/* ============================================================
   Sentinel Decs — Design System
   Identity: 170th Intelligence Support Squadron
   Palette: derived from unit patch (gold, navy, crimson, silver)
   ============================================================ */

/* ── Self-hosted fonts (no external requests, no Google tracking) ─── */

/* Inter — cyrillic-ext */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('../fonts/inter-cyrillic-ext.woff2') format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
/* Inter — cyrillic */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('../fonts/inter-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
/* Inter — greek-ext */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('../fonts/inter-greek-ext.woff2') format('woff2'); unicode-range: U+1F00-1FFF; }
/* Inter — greek */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('../fonts/inter-greek.woff2') format('woff2'); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
/* Inter — vietnamese */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('../fonts/inter-vietnamese.woff2') format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
/* Inter — latin-ext */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('../fonts/inter-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* Inter — latin */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('../fonts/inter-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* JetBrains Mono — cyrillic-ext */
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 500; font-display: swap; src: url('../fonts/jetbrains-mono-cyrillic-ext.woff2') format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
/* JetBrains Mono — cyrillic */
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 500; font-display: swap; src: url('../fonts/jetbrains-mono-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
/* JetBrains Mono — greek */
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 500; font-display: swap; src: url('../fonts/jetbrains-mono-greek.woff2') format('woff2'); unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF; }
/* JetBrains Mono — vietnamese */
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 500; font-display: swap; src: url('../fonts/jetbrains-mono-vietnamese.woff2') format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
/* JetBrains Mono — latin-ext */
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 500; font-display: swap; src: url('../fonts/jetbrains-mono-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* JetBrains Mono — latin */
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 500; font-display: swap; src: url('../fonts/jetbrains-mono-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Space Grotesk — vietnamese */
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 500 700; font-display: swap; src: url('../fonts/space-grotesk-vietnamese.woff2') format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
/* Space Grotesk — latin-ext */
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 500 700; font-display: swap; src: url('../fonts/space-grotesk-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* Space Grotesk — latin */
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 500 700; font-display: swap; src: url('../fonts/space-grotesk-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
  /* Backgrounds — navy-tinted dark */
  --sd-bg-page:    #0f1219;
  --sd-bg-card:    #161c28;
  --sd-bg-surface: #1e2636;
  --sd-bg-input:   #1e2636;

  /* Text */
  --sd-text-primary:   #f0f2f5;
  --sd-text-secondary: #9aa5b8;
  --sd-text-muted:     #5a6478;

  /* Borders */
  --sd-border:       #2a3348;
  --sd-border-focus: #E8B800;

  /* Accent — 170 ISS Gold (lightning bolts on unit patch) */
  --sd-accent:       #E8B800;
  --sd-accent-hover: #C49C00;
  --sd-accent-glow:  rgba(232, 184, 0, 0.18);

  /* Unit identity colors */
  --sd-navy:    #3C5280;
  --sd-crimson: #8B2222;
  --sd-silver:  #B0B8C8;

  /* Semantic */
  --sd-success: #2eb50b;
  --sd-warning: #f99d1c;
  --sd-danger:  #8B2222;
  --sd-info:    #4a7ab5;

  /* Elevation */
  --sd-shadow-flat:    0 2px 9px 0 rgba(0,0,0,.28);
  --sd-shadow-raised:  0 0 0 .2rem rgba(232,184,0,.22);
  --sd-shadow-float:   0 5px 14px rgba(0,0,0,.4);
  --sd-shadow-overlay: 0 0 30px rgba(0,0,0,.7);

  /* Spacing — 5px grid */
  --sd-space-1:  5px;
  --sd-space-2:  10px;
  --sd-space-3:  15px;
  --sd-space-4:  20px;
  --sd-space-6:  30px;
  --sd-space-8:  40px;
  --sd-space-12: 60px;

  /* Radius */
  --sd-radius-sm: 4px;
  --sd-radius:    6px;
  --sd-radius-lg: 10px;

  /* Sidebar */
  --sd-sidebar-width: 220px;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow-x: hidden;
}

body {
  background-color: var(--sd-bg-page);
  color: var(--sd-text-primary);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  color: var(--sd-text-primary);
  margin-top: 0;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

.sd-mono { font-family: 'JetBrains Mono', monospace; }

a { color: var(--sd-accent); text-decoration: none; }
a:hover { color: var(--sd-accent-hover); }

/* ── Layout: Sidebar + Main ─────────────────────────────────── */
.sd-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sd-sidebar {
  width: var(--sd-sidebar-width);
  background: var(--sd-bg-card);
  border-right: 1px solid var(--sd-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}

.sd-sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--sd-space-2);
  padding: var(--sd-space-4) var(--sd-space-4) var(--sd-space-3);
  border-bottom: 1px solid var(--sd-border);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--sd-text-primary);
  text-decoration: none;
}

.sd-sidebar-brand:hover { color: var(--sd-text-primary); }

.sd-brand-patch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(232,184,0,.35);
}

.sd-nav {
  flex: 1;
  padding: var(--sd-space-3) 0;
  min-height: 0;
  overflow-y: auto;
}

.sd-nav-section {
  padding: var(--sd-space-2) var(--sd-space-4) var(--sd-space-1);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sd-text-muted);
}

.sd-nav-link {
  display: flex;
  align-items: center;
  gap: var(--sd-space-2);
  padding: var(--sd-space-2) var(--sd-space-4);
  color: var(--sd-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.sd-nav-link:hover {
  color: var(--sd-text-primary);
  background: rgba(255,255,255,0.04);
  border-left-color: var(--sd-border);
}

.sd-nav-link.active {
  color: var(--sd-text-primary);
  background: rgba(206,0,112,0.1);
  border-left-color: var(--sd-accent);
}

.sd-nav-sub {
  padding-left: var(--sd-space-8);
  font-size: 0.825rem;
}

.sd-sidebar-footer {
  position: sticky;
  bottom: 0;
  padding: var(--sd-space-3) var(--sd-space-4);
  border-top: 1px solid var(--sd-border);
  background: var(--sd-bg-card);
}

.sd-user-badge {
  display: flex;
  align-items: center;
  gap: var(--sd-space-2);
  margin-bottom: var(--sd-space-2);
}

.sd-user-avatar {
  width: 32px;
  height: 32px;
  background: var(--sd-bg-surface);
  border: 1px solid var(--sd-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--sd-text-secondary);
  flex-shrink: 0;
}

.sd-user-info { min-width: 0; }
.sd-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--sd-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sd-user-rank {
  font-size: 0.7rem;
  color: var(--sd-text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* Main content area */
.sd-main {
  margin-left: var(--sd-sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.sd-topbar {
  display: none; /* hidden on desktop — mobile only */
}

.sd-content {
  flex: 1;
  padding: var(--sd-space-8) var(--sd-space-8);
  max-width: 1200px;
  width: 100%;
}

.sd-flash-zone {
  padding: var(--sd-space-4) var(--sd-space-8) 0;
}

.sd-footer {
  padding: var(--sd-space-4) var(--sd-space-8);
  border-top: 1px solid var(--sd-border);
  text-align: center;
  font-size: 0.75rem;
  color: var(--sd-text-muted);
}

/* ── Bootstrap Dark Overrides ───────────────────────────────── */
.card {
  background: var(--sd-bg-card);
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius);
  box-shadow: var(--sd-shadow-flat);
  color: var(--sd-text-primary);
}

.card-header {
  background: var(--sd-bg-surface);
  border-bottom: 1px solid var(--sd-border);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--sd-text-primary);
}

.card-body { padding: var(--sd-space-4); }

/* Forms */
.form-control,
.form-select {
  background: var(--sd-bg-input);
  border: 1px solid var(--sd-border);
  color: var(--sd-text-primary);
  border-radius: var(--sd-radius-sm);
  font-size: 0.875rem;
}

.form-control:focus,
.form-select:focus {
  background: var(--sd-bg-input);
  border-color: var(--sd-border-focus);
  color: var(--sd-text-primary);
  box-shadow: var(--sd-shadow-raised);
  outline: none;
}

.form-control::placeholder { color: var(--sd-text-muted); }

.form-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--sd-text-secondary);
  margin-bottom: var(--sd-space-1);
}

.form-text { color: var(--sd-text-muted); font-size: 0.75rem; }

.form-control:disabled,
.form-select:disabled {
  background: var(--sd-bg-page);
  color: var(--sd-text-muted);
  border-color: var(--sd-border);
  opacity: 0.7;
}

/* Buttons */
.btn-primary {
  background: var(--sd-accent);
  border-color: var(--sd-accent);
  color: #0f1219;
  border-radius: var(--sd-radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--sd-accent-hover);
  border-color: var(--sd-accent-hover);
  color: #0f1219;
  box-shadow: 0 0 16px rgba(232,184,0,.25);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--sd-border);
  color: var(--sd-text-secondary);
  border-radius: var(--sd-radius-sm);
  font-weight: 500;
  font-size: 0.875rem;
  transition: border-color 0.15s, color 0.15s;
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: var(--sd-bg-surface);
  border-color: var(--sd-text-secondary);
  color: var(--sd-text-primary);
}

.btn-outline-light {
  border-color: var(--sd-border);
  color: var(--sd-text-secondary);
}

.btn-outline-light:hover {
  background: var(--sd-bg-surface);
  border-color: var(--sd-text-secondary);
  color: var(--sd-text-primary);
}

.btn-danger {
  background: var(--sd-danger);
  border-color: var(--sd-danger);
  color: #fff;
}

.btn-danger:hover { opacity: 0.85; color: #fff; }

.btn-success {
  background: var(--sd-success);
  border-color: var(--sd-success);
  color: #fff;
}

.btn-sm {
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: var(--sd-radius-sm);
}

/* Tables */
.table {
  color: var(--sd-text-primary);
  border-color: var(--sd-border);
  font-size: 0.875rem;
}

.table thead th {
  background: var(--sd-bg-surface);
  border-bottom: 1px solid var(--sd-border);
  color: var(--sd-text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--sd-space-2) var(--sd-space-3);
  white-space: nowrap;
}

.table tbody tr {
  border-bottom: 1px solid var(--sd-border);
  transition: background 0.1s;
}

.table tbody tr:hover { background: rgba(255,255,255,0.03); }

.table tbody td {
  padding: var(--sd-space-2) var(--sd-space-3);
  vertical-align: middle;
  color: var(--sd-text-primary);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: var(--sd-bg-surface) !important;
  color: var(--sd-text-primary) !important;
  --bs-table-accent-bg: transparent;
}
.table-striped > tbody > tr:nth-of-type(even) > * {
  background-color: var(--sd-bg-card) !important;
  color: var(--sd-text-primary) !important;
}

/* Override Bootstrap's .table-light which fights the dark theme */
.table-light {
  --bs-table-bg: var(--sd-bg-surface);
  --bs-table-color: var(--sd-text-secondary);
  --bs-table-border-color: var(--sd-border);
}
.table thead.table-light th,
.table-light th {
  background-color: var(--sd-bg-surface) !important;
  color: var(--sd-text-secondary) !important;
}

/* Bootstrap .table-hover dark override */
.table-hover > tbody > tr:hover > * {
  background-color: rgba(232,184,0,0.06) !important;
  color: var(--sd-text-primary) !important;
}

.table-bordered td,
.table-bordered th { border-color: var(--sd-border); }

/* Badges */
.badge {
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: var(--sd-radius-sm);
  padding: 3px 8px;
  letter-spacing: 0.02em;
}

.bg-success { background: var(--sd-success) !important; }
.bg-warning { background: var(--sd-warning) !important; color: #000 !important; }
.bg-danger  { background: var(--sd-danger) !important; }
.bg-info    { background: var(--sd-info) !important; }
.bg-secondary { background: var(--sd-bg-surface) !important; color: var(--sd-text-secondary) !important; border: 1px solid var(--sd-border); }
.bg-primary { background: var(--sd-accent) !important; }

/* Alerts / Flash messages */
.alert {
  border: none;
  border-left: 4px solid;
  border-radius: var(--sd-radius-sm);
  background: var(--sd-bg-surface);
  color: var(--sd-text-primary);
  font-size: 0.875rem;
  padding: var(--sd-space-3) var(--sd-space-4);
}

.alert-info    { border-left-color: var(--sd-info); }
.alert-success { border-left-color: var(--sd-success); }
.alert-warning { border-left-color: var(--sd-warning); }
.alert-danger  { border-left-color: var(--sd-danger); }

.alert .btn-close { filter: invert(1) grayscale(1); opacity: 0.6; }
.alert .btn-close:hover { opacity: 1; }

/* Modals */
.modal-content {
  background: var(--sd-bg-card);
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius);
  box-shadow: var(--sd-shadow-overlay);
}

.modal-header {
  border-bottom: 1px solid var(--sd-border);
  padding: var(--sd-space-4);
}

.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  color: var(--sd-text-primary);
}

.modal-body { padding: var(--sd-space-4); }

.modal-footer {
  border-top: 1px solid var(--sd-border);
  padding: var(--sd-space-3) var(--sd-space-4);
}

.modal-backdrop { background: rgba(0,0,0,0.7); }
.btn-close { filter: invert(1) grayscale(1); opacity: 0.6; }
.btn-close:hover { opacity: 1; }

/* Dropdowns */
.dropdown-menu {
  background: var(--sd-bg-surface);
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius);
  box-shadow: var(--sd-shadow-float);
  font-size: 0.875rem;
}

.dropdown-item {
  color: var(--sd-text-secondary);
  padding: var(--sd-space-2) var(--sd-space-4);
}

.dropdown-item:hover {
  background: rgba(255,255,255,0.06);
  color: var(--sd-text-primary);
}

.dropdown-divider { border-color: var(--sd-border); }

/* Pagination */
.pagination .page-link {
  background: var(--sd-bg-card);
  border-color: var(--sd-border);
  color: var(--sd-text-secondary);
  font-size: 0.8rem;
}

.pagination .page-link:hover {
  background: var(--sd-bg-surface);
  color: var(--sd-text-primary);
}

.pagination .page-item.active .page-link {
  background: var(--sd-accent);
  border-color: var(--sd-accent);
  color: #fff;
}

.pagination .page-item.disabled .page-link {
  background: var(--sd-bg-page);
  color: var(--sd-text-muted);
  border-color: var(--sd-border);
}

/* ── Custom Components ──────────────────────────────────────── */

/* Stat Card (Grafana-style) */
.sd-stat-card {
  background: var(--sd-bg-card);
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius);
  padding: var(--sd-space-4);
  box-shadow: var(--sd-shadow-flat);
}

.sd-stat-card-link {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
.sd-stat-card-link:hover {
  border-color: var(--sd-accent);
  box-shadow: var(--sd-shadow-card);
}

.sd-stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--sd-text-primary);
  line-height: 1;
}

.sd-stat-label {
  font-size: 0.75rem;
  color: var(--sd-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: var(--sd-space-1);
}

.sd-stat-accent { color: var(--sd-accent); }
.sd-stat-success { color: var(--sd-success); }
.sd-stat-warning { color: var(--sd-warning); }
.sd-stat-info    { color: var(--sd-info); }

/* Section heading */
.sd-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sd-space-4);
  padding-bottom: var(--sd-space-3);
  border-bottom: 1px solid var(--sd-border);
}

.sd-section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--sd-text-primary);
  margin: 0;
}

/* Status timeline (Grafana-style vertical) */
.sd-timeline { position: relative; padding-left: var(--sd-space-6); }

.sd-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--sd-border);
}

.sd-timeline-item { position: relative; margin-bottom: var(--sd-space-4); }

.sd-timeline-dot {
  position: absolute;
  left: calc(-1 * var(--sd-space-6) + 2px);
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sd-bg-surface);
  border: 2px solid var(--sd-border);
}

.sd-timeline-dot.active {
  background: var(--sd-accent);
  border-color: var(--sd-accent);
  box-shadow: 0 0 0 3px var(--sd-accent-glow);
}

.sd-timeline-dot.done {
  background: var(--sd-success);
  border-color: var(--sd-success);
}

.sd-timeline-label {
  font-size: 0.8rem;
  color: var(--sd-text-secondary);
}

.sd-timeline-date {
  font-size: 0.7rem;
  color: var(--sd-text-muted);
  font-family: 'JetBrains Mono', monospace;
}

/* Method badges (audit log) */
.sd-method-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--sd-radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sd-method-get    { background: rgba(0,100,218,0.2); color: #5b9cf6; border: 1px solid rgba(0,100,218,0.3); }
.sd-method-post   { background: rgba(206,0,112,0.15); color: #e85fa0; border: 1px solid rgba(206,0,112,0.25); }
.sd-method-put    { background: rgba(249,157,28,0.15); color: #f9a825; border: 1px solid rgba(249,157,28,0.25); }
.sd-method-delete { background: rgba(241,98,33,0.15); color: #f16221; border: 1px solid rgba(241,98,33,0.25); }
.sd-method-patch  { background: rgba(46,181,11,0.15); color: #2eb50b; border: 1px solid rgba(46,181,11,0.25); }

/* Page title area */
.sd-page-header {
  margin-bottom: var(--sd-space-6);
}

.sd-page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--sd-text-primary);
  margin: 0 0 var(--sd-space-1) 0;
}

.sd-page-subtitle {
  font-size: 0.875rem;
  color: var(--sd-text-muted);
}

/* ── Nav Tabs (Bootstrap dark override) ─────────────────────── */
.nav-tabs {
  border-bottom: 1px solid var(--sd-border);
}

.nav-tabs .nav-link {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--sd-text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: var(--sd-space-2) var(--sd-space-4);
  transition: color 0.15s, border-color 0.15s;
}

.nav-tabs .nav-link:hover {
  color: var(--sd-text-primary);
  border-color: transparent;
  background: transparent;
}

.nav-tabs .nav-link.active {
  color: var(--sd-text-primary);
  background: transparent;
  border-bottom-color: var(--sd-accent);
}

.sd-tab-content {
  padding-top: var(--sd-space-4);
}

/* ── List group dark override ────────────────────────────────── */
.list-group-item {
  background: var(--sd-bg-card);
  border-color: var(--sd-border);
  color: var(--sd-text-primary);
}

.list-group-flush .list-group-item {
  border-left: none;
  border-right: none;
}

.list-group-item:first-child { border-top: none; }
.list-group-item:last-child  { border-bottom: none; }

/* ── Landing Mode: Full-Screen Layout ──────────────────────── */
.sd-landing-mode .sd-sidebar,
.sd-landing-mode .sd-sidebar-overlay { display: none !important; }
.sd-landing-mode .sd-main { margin-left: 0 !important; }
.sd-landing-mode .sd-topbar { display: none !important; }
.sd-landing-mode .sd-flash-zone { padding: 0; margin: 0; }
.sd-landing-mode .sd-content { padding: 0; }
.sd-landing-mode .sd-footer { display: none !important; }

/* ── Landing Keyframes ──────────────────────────────────────── */
@keyframes sd-float {
  0%   { transform: translateY(0) scale(1); opacity: 0; }
  8%   { opacity: 0.8; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(-100vh) scale(0.7); opacity: 0; }
}

@keyframes sd-fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes sd-expand {
  from { width: 0; }
  to   { width: 64px; }
}

@keyframes sd-drift {
  0%   { transform: translate(-50%, -50%) translateX(0) translateY(0); }
  50%  { transform: translate(-50%, -50%) translateX(-8px) translateY(3px); }
  100% { transform: translate(-50%, -50%) translateX(4px) translateY(-4px); }
}

@keyframes sd-marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Hero Section ────────────────────────────────────────────── */
.sd-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--sd-bg-page);
}

.sd-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 50%, rgba(60,82,128,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.sd-hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background: url('/static/img/hero-bg.png') center center / cover no-repeat;
}

.sd-hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 13, 19, 0.72);
}

.sd-aircraft {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  width: 105%;
  min-width: 800px;
  opacity: 0.055;
  fill: var(--sd-silver);
  animation: sd-drift 35s ease-in-out infinite alternate;
}

.sd-particles { position: absolute; inset: 0; }

.sd-particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(232, 184, 0, 0.7);
  box-shadow: 0 0 5px rgba(232, 184, 0, 0.35);
  bottom: -8px;
  animation: sd-float 12s 0s linear infinite;
}

/* Per-particle position, size, and timing (CSP-compliant — no inline styles) */
.sd-particle:nth-child(1)  { left:  5%; width:2px; height:2px; animation-duration:13s; animation-delay:-1s; }
.sd-particle:nth-child(2)  { left: 12%; width:4px; height:4px; animation-duration: 9s; animation-delay:-4s; }
.sd-particle:nth-child(3)  { left: 20%; width:3px; height:3px; animation-duration:11s; animation-delay:-7s; }
.sd-particle:nth-child(4)  { left: 28%; width:2px; height:2px; animation-duration:14s; animation-delay:-2s; }
.sd-particle:nth-child(5)  { left: 38%; width:5px; height:5px; animation-duration:10s; animation-delay:-9s; }
.sd-particle:nth-child(6)  { left: 47%; width:2px; height:2px; animation-duration:12s; animation-delay:-3s; }
.sd-particle:nth-child(7)  { left: 55%; width:3px; height:3px; animation-duration: 8s; animation-delay:-6s; }
.sd-particle:nth-child(8)  { left: 63%; width:4px; height:4px; animation-duration:15s; animation-delay:-1s; }
.sd-particle:nth-child(9)  { left: 70%; width:2px; height:2px; animation-duration:10s; animation-delay:-8s; }
.sd-particle:nth-child(10) { left: 78%; width:3px; height:3px; animation-duration:13s; animation-delay:-5s; }
.sd-particle:nth-child(11) { left: 85%; width:5px; height:5px; animation-duration: 9s; animation-delay:-2s; }
.sd-particle:nth-child(12) { left: 91%; width:2px; height:2px; animation-duration:11s; animation-delay:-7s; }
.sd-particle:nth-child(13) { left: 33%; width:3px; height:3px; animation-duration:16s; animation-delay:-4s; }
.sd-particle:nth-child(14) { left: 58%; width:4px; height:4px; animation-duration:14s; animation-delay:-10s; }
.sd-particle:nth-child(15) { left: 74%; width:2px; height:2px; animation-duration:12s; animation-delay:-3s; }

.sd-hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 680px;
  padding: 48px 28px;
  animation: sd-fadeInUp 0.7s ease-out both;
}

.sd-hero-eyebrow {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sd-accent);
  margin-bottom: 20px;
  padding: 4px 14px;
  border: 1px solid rgba(232,184,0,.3);
  border-radius: 20px;
}

.sd-hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.8rem, 6vw, 5.8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.95;
  color: var(--sd-text-primary);
  margin: 0 0 24px 0;
}

.sd-hero-divider {
  width: 0;
  height: 3px;
  background: var(--sd-accent);
  border-radius: 2px;
  margin: 0 auto 28px;
  animation: sd-expand 0.9s 0.3s ease-out both;
}

.sd-hero-sub {
  color: var(--sd-text-secondary);
  font-size: 1rem;
  line-height: 1.78;
  max-width: 460px;
  margin: 0 auto 42px;
}

.sd-hero-cta {
  display: inline-block;
  background: var(--sd-accent);
  color: #0a0d13;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px 52px;
  border-radius: var(--sd-radius);
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}

.sd-hero-cta:hover {
  background: var(--sd-accent-hover);
  color: #0a0d13;
  box-shadow: 0 0 36px rgba(232,184,0,.28), 0 2px 8px rgba(0,0,0,.4);
  transform: translateY(-1px);
}

/* ── Features Section ────────────────────────────────────────── */
.sd-features {
  background: var(--sd-bg-card);
  padding: 88px 28px;
  border-top: 1px solid var(--sd-border);
}

.sd-features-inner { max-width: 1000px; margin: 0 auto; }

.sd-features-heading {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sd-text-muted);
  margin-bottom: 48px;
}

.sd-features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.sd-feature-card {
  background: var(--sd-bg-surface);
  border: 1px solid var(--sd-border);
  border-top: 3px solid var(--sd-accent);
  border-radius: var(--sd-radius-lg);
  padding: 32px 26px;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease-out, transform 0.55s ease-out, border-color 0.2s;
}

.sd-feature-card.sd-visible { opacity: 1; transform: translateY(0); }
.sd-feature-card:nth-child(2) { transition-delay: 0.12s; }
.sd-feature-card:nth-child(3) { transition-delay: 0.24s; }
.sd-feature-card:hover { border-color: rgba(232,184,0,.45); border-top-color: var(--sd-accent); }

.sd-feature-icon { font-size: 1.6rem; margin-bottom: 16px; display: block; }

.sd-feature-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--sd-text-primary);
  margin: 0 0 10px 0;
}

.sd-feature-desc {
  font-size: 0.85rem;
  color: var(--sd-text-secondary);
  line-height: 1.7;
  margin: 0;
}

/* ── Ribbon Showcase Marquee ─────────────────────────────────── */
.sd-showcase {
  background: var(--sd-bg-page);
  padding: 52px 0;
  border-top: 1px solid var(--sd-border);
  overflow: hidden;
}

.sd-showcase-label {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sd-text-muted);
  margin-bottom: 24px;
}

.sd-showcase-track-wrap {
  position: relative;
  overflow: hidden;
}

.sd-showcase-track-wrap::before,
.sd-showcase-track-wrap::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 100px;
  z-index: 2;
  pointer-events: none;
}

.sd-showcase-track-wrap::before {
  left: 0;
  background: linear-gradient(to right, var(--sd-bg-page), transparent);
}

.sd-showcase-track-wrap::after {
  right: 0;
  background: linear-gradient(to left, var(--sd-bg-page), transparent);
}

.sd-showcase-track {
  display: flex;
  gap: 0;
  width: max-content;
  animation: sd-marquee 45s linear infinite;
  padding: 4px 0;
}

.sd-hero-ribbon {
  height: 18px;
  width: 60px;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
  /* margin-right makes each ribbon's trailing space part of its own width,
     so the half-set width (12*70px = 840px) equals exactly -50% of the
     full track width (24*70px = 1680px) — seamless marquee loop */
  margin-right: 10px;
}

.sd-hero-ribbon[data-r="1"]  { background: linear-gradient(90deg,#1a3a6b 30%,#E8B800 30%,#E8B800 70%,#1a3a6b 70%); }
.sd-hero-ribbon[data-r="2"]  { background: linear-gradient(90deg,#1a3a6b 20%,#c0c0c0 20%,#c0c0c0 40%,#1a3a6b 40%,#1a3a6b 60%,#c0c0c0 60%,#c0c0c0 80%,#1a3a6b 80%); }
.sd-hero-ribbon[data-r="3"]  { background: linear-gradient(90deg,#7b0000 25%,#f0f0f0 25%,#f0f0f0 37%,#1a3a6b 37%,#1a3a6b 63%,#f0f0f0 63%,#f0f0f0 75%,#7b0000 75%); }
.sd-hero-ribbon[data-r="4"]  { background: linear-gradient(90deg,#2d6a4f 33%,#f0f0f0 33%,#f0f0f0 67%,#2d6a4f 67%); }
.sd-hero-ribbon[data-r="5"]  { background: linear-gradient(90deg,#d06020 20%,#1a3a6b 20%,#1a3a6b 50%,#f0f0f0 50%,#f0f0f0 80%,#d06020 80%); }
.sd-hero-ribbon[data-r="6"]  { background: linear-gradient(90deg,#1a3a6b 15%,#f0f0f0 15%,#f0f0f0 25%,#E8B800 25%,#E8B800 75%,#f0f0f0 75%,#f0f0f0 85%,#1a3a6b 85%); }
.sd-hero-ribbon[data-r="7"]  { background: linear-gradient(90deg,#1a3a6b 20%,#7b0000 20%,#7b0000 40%,#f0f0f0 40%,#f0f0f0 60%,#7b0000 60%,#7b0000 80%,#1a3a6b 80%); }
.sd-hero-ribbon[data-r="8"]  { background: #1a3a6b; }
.sd-hero-ribbon[data-r="9"]  { background: linear-gradient(90deg,#4a3080 50%,#E8B800 50%); }
.sd-hero-ribbon[data-r="10"] { background: linear-gradient(90deg,#7b0000 16%,#f0f0f0 16%,#f0f0f0 33%,#1a3a6b 33%,#1a3a6b 67%,#f0f0f0 67%,#f0f0f0 84%,#7b0000 84%); }
.sd-hero-ribbon[data-r="11"] { background: linear-gradient(90deg,#1a3a6b 40%,#E8B800 40%,#E8B800 60%,#1a3a6b 60%); }
.sd-hero-ribbon[data-r="12"] { background: linear-gradient(90deg,#1a3a6b 25%,#7b0000 25%,#7b0000 50%,#1a3a6b 50%,#1a3a6b 75%,#7b0000 75%); }

/* ── Landing Footer Strip ────────────────────────────────────── */
.sd-landing-footer {
  background: var(--sd-bg-card);
  border-top: 1px solid var(--sd-border);
  padding: 20px 28px;
  text-align: center;
  color: var(--sd-text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ── Landing Mobile ──────────────────────────────────────────── */
@media (max-width: 767px) {
  .sd-hero-title { font-size: 3rem; }
  .sd-features-grid { grid-template-columns: 1fr; }
  .sd-aircraft { opacity: 0.035; min-width: 0; width: 100%; }
  .sd-features { padding: 60px 20px; }
}

/* ── Login Card ─────────────────────────────────────────────── */
.sd-login-wrap {
  display: flex;
  justify-content: center;
  padding-top: var(--sd-space-8);
}

.sd-login-card {
  background: var(--sd-bg-card);
  border: 1px solid var(--sd-border);
  border-radius: var(--sd-radius-lg);
  box-shadow: var(--sd-shadow-float);
  padding: var(--sd-space-8);
  width: 100%;
  max-width: 400px;
}

.sd-login-header {
  text-align: center;
  margin-bottom: var(--sd-space-6);
}

.sd-login-icon {
  font-size: 1.75rem;
  margin-bottom: var(--sd-space-3);
}

.sd-login-title {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: var(--sd-space-1);
}

.sd-login-hint {
  font-size: 0.8rem;
  color: var(--sd-text-muted);
  margin: 0;
}

/* ── Ribbon Rack Catalog ────────────────────────────────────── */
.sd-catalog-section {
  padding: 4px 6px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--sd-text-muted);
  background: var(--sd-bg-surface);
  border-bottom: 1px solid var(--sd-border);
}

.sd-catalog-item {
  padding: 5px 6px;
  border-bottom: 1px solid var(--sd-border);
  transition: background 0.1s;
}

.sd-catalog-item:hover { background: rgba(255,255,255,0.03); }

.sd-catalog-earned { background: rgba(46,181,11,0.07); }
.sd-catalog-earned:hover { background: rgba(46,181,11,0.1); }

/* ── PII Acknowledgement Banner + Blocking Overlay ─────────── */
.sd-pii-page-overlay {
  position: fixed;
  inset: 0;
  z-index: 1039;
  background: rgba(0, 0, 0, 0.55);
  cursor: not-allowed;
  pointer-events: all;
}

.sd-pii-banner {
  position: relative;
  z-index: 1040;
  background: rgba(139, 0, 0, 0.18);
  border-bottom: 2px solid rgba(200, 0, 0, 0.5);
  padding: 12px 24px;
}

.sd-pii-banner-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
}

.sd-pii-banner-icon { font-size: 1.1rem; flex-shrink: 0; }

.sd-pii-banner-text { flex: 1; font-size: 0.82rem; color: var(--sd-text-secondary); }
.sd-pii-banner-text strong { color: #ff6b6b; }

.sd-pii-banner-btn {
  background: transparent;
  border: 1px solid rgba(200, 0, 0, 0.5);
  color: var(--sd-text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 6px 16px;
  border-radius: var(--sd-radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.sd-pii-banner-btn:hover {
  background: rgba(200, 0, 0, 0.15);
  border-color: rgba(200, 0, 0, 0.8);
}

/* ── Utility Classes ────────────────────────────────────────── */
.sd-link-plain    { color: inherit; text-decoration: none; }
.sd-form-inline   { display: inline; }
.sd-text-xs       { font-size: 0.75rem; }
.sd-text-xxs      { font-size: 0.7rem; }
.sd-pre-mono      { white-space: pre-wrap; font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; }
.sd-pre-serif     { white-space: pre-wrap; font-family: 'Times New Roman', serif; }
.sd-ribbon-swatch { width: 42px; height: 12px; overflow: hidden; }
.sd-catalog-scroll     { max-height: 500px; overflow-y: auto; }
.sd-ribbon-swatch-flex { flex-shrink: 0; width: 42px; height: 12px; overflow: hidden; }
.sd-rack-svg           { max-width: 100%; height: auto; }
.sd-flex-fill          { flex: 1; min-width: 0; }
.sd-btn-xs             { font-size: 0.7rem; padding: 2px 6px; }

.text-muted { color: var(--sd-text-muted) !important; }
.text-secondary { color: var(--sd-text-secondary) !important; }
.border-secondary { border-color: var(--sd-border) !important; }
.bg-dark { background-color: var(--sd-bg-card) !important; }

hr { border-color: var(--sd-border); opacity: 1; }

/* ── Mobile Layout ──────────────────────────────────────────── */
@media (max-width: 991px) {
  .sd-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sd-sidebar.open { transform: translateX(0); }

  .sd-main { margin-left: 0; }

  .sd-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sd-space-3) var(--sd-space-4);
    background: var(--sd-bg-card);
    border-bottom: 1px solid var(--sd-border);
    position: sticky;
    top: 0;
    z-index: 50;
  }

  .sd-topbar-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--sd-text-primary);
    text-decoration: none;
  }

  .sd-menu-toggle {
    background: none;
    border: 1px solid var(--sd-border);
    color: var(--sd-text-secondary);
    border-radius: var(--sd-radius-sm);
    padding: 5px 9px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
  }

  .sd-content {
    padding: var(--sd-space-4);
  }

  .sd-flash-zone {
    padding: var(--sd-space-4) var(--sd-space-4) 0;
  }

  .sd-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
  }

  .sd-sidebar-overlay.open { display: block; }
}

@media (min-width: 992px) {
  .sd-sidebar { transform: none !important; }
  .sd-sidebar-overlay { display: none !important; }
}

/* ── Admin Dashboard ──────────────────────────────────────── */

/* Tab nav */
.sd-admin-tabs .nav-link {
  color: var(--sd-text-secondary);
  border-color: transparent;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 16px;
}
.sd-admin-tabs .nav-link:hover { color: var(--sd-text-primary); background: rgba(255,255,255,0.04); }
.sd-admin-tabs .nav-link.active {
  color: var(--sd-accent);
  background: var(--sd-bg-card);
  border-color: var(--sd-border) var(--sd-border) var(--sd-bg-card);
}
.sd-admin-tabs { border-bottom-color: var(--sd-border); }

.sd-admin-tab-content {
  background: var(--sd-bg-card);
  border: 1px solid var(--sd-border);
  border-top: none;
  border-radius: 0 0 var(--sd-radius) var(--sd-radius);
  padding: var(--sd-space-4);
}

/* Admin table — sticky header + denser layout */
.sd-admin-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--sd-bg-surface) !important;
  border-bottom: 2px solid var(--sd-border);
}
.sd-admin-table td { font-size: 0.8rem; padding: 6px 10px !important; }
.sd-admin-table th { font-size: 0.7rem; padding: 6px 10px !important; }
.sd-admin-table .sd-num { font-family: 'JetBrains Mono', monospace; font-variant-numeric: tabular-nums; }

/* Filter chip row */
.sd-filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--sd-space-3); align-items: center; }
.sd-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border: 1px solid var(--sd-border);
  border-radius: 99px;
  font-size: 0.75rem;
  color: var(--sd-text-secondary);
  background: var(--sd-bg-surface);
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
  white-space: nowrap;
}
.sd-filter-chip:hover { border-color: var(--sd-accent); color: var(--sd-text-primary); }
.sd-filter-chip.active { border-color: var(--sd-accent); color: var(--sd-accent); background: var(--sd-accent-glow); }
.sd-filter-chip input[type="text"],
.sd-filter-chip input[type="search"] {
  background: transparent;
  border: none;
  outline: none;
  color: var(--sd-text-primary);
  font-size: 0.75rem;
  width: 120px;
}

/* Empty state */
.sd-empty-state {
  text-align: center;
  padding: var(--sd-space-8) var(--sd-space-4);
  color: var(--sd-text-muted);
}
.sd-empty-state-icon { font-size: 2rem; margin-bottom: var(--sd-space-2); opacity: 0.4; }
.sd-empty-state-msg { font-size: 0.875rem; }

/* Inline edit row */
.sd-edit-row { background: var(--sd-bg-page) !important; }
.sd-edit-row td { padding: 0 !important; }
.sd-inline-edit-form {
  background: var(--sd-bg-surface);
  border-top: 2px solid var(--sd-accent);
  padding: var(--sd-space-4) !important;
}
.sd-inline-edit-form .form-label { font-size: 0.75rem; color: var(--sd-text-secondary); margin-bottom: 2px; }

/* Toast notification */
#sd-toast-area {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.sd-toast {
  background: var(--sd-bg-surface);
  border: 1px solid var(--sd-border);
  border-left: 3px solid var(--sd-success);
  border-radius: var(--sd-radius);
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--sd-text-primary);
  box-shadow: var(--sd-shadow-float);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: auto;
}
.sd-toast.show { opacity: 1; transform: translateY(0); }

/* Mobile: collapse admin tables to stacked cards */
@media (max-width: 768px) {
  .sd-admin-table thead { display: none; }
  .sd-admin-table, .sd-admin-table tbody, .sd-admin-table tr { display: block; width: 100%; }
  .sd-admin-table tr {
    border: 1px solid var(--sd-border);
    border-radius: var(--sd-radius-sm);
    margin-bottom: 8px;
    padding: 8px;
    background: var(--sd-bg-card);
  }
  .sd-admin-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0 !important;
    border: none !important;
    font-size: 0.8rem;
  }
  .sd-admin-table td::before {
    content: attr(data-label);
    font-size: 0.7rem;
    color: var(--sd-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    flex-shrink: 0;
    margin-right: 8px;
  }
  .sd-admin-table thead th { position: static; }
  .sd-admin-tab-content { padding: var(--sd-space-3); }
}
