/* =============================================================
   TIES Admin — Navy & Gold design system (v2)
   Dark & Light themes, same class names as v1 so every template
   (dashboard, clients, projects, accounts) picks this up for free.
   Table of contents:
     1. Tokens & reset
     2. Layout shell (sidebar / header / content)
     3. Sidebar
     4. Header
     5. Buttons, chips, form controls
     6. Page head
     7. Stat cards
     8. Panels / wallet / cash-flow chart
     9. Table
     10. Responsive breakpoints
     11. Nav link as a <button> / disabled item
     12. Alerts / flash messages
     13. Impersonation banner
     14. Forms (modals + login page)
     15. Modals
     16. Data table extras: row actions, badges, empty state
     17. Auth page (login)
     18. Project status badges + budget progress bars
     19. Deadline chip, status timeline, installment badges
     20. Project Detail v2 — stat cards, preview cards, pd- grid
============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=DM+Mono:wght@400;500&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ---------- 1. Tokens & reset ---------- */

[data-theme="dark"] {
  --navy:        #1a3048;
  --navy-deep:   #0d1e2e;
  --navy-mid:    #223a55;
  --navy-light:  #2d4f72;
  --gold:        #9f893c;
  --gold-l:      #c4a84e;
  --gold-bright: #e0c060;
  --gold-pale:   rgba(196,168,78,0.10);
  --gold-glow:   rgba(196,168,78,0.20);

  --bg:        #080d14;
  --bg-2:      #0c1520;
  --bg-3:      #101c2a;
  --surface:   #131f2e;
  --surface-2: #172537;
  --surface-3: #1c2d40;
  --surface-4: #203348;

  --border:      rgba(255,255,255,0.07);
  --border-2:    rgba(255,255,255,0.14);
  --border-gold: rgba(196,168,78,0.28);

  --ink-900: rgba(255,255,255,0.90);
  --ink-700: rgba(255,255,255,0.72);
  --ink-600: rgba(255,255,255,0.62);
  --ink-500: rgba(255,255,255,0.55);
  --ink-400: rgba(255,255,255,0.42);
  --ink-300: rgba(255,255,255,0.28);
  --ink-200: rgba(255,255,255,0.18);
  --ink-100: rgba(255,255,255,0.10);
  --ink-50:  rgba(255,255,255,0.05);

  --green:  #34d399; --green-bg:  rgba(52,211,153,0.12);
  --red:    #f87171; --red-bg:    rgba(248,113,113,0.12);
  --blue:   #60a5fa; --blue-bg:   rgba(96,165,250,0.12);
  --purple: #a78bfa; --purple-bg: rgba(167,139,250,0.12);
  --orange: #fb923c; --orange-bg: rgba(251,146,60,0.12);

  --danger-50: var(--red-bg);   --danger-600: var(--red);
  --warning-50: var(--orange-bg); --warning-600: var(--orange);
  --info-50: var(--blue-bg);    --info-600: var(--blue);
  --violet-50: var(--purple-bg); --violet-600: var(--purple);

  --shadow-card: 0 2px 10px rgba(0,0,0,.30);
  --shadow-soft: 0 16px 44px -16px rgba(0,0,0,.55);
  --shadow-gold: 0 4px 24px rgba(159,137,60,0.22);
  --topnav-bg: rgba(8,13,20,0.86);
}

:root,
[data-theme="light"] {
  --navy:        #1a3048;
  --navy-deep:   #0d1e2e;
  --navy-mid:    #1e3d60;
  --navy-light:  #2d5080;
  --gold:        #8a7230;
  --gold-l:      #a68a28;
  --gold-bright: #c4a030;
  --gold-pale:   rgba(166,138,40,0.10);
  --gold-glow:   rgba(166,138,40,0.20);

  --bg:        #f0f4f8;
  --bg-2:      #e8eef5;
  --bg-3:      #dde5ef;
  --surface:   #ffffff;
  --surface-2: #f5f8fc;
  --surface-3: #edf1f7;
  --surface-4: #e4eaf3;

  --border:      rgba(26,48,72,0.10);
  --border-2:    rgba(26,48,72,0.18);
  --border-gold: rgba(166,138,40,0.32);

  --ink-900: #1a2535;
  --ink-700: #33455f;
  --ink-600: #445a78;
  --ink-500: #4a5e7a;
  --ink-400: #6b8099;
  --ink-300: #8196b2;
  --ink-200: rgba(26,48,72,0.16);
  --ink-100: rgba(26,48,72,0.09);
  --ink-50:  rgba(26,48,72,0.045);

  --green:  #059669; --green-bg:  rgba(5,150,105,0.10);
  --red:    #dc2626; --red-bg:    rgba(220,38,38,0.10);
  --blue:   #1d4ed8; --blue-bg:   rgba(29,78,216,0.10);
  --purple: #7c3aed; --purple-bg: rgba(124,58,237,0.10);
  --orange: #c2410c; --orange-bg: rgba(194,65,12,0.10);

  --danger-50: var(--red-bg);   --danger-600: var(--red);
  --warning-50: var(--orange-bg); --warning-600: var(--orange);
  --info-50: var(--blue-bg);    --info-600: var(--blue);
  --violet-50: var(--purple-bg); --violet-600: var(--purple);

  --shadow-card: 0 1px 4px rgba(26,48,72,.10);
  --shadow-soft: 0 16px 44px -18px rgba(26,48,72,.22);
  --shadow-gold: 0 4px 20px rgba(166,138,40,0.18);
  --topnav-bg: rgba(240,244,248,0.92);
}

:root {
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-xl: 22px;
  --ease-out: cubic-bezier(0.16,1,0.3,1);
  --t: 0.22s var(--ease-out);
  --t-slow: 0.35s var(--ease-out);

  --sidebar-width: 272px;
  --sidebar-collapsed: 76px;
  --header-height: 64px;

  --font-sans: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-display: 'Inter', 'Tahoma', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'DM Mono', 'Fira Code', monospace;

  /* legacy alias so any leftover var(--brand-*) still resolves sensibly */
  --brand-50: var(--gold-pale);  --brand-100: var(--gold-pale); --brand-200: var(--gold-pale);
  --brand-300: var(--gold-l);    --brand-400: var(--gold-l);    --brand-500: var(--gold);
  --brand-600: var(--gold);      --brand-700: var(--gold-l);    --brand-800: var(--gold-l);
  --brand-900: var(--gold-bright); --brand-950: var(--navy-deep);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .25s ease, color .25s ease;
}
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, button, textarea { font: inherit; color: inherit; }
svg { display: block; flex-shrink: 0; }
::selection { background: var(--gold-pale); color: var(--gold-bright); }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-4); border-radius: 10px; }

/* ---------- 2. Layout shell ---------- */

.shell { display: flex; min-height: 100vh; background: var(--bg); }

.shell__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: padding-left var(--t-slow);
}

.content { flex: 1; padding: 1.25rem 1rem 2.5rem; }
.content__inner { max-width: 1400px; margin: 0 auto; }

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(4,7,11,.65);
  backdrop-filter: blur(3px);
  display: none;
}
.sidebar-backdrop.is-visible { display: block; }

/* ---------- 3. Sidebar ---------- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-width);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform .2s ease-out, width var(--t-slow), background-color .25s ease;
  overflow: hidden;
}
.sidebar.is-open { transform: translateX(0); }

/* gold shimmer top stripe, matching the reference design */
.sidebar::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--gold-l), var(--gold), transparent);
  background-size: 200% 100%;
  animation: sbShimmer 4s linear infinite;
  z-index: 1;
}
@keyframes sbShimmer { 0% { background-position: -100% 0; } 100% { background-position: 300% 0; } }

.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .brand__name,
.sidebar.collapsed .nav-group__label,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .sidebar__footer-text,
.sidebar.collapsed .sidebar__footer-logout span {
  opacity: 0;
  pointer-events: none;
  width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.sidebar.collapsed .nav-link,
.sidebar.collapsed .sidebar__footer-logout { justify-content: center; gap: 0; }
.sidebar.collapsed .nav-link__badge { display: none; }

.sidebar__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: 1.3rem 1.25rem .5rem;
  min-height: 70px;
  position: relative; z-index: 1;
}
.brand { display: flex; align-items: center; gap: .65rem; min-width: 0; overflow: hidden; }
.brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.35rem;
  width: 2.35rem;
  flex-shrink: 0;
  border-radius: .65rem;
  overflow: hidden;
  color: var(--navy-deep);
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-l) 55%, var(--gold-bright) 100%);
  box-shadow: 0 4px 16px rgba(159,137,60,.35), inset 0 1px 0 rgba(255,255,255,.25);
}
.brand__mark img { width: 100%; height: 100%; object-fit: cover; }
.brand__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: .5px;
  white-space: nowrap;
  transition: opacity var(--t);
}
.sidebar__close { display: none; }

.sidebar__search { padding: .6rem 1rem 0; }

.sidebar__nav {
  margin-top: .35rem;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 .75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
  position: relative; z-index: 1;
  scrollbar-width: none;
}
.sidebar__nav::-webkit-scrollbar { display: none; }

.nav-group__label {
  padding: 0 .6rem;
  font-family: var(--font-display);
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--ink-300);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--t);
}
.nav-list { margin-top: .45rem; display: flex; flex-direction: column; gap: .2rem; }

.nav-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  border-radius: var(--radius-sm);
  padding: .6rem .75rem;
  font-size: .85rem;
  font-weight: 500;
  color: var(--ink-600);
  white-space: nowrap;
  overflow: hidden;
  transition: background-color var(--t), color var(--t), border-color var(--t);
  border: 1px solid transparent;
}
.nav-link:hover { background: var(--gold-pale); color: var(--ink-900); }
.nav-link__icon { color: var(--ink-400); transition: color var(--t); flex-shrink: 0; }
.nav-link:hover .nav-link__icon { color: var(--gold-l); }

.nav-link.is-active {
  background: linear-gradient(135deg, rgba(196,168,78,.16), rgba(196,168,78,.05));
  border-color: var(--border-gold);
  color: var(--gold-l);
}
.nav-link.is-active .nav-link__icon { color: var(--gold-l); }
.nav-link.is-active:hover { background: linear-gradient(135deg, rgba(196,168,78,.20), rgba(196,168,78,.07)); color: var(--gold-l); }

.nav-link__badge {
  margin-left: auto;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-600);
  font-size: .68rem;
  font-weight: 700;
  padding: .05rem .45rem;
}
.nav-link.is-active .nav-link__badge { background: var(--gold-pale); color: var(--gold-l); }

.sidebar__footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--border);
  padding: .85rem .75rem 1rem;
  flex-shrink: 0;
}
.sidebar__footer-user {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .5rem .6rem;
  border-radius: var(--radius-sm);
}
.sidebar__footer-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.2rem;
  width: 2.2rem;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  border: 1.5px solid var(--border-gold);
  color: var(--gold-l);
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 700;
}
.sidebar__footer-text { min-width: 0; overflow: hidden; transition: opacity var(--t); }
.sidebar__footer-name { font-size: .84rem; font-weight: 600; color: var(--ink-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__footer-role { font-size: .7rem; color: var(--ink-400); white-space: nowrap; }

.sidebar__footer-logout {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  margin-top: .35rem;
  padding: .55rem .6rem;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--ink-400);
  font-size: .8rem;
  font-weight: 500;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: var(--t);
}
.sidebar__footer-logout:hover { background: var(--red-bg); color: var(--red); }
.sidebar__footer-logout svg { flex-shrink: 0; }

/* ---------- 4. Header ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 0 1.1rem;
  background: var(--topnav-bg);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.header__menu { display: inline-flex; }
.header__title {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 700;
  color: var(--ink-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header__actions { display: flex; align-items: center; gap: .4rem; margin-left: auto; }
.header__divider { width: 1px; height: 1.5rem; background: var(--border); margin: 0 .35rem; }
.header__notif { position: relative; }
.header__notif-dot {
  position: absolute;
  top: .4rem;
  right: .4rem;
  height: .4rem;
  width: .4rem;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 0 2px var(--surface-2);
}
.header__share { display: none; }

/* ---------- 5. Buttons, chips, form controls ---------- */

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.2rem;
  width: 2.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink-500);
  transition: var(--t);
}
.icon-btn:hover { background: var(--surface-3); color: var(--gold-l); border-color: var(--border-gold); }
.icon-btn--ghost { background: transparent; border-color: transparent; }
.icon-btn--ghost:hover { background: var(--surface-3); border-color: var(--border); color: var(--ink-900); }

.avatar-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: .3rem .6rem .3rem .3rem;
  transition: var(--t);
  text-decoration: none;
  color: var(--ink-600);
  cursor: pointer;
}
.avatar-btn:hover { background: var(--surface-3); border-color: var(--border-2); }
.avatar-btn__initial {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.9rem;
  width: 1.9rem;
  border-radius: var(--radius-sm);
  background: var(--gold-pale);
  color: var(--gold-l);
  border: 1px solid var(--border-gold);
  font-size: .72rem;
  font-weight: 700;
  font-family: var(--font-display);
}
.avatar-btn__chevron { color: var(--ink-400); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: .55rem 1rem;
  font-size: .85rem;
  font-weight: 600;
  font-family: var(--font-sans);
  white-space: nowrap;
  transition: var(--t);
  cursor: pointer;
}
.btn:active { transform: scale(.97); }
.btn--sm { padding: .48rem .85rem; font-size: .8rem; border-radius: var(--radius-sm); }
.btn--block { width: 100%; }
.btn--primary {
  background: linear-gradient(135deg, #b8973a, var(--gold-l), var(--gold-bright));
  color: #0a1520;
  box-shadow: var(--shadow-gold);
  font-weight: 700;
}
.btn--primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn--outline { background: var(--surface-2); border-color: var(--border); color: var(--ink-600); }
.btn--outline:hover { background: var(--surface-3); color: var(--ink-900); border-color: var(--border-2); }
.btn--soft { background: var(--gold-pale); color: var(--gold-l); }
.btn--soft:hover { background: var(--gold-glow); }
.btn--light { background: rgba(255,255,255,.92); color: var(--navy-deep); }
.btn--light:hover { background: #fff; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  border-radius: 999px;
  padding: .15rem .5rem;
  font-size: .72rem;
  font-weight: 700;
}
.chip--positive { background: var(--green-bg); color: var(--green); }
.chip--negative { background: var(--red-bg); color: var(--red); }
.chip--neutral { background: var(--gold-pale); color: var(--gold-l); }

.legend-dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 999px; flex-shrink: 0; }
.legend-dot.status-badge--planned   { background: var(--blue); }
.legend-dot.status-badge--ongoing   { background: var(--green); }
.legend-dot.status-badge--on_hold   { background: var(--orange); }
.legend-dot.status-badge--completed { background: var(--gold-l); }
.legend-dot.status-badge--cancelled { background: var(--red); }

.search-field { position: relative; display: block; }
.search-field__icon { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--ink-300); pointer-events: none; }
.search-field input {
  width: 100%;
  border: 1.5px solid var(--border);
  background: var(--bg-3);
  color: var(--ink-900);
  border-radius: var(--radius-sm);
  padding: .55rem .75rem .55rem 2.1rem;
  font-size: .875rem;
  transition: var(--t);
}
.search-field input::placeholder { color: var(--ink-300); }
.search-field input:focus { outline: none; border-color: var(--border-gold); background: var(--bg-2); box-shadow: 0 0 0 3px var(--gold-pale); }
.search-field--table { width: 11rem; }
.search-field--table input { padding-top: .45rem; padding-bottom: .45rem; }

.select-pill {
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid var(--border);
  background: var(--bg-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23c4a84e' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .75rem center;
  border-radius: var(--radius-sm);
  padding: .55rem 2.1rem .55rem .9rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-900);
}
.select-pill:focus { outline: none; border-color: var(--border-gold); box-shadow: 0 0 0 3px var(--gold-pale); }

.checkbox {
  height: 1rem;
  width: 1rem;
  border-radius: .3rem;
  border: 1.5px solid var(--ink-200);
  accent-color: var(--gold);
}

/* ---------- 6. Page head ---------- */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.breadcrumb { display: flex; align-items: center; gap: .35rem; font-size: .76rem; font-weight: 500; color: var(--ink-400); margin-bottom: .3rem; }
.breadcrumb a { color: var(--ink-400); transition: color .15s ease; }
.breadcrumb a:hover { color: var(--gold-l); }
.breadcrumb__current { color: var(--ink-700); font-weight: 600; }
.page-head__title { font-family: var(--font-display); font-size: 1.55rem; font-weight: 800; letter-spacing: -.01em; color: var(--ink-900); }
.page-head__subtitle { margin-top: .2rem; font-size: .85rem; color: var(--ink-400); }
.page-head__actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }

/* ---------- 7. Stat cards ---------- */

.stat-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); border-color: var(--border-2); }

.stat-card--highlight {
  border-color: transparent;
  color: #0a1520;
  background: linear-gradient(135deg, #d9b465 0%, var(--gold) 55%, #7a6428 120%);
  position: relative;
  overflow: hidden;
}
.stat-card--highlight::after {
  content: '';
  position: absolute; right: -2rem; top: -2.5rem;
  width: 9rem; height: 9rem; border-radius: 999px;
  background: rgba(255,255,255,.14);
}

.stat-card__top { position: relative; display: flex; align-items: flex-start; justify-content: space-between; }
.stat-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  width: 2.5rem;
  border-radius: var(--radius-sm);
  background: var(--gold-pale);
  color: var(--gold-l);
}
.stat-card--highlight .stat-card__icon { background: rgba(10,21,32,.18); color: #0a1520; }
.stat-card--highlight .chip--positive,
.stat-card--highlight .chip--negative,
.stat-card--highlight .chip--neutral { background: rgba(10,21,32,.18); color: #0a1520; }

.stat-card__label { position: relative; margin-top: 1rem; font-size: .875rem; color: var(--ink-400); }
.stat-card--highlight .stat-card__label { color: rgba(10,21,32,.75); }
.stat-card__amount { position: relative; font-size: 1.3rem; font-weight: 800; font-family: var(--font-display); color: var(--ink-900); }
.stat-card--highlight .stat-card__amount { color: #0a1520; }

.stat-card__cta {
  position: relative;
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .85rem;
  font-weight: 700;
  color: var(--gold-l);
}
.stat-card__cta:hover { color: var(--gold-bright); }
.stat-card--highlight .stat-card__cta { color: rgba(10,21,32,.85); }
.stat-card--highlight .stat-card__cta:hover { color: #0a1520; }

/* ---------- 8. Panels / wallet / cash-flow chart ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
}
.panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.panel__title { font-family: var(--font-display); font-weight: 700; color: var(--ink-900); }
.panel__subtitle { margin-top: .15rem; font-size: .78rem; color: var(--ink-400); }

.split-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1rem; }

.currency-grid { margin-top: 1rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; }
.currency-tile { border: 1px solid var(--border); border-radius: var(--radius-md); padding: .85rem 1rem; background: var(--bg-3); }
.currency-tile__top { display: flex; align-items: center; justify-content: space-between; }
.currency-tile__code { display: flex; align-items: center; gap: .4rem; font-size: .875rem; font-weight: 600; color: var(--ink-700); }
.currency-tile__flag { font-size: 1rem; line-height: 1; }
.currency-tile__more { border: none; background: none; color: var(--ink-300); padding: 0; }
.currency-tile__more:hover { color: var(--gold-l); }
.currency-tile__amount { margin-top: .5rem; font-size: 1.1rem; font-weight: 800; color: var(--ink-900); font-family: var(--font-display); }
.currency-tile__limit { margin-top: .1rem; font-size: .68rem; color: var(--ink-400); }
.currency-tile__status { margin-top: .5rem; display: inline-block; font-size: .68rem; font-weight: 600; color: var(--ink-300); }
.currency-tile__status.is-active { color: var(--green); }

.cashflow-total { font-size: 1.5rem; font-weight: 800; font-family: var(--font-display); color: var(--ink-900); }

.segmented { display: inline-flex; padding: .2rem; border-radius: var(--radius-sm); background: var(--bg-3); font-size: .75rem; font-weight: 600; border: 1px solid var(--border); }
.segmented__btn { border: none; background: none; padding: .35rem .75rem; border-radius: 6px; color: var(--ink-500); }
.segmented__btn.is-active { background: var(--gold-pale); color: var(--gold-l); }

.chart { margin-top: 1.25rem; display: flex; gap: .75rem; height: 15rem; }
.chart__axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 1.5rem;
  font-size: .7rem;
  color: var(--ink-400);
  text-align: right;
}
.chart__plot {
  flex: 1;
  display: flex;
  align-items: stretch;
  gap: .5rem;
  background-image: repeating-linear-gradient(0deg, var(--border) 0, var(--border) 1px, transparent 1px, transparent 20%);
  background-size: 100% calc(100% - 1.5rem);
  background-repeat: no-repeat;
  background-position: top;
}
.chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.chart__bar-track { flex: 1; width: 100%; max-width: 2.25rem; display: flex; align-items: flex-end; margin: 0 auto; }
.chart__bar {
  position: relative;
  width: 100%;
  border-radius: .5rem .5rem 0 0;
  background: linear-gradient(180deg, var(--gold-l), var(--gold-pale));
  transition: filter .15s ease;
}
.chart__bar--peak { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); }
.chart__bar:hover { filter: brightness(1.1); }
.chart__col-label { margin-top: .5rem; font-size: .72rem; color: var(--ink-400); }

.chart__tooltip {
  position: absolute;
  left: 50%;
  top: -1.9rem;
  transform: translateX(-50%);
  background: var(--surface-4);
  border: 1px solid var(--border-2);
  color: var(--ink-900);
  font-size: .7rem;
  font-weight: 700;
  padding: .25rem .5rem;
  border-radius: .4rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.chart__bar:hover .chart__tooltip,
.chart__bar--peak .chart__tooltip { opacity: 1; }

/* ---------- 9. Table ---------- */

.activities-panel { margin-top: 1rem; }
.activities-panel__tools { display: flex; align-items: center; gap: .5rem; }

.table-scroll { margin-top: 1rem; overflow-x: auto; }
.table { width: 100%; min-width: 720px; border-collapse: collapse; text-align: left; font-size: .875rem; }
.table thead tr { border-bottom: 1px solid var(--border-2); background: var(--surface-2); }
.table th {
  padding: .65rem .75rem .65rem .9rem;
  font-family: var(--font-display);
  font-size: .66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-400);
}
.table th:first-child { padding-left: .9rem; }
.table__checkbox-col { width: 2rem; }
.table__menu-col { width: 2rem; }
.table tbody tr { border-bottom: 1px solid var(--border); transition: background .15s ease; }
.table tbody tr:hover { background: var(--surface-2); }
.table td { padding: .8rem .75rem .8rem .9rem; color: var(--ink-700); }
.table__empty { text-align: center; padding: 2.5rem 0; color: var(--ink-400); }
.text-muted { color: var(--ink-400); }
.text-strong { font-weight: 700; color: var(--ink-900); }

.activity-cell { display: flex; align-items: center; gap: .65rem; text-decoration: none; }
.activity-cell__name { font-weight: 600; color: var(--ink-900); transition: color var(--t); }
.activity-cell:hover .activity-cell__name { color: var(--gold-l); }

.activity-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.1rem;
  width: 2.1rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.activity-icon--green  { background: var(--green-bg); color: var(--green); }
.activity-icon--blue   { background: var(--info-50); color: var(--info-600); }
.activity-icon--amber  { background: var(--warning-50); color: var(--warning-600); }
.activity-icon--violet { background: var(--violet-50); color: var(--violet-600); }
.activity-icon--rose   { background: var(--danger-50); color: var(--danger-600); }

.status-pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 600; }
.status-pill--success { color: var(--green); }
.status-pill--pending  { color: var(--warning-600); }
.status-pill--failed   { color: var(--danger-600); }
.status-pill--neutral  { color: var(--ink-500); }

/* ---------- 10. Responsive ---------- */

@media (min-width: 640px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .content { padding: 1.5rem 1.5rem 2.5rem; }
}

@media (min-width: 992px) {
  .split-grid { grid-template-columns: 2fr 3fr; }
}

@media (min-width: 1024px) {
  .sidebar { transform: none; }
  .sidebar__close { display: none !important; }
  .shell__main { padding-left: var(--sidebar-width); }
  .sidebar.collapsed ~ .sidebar-backdrop ~ .shell__main,
  .sidebar.collapsed ~ .shell__main { padding-left: var(--sidebar-collapsed); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .content { padding: 1.5rem 2rem 3rem; }
}

@media (max-width: 1023.98px) {
  .header__menu { display: inline-flex; }
  .sidebar__close { display: inline-flex; }
}

@media (max-width: 639.98px) {
  .header__actions-hide-sm { display: none; }
  .currency-grid { grid-template-columns: 1fr; }
  .search-field--table { width: 8.5rem; }
}

/* =============================================================
   11. Nav link as a <button> (Log out) / disabled item (Projects)
============================================================= */

button.nav-link--button {
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font: inherit;
}

.nav-link--disabled {
  cursor: default;
  color: var(--ink-300);
}
.nav-link--disabled .nav-link__icon { color: var(--ink-200); }
.nav-link--disabled:hover { background: none; color: var(--ink-300); }

/* =============================================================
   12. Alerts / flash messages
============================================================= */

.messages { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.25rem; }
.alert {
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  font-size: .875rem;
  font-weight: 500;
  border: 1px solid transparent;
  animation: alertIn .25s var(--ease-out);
}
@keyframes alertIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.alert p { margin: 0; }
.alert p + p { margin-top: .25rem; }
.alert--success { background: var(--green-bg); color: var(--green); border-color: rgba(52,211,153,.25); }
.alert--error   { background: var(--red-bg); color: var(--red); border-color: rgba(248,113,113,.25); }
.alert--warning { background: var(--orange-bg); color: var(--orange); border-color: rgba(251,146,60,.25); }
.alert--info,
.alert--debug   { background: var(--info-50); color: var(--info-600); border-color: rgba(96,165,250,.25); }

/* =============================================================
   13. Impersonation banner
============================================================= */

.impersonation-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .6rem 1.25rem;
  background: var(--orange);
  color: #1c1206;
  font-size: .8125rem;
  font-weight: 500;
}
.impersonation-bar .btn--light { color: #7c2d12; }

/* =============================================================
   14. Forms (used inside modals and the login page)
============================================================= */

.form-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.form-grid--2col { grid-template-columns: 1fr; }
@media (min-width: 560px) {
  .form-grid--2col { grid-template-columns: 1fr 1fr; }
}
.form-field { display: flex; flex-direction: column; gap: .35rem; }
.form-field--span2 { grid-column: 1 / -1; }

.field-label {
  font-family: var(--font-display);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.field-hint { font-size: .74rem; color: var(--ink-400); }

.logo-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-md);
  background: var(--surface-3);
  border: 1px solid var(--border);
  margin-bottom: .6rem;
  overflow: hidden;
}
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

.logo-clear-label {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .8rem;
  color: var(--ink-500);
  margin-bottom: .5rem;
  cursor: pointer;
}
.field-error { font-size: .76rem; font-weight: 600; color: var(--red); }

.field-input {
  width: 100%;
  border: 1.5px solid var(--border);
  background: var(--bg-3);
  border-radius: var(--radius-sm);
  padding: .6rem .8rem;
  font-size: .875rem;
  color: var(--ink-900) !important;
  -webkit-text-fill-color: var(--ink-900);
  transition: var(--t);
}
.field-input::placeholder { color: var(--ink-300); -webkit-text-fill-color: var(--ink-300); }
.field-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-pale);
  background: var(--bg-2);
}
textarea.field-input { resize: vertical; min-height: 4.5rem; }
.has-error .field-input { border-color: var(--red); }

select.field-input {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(196,168,78,0.8)' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
select.field-input option { background: var(--bg-2); color: var(--ink-900); }

/* Chrome/Edge autofill fix so text stays visible on a dark field */
.field-input:-webkit-autofill,
.field-input:-webkit-autofill:hover,
.field-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink-900) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--bg-3) inset !important;
  caret-color: var(--gold-l);
  transition: background-color 99999s ease-in-out 0s;
}
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="datetime-local"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="number"] { color-scheme: dark; }
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="datetime-local"],
[data-theme="light"] input[type="time"],
[data-theme="light"] input[type="number"] { color-scheme: light; }

.field-choice-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .9rem;
  padding: .6rem .75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  max-height: 9rem;
  overflow-y: auto;
}
.field-choice-list label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8125rem;
  color: var(--ink-700);
  white-space: nowrap;
}
.field-choice-list input.field-checkbox { margin: 0; }
.field-checkbox {
  height: 1rem;
  width: 1rem;
  border-radius: .3rem;
  border: 1.5px solid var(--ink-200);
  accent-color: var(--gold);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
  margin-top: .5rem;
}

/* Toggle switch (boolean fields) */
.toggle-field {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem 1rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--t);
}
.toggle-field:hover { border-color: var(--border-2); background: var(--surface-2); }
.toggle-field input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.toggle-switch {
  position: relative;
  width: 42px; height: 23px;
  background: var(--surface-4);
  border-radius: 100px;
  transition: var(--t);
  flex-shrink: 0;
  border: 1px solid var(--border-2);
}
.toggle-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 17px; height: 17px; background: var(--ink-400); border-radius: 50%; transition: var(--t);
}
.toggle-field input[type="checkbox"]:checked + .toggle-switch { background: var(--gold-pale); border-color: var(--gold); }
.toggle-field input[type="checkbox"]:checked + .toggle-switch::after { left: 21px; background: var(--gold-l); box-shadow: 0 0 10px var(--gold-glow); }

/* =============================================================
   15. Modals
============================================================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 3.5vh 1rem;
  overflow-y: auto;
}
.modal.is-open { display: flex; }
.modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3,6,10,.68);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 34rem;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  padding: 1.5rem;
  animation: modalIn .22s var(--ease-out);
  overflow: hidden;
}
.modal__panel::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-l), var(--gold-bright));
}
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(10px); } to { opacity: 1; transform: none; } }
.modal__panel--wide { max-width: 44rem; }
.modal__panel--narrow { max-width: 26rem; }
.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}
.modal__title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; color: var(--ink-900); }
.modal__subtitle { margin-top: .25rem; font-size: .8125rem; color: var(--ink-400); }
.modal__close {
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--ink-500);
  height: 2rem;
  width: 2rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--t);
}
.modal__close:hover { background: var(--red-bg); color: var(--red); border-color: rgba(248,113,113,.25); }

/* =============================================================
   16. Data table extras: row actions, badges, empty state
============================================================= */

.row-actions { display: flex; align-items: center; gap: .15rem; }
.row-actions form { display: inline-flex; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  border-radius: 999px;
  padding: .18rem .6rem;
  font-size: .7rem;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--ink-500);
}
.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge + .badge { margin-left: .3rem; }
.badge--brand { background: var(--gold-pale); color: var(--gold-l); }
.badge--muted { background: var(--surface-2); color: var(--ink-400); }

.panel__actions { display: flex; align-items: center; gap: .5rem; }

/* =============================================================
   17. Auth page (login)
============================================================= */

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(60% 50% at 15% 0%, rgba(196,168,78,.14), transparent 60%),
    radial-gradient(50% 40% at 100% 100%, rgba(34,58,85,.5), transparent 60%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 24rem;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  padding: 2rem 1.75rem;
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-l), var(--gold-bright));
}
.auth-card__brand { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.5rem; }
.auth-card__title { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; letter-spacing: -.01em; color: var(--ink-900); }
.auth-card__subtitle { margin-top: .3rem; margin-bottom: 1.5rem; font-size: .875rem; color: var(--ink-400); }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form__submit { margin-top: .5rem; }

/* =============================================================
   18. Project status badges + budget progress bars
============================================================= */

.status-badge--planned   { background: var(--info-50); color: var(--info-600); }
.status-badge--ongoing   { background: var(--green-bg); color: var(--green); }
.status-badge--on_hold   { background: var(--warning-50); color: var(--warning-600); }
.status-badge--completed { background: var(--gold-pale); color: var(--gold-l); }
.status-badge--cancelled { background: var(--danger-50); color: var(--danger-600); }

.progress-track {
  width: 6rem;
  height: .4rem;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-l));
  border-radius: 999px;
}
.progress-fill--over { background: var(--red); }

.table tfoot td { padding-top: .6rem; }

/* =============================================================
   19. Deadline chip, status timeline, installment badges
============================================================= */

.chip--warning { background: var(--warning-50); color: var(--warning-600); }

.badge--warning { background: var(--warning-50); color: var(--warning-600); }
.badge--success { background: var(--green-bg); color: var(--green); }
.badge--danger  { background: var(--danger-50); color: var(--danger-600); }

.status-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: .25rem 0 .25rem .25rem;
}
.status-timeline__item {
  position: relative;
  display: flex;
  gap: .75rem;
  padding-left: 1.5rem;
}
.status-timeline__item::before {
  content: "";
  position: absolute;
  left: .3rem;
  top: 1rem;
  bottom: -1rem;
  width: 1px;
  background: var(--border);
}
.status-timeline__item:last-child::before { display: none; }
.status-timeline__dot {
  position: absolute;
  left: 0;
  top: .2rem;
  width: .6rem;
  height: .6rem;
  border-radius: 999px;
}
/* solid dot colors — clearer than the pale badge tint at this size */
.status-timeline__dot.status-badge--planned   { background: var(--blue); }
.status-timeline__dot.status-badge--ongoing   { background: var(--green); }
.status-timeline__dot.status-badge--on_hold   { background: var(--orange); }
.status-timeline__dot.status-badge--completed { background: var(--gold-l); }
.status-timeline__dot.status-badge--cancelled { background: var(--red); }
.status-timeline__content { flex: 1; }

/* =============================================================
   20. Project Detail v2 — modern stat cards, preview cards,
   two-column table grid, pagination. Scoped with a "pd-" prefix
   so it never touches the original dashboard/clients screens.
============================================================= */

.pd-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.1rem;
}

.pd-stat {
  --pd-accent: var(--gold-l);
  --pd-accent-soft: var(--gold-pale);
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.35rem 1.25rem;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform .18s ease, box-shadow .18s ease;
}
.pd-stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--pd-accent);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.pd-stat:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
}
.pd-stat--info    { --pd-accent: var(--blue);   --pd-accent-soft: var(--info-50); }
.pd-stat--warning { --pd-accent: var(--orange); --pd-accent-soft: var(--warning-50); }
.pd-stat--danger  { --pd-accent: var(--red);    --pd-accent-soft: var(--danger-50); }
.pd-stat--violet  { --pd-accent: var(--purple); --pd-accent-soft: var(--violet-50); }
.pd-stat--brand   { --pd-accent: var(--gold-l); --pd-accent-soft: var(--gold-pale); }

.pd-stat--hero {
  background: linear-gradient(135deg, #d9b465 0%, var(--gold) 55%, #7a6428 120%);
  border-color: transparent;
  color: #0a1520;
}
.pd-stat--hero::before { display: none; }
.pd-stat--hero::after {
  content: "";
  position: absolute;
  right: -2rem; top: -2.5rem;
  width: 9rem; height: 9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
}
.pd-stat--hero .pd-stat__icon { background: rgba(10,21,32,.18); color: #0a1520; }
.pd-stat--hero .pd-stat__label { color: rgba(10,21,32,.72); }
.pd-stat--hero .pd-stat__value { color: #0a1520; }
.pd-stat--hero .pd-stat__hint { color: rgba(10,21,32,.65); }
.pd-stat--hero .pd-stat__badge { background: rgba(10,21,32,.18); color: #0a1520; }

.pd-stat__top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}
.pd-stat__icon {
  width: 2.65rem;
  height: 2.65rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--pd-accent-soft);
  color: var(--pd-accent);
}
.pd-stat__badge {
  display: inline-flex;
  align-items: center;
  font-size: .7rem;
  font-weight: 700;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: var(--pd-accent-soft);
  color: var(--pd-accent);
  white-space: nowrap;
}
.pd-stat__label {
  position: relative;
  font-size: .76rem;
  font-weight: 600;
  color: var(--ink-400);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.pd-stat__value {
  position: relative;
  margin-top: .3rem;
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: -.02em;
  color: var(--ink-900);
}
.pd-stat__hint {
  position: relative;
  margin-top: .35rem;
  font-size: .76rem;
  color: var(--ink-400);
}

/* Two-column grid for report tables — stacks on narrow screens */
.pd-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 1180px) {
  .pd-grid--2col { grid-template-columns: 1fr 1fr; }
}

.pd-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pd-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.pd-card__title { font-family: var(--font-display); font-weight: 700; font-size: .95rem; color: var(--ink-900); }
.pd-card__subtitle { margin-top: .2rem; font-size: .78rem; color: var(--ink-400); }
.pd-card__actions { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }

.pd-card__body { flex: 1; }

.pd-mini-table { width: 100%; border-collapse: collapse; }
.pd-mini-table th {
  text-align: left;
  font-family: var(--font-display);
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-400);
  font-weight: 700;
  padding: .6rem 1.35rem;
}
.pd-mini-table td {
  padding: .65rem 1.35rem;
  font-size: .84rem;
  border-top: 1px solid var(--border);
  vertical-align: middle;
  color: var(--ink-700);
}
.pd-mini-table tbody tr { transition: background .12s ease; }
.pd-mini-table tbody tr:hover { background: var(--surface-2); }

.pd-card__foot {
  padding: .9rem 1.35rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  background: var(--surface-2);
}
.pd-view-all {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .8rem;
  font-weight: 700;
  color: var(--gold-l);
  transition: gap .12s ease, color .12s ease;
}
.pd-view-all:hover { gap: .55rem; color: var(--gold-bright); }
.pd-card__empty { padding: 2.25rem 1.35rem; text-align: center; color: var(--ink-400); font-size: .85rem; }

/* Pagination (full report list pages) */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.35rem;
  border-top: 1px solid var(--border);
}
.pagination__info { font-size: .8rem; color: var(--ink-400); }
.pagination__links { display: flex; align-items: center; gap: .3rem; }
.pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 .5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink-600);
  background: var(--surface-2);
  transition: var(--t);
}
.pagination__link:hover { background: var(--surface-3); border-color: var(--border-2); color: var(--ink-900); }
.pagination__link.is-active { background: var(--gold); border-color: var(--gold); color: #0a1520; }
.pagination__link.is-disabled { opacity: .4; pointer-events: none; }

@media (max-width: 639.98px) {
  .pd-card__head { flex-direction: column; align-items: stretch; }
  .pd-card__actions { justify-content: flex-end; }
}
