/* ============================================================
   MTN CONNECT WEB — DESIGN SYSTEM
   main.css
   ============================================================ */

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

/* ---------- 2. Design Tokens ---------- */
:root {
  /* Brand */
  --brand-50:  #fffbe6;
  --brand-100: #fff3b8;
  --brand-200: #ffe98a;
  --brand-300: #ffdf5c;
  --brand-400: #ffd52e;
  --brand-500: #ffcb05;   /* primary accent */
  --brand-600: #e6b400;
  --brand-700: #b38c00;
  --brand-800: #806400;
  --brand-900: #4d3c00;

  /* Status */
  --success: #22c55e;
  --success-soft: rgba(34, 197, 94, 0.12);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.12);
  --danger:  #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --info:    #3b82f6;
  --info-soft: rgba(59, 130, 246, 0.12);

  /* Radii */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-2xl: 28px;
  --r-full: 999px;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 56px;
  --s-10: 72px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.25);
  --shadow-md: 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.5);
  --shadow-glow: 0 0 0 1px rgba(255,203,5,.25), 0 8px 32px rgba(255,203,5,.18);

  /* Transitions */
  --t-fast: 140ms cubic-bezier(.4,0,.2,1);
  --t-med:  240ms cubic-bezier(.4,0,.2,1);
  --t-slow: 400ms cubic-bezier(.4,0,.2,1);

  /* Typography */
  --font-ui: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

/* ---------- 3. Dark theme ---------- */
:root, [data-theme="dark"] {
  --accent-ink: #ffcb05;   /* accent used as text */
  --on-accent: #111111;    /* text on yellow */
  --bg-0: #070b14;    /* page background */
  --bg-1: #0b1220;    /* surface */
  --bg-2: #111a2e;    /* elevated surface */
  --bg-3: #172238;    /* hover surface */
  --bg-glass: rgba(17, 26, 46, 0.65);

  --border-1: rgba(255,255,255,0.06);
  --border-2: rgba(255,255,255,0.10);
  --border-3: rgba(255,255,255,0.16);

  --text-1: #f1f5f9;   /* primary */
  --text-2: #a3b1c6;   /* secondary */
  --text-3: #6b7a93;   /* muted */
  --text-inv: #070b14;

  --overlay: rgba(3,6,12,0.72);
  --sidebar-bg: #080e1c;
  --topbar-bg: rgba(11,18,32,0.85);
}

/* ---------- 4. Light theme ---------- */
[data-theme="light"] {
  --accent-ink: #7a5a00;   /* dark gold: readable on white */
  --on-accent: #111111;
  --bg-0: #f5f7fb;
  --bg-1: #ffffff;
  --bg-2: #ffffff;
  --bg-3: #eef2f8;
  --bg-glass: rgba(255,255,255,0.75);

  --border-1: rgba(10,20,40,0.06);
  --border-2: rgba(10,20,40,0.10);
  --border-3: rgba(10,20,40,0.16);

  --text-1: #0b1220;
  --text-2: #4a5568;
  --text-3: #8a97ad;
  --text-inv: #ffffff;

  --overlay: rgba(10,20,40,0.35);
  --sidebar-bg: #ffffff;
  --topbar-bg: rgba(255,255,255,0.85);

  --shadow-sm: 0 1px 2px rgba(10,20,40,.06);
  --shadow-md: 0 8px 24px rgba(10,20,40,.08);
  --shadow-lg: 0 24px 60px rgba(10,20,40,.14);
}

/* ---------- 5. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-1);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  transition: background var(--t-med), color var(--t-med);
}
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-ink); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--brand-300); }
::selection { background: var(--brand-500); color: #111111; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-2);
  border-radius: var(--r-full);
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--border-3); background-clip: padding-box; }

/* ---------- 6. Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--s-4);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-1);
  line-height: 1.2;
}
h1 { font-size: 44px; }
h2 { font-size: 32px; }
h3 { font-size: 24px; }
h4 { font-size: 19px; }
h5 { font-size: 16px; }
h6 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }

p { margin: 0 0 var(--s-4); color: var(--text-2); }
small, .text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 17px; }
.text-muted { color: var(--text-3); }
.text-soft  { color: var(--text-2); }
.text-brand { color: var(--accent-ink); }
.text-mono  { font-family: var(--font-mono); }
.text-center { text-align: center; }
.text-right  { text-align: right; }

.gradient-text {
  background: linear-gradient(120deg, var(--brand-300), var(--brand-500) 60%, #f2a900);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 7. Layout helpers ---------- */
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--s-6); }
.container-wide { max-width: 1440px; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--s-1); } .gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); } .gap-4 { gap: var(--s-4); }
.gap-5 { gap: var(--s-5); } .gap-6 { gap: var(--s-6); }
.w-full { width: 100%; }
.h-full { height: 100%; }
.relative { position: relative; }
.hidden { display: none !important; }
.mt-2 { margin-top: var(--s-2); } .mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); } .mt-6 { margin-top: var(--s-6); }
.mt-8 { margin-top: var(--s-8); } .mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--s-2); } .mb-4 { margin-bottom: var(--s-4); }
.mb-6 { margin-bottom: var(--s-6); } .mb-8 { margin-bottom: var(--s-8); }

/* ---------- 8. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 10px 18px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: var(--bg-3);
  color: var(--text-1);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: all var(--t-fast);
  text-decoration: none;
  line-height: 1;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--brand-500);
  color: var(--on-accent);
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(255,203,5,.28);
}
.btn-primary:hover { box-shadow: 0 10px 28px rgba(255,203,5,.4); }

.btn-outline {
  background: transparent;
  border-color: var(--border-3);
  color: var(--text-1);
}
.btn-outline:hover { background: var(--bg-3); border-color: var(--brand-500); }

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

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

.btn-success { background: var(--success); color: #052e16; }

.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn-lg { padding: 14px 26px; font-size: 15px; border-radius: var(--r-lg); }
.btn-icon { padding: 9px; width: 36px; height: 36px; }
.btn-icon.btn-sm { width: 30px; height: 30px; padding: 6px; }
.btn-block { width: 100%; }

/* ---------- 9. Cards ---------- */
.card {
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.card-hover:hover {
  border-color: var(--border-3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.card-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-2);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--border-1);
}
.card-title { font-size: 16px; font-weight: 700; margin: 0; }
.card-subtitle { font-size: 13px; color: var(--text-3); margin: 2px 0 0; }

/* ---------- 10. Forms ---------- */
.field { margin-bottom: var(--s-5); }
.label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: var(--s-2);
}
.label .req { color: var(--danger); margin-left: 2px; }

.input, .select, .textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  color: var(--text-1);
  font-size: 14px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-3); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(255,203,5,.15);
  background: var(--bg-1);
}
.textarea { min-height: 100px; resize: vertical; font-family: inherit; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7a93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.input-group { position: relative; }
.input-group .input { padding-left: 42px; }
.input-group .icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

/* Checkbox / radio */
.check {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  color: var(--text-2);
}
.check input { appearance: none; width: 18px; height: 18px; border: 1.5px solid var(--border-3); border-radius: 5px; background: var(--bg-2); cursor: pointer; position: relative; transition: all var(--t-fast); flex-shrink: 0; }
.check input:checked { background: var(--brand-500); border-color: var(--brand-500); }
.check input:checked::after {
  content: '';
  position: absolute; left: 5px; top: 1.5px;
  width: 5px; height: 10px;
  border: solid #111111;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Toggle switch */
.toggle { position: relative; display: inline-block; width: 42px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider {
  position: absolute; inset: 0;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all var(--t-med);
}
.toggle .slider::before {
  content: '';
  position: absolute;
  height: 18px; width: 18px;
  left: 2px; top: 50%;
  transform: translateY(-50%);
  background: var(--text-2);
  border-radius: 50%;
  transition: all var(--t-med);
}
.toggle input:checked + .slider { background: var(--brand-500); border-color: var(--brand-500); }
.toggle input:checked + .slider::before { transform: translate(18px, -50%); background: #111111; }

/* ---------- 11. Badges / pills ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.5;
  background: var(--bg-3);
  color: var(--text-2);
  border: 1px solid var(--border-1);
}
.badge-success { background: var(--success-soft); color: var(--success); border-color: rgba(34,197,94,.25); }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: rgba(245,158,11,.25); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger);  border-color: rgba(239,68,68,.25); }
.badge-info    { background: var(--info-soft);    color: var(--info);    border-color: rgba(59,130,246,.25); }
.badge-brand   { background: rgba(255,203,5,.12); color: var(--accent-ink); border-color: rgba(255,203,5,.28); }

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-3);
  display: inline-block;
  flex-shrink: 0;
}
.dot.live { background: var(--success); box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse 1.8s infinite; }
.dot.offline { background: var(--text-3); }
.dot.alert { background: var(--danger); }
.dot.recording { background: var(--danger); animation: pulse 1.2s infinite; }

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  70%  { box-shadow: 0 0 0 8px transparent; opacity: .9; }
  100% { box-shadow: 0 0 0 0 transparent; opacity: 1; }
}

/* ---------- 12. Avatar ---------- */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), #f2a900);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #111111;
  font-size: 14px;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.avatar-xl { width: 72px; height: 72px; font-size: 26px; }

/* ---------- 13. Tables ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  background: var(--bg-1);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th {
  text-align: left;
  padding: 14px 18px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border-1);
  white-space: nowrap;
}
.table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-1);
  color: var(--text-2);
  vertical-align: middle;
}
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--bg-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table td strong, .table td .text-1 { color: var(--text-1); font-weight: 600; }

/* ---------- 14. Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: var(--s-6);
  animation: fadeIn var(--t-med);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  padding: var(--s-7);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp var(--t-med);
}
.modal-lg { max-width: 760px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-5); }
.modal-title { font-size: 20px; font-weight: 700; margin: 0; }
.modal-desc { font-size: 14px; color: var(--text-3); margin: 4px 0 0; }
.modal-close {
  background: transparent; border: none; cursor: pointer;
  color: var(--text-3); padding: 6px; border-radius: var(--r-sm);
  transition: all var(--t-fast);
}
.modal-close:hover { background: var(--bg-3); color: var(--text-1); }
.modal-footer {
  display: flex; gap: var(--s-3); justify-content: flex-end;
  margin-top: var(--s-6); padding-top: var(--s-5);
  border-top: 1px solid var(--border-1);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 15. Toast ---------- */
.toast-stack {
  position: fixed;
  top: var(--s-6); right: var(--s-6);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  pointer-events: none;
}
.toast {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-left: 3px solid var(--brand-500);
  border-radius: var(--r-md);
  padding: 12px 16px;
  min-width: 280px;
  box-shadow: var(--shadow-md);
  animation: slideIn var(--t-med);
  pointer-events: auto;
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.toast-msg   { font-size: 13px; color: var(--text-3); }

@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }

/* ---------- 16. Tabs ---------- */
.tabs {
  display: flex;
  gap: var(--s-1);
  border-bottom: 1px solid var(--border-1);
  margin-bottom: var(--s-6);
  overflow-x: auto;
}
.tab {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-3);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.tab:hover { color: var(--text-1); }
.tab.active { color: var(--accent-ink); border-bottom-color: var(--brand-500); }

/* ---------- 17. Progress ---------- */
.progress {
  height: 8px;
  background: var(--bg-3);
  border-radius: var(--r-full);
  overflow: hidden;
  width: 100%;
}
.progress .bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-400), var(--brand-600));
  border-radius: var(--r-full);
  transition: width var(--t-slow);
}
.progress.thin { height: 4px; }
.progress .bar.success { background: var(--success); }
.progress .bar.warning { background: var(--warning); }
.progress .bar.danger  { background: var(--danger); }

/* ---------- 18. Divider ---------- */
.divider { height: 1px; background: var(--border-1); margin: var(--s-5) 0; border: none; }
.divider-v { width: 1px; background: var(--border-1); align-self: stretch; }

/* ---------- 19. Skeleton ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------- 20. Video / camera tiles ---------- */
.cam-tile {
  position: relative;
  background: #000;
  border-radius: var(--r-md);
  overflow: hidden;
  aspect-ratio: 16/9;
  border: 1px solid var(--border-2);
  cursor: pointer;
}
.cam-tile video, .cam-tile img.cam-frame {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.cam-tile::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.5) 0%, transparent 25%, transparent 70%, rgba(0,0,0,.7) 100%);
  pointer-events: none;
}
.cam-label {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
  padding: 5px 10px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.cam-meta {
  position: absolute;
  bottom: 10px; left: 10px; right: 10px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: rgba(255,255,255,.85);
  font-family: var(--font-mono);
}
.cam-tile.offline video, .cam-tile.offline img { filter: grayscale(1) brightness(.3); }
.cam-tile.offline::before {
  content: 'OFFLINE';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  font-weight: 700;
  letter-spacing: .2em;
  font-size: 13px;
  z-index: 3;
  pointer-events: none;
}

/* ---------- 21. Sidebar / Topbar (used by app pages) ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  background: var(--bg-0);
}

.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-1);
  padding: var(--s-5) var(--s-4);
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: transform var(--t-med);
  z-index: 100;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 0 var(--s-2) var(--s-5);
  border-bottom: 1px solid var(--border-1);
}
.sidebar-brand .logo {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--brand-500);
  letter-spacing: -.04em;
  font-size: 14px !important;
  display: flex; align-items: center; justify-content: center;
  color: #111111;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 4px 14px rgba(255,203,5,.35);
}
.sidebar-brand .name { font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.sidebar-brand .name span { color: var(--accent-ink); }

.nav-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-3);
  padding: 0 var(--s-3) var(--s-2);
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--t-fast);
  position: relative;
}
.nav-item:hover { background: var(--bg-2); color: var(--text-1); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(255,203,5,.22), rgba(255,203,5,.04));
  color: var(--accent-ink);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--brand-500);
  box-shadow: 0 0 12px rgba(255,203,5,.6);
}
.nav-item .icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item .badge { margin-left: auto; }

.sidebar-footer {
  margin-top: auto;
  padding-top: var(--s-5);
  border-top: 1px solid var(--border-1);
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  height: 64px;
  background: var(--topbar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--s-6);
  gap: var(--s-4);
}
.topbar-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}
.topbar-search .input { padding: 9px 14px 9px 40px; background: var(--bg-2); }
.topbar-search .icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}
.topbar-actions { display: flex; align-items: center; gap: var(--s-2); }

.icon-btn {
  position: relative;
  width: 38px; height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--t-fast);
}
.icon-btn:hover { background: var(--bg-2); color: var(--text-1); border-color: var(--border-1); }
.icon-btn .badge-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-0);
}

.main { display: flex; flex-direction: column; min-width: 0; }
.page {
  padding: var(--s-6);
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-6);
  flex-wrap: wrap;
}
.page-title { font-size: 26px; font-weight: 700; margin: 0; letter-spacing: -.02em; }
.page-subtitle { font-size: 14px; color: var(--text-3); margin: 4px 0 0; }
.page-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: var(--s-2);
  font-size: 13px; color: var(--text-3); margin-bottom: var(--s-3);
}
.breadcrumb a { color: var(--text-3); }
.breadcrumb a:hover { color: var(--accent-ink); }
.breadcrumb .sep { color: var(--text-3); opacity: .5; }

/* ---------- 22. Stat card ---------- */
.stat {
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  transition: all var(--t-fast);
}
.stat:hover { border-color: var(--border-3); transform: translateY(-2px); }
.stat-head { display: flex; align-items: center; justify-content: space-between; }
.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,203,5,.12);
  color: var(--accent-ink);
}
.stat-icon.success { background: var(--success-soft); color: var(--success); }
.stat-icon.warning { background: var(--warning-soft); color: var(--warning); }
.stat-icon.danger  { background: var(--danger-soft);  color: var(--danger); }
.stat-icon.info    { background: var(--info-soft);    color: var(--info); }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.stat-label { font-size: 13px; color: var(--text-3); font-weight: 500; }
.stat-delta { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--danger); }

/* ---------- 23. Utilities ---------- */
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.backdrop-blur { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* Gradient background glow used on marketing pages */
.glow-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.glow-bg::before, .glow-bg::after {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .35;
}
.glow-bg::before { background: var(--brand-500); top: -200px; left: -150px; }
.glow-bg::after  { background: #f2a900; bottom: -250px; right: -150px; opacity: .22; }
[data-theme="light"] .glow-bg::before { opacity: .18; }
[data-theme="light"] .glow-bg::after  { opacity: .12; }

/* ---------- 24. Responsive ---------- */
@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
}
@media (max-width: 640px) {
  h1 { font-size: 32px; }
  h2 { font-size: 26px; }
  .page { padding: var(--s-4); }
  .topbar { padding: 0 var(--s-4); }
  .card { padding: var(--s-5); }
  .modal { padding: var(--s-5); }
}
/* ---------- MTN Connect: white + yellow ---------- */
[data-theme="light"] {
  --bg-0: #fafafa;
  --bg-3: #f4f1e6;
  --sidebar-bg: #ffffff;
}
[data-theme="light"] .topbar { border-bottom: 3px solid var(--brand-500); }
[data-theme="light"] .nav-item.active { color: var(--text-1); }
[data-theme="light"] .nav-item.active .icon { color: var(--accent-ink); }
.sidebar-brand .name { font-weight: 800; }
.sidebar-brand .name span { color: var(--text-1); font-weight: 500; }
.badge-brand { color: var(--accent-ink); }
.gradient-text { background: linear-gradient(120deg, var(--accent-ink), var(--accent-ink)); -webkit-background-clip: text; background-clip: text; }
