/* ============================================================
   Bididiu Management — Design System v4 "Midnight"
   Premium dark: minimal Space Grotesk display + Plus Jakarta Sans body,
   deep ink-violet palette, electric violet + champagne accents,
   glass surfaces, smooth choreographed motion (transform/opacity only).
   NOTE: Client Gallery (own layout, no style.css) and Invoice
   (hardcoded light palette on .invoice-body) are intentionally untouched.
   ============================================================ */
:root {
  --bg: #0a0912;
  --bg-mesh:
    radial-gradient(1000px 560px at 90% -10%, rgba(124, 108, 255, .18) 0%, transparent 58%),
    radial-gradient(1100px 640px at -8% 6%, rgba(108, 92, 231, .14) 0%, transparent 56%),
    radial-gradient(900px 520px at 50% 115%, rgba(227, 182, 103, .08) 0%, transparent 60%);
  --surface: #141320;
  --surface-2: #1b1a29;
  --surface-3: #242236;
  --ink: #f4f3fb;
  --ink-soft: #c3c0d8;
  --muted: #8b88a6;
  --line: rgba(255, 255, 255, .085);
  --line-soft: rgba(255, 255, 255, .05);

  --primary: #7c6cff;
  --primary-dark: #6a5af0;
  --primary-deep: #5546d0;
  --primary-soft: rgba(124, 108, 255, .15);
  --primary-glow: rgba(124, 108, 255, .5);

  /* champagne / gold — premium accent, used sparingly */
  --gold: #e3b667;
  --gold-soft: rgba(227, 182, 103, .14);
  --gold-deep: #c99a44;

  /* supporting palette (calendar combos, accents, charts) — brightened for dark */
  --c-coral: #fb8b67;
  --c-blue: #5ba0e6;
  --c-teal: #38d9a9;
  --c-purple: #7c6cff;
  --c-amber: #f0b54b;
  --c-pink: #ec6fa0;

  --ok: #34d399;
  --bad: #fb6f6a;
  --warn: #f0b54b;

  /* legacy aliases (used by team/directory styles) */
  --accent: var(--primary);
  --card: var(--surface);
  --fg: var(--ink);
  --muted-bg: var(--surface-2);
  --radius: var(--r-lg);

  /* theme-specific surfaces & accent-on-surface text (flip in light mode) */
  --topbar-bg: rgba(10, 9, 18, .68);
  --auth-card-bg: linear-gradient(180deg, rgba(28,26,42,.82), rgba(18,17,28,.86));
  --auth-card-border: rgba(255,255,255,.09);
  --t-violet: #b3a8ff;
  --t-blue: #7fb4ec;
  --t-red: #ff9b96;

  --r-xl: 28px;
  --r-lg: 22px;
  --r: 16px;
  --r-sm: 12px;

  --shadow-lg: 0 32px 80px -24px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255,255,255,.03);
  --shadow: 0 20px 52px -18px rgba(0, 0, 0, .6);
  --shadow-sm: 0 10px 28px -14px rgba(0, 0, 0, .55);
  --shadow-inset: inset 0 1px 0 rgba(255,255,255,.06);

  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-soft: cubic-bezier(.22, .61, .36, 1);
  --dur: .28s;
  --dur-slow: .5s;

  --sidebar-w: 264px;
  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ---- Light mode (opt-in via data-theme="light") ---- */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f1f9;
  --bg-mesh:
    radial-gradient(900px 520px at 92% -8%, rgba(232, 197, 142, .16) 0%, transparent 60%),
    radial-gradient(1100px 640px at -10% 8%, rgba(108, 92, 231, .14) 0%, transparent 58%),
    radial-gradient(800px 500px at 50% 110%, rgba(108, 92, 231, .08) 0%, transparent 60%);
  --surface: #ffffff;
  --surface-2: #f7f6fc;
  --surface-3: #efedf8;
  --ink: #1a1730;
  --ink-soft: #4d4a66;
  --muted: #908ca8;
  --line: #e9e6f3;
  --line-soft: #f0eef8;
  --primary: #6c5ce7;
  --primary-dark: #5645c9;
  --primary-deep: #463aa1;
  --primary-soft: #efeafe;
  --primary-glow: rgba(108, 92, 231, .35);
  --gold: #cf9d52;
  --gold-soft: #f7ecd9;
  --gold-deep: #a87a35;
  --c-coral: #f0825f;
  --c-blue: #4886c4;
  --c-teal: #2fa384;
  --c-purple: #6c5ce7;
  --c-amber: #e3a23c;
  --c-pink: #d6618a;
  --ok: #2f9e74;
  --bad: #d8564f;
  --warn: #c4860f;
  --shadow-lg: 0 28px 70px -22px rgba(38, 27, 90, .30);
  --shadow: 0 18px 48px -16px rgba(38, 27, 90, .20);
  --shadow-sm: 0 8px 24px -10px rgba(38, 27, 90, .16);
  --shadow-inset: inset 0 1px 0 rgba(255,255,255,.6);
  --topbar-bg: rgba(243, 241, 249, .72);
  --auth-card-bg: rgba(255,255,255,.9);
  --auth-card-border: rgba(255,255,255,.7);
  --t-violet: #5645c9;
  --t-blue: #3169b5;
  --t-red: #c0392b;
}
html[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator,
html[data-theme="light"] input[type="month"]::-webkit-calendar-picker-indicator { filter: none; }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; color-scheme: dark; overflow-x: clip; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  background-image: var(--bg-mesh);
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--primary); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: #9a8dff; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.01em; }
::selection { background: var(--primary-glow); color: #fff; }

/* premium scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(124,108,255,.28); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(124,108,255,.5); background-clip: padding-box; }

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

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background:
    radial-gradient(420px 320px at 0% 0%, rgba(124,108,255,.28) 0%, transparent 60%),
    linear-gradient(185deg, #15131f 0%, #100e1a 60%, #0b0a13 100%);
  color: #c8c5dc;
  border-right: 1px solid rgba(255,255,255,.06);
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; font-size: 1.28rem; color: #f6f5fb; font-family: var(--font-display); letter-spacing: .01em; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 13px;
  background: linear-gradient(135deg, var(--primary), #9b8cff);
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.12rem; font-family: var(--font-body);
  box-shadow: 0 8px 22px rgba(108, 92, 231, .5), inset 0 1px 0 rgba(255,255,255,.35);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.brand:hover .brand-logo { transform: rotate(-6deg) scale(1.05); box-shadow: 0 10px 28px rgba(108, 92, 231, .6), inset 0 1px 0 rgba(255,255,255,.4); }
.brand-logo-img { background: #0b0b10; overflow: hidden; }
.brand-logo-img img { width: 100%; height: 100%; object-fit: contain; padding: 6px; display: block; }

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 13px;
  padding: 12px 15px; border-radius: 13px;
  color: #a8a4c2; font-weight: 600; font-size: .94rem;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
  isolation: isolate;
}
.nav-item::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: linear-gradient(135deg, var(--primary), #8a7af2);
  opacity: 0; transform: scale(.92);
  box-shadow: 0 10px 26px rgba(108,92,231,.45);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.nav-item:hover { color: #fff; transform: translateX(2px); }
.nav-item:hover:not(.active) { background: rgba(255,255,255,.055); }
.nav-item.active { color: #fff; }
.nav-item.active::before { opacity: 1; transform: scale(1); }
.nav-item .ic { width: 20px; height: 20px; position: relative; }
.nav-item span { position: relative; }
.ic { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.side-legend { display: flex; flex-direction: column; gap: 9px; padding: 17px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.06); border-radius: var(--r); backdrop-filter: blur(8px); }
.legend-title { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: #7e7a9a; margin-bottom: 2px; }
.legend-row { display: flex; align-items: center; gap: 9px; font-size: .85rem; color: #c1bdd6; }
.dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(255,255,255,.05); }

.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding-top: 6px; }
.user-chip { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; padding: 6px; margin: -6px; border-radius: 14px; cursor: pointer; transition: background var(--dur) var(--ease); text-decoration: none; }
.user-chip:hover { background: rgba(255,255,255,.06); }
.user-chip.active { background: rgba(255,255,255,.08); }
.avatar {
  width: 40px; height: 40px; border-radius: 13px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--gold), #e9c98a);
  color: #3a2a0e; display: grid; place-items: center; font-weight: 800; text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(207,157,82,.35), inset 0 1px 0 rgba(255,255,255,.4);
}
.user-meta { display: flex; flex-direction: column; min-width: 0; }
.user-meta strong { font-size: .9rem; color: #f6f5fb; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { color: #8d89a8; font-size: .75rem; text-transform: capitalize; }
.logout { width: 40px; height: 40px; border-radius: 13px; background: rgba(255,255,255,.06); display: grid; place-items: center; color: #a8a4c2; flex-shrink: 0; transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.logout:hover { background: rgba(216,86,79,.18); color: #ff9b94; transform: scale(1.06); }
.logout .ic { width: 18px; height: 18px; }
.avatar.avatar-photo { object-fit: cover; background: none; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.side-legend {
  margin-top: auto; margin-bottom: 8px; padding: 10px 14px;
  background: rgba(255,255,255,.04); border-radius: 12px;
  border: 1px solid rgba(255,255,255,.07);
}
.legend-label {
  font-size: .6rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: #7a769a; margin-bottom: 8px;
}
.legend-items {
  display: grid; grid-template-columns: 10px 1fr 10px 1fr; gap: 6px 8px; align-items: center;
}
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-name { font-size: .73rem; color: #b0acca; }

/* ---- Main ---- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 24px 34px; position: sticky; top: 0; z-index: 20;
  background: var(--topbar-bg); backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.sidebar-toggle {
  display: none; background: transparent; border: none; color: var(--ink); cursor: pointer;
  width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.sidebar-toggle:hover { background: var(--surface-2); }
.sidebar-toggle .ic { width: 24px; height: 24px; }

/* Sidebar overlay for mobile */
.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 99;
  backdrop-filter: blur(3px);
}
.hello { display: flex; flex-direction: column; }
.hello-sub { font-size: .82rem; color: var(--muted); letter-spacing: .01em; }
.hello-name { font-size: 1.5rem; font-weight: 600; text-transform: capitalize; font-family: var(--font-display); letter-spacing: -.01em; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.today-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 9px 17px; font-size: .85rem; font-weight: 600; color: var(--ink-soft); box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.today-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.today-chip .ic { width: 16px; height: 16px; color: var(--primary); }
.notification-btn { display: inline-flex; align-items: center; justify-content: center; position: relative; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); cursor: pointer; transition: all .2s var(--ease); text-decoration: none; }
.notification-btn:hover { background: var(--surface-2); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.notification-btn .ic { width: 20px; height: 20px; }
.notification-badge { position: absolute; top: -6px; right: -6px; display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; background: var(--bad); color: #fff; border-radius: 999px; font-size: .75rem; font-weight: 700; padding: 0 5px; box-shadow: 0 2px 8px rgba(0,0,0,.15); animation: badgePulse .6s var(--ease) infinite alternate; }
@keyframes badgePulse { from { transform: scale(1); } to { transform: scale(1.15); } }
.content { padding: 10px 34px 56px; animation: pageIn .55s var(--ease) both; min-width: 0; overflow-x: clip; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---- Bottom nav (mobile) ---- */
.bottomnav { display: none; }

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  padding: 11px 19px; border-radius: 13px; cursor: pointer; font-size: .92rem; font-weight: 600;
  font-family: inherit; letter-spacing: .005em;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease),
              transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--surface-2); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0) scale(.98); transition-duration: .1s; }
.btn-primary { background: linear-gradient(135deg, var(--primary), #8170ee); border-color: transparent; color: #fff; box-shadow: 0 12px 28px -8px var(--primary-glow), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark), #7263e6); box-shadow: 0 16px 36px -8px var(--primary-glow), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-ghost:hover { box-shadow: none; }
.btn-danger { background: rgba(251,111,106,.12); border-color: rgba(251,111,106,.28); color: var(--bad); box-shadow: none; }
.btn-danger:hover { background: rgba(251,111,106,.2); box-shadow: none; }
.btn-block { width: 100%; }
.btn-round { border-radius: 999px; }
.btn-sm { padding: 8px 15px; font-size: .85rem; }
.btn-xs { padding: 5px 11px; font-size: .78rem; border-radius: 9px; }

/* ===================== Page head ===================== */
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.page-head h2 { display: none; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); font-weight: 400; font-size: .88rem; }
.hint { color: var(--muted); margin-bottom: 14px; font-size: .9rem; }
.cell-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.list-title { margin: 32px 0 14px; font-size: 1.18rem; font-weight: 700; font-family: var(--font-display); }

/* ===================== Cards ===================== */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  padding: 25px; margin-bottom: 20px;
  transition: box-shadow var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease), border-color var(--dur) var(--ease);
}
.card:hover { box-shadow: var(--shadow); border-color: var(--line-soft); }
.card h3 { font-size: 1.12rem; font-weight: 700; margin-bottom: 16px; font-family: var(--font-display); letter-spacing: -.005em; }
.card h4.sub { margin: 10px 0 4px; color: var(--primary-dark); font-size: .9rem; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.grid-2 > * { min-width: 0; }

/* ===================== Stat cards (refined gradient + glass sheen) ===================== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  border-radius: var(--r-lg); padding: 23px; color: #fff; position: relative; overflow: hidden;
  box-shadow: var(--shadow); min-height: 116px; display: flex; flex-direction: column; justify-content: center;
  transition: transform var(--dur-slow) var(--ease), box-shadow var(--dur-slow) var(--ease);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(140deg, rgba(255,255,255,.22) 0%, transparent 45%); pointer-events: none; }
.stat-card::after { content: ""; position: absolute; right: -28px; top: -28px; width: 100px; height: 100px; border-radius: 50%; background: rgba(255,255,255,.12); }
.stat-num { font-size: 1.78rem; font-weight: 700; letter-spacing: -.02em; font-family: var(--font-display); position: relative; }
.stat-label { font-size: .82rem; opacity: .92; margin-top: 4px; font-weight: 500; position: relative; }
.stat-grid .stat-card:nth-child(6n+1) { background: linear-gradient(135deg, #7d6ef5, var(--c-purple)); }
.stat-grid .stat-card:nth-child(6n+2) { background: linear-gradient(135deg, #f3936f, var(--c-coral)); }
.stat-grid .stat-card:nth-child(6n+3) { background: linear-gradient(135deg, #5fa0d6, var(--c-blue)); }
.stat-grid .stat-card:nth-child(6n+4) { background: linear-gradient(135deg, #45c0a0, var(--c-teal)); }
.stat-grid .stat-card:nth-child(6n+5) { background: linear-gradient(135deg, #edb868, var(--c-amber)); }
.stat-grid .stat-card:nth-child(6n+6) { background: linear-gradient(135deg, #e286a8, var(--c-pink)); }
.stat-card.wide { grid-column: span 2; }
.stat-card.pos { background: linear-gradient(135deg, #46c094, #2f9e74) !important; }
.stat-card.neg { background: linear-gradient(135deg, #f08a83, #d8564f) !important; }
a.stat-card-link { text-decoration: none; cursor: pointer; }
a.stat-card-link:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

/* ===================== Forms ===================== */
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; color: var(--ink-soft); letter-spacing: .005em; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%; padding: 12px 15px; border: 1.5px solid var(--line); border-radius: 13px;
  font-size: .94rem; font-family: inherit; background: var(--surface-2); color: var(--ink); margin-bottom: 14px;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
input:not([type="checkbox"]):not([type="radio"]):hover, select:hover, textarea:hover { border-color: rgba(255,255,255,.16); }
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); background: var(--surface-3); box-shadow: 0 0 0 4px var(--primary-soft); }
input::placeholder, textarea::placeholder { color: var(--muted); }
select option { background: var(--surface-2); color: var(--ink); }
input[type="date"]::-webkit-calendar-picker-indicator, input[type="month"]::-webkit-calendar-picker-indicator { filter: invert(.85); cursor: pointer; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 19px; margin-bottom: 18px; transition: border-color var(--dur) var(--ease); }
fieldset:focus-within { border-color: #d4cdf3; }
legend { font-weight: 700; padding: 0 9px; color: var(--primary-dark); font-size: .95rem; font-family: var(--font-display); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; padding-top: 16px; border-top: 1px dashed var(--line); }
.inline-form input, .inline-form select { margin-bottom: 0; width: auto; flex: 1; min-width: 130px; }
.inline-form .qty-input { flex: none; width: 80px; min-width: 0; }
.mode-toggle { display: inline-flex; align-items: center; gap: 6px; flex: none; width: auto; font-size: .86rem; color: var(--ink-soft); cursor: pointer; }
.mode-toggle input { margin: 0; }
.mode-toggle-neg:has(input:checked) { color: var(--bad); font-weight: 700; }

.addon-quickadd { margin-top: 14px; padding-top: 16px; border-top: 1px dashed var(--line); }
.addon-cat-group + .addon-cat-group { margin-top: 12px; }
.addon-cat-title { font-weight: 700; font-size: .82rem; color: var(--primary-dark); margin-bottom: 7px; text-transform: uppercase; letter-spacing: .04em; }
.addon-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.addon-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-size: .84rem; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; color: var(--ink); }
.addon-chip:hover { border-color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }
.addon-chip.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; }
.addon-row-neg td { color: var(--bad); }
.addon-row-neg .hint { color: inherit; opacity: .75; }

/* ===================== Tables ===================== */
.table-scroll { overflow-x: auto; margin: 0 -4px; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.data-table th, .data-table td { padding: 14px 15px; text-align: left; font-size: .9rem; border-bottom: 1px solid var(--line-soft); }
.data-table th { color: var(--muted); font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; }
.data-table tbody tr { transition: background var(--dur) var(--ease); }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tr:last-child td { border-bottom: none; }
.actions { display: flex; gap: 6px; }
.kv { width: 100%; border-collapse: collapse; }
.kv th { text-align: left; padding: 8px 12px 8px 0; color: var(--muted); font-weight: 600; width: 42%; vertical-align: top; font-size: .88rem; }
.kv td { padding: 8px 0; font-size: .92rem; }

/* ===================== Badges + session colors ===================== */
.badge { display: inline-flex; align-items: center; padding: 5px 12px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--surface-2); color: var(--ink-soft); letter-spacing: .01em; }
.badge-role { background: var(--primary-soft); color: var(--t-violet); text-transform: capitalize; }
.badge-ok { background: rgba(52,211,153,.14); color: var(--ok); }
.badge-warn { background: rgba(240,181,75,.14); color: var(--warn); }
.badge-info { background: rgba(91,160,230,.14); color: var(--t-blue); }
.badge-sess { background: var(--primary-soft); color: var(--t-violet); }
.status-pending { background: rgba(240,181,75,.14); color: var(--warn); }
.status-dp_paid { background: rgba(91,160,230,.16); color: var(--t-blue); }
.status-lunas { background: rgba(52,211,153,.14); color: var(--ok); }
.status-approved { background: rgba(52,211,153,.14); color: var(--ok); }
.status-rejected { background: rgba(251,111,106,.14); color: var(--bad); }

/* session color tokens (dots, calendar events, list accents) */
.dot.sess-mappacci, .cal-event.sess-mappacci { background: #ece7ff; }
.dot.sess-pacci,    .cal-event.sess-pacci    { background: #e2eefb; }
.dot.sess-siraman,  .cal-event.sess-siraman  { background: #d9f3e8; }
.dot.sess-pengajian,.cal-event.sess-pengajian{ background: #fdeccf; }
.dot.sess-akad,     .cal-event.sess-akad     { background: #fde3ec; }
.dot.sess-resepsi,  .cal-event.sess-resepsi  { background: #e6e1ff; }
.dot.sess-mappacci { background: #8b7bff; }
.dot.sess-pacci { background: var(--c-blue); }
.dot.sess-siraman { background: var(--c-teal); }
.dot.sess-akad { background: var(--c-pink); }
.dot.sess-resepsi { background: var(--c-purple); }
.cal-event.sess-mappacci { color: #5a49d6; }
.cal-event.sess-pacci { color: #2f6fc2; }
.cal-event.sess-siraman { color: #1f8b63; }
.cal-event.sess-pengajian { color: #b0780f; }
.cal-event.sess-akad { color: #c44d77; }
.cal-event.sess-resepsi { color: #5a49d6; }

/* ===================== Calendar ===================== */
.month-nav { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.month-label { font-weight: 600; font-size: 1.18rem; min-width: 150px; text-align: center; font-family: var(--font-display); }
.calendar { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface-2); }
.cal-head div { padding: 13px 8px; text-align: center; font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-day { height: 110px; border-top: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); padding: 9px; font-size: .8rem; overflow-y: auto; transition: background var(--dur) var(--ease); }
.cal-week > .cal-day:last-child { border-right: none; }
.cal-day.empty { background: var(--surface-2); }
.cal-day.has-events { background: rgba(124,108,255,.06); }
.cal-day:not(.empty):hover { background: var(--primary-soft); }
.cal-day.today { background: var(--primary-soft); }
.cal-date { font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; font-size: .82rem; }
.cal-day.today .cal-date { display: inline-grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: var(--primary); color: #fff; box-shadow: 0 6px 16px var(--primary-glow); }
.cal-event { display: flex; gap: 6px; align-items: center; padding: 5px 9px; border-radius: 9px; margin-bottom: 4px; font-size: .85rem; font-weight: 600; white-space: nowrap; overflow: hidden; transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.cal-event:hover { transform: translateX(2px); box-shadow: var(--shadow-sm); }
.cal-event .ev-time { font-weight: 800; flex-shrink: 0; }
.cal-event .ev-label { overflow: hidden; text-overflow: ellipsis; display: block; line-height: 1.2; white-space: nowrap; }
.cal-event.multi-session { color: #fff; }

/* ---- View toggle (Bulan/Project) ---- */
.cal-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.view-toggle { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; box-shadow: var(--shadow-sm); }
.view-toggle a { padding: 7px 17px; border-radius: 999px; font-size: .85rem; font-weight: 600; color: var(--muted); transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.view-toggle a.active { background: linear-gradient(135deg, var(--primary), #8170ee); color: #fff; box-shadow: 0 8px 20px -6px var(--primary-glow); }
.btn-icon { min-width: 36px; padding: 6px 0; font-size: 1.15rem; line-height: 1; }

/* Legend & warna kombinasi sesi (Jadwal Per Bulan) */
.cal-legend { display: flex; flex-wrap: wrap; gap: 7px 17px; margin: 4px 0 16px; font-size: .8rem; color: var(--ink-soft); }
.cal-legend-item { display: inline-flex; align-items: center; gap: 7px; }
.cal-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(108,92,231,.06); }

.cal-dot.combo-siraman,     .cal-event.combo-siraman      { background: #D4A5FF; }
.cal-dot.combo-pacci,       .cal-event.combo-pacci        { background: #22C55E; }
.cal-dot.combo-akad,        .cal-event.combo-akad         { background: #FF9500; }
.cal-dot.combo-akad-resepsi,.cal-event.combo-akad-resepsi { background: linear-gradient(90deg, #FF9500 0%, #FF9500 50%, #FF3B3B 50%, #FF3B3B 100%); }
.cal-dot.combo-resepsi,     .cal-event.combo-resepsi      { background: #FF3B3B; }
.cal-dot.combo-lamaran,     .cal-event.combo-lamaran      { background: #3B82F6; }
.cal-dot.combo-lainnya,     .cal-event.combo-lainnya      { background: #6B7280; }

.cal-event.combo-siraman      { color: #fff; }
.cal-event.combo-pacci        { color: #fff; }
.cal-event.combo-akad         { color: #fff; }
.cal-event.combo-akad-resepsi { color: #fff; }
.cal-event.combo-resepsi      { color: #fff; }
.cal-event.combo-lamaran      { color: #fff; }
.cal-event.combo-lainnya      { color: #fff; }

/* ===================== Session list / timeline ===================== */
.session-list { display: grid; gap: 12px; }
.session-row { display: flex; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--primary); border-radius: var(--r); padding: 15px 19px; box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.session-row:hover { transform: translateY(-2px) translateX(2px); box-shadow: var(--shadow); }
.session-row.sess-mappacci { border-left-color: #8b7bff; }
.session-row.sess-pacci { border-left-color: var(--c-blue); }
.session-row.sess-siraman { border-left-color: var(--c-teal); }
.session-row.sess-pengajian { border-left-color: var(--c-amber); }
.session-row.sess-akad { border-left-color: var(--c-pink); }
.session-row.sess-resepsi { border-left-color: var(--c-purple); }
.sr-date { min-width: 116px; }
.sr-date span { display: block; color: var(--muted); font-size: .82rem; }
.sr-loc { color: var(--muted); font-size: .85rem; margin-top: 3px; }
.timeline { list-style: none; }
.timeline li { display: flex; gap: 14px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.timeline li:last-child { border-bottom: none; }
.tl-badge { background: var(--primary-soft); color: var(--primary-dark); padding: 6px 13px; border-radius: 10px; font-size: .8rem; font-weight: 700; height: fit-content; }

/* ===================== Summary bar ===================== */
.summary-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 21px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.summary-bar div { display: flex; flex-direction: column; }
.summary-bar span { color: var(--muted); font-size: .8rem; }
.summary-bar strong { font-size: 1.18rem; margin-top: 3px; font-family: var(--font-display); font-weight: 600; }

/* ===================== Production / kanban ===================== */
.prod-list { display: grid; gap: 16px; }
.prod-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.prod-targets { display: flex; flex-direction: column; gap: 2px; font-size: .82rem; color: var(--muted); text-align: right; }
.prod-targets .overdue, .pc-paket .overdue { color: var(--bad); font-weight: 700; }
.stage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 12px; }
.stage label { font-size: .76rem; margin-bottom: 4px; }
.stage-date { display: block; margin-top: 4px; font-size: .72rem; }
.status-select { margin-bottom: 0; padding: 9px 12px; cursor: pointer; }
.status-select.val-completed, .status-select.val-delivered, .status-select.val-ready_pickup, .status-select.val-on_studio { border-color: rgba(52,211,153,.5); background: rgba(52,211,153,.1); color: var(--ok); font-weight: 600; }
.status-select.val-in_progress, .status-select.val-editing, .status-select.val-designing, .status-select.val-printing,
.status-select.val-desain, .status-select.val-cetak, .status-select.val-memilih { border-color: rgba(240,181,75,.5); background: rgba(240,181,75,.1); color: var(--warn); }

/* ===================== Profit / P&L ===================== */
.profit-box { text-align: center; display: flex; flex-direction: column; justify-content: center; }
.profit-box.pos { background: linear-gradient(135deg, #46c094, #2f9e74); color: #fff; border: none; }
.profit-box.neg { background: linear-gradient(135deg, #f08a83, #d8564f); color: #fff; border: none; }
.profit-box h3 { opacity: .92; }
.big-num { font-size: 2.15rem; font-weight: 700; margin: 6px 0; font-family: var(--font-display); }
.pos-text { color: var(--ok); }
.neg-text { color: var(--bad); }

/* ===================== Misc ===================== */
.note { background: rgba(240,181,75,.08); border: 1px solid rgba(240,181,75,.22); color: var(--ink-soft); border-radius: var(--r-sm); padding: 13px; margin-top: 12px; font-size: .9rem; }
.empty-state { color: var(--muted); padding: 44px 20px; text-align: center; }
.alert { padding: 13px 17px; border-radius: var(--r-sm); margin-bottom: 16px; font-size: .9rem; }
.alert-error { background: rgba(251,111,106,.12); color: var(--t-red); border: 1px solid rgba(251,111,106,.28); }
.alert-banner { display: block; background: var(--primary-soft); color: var(--primary-dark); border: 1px solid transparent; border-radius: var(--r); padding: 15px 19px; margin-bottom: 16px; font-size: .92rem; text-decoration: none; transition: box-shadow .2s, transform .2s; }
.alert-banner:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.danger-zone { border: 1px dashed rgba(251,111,106,.3); border-radius: var(--r); padding: 19px; margin-top: 4px; background: rgba(251,111,106,.05); }
.delete-section { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }

/* ===================== Pricelist ===================== */
.pricelist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.price-card { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 17px; background: var(--surface-2); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.price-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: #ddd6f3; background: var(--surface); }
.price-card .pc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.price-card strong { font-size: 1.06rem; font-family: var(--font-display); font-weight: 600; }
.price-tag { color: var(--primary); font-weight: 700; white-space: nowrap; }
.price-items { margin: 10px 0 0; padding-left: 18px; font-size: .88rem; }
.price-items li { margin-bottom: 4px; }
.session-row-input { display: grid; grid-template-columns: 1.2fr 1.2fr 1fr 1fr 1.5fr auto; gap: 8px; margin-bottom: 8px; }
.session-row-input input, .session-row-input select { margin-bottom: 0; }
.session-row-input--simple { grid-template-columns: 1.4fr 1.3fr 2fr; }
.session-lokasi-row { display: flex; gap: 8px; align-items: center; }
.session-lokasi-row input { flex: 1; margin-bottom: 0; }
.session-lokasi-row .btn { flex-shrink: 0; }

/* ===================== Produk / Paket builder ===================== */
.checkbox-row { display: flex; align-items: center; gap: 9px; font-weight: 500; color: var(--ink); margin-bottom: 8px; cursor: pointer; }
.checkbox-row input { margin: 0; width: auto; accent-color: var(--primary); }
.checkbox-stack { display: flex; flex-direction: column; justify-content: center; }
.filter-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filter-row input, .filter-row select { height: 36px; box-sizing: border-box; padding: 0 12px; font-size: .85rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); }
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-select { height: 36px; padding: 0 10px; font-size: .85rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); cursor: pointer; }
#filterPanel.open { display: flex !important; }
.row-actions { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.inline-edit { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.item-row-input { display: grid; grid-template-columns: 2.4fr .7fr 1.4fr auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.item-row-input select, .item-row-input input { margin-bottom: 0; }
.calc-summary .stat-grid { margin-top: 4px; }
.calc-summary .btn { margin-top: 12px; }

/* ===================== Auth ===================== */
.auth-bg {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 680px at 12% -8%, rgba(124,108,255,.22) 0%, transparent 56%),
    radial-gradient(1000px 560px at 104% 108%, rgba(227,182,103,.14) 0%, transparent 56%),
    var(--bg);
}
/* slow drifting aurora behind the card */
.auth-bg::before, .auth-bg::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(80px); pointer-events: none; z-index: 0;
}
.auth-bg::before { width: 460px; height: 460px; top: -120px; left: -80px; background: rgba(124,108,255,.32); animation: aurora1 14s var(--ease-soft) infinite alternate; }
.auth-bg::after { width: 400px; height: 400px; bottom: -140px; right: -60px; background: rgba(227,182,103,.18); animation: aurora2 18s var(--ease-soft) infinite alternate; }
@keyframes aurora1 { to { transform: translate(80px, 60px) scale(1.15); } }
@keyframes aurora2 { to { transform: translate(-70px, -50px) scale(1.1); } }
.auth-wrap { position: relative; z-index: 1; width: 100%; max-width: 420px; animation: authIn .7s var(--ease) both; }
@keyframes authIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.auth-card {
  background: var(--auth-card-bg);
  backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--auth-card-border);
  border-radius: 28px; box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,.06);
  padding: 44px 36px;
}
.auth-title { text-align: center; font-size: 1.6rem; font-weight: 600; font-family: var(--font-display); letter-spacing: -.02em; color: var(--ink); }
.auth-sub { text-align: center; color: var(--muted); margin-bottom: 26px; font-size: .92rem; }
.auth-card label { color: var(--ink-soft); }
.auth-card .btn-primary { margin-top: 6px; height: 48px; font-size: .98rem; }

/* ===================== Error ===================== */
.error-page { text-align: center; padding: 90px 20px; }
.error-page h1 { font-size: 4.6rem; font-weight: 700; color: var(--primary); font-family: var(--font-display); }
.error-page p { color: var(--muted); margin: 12px 0 28px; }

/* ===================== Invoice ===================== */
.invoice-body {
  background: #f4f2ee;
  font-family: 'Inter', sans-serif;
  color: #1a1814;
  min-height: 100vh;
  padding: 40px 0 80px;
}
.invoice-actions {
  max-width: 720px;
  margin: 0 auto 28px;
  display: flex;
  gap: 10px;
  padding: 0 20px;
}
.invoice-sheet {
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  padding: 64px 72px;
  box-shadow: 0 2px 24px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.04);
}

/* Header */
.inv-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 36px;
  margin-bottom: 36px;
  border-bottom: 1px solid #e4e0da;
}
.inv-brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  margin-bottom: 8px;
}
.inv-brand-logo-wrap img { height: 32px; width: auto; display: block; }
.inv-brand-name {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #1a1814;
  margin-bottom: 4px;
}
.inv-tag {
  font-size: 0.72rem;
  color: #9a948c;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.inv-meta { text-align: right; }
.inv-meta-word {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 300;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #1a1814;
  line-height: 1;
  margin-bottom: 14px;
}
.inv-meta-info {
  font-size: 0.78rem;
  color: #9a948c;
  line-height: 1.9;
}
.inv-meta-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.66rem;
  font-weight: 600;
}

/* Client + session two-col */
.inv-to {
  display: flex;
  gap: 48px;
  margin-bottom: 40px;
}
.inv-to-col { flex: 1; min-width: 0; }
.inv-to-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #9a948c;
  font-weight: 700;
  margin-bottom: 9px;
}
.inv-to-name {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1814;
  margin-bottom: 4px;
  font-family: 'Fraunces', Georgia, serif;
}
.inv-to-detail {
  font-size: 0.815rem;
  color: #6e6a64;
  line-height: 1.7;
}

/* Table */
.inv-table {
  width: 100%;
  border-collapse: collapse;
}
.inv-table thead th {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9a948c;
  font-weight: 700;
  padding: 0 0 12px;
  border-bottom: 1px solid #e4e0da;
}
.inv-table thead th.r { text-align: right; }
.inv-table tbody td {
  padding: 14px 0;
  font-size: 0.855rem;
  border-bottom: 1px solid #f0ede8;
  color: #1a1814;
  line-height: 1.5;
}
.inv-table tbody td.r { text-align: right; white-space: nowrap; }
.inv-table tbody tr:last-child td { border-bottom: none; }
.inv-note { font-size: 0.77rem; color: #9a948c; margin-top: 3px; }
.inv-red { color: #8b3a3a; }

/* Totals */
.inv-totals {
  border-top: 1px solid #e4e0da;
  padding-top: 22px;
  margin-top: 6px;
}
.inv-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
}
.inv-total-label { font-size: 0.82rem; color: #9a948c; }
.inv-total-value { font-size: 0.855rem; color: #1a1814; font-weight: 500; }
.inv-grand-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 18px 0 14px;
  border-top: 1px solid #1a1814;
  margin-top: 10px;
}
.inv-grand-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: #1a1814;
}
.inv-grand-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1a1814;
  font-family: 'Fraunces', Georgia, serif;
}
.inv-remain-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #fdf8f2;
  border: 1px solid #e8dfd4;
  border-radius: 6px;
  margin-top: 10px;
}
.inv-remain-label { font-size: 0.78rem; font-weight: 600; color: #8b3a3a; letter-spacing: 0.02em; }
.inv-remain-value { font-size: 0.95rem; font-weight: 700; color: #8b3a3a; font-family: 'Fraunces', Georgia, serif; }

/* Footer */
.inv-foot {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid #e4e0da;
  text-align: center;
}
.inv-foot-main {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 0.875rem;
  color: #1a1814;
  margin-bottom: 8px;
  font-weight: 300;
}
.inv-foot-note { font-size: 0.73rem; color: #9a948c; letter-spacing: 0.02em; line-height: 1.6; }

@media print {
  .no-print { display: none !important; }
  .invoice-body { background: #fff; padding: 0; }
  .invoice-sheet { box-shadow: none; margin: 0; max-width: 100%; padding: 40px 52px; }
  .inv-remain-row { background: #fdf8f2; border: 1px solid #e8dfd4; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (max-width: 640px) {
  .invoice-body { padding: 16px 0 60px; }
  .invoice-actions { padding: 0 14px; }
  .invoice-sheet { padding: 28px 20px; }
  .inv-header { flex-direction: column; gap: 20px; padding-bottom: 24px; margin-bottom: 24px; }
  .inv-meta { text-align: left; }
  .inv-meta-word { font-size: 1.6rem; }
  .inv-to { flex-direction: column; gap: 20px; margin-bottom: 28px; }
}

/* ===================== Responsive ===================== */
@media (max-width: 1000px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stat-card.wide { grid-column: span 1; }
  .row-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  /* Mobile sidebar drawer */
  .sidebar {
    position: fixed; left: 0; top: 0; height: 100vh; width: var(--sidebar-w);
    z-index: 100; transform: translateX(-100%); transition: transform var(--dur-slow) var(--ease);
    overflow-y: auto;
    padding: 18px 14px;
    gap: 14px;
  }
  .sidebar .nav-item {
    padding: 9px 12px;
    font-size: .86rem;
    border-radius: 10px;
  }
  .sidebar .nav-item .ic { width: 18px; height: 18px; }
  .sidebar .brand { font-size: 1.1rem; }
  .sidebar .brand-logo { width: 34px; height: 34px; font-size: .95rem; }
  .sidebar .nav-fin-label { padding: 6px 14px 2px; }
  /* Mobile: legend mengalir natural (tanpa margin-top:auto) agar footer profil/logout tetap terlihat */
  .side-legend { margin-top: 0; }
  .side-foot {
    position: sticky;
    bottom: 0;
    margin-top: 8px;
    padding: 10px 0 2px;
    background: linear-gradient(to bottom, transparent, var(--bg) 30%);
  }
  .side-foot .avatar { width: 34px; height: 34px; border-radius: 10px; }
  .side-foot .logout { width: 34px; height: 34px; border-radius: 10px; }
  .sidebar.mobile-open { transform: translateX(0); }

  /* Hamburger menu button */
  .sidebar-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    align-self: center;
  }

  /* Mobile topbar: title left-aligned after hamburger */
  .topbar { padding: 12px 16px; justify-content: flex-start; align-items: center; }
  .hello { flex: 1; padding-left: 10px; }
  .top-actions { margin-left: auto; display: flex; align-items: center; }

  .today-chip { display: none; }
  .content { padding: 12px 16px 56px; }
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .session-row-input { grid-template-columns: 1fr 1fr; }
  .hello-name { font-size: 1.1rem; }
  .cal-day { min-height: 85px; font-size: .65rem; padding: 5px 4px; }
  .cal-event { font-size: 0.67rem; padding: 3px 5px; margin-bottom: 2px; }
  .cal-event .ev-label { display: block; }
  .cal-head div { padding: 8px 3px; font-size: .62rem; }
}

@media (max-width: 600px) {
  .topbar { padding: 14px 16px; }
  .content { padding: 12px 14px 64px; }
  .hello-name { font-size: 1rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 18px; min-height: 100px; }
  .stat-num { font-size: 1.5rem; }
  .month-nav { width: 100%; justify-content: space-between; }
  .month-nav .month-label { min-width: 0; flex: 1; }
  .summary-bar { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .card { padding: 19px; border-radius: var(--r); }
  .stat-card { padding: 16px; min-height: 92px; }
  .stat-num { font-size: 1.35rem; }
  .brand-name { font-size: 1.15rem; }
  .pc-name, .card h3 { font-size: 1rem; }
  .btn { padding: 10px 16px; }
}

/* Larger, comfier tap targets + smoother momentum scroll on touch devices */
@media (hover: none) and (pointer: coarse) {
  .nav-item { padding: 13px 15px; }
  .table-scroll { -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
}

/* ===================== Project view (cards) ===================== */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin-top: 4px; }
.project-card { position: relative; display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; color: var(--ink); transition: transform var(--dur-slow) var(--ease), box-shadow var(--dur-slow) var(--ease), border-color var(--dur) var(--ease); cursor: pointer; }
.project-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); border-color: var(--line-soft); }
.pc-accent { width: 8px; flex-shrink: 0; position: relative; overflow: hidden; }
.pc-accent::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.5), transparent 60%); }
.pc-body { padding: 17px 19px; flex: 1; min-width: 0; }
.pc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 4px; }
.pc-name { font-size: 1rem; font-weight: 700; line-height: 1.25; font-family: var(--font-display); }
.pc-paket { color: var(--muted); font-size: .82rem; margin-bottom: 15px; }
.pc-prog-top { display: flex; justify-content: space-between; font-size: .76rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.pc-bar { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.pc-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #9b8cff);
  animation: fillbar 1s var(--ease) forwards; animation-delay: calc(var(--d,0) * 60ms + 260ms); }
.pc-status-icons { display: flex; gap: 8px; align-items: center; margin: 12px 0 0; }
.si { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; transition: transform .15s; }
.si svg { width: 15px; height: 15px; }
.si-pending { background: var(--surface-2); color: var(--muted); }
.si-active { background: rgba(240,181,75,.16); color: var(--warn); }
.si-done { background: rgba(52,211,153,.16); color: var(--ok); }
.si-na { background: var(--surface-2); color: var(--muted); opacity: .5; }
.si-khusus { background: rgba(251,139,103,.16); color: var(--c-coral); }
.si:hover { transform: scale(1.15); }
.pc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: .78rem; }
.pc-days { font-weight: 700; padding: 4px 11px; border-radius: 999px; background: var(--surface-2); color: var(--ink-soft); }
.pc-days.soon { background: rgba(240,181,75,.16); color: var(--warn); }
.pc-days.late { background: rgba(251,111,106,.16); color: var(--bad); }
.pc-days.ok { background: rgba(52,211,153,.16); color: var(--ok); }
.pc-resepsi { color: var(--muted); }
.acc-0 .pc-accent { background: var(--c-purple); }
.acc-1 .pc-accent { background: var(--c-coral); }
.acc-2 .pc-accent { background: var(--c-blue); }
.acc-3 .pc-accent { background: var(--c-teal); }
.acc-4 .pc-accent { background: var(--c-amber); }
.acc-5 .pc-accent { background: var(--c-pink); }
@keyframes fillbar { to { width: var(--w, 0); } }

/* ===================== Entrance animation (stagger) ===================== */
.anim-stagger > * { opacity: 0; animation: fadeUp .6s var(--ease) forwards; animation-delay: calc(var(--d,0) * 60ms); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px) scale(.99); } to { opacity: 1; transform: none; } }

/* Focus visibility for keyboard navigation (a11y) */
a:focus-visible, button:focus-visible, .btn:focus-visible, .nav-item:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2.5px solid var(--primary); outline-offset: 2px; border-radius: 10px;
}

/* ===================== Light Mode (Booking page) ===================== */
.dark-mode {
  --bg: #fafafa;
  --bg-mesh: none;
  --surface: #ffffff;
  --surface-2: #f9f9f9;
  --surface-3: #f3f3f3;
  --ink: #1a1a1a;
  --ink-soft: #666666;
  --muted: #999999;
  --line: #e0e0e0;
  --line-soft: #f0f0f0;
  --primary-soft: #f0f0f9;
  --body-bg: #fafafa;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .anim-stagger > *, .pc-bar i { opacity: 1 !important; transform: none !important; }
  .pc-bar i { width: var(--w, 0) !important; }
}

/* ===================== Notification Modal ===================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  z-index: 1000;
  padding-top: 70px;
}

.modal-content {
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  max-width: 420px;
  width: 100%;
  margin-right: 16px;
  max-height: 600px;
  display: flex;
  flex-direction: column;
}

.notification-panel {
  background: var(--surface);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--ink);
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--ink-soft);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: var(--ink);
}

.modal-body {
  overflow-y: auto;
  flex: 1;
}

.notification-list {
  padding: 0;
}

.notification-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: background 200ms ease;
}

.notification-item:hover {
  background: var(--surface-2);
}

.notif-content {
  flex: 1;
  min-width: 0;
}

.notif-content h4 {
  margin: 0 0 6px 0;
  font-size: 0.95rem;
  color: var(--ink);
  font-weight: 600;
}

.notif-content p {
  margin: 0 0 6px 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.notif-content small {
  font-size: 0.75rem;
  color: var(--muted);
}

.mark-read-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  color: var(--ok);
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms ease;
  flex-shrink: 0;
}

.mark-read-btn:hover {
  background: var(--surface-2);
  border-color: var(--ok);
}

.empty-state {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .modal {
    align-items: flex-end;
    padding-top: 0;
  }

  .modal-content {
    max-width: 100%;
    margin-right: 0;
    border-radius: 12px 12px 0 0;
    max-height: 70vh;
  }

  /* Settings pages responsive improvements */
  .data-table { font-size: 0.85rem; }
  .data-table th, .data-table td { padding: 10px 8px; }
  .btn-xs { padding: 4px 9px; font-size: 0.75rem; }

  /* Touch targets */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 36px; }
  .btn-xs { min-height: 32px; }

  /* Stack actions in table rows */
  .actions { flex-direction: column; gap: 4px; }

  .kv th { width: auto; }
  .kv { font-size: 0.9rem; }

  /* Table scroll — selalu bisa geser horizontal */
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll .data-table { min-width: 500px; }

  /* filter-row jangan overflow */
  .filter-row { flex-wrap: wrap; gap: 6px; }
  .filter-select { max-width: 100%; }

  /* row-actions di tabel jangan wrap aneh */
  .row-actions { flex-wrap: nowrap; gap: 4px; }
}

/* Form grid styles */
.form-grid {
  display: flex; flex-direction: column; gap: 0;
}
.form-grid fieldset,
.form-grid label,
.form-grid input,
.form-grid select,
.form-grid textarea,
.form-grid .btn,
.form-grid > .hint {
  margin-bottom: 16px;
}

/* Checkbox rows */
.checkbox-row { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.checkbox-row input { margin: 0; width: auto; }

/* Session row input for booking sessions — canonical rule is at line ~530, this overrides margin only */
.session-row-input select,
.session-row-input input { margin-bottom: 0; }

/* Mobile responsive for sessions and forms */
@media (max-width: 820px) {
  .session-row-input { grid-template-columns: 1fr 1fr; gap: 8px; }
  .session-row-input select,
  .session-row-input input { font-size: 0.88rem; padding: 10px 12px; }
  .session-row-input .btn { padding: 6px 10px; font-size: 0.75rem; }
}

@media (max-width: 480px) {
  .form-grid { gap: 0; }
  .form-grid fieldset,
  .form-grid label,
  .form-grid input,
  .form-grid select,
  .form-grid textarea,
  .form-grid .btn {
    margin-bottom: 14px;
  }

  .session-row-input { grid-template-columns: 1fr; }
  .session-row-input .btn { width: 100%; }

  .cal-day { height: auto; min-height: 66px; padding: 3px 2px; }
  .cal-event { font-size: 0.57rem; padding: 2px 3px; border-radius: 5px; gap: 3px; }
  .cal-head div { font-size: .52rem; padding: 6px 1px; }

  .table-scroll { margin: 0; }
  .data-table { font-size: 0.8rem; }
  .data-table th, .data-table td { padding: 8px 6px; }

  .page-head { flex-direction: column; align-items: flex-start; }
  .head-actions { width: 100%; flex-wrap: wrap; }
  .head-actions .btn { flex: 0 0 auto; text-align: center; justify-content: center; }
}

/* ===== Directory / Team Page ===== */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.team-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.team-avatar-wrap { flex-shrink: 0; }
.team-avatar-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line);
}
.team-avatar-initial {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
}
.team-info { flex: 1; min-width: 0; }
.team-name { font-size: 1rem; font-weight: 700; margin: 0 0 6px; }
.team-bio { font-size: 0.82rem; color: var(--muted); margin: 8px 0; line-height: 1.5; }
.team-phone {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  margin: 4px 0 8px;
}
.team-phone:hover { color: var(--accent); }
.team-positions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.badge-pos { background: var(--surface); color: var(--fg); font-size: 0.72rem; }

/* ===== Crew Avatar (small, in table) ===== */
.crew-name-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.crew-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.crew-avatar-initial-sm {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ===== Filter bar ===== */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.card-head h3 { margin: 0; }
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-group {
  display: flex;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: all .18s var(--ease);
  white-space: nowrap;
}
.filter-chip:hover { color: var(--ink); background: var(--surface); }
.filter-chip.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px -2px var(--primary-glow);
}

/* ===================== Accent-text contrast polish ===================== */
.card h4.sub, legend, .addon-cat-title, .alert-banner, .tl-badge { color: var(--t-violet); }
.addon-chip.active { color: var(--t-violet); }
.alert-banner { background: var(--primary-soft); }
.muted, .hint { color: var(--muted); }
.note { color: var(--ink-soft); }

/* ===================== Animated Logo Loader ===================== */
#app-loader {
  position: fixed; inset: 0; z-index: 9999; overflow: hidden;
  display: grid; place-items: center;
  background:
    radial-gradient(900px 520px at 50% 30%, rgba(124,108,255,.16) 0%, transparent 60%),
    var(--bg);
  transition: opacity .6s var(--ease), visibility .6s var(--ease);
}
#app-loader.loaded { opacity: 0; visibility: hidden; pointer-events: none; }
/* skip loader on subsequent in-session loads (set by inline head script) */
html.no-loader #app-loader { display: none !important; }
.loader-inner { display: flex; flex-direction: column; align-items: center; gap: 26px; max-width: 90vw; padding: 0 24px; }
.loader-mark {
  position: relative; width: 84px; height: 84px;
  display: grid; place-items: center;
  animation: loaderFloat 2.4s var(--ease-soft) infinite;
}
.loader-mark::before {
  content: ""; position: absolute; inset: -10px; border-radius: 26px;
  background: conic-gradient(from 0deg, transparent 0%, var(--primary) 25%, transparent 55%);
  filter: blur(2px); opacity: .9;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  animation: loaderSpin 1.1s linear infinite;
}
.loader-logo {
  width: 56px; height: 56px; object-fit: contain;
  border-radius: 16px; display: block;
  animation: loaderPulse 1.8s var(--ease-soft) infinite;
}
.loader-mono {
  width: 56px; height: 56px; border-radius: 17px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), #9b8cff);
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.7rem;
  box-shadow: 0 12px 30px -8px var(--primary-glow);
  animation: loaderPulse 1.8s var(--ease-soft) infinite;
}
.loader-word {
  font-family: var(--font-display); font-weight: 500; font-size: 1.05rem;
  letter-spacing: .42em; text-transform: uppercase; padding-left: .42em;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-soft);
  background: linear-gradient(90deg, var(--muted) 0%, #fff 50%, var(--muted) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: loaderShimmer 2s linear infinite;
}
@keyframes loaderSpin { to { transform: rotate(360deg); } }
@keyframes loaderPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes loaderFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes loaderShimmer { to { background-position: -200% 0; } }

/* ===================== Theme toggle ===================== */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft);
  cursor: pointer; flex-shrink: 0;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.theme-toggle:hover { background: var(--surface-2); color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.theme-toggle .ic { width: 20px; height: 20px; }
.theme-toggle .ic-moon { display: none; }
.theme-toggle .ic-sun { display: block; }
html[data-theme="light"] .theme-toggle .ic-sun { display: none; }
html[data-theme="light"] .theme-toggle .ic-moon { display: block; }
.theme-toggle-float { position: fixed; top: 18px; right: 18px; z-index: 30; box-shadow: var(--shadow-sm); }

/* ===================== Charts ===================== */
.chart-wrap { position: relative; height: 260px; width: 100%; min-width: 0; }
.chart-wrap canvas { max-width: 100% !important; }
@media (max-width: 600px) { .chart-wrap { height: 220px; } }

/* ===================== Scroll / mount reveal ===================== */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
