/*
 * MINATI DESIGN SYSTEM — Central Theme Tokens
 * ============================================
 * File ini berisi CSS variables untuk kontrol tema terpusat.
 * Semua file CSS lain (minati-theme.css, minati.css, dll) TETAP DILOAD.
 * File ini di-load PERTAMA, sebelum file CSS lain.
 *
 * CARA GANTI TEMA: Edit variabel di section :root di bawah.
 * Semua komponen di seluruh aplikasi otomatis ikut berubah.
 */

/* ── DESIGN TOKENS — Edit di sini untuk ganti tema ───── */
:root {
  /* === WARNA BRAND === */
  --m-primary:       #1e9aa0;   /* teal utama — ubah ini untuk ganti warna brand */
  --m-primary-dark:  #0f5f6b;   /* teal gelap — sidebar, hero background */
  --m-primary-light: #eef7f8;   /* teal sangat muda — background soft */
  --m-primary-mid:   #3dbdc2;   /* teal menengah — gradient end */

  --m-accent:        #f5be2f;   /* kuning/amber — tombol CTA utama */
  --m-accent-dark:   #d08000;   /* amber gelap — hover state */
  --m-accent-light:  #fff8e1;   /* amber muda — background accent */

  /* === WARNA NEUTRAL === */
  --m-text:          #10283c;   /* teks utama */
  --m-muted:         #607286;   /* teks sekunder */
  --m-hint:          #9ab0bb;   /* placeholder, hint */
  --m-surface:       #ffffff;   /* background card/panel */
  --m-soft:          #eef7f8;   /* background halaman customer */
  --m-stroke:        #cde4e6;   /* border warna */
  --m-border-soft:   rgba(18, 55, 71, 0.07); /* border transparan */

  /* === WARNA SEMANTIK === */
  --m-success:       #27ae60;
  --m-success-bg:    #ecfdf5;
  --m-success-bd:    #b7e9c9;
  --m-success-text:  #065f46;

  --m-warning:       #d08000;
  --m-warning-bg:    #fff8e1;
  --m-warning-bd:    #f5d87a;
  --m-warning-text:  #7a4800;

  --m-danger:        #e24b4a;
  --m-danger-bg:     #fff1f2;
  --m-danger-bd:     #fecdd3;
  --m-danger-text:   #be123c;

  --m-info-bg:       #ecfeff;
  --m-info-bd:       #a5f3fc;
  --m-info-text:     #0f766e;

  /* === TYPOGRAPHY === */
  --m-font:          Arial, Helvetica, sans-serif;
  --m-font-size:     14px;

  /* === RADIUS === */
  --m-radius-sm:     8px;
  --m-radius-md:     12px;
  --m-radius-lg:     16px;
  --m-radius-xl:     20px;
  --m-radius-2xl:    24px;
  --m-radius-pill:   999px;

  /* === SHADOWS === */
  --m-shadow:        0 14px 40px rgba(15, 95, 107, 0.10);
  --m-shadow-soft:   0 6px 20px rgba(15, 95, 107, 0.07);
  --m-shadow-sm:     0 2px 8px rgba(15, 95, 107, 0.06);

  /* === GRADIENTS === */
  --m-grad-primary:  linear-gradient(135deg, var(--m-primary-dark), var(--m-primary));
  --m-grad-accent:   linear-gradient(135deg, var(--m-accent-dark), var(--m-accent));
  --m-grad-sidebar:  linear-gradient(180deg, #0c5462 0%, #14737a 100%);
  --m-grad-bg:       linear-gradient(180deg, #f6fbfb 0%, var(--m-soft) 100%);

  /* === SIZES === */
  --m-max:           1220px;
  --m-max-admin:     1320px;
  --m-max-customer:  600px;
  --m-sidebar-width: 292px;
}

/* ── SVG ICON FIX — Global (mencegah black blob) ─────── */
/*
 * Semua SVG icon di MINATI menggunakan stroke-based drawing.
 * Tanpa ini, browser default fill=black sehingga icon jadi kotak hitam.
 */
svg[viewBox="0 0 24 24"]:not(.minati-logo-svg):not([fill]) {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

/* Nav icons, button icons, badge icons */
.nav-ico svg,
.btn-ico svg,
.minati-btn svg,
.enterprise-nav svg,
.enterprise-icon svg,
.minati-bottom-nav svg,
.minati-feature-icon svg,
.minati-check-item > svg,
.enterprise-actions svg,
.minati-eyebrow svg,
.section-title svg,
.minati-kpi svg,
.minati-stat svg,
.minati-inline-actions svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── EXTENDED BUTTON VARIANTS ─────────────────────────── */
/* Compat: .btn.primary sama dengan .minati-btn.primary */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: var(--m-radius-lg);
  border: 1.5px solid var(--m-stroke);
  background: var(--m-surface);
  color: var(--m-muted);
  font-size: 13px;
  font-weight: 700;
  font-family: var(--m-font);
  cursor: pointer;
  text-decoration: none;
  transition: opacity .12s, transform .1s;
  white-space: nowrap;
  line-height: 1;
}
.btn svg {
  width: 15px; height: 15px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}
.btn:hover  { opacity: .88; }
.btn:active { transform: scale(.98); }
.btn-primary {
  background: var(--m-grad-accent);
  border-color: var(--m-accent-dark);
  color: #3a2b00;
}
.btn-teal {
  background: var(--m-grad-primary);
  border-color: transparent;
  color: #fff;
}
.btn-success {
  background: var(--m-success-bg);
  border-color: var(--m-success-bd);
  color: var(--m-success-text);
}
.btn-danger {
  background: var(--m-danger-bg);
  border-color: var(--m-danger-bd);
  color: var(--m-danger-text);
}
.btn-ghost  { background: transparent; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 12px; border-radius: var(--m-radius-md); }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 15px; border-radius: var(--m-radius-xl); }
.btn-full { width: 100%; justify-content: center; }

/* ── INPUT — Centralized focus state ─────────────────── */
.input,
input.input,
select.input,
textarea.input {
  width: 100%;
  border: 1.5px solid var(--m-stroke);
  border-radius: var(--m-radius-md);
  padding: 10px 13px;
  font-size: var(--m-font-size);
  font-family: var(--m-font);
  color: var(--m-text);
  background: var(--m-surface);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
  -webkit-appearance: none;
}
.input:focus,
input.input:focus,
select.input:focus,
textarea.input:focus {
  border-color: var(--m-primary);
  box-shadow: 0 0 0 3px rgba(30, 154, 160, 0.10);
}
.input:disabled {
  background: var(--m-soft);
  color: var(--m-hint);
  cursor: not-allowed;
}

/* ── CARD VARIANTS ────────────────────────────────────── */
.card {
  background: var(--m-surface);
  border: 1px solid var(--m-stroke);
  border-radius: var(--m-radius-xl);
  padding: 20px;
  box-shadow: var(--m-shadow-soft);
}
.card-flat { box-shadow: none; }
.card-soft { background: var(--m-soft); }

/* ── SECTION TITLE ────────────────────────────────────── */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--m-border-soft);
  margin-bottom: 16px;
}
.section-title .h3 { font-size: 16px; font-weight: 800; color: var(--m-text); }

/* ── ICO-BOX (icon berwarna di dalam kotak) ───────────── */
.ico-box {
  width: 40px; height: 40px;
  border-radius: var(--m-radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ico-box svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.ico-box.teal   { background: rgba(30, 154, 160, 0.10); color: var(--m-primary-dark); }
.ico-box.amber  { background: rgba(245, 190, 47, 0.12); color: var(--m-accent-dark); }
.ico-box.green  { background: rgba(39, 174, 96, 0.10);  color: #1a7a43; }
.ico-box.red    { background: rgba(226, 75, 74, 0.10);  color: var(--m-danger-text); }
.ico-box.blue   { background: rgba(37, 99, 235, 0.08);  color: #1d4ed8; }
.ico-box.purple { background: rgba(124, 58, 237, 0.08); color: #5b21b6; }

/* ── BADGE VARIANTS ───────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--m-radius-pill);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-success { background: var(--m-success-bg); color: var(--m-success-text); border-color: var(--m-success-bd); }
.badge-warning { background: var(--m-warning-bg); color: var(--m-warning-text); border-color: var(--m-warning-bd); }
.badge-danger  { background: var(--m-danger-bg);  color: var(--m-danger-text);  border-color: var(--m-danger-bd);  }
.badge-info    { background: var(--m-info-bg);    color: var(--m-info-text);    border-color: var(--m-info-bd);    }
.badge-neutral { background: #f0f4f8; color: #475467; border-color: #e5e7eb; }
.badge-teal    { background: var(--m-primary-light); color: var(--m-primary-dark); border-color: var(--m-stroke); }

/* ── ALERT VARIANTS ───────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--m-radius-lg);
  border: 1px solid;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.alert-ok   { background: var(--m-success-bg); border-color: var(--m-success-bd); color: var(--m-success-text); }
.alert-err  { background: var(--m-danger-bg);  border-color: var(--m-danger-bd);  color: var(--m-danger-text);  }
.alert-warn { background: var(--m-warning-bg); border-color: var(--m-warning-bd); color: var(--m-warning-text); }
.alert-info { background: var(--m-info-bg);    border-color: var(--m-info-bd);    color: var(--m-info-text);    }

/* ── KPI CARD ─────────────────────────────────────────── */
.kpi-card {
  background: var(--m-surface);
  border: 1px solid var(--m-stroke);
  border-radius: var(--m-radius-xl);
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: box-shadow .12s, transform .1s;
  text-decoration: none;
  color: inherit;
}
.kpi-card:hover { box-shadow: var(--m-shadow); transform: translateY(-1px); }
.kpi-card.urgent .kpi-value { color: var(--m-danger); }
.kpi-body    { flex: 1; min-width: 0; }
.kpi-label   { font-size: 11px; color: var(--m-muted); font-weight: 700; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value   { font-size: 26px; font-weight: 900; color: var(--m-text); line-height: 1; }
.kpi-value.money { font-size: 20px; }
.kpi-sub     { font-size: 11px; color: var(--m-hint); margin-top: 3px; }

/* ── LAYOUT HELPERS ───────────────────────────────────── */
.stack   { display: flex; flex-direction: column; }
.stack-2 { display: flex; flex-direction: column; gap: 8px; }
.stack-3 { display: flex; flex-direction: column; gap: 12px; }
.stack-4 { display: flex; flex-direction: column; gap: 16px; }
.row     { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.flex-1  { flex: 1; min-width: 0; }
.w-full  { width: 100%; }
.grid-2  { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3  { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-4  { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.full    { grid-column: 1 / -1; }
.center  { text-align: center; }
.muted   { color: var(--m-muted); }
.hint    { color: var(--m-hint); font-size: 11px; line-height: 1.4; }
.h1 { font-size: 32px; font-weight: 900; color: var(--m-text); line-height: 1.1; }
.h2 { font-size: 24px; font-weight: 900; color: var(--m-text); line-height: 1.1; }
.h3 { font-size: 18px; font-weight: 900; color: var(--m-text); }

/* ── FORM GRID ────────────────────────────────────────── */
.form-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-grid .full, .form-grid-3 .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; }
.label { font-size: 12px; font-weight: 700; color: #3a5a6a; }
.label .req { color: var(--m-danger); margin-left: 2px; }
.label .opt { font-weight: 400; color: var(--m-hint); }

/* ── UPLOAD ZONE ──────────────────────────────────────── */
.upload-zone {
  border: 1.5px dashed var(--m-stroke);
  border-radius: var(--m-radius-lg);
  padding: 14px;
  text-align: center;
  background: var(--m-soft);
}
.upload-zone label { display: block; font-size: 13px; font-weight: 700; color: #3a5a6a; margin-bottom: 8px; }
.upload-zone input[type=file] { font-size: 13px; }

/* ── EMPTY STATE ──────────────────────────────────────── */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 20px;
  text-align: center;
  color: var(--m-hint);
}
.empty svg   { width: 40px; height: 40px; stroke: var(--m-stroke); fill: none; stroke-width: 1.5; margin: 0 auto; }
.empty p     { font-size: 13px; line-height: 1.5; max-width: 280px; }
.empty-title { font-size: 15px; font-weight: 700; color: var(--m-muted); }

/* ── FILTER TABS ──────────────────────────────────────── */
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-tab {
  padding: 7px 14px;
  border-radius: var(--m-radius-pill);
  border: 1.5px solid var(--m-stroke);
  background: var(--m-surface);
  color: var(--m-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all .12s;
}
.filter-tab:hover, .filter-tab.active {
  background: var(--m-primary-dark);
  color: #fff;
  border-color: transparent;
}

/* ── AVATAR ───────────────────────────────────────────── */
.avatar    { border-radius: 50%; object-fit: cover; flex-shrink: 0; display: block; }
.avatar-sm { width: 32px;  height: 32px; }
.avatar-md { width: 44px;  height: 44px; }
.avatar-lg { width: 64px;  height: 64px; }
.avatar-xl { width: 88px;  height: 88px; }

/* Constrain existing avatar classes that were oversized */
.enterprise-avatar,
.enterprise-avatar.img,
img.enterprise-avatar {
  width: 48px !important;
  height: 48px !important;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.enterprise-avatar.mini { width: 26px !important; height: 26px !important; }
.profile-avatar, img.profile-avatar, .profile-avatar.xl {
  max-width: 88px !important;
  max-height: 88px !important;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

/* ── TIMELINE ─────────────────────────────────────────── */
.timeline      { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(18,55,71,.05); }
.timeline-item:last-child { border-bottom: none; }
.timeline-dot  { width: 8px; height: 8px; border-radius: 50%; background: var(--m-primary); flex-shrink: 0; margin-top: 5px; }
.timeline-body { flex: 1; min-width: 0; }
.timeline-title{ font-size: 13px; font-weight: 700; color: var(--m-text); }
.timeline-meta { font-size: 11px; color: var(--m-hint); margin-top: 2px; }
.timeline-desc { font-size: 12px; color: var(--m-muted); margin-top: 3px; line-height: 1.5; }

/* ── NOTE / CALLOUT ───────────────────────────────────── */
.note { padding: 12px 14px; border-radius: var(--m-radius-md); background: var(--m-soft); border: 1px solid var(--m-stroke); font-size: 12px; color: var(--m-muted); line-height: 1.5; }
.note-warning { background: var(--m-warning-bg); border-color: var(--m-warning-bd); color: var(--m-warning-text); }
.note-danger  { background: var(--m-danger-bg);  border-color: var(--m-danger-bd);  color: var(--m-danger-text);  }

/* ── PHOTO GRID ───────────────────────────────────────── */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.photo-item { border: 1px solid var(--m-stroke); border-radius: var(--m-radius-md); overflow: hidden; text-decoration: none; }
.photo-item img { width: 100%; height: 80px; object-fit: cover; display: block; }
.photo-meta { padding: 5px 8px; font-size: 11px; color: var(--m-muted); }

/* ── RESPONSIVE HELPERS ───────────────────────────────── */
@media (max-width: 700px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid, .form-grid-3  { grid-template-columns: 1fr; }
  .btn-full-mobile { width: 100%; justify-content: center; }
}

/* ── PRINT ────────────────────────────────────────────── */
@media print {
  .enterprise-sidebar, .minati-bottom-nav, .bottom-nav,
  button, .minati-btn, .btn,
  .enterprise-actions, .enterprise-mobile-toggle { display: none !important; }
  .enterprise-shell, .enterprise-main { display: block !important; }
  .card, .kpi-card, .minati-card { box-shadow: none !important; border: 1px solid #ddd !important; }
  body { background: white !important; }
}

/* ============================================================
   CUSTOMER PAGE STANDARD WRAPPER
   Semua halaman customer WAJIB pakai .customer-page-wrap
   Max-width 600px — konsisten mobile-first di semua halaman
   ============================================================ */
.customer-page-wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px 16px 88px;
  min-height: 100vh;
}
.customer-flash {
  margin-bottom: 14px;
}
/* Override minati-wrap untuk customer — pastikan tidak pakai max-width lebar */
.customer-page-wrap .minati-wrap {
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0;
}
/* Semua tombol di customer: tidak full-width kecuali diminta */
.customer-page-wrap .minati-btn {
  width: auto;
}
.customer-page-wrap .minati-btn.block,
.customer-page-wrap .btn-full {
  width: 100%;
}
