/* ===================================================================
   MONEY MANAGEMENT PRO — Core Stylesheet
   Design system: emerald + warm gold, Lexend/Inter/JetBrains Mono
   =================================================================== */

:root{
  /* ---- Color tokens ---- */
  --bg:            #F5F8F7;
  --surface:       #FFFFFF;
  --surface-2:     #FBFCFC;
  --ink:           #16212B;
  --ink-2:         #45525F;
  --muted:         #8A95A1;

  --primary:       #146C5B;
  --primary-600:   #0F5446;
  --primary-700:   #0C4238;
  --primary-100:   #E3F2EE;
  --primary-50:    #F1F8F6;

  --gold:          #C68A2E;
  --gold-ink:      #8A611D;
  --gold-100:      #FBF1DE;

  --success:       #1FAA59;
  --success-100:   #E6F7ED;
  --danger:        #E5484D;
  --danger-100:    #FDEBEC;
  --info:          #3B6FD4;
  --info-100:      #EAF1FC;
  --warn:          #C68A2E;

  --border:        #E7EBEE;
  --border-soft:   #EFF2F4;

  --radius-lg:     18px;
  --radius:        14px;
  --radius-sm:     10px;
  --radius-pill:   999px;

  --shadow-xs:     0 1px 2px rgba(16,24,32,.05);
  --shadow-sm:     0 2px 8px rgba(16,24,32,.05), 0 1px 2px rgba(16,24,32,.04);
  --shadow-md:     0 10px 28px rgba(16,24,32,.07), 0 2px 6px rgba(16,24,32,.05);
  --shadow-lg:     0 24px 56px rgba(16,24,32,.12);

  --font-display:  'Lexend', 'Inter', sans-serif;
  --font-body:     'Inter', sans-serif;
  --font-mono:     'JetBrains Mono', monospace;

  --sidebar-w:     268px;
  --topbar-h:      74px;
}

*{ box-sizing:border-box; }

html,body{ height:100%; }

body{
  font-family:var(--font-body);
  background:var(--bg);
  color:var(--ink);
  font-size:14.5px;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}

h1,h2,h3,h4,h5,h6{ font-family:var(--font-display); color:var(--ink); font-weight:600; letter-spacing:-.01em; }

a{ text-decoration:none; color:var(--primary); }
a:hover{ color:var(--primary-600); }

.num,.mono{ font-family:var(--font-mono); font-feature-settings:"tnum"; letter-spacing:-.01em; }

::selection{ background:var(--primary-100); }

:focus-visible{ outline:2px solid var(--primary); outline-offset:2px; border-radius:6px; }

/* scrollbars */
::-webkit-scrollbar{ width:8px; height:8px; }
::-webkit-scrollbar-thumb{ background:#D7DEE3; border-radius:8px; }
::-webkit-scrollbar-track{ background:transparent; }

/* reduced motion */
@media (prefers-reduced-motion: reduce){
  *{ animation-duration:.001ms !important; transition-duration:.001ms !important; }
}

/* ===================================================================
   LOGIN PAGE
   =================================================================== */
.auth-page{
  min-height:100vh;
  display:flex;
  background:var(--surface);
}
.auth-form-side{
  flex:0 0 46%;
  max-width:560px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:56px 64px;
  position:relative;
}
.auth-brand{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:48px;
}
.auth-brand .brand-mark{
  width:42px; height:42px;
  border-radius:11px;
  background:linear-gradient(155deg,var(--primary) 0%,var(--primary-700) 100%);
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-size:18px;
  box-shadow:var(--shadow-sm);
}
.auth-brand .brand-name{ font-family:var(--font-display); font-weight:700; font-size:19px; color:var(--ink); }
.auth-brand .brand-name small{ display:block; font-family:var(--font-body); font-weight:500; font-size:11.5px; color:var(--muted); letter-spacing:.06em; text-transform:uppercase; margin-top:1px; }

.auth-form-side h1{ font-size:28px; margin-bottom:6px; }
.auth-form-side .auth-sub{ color:var(--muted); margin-bottom:34px; font-size:14.5px; }

.form-field label{ font-size:12.5px; font-weight:600; color:var(--ink-2); margin-bottom:6px; display:block; text-transform:uppercase; letter-spacing:.04em; }
.form-control, .form-select{
  border:1.5px solid var(--border);
  border-radius:var(--radius-sm);
  padding:12px 14px;
  font-size:14.5px;
  background:var(--surface-2);
  transition:border-color .15s, box-shadow .15s, background .15s;
}
.form-control:focus, .form-select:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 4px var(--primary-100);
  background:#fff;
}
.input-icon-group{ position:relative; }
.input-icon-group i.field-icon{ position:absolute; left:14px; top:50%; transform:translateY(-50%); color:var(--muted); font-size:14px; }
.input-icon-group .form-control{ padding-left:38px; }
.input-icon-group .toggle-pass{ position:absolute; right:12px; top:50%; transform:translateY(-50%); color:var(--muted); cursor:pointer; background:none; border:none; font-size:13.5px; }

.btn{
  font-family:var(--font-display);
  font-weight:600;
  border-radius:var(--radius-sm);
  padding:10px 18px;
  font-size:14px;
  letter-spacing:-.005em;
  transition:transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.btn:active{ transform:translateY(1px) scale(.99); }
.btn-primary{ background:var(--primary); border-color:var(--primary); box-shadow:0 1px 2px rgba(20,108,91,.15); }
.btn-primary:hover{ background:var(--primary-600); border-color:var(--primary-600); box-shadow:0 6px 16px rgba(20,108,91,.28); }
.btn-gold{ background:var(--gold); border-color:var(--gold); color:#fff; }
.btn-gold:hover{ background:#B07A24; color:#fff; box-shadow:0 6px 16px rgba(198,138,46,.3); }
.btn-outline-soft{ background:#fff; border:1.5px solid var(--border); color:var(--ink-2); }
.btn-outline-soft:hover{ border-color:var(--primary); color:var(--primary); background:var(--primary-50); }
.btn-light-soft{ background:var(--surface-2); border:1.5px solid var(--border); color:var(--ink-2); }
.btn-block-lg{ width:100%; padding:13px 18px; font-size:15px; }

.auth-form-side .form-check-label{ font-size:13.5px; color:var(--ink-2); }
.auth-form-side .forgot-link{ font-size:13.5px; font-weight:600; }

.auth-divider{ display:flex; align-items:center; gap:14px; margin:26px 0; color:var(--muted); font-size:12.5px; }
.auth-divider::before, .auth-divider::after{ content:""; flex:1; height:1px; background:var(--border); }

.auth-social-row{ display:flex; gap:12px; }
.auth-social-row .btn{ flex:1; display:flex; align-items:center; justify-content:center; gap:8px; }

.auth-footnote{ margin-top:30px; font-size:13.5px; color:var(--muted); }

/* illustration side */
.auth-visual-side{
  flex:1;
  position:relative;
  background:linear-gradient(165deg,#0F5446 0%, #146C5B 46%, #1B8B71 100%);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:60px;
  color:#fff;
}
.auth-visual-side .glow{ position:absolute; border-radius:50%; filter:blur(50px); opacity:.35; }
.auth-visual-side .glow-1{ width:340px; height:340px; background:#39C8A4; top:-80px; right:-80px; }
.auth-visual-side .glow-2{ width:260px; height:260px; background:#D4A24C; bottom:-60px; left:-40px; }

.visual-grid-pattern{
  position:absolute; inset:0;
  background-image:radial-gradient(rgba(255,255,255,.10) 1px, transparent 1px);
  background-size:26px 26px;
  opacity:.5;
}

.auth-visual-content{ position:relative; z-index:2; max-width:440px; }
.auth-visual-content h2{ color:#fff; font-size:30px; line-height:1.25; margin-bottom:14px; }
.auth-visual-content p{ color:rgba(255,255,255,.78); font-size:15px; line-height:1.6; }

.float-card{
  position:absolute;
  background:rgba(255,255,255,.97);
  border-radius:var(--radius);
  padding:16px 18px;
  box-shadow:0 24px 48px rgba(0,0,0,.22);
  color:var(--ink);
  animation:floatY 5s ease-in-out infinite;
}
.float-card.fc-1{ top:9%; right:8%; animation-delay:0s; }
.float-card.fc-2{ bottom:13%; right:14%; animation-delay:1.2s; }
.float-card .fc-label{ font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.05em; font-weight:600; }
.float-card .fc-value{ font-family:var(--font-mono); font-size:19px; font-weight:700; color:var(--primary-700); margin-top:2px; }
.float-card .fc-chip{ display:inline-flex; align-items:center; gap:4px; font-size:11.5px; font-weight:700; color:var(--success); margin-top:4px; }

@keyframes floatY{ 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(-10px); } }

.auth-stats-row{ display:flex; gap:28px; margin-top:38px; position:relative; z-index:2; }
.auth-stats-row .stat b{ display:block; font-size:21px; font-family:var(--font-mono); }
.auth-stats-row .stat span{ font-size:12px; color:rgba(255,255,255,.7); }

@media (max-width: 991px){
  .auth-visual-side{ display:none; }
  .auth-form-side{ flex:1; max-width:100%; padding:40px 7%; }
}

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

.sidebar{
  width:var(--sidebar-w);
  flex:0 0 var(--sidebar-w);
  background:var(--surface);
  border-right:1px solid var(--border-soft);
  position:fixed;
  top:0; left:0; bottom:0;
  z-index:1040;
  display:flex;
  flex-direction:column;
  transition:transform .28s cubic-bezier(.4,0,.2,1);
}

.sidebar-brand{
  display:flex; align-items:center; gap:11px;
  padding:22px 22px 18px;
  border-bottom:1px solid var(--border-soft);
}
.sidebar-brand .brand-mark{
  width:38px; height:38px; border-radius:10px;
  background:linear-gradient(155deg,var(--primary) 0%,var(--primary-700) 100%);
  display:flex; align-items:center; justify-content:center; color:#fff; font-size:16px;
  flex:0 0 auto;
}
.sidebar-brand .brand-name{ font-family:var(--font-display); font-weight:700; font-size:16px; line-height:1.15; }
.sidebar-brand .brand-name small{ display:block; font-weight:500; font-size:10.5px; color:var(--muted); letter-spacing:.07em; text-transform:uppercase; margin-top:2px; }

.sidebar-nav{ flex:1; overflow-y:auto; padding:18px 14px 18px; }
.nav-section-label{
  font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.09em;
  color:var(--muted); padding:14px 12px 8px;
}
.nav-section-label:first-child{ padding-top:2px; }

.sidebar-nav .nav-link{
  display:flex; align-items:center; gap:12px;
  padding:10.5px 12px;
  border-radius:10px;
  color:var(--ink-2);
  font-size:14px;
  font-weight:500;
  font-family:var(--font-display);
  position:relative;
  margin-bottom:2px;
  cursor:pointer;
  transition:background .15s, color .15s;
}
.sidebar-nav .nav-link i{ width:18px; text-align:center; font-size:15px; color:var(--muted); transition:color .15s; }
.sidebar-nav .nav-link:hover{ background:var(--surface-2); color:var(--ink); }
.sidebar-nav .nav-link:hover i{ color:var(--ink-2); }
.sidebar-nav .nav-link.active{ background:var(--primary-100); color:var(--primary-700); }
.sidebar-nav .nav-link.active i{ color:var(--primary); }
.sidebar-nav .nav-link.active::before{
  content:""; position:absolute; left:-14px; top:8px; bottom:8px; width:3px;
  background:var(--primary); border-radius:0 4px 4px 0;
}
.sidebar-nav .nav-link .nav-badge{
  margin-left:auto; font-size:10.5px; font-weight:700; padding:1px 7px;
  border-radius:var(--radius-pill); background:var(--gold-100); color:var(--gold-ink);
}

.sidebar-foot{
  padding:16px; border-top:1px solid var(--border-soft);
}
.upgrade-card{
  background:linear-gradient(155deg,var(--primary-700), var(--primary));
  border-radius:var(--radius);
  padding:16px;
  color:#fff;
}
.upgrade-card h6{ color:#fff; font-size:13px; margin-bottom:4px; }
.upgrade-card p{ font-size:11.5px; color:rgba(255,255,255,.75); margin-bottom:10px; line-height:1.4; }
.upgrade-card .btn{ font-size:12px; padding:7px 12px; }

.sidebar-backdrop{
  position:fixed; inset:0; background:rgba(15,25,30,.45); z-index:1030; opacity:0; visibility:hidden;
  transition:opacity .2s ease;
}

.main-wrap{
  flex:1;
  margin-left:var(--sidebar-w);
  display:flex; flex-direction:column;
  min-width:0;
}

.topbar{
  height:var(--topbar-h);
  background:rgba(255,255,255,.92);
  backdrop-filter:saturate(180%) blur(10px);
  border-bottom:1px solid var(--border-soft);
  display:flex; align-items:center; gap:16px;
  padding:0 28px;
  position:sticky; top:0; z-index:1020;
}
.sidebar-toggle-btn{
  display:none; border:1.5px solid var(--border); background:#fff; border-radius:10px;
  width:38px; height:38px; align-items:center; justify-content:center; color:var(--ink-2); flex:0 0 auto;
}
.topbar-search{ position:relative; flex:0 1 380px; }
.topbar-search input{
  border:1.5px solid var(--border); background:var(--surface-2); border-radius:var(--radius-pill);
  padding:10px 16px 10px 40px; font-size:13.5px; width:100%;
  transition:border-color .15s, box-shadow .15s, background .15s;
}
.topbar-search input:focus{ outline:none; border-color:var(--primary); box-shadow:0 0 0 4px var(--primary-100); background:#fff; }
.topbar-search i{ position:absolute; left:15px; top:50%; transform:translateY(-50%); color:var(--muted); font-size:13px; }
.topbar-search kbd{
  position:absolute; right:10px; top:50%; transform:translateY(-50%);
  font-size:10.5px; color:var(--muted); border:1px solid var(--border); border-radius:5px; padding:1px 6px; background:#fff;
}

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

.icon-btn{
  width:40px; height:40px; border-radius:10px; border:1.5px solid var(--border); background:#fff;
  display:flex; align-items:center; justify-content:center; color:var(--ink-2); position:relative; font-size:15px;
  transition:border-color .15s, color .15s, background .15s;
}
.icon-btn:hover{ border-color:var(--primary); color:var(--primary); background:var(--primary-50); }
.icon-btn .dot{ position:absolute; top:8px; right:8px; width:8px; height:8px; border-radius:50%; background:var(--danger); border:1.5px solid #fff; }

.topbar-divider{ width:1px; height:26px; background:var(--border); margin:0 2px; }

.profile-chip{ display:flex; align-items:center; gap:10px; cursor:pointer; padding:5px 10px 5px 6px; border-radius:var(--radius-pill); transition:background .15s; }
.profile-chip:hover{ background:var(--surface-2); }
.avatar{
  width:36px; height:36px; border-radius:50%; background:linear-gradient(155deg,var(--gold),#A06B1C);
  display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700; font-size:13px; font-family:var(--font-display);
  flex:0 0 auto;
}
.profile-chip .pc-meta{ line-height:1.2; }
.profile-chip .pc-meta b{ display:block; font-size:13px; font-family:var(--font-display); }
.profile-chip .pc-meta span{ font-size:11.5px; color:var(--muted); }

.page-content{ padding:26px 28px 60px; max-width:1480px; width:100%; }

.page-head{ display:flex; align-items:flex-end; justify-content:space-between; flex-wrap:wrap; gap:14px; margin-bottom:22px; }
.page-head h1{ font-size:23px; margin-bottom:4px; }
.breadcrumb-eyebrow{ font-size:12px; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.06em; }
.breadcrumb-eyebrow i{ font-size:10px; margin:0 6px; }
.page-head .head-actions{ display:flex; gap:10px; flex-wrap:wrap; }

/* ===================================================================
   CARDS / WIDGETS
   =================================================================== */
.card{
  background:var(--surface);
  border:1px solid var(--border-soft);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-sm);
}
.card-pad{ padding:22px; }
.card-head-row{ display:flex; align-items:center; justify-content:between; justify-content:space-between; margin-bottom:18px; }
.card-head-row h3{ font-size:15.5px; margin:0; }
.card-head-row .ch-sub{ font-size:12px; color:var(--muted); margin-top:2px; }

.kpi-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
.kpi-card{
  background:var(--surface);
  border:1px solid var(--border-soft);
  border-radius:var(--radius-lg);
  padding:20px 20px 18px;
  box-shadow:var(--shadow-sm);
  position:relative;
  overflow:hidden;
  transition:transform .18s ease, box-shadow .18s ease;
}
.kpi-card:hover{ transform:translateY(-3px); box-shadow:var(--shadow-md); }
.kpi-card::before{ content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--rail,var(--primary)); }
.kpi-card .kpi-top{ display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:14px; }
.kpi-icon{ width:42px; height:42px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:17px; }
.kpi-trend{ font-size:11.5px; font-weight:700; display:flex; align-items:center; gap:3px; padding:3px 8px; border-radius:var(--radius-pill); }
.kpi-trend.up{ color:var(--success); background:var(--success-100); }
.kpi-trend.down{ color:var(--danger); background:var(--danger-100); }
.kpi-label{ font-size:12.5px; color:var(--muted); font-weight:600; margin-bottom:5px; }
.kpi-value{ font-family:var(--font-mono); font-size:25px; font-weight:700; color:var(--ink); letter-spacing:-.02em; }
.kpi-value sup{ font-size:13px; font-weight:600; color:var(--muted); margin-right:1px; top:-.5em; }
.kpi-foot{ font-size:11.5px; color:var(--muted); margin-top:6px; }

.kpi-card.t-primary{ --rail:var(--primary); } .kpi-card.t-primary .kpi-icon{ background:var(--primary-100); color:var(--primary); }
.kpi-card.t-success{ --rail:var(--success); } .kpi-card.t-success .kpi-icon{ background:var(--success-100); color:var(--success); }
.kpi-card.t-danger{ --rail:var(--danger); } .kpi-card.t-danger .kpi-icon{ background:var(--danger-100); color:var(--danger); }
.kpi-card.t-gold{ --rail:var(--gold); } .kpi-card.t-gold .kpi-icon{ background:var(--gold-100); color:var(--gold-ink); }
.kpi-card.t-info{ --rail:var(--info); } .kpi-card.t-info .kpi-icon{ background:var(--info-100); color:var(--info); }

@media (max-width:1199px){ .kpi-grid{ grid-template-columns:repeat(2,1fr); } }
@media (max-width:575px){ .kpi-grid{ grid-template-columns:1fr; } }

/* chart legend dots */
.legend-row{ display:flex; gap:18px; flex-wrap:wrap; }
.legend-dot{ display:inline-flex; align-items:center; gap:6px; font-size:12.5px; color:var(--ink-2); }
.legend-dot span{ width:9px; height:9px; border-radius:50%; display:inline-block; }

.chip-tab{ display:inline-flex; background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-pill); padding:3px; }
.chip-tab button{ border:none; background:none; font-size:12.5px; font-weight:600; padding:6px 14px; border-radius:var(--radius-pill); color:var(--muted); font-family:var(--font-display); }
.chip-tab button.active{ background:var(--ink); color:#fff; }

/* category pill list (expense pie legend) */
.cat-legend-item{ display:flex; align-items:center; gap:10px; padding:9px 0; border-bottom:1px dashed var(--border-soft); }
.cat-legend-item:last-child{ border-bottom:none; }
.cat-legend-item .dot{ width:10px; height:10px; border-radius:50%; flex:0 0 auto; }
.cat-legend-item .cl-name{ flex:1; font-size:13px; color:var(--ink-2); font-weight:500; }
.cat-legend-item .cl-val{ font-family:var(--font-mono); font-size:13px; font-weight:700; }
.cat-legend-item .cl-pct{ font-size:11.5px; color:var(--muted); width:38px; text-align:right; }

/* ===================================================================
   TABLES
   =================================================================== */
.table-card{ padding:0; overflow:hidden; }
.table-card .tc-head{ display:flex; align-items:center; justify-content:space-between; padding:20px 22px 14px; flex-wrap:wrap; gap:12px; }
.table-card .tc-head h3{ font-size:15.5px; margin:0; }

.table-responsive-wrap{ overflow-x:auto; }
table.data-table{ width:100%; border-collapse:separate; border-spacing:0; min-width:680px; }
table.data-table thead th{
  text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.05em; font-weight:700;
  color:var(--muted); background:var(--surface-2); padding:12px 22px; border-top:1px solid var(--border-soft); border-bottom:1px solid var(--border-soft);
  white-space:nowrap;
}
table.data-table tbody td{ padding:14px 22px; border-bottom:1px solid var(--border-soft); font-size:13.5px; color:var(--ink-2); white-space:nowrap; }
table.data-table tbody tr{ transition:background .12s; }
table.data-table tbody tr:hover{ background:var(--surface-2); }
table.data-table tbody tr:last-child td{ border-bottom:none; }
table.data-table td.cell-strong{ color:var(--ink); font-weight:600; }
table.data-table td .row-sub{ font-size:11.5px; color:var(--muted); margin-top:1px; }

.cell-entity{ display:flex; align-items:center; gap:10px; }
.cell-entity .ce-avatar{ width:32px; height:32px; border-radius:9px; background:var(--primary-100); color:var(--primary-700); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:11.5px; font-family:var(--font-display); flex:0 0 auto; }

.badge-status{ font-size:11px; font-weight:700; padding:4px 10px; border-radius:var(--radius-pill); display:inline-flex; align-items:center; gap:5px; }
.badge-status::before{ content:""; width:6px; height:6px; border-radius:50%; }
.badge-status.success{ background:var(--success-100); color:var(--success); } .badge-status.success::before{ background:var(--success); }
.badge-status.danger{ background:var(--danger-100); color:var(--danger); } .badge-status.danger::before{ background:var(--danger); }
.badge-status.warn{ background:var(--gold-100); color:var(--gold-ink); } .badge-status.warn::before{ background:var(--gold); }
.badge-status.info{ background:var(--info-100); color:var(--info); } .badge-status.info::before{ background:var(--info); }
.badge-status.muted{ background:var(--surface-2); color:var(--muted); } .badge-status.muted::before{ background:var(--muted); }

.row-actions{ display:flex; gap:6px; }
.row-actions .icon-btn{ width:32px; height:32px; border-radius:8px; font-size:12.5px; }

.tc-foot{ display:flex; align-items:center; justify-content:space-between; padding:16px 22px; border-top:1px solid var(--border-soft); flex-wrap:wrap; gap:10px; }
.pager{ display:flex; gap:6px; }
.pager button{ width:32px; height:32px; border-radius:8px; border:1px solid var(--border); background:#fff; color:var(--ink-2); font-size:12.5px; font-weight:600; }
.pager button.active{ background:var(--primary); border-color:var(--primary); color:#fff; }
.pager button:hover:not(.active){ border-color:var(--primary); color:var(--primary); }

/* filter bar */
.filter-bar{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; padding:0 22px 18px; }
.filter-bar .form-control, .filter-bar .form-select{ padding:8px 12px; font-size:13px; }
.filter-bar .fb-tight{ width:auto; }

/* ===================================================================
   FORMS / MODALS
   =================================================================== */
.form-label-sm{ font-size:12px; font-weight:600; color:var(--ink-2); margin-bottom:6px; text-transform:uppercase; letter-spacing:.03em; }
.modal-content{ border-radius:var(--radius-lg); border:none; box-shadow:var(--shadow-lg); }
.modal-header{ border-bottom:1px solid var(--border-soft); padding:20px 24px; }
.modal-header .modal-title{ font-size:16.5px; }
.modal-body{ padding:24px; }
.modal-footer{ border-top:1px solid var(--border-soft); padding:16px 24px; }

.upload-drop{
  border:1.5px dashed var(--border); border-radius:var(--radius); padding:22px; text-align:center; color:var(--muted); font-size:13px; background:var(--surface-2);
  cursor:pointer; transition:border-color .15s, background .15s;
}
.upload-drop:hover{ border-color:var(--primary); background:var(--primary-50); }
.upload-drop i{ font-size:22px; color:var(--primary); margin-bottom:8px; display:block; }

/* segmented switch */
.seg-switch{ display:inline-flex; background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-sm); padding:3px; }
.seg-switch input{ display:none; }
.seg-switch label{ padding:7px 16px; font-size:12.5px; font-weight:600; border-radius:7px; cursor:pointer; color:var(--ink-2); font-family:var(--font-display); }
.seg-switch input:checked + label{ background:#fff; color:var(--primary); box-shadow:var(--shadow-xs); }

/* ===================================================================
   ACCOUNTS PAGE
   =================================================================== */
.account-card{
  background:var(--surface); border:1px solid var(--border-soft); border-radius:var(--radius-lg);
  padding:22px; position:relative; overflow:hidden; transition:transform .18s, box-shadow .18s;
}
.account-card:hover{ transform:translateY(-3px); box-shadow:var(--shadow-md); }
.account-card .ac-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; }
.account-card .ac-icon{ width:46px; height:46px; border-radius:13px; display:flex; align-items:center; justify-content:center; font-size:19px; }
.account-card .ac-menu{ color:var(--muted); cursor:pointer; }
.account-card .ac-name{ font-family:var(--font-display); font-weight:600; font-size:14.5px; }
.account-card .ac-no{ font-size:12px; color:var(--muted); font-family:var(--font-mono); margin-top:2px; }
.account-card .ac-balance{ font-family:var(--font-mono); font-size:23px; font-weight:700; margin-top:16px; }
.account-card .ac-foot{ display:flex; align-items:center; justify-content:space-between; margin-top:16px; padding-top:14px; border-top:1px solid var(--border-soft); }
.account-card .ac-foot a{ font-size:12.5px; font-weight:600; }
.account-card.cash .ac-icon{ background:var(--success-100); color:var(--success); }
.account-card.bank .ac-icon{ background:var(--info-100); color:var(--info); }
.account-card.mobile .ac-icon{ background:var(--gold-100); color:var(--gold-ink); }

.add-account-card{
  border:1.5px dashed var(--border); border-radius:var(--radius-lg); display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:10px; min-height:198px; color:var(--muted); cursor:pointer;
  transition:border-color .15s, color .15s, background .15s;
}
.add-account-card:hover{ border-color:var(--primary); color:var(--primary); background:var(--primary-50); }
.add-account-card i{ font-size:22px; }

/* ===================================================================
   PEOPLE GRID (customers / suppliers / employees)
   =================================================================== */
.person-card{ background:var(--surface); border:1px solid var(--border-soft); border-radius:var(--radius-lg); padding:20px; transition:transform .18s, box-shadow .18s; }
.person-card:hover{ transform:translateY(-3px); box-shadow:var(--shadow-md); }
.person-card .pc-top{ display:flex; gap:12px; align-items:center; }
.person-card .pc-avatar{ width:44px; height:44px; border-radius:12px; background:var(--primary-100); color:var(--primary-700); display:flex; align-items:center; justify-content:center; font-weight:700; font-family:var(--font-display); }
.person-card .pc-name{ font-weight:600; font-size:14px; font-family:var(--font-display); }
.person-card .pc-role{ font-size:12px; color:var(--muted); }
.person-card .pc-stats{ display:flex; justify-content:space-between; margin-top:16px; padding-top:14px; border-top:1px solid var(--border-soft); }
.person-card .pc-stats div b{ display:block; font-family:var(--font-mono); font-size:14px; }
.person-card .pc-stats div span{ font-size:11px; color:var(--muted); }

/* ===================================================================
   INVOICE
   =================================================================== */
.invoice-sheet{ background:#fff; border:1px solid var(--border-soft); border-radius:var(--radius-lg); padding:44px; box-shadow:var(--shadow-sm); }
.invoice-sheet .inv-head{ display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:34px; padding-bottom:26px; border-bottom:2px solid var(--ink); }
.invoice-sheet .inv-brand{ display:flex; gap:12px; align-items:center; }
.invoice-sheet .inv-brand .brand-mark{ width:46px; height:46px; border-radius:12px; background:linear-gradient(155deg,var(--primary),var(--primary-700)); display:flex; align-items:center; justify-content:center; color:#fff; font-size:19px; }
.invoice-sheet .inv-brand .bn{ font-family:var(--font-display); font-weight:700; font-size:17px; }
.invoice-sheet .inv-brand .ba{ font-size:12px; color:var(--muted); max-width:230px; line-height:1.5; margin-top:2px; }
.invoice-sheet .inv-meta{ text-align:right; }
.invoice-sheet .inv-meta h2{ font-size:25px; letter-spacing:.05em; color:var(--primary-700); }
.invoice-sheet .inv-meta .im-row{ font-size:12.5px; color:var(--ink-2); margin-top:3px; }
.invoice-sheet .inv-meta .im-row b{ color:var(--ink); font-family:var(--font-mono); }

.invoice-sheet .inv-parties{ display:flex; gap:40px; margin-bottom:30px; }
.invoice-sheet .inv-parties .ip-block{ flex:1; }
.invoice-sheet .ip-label{ font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); font-weight:700; margin-bottom:8px; }
.invoice-sheet .ip-name{ font-weight:700; font-family:var(--font-display); font-size:14.5px; }
.invoice-sheet .ip-line{ font-size:13px; color:var(--ink-2); line-height:1.6; }

table.inv-items{ width:100%; border-collapse:collapse; margin-bottom:24px; }
table.inv-items thead th{ background:var(--primary-700); color:#fff; font-size:11.5px; text-transform:uppercase; letter-spacing:.04em; padding:11px 14px; text-align:left; }
table.inv-items thead th.num-col{ text-align:right; }
table.inv-items tbody td{ padding:13px 14px; font-size:13.5px; border-bottom:1px solid var(--border-soft); color:var(--ink-2); }
table.inv-items tbody td.num-col{ text-align:right; font-family:var(--font-mono); color:var(--ink); }
table.inv-items tbody tr:nth-child(even){ background:var(--surface-2); }

.inv-summary{ display:flex; justify-content:flex-end; }
.inv-summary table{ min-width:280px; }
.inv-summary td{ padding:7px 4px; font-size:13.5px; }
.inv-summary td:first-child{ color:var(--muted); }
.inv-summary td:last-child{ text-align:right; font-family:var(--font-mono); font-weight:600; }
.inv-summary tr.total td{ border-top:2px solid var(--ink); font-size:16.5px; font-weight:700; padding-top:12px; }
.inv-summary tr.total td:last-child{ color:var(--primary-700); }
.inv-summary tr.due td:last-child{ color:var(--danger); }

.inv-foot-note{ margin-top:30px; padding-top:20px; border-top:1px dashed var(--border); font-size:12px; color:var(--muted); display:flex; justify-content:space-between; align-items:center; }
.inv-stamp{ font-family:var(--font-display); font-weight:700; padding:6px 16px; border:2px solid var(--success); color:var(--success); border-radius:8px; transform:rotate(-6deg); font-size:13px; letter-spacing:.06em; }

/* ===================================================================
   REPORTS
   =================================================================== */
.pl-row{ display:flex; justify-content:space-between; padding:11px 0; border-bottom:1px solid var(--border-soft); font-size:13.5px; }
.pl-row:last-child{ border-bottom:none; }
.pl-row.head{ font-weight:700; color:var(--ink); }
.pl-row .pl-amt{ font-family:var(--font-mono); font-weight:600; }
.pl-row.total{ border-top:2px solid var(--ink); margin-top:6px; padding-top:14px; font-weight:700; font-size:14.5px; }

/* ===================================================================
   SETTINGS
   =================================================================== */
.settings-tabs .nav-link{ border:none; background:none; padding:11px 8px; margin-right:22px; font-size:13.5px; font-weight:600; color:var(--muted); border-bottom:2.5px solid transparent; border-radius:0; font-family:var(--font-display); }
.settings-tabs .nav-link.active{ color:var(--primary-700); border-bottom-color:var(--primary); background:none; }
.settings-row{ display:flex; align-items:center; justify-content:space-between; padding:16px 0; border-bottom:1px solid var(--border-soft); gap:20px; }
.settings-row:last-child{ border-bottom:none; }
.settings-row .sr-title{ font-size:13.5px; font-weight:600; }
.settings-row .sr-sub{ font-size:12px; color:var(--muted); margin-top:2px; }

.form-switch .form-check-input{ width:40px; height:22px; }
.form-switch .form-check-input:checked{ background-color:var(--primary); border-color:var(--primary); }

/* ===================================================================
   EMPTY STATE / UTILITIES
   =================================================================== */
.empty-state{ text-align:center; padding:50px 20px; color:var(--muted); }
.empty-state i{ font-size:30px; margin-bottom:12px; color:var(--border); }
.empty-state h6{ color:var(--ink-2); font-size:14px; margin-bottom:4px; }
.empty-state p{ font-size:12.5px; }

.section-fade{ animation:fadeUp .35s ease; }
@keyframes fadeUp{ from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:translateY(0); } }

.page-view{ display:none; }
.page-view.active{ display:block; }

.text-muted-soft{ color:var(--muted); }
.fw-display{ font-family:var(--font-display); }

hr.soft{ border-top:1px solid var(--border-soft); opacity:1; }

/* dropdown polish */
.dropdown-menu{ border:1px solid var(--border-soft); border-radius:var(--radius); box-shadow:var(--shadow-md); padding:8px; }
.dropdown-item{ border-radius:8px; padding:9px 12px; font-size:13.5px; display:flex; align-items:center; gap:10px; }
.dropdown-item i{ width:16px; color:var(--muted); }
.dropdown-item:hover{ background:var(--surface-2); }
.dropdown-item.text-danger:hover{ background:var(--danger-100); }

.notif-item{ display:flex; gap:12px; padding:11px 6px; border-radius:10px; }
.notif-item:hover{ background:var(--surface-2); }
.notif-item .ni-icon{ width:34px; height:34px; border-radius:9px; display:flex; align-items:center; justify-content:center; font-size:13px; flex:0 0 auto; }
.notif-item .ni-title{ font-size:12.5px; color:var(--ink); font-weight:600; }
.notif-item .ni-time{ font-size:11px; color:var(--muted); }
.notif-dropdown{ width:340px; max-height:380px; overflow-y:auto; }

/* responsive */
@media (max-width:1199px){
  .page-content{ padding:22px 18px 60px; }
}
@media (max-width:991px){
  .sidebar{ transform:translateX(-100%); box-shadow:var(--shadow-lg); }
  .sidebar.open{ transform:translateX(0); }
  .sidebar-backdrop.show{ opacity:1; visibility:visible; }
  .main-wrap{ margin-left:0; }
  .sidebar-toggle-btn{ display:flex; }
  .topbar{ padding:0 16px; gap:10px; }
  .topbar-search{ flex:1; }
  .profile-chip .pc-meta{ display:none; }
}
@media (max-width:575px){
  .topbar-search{ display:none; }
  .topbar-spacer{ flex:1; }
  .page-head .head-actions{ width:100%; }
  .page-head .head-actions .btn{ flex:1; }
  .invoice-sheet{ padding:24px; }
  .invoice-sheet .inv-head{ flex-direction:column; gap:18px; }
  .invoice-sheet .inv-meta{ text-align:left; }
  .invoice-sheet .inv-parties{ flex-direction:column; gap:18px; }
}

/* ===================================================================
   CLIENT SUBSCRIPTION & BILLING — added module
   Reuses the existing emerald / gold token system above for consistency
   =================================================================== */
.nav-badge.bad{ background:var(--danger-100); color:var(--danger); }

.info-list .info-row{ display:flex; justify-content:space-between; gap:14px; padding:12px 0; border-bottom:1px solid var(--border-soft); font-size:13.5px; }
.info-list .info-row:last-child{ border-bottom:none; }
.info-list .info-row .lbl{ color:var(--muted); font-weight:500; flex:0 0 42%; }
.info-list .info-row .val{ color:var(--ink); font-weight:600; text-align:right; flex:1; }

.detail-header{ display:flex; align-items:center; gap:18px; padding:22px; background:linear-gradient(155deg,var(--primary-700),var(--primary)); border-radius:var(--radius-lg); color:#fff; margin-bottom:24px; flex-wrap:wrap; }
.detail-header .dh-avatar{ width:64px; height:64px; border-radius:16px; background:rgba(255,255,255,.16); display:flex; align-items:center; justify-content:center; font-size:24px; font-weight:700; font-family:var(--font-display); flex:0 0 auto; }
.detail-header .dh-name{ font-size:19px; color:#fff; margin-bottom:3px; }
.detail-header .dh-sub{ font-size:13px; color:rgba(255,255,255,.78); }
.detail-header .dh-actions{ margin-left:auto; display:flex; gap:10px; flex-wrap:wrap; }

.badge-status-lg{ font-size:13px; font-weight:700; padding:8px 18px; border-radius:var(--radius-pill); display:inline-flex; align-items:center; gap:8px; }
.badge-status-lg::before{ content:""; width:8px; height:8px; border-radius:50%; }
.badge-status-lg.success{ background:var(--success-100); color:var(--success); } .badge-status-lg.success::before{ background:var(--success); box-shadow:0 0 0 4px var(--success-100); }
.badge-status-lg.warn{ background:var(--gold-100); color:var(--gold-ink); } .badge-status-lg.warn::before{ background:var(--gold); box-shadow:0 0 0 4px var(--gold-100); }
.badge-status-lg.danger{ background:var(--danger-100); color:var(--danger); } .badge-status-lg.danger::before{ background:var(--danger); box-shadow:0 0 0 4px var(--danger-100); }
.badge-status-lg.muted{ background:var(--surface-2); color:var(--muted); } .badge-status-lg.muted::before{ background:var(--muted); box-shadow:0 0 0 4px var(--surface-2); }

.timeline{ position:relative; padding-left:26px; }
.timeline::before{ content:""; position:absolute; left:6px; top:6px; bottom:6px; width:2px; background:var(--border); }
.timeline-item{ position:relative; padding-bottom:22px; }
.timeline-item:last-child{ padding-bottom:0; }
.timeline-item::before{ content:""; position:absolute; left:-26px; top:2px; width:12px; height:12px; border-radius:50%; background:var(--primary); border:2.5px solid #fff; box-shadow:0 0 0 2px var(--primary-100); }
.timeline-item.t-success::before{ background:var(--success); box-shadow:0 0 0 2px var(--success-100); }
.timeline-item.t-gold::before{ background:var(--gold); box-shadow:0 0 0 2px var(--gold-100); }
.timeline-item .ti-title{ font-size:13.5px; font-weight:600; color:var(--ink); }
.timeline-item .ti-time{ font-size:11.5px; color:var(--muted); margin-top:2px; }

.flow-strip{ display:flex; align-items:stretch; gap:0; overflow-x:auto; }
.flow-step{ flex:1; min-width:190px; background:var(--surface); border:1px solid var(--border-soft); border-radius:var(--radius); padding:18px; position:relative; }
.flow-step .fs-num{ width:30px; height:30px; border-radius:9px; background:var(--primary-100); color:var(--primary-700); display:flex; align-items:center; justify-content:center; font-weight:700; font-family:var(--font-display); font-size:13px; margin-bottom:12px; }
.flow-step .fs-title{ font-size:13.5px; font-weight:700; margin-bottom:4px; }
.flow-step .fs-desc{ font-size:12px; color:var(--muted); line-height:1.5; }
.flow-arrow{ display:flex; align-items:center; justify-content:center; color:var(--border); font-size:16px; padding:0 6px; flex:0 0 auto; }
@media (max-width:991px){ .flow-strip{ flex-direction:column; } .flow-arrow{ transform:rotate(90deg); padding:6px 0; } }

.automation-toggle-row{ display:flex; align-items:center; justify-content:space-between; padding:16px 0; border-bottom:1px solid var(--border-soft); gap:16px; }
.automation-toggle-row:last-child{ border-bottom:none; }
.automation-toggle-row .atr-title{ font-size:13.5px; font-weight:600; }
.automation-toggle-row .atr-sub{ font-size:12px; color:var(--muted); margin-top:2px; }

.reminder-bucket{ border:1px solid var(--border-soft); border-radius:var(--radius-lg); overflow:hidden; }
.reminder-bucket .rb-head{ padding:16px 18px; display:flex; align-items:center; justify-content:space-between; }
.reminder-bucket .rb-head h4{ font-size:14px; margin:0; display:flex; align-items:center; gap:8px; }
.reminder-bucket.due-soon .rb-head{ background:var(--gold-100); }
.reminder-bucket.due-today .rb-head{ background:var(--danger-100); }
.reminder-bucket.expired .rb-head{ background:var(--surface-2); }
.reminder-row{ display:flex; align-items:center; justify-content:space-between; padding:13px 18px; border-top:1px solid var(--border-soft); gap:10px; }
.reminder-row .rr-name{ font-size:13px; font-weight:600; }
.reminder-row .rr-sub{ font-size:11.5px; color:var(--muted); }

.channel-card{ border:1px solid var(--border-soft); border-radius:var(--radius); padding:18px; display:flex; align-items:flex-start; gap:14px; transition:border-color .15s, box-shadow .15s; }
.channel-card:hover{ border-color:var(--primary); box-shadow:var(--shadow-sm); }
.channel-card .cc-icon{ width:42px; height:42px; border-radius:11px; display:flex; align-items:center; justify-content:center; font-size:17px; flex:0 0 auto; }
.channel-card .cc-title{ font-size:13.5px; font-weight:700; }
.channel-card .cc-sub{ font-size:12px; color:var(--muted); margin-top:2px; line-height:1.4; }

.mini-calendar{ width:100%; }
.mini-calendar .mc-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.mini-calendar .mc-head h4{ font-size:14.5px; margin:0; }
.mini-calendar .mc-nav button{ width:30px; height:30px; border-radius:8px; border:1px solid var(--border); background:#fff; color:var(--ink-2); }
.mc-grid{ display:grid; grid-template-columns:repeat(7,1fr); gap:6px; }
.mc-dow{ text-align:center; font-size:10.5px; font-weight:700; color:var(--muted); text-transform:uppercase; padding-bottom:4px; }
.mc-cell{ aspect-ratio:1/1; border-radius:9px; display:flex; flex-direction:column; align-items:center; justify-content:center; font-size:12.5px; color:var(--ink-2); background:var(--surface-2); position:relative; gap:3px; }
.mc-cell.empty{ background:transparent; }
.mc-cell.today{ background:var(--primary); color:#fff; font-weight:700; }
.mc-cell .mc-dot{ width:5px; height:5px; border-radius:50%; }
.mc-cell.has-gold .mc-dot{ background:var(--gold); }
.mc-cell.has-danger .mc-dot{ background:var(--danger); }
.mc-cell.has-success .mc-dot{ background:var(--success); }
.mc-legend{ display:flex; gap:16px; margin-top:14px; flex-wrap:wrap; }

@media (max-width:991px){ .detail-header .dh-actions{ margin-left:0; width:100%; } }
