/* ================================================================
   DEN MOBILE — Shared Admin Theme Polish
   Layered on top of each page's existing inline styles.
   Higher specificity (body prefix) so no !important is needed.
   ================================================================ */

/* ── Page background & subtle texture ─────────────────────────── */
body {
  background:
    radial-gradient(1200px 600px at 12% -10%, #E0EAFF 0%, transparent 70%),
    radial-gradient(900px 500px at 110% 110%, #DCFCE7 0%, transparent 70%),
    linear-gradient(180deg, #F8FBFF 0%, #EFF3FB 100%);
}

/* ── Topbar ───────────────────────────────────────────────────── */
body .topbar {
  backdrop-filter: saturate(140%) blur(8px);
  background: rgba(255, 255, 255, 0.85) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

body .topbar h2 {
  letter-spacing: -0.01em;
}

/* ── Cards / panels ───────────────────────────────────────────── */
body .controls-card,
body .summary-card,
body .section-card,
body .kpi,
body .card,
body .panel {
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 24px rgba(15, 23, 42, 0.06);
  transition: box-shadow .2s ease, transform .2s ease;
}

body .kpi:hover,
body .card:hover {
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06),
    0 16px 36px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

/* ── Buttons polish ───────────────────────────────────────────── */
body .btn {
  border-radius: 12px !important;
  font-weight: 600;
  letter-spacing: .01em;
  transition: all .15s ease;
}

body .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

body .btn.primary {
  background: linear-gradient(180deg, #2563EB, #1B4FD8) !important;
  border-color: #1E40AF !important;
  box-shadow: 0 4px 10px rgba(27, 79, 216, 0.25);
}

body .btn.primary:hover {
  box-shadow: 0 8px 18px rgba(27, 79, 216, 0.35);
}

/* ── Inputs / selects ─────────────────────────────────────────── */
body .filter,
body input[type="text"],
body input[type="email"],
body input[type="password"],
body input[type="number"],
body input[type="date"],
body input[type="time"],
body input[type="search"],
body select,
body textarea {
  border-radius: 12px !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  transition: border-color .15s, box-shadow .15s;
}

body .filter:focus,
body input:focus,
body select:focus,
body textarea:focus {
  outline: none !important;
  border-color: #2563EB !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

/* ── Tables ───────────────────────────────────────────────────── */
body table {
  border-radius: 14px;
  overflow: hidden;
}

body thead th {
  background: linear-gradient(180deg, #F8FAFC, #EEF2F7) !important;
  font-weight: 700 !important;
  color: #475569 !important;
}

body tbody tr {
  transition: background-color .12s;
}

body tbody tr:hover td {
  background: #F4F8FF !important;
}

/* ── Pills / status chips ─────────────────────────────────────── */
body .pill,
body .badge {
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: .02em;
}

/* ── Alerts ───────────────────────────────────────────────────── */
body .alert {
  border-radius: 14px;
  border-width: 1px;
  border-style: solid;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

body .alert.success {
  background: linear-gradient(180deg, #ECFDF5, #DCFCE7);
  border-color: #86EFAC;
  color: #14532D;
}

body .alert.error {
  background: linear-gradient(180deg, #FEF2F2, #FEE2E2);
  border-color: #FCA5A5;
  color: #7F1D1D;
}

/* ── KPI cards ────────────────────────────────────────────────── */
body .kpi {
  background: #FFFFFF;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

body .kpi .l {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #64748B;
}

body .kpi .v {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #0F172A;
}

/* ── Section headers ──────────────────────────────────────────── */
body .section-head h3,
body h2,
body h3 {
  letter-spacing: -0.01em;
}

/* ── Login & 2FA polish ───────────────────────────────────────── */
body.login-page,
.login-shell,
.auth-shell {
  background:
    radial-gradient(900px 500px at 10% -10%, #DBEAFE 0%, transparent 70%),
    radial-gradient(700px 400px at 110% 110%, #DCFCE7 0%, transparent 70%),
    linear-gradient(180deg, #F8FBFF 0%, #EEF3FB 100%);
}

/* ── Scrollbars (webkit) ──────────────────────────────────────── */
body ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body ::-webkit-scrollbar-track {
  background: transparent;
}

body ::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.35);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

body ::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.55);
  background-clip: padding-box;
  border: 2px solid transparent;
}

/* ── Sidebar nav refinements (override sidebar.php) ───────────── */
body .nav-item.active,
body .sub-item.active {
  background: linear-gradient(90deg, rgba(59, 110, 248, 0.18), rgba(59, 110, 248, 0.05)) !important;
  color: #FFFFFF !important;
}

body .nav-item:hover,
body .sub-item:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

/* ── Mobile niceties ──────────────────────────────────────────── */
@media (max-width: 640px) {

  body .controls-card,
  body .summary-card,
  body .section-card {
    border-radius: 14px;
  }

  body .kpi {
    padding: 14px;
  }

  body .kpi .v {
    font-size: 22px;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   v20260508 — PROFESSIONAL POLISH (auto-applies to every admin page)
   ═══════════════════════════════════════════════════════════════════ */

/* ── Topbar refinement ─────────────────────────────────────────── */
body .topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 24px !important;
}

body .topbar h2 {
  font-size: 20px;
  font-weight: 800;
  color: #0F172A;
}

/* ── Card surfaces — unified ───────────────────────────────────── */
body .controls-card,
body .summary-card,
body .section-card,
body .card,
body .panel {
  background: #FFFFFF;
  border: 1px solid rgba(15, 23, 42, 0.06);
  padding: 20px;
}

body .section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

body .section-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Tables: pro polish + sticky header ────────────────────────── */
body table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}

body thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 12px 14px !important;
  font-size: 11.5px !important;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
  white-space: nowrap;
}

body tbody td {
  padding: 12px 14px !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05) !important;
  vertical-align: middle;
}

body tbody tr:nth-child(even) td {
  background: rgba(248, 250, 252, 0.55);
}

body tbody tr:hover td {
  background: #EEF4FF !important;
}

body tbody tr:last-child td {
  border-bottom: 0 !important;
}

/* Wide-table wrappers — host top scrollbar without overflowing page */
body .table-wrap,
body .scroll-x {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: #FFFFFF;
}

/* Top synced scrollbar (added by admin-enhance.js) */
body .admin-top-scroll::-webkit-scrollbar {
  height: 10px;
}

body .admin-top-scroll::-webkit-scrollbar-thumb {
  background: rgba(37, 99, 235, 0.35);
  border-radius: 999px;
}

/* ── Action button cluster (table row actions) ─────────────────── */
body .actions,
body td.actions,
body .row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

body .btn.sm,
body .btn-sm,
body .btn.small {
  padding: 6px 10px !important;
  font-size: 12px !important;
  border-radius: 9px !important;
}

/* ── Status pills (semantic) ───────────────────────────────────── */
body .pill,
body .badge,
body .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 11.5px;
  line-height: 1.4;
  white-space: nowrap;
}

body .pill.success,
body .badge.success,
body .pill.online,
body .badge.online,
body .pill.active,
body .badge.active {
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #86EFAC;
}

body .pill.danger,
body .badge.danger,
body .pill.offline,
body .badge.offline,
body .pill.error,
body .badge.error {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}

body .pill.warning,
body .badge.warning,
body .pill.pending,
body .badge.pending {
  background: #FEF3C7;
  color: #854D0E;
  border: 1px solid #FDE68A;
}

body .pill.info,
body .badge.info {
  background: #DBEAFE;
  color: #1E40AF;
  border: 1px solid #93C5FD;
}

body .pill.muted,
body .badge.muted,
body .pill.neutral {
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #E2E8F0;
}

/* ── KPI strip — reporting/monitoring focus ────────────────────── */
body .kpis,
body .kpi-grid,
body .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

body .kpi {
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

body .kpi::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.04), transparent 60%);
  pointer-events: none;
}

body .kpi .l {
  font-size: 11px !important;
  margin-bottom: 6px;
}

body .kpi .v {
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

body .kpi .delta,
body .kpi .sub {
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
  margin-top: 4px;
}

body .kpi .delta.up {
  color: #16A34A;
}

body .kpi .delta.down {
  color: #DC2626;
}

/* ── Engagement pages: card grids + filters ───────────────────── */
body .stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

body .stats-row .stat-card {
  background: #FFFFFF;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03), 0 8px 20px rgba(15, 23, 42, .05);
}

body .stats-row .stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: #64748B;
  margin-bottom: 5px;
}

body .stats-row .stat-num {
  font-size: 26px;
  font-weight: 800;
  color: #0F172A;
  line-height: 1;
}

body .filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  background: #FFFFFF;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

/* ── Filter / toolbar grids ────────────────────────────────────── */
body .toolbar,
body .toolbar-grid,
body .filters,
body .controls-card form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

body .toolbar .field,
body .filters .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}

body .toolbar label,
body .filters label,
body .field>label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #64748B;
}

/* ── Empty state ───────────────────────────────────────────────── */
body .empty-state,
body .no-data {
  text-align: center;
  padding: 48px 20px;
  color: #64748B;
}

body .empty-state .icon,
body .no-data .icon {
  font-size: 42px;
  opacity: 0.5;
  margin-bottom: 10px;
}

body .empty-state h4,
body .no-data h4 {
  font-size: 16px;
  margin: 0 0 6px;
  color: #334155;
}

/* ── Pagination ────────────────────────────────────────────────── */
body .pagination,
body .pager {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

body .pagination a,
body .pagination span,
body .pager a,
body .pager span {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #FFFFFF;
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: #475569;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: all .15s;
}

body .pagination a:hover,
body .pager a:hover {
  border-color: #2563EB;
  color: #2563EB;
}

body .pagination .active,
body .pagination .current,
body .pager .active {
  background: linear-gradient(180deg, #2563EB, #1B4FD8);
  border-color: #1B4FD8;
  color: #FFFFFF;
}

/* ── Tabs / segmented controls ─────────────────────────────────── */
body .tabs,
body .segmented {
  display: inline-flex;
  background: #F1F5F9;
  border-radius: 12px;
  padding: 4px;
  gap: 2px;
}

body .tabs a,
body .tabs button,
body .segmented a,
body .segmented button {
  padding: 7px 14px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
}

body .tabs a.active,
body .tabs button.active,
body .segmented a.active,
body .segmented button.active {
  background: #FFFFFF;
  color: #0F172A;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* ── Forms (registration, settings, modals) ────────────────────── */
body form .row,
body form .form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

body label.field-label,
body .field>label,
body form>label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 5px;
  display: inline-block;
}

/* ── Loading / skeleton ────────────────────────────────────────── */
body .skeleton {
  background: linear-gradient(90deg, #F1F5F9 0%, #E2E8F0 50%, #F1F5F9 100%);
  background-size: 200% 100%;
  animation: skel 1.4s infinite;
  border-radius: 8px;
}

@keyframes skel {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ── Spinner ───────────────────────────────────────────────────── */
body .spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(37, 99, 235, 0.18);
  border-top-color: #2563EB;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Leaderboard — podium polish ───────────────────────────────── */
body .leaderboard tr:nth-child(1) td:first-child::before {
  content: "🥇 ";
}

body .leaderboard tr:nth-child(2) td:first-child::before {
  content: "🥈 ";
}

body .leaderboard tr:nth-child(3) td:first-child::before {
  content: "🥉 ";
}

body .leaderboard tr:nth-child(1) td {
  background: linear-gradient(90deg, #FFFBEB, transparent) !important;
  font-weight: 700;
}

body .leaderboard tr:nth-child(2) td {
  background: linear-gradient(90deg, #F8FAFC, transparent) !important;
  font-weight: 600;
}

body .leaderboard tr:nth-child(3) td {
  background: linear-gradient(90deg, #FEF3C7, transparent) !important;
  font-weight: 600;
}

/* ── Activity timeline ─────────────────────────────────────────── */
body .activity-row,
body .timeline-row {
  position: relative;
  padding-left: 20px;
}

body .activity-row::before,
body .timeline-row::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 18px;
  bottom: -1px;
  width: 2px;
  background: rgba(37, 99, 235, 0.15);
}

body .activity-row::after,
body .timeline-row::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

/* ── Page section spacing ──────────────────────────────────────── */
body .main {
  padding: 22px 24px !important;
}

body .main>*+* {
  margin-top: 16px;
}

/* ── Reduce motion respect ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

  body *,
  body *::before,
  body *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Print styles ──────────────────────────────────────────────── */
@media print {

  body .sidebar,
  body .topbar,
  body .controls-card form,
  body .actions,
  body .pagination,
  body .pager,
  body .row-actions {
    display: none !important;
  }

  body .main {
    padding: 0 !important;
  }

  body .section-card,
  body .card {
    box-shadow: none !important;
    border: 1px solid #E2E8F0 !important;
    page-break-inside: avoid;
  }
}

/* ── Focus-visible accessibility ───────────────────────────────── */
body *:focus-visible {
  outline: 2px solid #2563EB !important;
  outline-offset: 2px;
}

/* ================================================================
   UI/UX ENHANCEMENT LAYER (2026 refresh)
   Card-based hierarchy, status badges, live indicators, sticky
   tables. All additive + body-prefixed — never breaks page styles.
   ================================================================ */

/* ── Refined stat / KPI cards ─────────────────────────────────── */
body .stat-card {
  position: relative;
  border-radius: 16px !important;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

body .stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 16px 0 0 16px;
  background: linear-gradient(180deg, #2563EB, #1B4FD8);
  opacity: .9;
}

body .stat-card.green::before {
  background: linear-gradient(180deg, #22C55E, #16A34A);
}

body .stat-card.cyan::before {
  background: linear-gradient(180deg, #06B6D4, #0891B2);
}

body .stat-card.yellow::before {
  background: linear-gradient(180deg, #F59E0B, #D97706);
}

body .stat-card.red::before {
  background: linear-gradient(180deg, #EF4444, #DC2626);
}

body .stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(15, 23, 42, .06), 0 18px 40px rgba(15, 23, 42, .10) !important;
}

/* ── Universal status badges ──────────────────────────────────── */
body .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1.6;
  border: 1px solid transparent;
}

body .status-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

body .status-badge.is-online {
  color: #15803D;
  background: #DCFCE7;
  border-color: #BBF7D0;
}

body .status-badge.is-offline {
  color: #64748B;
  background: #F1F5F9;
  border-color: #E2E8F0;
}

body .status-badge.is-busy {
  color: #B45309;
  background: #FEF3C7;
  border-color: #FDE68A;
}

body .status-badge.is-error {
  color: #B91C1C;
  background: #FEE2E2;
  border-color: #FECACA;
}

/* ================================================================
   CORTEXUI SKIN (2026-05-31)
   Global visual overhaul for admin pages.
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Space+Grotesk:wght@600;700&display=swap');

body {
  font-family: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', sans-serif !important;
  color: #E6ECF7;
}

body h1,
body h2,
body h3,
body .section-head h3,
body .topbar-title h2 {
  font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif !important;
  letter-spacing: -0.02em !important;
}

body .topbar {
  background: linear-gradient(135deg, #0f1e3a 0%, #1a2f58 55%, #1f3b72 100%) !important;
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
}

body .topbar h2,
body .topbar p,
body .topbar a,
body .topbar .btn-sm,
body .topbar .notif-btn {
  color: #e2ecff !important;
}

body .topbar .notif-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

body .sidebar {
  background: linear-gradient(180deg, #0a1020 0%, #111a31 48%, #0a1020 100%) !important;
  border-right: 1px solid rgba(148, 163, 184, 0.16) !important;
  box-shadow: 18px 0 40px rgba(2, 6, 23, 0.5) !important;
}

body .nav-item.active,
body .sub-item.active {
  background: linear-gradient(120deg, rgba(56, 189, 248, 0.24), rgba(59, 130, 246, 0.22)) !important;
  border: 1px solid rgba(125, 211, 252, 0.36) !important;
  box-shadow: 0 8px 22px rgba(14, 116, 144, 0.2);
}

body .nav-item:hover,
body .sub-item:hover {
  background: rgba(148, 163, 184, 0.14) !important;
}

body .controls-card,
body .summary-card,
body .section-card,
body .card,
body .panel,
body .stat-card,
body .kpi {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.035)) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-radius: 18px !important;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.18),
    0 18px 40px rgba(0, 0, 0, 0.28) !important;
  backdrop-filter: blur(16px) saturate(150%);
}

body .section-card:hover,
body .card:hover,
body .kpi:hover,
body .stat-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 2px 4px rgba(15, 23, 42, 0.08),
    0 22px 44px rgba(30, 41, 59, 0.18) !important;
}

body .btn,
body .btn-sm,
body button,
body .toggle-btn {
  border-radius: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
}

body .btn.primary,
body .btn-sm.primary,
body button.primary {
  color: #eaf6ff !important;
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 52%, #3730a3 100%) !important;
  border: 1px solid rgba(14, 165, 233, 0.42) !important;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.3);
}

body .btn.primary:hover,
body .btn-sm.primary:hover,
body button.primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

body input,
body select,
body textarea,
body .filter,
body .company-filter {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #F2F6FF !important;
  border-radius: 12px !important;
}

body input:focus,
body select:focus,
body textarea:focus,
body .filter:focus,
body .company-filter:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
}

body table {
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 14px;
  overflow: hidden;
}

body thead th {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #AAB7CE !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body tbody td {
  color: #E6ECF7 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

body tbody tr:hover td {
  background: rgba(255, 255, 255, 0.05) !important;
}

body .state-pill,
body .pill,
body .badge,
body .status-pill,
body .status-badge {
  border-radius: 999px !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em;
}

body .live-refresh,
body .live-muted,
body .stat-label,
body .section-head .live-muted {
  color: #64748b !important;
}

body .stat-num,
body .kpi .v {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
  body .topbar {
    border-radius: 14px;
  }

  body .controls-card,
  body .summary-card,
  body .section-card,
  body .card,
  body .panel,
  body .stat-card,
  body .kpi {
    border-radius: 14px !important;
  }
}

body .status-badge.is-info {
  color: #1D4ED8;
  background: #DBEAFE;
  border-color: #BFDBFE;
}

/* ── Live pulse dot (real-time indicators) ────────────────────── */
body .live-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22C55E;
  position: relative;
  vertical-align: middle;
}

body .live-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(34, 197, 94, .45);
  animation: dm-pulse 1.6s ease-out infinite;
}

@keyframes dm-pulse {
  0% {
    transform: scale(.6);
    opacity: 1;
  }

  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body .live-dot::after {
    animation: none;
  }
}

/* ================================================================
   CORTEXUI DARK UNIFY (2026-05-31b)
   Single authoritative dark-glass skin applied to EVERY admin page.
   Forces readable light text + dark translucent surfaces so no page
   ends up with light-on-light or dark-on-dark invisibility.
   ================================================================ */

/* ── Base surface + text ──────────────────────────────────────── */
body {
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(0, 229, 195, 0.12) 0%, rgba(0, 229, 195, 0) 58%),
    radial-gradient(820px 460px at 104% -8%, rgba(124, 77, 255, 0.16) 0%, rgba(124, 77, 255, 0) 54%),
    radial-gradient(900px 760px at 50% 116%, rgba(36, 211, 255, 0.08) 0%, rgba(36, 211, 255, 0) 55%),
    linear-gradient(180deg, #060812 0%, #090D17 55%, #05070D 100%) !important;
  color: #E6ECF7 !important;
}

body .main,
body .content,
body .page,
body .page-content {
  color: #E6ECF7;
}

/* Headings + key text always light */
body h1,
body h2,
body h3,
body h4,
body h5,
body .section-head h3,
body .section-title,
body .card-head,
body .page-title,
body .controls-copy h3,
body .summary-copy h4 {
  color: #F4F7FF !important;
}

body p,
body label,
body span,
body div,
body td,
body li,
body small {
  color: inherit;
}

/* Muted helper text */
body .muted,
body .text-muted,
body .sub,
body .subtitle,
body .live-muted,
body .live-refresh,
body .stat-label,
body .hint,
body .help,
body small.muted {
  color: #9AA6BC !important;
}

/* Links inside content */
body .content a:not(.btn):not(.btn-sm):not(.nav-item):not(.sub-item):not(.footer-link),
body .main a:not(.btn):not(.btn-sm):not(.nav-item):not(.sub-item):not(.footer-link) {
  color: #6FE9DA;
}

/* ── Topbar ───────────────────────────────────────────────────── */
body .topbar {
  background: rgba(8, 12, 24, 0.68) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3) !important;
  backdrop-filter: blur(16px) saturate(150%);
}

body .topbar h2,
body .topbar .topbar-title h2 {
  color: #F5F7FF !important;
}

body .topbar p,
body .topbar .topbar-title p {
  color: #9FB0D1 !important;
}

/* ── Cards / panels / sections (dark glass) ───────────────────── */
body .controls-card,
body .summary-card,
body .section-card,
body .card,
body .panel,
body .stat-card,
body .kpi,
body .box,
body .widget,
body .tile,
body .surface {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.035)) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-radius: 18px !important;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.18), 0 18px 40px rgba(0, 0, 0, 0.28) !important;
  backdrop-filter: blur(16px) saturate(150%);
  color: #E6ECF7 !important;
}

body .section-card:hover,
body .card:hover,
body .kpi:hover,
body .stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 24px 46px rgba(0, 0, 0, 0.32) !important;
}

body .section-head,
body .card-head,
body .panel-head {
  background: rgba(255, 255, 255, 0.025) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* ── Tables ───────────────────────────────────────────────────── */
body thead th {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #AAB7CE !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body tbody td {
  color: #E6ECF7 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

body tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02) !important;
}

body tbody tr:hover td {
  background: rgba(255, 255, 255, 0.05) !important;
}

body .table-wrap,
body .scroll-x,
body .live-table-wrap {
  background: transparent !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* ── Inputs / selects / textareas ─────────────────────────────── */
body input,
body select,
body textarea,
body .filter,
body .company-filter {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #F2F6FF !important;
  border-radius: 12px !important;
  backdrop-filter: blur(10px);
}

body input::placeholder,
body textarea::placeholder {
  color: rgba(214, 222, 238, 0.45) !important;
}

body select option {
  background: #0B1020;
  color: #F2F6FF;
}

body input:focus,
body select:focus,
body textarea:focus,
body .filter:focus,
body .company-filter:focus {
  border-color: rgba(0, 229, 195, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(0, 229, 195, 0.18) !important;
}

/* ── Buttons ──────────────────────────────────────────────────── */
body .btn,
body .btn-sm,
body button {
  border-radius: 12px !important;
  font-weight: 700 !important;
}

body .btn.primary,
body .btn-sm.primary,
body button.primary {
  background: linear-gradient(135deg, #00E5C3 0%, #24D3FF 55%, #7C4DFF 100%) !important;
  border: 1px solid rgba(0, 229, 195, 0.4) !important;
  color: #041019 !important;
  box-shadow: 0 12px 26px rgba(0, 229, 195, 0.2) !important;
}

body .btn.ghost,
body .btn-sm.ghost,
body .btn.secondary,
body .btn-sm.secondary {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #E7EEFF !important;
}

body .btn.ghost:hover,
body .btn-sm.ghost:hover {
  border-color: rgba(0, 229, 195, 0.32) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}

/* ── Pills / badges keep readable on dark ─────────────────────── */
body .pill,
body .badge,
body .status-pill,
body .state-pill,
body .badge-status {
  border-radius: 999px !important;
  font-weight: 800 !important;
}

/* ── Modal / dropdown surfaces ────────────────────────────────── */
body .modal,
body .modal-content,
body .dropdown,
body .menu-dropdown,
body .popover,
body .notif-dropdown {
  background: rgba(10, 14, 26, 0.94) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #E6ECF7 !important;
  backdrop-filter: blur(18px) saturate(150%);
}

/* ── Alerts ───────────────────────────────────────────────────── */
body .alert.success {
  background: rgba(52, 211, 153, 0.12) !important;
  border-color: rgba(52, 211, 153, 0.24) !important;
  color: #BAF7D2 !important;
}

body .alert.error,
body .alert.danger {
  background: rgba(251, 113, 133, 0.12) !important;
  border-color: rgba(251, 113, 133, 0.24) !important;
  color: #FECDD3 !important;
}

body .alert.info {
  background: rgba(36, 211, 255, 0.12) !important;
  border-color: rgba(36, 211, 255, 0.24) !important;
  color: #BFEFFF !important;
}

/* ── Empty states ─────────────────────────────────────────────── */
body .empty-state,
body .no-data {
  color: #9AA6BC !important;
}

/* ── Scrollbars on dark ───────────────────────────────────────── */
body ::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
}

body ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 229, 195, 0.4);
}

/* ── Sticky table headers + zebra striping ────────────────────── */
body .table-wrap,
body .section-card {
  scroll-margin-top: 80px;
}

body thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

body tbody tr:nth-child(even) td {
  background: rgba(248, 250, 252, .6);
}

body tbody tr:nth-child(even):hover td {
  background: #F4F8FF !important;
}

/* ── Card section headers ─────────────────────────────────────── */
body .card-head,
body .section-card>h2:first-child,
body .section-card>h3:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}

/* ── Empty states ─────────────────────────────────────────────── */
body .empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #94A3B8;
}

body .empty-state .empty-icon {
  font-size: 40px;
  opacity: .7;
  margin-bottom: 10px;
}

/* ── Responsive card grids (mobile admin) ─────────────────────── */
@media (max-width: 768px) {

  body .stats-row,
  body .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
    gap: 10px !important;
  }

  body .stat-card {
    padding: 16px !important;
  }

  body .stats-row .stat-num {
    font-size: 22px;
  }

  body table {
    font-size: 13px;
  }
}

@media (max-width: 480px) {

  body .stats-row,
  body .stat-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* ================================================================
   LIGHT OPERATIONS SYSTEM (2026-06-12)
   Final authority for the web admin. This intentionally overrides
   legacy page-level dark/glass skins while preserving page structure.
   ================================================================ */
:root {
  --ops-bg: #F3F6FA;
  --ops-surface: #FFFFFF;
  --ops-surface-subtle: #F8FAFC;
  --ops-surface-hover: #EEF4FF;
  --ops-text: #172033;
  --ops-text-soft: #536178;
  --ops-muted: #738197;
  --ops-border: #DCE3ED;
  --ops-border-strong: #C8D2E1;
  --ops-primary: #155EEF;
  --ops-primary-hover: #0B4FD8;
  --ops-primary-soft: #EAF1FF;
  --ops-success: #147D4F;
  --ops-success-soft: #E7F7EF;
  --ops-warning: #9A5B08;
  --ops-warning-soft: #FFF4D8;
  --ops-danger: #B42318;
  --ops-danger-soft: #FDECEA;
  --ops-info: #036B8E;
  --ops-info-soft: #E5F6FB;
  --ops-sidebar: #101827;
  --ops-sidebar-soft: #182235;
  --ops-sidebar-text: #CFD8E7;
  --ops-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .07);
  --ops-shadow-raised: 0 12px 32px rgba(16, 24, 40, .12);
  --ops-radius: 14px;
}

html {
  background: var(--ops-bg);
}

body,
body.mod-main,
body.mod-ops,
body.mod-crm,
body.mod-team,
body.mod-mgmt,
body.mod-analytics,
body.mod-system {
  background: var(--ops-bg) !important;
  color: var(--ops-text) !important;
  font-family: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', sans-serif !important;
  line-height: 1.45;
}

body .main,
body .main-content,
body .content,
body .page,
body .page-content,
body .page-body {
  color: var(--ops-text) !important;
  min-width: 0;
}

body .content,
body .page-body {
  width: 100%;
  max-width: 1680px;
  margin-inline: auto;
}

body h1,
body h2,
body h3,
body h4,
body h5,
body .page-title,
body .section-title,
body .card-head,
body .section-head h3,
body .controls-copy h3,
body .summary-copy h4 {
  color: var(--ops-text) !important;
  font-family: 'Space Grotesk', 'Plus Jakarta Sans', sans-serif !important;
  text-wrap: balance;
}

body p,
body .text-pretty {
  text-wrap: pretty;
}

body .muted,
body .text-muted,
body .sub,
body .subtitle,
body .live-muted,
body .live-refresh,
body .stat-label,
body .hint,
body .help,
body small.muted,
body .topbar-subtitle {
  color: var(--ops-muted) !important;
}

/* Shell */
body .sidebar {
  background: var(--ops-sidebar) !important;
  border-right: 1px solid #27334A !important;
  box-shadow: 8px 0 24px rgba(16, 24, 40, .12) !important;
}

body .sidebar::before {
  display: none;
}

body .sidebar-logo,
body .sidebar-footer {
  background: var(--ops-sidebar) !important;
  backdrop-filter: none !important;
}

body .sidebar-logo {
  min-height: 74px;
  padding: 12px 14px !important;
}

body .sidebar-logo img {
  height: 46px !important;
}

body .sidebar-nav {
  box-shadow: none !important;
}

body .nav-section-label {
  color: #8391A8 !important;
}

body .section-chip {
  background: #202C41 !important;
  border-color: #34435C !important;
  box-shadow: none !important;
}

body .nav-item,
body .nav-group-btn,
body .sub-item {
  color: var(--ops-sidebar-text) !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

body .nav-item .icon,
body .nav-group-btn .icon,
body .sub-item .sub-icon {
  background: #202C41 !important;
  border-color: #34435C !important;
  box-shadow: none !important;
}

body .nav-item:hover,
body .nav-group-btn:hover,
body .sub-item:hover {
  color: #FFFFFF !important;
  background: #202C41 !important;
  border-color: #34435C !important;
  transform: none !important;
}

body .nav-item.active,
body .sub-item.active,
body .nav-group.open .nav-group-btn {
  color: #FFFFFF !important;
  background: #20345D !important;
  border-color: #315590 !important;
  box-shadow: none !important;
}

body .nav-item.active::before {
  background: #63A4FF !important;
}

body .nav-active-indicator {
  display: none !important;
}

body .nav-item-star:not(.active) {
  background: transparent !important;
  border-color: transparent !important;
}

body .nav-item-star .nav-star {
  animation: none !important;
  opacity: .7;
}

body .sidebar-user,
body .footer-link {
  background: var(--ops-sidebar-soft) !important;
  border-color: #2B3951 !important;
  box-shadow: none !important;
}

body .user-avatar {
  background: #245FC7 !important;
  box-shadow: none !important;
}

body .topbar {
  min-height: 68px;
  height: auto !important;
  padding: 12px 28px !important;
  background: rgba(255, 255, 255, .96) !important;
  color: var(--ops-text) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--ops-border) !important;
  border-radius: 0 !important;
  box-shadow: 0 1px 0 rgba(16, 24, 40, .02) !important;
  backdrop-filter: none !important;
}

body .topbar::after {
  display: none !important;
}

body .topbar h2,
body .topbar .topbar-title h2,
body .topbar .page-title {
  color: var(--ops-text) !important;
  text-shadow: none !important;
  font-size: 19px !important;
}

body .topbar p,
body .topbar .topbar-title p {
  color: var(--ops-muted) !important;
}

body .ops-breadcrumb {
  margin-bottom: 2px;
  color: var(--ops-muted) !important;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

body .topbar-actions {
  gap: 10px !important;
}

/* Surfaces */
body .controls-card,
body .summary-card,
body .section-card,
body .card,
body .panel,
body .stat-card,
body .kpi,
body .box,
body .widget,
body .tile,
body .surface {
  color: var(--ops-text) !important;
  background: var(--ops-surface) !important;
  border: 1px solid var(--ops-border) !important;
  border-radius: var(--ops-radius) !important;
  box-shadow: var(--ops-shadow) !important;
  backdrop-filter: none !important;
}

body .section-card:hover,
body .card:hover,
body .kpi:hover,
body .stat-card:hover {
  transform: none !important;
  border-color: var(--ops-border-strong) !important;
  box-shadow: var(--ops-shadow) !important;
}

body .section-head,
body .card-head,
body .panel-head {
  min-height: 58px;
  padding: 14px 18px !important;
  margin: 0 !important;
  background: var(--ops-surface) !important;
  border-bottom: 1px solid var(--ops-border) !important;
}

body .section-head h3 {
  font-size: 15px !important;
}

body .section-head p {
  color: var(--ops-muted) !important;
}

body .stats-grid,
body .stats-row,
body .kpis,
body .kpi-grid {
  gap: 12px !important;
}

body .stat-card,
body .kpi {
  padding: 17px 18px !important;
}

body .stat-card::after,
body .kpi::before {
  display: none !important;
}

body .stat-num,
body .kpi .v,
body [data-num],
body td,
body .metric-chip strong {
  color: var(--ops-text) !important;
  font-variant-numeric: tabular-nums;
}

body .stat-num {
  font-size: clamp(28px, 3vw, 38px) !important;
}

body .stat-change {
  color: var(--ops-muted) !important;
}

/* Forms and actions */
body input,
body select,
body textarea,
body .filter,
body .company-filter {
  min-height: 40px;
  color: var(--ops-text) !important;
  background: var(--ops-surface) !important;
  border: 1px solid var(--ops-border-strong) !important;
  border-radius: 9px !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

body select option {
  color: var(--ops-text);
  background: #FFFFFF;
}

body input::placeholder,
body textarea::placeholder {
  color: #8A96A8 !important;
}

body input:focus,
body select:focus,
body textarea:focus,
body .filter:focus,
body .company-filter:focus {
  outline: 0 !important;
  border-color: var(--ops-primary) !important;
  box-shadow: 0 0 0 3px rgba(21, 94, 239, .14) !important;
}

body .btn,
body .btn-sm,
body button,
body .toggle-btn,
body .view-toggle,
body .fp,
body .lm-bf {
  min-height: 38px;
  border-radius: 9px !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease !important;
}

body .btn:hover,
body .btn-sm:hover,
body button:hover {
  transform: none !important;
}

body .btn.primary,
body .btn-sm.primary,
body button.primary {
  color: #FFFFFF !important;
  background: var(--ops-primary) !important;
  border: 1px solid var(--ops-primary) !important;
}

body .btn.primary:hover,
body .btn-sm.primary:hover,
body button.primary:hover {
  color: #FFFFFF !important;
  background: var(--ops-primary-hover) !important;
  filter: none !important;
}

body .btn.ghost,
body .btn-sm.ghost,
body .btn.secondary,
body .btn-sm.secondary,
body .view-toggle {
  color: var(--ops-text-soft) !important;
  background: var(--ops-surface) !important;
  border: 1px solid var(--ops-border-strong) !important;
}

body .btn.ghost:hover,
body .btn-sm.ghost:hover,
body .view-toggle:hover {
  color: var(--ops-primary) !important;
  background: var(--ops-primary-soft) !important;
  border-color: #9DBBF3 !important;
}

body :is(a, button, input, select, textarea):focus-visible {
  outline: 3px solid rgba(21, 94, 239, .3) !important;
  outline-offset: 2px !important;
}

body button:disabled,
body .btn:disabled {
  cursor: not-allowed;
  opacity: .55;
}

/* Tables */
body .table-wrap,
body .table-scroll,
body .scroll-x,
body .live-table-wrap {
  max-width: 100%;
  background: var(--ops-surface) !important;
  border: 1px solid var(--ops-border) !important;
  border-radius: 12px !important;
}

body .admin-top-scroll {
  height: 12px;
  margin-bottom: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  background: #E8EDF4;
  border-radius: 8px;
}

body .admin-top-scroll-inner {
  height: 1px;
}

body table {
  color: var(--ops-text) !important;
  background: var(--ops-surface) !important;
  border-radius: 0 !important;
}

body thead th {
  top: 0;
  z-index: 4;
  color: #526078 !important;
  background: #EEF2F7 !important;
  border-bottom: 1px solid var(--ops-border-strong) !important;
}

body tbody td {
  color: var(--ops-text) !important;
  background: var(--ops-surface) !important;
  border-bottom: 1px solid #E8EDF4 !important;
}

body tbody tr:nth-child(even) td {
  background: var(--ops-surface-subtle) !important;
}

body tbody tr:hover td,
body tbody tr:nth-child(even):hover td {
  color: var(--ops-text) !important;
  background: var(--ops-surface-hover) !important;
}

body tbody tr.row-warn td {
  background: #FFF9E8 !important;
}

body tbody tr.row-alert td {
  background: #FFF0EE !important;
}

body tbody tr.row-warn:hover td {
  background: #FFF2C9 !important;
}

body tbody tr.row-alert:hover td {
  background: #FDE2DE !important;
}

body th[style*="sticky"],
body td[style*="sticky"],
body .sticky-col {
  background: inherit !important;
}

body .sort-btn {
  color: inherit !important;
  background: transparent !important;
}

/* Semantic feedback */
body .alert.success {
  color: #11633F !important;
  background: var(--ops-success-soft) !important;
  border-color: #9BD9BC !important;
}

body .alert.error,
body .alert.danger {
  color: #8F1C13 !important;
  background: var(--ops-danger-soft) !important;
  border-color: #F2B8B2 !important;
}

body .alert.info {
  color: #075F7A !important;
  background: var(--ops-info-soft) !important;
  border-color: #9ED7E7 !important;
}

body .pill,
body .badge,
body .status-pill,
body .state-pill,
body .status-badge,
body .badge-status {
  font-weight: 700 !important;
}

body .empty-state,
body .no-data {
  color: var(--ops-muted) !important;
  background: var(--ops-surface-subtle);
  border: 1px dashed var(--ops-border-strong);
  border-radius: 12px;
}

/* Live Monitor: dense, exception-first operations surface */
body[data-admin-page="live-monitor"] .content {
  gap: 14px !important;
  max-width: none;
}

body[data-admin-page="live-monitor"] .controls-card,
body[data-admin-page="live-monitor"] .summary-card,
body[data-admin-page="live-monitor"] .schedule-form,
body[data-admin-page="live-monitor"] .schedule-body,
body[data-admin-page="live-monitor"] .metric-chip,
body[data-admin-page="live-monitor"] .schedule-table {
  color: var(--ops-text) !important;
  background: var(--ops-surface) !important;
  border-color: var(--ops-border) !important;
}

body[data-admin-page="live-monitor"] .controls-card::before {
  background: var(--ops-primary) !important;
}

body[data-admin-page="live-monitor"] .eyebrow {
  color: var(--ops-primary) !important;
}

body[data-admin-page="live-monitor"] .metric-chip span,
body[data-admin-page="live-monitor"] .toolbar-field label,
body[data-admin-page="live-monitor"] .schedule-field label {
  color: var(--ops-muted) !important;
}

body[data-admin-page="live-monitor"] .lm-headline {
  grid-template-columns: repeat(6, minmax(130px, 1fr)) !important;
  gap: 10px !important;
  margin: 0 0 14px !important;
}

body[data-admin-page="live-monitor"] .lm-hcard,
body[data-admin-page="live-monitor"] .lm-spanel,
body[data-admin-page="live-monitor"] .lm-card,
body[data-admin-page="live-monitor"] .lm-dstat {
  color: var(--ops-text) !important;
  background: var(--ops-surface) !important;
  border: 1px solid var(--ops-border) !important;
  box-shadow: var(--ops-shadow) !important;
  backdrop-filter: none !important;
}

body[data-admin-page="live-monitor"] .lm-hcard {
  padding: 13px 15px !important;
}

body[data-admin-page="live-monitor"] .lm-hcard::before {
  width: 4px;
}

body[data-admin-page="live-monitor"] .lm-hcard:hover,
body[data-admin-page="live-monitor"] .lm-card:hover {
  transform: none !important;
  box-shadow: var(--ops-shadow) !important;
}

body[data-admin-page="live-monitor"] .lm-hcard.lvl-alert {
  animation: none !important;
  background: var(--ops-danger-soft) !important;
  border-color: #F0B4AE !important;
}

body[data-admin-page="live-monitor"] .lm-hcard .hc-l,
body[data-admin-page="live-monitor"] .lm-card-meta,
body[data-admin-page="live-monitor"] .lm-timer-lbl,
body[data-admin-page="live-monitor"] .lm-card-stats b,
body[data-admin-page="live-monitor"] .lm-dsec-h,
body[data-admin-page="live-monitor"] .lm-dstat .k {
  color: var(--ops-muted) !important;
}

body[data-admin-page="live-monitor"] .lm-hcard .hc-v,
body[data-admin-page="live-monitor"] .lm-card-name,
body[data-admin-page="live-monitor"] .lm-card-timer .t,
body[data-admin-page="live-monitor"] .lm-card-stats span,
body[data-admin-page="live-monitor"] .lm-srow .r-name,
body[data-admin-page="live-monitor"] .lm-dstat .v {
  color: var(--ops-text) !important;
}

body[data-admin-page="live-monitor"] .lm-smart {
  grid-template-columns: minmax(340px, 1.35fr) minmax(280px, .65fr) !important;
  gap: 12px !important;
  margin-bottom: 14px !important;
}

body[data-admin-page="live-monitor"] .lm-spanel-head,
body[data-admin-page="live-monitor"] .lm-spanel-problem .lm-spanel-head,
body[data-admin-page="live-monitor"] .lm-spanel-top .lm-spanel-head {
  color: var(--ops-text) !important;
  background: var(--ops-surface-subtle) !important;
  border-bottom: 1px solid var(--ops-border);
}

body[data-admin-page="live-monitor"] .lm-spanel-problem {
  border-left: 4px solid var(--ops-danger) !important;
}

body[data-admin-page="live-monitor"] .lm-srow {
  background: var(--ops-surface-subtle) !important;
}

body[data-admin-page="live-monitor"] .lm-srow:hover {
  background: var(--ops-surface-hover) !important;
}

body[data-admin-page="live-monitor"] .lm-bf {
  color: var(--ops-text-soft) !important;
  background: var(--ops-surface) !important;
  border: 1px solid var(--ops-border-strong) !important;
}

body[data-admin-page="live-monitor"] .lm-bf.active {
  color: #FFFFFF !important;
  background: var(--ops-primary) !important;
  border-color: var(--ops-primary) !important;
}

body[data-admin-page="live-monitor"] .lm-board-search {
  width: min(240px, 100%);
  min-height: 38px;
}

body[data-admin-page="live-monitor"] .lm-board-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
  gap: 10px !important;
  padding: 12px !important;
}

body[data-admin-page="live-monitor"] .lm-card {
  padding: 13px 14px 12px 18px !important;
}

body[data-admin-page="live-monitor"] .lm-drawer-overlay {
  background: rgba(16, 24, 40, .42) !important;
  backdrop-filter: none !important;
}

body[data-admin-page="live-monitor"] .lm-drawer {
  color: var(--ops-text) !important;
  background: var(--ops-surface) !important;
  border-left: 1px solid var(--ops-border) !important;
  box-shadow: -12px 0 32px rgba(16, 24, 40, .16) !important;
}

body[data-admin-page="live-monitor"] .lm-drawer-head {
  color: var(--ops-text) !important;
  background: var(--ops-surface-subtle) !important;
  border-bottom-color: var(--ops-border) !important;
}

body[data-admin-page="live-monitor"] .lm-drawer-name {
  color: var(--ops-text) !important;
}

body[data-admin-page="live-monitor"] .lm-drawer-sub {
  color: var(--ops-muted) !important;
}

body[data-admin-page="live-monitor"] .lm-drawer-close {
  color: var(--ops-text) !important;
  background: #FFFFFF !important;
  border-color: var(--ops-border-strong) !important;
}

body[data-admin-page="live-monitor"] .wallboard-ctrl,
body[data-admin-page="live-monitor"] .filter-pills,
body[data-admin-page="live-monitor"] .wallboard-tools {
  color: var(--ops-text) !important;
  background: var(--ops-surface-subtle) !important;
  border-color: var(--ops-border) !important;
}

body[data-admin-page="live-monitor"] .kpis {
  display: none !important;
}

body[data-admin-page="live-monitor"] #reportCard {
  margin-top: 0;
}

body[data-admin-page="live-monitor"] #wallboardTable th:nth-child(-n+4),
body[data-admin-page="live-monitor"] #wallboardTable td:nth-child(-n+4) {
  background-clip: padding-box;
}

/* Dashboard and reports */
body[data-admin-page="dashboard"] .stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  margin-bottom: 18px !important;
}

body[data-admin-page="dashboard"] .dashboard-secondary-stats {
  display: none !important;
}

body[data-admin-page="dashboard"] .ops-overview-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

body[data-admin-page="dashboard"] .ops-overview-head h3 {
  margin: 0 0 3px;
  font-size: 18px;
}

body[data-admin-page="dashboard"] .ops-overview-head p {
  margin: 0;
  color: var(--ops-muted);
  font-size: 13px;
}

body[data-admin-page="dashboard"] .ops-stat-link {
  display: block;
  color: inherit !important;
  text-decoration: none;
}

body[data-admin-page="dashboard"] .ops-stat-link:hover {
  border-color: #9DBBF3 !important;
  background: #FAFCFF !important;
}

body[data-admin-page="dashboard"] .ops-stat-link .stat-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--ops-primary);
  background: var(--ops-primary-soft);
  border-radius: 9px;
  font-size: 14px;
  font-weight: 800;
}

body[data-admin-page="dashboard"] .ops-secondary-details {
  margin: -4px 0 20px;
  overflow: hidden;
  background: var(--ops-surface);
  border: 1px solid var(--ops-border);
  border-radius: 12px;
}

body[data-admin-page="dashboard"] .ops-secondary-details summary {
  padding: 11px 15px;
  color: var(--ops-text-soft);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

body[data-admin-page="dashboard"] .ops-secondary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--ops-border);
}

body[data-admin-page="dashboard"] .ops-secondary-grid > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 15px;
  border-right: 1px solid var(--ops-border);
}

body[data-admin-page="dashboard"] .ops-secondary-grid > div:last-child {
  border-right: 0;
}

body[data-admin-page="dashboard"] .ops-secondary-grid span {
  color: var(--ops-muted);
  font-size: 12px;
}

body[data-admin-page="dashboard"] .ops-secondary-grid strong {
  color: var(--ops-text);
  font-variant-numeric: tabular-nums;
}

body[data-admin-page="dashboard"] .stat-card:nth-child(n+5) {
  padding-block: 14px !important;
}

body[data-admin-page="dashboard"] #charts-wrapper > div {
  background: var(--ops-surface-subtle) !important;
  border: 1px solid var(--ops-border);
}

body[data-admin-page="reports"] .filter-form,
body .filter-form,
body .filters,
body .filter-row,
body .filter-bar {
  position: relative;
}

body[data-admin-page="reports"] .page-body {
  padding: 20px !important;
}

/* Responsive behavior */
@media (max-width: 1180px) {
  body[data-admin-page="live-monitor"] .lm-headline {
    grid-template-columns: repeat(3, minmax(140px, 1fr)) !important;
  }

  body[data-admin-page="dashboard"] .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-admin-page="dashboard"] .ops-secondary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body .topbar {
    min-height: 60px;
    padding: 10px 14px !important;
  }

  body .content,
  body .page-body {
    padding: 14px !important;
  }

  body[data-admin-page="live-monitor"] .lm-smart {
    grid-template-columns: 1fr !important;
  }

  body[data-admin-page="live-monitor"] .lm-board-toggle {
    width: 100%;
  }
}

@media (max-width: 640px) {
  body .topbar-title,
  body .topbar .topbar-title {
    max-width: none;
  }

  body .topbar .btn,
  body .topbar .btn-sm,
  body .topbar button {
    min-width: 38px;
    max-width: none;
  }

  body[data-admin-page="dashboard"] .stats-grid,
  body[data-admin-page="live-monitor"] .lm-headline {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body[data-admin-page="dashboard"] .ops-overview-head {
    align-items: flex-start;
    flex-direction: column;
  }

  body[data-admin-page="live-monitor"] .lm-board-grid {
    grid-template-columns: 1fr !important;
  }

  body .section-head {
    align-items: flex-start !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ================================================================
   CONTRAST HARDENING (2026-06-12b)
   Legacy pages still contain dark-theme inline foreground colors.
   These page contracts keep all text readable on the light system.
   ================================================================ */
body .form-label,
body .kpi-label,
body .kpi-sub,
body .page-sub,
body .table-meta,
body .sub-days-lbl {
  color: #526078 !important;
}

body .content a:not(.btn):not(.btn-sm):not(.page-btn),
body .page-body a:not(.btn):not(.btn-sm):not(.page-btn),
body .main-content a:not(.btn):not(.btn-sm):not(.page-btn) {
  color: #174EA6 !important;
}

body .btn-primary,
body a.btn-primary,
body button.btn-primary {
  color: #FFFFFF !important;
  background: var(--ops-primary) !important;
  border-color: var(--ops-primary) !important;
}

body .btn-primary:hover,
body a.btn-primary:hover,
body button.btn-primary:hover {
  color: #FFFFFF !important;
  background: var(--ops-primary-hover) !important;
}

body .btn-ghost,
body a.btn-ghost,
body button.btn-ghost {
  color: #344054 !important;
  background: #FFFFFF !important;
  border-color: var(--ops-border-strong) !important;
}

body .notif-btn {
  color: #344054 !important;
  background: #FFFFFF !important;
  border-color: var(--ops-border-strong) !important;
}

body .state-pill.state-online {
  color: #11633F !important;
  background: #DFF7EA !important;
  border-color: #9BD9BC !important;
}

body .state-pill.state-offline {
  color: #475467 !important;
  background: #EAECF0 !important;
  border-color: #D0D5DD !important;
}

/* Queue View */
body[data-admin-page="queue"] .customer-name,
body[data-admin-page="queue"] .table-card td,
body[data-admin-page="queue"] .table-card td a,
body[data-admin-page="queue"] .csv-tip strong,
body[data-admin-page="queue"] .csv-cols strong,
body[data-admin-page="queue"] .modal-header h3,
body[data-admin-page="queue"] .empty-title {
  color: var(--ops-text) !important;
}

body[data-admin-page="queue"] .customer-note,
body[data-admin-page="queue"] .phone-chip,
body[data-admin-page="queue"] .table-meta,
body[data-admin-page="queue"] .csv-tip,
body[data-admin-page="queue"] .csv-cols,
body[data-admin-page="queue"] .file-drop-text,
body[data-admin-page="queue"] .form-label {
  color: #526078 !important;
}

body[data-admin-page="queue"] .phone-chip,
body[data-admin-page="queue"] .csv-tip code,
body[data-admin-page="queue"] .csv-cols,
body[data-admin-page="queue"] .modal,
body[data-admin-page="queue"] .modal-footer,
body[data-admin-page="queue"] .file-drop {
  color: var(--ops-text) !important;
  background: #FFFFFF !important;
  border-color: var(--ops-border) !important;
}

body[data-admin-page="queue"] .badge-pending {
  color: #854D0E !important;
  background: #FEF3C7 !important;
  border-color: #F6D77A !important;
}

body[data-admin-page="queue"] .badge-in_progress {
  color: #1849A9 !important;
  background: #EAF1FF !important;
  border-color: #A8C2F2 !important;
}

body[data-admin-page="queue"] .badge-sales {
  color: #11633F !important;
  background: #DFF7EA !important;
  border-color: #9BD9BC !important;
}

body[data-admin-page="queue"] .badge-followup {
  color: #075F7A !important;
  background: #E5F6FB !important;
  border-color: #9ED7E7 !important;
}

body[data-admin-page="queue"] .badge-rejection {
  color: #8F1C13 !important;
  background: #FDECEA !important;
  border-color: #F2B8B2 !important;
}

body[data-admin-page="queue"] .page-btn {
  color: #344054 !important;
  background: #FFFFFF !important;
  border-color: var(--ops-border-strong) !important;
}

body[data-admin-page="queue"] .page-btn.active {
  color: #FFFFFF !important;
  background: var(--ops-primary) !important;
}

/* Call Queue */
body[data-admin-page="callqueue"] .reporting-table th {
  color: #526078 !important;
  background: #EEF2F7 !important;
}

body[data-admin-page="callqueue"] .reporting-table td,
body[data-admin-page="callqueue"] .reporting-table td * {
  color: var(--ops-text) !important;
  background: transparent !important;
}

body[data-admin-page="callqueue"] .batch-card {
  color: var(--ops-text) !important;
  background: #F7FBFC !important;
  border-color: #67C5D7 !important;
}

body[data-admin-page="callqueue"] .batch-card > div:not(.batch-active-badge),
body[data-admin-page="callqueue"] .batch-card .batch-available,
body[data-admin-page="callqueue"] .batch-card .batch-total {
  color: #344054 !important;
}

body[data-admin-page="callqueue"] .batch-card .batch-available {
  color: #087A91 !important;
}

body[data-admin-page="callqueue"] .batch-card button,
body[data-admin-page="callqueue"] .batch-card a {
  background: #FFFFFF !important;
}

body[data-admin-page="callqueue"] .batch-card form:first-of-type button {
  color: #A11B14 !important;
  background: #FDECEA !important;
  border-color: #F2B8B2 !important;
}

body[data-admin-page="callqueue"] .batch-redial-btn {
  color: #854D0E !important;
  background: #FFF4D8 !important;
  border-color: #F6D77A !important;
}

body[data-admin-page="callqueue"] .batch-card a[href*="download_batch_csv"] {
  color: #11633F !important;
  background: #E7F7EF !important;
  border-color: #9BD9BC !important;
}

body[data-admin-page="callqueue"] .csv-tip,
body[data-admin-page="callqueue"] .csv-tip * {
  color: #344054 !important;
}

/* Billing */
body[data-admin-page="billing"] .badge {
  color: #344054 !important;
  background: #EAECF0 !important;
  border: 1px solid #D0D5DD !important;
}

body[data-admin-page="billing"] .inv-row .badge[style*="16A34A"],
body[data-admin-page="billing"] .badge.badge-active {
  color: #11633F !important;
  background: #DFF7EA !important;
  border-color: #9BD9BC !important;
}

body[data-admin-page="billing"] .sub-days {
  color: #854D0E !important;
}

body[data-admin-page="billing"] .card [style*="color:#CFE3FF"],
body[data-admin-page="billing"] #planCalcResult [style*="color:#CFE3FF"] {
  color: #1849A9 !important;
}

body[data-admin-page="billing"] .card [style*="color:#34d399"],
body[data-admin-page="billing"] .card [style*="color:#34D399"] {
  color: #11633F !important;
}

body[data-admin-page="billing"] .card [style*="background:rgba(96,165,250,.12)"] {
  color: #1849A9 !important;
  background: #EAF1FF !important;
  border-color: #A8C2F2 !important;
}

/* Live Monitor */
body[data-admin-page="live-monitor"] .lm-spanel-count {
  color: #344054 !important;
  background: #EAECF0 !important;
}

body[data-admin-page="live-monitor"] .lm-srow .r-metric {
  color: #087A91 !important;
}

body[data-admin-page="live-monitor"] .lm-srow .r-tag,
body[data-admin-page="live-monitor"] .lm-b-problem {
  color: #8F1C13 !important;
  background: #FDECEA !important;
}

body[data-admin-page="live-monitor"] .fp,
body[data-admin-page="live-monitor"] .fp .cnt {
  color: #344054 !important;
  background: #FFFFFF !important;
  border-color: var(--ops-border-strong) !important;
}

body[data-admin-page="live-monitor"] .fp.active,
body[data-admin-page="live-monitor"] .fp.active .cnt {
  color: #FFFFFF !important;
  background: var(--ops-primary) !important;
}

body[data-admin-page="live-monitor"] .branch-monitor-card {
  overflow: hidden;
  color: var(--ops-text);
  background: #FFFFFF;
  border: 1px solid var(--ops-border);
  border-radius: 12px;
}

body[data-admin-page="live-monitor"] .branch-monitor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  color: var(--ops-text);
  background: #F8FAFC;
  border-bottom: 1px solid var(--ops-border);
}

body[data-admin-page="live-monitor"] .branch-monitor-name {
  color: var(--ops-text) !important;
  font-size: 15px;
  font-weight: 700;
}

body[data-admin-page="live-monitor"] .branch-monitor-type {
  padding: 2px 8px;
  color: #1849A9 !important;
  background: #EAF1FF;
  border: 1px solid #A8C2F2;
  border-radius: 6px;
  font-size: 11px;
}

body[data-admin-page="live-monitor"] .branch-monitor-head .btn {
  color: #344054 !important;
  background: #FFFFFF !important;
  border-color: var(--ops-border-strong) !important;
}

body[data-admin-page="live-monitor"] #branchOverviewBody [id^="branchDetail_"] {
  overflow-x: auto;
  color: var(--ops-text) !important;
  background: #FFFFFF !important;
  border-top: 1px solid var(--ops-border) !important;
}

/* Legacy inline-color compatibility */
body .main [style*="color:var(--muted)"],
body .main-content [style*="color:var(--muted)"] {
  color: #526078 !important;
}

body .main [style*="color:var(--text-2)"],
body .main-content [style*="color:var(--text-2)"] {
  color: #344054 !important;
}

body .main [style*="color:var(--success)"],
body .main-content [style*="color:var(--success)"] {
  color: #11633F !important;
}

/* Light tables keep a dark foreground in every interactive state. */
body .main tbody tr:hover > td,
body .main-content tbody tr:hover > td {
  color: var(--ops-text) !important;
  background: #EAF1FF !important;
}

body .main tbody tr:hover > td *,
body .main-content tbody tr:hover > td * {
  color: inherit;
}

body[data-admin-page="queue"] .btn-danger-soft {
  color: #A11B14 !important;
  background: #FDECEA !important;
  border-color: #F2B8B2 !important;
}

body[data-admin-page="queue"] .btn-danger-soft:hover {
  color: #7A1611 !important;
  background: #FAD7D3 !important;
  border-color: #E99A93 !important;
}

body[data-admin-page="callqueue"] .csv-guidance,
body[data-admin-page="callqueue"] .csv-guidance * {
  color: #344054 !important;
}

body[data-admin-page="callqueue"] .csv-guidance {
  background: #EAF7FB !important;
  border-color: #9ED7E7 !important;
}

body[data-admin-page="callqueue"] .csv-guidance code {
  color: #075F7A !important;
  background: #FFFFFF !important;
}

body[data-admin-page="callqueue"] .batch-card form button:hover,
body[data-admin-page="callqueue"] .batch-card a:hover {
  filter: brightness(.96);
}

body[data-admin-page="billing"] .inv-row [style*="color:var(--success)"] {
  color: #11633F !important;
}

body[data-admin-page="live-monitor"] .schedule-state.run {
  color: #11633F !important;
  background: #DFF7EA !important;
  border-color: #9BD9BC !important;
}

body[data-admin-page="live-monitor"] .schedule-state.stop {
  color: #8F1C13 !important;
  background: #FDECEA !important;
  border-color: #F2B8B2 !important;
}

body[data-admin-page="live-monitor"] .schedule-state.neutral {
  color: #475467 !important;
  background: #EAECF0 !important;
  border-color: #D0D5DD !important;
}
