/* ==========================================================================
   Admin panel design system
   ========================================================================== */
:root {
  --bg: #f6f6f8;
  --surface: #ffffff;
  --surface-2: #fafafb;
  --surface-hover: #f4f4f6;
  --border: #e8e8ec;
  --border-strong: #d6d6dc;
  --text: #111216;
  --text-2: #4b4d57;
  --muted: #7a7c87;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef0ff;
  --primary-ring: rgba(79, 70, 229, .18);

  --success: #15803d;
  --success-soft: #ecfdf3;
  --warning: #b45309;
  --warning-soft: #fff8eb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --star: #f5a524;

  /* Chart series (validated categorical slots 1-3). */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --grid: #efeff2;

  --sidebar-bg: #0f1117;
  --sidebar-text: #a3a7b7;
  --sidebar-active: #ffffff;
  --sidebar-hover: rgba(255, 255, 255, .06);
  --sidebar-border: rgba(255, 255, 255, .07);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 17, 23, .05);
  --shadow: 0 1px 3px rgba(16, 17, 23, .06), 0 1px 2px rgba(16, 17, 23, .04);
  --shadow-lg: 0 12px 32px -8px rgba(16, 17, 23, .18);
  --sidebar-w: 256px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; letter-spacing: -.01em; }
p { margin: 0; }
.icon { flex-shrink: 0; display: block; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; background: var(--sidebar-bg); color: var(--sidebar-text);
  display: flex; flex-direction: column; padding: 18px 14px; z-index: 40;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; color: #fff; font-weight: 700; font-size: 16px; }
.sidebar-brand:hover { color: #fff; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 4px 12px rgba(99, 102, 241, .35);
}
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #62667a; padding: 14px 12px 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--sidebar-text); font-weight: 500; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--sidebar-hover); color: #e7e8ee; }
.nav a.active { background: rgba(255, 255, 255, .09); color: var(--sidebar-active); }
.nav a.active .icon { color: #a5b4fc; }
.nav .count { margin-left: auto; font-size: 11.5px; padding: 1px 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); color: #c9ccd8; }
.sidebar-cta { margin: 16px 4px 0; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--sidebar-border); padding-top: 14px; }
.ai-pill { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .04); font-size: 12.5px; margin-bottom: 12px; color: #c9ccd8; }
.ai-pill:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.dot-off { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .18); }
.user-row { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.user-row .avatar { background: #262a36; color: #e2e4ec; }
.user-meta { min-width: 0; flex: 1; }
.user-meta strong { display: block; color: #e7e8ee; font-weight: 600; font-size: 13px; }
.user-meta span { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: 0; background: transparent; color: inherit; cursor: pointer;
}
.sidebar .icon-btn:hover { background: var(--sidebar-hover); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 64px; display: flex; align-items: center; gap: 12px;
  padding: 0 32px; background: rgba(246, 246, 248, .85); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .menu-btn { display: none; color: var(--text-2); }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; min-width: 0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs strong { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.content { padding: 28px 32px 56px; width: 100%; max-width: 1360px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 22px; font-weight: 700; }
.page-head p { color: var(--muted); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.scrim { display: none; }

@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .22s ease; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 17, 23, .4); z-index: 35; }
  .topbar { padding: 0 16px; }
  .topbar .menu-btn { display: inline-grid; }
  .content { padding: 20px 16px 48px; }
}

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2 { font-size: 15px; font-weight: 600; }
.card-head p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card-body { padding: 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.grid { display: grid; gap: 16px; }
.kpi-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.split { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); margin-bottom: 16px; }
.split-even { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-bottom: 16px; }
.detail { display: grid; gap: 16px; grid-template-columns: 340px minmax(0, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.kpi-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1200px) { .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .split, .split-even, .detail { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .kpi-grid { grid-template-columns: minmax(0, 1fr); } }

/* KPI tile */
.kpi { padding: 18px 20px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.kpi-label { color: var(--text-2); font-weight: 500; font-size: 13px; }
.kpi-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-hover); color: var(--text-2); }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.kpi-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 12.5px; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: 12px; padding: 2px 7px; border-radius: 99px; }
.delta-up { color: var(--success); background: var(--success-soft); }
.delta-down { color: var(--danger); background: var(--danger-soft); }
.delta-flat { color: var(--muted); background: var(--surface-hover); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-hover); color: var(--text); }
.btn:focus-visible, .icon-btn:focus-visible, .nav a:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(79, 70, 229, .3); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-hover); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-lg { height: 42px; padding: 0 18px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-group form { margin: 0; }

.segmented { display: inline-flex; padding: 3px; background: #ececf0; border-radius: 10px; gap: 2px; }
.segmented a { padding: 5px 12px; border-radius: 7px; color: var(--text-2); font-weight: 500; font-size: 12.5px; }
.segmented a:hover { color: var(--text); }
.segmented a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }

/* ---------- Badges / avatars ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; box-shadow: none; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-success .dot { background: var(--success); }
.badge-neutral { background: var(--surface-hover); color: var(--text-2); }
.badge-neutral .dot { background: var(--muted); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-primary { background: var(--primary-soft); color: var(--primary); }

.avatar {
  width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; flex-shrink: 0; object-fit: cover;
  background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 13px;
}
.avatar-sm { width: 28px; height: 28px; border-radius: 8px; font-size: 11px; }
.avatar-lg { width: 56px; height: 56px; border-radius: 14px; font-size: 18px; }
.entity { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--text); }
.entity:hover { color: var(--text); }
.entity-text { min-width: 0; }
.entity-text > strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entity-text > span { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stars-inline { color: var(--star); letter-spacing: 1px; white-space: nowrap; }
.stars-off { color: #dcdce2; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 20px;
  background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 14px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.review-text { color: var(--text-2); max-width: 520px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.field label, .label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text); }
.field .hint, .hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; font-weight: 400; }
.opt { color: var(--muted); font-weight: 400; }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 110px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 36px; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; min-width: 0; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

.form-section { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; padding: 24px; border-bottom: 1px solid var(--border); }
.form-section:last-of-type { border-bottom: 0; }
.form-section-info h3 { font-size: 14px; font-weight: 600; }
.form-section-info p { color: var(--muted); font-size: 13px; margin-top: 4px; }
@media (max-width: 900px) { .form-section { grid-template-columns: minmax(0, 1fr); gap: 14px; } }

.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { position: relative; width: 38px; height: 22px; border-radius: 99px; background: #d4d4da; flex-shrink: 0; transition: background .15s; margin-top: 1px; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px var(--primary-ring); }
.switch-text strong { display: block; font-weight: 600; font-size: 13px; }
.switch-text span { color: var(--muted); font-size: 12.5px; }

.file-drop { display: flex; align-items: center; gap: 14px; }
.file-drop input[type=file] { font: inherit; font-size: 13px; color: var(--text-2); }
.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }

.radio-cards { display: grid; gap: 10px; }
.radio-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s, background .15s; }
.radio-card:hover { background: var(--surface-2); }
.radio-card input { margin-top: 3px; accent-color: var(--primary); }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary) inset; }
.radio-card strong { display: block; font-size: 13.5px; }
.radio-card span { color: var(--muted); font-size: 12.5px; }
.radio-card code { font-size: 11.5px; color: var(--text-2); }

.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- Alerts / toasts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px; border: 1px solid; }
.alert-error { background: var(--danger-soft); color: #991b1b; border-color: #fecaca; }
.alert-success { background: var(--success-soft); color: #166534; border-color: #bbf7d0; }
.alert-warning { background: var(--warning-soft); color: #92400e; border-color: #fde68a; }
.alert-info { background: var(--primary-soft); color: #3730a3; border-color: #c7d2fe; }
.alert a { color: inherit; font-weight: 600; text-decoration: underline; }
.mb { margin-bottom: 16px; }

.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px 12px 16px; border-radius: var(--radius); background: #111216; color: #fff; box-shadow: var(--shadow-lg);
  font-weight: 500; font-size: 13.5px; animation: toast-in .25s ease; max-width: calc(100vw - 32px);
}
.toast .icon { color: #4ade80; }
.toast.toast-error .icon { color: #f87171; }
.toast .icon-btn { width: 26px; height: 26px; color: #9ca3af; }
.toast .icon-btn:hover { color: #fff; }
.toast.hide { opacity: 0; transform: translateY(8px); transition: all .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Tabs / toolbar / pagination ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.on { color: var(--text); border-color: var(--primary); font-weight: 600; }
.tabs .count { font-size: 11.5px; padding: 0 7px; border-radius: 99px; background: var(--surface-hover); color: var(--text-2); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.toolbar .input-icon { flex: 1; min-width: 200px; max-width: 360px; }
.toolbar .select { width: auto; min-width: 140px; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.empty { text-align: center; padding: 56px 24px; }
.empty-icon { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.empty h3 { font-size: 16px; font-weight: 600; }
.empty p { color: var(--muted); margin: 6px auto 18px; max-width: 380px; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.list-item:last-child { border-bottom: 0; }
.list-main { min-width: 0; flex: 1; }
.list-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.list-top strong { font-weight: 600; font-size: 13.5px; }
.list-item .review-text { margin-top: 4px; font-size: 13px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 3px 9px; border-radius: 6px; background: var(--surface-hover); color: var(--text-2); font-size: 12px; font-weight: 500; }

/* ---------- Charts ---------- */
.chart-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12.5px; color: var(--text-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.chart { position: relative; height: 300px; margin-top: 12px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .axis-text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart-tooltip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 150px; padding: 10px 12px; border-radius: 10px;
  background: #111216; color: #fff; font-size: 12px; box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .1s;
}
.chart-tooltip.show { opacity: 1; }
.chart-tooltip .tt-date { color: #a3a7b7; margin-bottom: 6px; font-weight: 500; }
.chart-tooltip .tt-row { display: flex; align-items: center; gap: 8px; }
.chart-tooltip .tt-row + .tt-row { margin-top: 3px; }
.chart-tooltip .tt-row i { width: 8px; height: 8px; border-radius: 50%; }
.chart-tooltip .tt-row b { margin-left: auto; padding-left: 14px; font-variant-numeric: tabular-nums; }
.chart-table { margin-top: 12px; font-size: 12.5px; }
.chart-table summary { cursor: pointer; color: var(--muted); font-weight: 500; }
.chart-table summary:hover { color: var(--text); }
.chart-table .table-wrap { max-height: 260px; overflow: auto; margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.chart-table .table th, .chart-table .table td { padding: 6px 12px; }

.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13px; }
.bar-row .bar-label { color: var(--text-2); font-weight: 500; white-space: nowrap; }
.bar-track { height: 10px; background: var(--surface-hover); border-radius: 0 4px 4px 0; }
.bar-fill { height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-row .bar-value { text-align: right; white-space: nowrap; min-width: 72px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.big-rating { display: flex; align-items: baseline; gap: 8px; margin-bottom: 18px; }
.big-rating strong { font-size: 36px; font-weight: 700; letter-spacing: -.02em; }

.funnel { display: grid; gap: 14px; }
.funnel-step .funnel-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.funnel-step .funnel-top span { color: var(--text-2); font-weight: 500; }
.funnel-step .funnel-top b { font-variant-numeric: tabular-nums; }
.funnel-track { height: 8px; border-radius: 0 4px 4px 0; background: var(--surface-hover); }
.funnel-fill { height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }

/* ---------- QR ---------- */
.qr-frame { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: grid; place-items: center; }
.qr-frame img { width: 100%; max-width: 220px; border-radius: 8px; background: #fff; padding: 8px; box-shadow: var(--shadow); }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side {
  position: relative; overflow: hidden; padding: 48px; color: #fff; display: flex; flex-direction: column;
  background: radial-gradient(1200px 600px at -10% -10%, #312e81 0, transparent 60%), radial-gradient(900px 500px at 110% 110%, #4c1d95 0, transparent 55%), #0f1117;
}
.auth-side .sidebar-brand { padding: 0; }
.auth-quote { margin-top: auto; max-width: 440px; }
.auth-quote h2 { font-size: 30px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
.auth-quote p { color: #b4b8c9; margin-top: 12px; font-size: 15px; }
.auth-stats { display: flex; gap: 28px; margin-top: 32px; }
.auth-stats b { display: block; font-size: 22px; }
.auth-stats span { color: #9ca0b3; font-size: 12.5px; }
.auth-main { display: grid; place-items: center; padding: 32px 16px; background: var(--surface); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 24px; font-weight: 700; }
.auth-card > p { color: var(--muted); margin: 6px 0 24px; }
.auth-card .field { margin-bottom: 16px; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-side { display: none; } }

/* ---------- AI suggest / provider panels ---------- */
.ai-suggest { margin-top: 14px; }
.ai-suggest .hint { margin-top: 8px; }
.provider-panel[hidden] { display: none; }
.provider-cards { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 720px) { .provider-cards { grid-template-columns: minmax(0, 1fr); } }
