/* ===================================================================
   WEDDING PLANNER — DESIGN SYSTEM
   Palette terinspirasi warna upacara adat Indonesia: marun, emas antik,
   sage — bukan palet "AI generik" cream+terracotta.
   Font: Fraunces (display) + Plus Jakarta Sans (body, dibuat di Jakarta)
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,500;0,9..144,600;0,9..144,700;0,9..144,900;1,9..144,600&family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,500&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
  /* --- Warna --- */
  --bg: #F6F0E4;
  --surface: #FFFFFF;
  --surface-soft: #FBF7EF;
  --ink: #241A16;
  --ink-soft: #6E6156;
  --ink-faint: #A69A8C;

  --maroon: #6E1E24;
  --maroon-dark: #4A1418;
  --maroon-tint: #F3E3E1;

  --gold: #B0863A;
  --gold-dark: #8C6A2C;
  --gold-tint: #F1E4C4;

  --sage: #52603F;
  --sage-tint: #E5EAD7;

  --danger: #A33B2E;
  --danger-tint: #F3E0DC;

  --line: #E7DBC3;
  --line-soft: #F0E6D2;

  /* --- Tipografi --- */
  --font-display: 'Fraunces', serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* --- Radius --- */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-full: 999px;

  /* --- Bayangan --- */
  --shadow-sm: 0 1px 3px rgba(36, 26, 22, 0.07);
  --shadow-md: 0 6px 20px rgba(36, 26, 22, 0.09);
  --shadow-lg: 0 16px 40px rgba(36, 26, 22, 0.14);

  /* --- Spasi --- */
  --sp-1: 4px;  --sp-2: 8px;   --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px;  --sp-7: 48px;  --sp-8: 64px;

  /* --- Layout --- */
  --sidebar-w: 264px;
  --topbar-h: 72px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ===================== RESET ===================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; color: var(--ink); font-weight: 600; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2.5px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* ===================== UTIL ===================== */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); } .gap-5 { gap: var(--sp-5); }
.text-muted { color: var(--ink-soft); }
.text-faint { color: var(--ink-faint); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11.5px; }
.mono { font-family: var(--font-mono); }
.hide-mobile { display: none; }
.w-full { width: 100%; }

/* ===================== AUTH SHELL (login/setup) ===================== */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  background:
    radial-gradient(circle at 15% 20%, rgba(176,134,58,0.10), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(110,30,36,0.08), transparent 45%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-7) var(--sp-6) var(--sp-6);
  border: 1px solid var(--line-soft);
  animation: riseIn 0.5s ease both;
}
.auth-brand {
  text-align: center;
  margin-bottom: var(--sp-6);
}
.auth-brand .seal-mini {
  width: 56px; height: 56px; margin: 0 auto var(--sp-3);
}
.auth-brand h1 {
  font-size: 26px;
  letter-spacing: -0.01em;
}
.auth-brand p {
  color: var(--ink-soft);
  font-size: 13.5px;
  margin-top: var(--sp-1);
}
.auth-tabs { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-5); background: var(--surface-soft); padding: 4px; border-radius: var(--r-full); border: 1px solid var(--line-soft); }
.auth-tab { flex: 1; text-align: center; padding: 9px 12px; border-radius: var(--r-full); font-size: 13.5px; font-weight: 600; color: var(--ink-soft); background: transparent; border: none; }
.auth-tab.active { background: var(--maroon); color: #fff; box-shadow: var(--shadow-sm); }

/* ===================== FORM ===================== */
.field { margin-bottom: var(--sp-4); }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--ink-faint); margin-top: 5px; }
.input, .select, .textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  background: var(--surface-soft);
  border-radius: var(--r-sm);
  padding: 11px 13px;
  font-size: 14.5px;
  color: var(--ink);
  transition: border-color .15s ease, background .15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--gold);
  background: var(--surface);
  outline: none;
}
.textarea { resize: vertical; min-height: 80px; }
.input-row { display: flex; gap: var(--sp-3); }
.input-row > * { flex: 1; min-width: 0; }
.form-error {
  background: var(--danger-tint); color: var(--danger); border: 1px solid rgba(163,59,46,0.25);
  padding: 10px 14px; border-radius: var(--r-sm); font-size: 13px; margin-bottom: var(--sp-4);
  display: flex; align-items: center; gap: 8px;
}

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; font-size: 14px; padding: 11px 20px; border-radius: var(--r-sm);
  border: 1.5px solid transparent; transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--maroon); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--maroon-dark); box-shadow: var(--shadow-md); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-dark); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { border-color: var(--maroon); color: var(--maroon); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-soft); color: var(--ink); }
.btn-danger { background: var(--danger-tint); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 13px; font-size: 12.5px; }
.btn-icon { padding: 9px; border-radius: var(--r-sm); }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }

/* ===================== APP SHELL ===================== */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--maroon) 0%, var(--maroon-dark) 100%);
  color: #F3E9DE;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 40;
  transition: transform .25s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 26px 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.sidebar-brand .seal-mini { width: 38px; height: 38px; flex-shrink: 0; }
.sidebar-brand-text { min-width: 0; }
.sidebar-brand-text .name { font-family: var(--font-display); font-size: 16.5px; font-weight: 600; color: #fff; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-brand-text .sub { font-size: 11px; color: rgba(243,233,222,0.65); letter-spacing: .04em; text-transform: uppercase; }

.sidebar-countdown {
  margin: 18px 18px 6px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--r-md);
  padding: 14px 16px;
  text-align: center;
}
.sidebar-countdown .num { font-family: var(--font-mono); font-size: 28px; font-weight: 700; color: var(--gold-tint); line-height: 1; }
.sidebar-countdown .lbl { font-size: 10.5px; color: rgba(243,233,222,0.7); margin-top: 5px; letter-spacing: .05em; text-transform: uppercase; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 14px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; margin-bottom: 2px; border-radius: var(--r-sm);
  color: rgba(243,233,222,0.78); font-size: 14px; font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.sidebar-nav a svg { width: 19px; height: 19px; flex-shrink: 0; opacity: .9; }
.sidebar-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-nav a.active { background: var(--gold); color: #2A1F0E; font-weight: 700; }
.sidebar-nav a.active svg { opacity: 1; }

.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,0.12); }
.sidebar-foot a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r-sm); color: rgba(243,233,222,0.7); font-size: 13.5px; font-weight: 600; }
.sidebar-foot a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-foot a svg { width: 17px; height: 17px; }

.sidebar-close { display: none; }

/* ===================== MAIN / TOPBAR ===================== */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: var(--topbar-h);
  background: rgba(246,240,228,0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--sp-6);
  position: sticky; top: 0; z-index: 30;
}
.topbar h2 { font-size: 21px; }
.topbar .topbar-sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.menu-toggle { display: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px; }
.menu-toggle svg { width: 20px; height: 20px; }

.page-content { padding: var(--sp-6); max-width: 1240px; width: 100%; }
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(36,26,22,0.45); z-index: 39; }
.sidebar-overlay.show { display: block; }

/* ===================== CARDS ===================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  padding: var(--sp-5);
}
.card-title { font-size: 16px; font-weight: 700; font-family: var(--font-display); }
.card + .card { margin-top: var(--sp-5); }

.grid-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); margin-bottom: var(--sp-5); }
.stat-card {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5); box-shadow: var(--shadow-sm);
  animation: riseIn .45s ease both;
}
.stat-card .stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.stat-card .stat-icon { width: 36px; height: 36px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; }
.stat-card .stat-icon svg { width: 18px; height: 18px; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.stat-card .stat-label { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.icon-maroon { background: var(--maroon-tint); color: var(--maroon); }
.icon-gold { background: var(--gold-tint); color: var(--gold-dark); }
.icon-sage { background: var(--sage-tint); color: var(--sage); }
.icon-danger { background: var(--danger-tint); color: var(--danger); }

/* ===================== SEAL (signature element) ===================== */
.seal-mini, .seal-hero { display: block; }
.seal-hero-wrap { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--sp-6) 0 var(--sp-4); }
.seal-hero { width: 168px; height: 168px; animation: stampIn .6s cubic-bezier(.2,.9,.3,1.2) both; }
.seal-hero-caption { margin-top: var(--sp-4); }
.seal-hero-caption .title { font-family: var(--font-display); font-size: 19px; font-weight: 600; }
.seal-hero-caption .sub { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }

@keyframes stampIn {
  0% { opacity: 0; transform: scale(1.35) rotate(-6deg); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===================== PROGRESS ===================== */
.progress-track { height: 9px; background: var(--line-soft); border-radius: var(--r-full); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--maroon)); border-radius: var(--r-full); transition: width .5s ease; }
.progress-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.progress-row .cat-name { font-weight: 600; }
.progress-row .cat-pct { color: var(--ink-soft); font-family: var(--font-mono); font-size: 12px; }
.progress-item { margin-bottom: var(--sp-4); }
.progress-item:last-child { margin-bottom: 0; }

.ring-wrap { position: relative; width: 132px; height: 132px; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line-soft); stroke-width: 11; }
.ring-fg { fill: none; stroke: var(--gold); stroke-width: 11; stroke-linecap: round; transition: stroke-dashoffset 0.8s cubic-bezier(.3,.8,.4,1); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center .val { font-family: var(--font-display); font-size: 26px; font-weight: 700; }
.ring-center .lbl { font-size: 10.5px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }

/* ===================== BADGES ===================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--sage-tint); color: var(--sage); }
.badge-warning { background: var(--gold-tint); color: var(--gold-dark); }
.badge-muted { background: var(--line-soft); color: var(--ink-soft); }
.badge-danger { background: var(--danger-tint); color: var(--danger); }

/* ===================== TABLE / LIST ===================== */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--line-soft); }
table.data-table { width: 100%; border-collapse: collapse; min-width: 640px; background: var(--surface); }
.data-table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-soft); font-weight: 700; padding: 13px 16px; background: var(--surface-soft);
  border-bottom: 1px solid var(--line-soft);
}
.data-table td { padding: 13px 16px; font-size: 13.5px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-soft); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.row-actions button { background: transparent; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px; color: var(--ink-soft); }
.row-actions button:hover { border-color: var(--maroon); color: var(--maroon); }
.row-actions svg { width: 15px; height: 15px; }

/* ===================== CHECKLIST ITEM ===================== */
.check-item {
  display: flex; align-items: flex-start; gap: 13px; padding: 14px 16px;
  border: 1px solid var(--line-soft); border-radius: var(--r-sm); background: var(--surface);
  margin-bottom: 9px; transition: background .15s ease;
}
.check-item.is-done { background: var(--sage-tint); border-color: transparent; }
.check-item.is-done .check-task { text-decoration: line-through; color: var(--ink-faint); }
.check-box {
  width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; margin-top: 1px;
  background: var(--surface); transition: all .15s ease;
}
.check-item.is-done .check-box { background: var(--sage); border-color: var(--sage); }
.check-box svg { width: 13px; height: 13px; color: #fff; opacity: 0; transition: opacity .15s ease; }
.check-item.is-done .check-box svg { opacity: 1; }
.check-body { flex: 1; min-width: 0; }
.check-task { font-size: 14px; font-weight: 600; }
.check-meta { display: flex; gap: 10px; align-items: center; margin-top: 5px; font-size: 12px; color: var(--ink-soft); flex-wrap: wrap; }

/* --- Sub-item (rincian isi tugas) --- */
.subitem-toggle {
  flex-shrink: 0; background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--r-sm);
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; color: var(--ink-soft);
  transition: transform .15s ease, background .15s ease; margin-top: 1px;
}
.subitem-toggle svg { width: 13px; height: 13px; transition: transform .2s ease; }
.subitem-toggle.expanded svg { transform: rotate(180deg); }
.subitem-toggle:hover { background: var(--gold-tint); color: var(--gold-dark); }
.subitem-count { font-family: var(--font-mono); font-size: 11px; background: var(--surface-soft); border: 1px solid var(--line); padding: 2px 8px; border-radius: var(--r-full); color: var(--ink-soft); }

.subitem-panel {
  margin: 10px 0 2px 35px; padding: 12px 14px; background: var(--surface-soft); border: 1px dashed var(--line);
  border-radius: var(--r-sm); display: none;
}
.subitem-panel.show { display: block; animation: riseIn .2s ease both; }
.subitem-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.subitem-row .mini-box {
  width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid var(--line); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; background: var(--surface); cursor: pointer;
}
.subitem-row .mini-box.done { background: var(--sage); border-color: var(--sage); }
.subitem-row .mini-box svg { width: 10px; height: 10px; color: #fff; opacity: 0; }
.subitem-row .mini-box.done svg { opacity: 1; }
.subitem-row .subitem-name { flex: 1; font-size: 13px; }
.subitem-row.done .subitem-name { text-decoration: line-through; color: var(--ink-faint); }
.subitem-row .subitem-del { background: transparent; border: none; color: var(--ink-faint); padding: 4px; flex-shrink: 0; }
.subitem-row .subitem-del:hover { color: var(--danger); }
.subitem-row .subitem-del svg { width: 13px; height: 13px; }
.subitem-add-row { display: flex; gap: 8px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.subitem-add-row input { flex: 1; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 7px 11px; font-size: 12.5px; background: var(--surface); }
.subitem-add-row button { flex-shrink: 0; }

.timeline-group { margin-bottom: var(--sp-6); }
.timeline-heading { display: flex; align-items: center; gap: 10px; margin-bottom: var(--sp-3); }
.timeline-heading .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--maroon); }
.timeline-heading h3 { font-size: 15.5px; }
.timeline-heading .count { font-size: 12px; color: var(--ink-faint); font-family: var(--font-mono); }

/* ===================== EMPTY STATE ===================== */
.empty-state { text-align: center; padding: var(--sp-7) var(--sp-4); color: var(--ink-soft); }
.empty-state svg { width: 46px; height: 46px; margin: 0 auto var(--sp-3); opacity: .5; }
.empty-state .title { font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.empty-state .sub { font-size: 13px; }

/* ===================== MODAL ===================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(36,26,22,0.45); z-index: 60;
  display: none; align-items: center; justify-content: center; padding: var(--sp-4);
  backdrop-filter: blur(2px);
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto;
  animation: modalIn .22s ease both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-5) var(--sp-5) var(--sp-4); border-bottom: 1px solid var(--line-soft); }
.modal-head h3 { font-size: 17px; }
.modal-close { background: var(--surface-soft); border: none; border-radius: var(--r-full); width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; color: var(--ink-soft); }
.modal-close svg { width: 15px; height: 15px; }
.modal-body { padding: var(--sp-5); }
.modal-foot { padding: var(--sp-4) var(--sp-5) var(--sp-5); display: flex; gap: var(--sp-3); }
.modal-foot .btn { flex: 1; }

/* ===================== TOAST ===================== */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 80; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--ink); color: #fff; padding: 13px 18px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px;
  animation: toastIn .25s ease both; max-width: 320px;
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--sage); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ===================== FILTER BAR ===================== */
.filter-bar { display: flex; gap: var(--sp-3); margin-bottom: var(--sp-5); flex-wrap: wrap; align-items: center; }
.filter-bar .input, .filter-bar .select { width: auto; min-width: 160px; }
.search-box { position: relative; flex: 1; min-width: 200px; }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-faint); }
.search-box .input { padding-left: 38px; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-5); flex-wrap: wrap; gap: var(--sp-3); }
.section-head h3 { font-size: 18px; }

.tab-bar { display: flex; gap: 4px; background: var(--surface-soft); border: 1px solid var(--line-soft); border-radius: var(--r-full); padding: 4px; margin-bottom: var(--sp-5); width: fit-content; }
.tab-btn { padding: 8px 16px; border-radius: var(--r-full); border: none; background: transparent; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.tab-btn.active { background: var(--maroon); color: #fff; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
  .grid-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; position: absolute; top: 22px; right: 18px; background: rgba(255,255,255,0.1); border: none; border-radius: var(--r-full); width: 30px; height: 30px; color: #fff; }
  .sidebar-close svg { width: 15px; height: 15px; }
  .main { margin-left: 0; }
  .menu-toggle { display: flex; }
  .hide-mobile { display: none !important; }
}

@media (max-width: 640px) {
  .grid-stats { grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
  .page-content { padding: var(--sp-4); }
  .topbar { padding: 0 var(--sp-4); height: 64px; }
  .topbar h2 { font-size: 17px; }
  .auth-card { padding: var(--sp-6) var(--sp-4); }
  .modal-foot { flex-direction: column-reverse; }
  .stat-card .stat-value { font-size: 21px; }
  .seal-hero { width: 128px; height: 128px; }
  .input-row { flex-direction: column; gap: 0; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .section-head .btn { width: 100%; }
}
