/* =========================================================================
   Shyama Bhakti Admin — design system
   Saffron/marigold accent on a neutral slate base. Light + dark themes.
   ========================================================================= */

:root {
  --saffron-50:  #fff7ed;
  --saffron-100: #ffedd5;
  --saffron-200: #fed7aa;
  --saffron-300: #fdba74;
  --saffron-400: #fb923c;
  --saffron-500: #f97316;
  --saffron-600: #ea580c;
  --saffron-700: #c2410c;

  --bg:            #f5f6f8;
  --bg-elevated:   #ffffff;
  --bg-subtle:     #f8fafc;
  --bg-hover:      #f1f5f9;
  --sidebar-bg:    #12151c;
  --sidebar-fg:    #98a2b3;
  --sidebar-fg-active: #ffffff;

  --fg:            #0f172a;
  --fg-muted:      #64748b;
  --fg-subtle:     #94a3b8;

  --border:        #e2e8f0;
  --border-strong: #cbd5e1;

  --primary:       var(--saffron-500);
  --primary-hover: var(--saffron-600);
  --primary-soft:  var(--saffron-50);

  --success: #16a34a;  --success-soft: #dcfce7;
  --danger:  #dc2626;  --danger-soft:  #fee2e2;
  --warning: #d97706;  --warning-soft: #fef3c7;
  --info:    #2563eb;  --info-soft:    #dbeafe;

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow:    0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, .12);

  --sidebar-w: 252px;
  --topbar-h:  62px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
}

:root[data-theme='dark'] {
  --bg:            #0b0e14;
  --bg-elevated:   #141922;
  --bg-subtle:     #1a2029;
  --bg-hover:      #1f2733;
  --sidebar-bg:    #080a0f;
  --sidebar-fg:    #7d8799;

  --fg:            #e6edf3;
  --fg-muted:      #9aa5b4;
  --fg-subtle:     #6b7688;

  --border:        #232c3a;
  --border-strong: #33404f;

  --primary-soft:  rgba(249, 115, 22, .14);
  --success-soft:  rgba(22, 163, 74, .16);
  --danger-soft:   rgba(220, 38, 38, .16);
  --warning-soft:  rgba(217, 119, 6, .16);
  --info-soft:     rgba(37, 99, 235, .16);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow:    0 1px 3px rgba(0, 0, 0, .5);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

/* ------------------------------------------------------------------ layout */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  transition: transform .22s ease;
}

.sidebar__brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  flex-shrink: 0;
}

.sidebar__logo {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--saffron-400), var(--saffron-600));
  display: grid; place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar__title { color: #fff; font-weight: 600; font-size: 14.5px; letter-spacing: -.01em; }
.sidebar__subtitle { font-size: 11px; color: var(--sidebar-fg); }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 12px 10px 20px; }
.sidebar__nav::-webkit-scrollbar { width: 4px; }
.sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }

.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 0; }
.nav-group__label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: #55606f;
  padding: 0 10px 6px;
  font-weight: 600;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 450;
  color: var(--sidebar-fg);
  transition: background .14s, color .14s;
  position: relative;
}
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #e6edf3; }
.nav-link.active { background: rgba(249, 115, 22, .16); color: var(--sidebar-fg-active); font-weight: 550; }
.nav-link.active::before {
  content: '';
  position: absolute; left: -10px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}
.nav-link__icon { width: 17px; text-align: center; font-size: 14px; flex-shrink: 0; opacity: .95; }
.nav-link__badge {
  margin-left: auto;
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .1);
  color: #cbd5e1;
}

.sidebar__footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, .07);
  flex-shrink: 0;
}

.sidebar__user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--radius-sm);
  transition: background .14s;
}
.sidebar__user:hover { background: rgba(255, 255, 255, .06); }
.sidebar__user-name { color: #e6edf3; font-size: 13px; font-weight: 550; }
.sidebar__user-role { font-size: 11px; color: var(--sidebar-fg); }

/* main column */

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar__title { font-size: 16px; font-weight: 600; letter-spacing: -.015em; }
.topbar__crumb { font-size: 12px; color: var(--fg-muted); }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.page { padding: 22px; flex: 1; max-width: 1560px; width: 100%; }

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-head__text h1 { font-size: 20px; font-weight: 650; letter-spacing: -.02em; }
.page-head__text p { color: var(--fg-muted); font-size: 13px; margin-top: 2px; }
.page-head__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------- cards */

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card__head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.card__title { font-size: 14px; font-weight: 600; }
.card__subtitle { font-size: 12px; color: var(--fg-muted); }
.card__actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card__body { padding: 18px; }
.card__body--flush { padding: 0; }
.card__foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-subtle);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* stat tiles */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat__label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--fg-muted);
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.stat__value {
  font-size: 26px;
  font-weight: 680;
  letter-spacing: -.03em;
  margin-top: 6px;
  line-height: 1.15;
}
.stat__meta { font-size: 12px; color: var(--fg-muted); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.stat__delta { font-weight: 600; }
.stat__delta--up { color: var(--success); }
.stat__delta--down { color: var(--danger); }
.stat__icon {
  position: absolute; top: 14px; right: 16px;
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 16px;
  background: var(--primary-soft);
}

/* ------------------------------------------------------------------ tables */

.table-wrap { overflow-x: auto; }

table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  white-space: nowrap;
}
table.table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--fg-muted);
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  position: sticky; top: 0;
}
table.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.table tbody tr:last-child td { border-bottom: none; }
table.table tbody tr { transition: background .12s; }
table.table tbody tr:hover { background: var(--bg-hover); }
table.table th a { display: inline-flex; align-items: center; gap: 4px; }
table.table th a:hover { color: var(--fg); }

.td-wrap { white-space: normal; min-width: 220px; }
.td-num { text-align: right; font-variant-numeric: tabular-nums; }
.td-actions { text-align: right; }

.cell-media { display: flex; align-items: center; gap: 11px; min-width: 240px; }
.cell-media__thumb {
  width: 42px; height: 42px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg-hover);
  flex-shrink: 0;
}
.cell-media__thumb--tall { width: 34px; height: 46px; }
.cell-media__fallback {
  width: 42px; height: 42px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--bg-hover);
  font-size: 17px;
  flex-shrink: 0;
}
.cell-media__title { font-weight: 550; white-space: normal; line-height: 1.35; }
.cell-media__meta { font-size: 12px; color: var(--fg-muted); }

.empty {
  padding: 52px 20px;
  text-align: center;
  color: var(--fg-muted);
}
.empty__icon { font-size: 34px; opacity: .5; margin-bottom: 8px; }
.empty__title { font-weight: 600; color: var(--fg); margin-bottom: 3px; }

/* ------------------------------------------------------------------ badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-info    { background: var(--info-soft);    color: var(--info); }
.badge-primary { background: var(--primary-soft); color: var(--primary-hover); }
.badge-muted   { background: var(--bg-hover);     color: var(--fg-muted); }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ----------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--bg-elevated);
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  transition: background .14s, border-color .14s, opacity .14s, transform .06s;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn-outline { border-color: var(--border-strong); color: var(--fg); }
.btn-outline:hover:not(:disabled) { background: var(--bg-hover); }

.btn-ghost { background: transparent; color: var(--fg-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-hover); color: var(--fg); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.08); }

.btn-sm { padding: 4px 9px; font-size: 12.5px; border-radius: 5px; }
.btn-lg { padding: 10px 20px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn-icon { padding: 6px; width: 30px; height: 30px; }

.btn-group { display: inline-flex; gap: 4px; }

/* ------------------------------------------------------------------- forms */

.form-grid { display: grid; gap: 15px; }
.form-grid--2 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.form-grid--3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field__label { font-size: 12.5px; font-weight: 600; color: var(--fg); }
.field__label .req { color: var(--danger); }
.field__hint { font-size: 11.5px; color: var(--fg-muted); }
.field__error { font-size: 11.5px; color: var(--danger); }

.input, .select, .textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  font-size: 13.5px;
  transition: border-color .14s, box-shadow .14s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--fg-subtle); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.55; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8.5 2 4.5h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.input-sm { padding: 5px 9px; font-size: 12.5px; }

.checkbox, .radio {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 13.5px;
  line-height: 1.45;
}
.checkbox input, .radio input { margin-top: 2px; accent-color: var(--primary); width: 15px; height: 15px; flex-shrink: 0; }

/* radio cards used by the audience picker */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 8px; }
.choice {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .14s, background .14s;
  display: block;
}
.choice:hover { border-color: var(--primary-300, var(--primary)); background: var(--bg-hover); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice__title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.choice__desc { font-size: 11.5px; color: var(--fg-muted); margin-top: 2px; }
.choice:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 1px var(--primary) inset;
}

.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.filter-bar .field { flex: 0 1 170px; }
.filter-bar .field--wide { flex: 1 1 240px; }

.search-input { position: relative; flex: 1 1 240px; }
.search-input .input { padding-left: 32px; }
.search-input::before {
  content: '🔍';
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%);
  font-size: 12px; opacity: .55;
  pointer-events: none;
}

/* ---------------------------------------------------------------- toggles */

.switch { position: relative; display: inline-block; width: 38px; height: 21px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch__slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border-strong);
  border-radius: 21px;
  transition: background .18s;
}
.switch__slider::before {
  content: '';
  position: absolute;
  height: 15px; width: 15px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform .18s;
  box-shadow: var(--shadow-sm);
}
.switch input:checked + .switch__slider { background: var(--primary); }
.switch input:checked + .switch__slider::before { transform: translateX(17px); }
.switch input:disabled + .switch__slider { opacity: .5; cursor: not-allowed; }

/* ------------------------------------------------------------------ modals */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(2px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 100;
  overflow-y: auto;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  animation: modal-in .16s ease-out;
}
.modal--wide { max-width: 860px; }
.modal--narrow { max-width: 420px; }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(-8px) scale(.99); }
  to   { opacity: 1; transform: none; }
}

.modal__head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.modal__title { font-size: 15.5px; font-weight: 600; }
.modal__close {
  margin-left: auto;
  background: none; border: none;
  font-size: 19px; line-height: 1;
  color: var(--fg-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 5px;
}
.modal__close:hover { background: var(--bg-hover); color: var(--fg); }
.modal__body { padding: 20px; }
.modal__foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
  background: var(--bg-subtle);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ------------------------------------------------------------------ toasts */

.toast-stack {
  position: fixed;
  top: 16px; right: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 200;
  max-width: 380px;
}
.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--fg-muted);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 11px 14px;
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 13.5px;
  animation: toast-in .2s ease-out;
}
.toast--success { border-left-color: var(--success); }
.toast--error   { border-left-color: var(--danger); }
.toast--info    { border-left-color: var(--info); }
.toast--warning { border-left-color: var(--warning); }
.toast__close { margin-left: auto; background: none; border: none; cursor: pointer; color: var(--fg-subtle); font-size: 15px; }

@keyframes toast-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

/* -------------------------------------------------------------- pagination */

.pagination {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.pagination__info { color: var(--fg-muted); font-size: 12.5px; margin-right: auto; }
.pagination a, .pagination span {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
  color: var(--fg-muted);
  background: var(--bg-elevated);
}
.pagination a:hover { background: var(--bg-hover); color: var(--fg); }
.pagination .current { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pagination .disabled { opacity: .45; pointer-events: none; }

/* ------------------------------------------------------------------ charts */

.chart-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.chart-grid--2-1 { grid-template-columns: 2fr 1fr; }

.chart { width: 100%; height: 240px; display: block; }
.chart--sm { height: 180px; }

.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 12.5px; }
.legend__item { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-muted); }
.legend__swatch { width: 9px; height: 9px; border-radius: 2.5px; }

.bar-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.bar-row__label { width: 118px; font-size: 12.5px; flex-shrink: 0; }
.bar-row__track { flex: 1; height: 7px; background: var(--bg-hover); border-radius: 4px; overflow: hidden; }
.bar-row__fill { height: 100%; border-radius: 4px; background: var(--primary); transition: width .4s ease; }
.bar-row__value { width: 62px; text-align: right; font-size: 12.5px; color: var(--fg-muted); font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------- misc parts */

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--saffron-400), var(--saffron-600));
  color: #fff;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 650;
  flex-shrink: 0;
  object-fit: cover;
}
.avatar--lg { width: 52px; height: 52px; font-size: 18px; }
.avatar--sm { width: 26px; height: 26px; font-size: 10.5px; }

.alert {
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 13.5px;
  display: flex; gap: 9px; align-items: flex-start;
  margin-bottom: 14px;
  border: 1px solid transparent;
}
.alert--info    { background: var(--info-soft);    color: var(--info);    border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert--warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.alert--danger  { background: var(--danger-soft);  color: var(--danger);  border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert--success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab {
  padding: 9px 14px;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--fg-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color .14s, border-color .14s;
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.list-row {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--bg-hover); }
.list-row__main { min-width: 0; flex: 1; }
.list-row__title { font-weight: 550; font-size: 13.5px; }
.list-row__meta { font-size: 12px; color: var(--fg-muted); }
.list-row__value { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 9px 14px; font-size: 13.5px; }
.kv dt { color: var(--fg-muted); }
.kv dd { font-weight: 500; word-break: break-word; }

.code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  font-size: 12px;
}
.chip button { background: none; border: none; cursor: pointer; color: var(--fg-muted); font-size: 13px; line-height: 1; }
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* phone preview for the notification composer */
.phone-preview {
  background: linear-gradient(160deg, #2b3245, #171b26);
  border-radius: 22px;
  padding: 16px 13px;
  min-height: 210px;
}
.phone-preview__time { color: rgba(255,255,255,.6); font-size: 11px; text-align: center; margin-bottom: 12px; }
.push-card {
  background: rgba(255, 255, 255, .96);
  border-radius: 14px;
  padding: 11px 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
  color: #111;
}
.push-card__head { display: flex; align-items: center; gap: 7px; font-size: 11px; color: #555; margin-bottom: 4px; }
.push-card__icon { width: 15px; height: 15px; border-radius: 4px; background: linear-gradient(135deg, var(--saffron-400), var(--saffron-600)); }
.push-card__title { font-weight: 650; font-size: 13.5px; line-height: 1.3; color: #111; }
.push-card__body { font-size: 12.5px; color: #333; line-height: 1.4; margin-top: 2px; word-break: break-word; }
.push-card__image { margin-top: 8px; border-radius: 8px; max-height: 130px; width: 100%; object-fit: cover; }

.audience-meter {
  display: flex; align-items: baseline; gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
}
.audience-meter__value { font-size: 24px; font-weight: 700; color: var(--primary-hover); letter-spacing: -.02em; }
.audience-meter__label { font-size: 12.5px; color: var(--fg-muted); }

.spinner {
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-subtle) 37%, var(--bg-hover) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ------------------------------------------------------------------- login */

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.auth-art {
  background: linear-gradient(150deg, #12151c 0%, #24170c 55%, #7a3b0c 100%);
  color: #fff;
  padding: 48px;
  display: flex; flex-direction: column; justify-content: center;
  position: relative;
  overflow: hidden;
}
.auth-art::after {
  content: '';
  position: absolute;
  width: 460px; height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249,115,22,.34), transparent 68%);
  right: -140px; bottom: -140px;
}
.auth-art__logo { font-size: 40px; margin-bottom: 20px; }
.auth-art h2 { font-size: 27px; font-weight: 650; letter-spacing: -.02em; line-height: 1.25; }
.auth-art p { color: rgba(255,255,255,.7); margin-top: 12px; max-width: 380px; font-size: 14px; }
.auth-art ul { margin-top: 26px; list-style: none; display: grid; gap: 10px; }
.auth-art li { display: flex; gap: 9px; align-items: center; color: rgba(255,255,255,.85); font-size: 13.5px; }

.auth-form-wrap { display: grid; place-items: center; padding: 40px 24px; }
.auth-form { width: 100%; max-width: 372px; }
.auth-form h1 { font-size: 23px; font-weight: 650; letter-spacing: -.02em; }
.auth-form > p { color: var(--fg-muted); margin: 5px 0 24px; font-size: 13.5px; }

/* ------------------------------------------------------------- responsive */

.sidebar-toggle { display: none; }
.sidebar-scrim { display: none; }

@media (max-width: 1100px) {
  .chart-grid--2-1 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .sidebar-toggle { display: inline-flex; }
  .sidebar-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 55; }
  .sidebar-scrim.open { display: block; }
  .page { padding: 16px; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .kv { grid-template-columns: 1fr; gap: 3px 0; }
  .kv dd { margin-bottom: 8px; }
}

@media (max-width: 640px) {
  .topbar { padding: 0 14px; }
  .topbar__crumb { display: none; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
  .stat__value { font-size: 21px; }
  .filter-bar .field { flex: 1 1 100%; }
}

@media print {
  .sidebar, .topbar, .page-head__actions, .filter-bar, .pagination { display: none !important; }
  .main { margin-left: 0; }
  .card { border-color: #ddd; box-shadow: none; }
}
