/* =====================================================================
   ACCOUNTIEONS — Fresh UI Design System
   Plain CSS + Bootstrap 5. Futuristic, depth, subtle 3D, energetic.
   Drop-in for a Bootstrap codebase. Theme via [data-theme] on <html>.
   ===================================================================== */

/* ---------- Fonts ---------- */
/* Display / numbers: Space Grotesk · UI / body: Plus Jakarta Sans */

:root {
  /* Neutrals (shared across themes) */
  --ink:        #0f1424;   /* primary text */
  --ink-2:      #3a4256;   /* secondary text */
  --ink-3:      #6b7385;   /* muted text */
  --ink-4:      #9aa1b2;   /* faint text */
  --line:       #e9ebf3;   /* hairline border */
  --line-2:     #f1f2f8;
  --surface:    #ffffff;   /* card */
  --surface-2:  #fbfbfe;   /* inset */
  --canvas:     #f4f5fb;   /* page bg */

  /* Semantic (shared) */
  --pos:   #12b886;  --pos-soft: #e4f8f0;
  --neg:   #f5436e;  --neg-soft: #ffe8ee;
  --warn:  #f59e0b;  --warn-soft:#fff4e0;
  --info:  #3b82f6;  --info-soft:#e6f0ff;

  /* Radii / shadows */
  --r-sm: 10px;  --r-md: 14px;  --r-lg: 20px;  --r-xl: 26px;
  --sh-1: 0 1px 2px rgba(16,20,36,.04), 0 1px 3px rgba(16,20,36,.06);
  --sh-2: 0 2px 6px rgba(16,20,36,.05), 0 8px 24px rgba(16,20,36,.06);
  --sh-3: 0 4px 12px rgba(16,20,36,.06), 0 18px 48px rgba(16,20,36,.10);
  --sh-pop: 0 12px 32px rgba(16,20,36,.10), 0 30px 70px rgba(16,20,36,.14);

  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-back: cubic-bezier(.34,1.56,.64,1);

  /* ===== DEFAULT THEME = SUNRISE (finalized) ===== */
  --acc:    #7a4dff;
  --acc-2:  #ff6b8b;
  --acc-ink:#6a3df0;
  --acc-soft:#f3ecff;
  --grad:   linear-gradient(135deg,#7a4dff 0%,#ff6b8b 60%,#ff9a6b 100%);
  --grad-hero: linear-gradient(120deg,#7a4dff 0%,#f0567f 55%,#ff8f63 100%);
  --glow:   rgba(245,86,127,.40);
  --glow-soft: rgba(245,86,127,.15);
}

/* ---------- Theme: Sunrise (explicit alias of default) ---------- */
[data-theme="sunrise"] {
  --acc:#7a4dff; --acc-2:#ff6b8b; --acc-ink:#6a3df0; --acc-soft:#f3ecff;
  --grad: linear-gradient(135deg,#7a4dff 0%,#ff6b8b 60%,#ff9a6b 100%);
  --grad-hero: linear-gradient(120deg,#7a4dff 0%,#f0567f 55%,#ff8f63 100%);
  --glow: rgba(245,86,127,.40); --glow-soft: rgba(245,86,127,.15);
}
/* ---------- Theme: Aurora (rich violet) ---------- */
[data-theme="aurora"] {
  --acc:#6c4dff; --acc-2:#9d7bff; --acc-ink:#5a3df0; --acc-soft:#efeaff;
  --grad: linear-gradient(135deg,#6c4dff 0%,#9d7bff 60%,#b79bff 100%);
  --grad-hero: linear-gradient(135deg,#6c4dff 0%,#8a6bff 55%,#a98bff 100%);
  --glow: rgba(108,77,255,.40); --glow-soft: rgba(108,77,255,.16);
}

/* ---------- Theme: Electric (violet + cyan) ---------- */
[data-theme="electric"] {
  --acc:#5b46ff; --acc-2:#19c6ff; --acc-ink:#4836e6; --acc-soft:#e8ecff;
  --grad: linear-gradient(135deg,#5b46ff 0%,#3f8bff 50%,#19c6ff 100%);
  --grad-hero: linear-gradient(120deg,#5b46ff 0%,#3a7bff 55%,#16c2ff 100%);
  --glow: rgba(40,120,255,.42); --glow-soft: rgba(40,120,255,.16);
}
/* ---------- Theme: Mint (indigo + teal, premium) ---------- */
[data-theme="mint"] {
  --acc:#4f46e5; --acc-2:#14b8a6; --acc-ink:#4138c9; --acc-soft:#e9e8fb;
  --grad: linear-gradient(135deg,#4f46e5 0%,#2aa9b0 60%,#14b8a6 100%);
  --grad-hero: linear-gradient(120deg,#4f46e5 0%,#2596a6 55%,#14b8a6 100%);
  --glow: rgba(40,150,166,.38); --glow-soft: rgba(40,150,166,.15);
}

/* ===================================================================== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 14px;
  letter-spacing: -.005em;
}
.num { font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
a { color: var(--acc-ink); text-decoration: none; }
::selection { background: var(--acc-soft); color: var(--acc-ink); }

/* Ambient gradient mesh on the page */
.app-bg {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(60% 50% at 82% 0%, var(--glow-soft), transparent 70%),
    radial-gradient(50% 45% at 0% 12%, var(--glow-soft), transparent 70%),
    radial-gradient(40% 40% at 100% 100%, rgba(18,184,134,.06), transparent 70%);
}

/* ===================== LAYOUT SHELL ===================== */
.shell { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; transition: grid-template-columns .32s var(--ease); }
.shell.nav-collapsed { grid-template-columns: 76px 1fr; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: 0; align-self: start; height: 100vh;
  background: linear-gradient(180deg, #ffffff 0%, #fcfcff 100%);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 14px;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 4px; margin-bottom: 6px; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 12px; flex: 0 0 auto;
  background: var(--grad); color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 18px; box-shadow: 0 6px 16px var(--glow), inset 0 1px 0 rgba(255,255,255,.4);
  font-family: "Space Grotesk"; position: relative; overflow: hidden;
}
.brand-logo::after { content:""; position:absolute; inset:0; background:linear-gradient(120deg,transparent 30%,rgba(255,255,255,.5) 50%,transparent 70%); transform:translateX(-120%); animation: sheen 5s var(--ease) infinite; }
@keyframes sheen { 0%,72%{transform:translateX(-120%)} 86%,100%{transform:translateX(120%)} }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -.02em; white-space: nowrap; }
.brand-sub { font-size: 10.5px; color: var(--ink-4); font-weight: 600; }

.nav-collapse-btn {
  margin-left: auto; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-3); display: grid; place-items: center; cursor: pointer; transition: .2s var(--ease);
}
.nav-collapse-btn:hover { color: var(--acc-ink); border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }

.nav-scroll { overflow-y: auto; flex: 1; margin: 4px -6px 0; padding: 0 6px; }
.nav-scroll::-webkit-scrollbar { width: 6px; }
.nav-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }

.nav-group-label { font-size: 10px; font-weight: 800; letter-spacing: .12em; color: var(--ink-4); text-transform: uppercase; padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px;
  color: var(--ink-2); font-weight: 600; font-size: 13.5px; cursor: pointer; position: relative;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
  white-space: nowrap; user-select: none;
}
.nav-item .nav-ic { width: 20px; height: 20px; flex: 0 0 auto; color: var(--ink-3); transition: color .18s; }
.nav-item .nav-caret { margin-left: auto; width: 15px; height: 15px; color: var(--ink-4); transition: transform .2s; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); transform: translateX(2px); }
.nav-item:hover .nav-ic { color: var(--acc-ink); }
.nav-item.active {
  background: var(--grad); color: #fff;
  box-shadow: 0 8px 20px var(--glow), inset 0 1px 0 rgba(255,255,255,.25);
}
.nav-item.active .nav-ic, .nav-item.active .nav-caret { color: #fff; }
.nav-badge { margin-left: auto; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 20px; background: var(--neg-soft); color: var(--neg); }
.nav-item.active .nav-badge { background: rgba(255,255,255,.22); color: #fff; }

.nav-sub { overflow: hidden; max-height: 0; transition: max-height .3s var(--ease); padding-left: 18px; }
.nav-sub.open { max-height: 420px; }
.nav-subitem { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 9px; color: var(--ink-3); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.nav-subitem::before { content:""; width: 5px; height: 5px; border-radius: 50%; background: var(--ink-4); flex: 0 0 auto; transition: .18s; }
.nav-subitem:hover { color: var(--ink); background: var(--surface-2); }
.nav-subitem.active { color: var(--acc-ink); }
.nav-subitem.active::before { background: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }

/* Collapsed sidebar */
.nav-collapsed .brand-name, .nav-collapsed .brand-sub,
.nav-collapsed .nav-item span.lbl, .nav-collapsed .nav-caret,
.nav-collapsed .nav-group-label, .nav-collapsed .nav-sub,
.nav-collapsed .nav-badge, .nav-collapsed .side-foot-txt { display: none; }
.nav-collapsed .nav-item { justify-content: center; padding: 11px; }
.nav-collapsed .brand { justify-content: center; }
.nav-collapsed .nav-collapse-btn { display: none; }

.side-foot { margin-top: 8px; padding: 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.side-foot-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--acc-soft); color: var(--acc-ink); display: grid; place-items: center; flex: 0 0 auto; }
.side-foot-txt { line-height: 1.25; }

/* ---------- Top bar ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 25; display: flex; align-items: center; gap: 14px;
  padding: 14px 26px; background: rgba(255,255,255,.72); backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.page-title { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.crumb { color: var(--ink-3); font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.crumb b { color: var(--ink); }
.topbar-spacer { flex: 1; }

.nav-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px;
  border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  font-weight: 600; font-size: 13px; cursor: pointer; transition: .18s var(--ease); white-space: nowrap;
}
.nav-pill:hover { border-color: var(--acc); color: var(--acc-ink); box-shadow: 0 0 0 3px var(--acc-soft); transform: translateY(-1px); }
.nav-pill .ic { width: 16px; height: 16px; }
.nav-pill svg { width: 16px; height: 16px; }
.search-pill { min-width: 200px; color: var(--ink-3); }
.search-pill .kbd { margin-left: auto; font-family: "Space Grotesk"; font-size: 11px; background: var(--ink); color: #fff; padding: 2px 6px; border-radius: 6px; }
.icon-btn { width: 36px; height: 36px; padding: 0; justify-content: center; position: relative; }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--neg); border: 2px solid #fff; }

.role-chip { background: var(--grad); color: #fff; border: none; box-shadow: 0 6px 16px var(--glow); }
.role-chip:hover { color: #fff; transform: translateY(-1px); }
.user-chip { display: flex; align-items: center; gap: 9px; }
.avatar { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 12px; box-shadow: 0 4px 10px var(--glow); }
/* Topbar dropdowns — consistent UI font + acc2 look (else they fall back to raw Bootstrap) */
.dropdown-menu { font-family: "Plus Jakarta Sans", system-ui, sans-serif; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-pop); padding: 6px; background: var(--surface); color: var(--ink); }
.dropdown-item { border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--ink-2); padding: 8px 12px; transition: .14s var(--ease); }
.dropdown-item:hover, .dropdown-item:focus { background: var(--acc-soft); color: var(--acc-ink); }
.dropdown-item.active, .dropdown-item:active { background: var(--grad); color: #fff; }
.dropdown-item i.bi { margin-right: 7px; opacity: .85; }
.dropdown-header { font-weight: 800; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); }
.dropdown-divider { border-color: var(--line); }
.user-chip i { color: var(--ink-4); }

/* ---------- Content ---------- */
.content { padding: 26px; max-width: 1640px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; }
.page-head .ph-ic { width: 52px; height: 52px; border-radius: 16px; background: var(--grad); color: #fff; display: grid; place-items: center; flex: 0 0 auto; box-shadow: 0 10px 24px var(--glow), inset 0 1px 0 rgba(255,255,255,.3); }
.page-head .ph-ic svg { width: 26px; height: 26px; }
.page-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin: 0; line-height: 1.05; }
.page-head .ph-sub { color: var(--ink-3); font-weight: 500; margin-top: 4px; font-size: 14px; }

/* ===================== CARDS ===================== */
.card-x {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-2); position: relative;
}
.card-pad { padding: 20px; }
.section-label { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-4); display: flex; align-items: center; gap: 8px; margin: 26px 2px 14px; }
.section-label .ln { flex: 1; height: 1px; background: var(--line); }

/* KPI / stat tile — subtle 3D */
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px; box-shadow: var(--sh-2); position: relative; overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
  transform-style: preserve-3d; will-change: transform;
}
.stat::before { content:""; position:absolute; left:0; top:0; right:0; height:4px; background: var(--grad); opacity:.9; }
.stat.s-pos::before { background: linear-gradient(90deg,var(--pos),#34d8a8); }
.stat.s-neg::before { background: linear-gradient(90deg,var(--neg),#ff8aa3); }
.stat.s-warn::before { background: linear-gradient(90deg,var(--warn),#ffce6b); }
.stat.s-info::before { background: linear-gradient(90deg,var(--info),#7db0ff); }
.stat:hover { box-shadow: var(--sh-pop); }
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.stat-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color:#fff; box-shadow: 0 6px 14px var(--glow-soft); }
.stat-ic svg { width: 20px; height: 20px; }
.ic-acc  { background: var(--grad); box-shadow: 0 6px 14px var(--glow); }
.ic-pos  { background: linear-gradient(135deg,#12b886,#34d8a8); box-shadow:0 6px 14px rgba(18,184,134,.3); }
.ic-neg  { background: linear-gradient(135deg,#f5436e,#ff7d9b); box-shadow:0 6px 14px rgba(245,67,110,.3); }
.ic-warn { background: linear-gradient(135deg,#f59e0b,#ffc24d); box-shadow:0 6px 14px rgba(245,158,11,.3); }
.ic-info { background: linear-gradient(135deg,#3b82f6,#7db0ff); box-shadow:0 6px 14px rgba(59,130,246,.3); }
.stat-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-4); }
.stat-value { font-size: 30px; font-weight: 700; line-height: 1; margin: 4px 0 8px; }
.stat-foot { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.stat-foot .em-neg { color: var(--neg); }
.stat-foot .em-pos { color: var(--pos); }

.trend { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 800; padding: 3px 8px; border-radius: 20px; }
.trend.up { background: var(--pos-soft); color: var(--pos); }
.trend.down { background: var(--neg-soft); color: var(--neg); }
.trend.flat { background: var(--surface-2); color: var(--ink-3); }
.trend svg { width: 13px; height: 13px; }

/* mini sparkline strip */
.spark { display: flex; align-items: flex-end; gap: 3px; height: 22px; }
.spark i { flex: 1; background: var(--acc-soft); border-radius: 3px; min-height: 3px; display: block; }
.spark i.hi { background: var(--grad); }

/* ===================== HERO CARDS (bold moments) ===================== */
.hero-card {
  border-radius: var(--r-xl); padding: 22px; color: #fff; position: relative; overflow: hidden;
  box-shadow: 0 18px 44px var(--glow); isolation: isolate;
}
.hero-card .glo { position:absolute; border-radius:50%; filter: blur(34px); opacity:.5; mix-blend-mode: screen; }
.hero-card .label { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.hero-card .big { font-size: 38px; font-weight: 700; line-height: 1; margin: 6px 0; }
.hg-acc  { background: var(--grad-hero); }
.hg-pos  { background: linear-gradient(135deg,#0fae7e,#15c79a 60%,#2fe0b0); box-shadow:0 18px 44px rgba(18,184,134,.4); }
.hg-info { background: linear-gradient(135deg,#2f6bff,#3aa0ff 60%,#23c2ff); box-shadow:0 18px 44px rgba(40,120,255,.4); }
.hero-tag { display:inline-flex; align-items:center; gap:6px; font-size:11px; font-weight:700; padding:4px 10px; border-radius:20px; background:rgba(255,255,255,.18); backdrop-filter: blur(4px); }
.hero-tag .lv { width:7px;height:7px;border-radius:50%;background:#fff; box-shadow:0 0 0 0 rgba(255,255,255,.7); animation: pulse 2s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(255,255,255,.6)} 70%{box-shadow:0 0 0 8px rgba(255,255,255,0)} 100%{box-shadow:0 0 0 0 rgba(255,255,255,0)} }

/* ===================== BUTTONS ===================== */
.btn-x { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 17px; border-radius: 12px; font-weight: 700; font-size: 13.5px; border: 1px solid transparent; cursor: pointer; transition: .2s var(--ease); white-space: nowrap; }
.btn-x svg { width: 17px; height: 17px; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px var(--glow), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px var(--glow), inset 0 1px 0 rgba(255,255,255,.3); color:#fff; }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--line); box-shadow: var(--sh-1); }
.btn-ghost:hover { border-color: var(--acc); color: var(--acc-ink); box-shadow: 0 0 0 3px var(--acc-soft); }
.btn-soft { background: var(--acc-soft); color: var(--acc-ink); }
.btn-soft:hover { background: var(--acc); color: #fff; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }

/* chips/segmented */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 2px; }
.seg button { border: none; background: transparent; color: var(--ink-3); font-weight: 700; font-size: 12.5px; padding: 6px 13px; border-radius: 9px; cursor: pointer; transition: .18s; }
.seg button.on { background: #fff; color: var(--acc-ink); box-shadow: var(--sh-1); }

.badge-x { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.badge-x .d { width: 6px; height: 6px; border-radius: 50%; }
.bx-pos { background: var(--pos-soft); color: var(--pos); } .bx-pos .d{background:var(--pos);}
.bx-warn{ background: var(--warn-soft); color: #c97a06; } .bx-warn .d{background:var(--warn);}
.bx-neg { background: var(--neg-soft); color: var(--neg); } .bx-neg .d{background:var(--neg);}
.bx-info{ background: var(--info-soft); color: var(--info); } .bx-info .d{background:var(--info);}
.bx-acc { background: var(--acc-soft); color: var(--acc-ink); } .bx-acc .d{background:var(--acc);}

/* ===================== TABLE ===================== */
.tbl-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-2); overflow: hidden; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead th { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-4); text-align: left; padding: 14px 18px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.tbl tbody td { padding: 14px 18px; border-bottom: 1px solid var(--line-2); vertical-align: middle; font-size: 13.5px; color: var(--ink-2); }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--acc-soft); }
.tbl tbody tr:last-child td { border-bottom: none; }
.cust { display: flex; align-items: center; gap: 12px; }
.cust .av { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 12.5px; flex: 0 0 auto; box-shadow: var(--sh-1); }
.cust .nm { font-weight: 700; color: var(--ink); }
.cust .nm a { color: var(--ink); }
.cust .nm a:hover { color: var(--acc-ink); }
.cust .meta { font-size: 11.5px; color: var(--ink-4); }
.gst-chip { font-family: "Space Grotesk"; font-size: 11px; font-weight: 600; background: var(--acc-soft); color: var(--acc-ink); padding: 2px 7px; border-radius: 6px; letter-spacing: .02em; }
.row-act { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; color: var(--ink-3); cursor: pointer; transition: .15s; }
.row-act:hover { background: var(--acc-soft); color: var(--acc-ink); }
.row-act svg { width: 16px; height: 16px; }

/* avatar color variants */
.av-1{background:linear-gradient(135deg,#12b886,#34d8a8);} .av-2{background:linear-gradient(135deg,#f59e0b,#ffc24d);}
.av-3{background:linear-gradient(135deg,#3b82f6,#7db0ff);} .av-4{background:linear-gradient(135deg,#6c4dff,#9d7bff);}
.av-5{background:linear-gradient(135deg,#f5436e,#ff8aa3);} .av-6{background:linear-gradient(135deg,#0ea5e9,#67d3ff);}
.av-7{background:linear-gradient(135deg,#8b5cf6,#c4a3ff);} .av-8{background:linear-gradient(135deg,#14b8a6,#5ee0d2);}

/* ===================== FORMS ===================== */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 7px; }
.field label .req { color: var(--neg); }
.inp, .sel, textarea.inp {
  width: 100%; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface);
  padding: 0 14px; font-size: 14px; font-family: inherit; color: var(--ink); transition: .18s var(--ease); outline: none;
}
textarea.inp { height: auto; padding: 12px 14px; resize: vertical; min-height: 96px; line-height: 1.5; }
.inp::placeholder { color: var(--ink-4); }
.inp:focus, .sel:focus, textarea.inp:focus { border-color: var(--acc); box-shadow: 0 0 0 4px var(--acc-soft); }
.inp:hover, .sel:hover { border-color: #d4d7e4; }
.inp-group { display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; transition: .18s; }
.inp-group:focus-within { border-color: var(--acc); box-shadow: 0 0 0 4px var(--acc-soft); }
.inp-group .adorn { display: grid; place-items: center; padding: 0 13px; background: var(--surface-2); color: var(--ink-3); font-weight: 700; border-right: 1.5px solid var(--line); }
.inp-group input, .inp-group select { border: none; outline: none; height: 44px; padding: 0 14px; font-size: 14px; flex: 1; background: transparent; font-family: inherit; color: var(--ink); min-width: 0; }
.field-hint { font-size: 11.5px; color: var(--ink-4); margin-top: 6px; }

.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-2); overflow: hidden; margin-bottom: 20px; }
.form-card-head { display: flex; align-items: center; gap: 11px; padding: 16px 22px; border-bottom: 1px solid var(--line-2); }
.form-card-head .fc-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--acc-soft); color: var(--acc-ink); display: grid; place-items: center; }
.form-card-head .fc-ic svg { width: 18px; height: 18px; }
.form-card-head .fc-t { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.form-card-body { padding: 22px; }

/* segmented type toggle (Good / Service, Individual / Business) */
.type-toggle { display: inline-flex; gap: 8px; }
.type-opt { display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-weight: 700; font-size: 13px; color: var(--ink-2); cursor: pointer; transition: .18s var(--ease); white-space: nowrap; }
.type-opt svg { width: 17px; height: 17px; }
.type-opt:hover { border-color: var(--acc); }
.type-opt.on { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 8px 18px var(--glow); }

/* checkbox */
.chk { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; color: var(--ink-2); font-size: 13.5px; }
.chk input { display: none; }
.chk .box { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line); background: #fff; display: grid; place-items: center; transition: .18s; }
.chk .box svg { width: 15px; height: 15px; color: #fff; opacity: 0; transform: scale(.5); transition: .18s var(--ease-back); }
.chk input:checked + .box { background: var(--grad); border-color: transparent; box-shadow: 0 4px 10px var(--glow); }
.chk input:checked + .box svg { opacity: 1; transform: scale(1); }

/* toggle switch */
.tgl { width: 46px; height: 27px; border-radius: 20px; background: #d8dbe8; position: relative; cursor: pointer; transition: .25s var(--ease); flex: 0 0 auto; }
.tgl::after { content:""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: .25s var(--ease-back); }
.tgl.on { background: var(--grad); box-shadow: 0 4px 12px var(--glow); }
.tgl.on::after { left: 22px; }

/* ===================== LISTS / MISC ===================== */
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.list-row:last-child { border-bottom: none; }
.mini-av { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 12px; flex: 0 0 auto; box-shadow: var(--sh-1); }

/* settings tile */
.set-tile { display: flex; gap: 14px; padding: 18px; border-radius: var(--r-md); border: 1px solid var(--line); background: #fff; cursor: pointer; transition: .22s var(--ease); position: relative; }
.set-tile:hover { border-color: var(--acc); box-shadow: var(--sh-3); transform: translateY(-2px); }
.set-tile .st-ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; flex: 0 0 auto; }
.set-tile .st-ic svg { width: 22px; height: 22px; }

/* timeline */
.tl { position: relative; padding-left: 26px; }
.tl::before { content:""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--line),transparent); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item::before { content:""; position: absolute; left: -23px; top: 4px; width: 11px; height: 11px; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.tl-item.g::before { background: var(--pos); } .tl-item.v::before { background: var(--acc); } .tl-item.o::before { background: var(--warn); }

/* quick action */
.qa { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: #fff; cursor: pointer; transition: .22s var(--ease); }
.qa:hover { border-color: var(--acc); transform: translateY(-3px); box-shadow: var(--sh-3); }
.qa .qa-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.qa .qa-ic svg { width: 20px; height: 20px; }
.qa .qa-t { font-weight: 700; font-size: 13px; color: var(--ink); }

/* progress */
.bar { height: 9px; border-radius: 20px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 20px; background: var(--grad); box-shadow: 0 0 12px var(--glow); transition: width 1.2s var(--ease); }

/* countdown */
.cd-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 4px; text-align: center; }
.cd-box .n { font-size: 26px; font-weight: 700; line-height: 1; color: var(--ink); }
.cd-box .u { font-size: 9.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-4); margin-top: 4px; }

/* footer */
.foot { display: flex; align-items: center; gap: 16px; padding: 20px 26px; color: var(--ink-4); font-size: 12.5px; font-weight: 500; border-top: 1px solid var(--line); margin-top: 14px; }
.foot a { color: var(--ink-3); font-weight: 600; }
.foot .heart { color: var(--neg); }

/* ===================== THEME SWITCHER (FAB) ===================== */
.theme-fab { position: fixed; right: 22px; bottom: 22px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.theme-panel { background: rgba(255,255,255,.86); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--sh-pop); padding: 14px; width: 234px; transform-origin: bottom right; transition: .28s var(--ease-back); }
.theme-panel.hide { opacity: 0; transform: scale(.85) translateY(10px); pointer-events: none; }
.theme-panel h6 { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-4); margin: 2px 2px 11px; }
.swatch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.swatch { border: 1.5px solid var(--line); border-radius: 13px; padding: 9px; cursor: pointer; transition: .18s var(--ease); background: #fff; }
.swatch:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.swatch.on, .swatch.sel { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.swatch .sw-bar { height: 30px; border-radius: 9px; margin-bottom: 7px; box-shadow: inset 0 1px 0 rgba(255,255,255,.3); }
.swatch .sw-nm { font-size: 11.5px; font-weight: 700; color: var(--ink-2); text-align: center; }
.fab-btn { width: 56px; height: 56px; border-radius: 50%; background: var(--grad); color: #fff; border: none; display: grid; place-items: center; cursor: pointer; box-shadow: 0 12px 30px var(--glow); transition: .25s var(--ease-back); }
.fab-btn:hover { transform: scale(1.08) rotate(15deg); }
.fab-btn svg { width: 24px; height: 24px; }

/* ===================== ANIMATIONS / REVEAL ===================== */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
/* Resting state is VISIBLE — animation is additive only, so content never
   depends on JS or animation support to render. */
.reveal { opacity: 1; }
.reveal.anim { animation: rise .6s var(--ease) both; }
.reveal-on { opacity: 1 !important; }
@media (prefers-reduced-motion: reduce){ .reveal.anim { animation: none; } }
[data-d="1"]{animation-delay:.04s}[data-d="2"]{animation-delay:.10s}[data-d="3"]{animation-delay:.16s}
[data-d="4"]{animation-delay:.22s}[data-d="5"]{animation-delay:.28s}[data-d="6"]{animation-delay:.34s}
[data-d="7"]{animation-delay:.40s}[data-d="8"]{animation-delay:.46s}

@keyframes growbar { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* grid helpers */
.g { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2,1fr); }
.g-3 { grid-template-columns: repeat(3,1fr); }
.g-4 { grid-template-columns: repeat(4,1fr); }
@media (max-width: 1280px){ .g-4{grid-template-columns:repeat(2,1fr);} }
@media (max-width: 1100px){ .g-3{grid-template-columns:1fr;} .g-2{grid-template-columns:1fr;} }

/* ============================================================
   RESPONSIVE — mobile/tablet drawer sidebar + adaptive shell
   ============================================================ */
.nav-toggle { display: none; }      /* hamburger — desktop hidden */
.nav-backdrop { display: none; }

@media (max-width: 1024px) {
  /* Single-column shell; sidebar floats as an off-canvas drawer. */
  .shell, .shell.nav-collapsed { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; height: 100vh; width: 274px; max-width: 84vw;
    transform: translateX(-100%); transition: transform .28s var(--ease);
    box-shadow: 0 0 50px rgba(16,20,36,.22); z-index: 200;
  }
  .shell.nav-open .sidebar { transform: translateX(0); }

  /* On mobile the drawer is always full — never the icon-only collapsed state. */
  .nav-collapsed .brand-name, .nav-collapsed .brand-sub,
  .nav-collapsed .nav-item span.lbl, .nav-collapsed .nav-caret,
  .nav-collapsed .nav-group-label, .nav-collapsed .nav-sub,
  .nav-collapsed .nav-badge, .nav-collapsed .side-foot-txt { display: revert; }
  .nav-collapsed .nav-item { justify-content: flex-start; padding: 9px 12px; }
  .nav-collapse-btn { display: none; }

  /* Dimmed backdrop behind the open drawer. */
  .nav-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(15,20,36,.45);
    opacity: 0; visibility: hidden; transition: opacity .28s var(--ease); z-index: 150;
  }
  .shell.nav-open .nav-backdrop { opacity: 1; visibility: visible; }
  body.nav-locked { overflow: hidden; }

  /* Hamburger appears; tighten the topbar + content. */
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; flex: 0 0 auto; border-radius: 11px;
    border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer;
  }
  .nav-toggle:hover { color: var(--acc-ink); border-color: var(--acc); }
  .topbar { padding: 11px 14px; gap: 10px; }
  .content { padding: 18px 14px; }
  .search-pill { display: none; }   /* Cmd/Ctrl+K palette still works */

  /* Wide tables scroll horizontally instead of breaking the layout. */
  .card, .tbl-scroll, .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: max-content; }
}

@media (max-width: 560px) {
  .content { padding: 14px 11px; }
  .topbar { gap: 7px; }
  .page-head { gap: 12px; margin-bottom: 16px; }
  .page-head h1 { font-size: 23px; }
  .page-head .ph-ic { width: 44px; height: 44px; }
  .page-head .ph-ic svg { width: 22px; height: 22px; }
  /* Collapse 2-up grids fully on phones. */
  .g-4, .g-3, .g-2 { grid-template-columns: 1fr; }
  .crumb { font-size: 12px; }
  /* Hide the long brand/company labels in the topbar to save room. */
  .nav-pill .d-none { display: none !important; }
}

/* bar chart (revenue vs expense) */
.barchart { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; height: 220px; padding: 8px 6px 0; }
.bg-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 9px; height: 100%; justify-content: flex-end; }
.bg-pair { display: flex; align-items: flex-end; gap: 5px; height: 100%; width: 100%; justify-content: center; }
.bg-bar { width: 14px; border-radius: 6px 6px 3px 3px; transform-origin: bottom; animation: growbar .9s var(--ease) both; }
.bg-rev { background: var(--grad); box-shadow: 0 4px 10px var(--glow-soft); }
.bg-exp { background: linear-gradient(180deg,#ff8a5b,#f5436e); box-shadow: 0 4px 10px rgba(245,67,110,.18); }
.bg-col:hover .bg-bar { filter: brightness(1.05) saturate(1.1); }
.bg-lbl { font-size: 11px; font-weight: 700; color: var(--ink-4); }
.legend { display: inline-flex; align-items: center; gap: 16px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.legend .sw { width: 11px; height: 11px; border-radius: 4px; }

.soft-divider { height: 1px; background: var(--line); margin: 0; border: none; }
.text-muted-x { color: var(--ink-3); }
.text-faint { color: var(--ink-4); }

/* ===== Rotating reminder ticker (hero) ===== */
.ticker { display: flex; align-items: center; gap: 11px; }
.ticker-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 800; letter-spacing: .09em; padding: 5px 11px; border-radius: 20px; background: rgba(255,255,255,.2); flex: 0 0 auto; }
.ticker-badge .lv { width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0 rgba(255,255,255,.7); animation: pulse 2s infinite; }
.ticker-view { height: 22px; overflow: hidden; position: relative; flex: 1; min-width: 0; }
.ticker-line { position: absolute; left: 0; right: 0; top: 0; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker-line.anim { animation: tickerUp .55s var(--ease); }
@keyframes tickerUp { from { transform: translateY(115%); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== Auto-swipe daily-stat carousel (hero) ===== */
.swiper { position: relative; min-height: 150px; }
.swipe-slide { position: absolute; inset: 0; opacity: 0; transform: translateX(46px); transition: transform .6s var(--ease), opacity .5s var(--ease); pointer-events: none; }
.swipe-slide.on { opacity: 1; transform: none; pointer-events: auto; }
.swipe-slide.out { opacity: 0; transform: translateX(-46px); }
.swipe-dots { position: absolute; bottom: 0; left: 0; display: flex; gap: 6px; }
.swipe-dots i { width: 7px; height: 7px; border-radius: 20px; background: rgba(255,255,255,.4); transition: .3s var(--ease); cursor: pointer; }
.swipe-dots i.on { width: 20px; background: #fff; }

/* =====================================================================
   DARK MODE  —  toggle via [data-mode="dark"] on <html>.
   Only neutral/surface tokens flip; the accent theme stays as chosen,
   so Sunrise (or any user accent) works in both light and dark.
   ===================================================================== */
[data-mode="dark"] {
  --ink:        #eef1f8;
  --ink-2:      #c3c8d6;
  --ink-3:      #9097a8;
  --ink-4:      #6b7385;
  --line:       #272d3e;
  --line-2:     #1d2231;
  --surface:    #161b29;
  --surface-2:  #1c2230;
  --canvas:     #0d1018;

  --acc-soft:   color-mix(in srgb, var(--acc) 24%, transparent);
  --acc-ink:    color-mix(in srgb, var(--acc) 38%, #ffffff);
  --pos-soft:   color-mix(in srgb, var(--pos) 22%, transparent);
  --neg-soft:   color-mix(in srgb, var(--neg) 22%, transparent);
  --warn-soft:  color-mix(in srgb, var(--warn) 22%, transparent);
  --info-soft:  color-mix(in srgb, var(--info) 22%, transparent);

  --sh-1: 0 1px 2px rgba(0,0,0,.4);
  --sh-2: 0 2px 8px rgba(0,0,0,.45);
  --sh-3: 0 10px 30px rgba(0,0,0,.5);
  --sh-pop: 0 20px 54px rgba(0,0,0,.6);
}
/* surfaces that hardcode white in light mode */
[data-mode="dark"] .nav-pill,
[data-mode="dark"] .btn-ghost,
[data-mode="dark"] .type-opt,
[data-mode="dark"] .inp-group,
[data-mode="dark"] .set-tile,
[data-mode="dark"] .qa,
[data-mode="dark"] .seg button.on,
[data-mode="dark"] .swatch,
[data-mode="dark"] .chk .box,
[data-mode="dark"] .nav-collapse-btn { background: var(--surface); }
[data-mode="dark"] .sidebar { background: linear-gradient(180deg, #161b29, #1c2230); }
[data-mode="dark"] .topbar { background: rgba(13,16,24,.74); }
[data-mode="dark"] .theme-panel { background: rgba(22,27,41,.92); }
[data-mode="dark"] .seg { background: var(--surface-2); }
[data-mode="dark"] .bx-warn { color: #ffce6b; }
[data-mode="dark"] .nav-item.active .nav-ic,
[data-mode="dark"] .nav-item.active .lbl { color: #fff; }
[data-mode="dark"] .lp-nav { background: rgba(13,16,24,.8) !important; }
[data-mode="dark"] .num.text-faint, [data-mode="dark"] .kbd { color: var(--ink-3); }
[data-mode="dark"] .brand-name, [data-mode="dark"] .page-head h1 { color: var(--ink); }
