/* ====================================================================
   STADIA — Sports Stadium Operations & Finance Platform
   Design system: deep navy / royal blue / electric pitch green
   ==================================================================== */

/* ---------- 1. Design tokens --------------------------------------- */
:root {
  /* brand */
  --navy-900: #071227;
  --navy-800: #0B1B36;
  --navy-700: #10254A;
  --navy-600: #16325F;
  --navy-500: #1E4276;

  --blue-700: #1D4ED8;
  --blue-600: #2563EB;
  --blue-500: #3B82F6;
  --blue-100: #DBEAFE;

  --pitch-600: #059669;
  --pitch-500: #10B981;
  --pitch-400: #34D399;
  --pitch-100: #D1FAE5;

  --amber-500: #F59E0B;
  --amber-100: #FEF3C7;
  --red-600:   #DC2626;
  --red-500:   #EF4444;
  --red-100:   #FEE2E2;
  --cyan-500:  #06B6D4;
  --violet-500:#8B5CF6;

  /* surfaces (light) */
  --bg:            #F4F6FA;
  --bg-alt:        #EDF1F7;
  --surface:       #FFFFFF;
  --surface-2:     #F8FAFC;
  --surface-3:     #F1F5F9;
  --border:        #E2E8F0;
  --border-strong: #CBD5E1;

  /* text */
  --text:      #0F1F3D;
  --text-2:    #475569;
  --text-3:    #7C8CA5;
  --text-inv:  #F8FAFC;

  /* accents */
  --accent:      var(--blue-600);
  --accent-soft: rgba(37, 99, 235, .10);
  --success:     var(--pitch-600);
  --warning:     var(--amber-500);
  --danger:      var(--red-600);
  --info:        var(--blue-600);

  /* sidebar always dark for the stadium look */
  --side-bg:      linear-gradient(178deg, #08152C 0%, #0C1F3E 55%, #0A1A33 100%);
  --side-text:    #A9BAD4;
  --side-text-hi: #FFFFFF;
  --side-active:  rgba(59, 130, 246, .16);
  --side-border:  rgba(148, 178, 224, .12);

  /* elevation */
  --shadow-xs: 0 1px 2px rgba(15, 31, 61, .05);
  --shadow-sm: 0 1px 3px rgba(15, 31, 61, .07), 0 1px 2px rgba(15, 31, 61, .04);
  --shadow-md: 0 4px 12px rgba(15, 31, 61, .08), 0 2px 4px rgba(15, 31, 61, .04);
  --shadow-lg: 0 12px 32px rgba(15, 31, 61, .12), 0 4px 8px rgba(15, 31, 61, .05);
  --shadow-xl: 0 24px 60px rgba(7, 18, 39, .22);

  --r-sm: 6px;
  --r:    10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-full: 999px;

  --sidebar-w: 258px;
  --sidebar-collapsed: 72px;
  --topbar-h: 62px;

  --ease: cubic-bezier(.4, 0, .2, 1);
  --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

html[data-theme="dark"] {
  --bg:            #070E1C;
  --bg-alt:        #0A1425;
  --surface:       #0E1A2E;
  --surface-2:     #12233C;
  --surface-3:     #16294552;
  --border:        #1E3252;
  --border-strong: #2B4570;

  --text:      #E8EEF8;
  --text-2:    #9DB0CC;
  --text-3:    #6C81A3;

  --accent-soft: rgba(59, 130, 246, .16);
  --side-bg:     linear-gradient(178deg, #050B18 0%, #08142A 60%, #060F20 100%);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, .45);
  --shadow-lg: 0 14px 36px rgba(0, 0, 0, .5);
  --shadow-xl: 0 24px 60px rgba(0, 0, 0, .6);
}

/* ---------- 2. Reset ----------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 650; line-height: 1.25; letter-spacing: -.011em; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p  { margin: 0 0 10px; }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
small { font-size: 12px; }

::selection { background: rgba(37, 99, 235, .22); }

:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
  border-radius: 4px;
}

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: content-box; }

/* ---------- 3. Layout shell ---------------------------------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--side-bg);
  color: var(--side-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  border-right: 1px solid rgba(148, 178, 224, .08);
  transition: width .22s var(--ease), transform .22s var(--ease);
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 200px;
  background: radial-gradient(120% 90% at 50% 0%, rgba(16, 185, 129, .14), transparent 70%);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  border-bottom: 1px solid var(--side-border);
  position: relative;
  z-index: 1;
}

.brand-mark {
  width: 34px; height: 34px;
  flex: 0 0 34px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--blue-600), var(--pitch-500));
  box-shadow: 0 3px 12px rgba(16, 185, 129, .3);
  overflow: hidden;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }

.brand-text { min-width: 0; }
.brand-name {
  font-weight: 700; font-size: 15px; color: #fff;
  letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-sub { font-size: 10.5px; color: #7D97BC; letter-spacing: .8px; text-transform: uppercase; font-weight: 600; }

.side-scroll { flex: 1; overflow-y: auto; padding: 12px 0 24px; position: relative; z-index: 1; }
.side-scroll::-webkit-scrollbar { width: 6px; }
.side-scroll::-webkit-scrollbar-thumb { background: rgba(148, 178, 224, .2); }

.nav-group { padding: 0 10px; margin-bottom: 2px; }
.nav-label {
  padding: 14px 12px 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 1.1px;
  text-transform: uppercase; color: #61789B;
}

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8.5px 12px;
  border-radius: 8px;
  color: var(--side-text);
  font-size: 13.4px; font-weight: 500;
  transition: background .14s var(--ease), color .14s var(--ease);
  position: relative;
  white-space: nowrap;
}
.nav-item:hover { background: rgba(148, 178, 224, .08); color: var(--side-text-hi); text-decoration: none; }
.nav-item.active { background: var(--side-active); color: #fff; font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0;
  background: linear-gradient(var(--pitch-400), var(--blue-500));
}
.nav-item .ico { flex: 0 0 18px; width: 18px; height: 18px; opacity: .9; }
.nav-item.active .ico { opacity: 1; }
.nav-item .nav-badge {
  margin-left: auto; font-size: 10.5px; font-weight: 700;
  background: var(--red-500); color: #fff;
  border-radius: var(--r-full); padding: 1px 6px; min-width: 18px; text-align: center;
}

.nav-parent { cursor: pointer; user-select: none; }
.nav-parent .chev { margin-left: auto; transition: transform .18s var(--ease); opacity: .6; }
.nav-parent[aria-expanded="true"] .chev { transform: rotate(90deg); }
.nav-children {
  display: none;
  margin: 2px 0 6px 0;
  padding-left: 30px;
  border-left: 1px solid var(--side-border);
  margin-left: 21px;
}
.nav-children.open { display: block; }
.nav-children .nav-item { padding: 6.5px 10px; font-size: 12.9px; }
.nav-children .nav-item.active::before { display: none; }
.nav-children .nav-item.active { background: rgba(59, 130, 246, .2); }

.side-foot {
  padding: 12px 14px;
  border-top: 1px solid var(--side-border);
  position: relative; z-index: 1;
}
.side-status {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 11px; border-radius: 9px;
  background: rgba(148, 178, 224, .07);
  border: 1px solid var(--side-border);
}
.side-status .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.side-status .dot.on  { background: var(--pitch-400); box-shadow: 0 0 0 3px rgba(52, 211, 153, .2); animation: pulse 2.4s infinite; }
.side-status .dot.off { background: #64748B; }
.side-status .t { font-size: 11.5px; color: #8FA6C6; line-height: 1.3; }
.side-status .t b { display: block; color: #fff; font-size: 12.5px; letter-spacing: .3px; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(52, 211, 153, .2); }
  50%      { box-shadow: 0 0 0 6px rgba(52, 211, 153, .05); }
}

/* main column */
.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  transition: margin-left .22s var(--ease);
}

.topbar {
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
  position: sticky; top: 0; z-index: 45;
}

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 9px;
  color: var(--text-2);
  cursor: pointer;
  transition: background .14s var(--ease), color .14s var(--ease);
  position: relative;
  flex: 0 0 auto;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot-badge {
  position: absolute; top: 6px; right: 6px;
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: var(--r-full);
  background: var(--red-500); color: #fff;
  font-size: 9.5px; font-weight: 700;
  display: grid; place-items: center;
  border: 2px solid var(--surface);
}

.page-title { font-size: 15px; font-weight: 650; }
.page-title span { display: block; font-size: 11.5px; font-weight: 500; color: var(--text-3); }
.spacer { flex: 1; }

.topbar-search {
  position: relative;
  width: 260px;
  max-width: 34vw;
}
.topbar-search input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.topbar-search svg { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--text-3); }

.user-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  color: var(--text);
}
.user-chip:hover { background: var(--surface-3); }
.user-chip .who { line-height: 1.15; text-align: left; }
.user-chip .who b { display: block; font-size: 12.6px; font-weight: 600; }
.user-chip .who span { font-size: 10.5px; color: var(--text-3); }

.avatar {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; color: #fff;
  background: var(--blue-600);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 56px; height: 56px; flex-basis: 56px; font-size: 19px; }
.avatar.xl { width: 84px; height: 84px; flex-basis: 84px; font-size: 28px; }
.avatar.sm { width: 26px; height: 26px; flex-basis: 26px; font-size: 10px; }

.content { padding: 22px 24px 56px; flex: 1; }

/* dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 70;
  display: none;
}
.dropdown-menu.open { display: block; animation: pop .14s var(--ease); }
.dropdown-menu.wide { min-width: 340px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.dropdown-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 8px;
  color: var(--text); font-size: 13px;
  width: 100%; border: 0; background: none; text-align: left; cursor: pointer;
  font-family: inherit;
}
.dropdown-item:hover { background: var(--surface-3); text-decoration: none; }
.dropdown-item svg { width: 16px; height: 16px; color: var(--text-3); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger svg { color: var(--danger); }
.dropdown-sep { height: 1px; background: var(--border); margin: 5px 2px; }
.dropdown-head { padding: 8px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--text-3); display: flex; justify-content: space-between; align-items: center; }

/* ---------- 4. Page furniture -------------------------------------- */
.page-head {
  display: flex; align-items: flex-start; gap: 14px;
  flex-wrap: wrap; margin-bottom: 18px;
}
.page-head h1 { font-size: 21px; }
.page-head .sub { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); margin-bottom: 5px; }
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--accent); }

/* ---------- 5. Cards ------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}
.card + .card { margin-top: 16px; }
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.card-head h2, .card-head h3 { font-size: 14.5px; font-weight: 650; }
.card-head .sub { font-size: 12px; color: var(--text-3); }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px 14px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-md) var(--r-md); }

/* ---------- 6. Stat tiles ------------------------------------------- */
.stat-grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 15px 16px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease);
}
.stat:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent);
  opacity: .85;
}
.stat.ok::before   { background: var(--success); }
.stat.warn::before { background: var(--warning); }
.stat.bad::before  { background: var(--danger); }
.stat.info::before { background: var(--cyan-500); }
.stat.violet::before { background: var(--violet-500); }

.stat-top { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.stat-ico {
  width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: 9px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.stat-ico svg { width: 16px; height: 16px; }
.stat.ok .stat-ico   { background: rgba(5, 150, 105, .11);  color: var(--success); }
.stat.warn .stat-ico { background: rgba(245, 158, 11, .13); color: var(--warning); }
.stat.bad .stat-ico  { background: rgba(220, 38, 38, .11);  color: var(--danger); }
.stat.info .stat-ico { background: rgba(6, 182, 212, .12);  color: var(--cyan-500); }
.stat.violet .stat-ico { background: rgba(139, 92, 246, .12); color: var(--violet-500); }

.stat-label { font-size: 11.5px; font-weight: 600; color: var(--text-3); letter-spacing: .3px; text-transform: uppercase; }
.stat-value { font-size: 23px; font-weight: 700; letter-spacing: -.6px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-value.sm { font-size: 18px; }
.stat-meta { font-size: 12px; color: var(--text-3); margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.trend { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 650; border-radius: var(--r-full); padding: 1px 7px; }
.trend.up   { background: rgba(5, 150, 105, .12); color: var(--success); }
.trend.down { background: rgba(220, 38, 38, .1);  color: var(--danger); }
.trend.flat { background: var(--surface-3); color: var(--text-3); }

/* live stadium status hero */
.status-hero {
  border-radius: var(--r-lg);
  padding: 20px 22px;
  color: #fff;
  position: relative;
  overflow: hidden;
  background: linear-gradient(125deg, #0A1730 0%, #123055 48%, #0C2140 100%);
  border: 1px solid rgba(148, 178, 224, .14);
  box-shadow: var(--shadow-md);
}
.status-hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 110% at 8% 0%, rgba(16, 185, 129, .26), transparent 62%),
    radial-gradient(50% 100% at 96% 100%, rgba(37, 99, 235, .3), transparent 60%);
}
.status-hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.03) 0 2px, transparent 2px 46px);
  opacity: .7;
}
.status-hero > * { position: relative; z-index: 1; }
.status-hero.closed { background: linear-gradient(125deg, #16121F 0%, #2A1B2C 50%, #14101C 100%); }
.status-hero.closed::before { background: radial-gradient(60% 110% at 8% 0%, rgba(239, 68, 68, .2), transparent 62%); }

.status-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 15px 6px 11px;
  border-radius: var(--r-full);
  font-size: 13px; font-weight: 750; letter-spacing: 1.4px;
  background: rgba(16, 185, 129, .18);
  border: 1px solid rgba(52, 211, 153, .4);
  color: #6EE7B7;
}
.status-pill.closed { background: rgba(239, 68, 68, .16); border-color: rgba(248, 113, 113, .38); color: #FCA5A5; }
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 2.4s infinite; }

.status-facts { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 16px; }
.status-fact .k { font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: #86A3C9; font-weight: 650; }
.status-fact .v { font-size: 17px; font-weight: 700; margin-top: 1px; font-variant-numeric: tabular-nums; }
.status-fact .v small { font-size: 11.5px; font-weight: 500; color: #A9C0DC; }

.status-progress { margin-top: 16px; }
.status-progress .bar { height: 6px; border-radius: var(--r-full); background: rgba(255,255,255,.12); overflow: hidden; }
.status-progress .fill { height: 100%; border-radius: var(--r-full); background: linear-gradient(90deg, var(--pitch-400), var(--blue-500)); transition: width .4s var(--ease); }
.status-progress .cap { display: flex; justify-content: space-between; font-size: 11px; color: #93AECD; margin-top: 6px; }

/* ---------- 7. Buttons ---------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit; font-size: 13px; font-weight: 570;
  cursor: pointer; white-space: nowrap;
  transition: background .14s var(--ease), border-color .14s var(--ease), transform .1s var(--ease), box-shadow .14s var(--ease);
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex: 0 0 16px; }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }

.btn-default { border-color: var(--border); background: var(--surface); }
.btn-default:hover { background: var(--surface-3); border-color: var(--border-strong); }

.btn-primary { background: var(--blue-600); color: #fff; box-shadow: 0 1px 2px rgba(37,99,235,.3); }
.btn-primary:hover { background: var(--blue-700); }

.btn-success { background: var(--pitch-600); color: #fff; }
.btn-success:hover { background: #047857; }

.btn-danger { background: var(--red-600); color: #fff; }
.btn-danger:hover { background: #B91C1C; }

.btn-warning { background: var(--amber-500); color: #3B2606; }
.btn-warning:hover { background: #D97706; color: #fff; }

.btn-dark { background: var(--navy-800); color: #fff; }
.btn-dark:hover { background: var(--navy-700); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }

.btn-outline-danger { border-color: var(--red-500); color: var(--danger); background: transparent; }
.btn-outline-danger:hover { background: var(--red-100); }
html[data-theme="dark"] .btn-outline-danger:hover { background: rgba(239,68,68,.14); }

.btn-sm { height: 30px; padding: 0 10px; font-size: 12.2px; border-radius: 7px; }
.btn-sm svg { width: 14px; height: 14px; flex-basis: 14px; }
.btn-lg { height: 44px; padding: 0 22px; font-size: 14.5px; border-radius: 11px; }
.btn-block { width: 100%; }
.btn-icon { width: 32px; padding: 0; }
.btn-icon.btn-sm { width: 28px; }

.btn-group { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: var(--surface); }
.btn-group .btn { border-radius: 0; border: 0; border-right: 1px solid var(--border); background: transparent; height: 32px; padding: 0 11px; font-size: 12.4px; }
.btn-group .btn:last-child { border-right: 0; }
.btn-group .btn.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }

/* quick actions */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr)); gap: 10px; }
.quick-action {
  display: flex; flex-direction: column; align-items: flex-start; gap: 9px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  font-size: 13px; font-weight: 570;
  transition: border-color .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease);
}
.quick-action:hover { text-decoration: none; border-color: var(--blue-500); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.quick-action .qa-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.quick-action .qa-ico svg { width: 17px; height: 17px; }
.quick-action.g .qa-ico { background: rgba(5,150,105,.11); color: var(--success); }
.quick-action.a .qa-ico { background: rgba(245,158,11,.13); color: var(--warning); }
.quick-action.r .qa-ico { background: rgba(220,38,38,.1); color: var(--danger); }
.quick-action.v .qa-ico { background: rgba(139,92,246,.12); color: var(--violet-500); }
.quick-action.c .qa-ico { background: rgba(6,182,212,.12); color: var(--cyan-500); }

/* ---------- 8. Forms ------------------------------------------------ */
.form-grid { display: grid; gap: 15px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.one { grid-template-columns: 1fr; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 12.3px; font-weight: 620; color: var(--text-2); }
.field > label .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--text-3); }
.field .err { font-size: 11.8px; color: var(--danger); font-weight: 550; }

.input, .select, .textarea {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit; font-size: 13.4px;
  transition: border-color .14s var(--ease), box-shadow .14s var(--ease);
}
.textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .14);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input.is-error, .select.is-error { border-color: var(--red-500); }
.input[readonly], .input:disabled, .select:disabled { background: var(--surface-3); color: var(--text-2); cursor: not-allowed; }

.select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2378899f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.input-group { display: flex; align-items: stretch; }
.input-group .addon {
  display: grid; place-items: center;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: 9px 0 0 9px;
  background: var(--surface-3);
  color: var(--text-3);
  font-size: 13px; font-weight: 600;
  white-space: nowrap;
}
.input-group .input { border-radius: 0 9px 9px 0; }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; user-select: none; }
.check input[type="checkbox"], .check input[type="radio"] {
  width: 16px; height: 16px; accent-color: var(--blue-600); cursor: pointer; margin: 0; flex: 0 0 16px;
}

.switch { position: relative; display: inline-block; width: 38px; height: 21px; flex: 0 0 38px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--border-strong); border-radius: var(--r-full);
  transition: background .18s var(--ease);
}
.switch .track::before {
  content: ""; position: absolute; height: 15px; width: 15px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: transform .18s var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .track { background: var(--pitch-600); }
.switch input:checked + .track::before { transform: translateX(17px); }

.form-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.form-actions .spacer { flex: 1; }

fieldset { border: 0; padding: 0; margin: 0 0 22px; }
fieldset legend {
  font-size: 11.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--text-3); padding: 0 0 10px;
}

/* ---------- 9. Tables ----------------------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.2px;
  min-width: 620px;
}
table.data thead th {
  text-align: left;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 11.2px; font-weight: 700; letter-spacing: .55px; text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
table.data thead th a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
table.data thead th a:hover { color: var(--accent); text-decoration: none; }
table.data thead th svg { width: 12px; height: 12px; opacity: .5; }
table.data thead th.sorted svg { opacity: 1; color: var(--accent); }

table.data tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .12s var(--ease); }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .cta { text-align: right; white-space: nowrap; }
table.data .strong { font-weight: 620; }
table.data tfoot td {
  padding: 11px 14px;
  background: var(--surface-2);
  border-top: 2px solid var(--border-strong);
  font-weight: 700;
}
table.data .row-muted td { opacity: .58; }

.cell-main { font-weight: 600; }
.cell-sub  { font-size: 11.8px; color: var(--text-3); }
.cell-flex { display: flex; align-items: center; gap: 9px; }

.mono { font-family: var(--mono); font-size: 12.4px; letter-spacing: -.2px; }

/* empty state */
.empty { padding: 52px 24px; text-align: center; }
.empty .ico {
  width: 54px; height: 54px; margin: 0 auto 14px;
  border-radius: 15px; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-3);
}
.empty .ico svg { width: 24px; height: 24px; }
.empty h3 { font-size: 15px; margin-bottom: 5px; }
.empty p { color: var(--text-3); font-size: 13px; max-width: 380px; margin: 0 auto 16px; }

/* ---------- 10. Badges & chips -------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2.5px 9px;
  border-radius: var(--r-full);
  font-size: 11.4px; font-weight: 650; letter-spacing: .25px;
  white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
  border: 1px solid transparent;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: rgba(5,150,105,.12);  color: #047857; }
.badge-warning { background: rgba(245,158,11,.16); color: #B45309; }
.badge-danger  { background: rgba(220,38,38,.11);  color: #B91C1C; }
.badge-info    { background: rgba(37,99,235,.11);  color: #1D4ED8; }
.badge-neutral { background: var(--surface-3); color: var(--text-2); }
.badge-dark    { background: var(--navy-800); color: #fff; }

html[data-theme="dark"] .badge-success { color: #6EE7B7; }
html[data-theme="dark"] .badge-warning { color: #FCD34D; }
html[data-theme="dark"] .badge-danger  { color: #FCA5A5; }
html[data-theme="dark"] .badge-info    { color: #93C5FD; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--r-full);
  border: 1px solid var(--border); background: var(--surface-2);
  font-size: 12px; color: var(--text-2);
}
.chip button { border: 0; background: none; cursor: pointer; color: var(--text-3); padding: 0; display: grid; place-items: center; }
.chip button svg { width: 13px; height: 13px; }

/* ---------- 11. Filter bar ------------------------------------------ */
.filters {
  display: flex; gap: 9px; flex-wrap: wrap; align-items: flex-end;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--r-md) var(--r-md) 0 0;
}
.filters .field { min-width: 140px; flex: 0 1 auto; }
.filters .field > label { font-size: 11px; letter-spacing: .3px; text-transform: uppercase; }
.filters .input, .filters .select { height: 34px; font-size: 13px; }
.filters .grow { flex: 1 1 190px; min-width: 170px; }
.filters .filter-actions { display: flex; gap: 7px; margin-left: auto; }

.search-field { position: relative; }
.search-field .input { padding-left: 33px; }
.search-field svg { position: absolute; left: 10px; top: 9px; width: 15px; height: 15px; color: var(--text-3); pointer-events: none; }

/* ---------- 12. Pagination ------------------------------------------ */
.pager {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.pager .info { font-size: 12.5px; color: var(--text-3); }
.pager .pages { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.pager .pg {
  min-width: 32px; height: 32px; padding: 0 9px;
  display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text-2);
  font-size: 12.6px; font-weight: 550;
}
.pager .pg:hover { background: var(--surface-3); text-decoration: none; color: var(--text); }
.pager .pg.active { background: var(--blue-600); border-color: var(--blue-600); color: #fff; font-weight: 650; }
.pager .pg.disabled { opacity: .4; pointer-events: none; }
.pager .gap { color: var(--text-3); padding: 0 3px; }

/* ---------- 13. Alerts ---------------------------------------------- */
.alert {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13.2px;
  margin-bottom: 14px;
}
.alert svg { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 1px; }
.alert .close { margin-left: auto; background: none; border: 0; cursor: pointer; color: inherit; opacity: .55; padding: 0; }
.alert-success { background: rgba(5,150,105,.08);  border-color: rgba(5,150,105,.28);  color: #065F46; }
.alert-danger  { background: rgba(220,38,38,.07);  border-color: rgba(220,38,38,.26);  color: #991B1B; }
.alert-warning { background: rgba(245,158,11,.09); border-color: rgba(245,158,11,.3);  color: #92400E; }
.alert-info    { background: rgba(37,99,235,.07);  border-color: rgba(37,99,235,.24);  color: #1E40AF; }

html[data-theme="dark"] .alert-success { color: #6EE7B7; }
html[data-theme="dark"] .alert-danger  { color: #FCA5A5; }
html[data-theme="dark"] .alert-warning { color: #FCD34D; }
html[data-theme="dark"] .alert-info    { color: #93C5FD; }

.toast-stack { position: fixed; top: 74px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 9px; max-width: 380px; }
.toast-stack .alert { box-shadow: var(--shadow-lg); background: var(--surface); margin: 0; animation: slideIn .22s var(--ease); }
@keyframes slideIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

/* ---------- 14. Modals ---------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(7, 18, 39, .55);
  backdrop-filter: blur(3px);
  display: none;
  align-items: flex-start; justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
}
.modal-backdrop.open { display: flex; animation: fade .16s var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%; max-width: 540px;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  animation: rise .2s var(--ease);
  margin: auto 0;
}
.modal.lg { max-width: 780px; }
.modal.xl { max-width: 1020px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 15.5px; }
.modal-head .sub { font-size: 12px; color: var(--text-3); }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 20px; max-height: calc(100vh - 230px); overflow-y: auto; }
.modal-foot { display: flex; gap: 9px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* ---------- 15. Tabs ------------------------------------------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tab {
  padding: 10px 15px;
  font-size: 13.2px; font-weight: 570;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  white-space: nowrap; cursor: pointer;
  background: none; border-top: 0; border-left: 0; border-right: 0; font-family: inherit;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 650; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- 16. Charts ----------------------------------------------- */
.chart-box { position: relative; width: 100%; }
.chart-box.h-sm  { height: 190px; }
.chart-box.h-md  { height: 260px; }
.chart-box.h-lg  { height: 330px; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 12.2px; color: var(--text-2); }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 6px; }

/* ---------- 17. Lists / timeline ------------------------------------- */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--surface-2); text-decoration: none; }
.list-item .li-main { min-width: 0; flex: 1; }
.list-item .li-title { font-weight: 590; font-size: 13.3px; }
.list-item .li-sub { font-size: 11.8px; color: var(--text-3); }
.list-item .li-end { text-align: right; white-space: nowrap; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before {
  content: ""; position: absolute; left: -20px; top: 5px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--blue-500);
}
.tl-item.ok::before   { border-color: var(--success); }
.tl-item.bad::before  { border-color: var(--danger); }
.tl-item.warn::before { border-color: var(--warning); }
.tl-time { font-size: 11.4px; color: var(--text-3); }
.tl-title { font-size: 13.2px; font-weight: 570; }

/* schedule strip */
.sched-item {
  display: flex; gap: 13px; align-items: stretch;
  padding: 11px 16px; border-bottom: 1px solid var(--border);
}
.sched-item:last-child { border-bottom: 0; }
.sched-time {
  flex: 0 0 74px; text-align: right;
  font-variant-numeric: tabular-nums;
}
.sched-time b { display: block; font-size: 13px; font-weight: 650; }
.sched-time span { font-size: 11px; color: var(--text-3); }
.sched-bar { width: 3px; border-radius: 3px; background: var(--blue-500); flex: 0 0 3px; }
.sched-bar.g { background: var(--pitch-500); }
.sched-bar.a { background: var(--amber-500); }
.sched-bar.r { background: var(--red-500); }
.sched-bar.n { background: var(--border-strong); }
.sched-main { min-width: 0; flex: 1; }
.sched-main b { font-size: 13.2px; font-weight: 600; display: block; }
.sched-main span { font-size: 11.8px; color: var(--text-3); }

/* ---------- 18. Hours grid ------------------------------------------- */
.hours-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.day-card {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
}
.day-card.today { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.day-card.closed { background: var(--surface-2); }
.day-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.day-head b { font-size: 13.2px; }
.day-head .total { margin-left: auto; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.day-body { padding: 9px 13px 12px; display: flex; flex-direction: column; gap: 7px; }
.session-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 9px; border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12.6px;
  font-variant-numeric: tabular-nums;
}
.session-row .sess-label { color: var(--text-3); font-size: 11px; }
.session-row .sess-actions { margin-left: auto; display: flex; gap: 3px; }

/* ---------- 19. Invoice document ------------------------------------- */
.doc {
  background: #fff;
  color: #14213D;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 38px 40px;
  max-width: 880px;
  margin: 0 auto;
}
.doc-head { display: flex; gap: 24px; justify-content: space-between; flex-wrap: wrap; padding-bottom: 22px; border-bottom: 2px solid #0F2144; }
.doc-brand { display: flex; gap: 13px; align-items: flex-start; }
.doc-brand .mark { width: 50px; height: 50px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(140deg, #1D4ED8, #10B981); color: #fff; flex: 0 0 50px; overflow: hidden; }
.doc-brand .mark svg { width: 26px; height: 26px; }
.doc-brand h2 { font-size: 20px; color: #0F2144; letter-spacing: -.3px; }
.doc-brand .meta { font-size: 12px; color: #5A6B85; line-height: 1.65; margin-top: 3px; }
.doc-title { text-align: right; }
.doc-title .t { font-size: 30px; font-weight: 750; letter-spacing: 3px; color: #0F2144; }
.doc-title .no { font-family: var(--mono); font-size: 13.5px; color: #1D4ED8; font-weight: 650; margin-top: 2px; }
.doc-title .dates { font-size: 12px; color: #5A6B85; margin-top: 7px; line-height: 1.7; }

.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; padding: 22px 0; }
.doc-party .k { font-size: 10.5px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; color: #8494AC; margin-bottom: 6px; }
.doc-party .n { font-size: 15px; font-weight: 650; color: #0F2144; }
.doc-party .d { font-size: 12.4px; color: #5A6B85; line-height: 1.7; }

table.doc-table { width: 100%; border-collapse: collapse; font-size: 12.8px; margin-top: 6px; }
table.doc-table thead th {
  background: #0F2144; color: #fff;
  padding: 10px 12px; text-align: left;
  font-size: 10.6px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
}
table.doc-table thead th:first-child { border-radius: 6px 0 0 6px; }
table.doc-table thead th:last-child  { border-radius: 0 6px 6px 0; }
table.doc-table tbody td { padding: 11px 12px; border-bottom: 1px solid #E6EBF2; vertical-align: top; }
table.doc-table tbody tr:nth-child(even) td { background: #F8FAFC; }
table.doc-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.doc-totals { display: flex; justify-content: flex-end; margin-top: 18px; }
.doc-totals table { font-size: 13px; min-width: 290px; }
.doc-totals td { padding: 6px 0; }
.doc-totals td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; padding-left: 30px; }
.doc-totals tr.grand td { border-top: 2px solid #0F2144; padding-top: 10px; font-size: 16px; font-weight: 750; color: #0F2144; }
.doc-totals tr.bal td { font-weight: 700; }
.doc-totals tr.bal td:last-child { color: #B91C1C; }
.doc-totals tr.bal.settled td:last-child { color: #047857; }

.doc-stamp {
  display: inline-block;
  border: 3px solid #047857; color: #047857;
  padding: 5px 18px; border-radius: 8px;
  font-size: 17px; font-weight: 800; letter-spacing: 3px;
  transform: rotate(-7deg);
}
.doc-stamp.due { border-color: #B91C1C; color: #B91C1C; }
.doc-stamp.part { border-color: #B45309; color: #B45309; }
.doc-stamp.void { border-color: #64748B; color: #64748B; }

.doc-foot { margin-top: 34px; padding-top: 20px; border-top: 1px solid #E6EBF2; display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; }
.doc-foot .k { font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #8494AC; margin-bottom: 5px; }
.doc-foot .v { font-size: 12.2px; color: #5A6B85; line-height: 1.7; }
.doc-sign { text-align: right; padding-top: 34px; }
.doc-sign .line { border-top: 1px solid #0F2144; width: 190px; margin-left: auto; padding-top: 5px; font-size: 11.5px; color: #5A6B85; }
.doc-note { margin-top: 22px; text-align: center; font-size: 11px; color: #8494AC; }

/* ---------- 20. Login ------------------------------------------------ */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  background: var(--navy-900);
}
.auth-visual {
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 46px 52px;
  color: #fff;
  background: linear-gradient(150deg, #061021 0%, #0D2247 45%, #08182F 100%);
}
.auth-visual::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(48% 46% at 78% 12%, rgba(16,185,129,.30), transparent 62%),
    radial-gradient(52% 50% at 14% 88%, rgba(37,99,235,.34), transparent 64%);
}
/* stadium floodlights */
.auth-visual::after {
  content: ""; position: absolute; inset: 0;
  background:
    conic-gradient(from 195deg at 22% -6%, transparent 0deg, rgba(255,255,255,.075) 8deg, transparent 20deg),
    conic-gradient(from 165deg at 78% -6%, transparent 0deg, rgba(255,255,255,.075) 8deg, transparent 20deg),
    repeating-linear-gradient(90deg, rgba(255,255,255,.022) 0 3px, transparent 3px 68px);
  pointer-events: none;
}
.auth-visual > * { position: relative; z-index: 2; }

.auth-logo { display: flex; align-items: center; gap: 13px; }
.auth-logo .mark { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(140deg, var(--blue-600), var(--pitch-500)); box-shadow: 0 6px 22px rgba(16,185,129,.35); flex: 0 0 44px; }
.auth-logo .mark svg { width: 24px; height: 24px; }
.auth-logo b { font-size: 19px; letter-spacing: .4px; display: block; }
.auth-logo span { font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase; color: #7C98BE; font-weight: 600; }

.auth-pitch h1 { font-size: 40px; line-height: 1.13; letter-spacing: -1.2px; font-weight: 700; max-width: 12ch; }
.auth-pitch h1 em { font-style: normal; background: linear-gradient(96deg, var(--pitch-400), var(--blue-500)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-pitch p { color: #9DB6D6; font-size: 15px; max-width: 42ch; margin-top: 16px; line-height: 1.65; }

.auth-stats { display: flex; gap: 34px; flex-wrap: wrap; }
.auth-stat .v { font-size: 24px; font-weight: 720; letter-spacing: -.5px; }
.auth-stat .k { font-size: 11px; color: #7C98BE; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; margin-top: 2px; }

.auth-panel {
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 28px;
}
.auth-card { width: 100%; max-width: 384px; }
.auth-card h2 { font-size: 25px; letter-spacing: -.5px; }
.auth-card .lead { color: var(--text-3); font-size: 13.6px; margin: 6px 0 26px; }
.auth-card .field { margin-bottom: 15px; }
.auth-card .input { height: 42px; font-size: 14px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 20px; }
.auth-foot { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); text-align: center; }

.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 40px; }
.pw-toggle { position: absolute; right: 6px; top: 5px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: none; cursor: pointer; color: var(--text-3); border-radius: 7px; }
.pw-toggle:hover { background: var(--surface-3); }
.pw-toggle svg { width: 17px; height: 17px; }

.demo-creds {
  margin-top: 18px; padding: 12px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r);
  background: var(--surface-2);
  font-size: 12px; color: var(--text-2);
}
.demo-creds b { display: block; margin-bottom: 5px; font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: var(--text-3); }
.demo-creds code { font-family: var(--mono); background: var(--surface-3); padding: 1px 5px; border-radius: 4px; font-size: 11.5px; }
.demo-creds .r { display: flex; justify-content: space-between; padding: 2px 0; }

/* ---------- 21. Misc utilities --------------------------------------- */
.muted { color: var(--text-3); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-accent  { color: var(--accent); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.fw-600 { font-weight: 620; }
.fw-700 { font-weight: 700; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fs-18 { font-size: 18px; }
.fs-22 { font-size: 22px; }

.mt-0 { margin-top: 0; } .mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; } .mt-4 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; } .mb-4 { margin-bottom: 24px; }
.p-0 { padding: 0; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 6px; } .gap-2 { gap: 12px; } .gap-3 { gap: 18px; }
.wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.hidden { display: none !important; }

.progress { height: 6px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.progress .bar { height: 100%; border-radius: var(--r-full); background: var(--blue-600); transition: width .35s var(--ease); }
.progress .bar.g { background: var(--pitch-600); }
.progress .bar.a { background: var(--amber-500); }
.progress .bar.r { background: var(--red-600); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 20px; font-size: 13.2px; }
.kv dt { color: var(--text-3); font-size: 12.4px; }
.kv dd { margin: 0; font-weight: 550; text-align: right; }

.section-title {
  font-size: 11.5px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase;
  color: var(--text-3); margin: 24px 0 11px;
}
.section-title:first-child { margin-top: 0; }

.divider-y > * + * { border-top: 1px solid var(--border); }

/* ---------- 22. Responsive ------------------------------------------- */
.sidebar-toggle { display: none; }
.scrim { display: none; }

@media (max-width: 1280px) {
  .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
}

@media (max-width: 980px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-parties { grid-template-columns: 1fr; gap: 18px; }
  .doc-foot { grid-template-columns: 1fr; }
  .doc-sign { text-align: left; padding-top: 12px; }
  .doc-sign .line { margin-left: 0; }
}

@media (max-width: 860px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(7,18,39,.5); }
  .main { margin-left: 0; }
  .sidebar-toggle { display: grid; }
  .topbar-search { display: none; }
  .content { padding: 16px 14px 48px; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .form-grid .span-2, .form-grid .span-3 { grid-column: span 1; }
  .doc { padding: 24px 20px; }
  .doc-title { text-align: left; }
  .filters { padding: 12px; }
  .filters .field { min-width: 0; flex: 1 1 140px; }
  .filters .filter-actions { margin-left: 0; width: 100%; }
}

@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4, .grid-5, .grid-6 { grid-template-columns: 1fr; }
  .stat-value { font-size: 21px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .user-chip .who { display: none; }
  .status-facts { gap: 16px; }
  .status-fact { flex: 1 1 40%; }
  .auth-panel { padding: 28px 18px; }
  .modal-body { padding: 16px; }
  .pager { justify-content: center; }
  .pager .pages { margin-left: 0; }
}

/* ---------- 23. Print ------------------------------------------------- */
@media print {
  .sidebar, .topbar, .no-print, .page-head .actions, .pager, .filters { display: none !important; }
  .main { margin-left: 0; }
  .content { padding: 0; }
  body { background: #fff; }
  .doc { box-shadow: none; border: 0; padding: 0; max-width: none; }
  .card { border: 1px solid #D8DEE8; box-shadow: none; break-inside: avoid; }
  table.data thead th { background: #EEF2F7 !important; color: #333 !important; position: static; }
  a { color: inherit; text-decoration: none; }
  @page { margin: 14mm; }
}
