/* ==========================================================================
   AEROCUP 2026 — Dark Swiss Minimalist UI v5.1 (Full Polish: Desktop + Mobile + Ops)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Space+Grotesk:wght@600;700&family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap');

:root {
  --ds-obsidian: #090B0F;
  --ds-slate: #12161F;
  --ds-slate-2: #161B26;
  --ds-border: #1F2633;
  --ds-border-hover: #2E384D;
  --ds-signal: #EA580C;
  --ds-signal-hover: #C2410C;
  --ds-cobalt: #2563EB;
  --ds-emerald: #10B981;
  --ds-amber: #F59E0B;
  --ds-rose: #F43F5E;
  --ds-text: #F8FAFC;
  --ds-text-2: #CBD5E1;
  --ds-muted: #94A3B8;
  --ds-dim: #64748B;
  --ds-font: 'Vazirmatn', system-ui, -apple-system, sans-serif;
  --ds-display: 'Space Grotesk', 'Vazirmatn', sans-serif;
  --ds-mono: 'JetBrains Mono', ui-monospace, monospace;
}

html, body {
  max-width: 100% !important;
  overflow-x: clip !important;
  font-family: var(--ds-font) !important;
  color-scheme: dark !important;
  background-color: var(--ds-obsidian) !important;
  color: var(--ds-text) !important;
}

body.admin-app-body,
body.admin-app-body.ops-portal-body {
  background-color: var(--ds-obsidian) !important;
  background-image:
    radial-gradient(circle at 15% 0%, rgba(234, 88, 12, 0.085), transparent 36%),
    linear-gradient(rgba(31, 38, 51, 0.32) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 38, 51, 0.32) 1px, transparent 1px) !important;
  background-size: 100% 100%, 36px 36px, 36px 36px !important;
  color: var(--ds-text) !important;
  margin: 0 !important;
  min-height: 100dvh !important;
  -webkit-font-smoothing: antialiased;
}

/* Hide legacy sidebar & mobile bars */
.admin-sidebar,
.admin-mobile-top,
.admin-menu-overlay {
  display: none !important;
}

/* Prevent ANY grid/flex child from blowing out mobile width */
.admin-shell,
.admin-main,
.admin-main > section,
.admin-main > section > *,
.admin-main > div,
.score-grid > *,
.ops-grid > *,
.ops-wrap,
.ops-card,
.score-card,
.admin-panel-card {
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.admin-shell {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-height: calc(100dvh - 100px) !important;
  background: transparent !important;
}

.admin-main {
  margin: 0 auto !important;
  width: 100% !important;
  max-width: 1440px !important;
  padding: 24px 24px 64px !important;
  background: transparent !important;
}

.admin-main > .container,
.ap-page > .container,
.audit-module > .container {
  max-width: none !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}
.ap-page, .audit-module {
  padding-top: 24px !important;
}

/* ==========================================================================
   1. Top Utility Strip
   ========================================================================== */
.ds-util-strip {
  background: rgba(9, 11, 15, 0.96);
  border-bottom: 1px solid var(--ds-border);
  color: var(--ds-text-2);
  font-family: var(--ds-mono), var(--ds-font);
  font-size: 11px;
  padding: 6px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ds-util-group {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ds-sys-online {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #34D399;
  font-weight: 600;
}
.ds-sys-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34D399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.7);
  animation: dsPulse 2s infinite;
}
@keyframes dsPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.ds-util-muted { color: var(--ds-dim); }
.ds-util-phase { color: var(--ds-signal); font-weight: 700; }

/* ==========================================================================
   2. Sticky Main Header & Horizontal Navigation
   ========================================================================== */
.ds-header {
  background: rgba(18, 22, 31, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--ds-border);
  position: sticky;
  top: 0;
  z-index: 60;
}
.ds-header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ds-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.ds-brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(234, 88, 12, 0.14);
  border: 1px solid rgba(234, 88, 12, 0.42);
  color: var(--ds-signal);
  font-family: var(--ds-display);
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
}
.ds-brand-title {
  font-family: var(--ds-display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.1;
  color: #fff;
}
.ds-brand-title span { color: var(--ds-signal); }
.ds-brand-sub {
  font-size: 10.5px;
  color: var(--ds-muted);
  margin-top: 2px;
}

.ds-nav {
  display: flex;
  align-items: center;
  gap: 3px;
}
.ds-nav a,
.ds-nav-more-btn {
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ds-muted);
  text-decoration: none;
  background: transparent;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.ds-nav a:hover,
.ds-nav-more-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.ds-nav a.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 700;
}

.ds-more-wrap { position: relative; }
.ds-more-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  background: var(--ds-slate);
  border: 1px solid var(--ds-border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 80;
}
.ds-more-menu.open { display: flex; }
.ds-more-menu a,
.ds-more-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--ds-text-2);
  text-decoration: none;
  background: transparent;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  text-align: right;
}
.ds-more-menu a:hover,
.ds-more-menu button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.ds-more-menu .ds-logout-item {
  color: #FDA4AF;
  border-top: 1px solid var(--ds-border);
  margin-top: 4px;
  padding-top: 9px;
}

.ds-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.ds-search-wrap { position: relative; }
.ds-search-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--ds-obsidian);
  border: 1px solid var(--ds-border);
  border-radius: 9px;
  padding: 0 11px;
  height: 36px;
  width: 210px;
  transition: border-color 0.15s ease;
}
.ds-search-box:focus-within { border-color: var(--ds-signal); }
.ds-search-box input {
  border: 0 !important;
  background: transparent !important;
  color: #fff !important;
  outline: none !important;
  box-shadow: none !important;
  width: 100%;
  font-size: 12px !important;
  padding: 0 !important;
}
.ds-search-box kbd {
  font-family: var(--ds-mono);
  font-size: 10px;
  background: var(--ds-slate);
  border: 1px solid var(--ds-border);
  color: var(--ds-muted);
  padding: 1px 5px;
  border-radius: 4px;
}
.ds-mob-search-btn {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--ds-obsidian);
  border: 1px solid var(--ds-border);
  color: var(--ds-muted);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.ds-search-dd {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  background: var(--ds-slate);
  border: 1px solid var(--ds-border);
  border-radius: 12px;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.65);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  max-height: 320px;
  overflow-y: auto;
  z-index: 90;
}
.ds-search-dd.open { display: flex; }
.ds-search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 11px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ds-text-2);
  font-size: 12px;
  font-weight: 600;
}
.ds-search-item:hover {
  background: rgba(234, 88, 12, 0.14);
  color: #fff;
}
.ds-search-item small {
  font-family: var(--ds-mono);
  font-size: 10px;
  color: var(--ds-dim);
}

.ds-ops-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  border-radius: 9px;
  background: var(--ds-signal);
  color: #fff !important;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(234, 88, 12, 0.25);
  transition: background 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.ds-ops-btn:hover {
  background: var(--ds-signal-hover);
  transform: translateY(-1px);
}
.ds-ops-text-mob { display: none; }

/* ==========================================================================
   3. Overview Custom Telemetry & Hairline KPI Strip (Matches Reference 1:1)
   ========================================================================== */
.ds-kpi-strip {
  background: linear-gradient(180deg, rgba(22, 27, 38, 0.94) 0%, rgba(18, 22, 31, 0.98) 100%);
  border: 1px solid var(--ds-border);
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.ds-kpi-strip > article {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-left: 1px solid var(--ds-border) !important;
  padding: 20px 22px !important;
  margin: 0 !important;
}
.ds-kpi-strip > article:last-child { border-left: 0 !important; }
.ds-kpi-strip > article:hover { background: rgba(255, 255, 255, 0.02) !important; }
.ds-kpi-strip > article small {
  font-size: 12px !important;
  color: var(--ds-muted) !important;
  font-weight: 600 !important;
}
.ds-kpi-strip > article strong {
  font-family: var(--ds-mono), var(--ds-font) !important;
  font-size: 34px !important;
  font-weight: 700 !important;
  color: #fff !important;
  margin: 8px 0 4px !important;
  display: block;
}
@media (max-width: 900px) {
  .ds-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ds-kpi-strip > article {
    border-bottom: 1px solid var(--ds-border) !important;
    padding: 15px 14px !important;
  }
  .ds-kpi-strip > article:nth-child(even) { border-left: 0 !important; }
  .ds-kpi-strip > article:nth-last-child(-n+2) { border-bottom: 0 !important; }
}

.ds-telemetry-row {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 18px;
  margin-bottom: 18px;
}
@media (max-width: 1023px) {
  .ds-telemetry-row {
    grid-template-columns: 1fr;
  }
}
.ds-telemetry-card {
  background: linear-gradient(180deg, rgba(22, 27, 38, 0.94) 0%, rgba(18, 22, 31, 0.98) 100%);
  border: 1px solid var(--ds-border);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.ds-tel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ds-tel-eyebrow {
  font-family: var(--ds-mono);
  font-size: 10.5px;
  color: var(--ds-muted);
  letter-spacing: 0.08em;
}
.ds-tel-badge {
  font-family: var(--ds-mono);
  font-size: 11px;
  color: #34D399;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.28);
  padding: 2px 8px;
  border-radius: 6px;
}
.ds-tel-main {
  margin-top: 14px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.ds-tel-main strong {
  font-family: var(--ds-mono), var(--ds-font);
  font-size: 36px;
  font-weight: 700;
  color: #fff;
}
.ds-tel-main span {
  font-size: 12px;
  color: var(--ds-muted);
}
.ds-tel-sub {
  font-size: 12px;
  color: var(--ds-muted);
  margin-top: 4px;
}
.ds-tel-spark {
  margin: 18px 0;
}
.ds-tel-foot {
  padding-top: 14px;
  border-top: 1px solid var(--ds-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ds-tel-foot small {
  display: block;
  font-size: 11px;
  color: var(--ds-muted);
}
.ds-tel-foot strong {
  font-family: var(--ds-mono), var(--ds-font);
  font-size: 18px;
  color: #fff;
}

/* Status Bars exact reference colors */
.status-bars i {
  background: var(--ds-obsidian) !important;
  border: 1px solid var(--ds-border) !important;
  height: 8px !important;
  border-radius: 99px !important;
}
#barQualified { background: #10B981 !important; }
#barDraft { background: #F59E0B !important; }
#barSubmitted { background: #2563EB !important; }
#barNotQualified, #barDisqualified { background: #F43F5E !important; }

/* ==========================================================================
   4. Dark Swiss Cards, Surfaces, Typography & Controls (All 27 Pages + Ops)
   ========================================================================== */
.admin-panel-card,
.admin-kpi-grid > article,
.c-card,
.ops-card,
.ops-kpi,
.q-table-card,
.q-stat,
.q-toolbar,
.score-card,
.score-kpi,
.ra-card,
.ra-stat,
.staff-card,
.staff-stat,
.doc-table-card,
.doc-stat,
.doc-toolbar,
.team-table-card,
.team-stat,
.team-toolbar,
.user-table-card,
.user-stat,
.user-toolbar,
.ap-card,
.ap-kpi,
.ap-viewer,
.audit-table-card,
.audit-kpi,
.audit-tools,
.audit-viewer,
.pm-card,
.threshold-display,
.weight-card,
.drawer-card,
.user-card,
.doc-card,
.q-card {
  background: linear-gradient(180deg, rgba(22, 27, 38, 0.94) 0%, rgba(18, 22, 31, 0.98) 100%) !important;
  border: 1px solid var(--ds-border) !important;
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.04) !important;
  color: var(--ds-text) !important;
  border-radius: 14px !important;
}

.admin-hero-card,
.ops-banner,
.score-banner,
.q-command,
.user-role-strip,
.ops-hero,
.pm-card.dark {
  background: linear-gradient(135deg, #101520 0%, #151C2B 60%, #111827 100%) !important;
  border: 1px solid var(--ds-border) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  border-radius: 16px !important;
}

/* Fix ALL dark-navy (#0b1d3a) unreadable text across every single page */
.admin-main h1, .admin-main h2, .admin-main h3, .admin-main h4,
.ops-wrap h1, .ops-wrap h2, .ops-wrap h3, .ops-wrap h4,
.admin-kpi-grid strong, .team-stat strong, .user-stat strong,
.doc-stat strong, .score-kpi strong, .q-stat strong,
.ops-kpi strong, .ra-stat strong, .staff-stat strong,
.ap-kpi strong, .audit-kpi strong, .threshold-display strong,
.score-value, .team-number, .doc-version, .q-score,
.staff-check span, .staff-main strong, .perm-label strong,
.ops-list-item strong, .launch-name strong, .audit-action,
.audit-entity strong, .team-main strong, .user-main strong,
.doc-team strong, .q-team strong, .pm-item strong, .pm-file strong,
.ra-user strong, .ap-meta strong, .drawer-field strong,
.user-field strong, .doc-field strong, .q-field strong,
.pen-kv strong, .pen-box h4, .ops-score-meta strong,
.ops-doc-info, .ops-doc-info strong, .ops-check-label span,
.weight-card b, .status-bars strong, .audit-item strong,
.admin-list-item strong, .ra-stage-item strong, .ra-stage-option b {
  color: #F8FAFC !important;
}

.admin-main label, .ops-wrap label, .config-field label,
.ops-field label, .staff-form label, .ra-form label, .c-field label,
.ap-form label > span, .q-manual-box label, .pm-label {
  color: var(--ds-text-2) !important;
}

.admin-main h1 em { color: var(--ds-signal) !important; font-style: normal; }
.admin-main p, .admin-main small, .ops-wrap p, .ops-wrap small,
.audit-reason, .ap-box p, .admin-footer, .ops-footer, .ra-footer, .staff-footer {
  color: var(--ds-muted) !important;
}
.section-index, .eyebrow, .score-eyebrow, .q-eyebrow {
  font-family: var(--ds-mono) !important;
  color: var(--ds-signal) !important;
}

/* Dark Translucent Status Badges & Pills (Zero bright white blobs!) */
.ops-status, .team-status, .doc-status, .ap-status, .score-chip,
.q-decision, .q-complete, .q-judge, .user-role, .user-state,
.staff-perm, .staff-state, .ra-role, .ra-state, .ra-stage-status,
.pm-chip, .c-pill, .launch-pill, .status-chip, #permBadges span {
  background: rgba(148, 163, 184, 0.12) !important;
  color: #CBD5E1 !important;
  border: 1px solid rgba(148, 163, 184, 0.24) !important;
}
.ops-status.green, .team-status.QUALIFIED, .doc-status.final,
.ap-status.ACCEPTED, .score-chip.locked, .q-decision.qualified,
.q-decision.ready, .q-complete.yes, .q-judge.ok, .user-state.on,
.staff-state.on, .ra-state:not(.off), .ra-stage-status.open,
.pm-chip.live, .c-pill.on, .launch-pill.checked, .admin-system-state {
  background: rgba(16, 185, 129, 0.14) !important;
  color: #34D399 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}
.ops-status.orange, .team-status.SUBMITTED, .doc-status.queue,
.ap-status.PENDING, .score-chip.open, .q-decision.submitted,
.q-complete.no, .user-password, .pm-chip.draft, .launch-pill.called {
  background: rgba(245, 158, 11, 0.14) !important;
  color: #FBBF24 !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
}
.ops-status.red, .team-status.DISQUALIFIED, .ap-status.REJECTED,
.q-decision.disqualified, .c-pill.off, .launch-pill.late {
  background: rgba(244, 63, 94, 0.14) !important;
  color: #FDA4AF !important;
  border: 1px solid rgba(244, 63, 94, 0.3) !important;
}
.doc-status.active, .ap-status.UNDER_REVIEW, .launch-pill.done {
  background: rgba(37, 99, 235, 0.16) !important;
  color: #93C5FD !important;
  border: 1px solid rgba(37, 99, 235, 0.34) !important;
}

/* Tables */
.admin-table-wrap, .team-table-wrap, .user-table-wrap, .doc-table-wrap,
.ap-table-wrap, .score-table-wrap, .q-table-wrap, .ops-table-wrap,
.c-table-wrap, .pm-table-wrap, .staff-table-wrap, .ra-table-wrap, .audit-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  border-color: var(--ds-border) !important;
}
th {
  background: #0D1118 !important;
  color: var(--ds-muted) !important;
  border-bottom: 1px solid var(--ds-border) !important;
}
td {
  border-color: var(--ds-border) !important;
  color: var(--ds-text-2) !important;
}
td strong { color: #FFFFFF !important; }
tbody tr:hover { background: rgba(255, 255, 255, 0.025) !important; }

/* Inputs, Selects, Textareas */
.admin-main input:not([type="checkbox"]):not([type="radio"]),
.admin-main select,
.admin-main textarea,
.ops-wrap input:not([type="checkbox"]):not([type="radio"]),
.ops-wrap select,
.ops-wrap textarea,
.ra-modal input, .ra-modal select, .ra-modal textarea,
.q-manual-box select, .q-manual-box textarea {
  background: var(--ds-obsidian) !important;
  border: 1px solid var(--ds-border) !important;
  color: #FFFFFF !important;
  border-radius: 10px !important;
}
.admin-main input:focus, .admin-main select:focus, .admin-main textarea:focus,
.ops-wrap input:focus, .ops-wrap select:focus, .ops-wrap textarea:focus {
  border-color: var(--ds-signal) !important;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.16) !important;
}

/* Tactile Dark Swiss Buttons */
.admin-refresh, .team-btn, .user-btn, .doc-btn, .s-btn, .q-btn,
.ops-btn, .c-btn, .pm-btn, .staff-btn, .ra-btn, .ghost-action,
.team-action, .user-action, .doc-action, .ap-open, .score-row-btn,
.q-row-btn, .staff-action, .ra-row-btn, .team-pager button,
.user-pager button, .doc-pager button, .q-pager button, .audit-pages button,
.ops-top-btn, .ops-quick-chip, .l-btn {
  background: var(--ds-obsidian) !important;
  border: 1px solid var(--ds-border) !important;
  color: var(--ds-text-2) !important;
  border-radius: 9px !important;
  font-weight: 600 !important;
  transition: all 0.15s ease !important;
}
.admin-refresh:hover, .team-btn:hover, .user-btn:hover, .doc-btn:hover,
.s-btn:hover, .q-btn:hover, .ops-btn:hover, .c-btn:hover, .pm-btn:hover,
.staff-btn:hover, .ra-btn:hover, .ops-top-btn:hover, .l-btn:hover {
  border-color: var(--ds-border-hover) !important;
  color: #fff !important;
}
.primary, .accent, .orange, .ap-submit, .save-config button,
.q-manual-box button, .ops-submit, .ops-submit-btn, .ops-top-btn.danger,
#closeDocsBtn, .ops-tab.active {
  background: var(--ds-signal) !important;
  border-color: var(--ds-signal) !important;
  color: #FFFFFF !important;
}
.primary:hover, .accent:hover, .orange:hover, .ap-submit:hover,
.ops-submit:hover, .ops-submit-btn:hover, #closeDocsBtn:hover {
  background: var(--ds-signal-hover) !important;
}
.ops-tab {
  background: var(--ds-obsidian) !important;
  border: 1px solid var(--ds-border) !important;
  color: var(--ds-muted) !important;
}
.l-btn.call { border-color: rgba(245, 158, 11, 0.4) !important; color: #FBBF24 !important; }
.l-btn.checkin { border-color: rgba(16, 185, 129, 0.4) !important; color: #34D399 !important; }
.l-btn.done { border-color: rgba(37, 99, 235, 0.4) !important; color: #93C5FD !important; }
.l-btn.late { border-color: rgba(244, 63, 94, 0.4) !important; color: #FDA4AF !important; }

/* Inner Boxes, Drawers & Modals */
.admin-list-item, .audit-item, .ops-list-item, .pm-item, .pm-file,
.drawer-field, .user-field, .doc-field, .q-field, .ap-meta, .ap-box,
.drawer-list-item, .user-detail-line, .doc-list-item, .q-judge-row,
.ra-stage-box, .ra-stage-option, .staff-check, .ops-score-item,
.ops-doc-card, .ops-check-label, .launch-card, .pen-box, .pen-kv,
.judge-weight-badge, #attGateBox, #adminAttGateBox, #teamPenaltiesBox {
  background: rgba(9, 11, 15, 0.72) !important;
  border-color: var(--ds-border) !important;
  color: var(--ds-text-2) !important;
}
.drawer-note, .user-note, .doc-note, .q-note, .q-note-drawer,
.config-note, .ops-note, .pm-note, .staff-note, .ra-note, .audit-json, .ops-empty {
  background: rgba(9, 11, 15, 0.6) !important;
  border-color: var(--ds-border) !important;
  color: var(--ds-muted) !important;
}
.team-drawer-panel, .user-drawer-panel, .doc-drawer-panel,
.q-panel, .ra-modal, .pen-modal {
  background: var(--ds-obsidian) !important;
  border-right: 1px solid var(--ds-border) !important;
  color: var(--ds-text) !important;
}
.team-drawer-head, .user-drawer-head, .doc-drawer-head,
.q-drawer-head, .ra-modal-head, .pen-modal-head {
  background: var(--ds-slate) !important;
  border-bottom: 1px solid var(--ds-border) !important;
}
.drawer-close, .user-drawer-close, .doc-drawer-close,
.q-close, .ra-close, .pen-modal-close {
  background: var(--ds-obsidian) !important;
  border: 1px solid var(--ds-border) !important;
  color: #fff !important;
}

/* ==========================================================================
   5. Mobile Layout Fixes (<= 1023px)
   ========================================================================== */
.ds-mob-nav,
.ds-sheet-backdrop {
  display: none;
}

@media (max-width: 1023px) {
  .ds-nav,
  .ds-search-box,
  .ds-util-hide-mob,
  .ds-ops-text-desk {
    display: none !important;
  }
  .ds-mob-search-btn {
    display: inline-flex !important;
  }
  .ds-ops-text-mob {
    display: inline !important;
  }
  .ds-util-strip {
    padding: 5px 14px;
    font-size: 10px;
  }
  .ds-header-inner {
    height: 56px;
    padding: 0 12px;
  }
  .ds-ops-btn {
    height: 36px;
    padding: 0 11px;
    font-size: 11.5px;
  }
  .admin-main {
    padding: 16px 12px 92px !important;
  }

  /* Fix stacked card headers on mobile (e.g. Technical Inspection Ledger!) */
  .ops-card-head,
  .score-card-head,
  .team-table-head,
  .doc-table-head,
  .user-table-head,
  .q-table-head,
  .ap-head,
  .audit-table-head,
  .pm-card-head {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }
  #inspectionTableSearch {
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Mobile Bottom Tab Bar */
  .ds-mob-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(64px + env(safe-area-inset-bottom));
    padding: 0 6px env(safe-area-inset-bottom);
    background: rgba(18, 22, 31, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--ds-border);
    z-index: 85;
  }
  .ds-mob-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 64px;
    color: var(--ds-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    background: transparent;
    border: 0;
    font-family: inherit;
    cursor: pointer;
  }
  .ds-mob-tab.active {
    color: var(--ds-signal);
    font-weight: 700;
  }

  /* Mobile Bottom Sheet Drawer */
  .ds-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 95;
    flex-direction: column;
    justify-content: flex-end;
  }
  .ds-sheet-backdrop.open { display: flex; }
  .ds-sheet {
    background: var(--ds-slate);
    border-top: 1px solid var(--ds-border);
    border-radius: 20px 20px 0 0;
    padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 82dvh;
    overflow-y: auto;
  }
  .ds-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ds-border);
    font-size: 13px;
    font-weight: 700;
    color: #fff;
  }
  .ds-sheet-close {
    background: transparent;
    border: 0;
    color: var(--ds-muted);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
  }
  .ds-sheet-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .ds-sheet-tile {
    padding: 13px 8px;
    border-radius: 12px;
    background: var(--ds-obsidian);
    border: 1px solid var(--ds-border);
    color: var(--ds-text-2);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    text-align: center;
  }
  .ds-sheet-tile.active {
    border-color: var(--ds-signal);
    color: #fff;
  }
  .ds-sheet-logout {
    width: 100%;
    padding: 11px;
    border-radius: 11px;
    background: rgba(244, 63, 94, 0.14);
    border: 1px solid rgba(244, 63, 94, 0.35);
    color: #FDA4AF;
    font: 700 12px inherit;
    cursor: pointer;
  }
}


/* ==========================================================================
   6. v5.2 Polish: Results Table Contrast, Audit/Appeals Viewer Text,
      and Richer Cobalt (#2563EB) & Amber (#F59E0B) Accents
   ========================================================================== */

/* Fix Audit & Appeals Authorized Viewer dark-navy text */
.audit-viewer strong,
.ap-viewer strong,
#viewerSummary,
.admin-main strong {
  color: #F8FAFC !important;
}

/* Fix Final Results Table white-on-white cells (Flight Score & Total Score) */
#resultsRows td:nth-child(7) {
  background: rgba(37, 99, 235, 0.14) !important;
  color: #60A5FA !important;
  border-left: 1px solid rgba(37, 99, 235, 0.28) !important;
  border-right: 1px solid rgba(37, 99, 235, 0.28) !important;
}
#resultsRows td:nth-child(9) {
  background: rgba(245, 158, 11, 0.14) !important;
  color: #FBBF24 !important;
  border-left: 1px solid rgba(245, 158, 11, 0.3) !important;
  border-right: 1px solid rgba(245, 158, 11, 0.3) !important;
  font-weight: 900 !important;
}
.score-table thead th:nth-child(7) {
  color: #60A5FA !important;
}
.score-table thead th:nth-child(9) {
  background: rgba(245, 158, 11, 0.1) !important;
  color: #FBBF24 !important;
}

/* Richer Cobalt Blue (#2563EB) & Amber Gold (#F59E0B) Accents across the UI */
body.admin-app-body,
body.admin-app-body.ops-portal-body {
  background-image:
    radial-gradient(circle at 12% 0%, rgba(37, 99, 235, 0.10), transparent 38%),
    radial-gradient(circle at 88% 4%, rgba(245, 158, 11, 0.08), transparent 34%),
    linear-gradient(rgba(31, 38, 51, 0.32) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 38, 51, 0.32) 1px, transparent 1px) !important;
  background-size: 100% 100%, 100% 100%, 36px 36px, 36px 36px !important;
}

/* Accent top hairlines on KPI cards using Cobalt & Amber */
.ds-kpi-strip > article:nth-child(1) { border-top: 2px solid #2563EB !important; }
.ds-kpi-strip > article:nth-child(2) { border-top: 2px solid #F59E0B !important; }
.ds-kpi-strip > article:nth-child(3) { border-top: 2px solid #EA580C !important; }
.ds-kpi-strip > article:nth-child(4) { border-top: 2px solid #10B981 !important; }

.team-stat:nth-child(odd),
.user-stat:nth-child(odd),
.doc-stat:nth-child(odd),
.score-kpi:nth-child(odd),
.ops-kpi:nth-child(odd),
.audit-kpi:nth-child(odd),
.ra-stat:nth-child(odd),
.staff-stat:nth-child(odd) {
  border-top: 2px solid #2563EB !important;
}
.team-stat:nth-child(even),
.user-stat:nth-child(even),
.doc-stat:nth-child(even),
.score-kpi:nth-child(even),
.ops-kpi:nth-child(even),
.audit-kpi:nth-child(even),
.ra-stat:nth-child(even),
.staff-stat:nth-child(even) {
  border-top: 2px solid #F59E0B !important;
}

/* Cobalt & Amber accents on links, badges, and interactive states */
.admin-panel-head a,
.ds-nav a.active {
  color: #60A5FA !important;
}
.ds-nav a.active {
  background: rgba(37, 99, 235, 0.14) !important;
  border: 1px solid rgba(37, 99, 235, 0.3) !important;
  color: #93C5FD !important;
}
.ds-util-phase {
  color: #FBBF24 !important;
}
.section-index, .eyebrow, .score-eyebrow, .q-eyebrow {
  color: #F59E0B !important;
}
.team-action:hover, .user-action:hover, .doc-action:hover,
.ap-open:hover, .score-row-btn:hover, .q-row-btn:hover,
.staff-action:hover, .ra-row-btn:hover {
  border-color: rgba(37, 99, 235, 0.55) !important;
  color: #93C5FD !important;
  background: rgba(37, 99, 235, 0.1) !important;
}
.audit-kpi:after {
  background: linear-gradient(90deg, #2563EB, #F59E0B) !important;
}
.score-kpi:before, .ops-kpi:before {
  display: none !important;
}


/* === AEROCUP v6.3 DARK MODE CONTRAST FIXES === */
.team-code,
.doc-team-code,
.q-code {
  width: auto !important;
  min-width: 78px !important;
  height: auto !important;
  padding: 7px 10px !important;
  border-radius: 10px !important;
  background: rgba(37, 99, 235, 0.14) !important;
  border: 1px solid rgba(59, 130, 246, 0.32) !important;
  color: #93C5FD !important;
  font: 800 10.5px Montserrat, monospace !important;
  letter-spacing: 0.03em !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
}

.user-avatar,
.staff-avatar,
.ra-avatar {
  background: rgba(37, 99, 235, 0.16) !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
  color: #93C5FD !important;
}

/* Force readable dark cells on scoring/results tables */
.score-table th,
.score-table td {
  color: #E2E8F0 !important;
}
.score-table td strong,
.score-table .score-value {
  color: #F8FAFC !important;
}
.score-table td small {
  color: #94A3B8 !important;
}
.score-col-best {
  background: rgba(37, 99, 235, 0.16) !important;
  color: #93C5FD !important;
  border-inline: 1px solid rgba(59, 130, 246, 0.25) !important;
}
.score-col-best small {
  color: #BFDBFE !important;
}
.score-col-final {
  background: rgba(234, 88, 12, 0.18) !important;
  color: #FB923C !important;
  border-inline-start: 1px solid rgba(234, 88, 12, 0.35) !important;
}
.score-col-innov-active {
  color: #FBBF24 !important;
}
.score-col-innov-revoked {
  color: #94A3B8 !important;
  text-decoration: line-through;
}

/* Dark mode badges for Student Card & BPJ status */
.ac-badge-green {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  padding: 4px 9px !important;
  border-radius: 8px !important;
  font-size: 10.5px !important;
  font-weight: 800 !important;
  background: rgba(16, 185, 129, 0.16) !important;
  border: 1px solid rgba(16, 185, 129, 0.36) !important;
  color: #34D399 !important;
  white-space: nowrap;
}
.ac-badge-amber {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  padding: 4px 9px !important;
  border-radius: 8px !important;
  font-size: 10.5px !important;
  font-weight: 800 !important;
  background: rgba(245, 158, 11, 0.16) !important;
  border: 1px solid rgba(245, 158, 11, 0.38) !important;
  color: #FBBF24 !important;
  white-space: nowrap;
}
.ac-badge-muted {
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  padding: 4px 9px !important;
  border-radius: 8px !important;
  font-size: 10.5px !important;
  font-weight: 800 !important;
  background: rgba(148, 163, 184, 0.14) !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  color: #CBD5E1 !important;
  white-space: nowrap;
}

/* Penalty inspection modal & dark boxes */
.pen-modal {
  background: #12161F !important;
  border-color: #1F2633 !important;
  color: #F8FAFC !important;
}
.pen-modal-head {
  background: #0D1117 !important;
  border-bottom: 1px solid #1F2633 !important;
}
.pen-box {
  background: #0D1117 !important;
  border-color: #1F2633 !important;
  color: #E2E8F0 !important;
}
.pen-box h4 {
  color: #F8FAFC !important;
}
.pen-kv {
  background: #151B26 !important;
  border-color: #232D3F !important;
}
.pen-kv small, .pen-kv span {
  color: #94A3B8 !important;
}
.pen-kv strong {
  color: #F8FAFC !important;
}

/* Ops portal dark surface fixes */
.ops-portal-body .ops-doc-card,
.ops-portal-body .ops-score-item,
.ops-portal-body .ops-empty,
.ops-portal-body .ops-check-label,
.ops-portal-body .launch-card {
  background: #0D1117 !important;
  border-color: #1F2633 !important;
  color: #E2E8F0 !important;
}
.ops-portal-body .ops-doc-info,
.ops-portal-body .ops-score-meta strong,
.ops-portal-body .launch-name strong,
.ops-portal-body .ops-check-label span {
  color: #F8FAFC !important;
}
.ops-portal-body .ops-quick-chip {
  background: #182030 !important;
  border-color: #2A364B !important;
  color: #E2E8F0 !important;
}
.ops-portal-body .ops-quick-chip.active,
.ops-portal-body .ops-quick-chip:hover {
  background: #EA580C !important;
  border-color: #EA580C !important;
  color: #fff !important;
}
