/* ═══════════════════════════════════════════════════════════════
   MAJESTY CRM — Premium Design System
   Automotive-grade UI · Volvo × GWM
   ═══════════════════════════════════════════════════════════════ */

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
  /* Brand */
  --primary:        #1a56db;
  --primary-dark:   #1245b5;
  --primary-light:  #eff6ff;
  --primary-glow:   rgba(26,86,219,.15);

  /* Gold accent */
  --gold:           #b45309;
  --gold-light:     #fef3c7;

  /* Semantic aliases (used in templates) */
  --success:        #16a34a;
  --danger:         #dc2626;
  --text-secondary: #64748b;

  /* Sidebar */
  --sidebar-bg:     #0b1120;
  --sidebar-w:      252px;
  --sidebar-accent: #1a56db;

  /* Surface */
  --bg:             #f0f4f8;
  --bg-2:           #e8eef5;
  --surface:        #ffffff;
  --surface-2:      #f8fafc;

  /* Border */
  --border:         #e1e8f0;
  --border-strong:  #cbd5e1;

  /* Text */
  --text:           #0f172a;
  --text-2:         #334155;
  --text-muted:     #64748b;
  --text-faint:     #94a3b8;

  /* Brand colors */
  --volvo:          #003057;
  --gwm:            #c8102e;
  --green:          #16a34a;
  --orange:         #ea580c;
  --red:            #dc2626;

  /* Radius */
  --radius:         12px;
  --radius-sm:      8px;
  --radius-lg:      16px;

  /* Shadow scale */
  --shadow-xs:  0 1px 2px rgba(15,23,42,.06);
  --shadow:     0 1px 4px rgba(15,23,42,.08), 0 4px 12px rgba(15,23,42,.05);
  --shadow-md:  0 4px 16px rgba(15,23,42,.10), 0 1px 4px rgba(15,23,42,.06);
  --shadow-lg:  0 12px 40px rgba(15,23,42,.14), 0 2px 8px rgba(15,23,42,.06);

  /* Topbar */
  --topbar-h:       58px;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ───────────────────────────────────────────────────── */
body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR — Premium Dark
   ═══════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  background-image:
    radial-gradient(ellipse at 0% 0%, rgba(26,86,219,.18) 0%, transparent 60%),
    radial-gradient(ellipse at 100% 100%, rgba(180,83,9,.08) 0%, transparent 50%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 300;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  border-right: 1px solid rgba(255,255,255,.04);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.sidebar-logo {
  max-width: 155px;
  max-height: 50px;
  object-fit: contain;
  filter: brightness(1.1) drop-shadow(0 2px 6px rgba(0,0,0,.5));
}

.sidebar-nav {
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
  overflow-x: visible;
}

.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 99px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  color: #8fa3be;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: .01em;
  transition: background .18s, color .18s, transform .15s;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: #e2e8f0;
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(26,86,219,.9), rgba(26,86,219,.7));
  color: #fff;
  box-shadow: inset 3px 0 0 #60a5fa, 0 4px 14px rgba(26,86,219,.3);
}

.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}

.nav-divider {
  height: 1px;
  background: rgba(255,255,255,.06);
  margin: 8px 10px;
}

/* SPV nav item — gold highlight */
.nav-item-spv { border: 1px solid rgba(250,204,21,.15); }
.nav-item-spv:hover { background: rgba(250,204,21,.08) !important; color: #fbbf24 !important; }
.nav-item-spv.active {
  background: linear-gradient(135deg, #92400e, #78350f) !important;
  color: #fef3c7 !important;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(146,64,14,.3);
}

/* Brand logos at sidebar bottom */
.sidebar-brands {
  padding: 10px 16px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.brand-logo-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.brand-logo-divider {
  width: 1px; height: 26px;
  background: rgba(255,255,255,.12);
  flex-shrink: 0;
}

.sidebar-brand-logo {
  max-height: 20px; max-width: 75px;
  object-fit: contain;
}
.volvo-logo { opacity: .75; }
.gwm-logo   { max-height: 28px; max-width: 85px; opacity: .8; }

/* Overlay backdrop */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 299;
  backdrop-filter: blur(2px);
}

/* ═══════════════════════════════════════════════════════════════
   MAIN LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0 24px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 12px;
  box-shadow: 0 1px 0 rgba(15,23,42,.06), var(--shadow-xs);
}

.hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 8px; margin-left: -8px; border-radius: 9px;
  color: var(--text); font-size: 18px;
  transition: background .15s;
  flex-shrink: 0;
}
.hamburger:hover { background: var(--bg); }

.topbar-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }

.page-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -.01em;
}
.page-title i { color: var(--primary); flex-shrink: 0; font-size: 15px; }

.breadcrumb-link { color: var(--text-muted); text-decoration: none; }
.breadcrumb-link:hover { color: var(--primary); }

.topbar-right {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}

.topbar-date {
  color: var(--text-muted);
  font-size: 12.5px;
  display: flex; align-items: center; gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 5px 12px;
  font-weight: 500;
}

/* ── Content area ───────────────────────────────────────────── */
.content { padding: 22px 26px; flex: 1; }

/* ═══════════════════════════════════════════════════════════════
   FLASH MESSAGES
   ═══════════════════════════════════════════════════════════════ */
.flash-container { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }

.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  transition: opacity .3s;
  border: 1px solid transparent;
}

.flash-success {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  color: #15803d;
  border-color: #bbf7d0;
  box-shadow: var(--shadow-xs);
}
.flash-error {
  background: linear-gradient(135deg, #fff5f5, #fee2e2);
  color: #b91c1c;
  border-color: #fecaca;
  box-shadow: var(--shadow-xs);
}
.flash-close {
  margin-left: auto; background: none; border: none; cursor: pointer;
  font-size: 18px; opacity: .5; flex-shrink: 0;
  transition: opacity .15s;
}
.flash-close:hover { opacity: 1; }
.flash-wa-btn {
  display: inline-flex; align-items: center; gap: 6px; margin-left: 12px;
  background: #25d366; color: #fff; padding: 5px 14px; border-radius: 99px;
  font-size: .8rem; font-weight: 600; text-decoration: none;
  box-shadow: 0 2px 8px rgba(37,211,102,.3);
}
.flash-wa-btn:hover { background: #1ebe5a; }

/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;       /* fallback: clips border-radius */
  overflow: clip;         /* modern: clips visually BUT tidak blokir child scroll */
  margin-bottom: 18px;
  transition: box-shadow .2s;
}

.card-header {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--surface);
}

.card-header h2 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -.01em;
}

.card-body    { padding: 18px; }
.card-body.p0 { padding: 0; }
.card-footer  {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--surface-2);
}
.mt-4 { margin-top: 16px; }

/* ═══════════════════════════════════════════════════════════════
   STATS GRID — Premium Stat Cards
   ═══════════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  opacity: 0;
  transition: opacity .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card:hover::before { opacity: 1; }

.stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}

/* Icon colors — with gradient backgrounds */
.stat-icon.blue   { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1d4ed8; }
.stat-icon.purple { background: linear-gradient(135deg, #ede9fe, #ddd6fe); color: #7c3aed; }
.stat-icon.dark   { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); color: var(--volvo); }
.stat-icon.red    { background: linear-gradient(135deg, #fee2e2, #fecaca); color: var(--gwm); }
.stat-icon.green  { background: linear-gradient(135deg, #dcfce7, #bbf7d0); color: var(--green); }
.stat-icon.gold   { background: linear-gradient(135deg, #fef9c3, #fde68a); color: var(--gold); }
.stat-icon.orange { background: linear-gradient(135deg, #ffedd5, #fed7aa); color: #ea580c; }
.stat-icon.teal   { background: linear-gradient(135deg, #ccfbf1, #99f6e4); color: #0f766e; }
.stat-icon.indigo { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); color: #4338ca; }

.stat-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--text);
}
.stat-label { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; font-weight: 500; }

/* ═══════════════════════════════════════════════════════════════
   TABLES — Clean & Premium
   ═══════════════════════════════════════════════════════════════ */
.table-scroll {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch; /* iOS momentum scroll */
  touch-action: pan-x pan-y;         /* izinkan horizontal + vertical swipe */
  overscroll-behavior-x: contain;    /* scroll tidak bocor ke halaman */
}

.table {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px; min-width: 600px;
}

.table th {
  background: var(--surface-2);
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-2);
  white-space: nowrap;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f5f8ff; }

.table-footer {
  padding: 11px 18px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS — Refined & Premium
   ═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer; border: none; text-decoration: none;
  transition: all .18s cubic-bezier(.4,0,.2,1);
  white-space: nowrap;
  letter-spacing: .01em;
}

.btn-primary {
  background: linear-gradient(135deg, #1a56db, #1245b5);
  color: #fff;
  box-shadow: 0 2px 8px rgba(26,86,219,.3), 0 1px 2px rgba(26,86,219,.2);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1e63f5, #1a56db);
  box-shadow: 0 4px 16px rgba(26,86,219,.4), 0 1px 4px rgba(26,86,219,.2);
  transform: translateY(-1px);
  color: #fff;
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.btn-ghost:hover {
  background: var(--bg);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-wa {
  background: linear-gradient(135deg, #25d366, #20bd5c);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,211,102,.3);
}
.btn-wa:hover { box-shadow: 0 4px 14px rgba(37,211,102,.4); transform: translateY(-1px); color:#fff; }

.btn-sm  { padding: 6px 13px; font-size: 12.5px; }
.btn-link { font-size: 12.5px; color: var(--primary); text-decoration: none; background: none; border: none; cursor: pointer; font-weight: 600; }

.btn-icon {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 14px;
  padding: 7px 9px; border-radius: var(--radius-sm);
  transition: background .12s, color .12s, transform .12s;
}
.btn-icon:hover { background: var(--bg); color: var(--primary); transform: scale(1.05); }
.btn-icon.danger:hover { color: var(--red); background: #fff1f1; }

.actions { white-space: nowrap; }
.action-btns { display: flex; align-items: center; gap: 6px; }
.btn.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 6px; }

/* ═══════════════════════════════════════════════════════════════
   FORMS — Clean Premium Inputs
   ═══════════════════════════════════════════════════════════════ */
.form-layout { max-width: 760px; }

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group.required label::after { content: ' *'; color: var(--red); }
.form-group label { font-size: 12.5px; font-weight: 600; color: var(--text-2); letter-spacing: .01em; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-control {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
  -webkit-appearance: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
  background: #fff;
}
.form-control::placeholder { color: var(--text-faint); }
.form-control-sm { padding: 6px 10px; font-size: 13px; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── Search Bar ─────────────────────────────────────────────── */
.search-form { flex: 1; }

.search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  flex-wrap: wrap;
  transition: border-color .15s, box-shadow .15s;
}
.search-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.search-wrap > i { color: var(--text-muted); font-size: 13px; flex-shrink: 0; }
.search-input {
  border: none; background: transparent; outline: none;
  font-size: 14px; font-family: inherit; color: var(--text); flex: 1; min-width: 120px;
}

/* ═══════════════════════════════════════════════════════════════
   TAGS & BADGES
   ═══════════════════════════════════════════════════════════════ */
.brand-tag {
  display: inline-block;
  padding: 2px 9px; border-radius: 5px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .06em;
}
.tag-volvo { background: var(--volvo); color: #fff; }
.tag-gwm   { background: var(--gwm);   color: #fff; }

.status-badge {
  display: inline-block;
  padding: 3px 10px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.status-cold           { background: #dbeafe; color: #1d4ed8; }
.status-warm           { background: #ffedd5; color: #c2410c; }
.status-hotcustomer    { background: #fee2e2; color: #991b1b; }
.status-prospekbaru    { background: #dbeafe; color: #1d4ed8; }
.status-dihubungi      { background: #e0e7ff; color: #4338ca; }
.status-testdrive      { background: #fef9c3; color: #92400e; }
.status-negosiasi      { background: #ffedd5; color: #c2410c; }
.status-spk            { background: #dcfce7; color: #15803d; }
.status-delivered      { background: #166534; color: #fff; }
.status-aftersales     { background: #f0fdf4; color: #15803d; }
.status-tidakjadi      { background: #fee2e2; color: #991b1b; }

.td-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fef9c3; color: #92400e;
  padding: 2px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 700;
}

.badge-count {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  background: #ede9fe; color: #6d28d9;
  padding: 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 600;
  line-height: 1.4;
}

.badge-spk {
  display: inline-flex; align-items: center; white-space: nowrap;
  background: #dbeafe; color: #1d4ed8;
  padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600;
}
.badge-delivered {
  display: inline-flex; align-items: center; white-space: nowrap;
  background: #166534; color: #fff;
  padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   TOPBAR — User Chip & Logout
   ═══════════════════════════════════════════════════════════════ */
.topbar-user { display: flex; align-items: center; gap: 6px; }

.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 12px 5px 5px;
  border-radius: 99px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  text-decoration: none; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow-xs);
}
.user-chip:hover { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

.user-avatar {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--primary), #4f80f0);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.user-avatar-sm { width: 26px; height: 26px; font-size: 11px; }
.user-avatar-lg { width: 54px; height: 54px; font-size: 20px; }

.user-info { display: flex; flex-direction: column; line-height: 1.3; }
.user-name { font-size: 13px; font-weight: 700; color: var(--text); }
.user-role { font-size: 10.5px; color: var(--text-muted); text-transform: capitalize; font-weight: 500; }

.btn-logout {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 9px;
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: all .18s;
  box-shadow: var(--shadow-xs);
}
.btn-logout:hover { background: #fff1f1; color: var(--red); border-color: #fca5a5; }

/* ═══════════════════════════════════════════════════════════════
   FILTER BAR
   ═══════════════════════════════════════════════════════════════ */
.filter-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-xs);
}
.filter-form {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.filter-label {
  font-size: 12.5px; font-weight: 600; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
}
.periode-badge {
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  color: #4338ca;
  padding: 4px 12px; border-radius: 99px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.filter-active-bar {
  padding: 9px 18px;
  background: #eff6ff; color: #1d4ed8;
  border-bottom: 1px solid #bfdbfe;
  font-size: 13px; display: flex; align-items: center; gap: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD LOGO BANNER
   ═══════════════════════════════════════════════════════════════ */
.dashboard-logo-banner {
  background: linear-gradient(135deg, #0b1120 0%, #1a2e4e 50%, #0b1120 100%);
  border-radius: var(--radius);
  padding: 30px 32px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  min-height: 110px;
  position: relative;
  overflow: hidden;
}
.dashboard-logo-banner::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(26,86,219,.2) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(180,83,9,.12) 0%, transparent 50%);
}
.dashboard-logo {
  max-height: 68px; max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,.35));
  position: relative;
}

/* ═══════════════════════════════════════════════════════════════
   EMPTY STATES
   ═══════════════════════════════════════════════════════════════ */
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 56px 24px; color: var(--text-muted); text-align: center;
}
.empty-state i { font-size: 40px; opacity: .2; }
.empty-state p  { font-size: 14px; max-width: 280px; }

/* ═══════════════════════════════════════════════════════════════
   PIPELINE & PROGRESS BARS
   ═══════════════════════════════════════════════════════════════ */
.pipeline-row { margin-bottom: 14px; }
.pipeline-label {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.pipeline-count { font-weight: 700; font-size: 13px; color: var(--text); }

.progress-bar-wrap {
  background: var(--border);
  border-radius: 99px; height: 7px;
  overflow: hidden;
}
.progress-bar-fill {
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  height: 7px; border-radius: 99px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
  min-width: 3px;
}

/* Mini bars in tables */
.mini-bar-wrap {
  background: var(--border); border-radius: 99px; height: 5px;
  margin-bottom: 3px; width: 80px;
}
.mini-bar-fill { height: 5px; border-radius: 99px; min-width: 2px; }
.fill-green { background: linear-gradient(90deg, #22c55e, #16a34a); }
.fill-blue  { background: linear-gradient(90deg, var(--primary), #60a5fa); }
.fill-red   { background: linear-gradient(90deg, #ef4444, #dc2626); }
.fill-volvo { background: var(--volvo); }
.fill-gwm   { background: var(--gwm); }

.omzet-bar-wrap { background: var(--border); border-radius: 99px; height: 6px; margin-bottom: 3px; }
.omzet-bar-fill { background: linear-gradient(90deg, #22c55e, #16a34a); height: 6px; border-radius: 99px; min-width: 2px; }

.trend-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.trend-month { font-size: 12px; color: var(--text-muted); width: 55px; flex-shrink: 0; font-weight: 500; }
.trend-bar-wrap { flex: 1; background: var(--border); border-radius: 99px; height: 8px; overflow: hidden; }
.trend-bar-fill { background: linear-gradient(90deg, var(--primary), #60a5fa); height: 8px; border-radius: 99px; min-width: 2px; transition: width .5s; }
.trend-count { font-size: 12px; font-weight: 700; width: 24px; text-align: right; flex-shrink: 0; }

.brand-dist-row { margin-bottom: 16px; }
.brand-dist-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 7px; font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════════
   MODALS — Premium Sheet
   ═══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(11,17,32,.55);
  display: none; align-items: flex-end; justify-content: center;
  z-index: 400; padding: 0;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%; max-width: 100%;
  max-height: 92vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp .28s cubic-bezier(.4,0,.2,1);
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.modal-header h3 {
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 9px;
  letter-spacing: -.01em;
}
.modal-close {
  background: var(--bg); border: none; cursor: pointer;
  font-size: 20px; color: var(--text-muted); line-height: 1;
  padding: 6px 10px; border-radius: var(--radius-sm);
  transition: all .15s;
}
.modal-close:hover { background: var(--border); color: var(--text); }

.modal-body   { padding: 18px 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
  background: var(--surface-2);
}

/* ═══════════════════════════════════════════════════════════════
   CUSTOMER PROFILE
   ═══════════════════════════════════════════════════════════════ */
.profile-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex; align-items: flex-start; gap: 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}
.profile-avatar {
  width: 58px; height: 58px;
  background: linear-gradient(135deg, var(--primary), #4f80f0);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(26,86,219,.3);
}
.profile-info { flex: 1; min-width: 0; }
.profile-info h2 { font-size: 18px; font-weight: 800; margin-bottom: 8px; letter-spacing: -.02em; }
.profile-meta {
  display: flex; flex-wrap: wrap; gap: 10px;
  font-size: 13px; color: var(--text-muted);
}
.profile-meta span { display: flex; align-items: center; gap: 5px; }
.profile-note { margin-top: 8px; font-size: 13px; color: var(--text-muted); font-style: italic; }
.profile-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  align-items: start;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
}

/* ═══════════════════════════════════════════════════════════════
   LEAD CARDS
   ═══════════════════════════════════════════════════════════════ */
.lead-card {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.lead-card:last-child { border-bottom: none; }
.lead-card:hover { background: #f5f8ff; }
.lead-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; flex-wrap: wrap; gap: 6px;
}
.lead-card-meta {
  display: flex; flex-wrap: wrap; gap: 10px;
  font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px;
}
.lead-card-meta span { display: flex; align-items: center; gap: 4px; }
.lead-note { font-size: 13px; color: var(--text-muted); font-style: italic; margin-bottom: 8px; }
.lead-card-footer {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
}
.lead-actions { display: flex; gap: 6px; align-items: center; }

/* ═══════════════════════════════════════════════════════════════
   TIMELINE
   ═══════════════════════════════════════════════════════════════ */
.timeline { padding: 16px 18px; display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  display: flex; gap: 14px;
  padding-bottom: 22px; position: relative;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 7px; top: 18px; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--border), transparent);
}
.timeline-dot {
  width: 16px; height: 16px;
  background: var(--primary); border-radius: 50%;
  flex-shrink: 0; margin-top: 2px;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--primary), 0 2px 6px rgba(26,86,219,.3);
}
.timeline-content { flex: 1; min-width: 0; }
.timeline-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px; flex-wrap: wrap;
}
.timeline-type {
  background: #e0e7ff; color: #4338ca;
  padding: 2px 8px; border-radius: 5px;
  font-size: 11.5px; font-weight: 700;
}
.timeline-note { font-size: 13.5px; margin-bottom: 4px; word-break: break-word; }
.timeline-meta { font-size: 12px; }

/* ═══════════════════════════════════════════════════════════════
   TAB NAVIGATION
   ═══════════════════════════════════════════════════════════════ */
.tab-bar, .tab-nav {
  display: flex; gap: 4px;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px;
  box-shadow: var(--shadow-xs);
  flex-wrap: wrap;
  width: fit-content;
}
.tab-bar { width: auto; }

.tab-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none; background: none; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  transition: background .15s, color .15s;
  white-space: nowrap; font-family: inherit;
}
.tab-btn:hover  { background: var(--bg); color: var(--text); }
.tab-btn.active {
  background: linear-gradient(135deg, var(--primary), #1a65f0);
  color: #fff;
  box-shadow: 0 2px 8px rgba(26,86,219,.3);
}

.tab-count {
  background: rgba(255,255,255,.28); color: inherit;
  padding: 1px 7px; border-radius: 99px;
  font-size: 11px; font-weight: 700;
}
.tab-btn:not(.active) .tab-count { background: #e0e7ff; color: #4338ca; }
.tab-count-green { background: #dcfce7 !important; color: #15803d !important; }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ═══════════════════════════════════════════════════════════════
   SPK STYLES
   ═══════════════════════════════════════════════════════════════ */
.spk-status {
  display: inline-block;
  padding: 3px 11px; border-radius: 99px;
  font-size: 11.5px; font-weight: 700;
}
.spk-proses    { background: #dbeafe; color: #1d4ed8; }
.spk-ready     { background: #fef9c3; color: #92400e; }
.spk-delivered { background: linear-gradient(135deg, #166534, #15803d); color: #fff; }
.spk-cancel    { background: #fee2e2; color: #991b1b; }

.pay-badge {
  display: inline-block;
  padding: 2px 9px; border-radius: 5px;
  font-size: 11px; font-weight: 800;
}
.pay-cash   { background: #dcfce7; color: #15803d; }
.pay-kredit { background: #dbeafe; color: #1d4ed8; }

.nomor-spk {
  display: inline-block; margin-left: 8px;
  background: var(--bg); color: var(--text-muted);
  padding: 2px 9px; border-radius: 5px;
  font-size: 11px; border: 1px solid var(--border);
  font-family: 'Cascadia Code', 'Fira Code', monospace;
}

.spk-card {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.spk-card:last-child { border-bottom: none; }
.spk-card:hover { background: #f5f8ff; }
.spk-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; flex-wrap: wrap; gap: 6px;
}
.spk-card-meta {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px;
}
.spk-card-meta span { display: flex; align-items: center; gap: 5px; }
.spk-card-dates {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 12.5px; margin-bottom: 6px;
}
.spk-card-dates span { display: flex; align-items: center; gap: 5px; }

.radio-group { display: flex; gap: 12px; flex-wrap: wrap; }
.radio-option {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 18px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: border-color .15s, background .15s;
  font-size: 14px; font-weight: 600;
}
.radio-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
}
.radio-option input { display: none; }

.info-box {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.info-avatar {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), #4f80f0);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff; flex-shrink: 0;
}

.info-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; padding: 9px 0;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.info-row:last-child { border-bottom: none; }
.info-row > span:first-child { color: var(--text-muted); flex-shrink: 0; min-width: 80px; font-weight: 500; }

/* ═══════════════════════════════════════════════════════════════
   SPV DASHBOARD GRIDS
   ═══════════════════════════════════════════════════════════════ */
.spv-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.spv-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; margin-bottom: 18px; }

/* SPV DO items */
.do-item {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.do-item:last-child { border-bottom: none; }
.do-item:hover { background: #fffbeb; }
.do-item-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.do-item-action { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* Stock summary */
.stock-summary-row { display: flex; gap: 16px; }
.stock-sum-item {
  flex: 1; text-align: center; padding: 18px 10px;
  border-radius: 10px;
}
.stock-sum-item.green { background: linear-gradient(135deg, #f0fdf4, #dcfce7); }
.stock-sum-item.blue  { background: linear-gradient(135deg, #eff6ff, #dbeafe); }
.stock-sum-val  { font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.stock-sum-lbl  { font-size: 12px; margin-top: 5px; color: var(--text-muted); font-weight: 500; }
.stock-sum-item.green .stock-sum-val { color: #15803d; }
.stock-sum-item.blue  .stock-sum-val { color: #1d4ed8; }

.do-confirm-info {
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 13px 15px; border: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════════
   STOCK / INVENTORY
   ═══════════════════════════════════════════════════════════════ */
.stock-status {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 99px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.stock-tersedia { background: linear-gradient(135deg, #dcfce7, #bbf7d0); color: #15803d; }
.stock-dispk    { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1d4ed8; }
.stock-terjual  { background: linear-gradient(135deg, #1e293b, #334155); color: #e2e8f0; }

.badge-plat { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 800; }
.plat-nasional { background: #fef9c3; color: #854d0e; }
.plat-ftz      { background: #ede9fe; color: #5b21b6; }

.rangka-code {
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  font-size: 12px; letter-spacing: 1.5px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 5px; padding: 2px 9px; color: var(--text-2);
}

.row-dispk         { background: rgba(220, 38, 38, 0.18) !important; border-left: 3px solid rgba(220, 38, 38, 0.6) !important; }
.row-dispk:hover   { background: rgba(220, 38, 38, 0.28) !important; }
.row-dispk td      { background: transparent !important; }
.row-terjual       { background: rgba(0, 0, 0, 0.22) !important; border-left: 3px solid rgba(0, 0, 0, 0.5) !important; }
.row-terjual:hover { background: rgba(0, 0, 0, 0.30) !important; }
.row-terjual td    { opacity: .70; background: transparent !important; }

.stock-unit-info {
  display: flex; align-items: center; gap: 8px;
  background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: 7px; padding: 9px 13px;
  margin-top: 6px; font-size: 13px; color: #1d4ed8; font-weight: 500;
}
.netto-display {
  font-size: 19px; font-weight: 800;
  padding: 11px 16px;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid #86efac;
  border-radius: var(--radius-sm);
  letter-spacing: -0.02em;
}
.indent-info-box {
  display: flex; align-items: flex-start; gap: 10px;
  background: #fef9c3; border: 1px solid #fde047;
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 13px; color: #713f12; margin-top: 4px;
}
.indent-info-box i { color: #ca8a04; margin-top: 1px; flex-shrink: 0; }
.badge-indent {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fef9c3; color: #713f12;
  border: 1px solid #fde047; border-radius: 5px;
  padding: 2px 7px; font-size: 11px; font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   ROLE BADGES
   ═══════════════════════════════════════════════════════════════ */
.role-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 11px; border-radius: 99px;
  font-size: 12px; font-weight: 700;
}
.role-pic        { background: #fef3c7; color: #92400e; }
.role-manager    { background: #ede9fe; color: #5b21b6; }
.role-supervisor { background: #dcfce7; color: #166534; }
.role-admin      { background: #e0f2fe; color: #075985; }
.role-sales      { background: #dbeafe; color: #1d4ed8; }

/* ═══════════════════════════════════════════════════════════════
   MARGIN & PROFIT
   ═══════════════════════════════════════════════════════════════ */
.hpp-form { margin-bottom: 4px; }
.pct-badge {
  display: inline-block; padding: 2px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 700;
}
.pct-good { background: #dcfce7; color: #15803d; }
.pct-low  { background: #fef9c3; color: #854d0e; }
.program-summary-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.program-summary-row:last-child { border-bottom: none; }
.profit-total-box {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 2px solid var(--primary);
  border-radius: var(--radius); padding: 18px 22px; margin-top: 18px;
  flex-wrap: wrap;
  box-shadow: 0 4px 16px rgba(26,86,219,.1);
}

/* ═══════════════════════════════════════════════════════════════
   DUPLICATE WA ALERT
   ═══════════════════════════════════════════════════════════════ */
.dup-alert {
  display: flex; align-items: flex-start; gap: 12px;
  background: #fff7ed; border: 1px solid #fed7aa;
  border-radius: var(--radius); padding: 15px 18px;
  margin-bottom: 16px; color: #9a3412;
}
.dup-alert > i { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.dup-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.dup-item {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid #fed7aa;
  border-radius: 7px; padding: 6px 12px;
  text-decoration: none; color: #9a3412; font-size: 13px;
  transition: background .12s;
}
.dup-item:hover { background: #fef3c7; }

/* Rupiah input wrapper */
.input-rp-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  transition: border-color .15s;
}
.input-rp-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.1);
}
.input-rp-prefix {
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg);
  border-right: 1.5px solid var(--border);
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  user-select: none;
}
.input-rp-wrap .form-control {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  flex: 1;
}
.input-rp-wrap .form-control:focus {
  border: none !important;
  box-shadow: none !important;
}

.input-with-check { position: relative; }
.input-with-check .form-control { padding-right: 36px; }
.check-icon {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%); font-size: 15px;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   CODE & UTILITY
   ═══════════════════════════════════════════════════════════════ */
code {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 5px; padding: 2px 7px; font-size: 12px;
  font-family: 'Cascadia Code', 'Fira Code', monospace;
}

.text-muted   { color: var(--text-muted); }
.text-sm      { font-size: 12px; }
.text-red     { color: var(--red); }
.text-orange  { color: var(--orange); }
.text-blue    { color: #2563eb; }
.text-purple  { color: #7c3aed; }
.text-green   { color: var(--green); }
.text-gold    { color: var(--gold); }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.flex-row     { display: flex; }
.flex-wrap    { flex-wrap: wrap; }
.align-center { align-items: center; }
.gap-2        { gap: 8px; }
.green-light  { background: #dcfce7; color: var(--green); }
.mt-4         { margin-top: 16px; }

.link-name { color: var(--primary); text-decoration: none; font-weight: 600; }
.link-name:hover { text-decoration: underline; }
.wa-link { color: #16a34a; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.wa-link:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════════
   LOGIN PAGE — Luxury
   ═══════════════════════════════════════════════════════════════ */
body.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 25% 25%, rgba(26,86,219,.25) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 75%, rgba(180,83,9,.15) 0%, transparent 50%),
    linear-gradient(135deg, #0b1120 0%, #162240 50%, #0b1120 100%);
}
.login-wrapper { width: 100%; max-width: 420px; padding: 20px; }
.login-card {
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.2);
  padding: 40px 36px;
  border: 1px solid rgba(255,255,255,.08);
}
.login-brand {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  margin-bottom: 20px;
}
.login-logo-wrap {
  background: linear-gradient(135deg, #0b1120, #1a2e4e);
  border-radius: 14px;
  padding: 20px 32px;
  display: flex; align-items: center; justify-content: center;
  width: 100%; margin-bottom: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.login-brand-logo { max-width: 200px; max-height: 68px; object-fit: contain; }
.login-brands { display: flex; gap: 8px; margin-bottom: 28px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-input { font-size: 15px; }
.input-icon-wrap { position: relative; display: flex; align-items: center; }
.input-icon-wrap .form-control { padding-left: 40px; padding-right: 38px; }
.input-icon { position: absolute; left: 13px; color: var(--text-muted); font-size: 14px; pointer-events: none; }
.pw-toggle {
  position: absolute; right: 10px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 14px; padding: 4px;
  border-radius: 5px; transition: color .15s;
}
.pw-toggle:hover { color: var(--primary); }
.btn-block { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }
.login-footer { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 24px; }
.login-brand-logo { max-width: 200px; max-height: 70px; object-fit: contain; }
.login-logo { width: 48px; height: 48px; background: linear-gradient(135deg, var(--primary), #4f80f0); border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; color: #fff; }
.login-brand-name { font-size: 20px; font-weight: 800; letter-spacing: 2px; color: var(--text); }
.login-brand-sub  { font-size: 11px; color: var(--text-muted); letter-spacing: .5px; }
.login-brand-text { display: flex; flex-direction: column; }

/* ═══════════════════════════════════════════════════════════════
   MOBILE BOTTOM NAV
   ═══════════════════════════════════════════════════════════════ */
.mobile-nav { display: none; }

.mobile-nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; padding: 6px 4px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 10px; font-weight: 600;
  transition: color .15s;
  border: none; background: none; cursor: pointer;
  position: relative;
}
.mobile-nav-item i { font-size: 19px; }
.mobile-nav-item.active { color: var(--primary); }
.mobile-nav-item.active::after {
  content: '';
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 24px; height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}
.mobile-nav-item span { font-size: 10px; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet ≤ 900px
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .detail-grid    { grid-template-columns: 1fr; }
  .spv-grid       { grid-template-columns: 1fr; }
  .spv-grid-3     { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile ≤ 768px
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 268px;
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-overlay.open { display: block; }

  .main-wrapper { margin-left: 0; }
  .hamburger { display: flex; align-items: center; justify-content: center; }

  .topbar { padding: 0 14px; }
  .topbar-date { display: none; }
  .page-title { font-size: 15px; }

  .content { padding: 12px 12px; padding-bottom: 84px; }

  /* ── Stats ── */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
  .stat-card  { padding: 13px 12px; gap: 10px; }
  .stat-icon  { width: 38px; height: 38px; font-size: 16px; border-radius: 10px; }
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 11px; }

  /* ── Cards ── */
  .card {
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    overflow: visible; /* iOS Safari: jangan blokir child horizontal scroll */
  }
  /* Pertahankan radius pada first/last child card */
  .card > .card-header:first-child {
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  }
  .card > .card-footer:last-child,
  .card > .card-body:last-child {
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  }
  .card-header { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
  .card-body   { padding: 13px; }
  .card-footer { padding: 12px 14px; }

  /* Card header action groups — always wrap on mobile */
  .card-header > div[style*="display:flex"],
  .card-header > div[style*="display: flex"] {
    flex-wrap: wrap;
  }

  /* ── Forms ── */
  .form-row    { grid-template-columns: 1fr; gap: 0; }
  .form-layout { max-width: 100%; }

  /* 🔴 iOS Safari auto-zoom fix: ALL inputs must be ≥ 16px */
  .form-control,
  .form-control-sm,
  .search-input,
  select.form-control,
  textarea.form-control,
  input[type="text"],
  input[type="number"],
  input[type="tel"],
  input[type="date"],
  input[type="email"],
  input[type="password"],
  select {
    font-size: 16px !important;
  }
  /* Keep label and helper text small */
  .form-group label { font-size: 13px; }

  /* ── Search wrap ── mobile stacks items */
  .search-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }
  .search-wrap > i.fa-magnifying-glass { display: none; }
  .search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: 16px !important;
  }
  .search-wrap .form-control-sm {
    width: 100%;
    padding: 10px 12px;
  }
  /* Filter & action buttons in search row */
  .search-wrap .btn {
    width: 100%;
    justify-content: center;
  }

  /* ── Touch targets — minimum 44px ── */
  .btn        { min-height: 44px; }
  .btn-sm     { min-height: 38px; padding: 8px 14px; }
  .btn-icon   { min-width: 44px; min-height: 44px; padding: 10px; font-size: 16px; }
  .tab-btn    { min-height: 40px; }
  .nav-item   { min-height: 44px; }

  /* Action buttons in tables */
  .action-btns { gap: 4px; }

  /* ── Profile ── */
  .profile-header { flex-direction: column; gap: 12px; }
  .profile-actions { width: 100%; }
  .profile-actions .btn { flex: 1; justify-content: center; }

  /* ── Modal ── */
  .modal { border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 95vh; }
  .modal-footer .btn { flex: 1; justify-content: center; }
  /* Modal overlay should center on large content */
  .modal-overlay { padding-top: 60px; }

  /* ── Tabs ── */
  .tab-bar, .tab-nav { padding: 4px; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .tab-btn { padding: 8px 12px; font-size: 13px; white-space: nowrap; min-height: 40px; }

  /* ── SPV & misc ── */
  .mini-bar-wrap { width: 60px; }
  .radio-group   { flex-direction: column; }
  .radio-option  { padding: 12px 14px; min-height: 44px; }
  .info-row > span:first-child { min-width: 70px; }
  .filter-form   { gap: 8px; }
  .filter-form select { flex: 1; min-width: 120px; }

  .stock-summary-row { flex-direction: column; gap: 10px; }
  .do-item { flex-direction: column; gap: 8px; }
  .do-item-action { align-items: flex-start; flex-direction: row; flex-wrap: wrap; gap: 8px; }

  /* ── Table: mobile scroll ── */
  .table-scroll {
    position: static; /* jangan relative, bisa ganggu scroll context */
    scroll-snap-type: none;
  }

  /* ── Mobile bottom nav ── */
  .mobile-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,.97);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 200;
    padding: 4px 0 env(safe-area-inset-bottom, 4px);
    box-shadow: 0 -4px 20px rgba(15,23,42,.08);
  }
  .mobile-nav-item { min-height: 48px; }

  .dashboard-logo-banner { padding: 20px 16px; min-height: 80px; }
  .dashboard-logo { max-height: 50px; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — Small Mobile ≤ 420px
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 20px; }
  .page-title { font-size: 14px; }
  .btn { font-size: 13px; padding: 8px 13px; }
  .btn-sm { padding: 6px 10px; font-size: 12px; }
  .user-info { display: none; }
  .user-chip { padding: 4px; }
}

/* ═══════════════════════════════════════════════════════════════
   DESKTOP MODAL — Centered
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 769px) {
  .modal-overlay { align-items: center; padding: 20px; }
  .modal { border-radius: var(--radius-lg); max-width: 560px; }
}
