/* styles.css — enterprise dashboard theme */
:root {
  --accent-hsl: 150 85% 55%;
  --accent: hsl(var(--accent-hsl));
  --accent-soft: hsl(var(--accent-hsl) / 0.14);
  --radius: 14px;
  --density: 1;
  --shadow: 0 10px 30px -12px rgba(0,0,0,.5);
  --font: "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif;
}

/* ---- dark (default) ---- */
[data-theme="dark"] {
  --bg: hsl(228 18% 8%);
  --bg-2: hsl(228 16% 10%);
  --surface: hsl(228 15% 12.5%);
  --surface-2: hsl(228 14% 15%);
  --elevated: hsl(228 14% 17%);
  --border: hsl(228 12% 100% / 0.08);
  --border-strong: hsl(228 12% 100% / 0.14);
  --text: hsl(228 20% 97%);
  --text-muted: hsl(228 12% 70%);
  --text-faint: hsl(228 10% 52%);
  --track: hsl(228 14% 22%);
  --grid: hsl(228 12% 100% / 0.06);
  --danger: hsl(8 80% 62%);
  --c1: var(--accent);
  --c2: hsl(220 80% 66%);
  --c3: hsl(300 65% 68%);
  --c4: hsl(38 90% 62%);
  --c5: hsl(190 70% 58%);
  --accent-fg: hsl(228 30% 9%);
}
/* ---- light ---- */
[data-theme="light"] {
  --bg: hsl(228 24% 96%);
  --bg-2: hsl(228 24% 94%);
  --surface: hsl(0 0% 100%);
  --surface-2: hsl(228 24% 98%);
  --elevated: hsl(0 0% 100%);
  --border: hsl(228 16% 12% / 0.10);
  --border-strong: hsl(228 16% 12% / 0.16);
  --text: hsl(228 28% 12%);
  --text-muted: hsl(228 12% 38%);
  --text-faint: hsl(228 10% 55%);
  --track: hsl(228 18% 90%);
  --grid: hsl(228 16% 12% / 0.07);
  --danger: hsl(8 72% 52%);
  --c1: var(--accent);
  --c2: hsl(220 78% 56%);
  --c3: hsl(300 55% 56%);
  --c4: hsl(38 82% 50%);
  --c5: hsl(190 65% 46%);
  --accent: color-mix(in oklab, hsl(var(--accent-hsl)) 70%, #06160d);
  --accent-fg: #ffffff;
  --shadow: 0 10px 30px -16px rgba(20,30,60,.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: -0.006em;
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }
.tnum, .kpi-value, .data-table td.ralign { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.muted-sm { color: var(--text-faint); font-size: 12px; }

/* ---------- app shell ---------- */
.app { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 232px; flex-shrink: 0; background: var(--bg-2);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  padding: 16px 12px; gap: 6px; transition: width .22s cubic-bezier(.22,1,.36,1);
}
.sidebar.collapsed { width: 68px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; position: relative; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; flex-shrink: 0; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -0.03em; }
.collapse-btn { margin-left: auto; background: none; border: none; color: var(--text-faint); cursor: pointer; padding: 4px; border-radius: 7px; display: grid; place-items: center; }
.collapse-btn:hover { background: var(--surface-2); color: var(--text); }
.sidebar.collapsed .brand { flex-direction: column; gap: 12px; padding: 6px 8px 14px; }
.sidebar.collapsed .collapse-btn { position: static; margin-left: 0; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-bottom { margin-top: auto; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px;
  background: none; border: none; color: var(--text-muted); cursor: pointer; font: inherit;
  font-size: 13.5px; font-weight: 500; text-align: left; width: 100%; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--text); }
.nav-item.active { box-shadow: inset 2px 0 0 var(--accent); }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
.upsell { margin-top: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px; }
.upsell-title { font-weight: 600; font-size: 13px; }
.upsell-sub { color: var(--text-faint); font-size: 11.5px; margin: 3px 0 9px; }
.upsell-bar { height: 5px; border-radius: 3px; background: var(--track); overflow: hidden; }
.upsell-bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.content { flex: 1; overflow-y: auto; padding: calc(24px * var(--density)); }

/* ---------- topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 0 24px; height: 64px;
  border-bottom: 1px solid var(--border); background: var(--bg); flex-shrink: 0;
}
.topbar-title h1 { font-size: 17px; }
.crumb { font-size: 11.5px; color: var(--text-faint); }
.topbar-search {
  margin-left: 8px; flex: 1; max-width: 420px; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0 11px; height: 38px; color: var(--text-faint);
}
.topbar-search input { flex: 1; background: none; border: none; outline: none; color: var(--text); font: inherit; font-size: 13px; }
.topbar-search input::placeholder { color: var(--text-faint); }
.topbar-search kbd { font-family: var(--font); font-size: 10.5px; color: var(--text-faint); border: 1px solid var(--border-strong); border-radius: 5px; padding: 1px 5px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn { position: relative; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; transition: .15s; }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 8px; }
.icon-btn:disabled { opacity: .4; cursor: default; }
.ping { position: absolute; top: 9px; right: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.btn { display: inline-flex; align-items: center; gap: 6px; border-radius: 10px; padding: 0 14px; height: 38px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: .15s; white-space: nowrap; }
.btn-primary { background: var(--accent); color: var(--accent-fg); border-color: transparent; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn.is-disabled { opacity: .45; pointer-events: none; }
.btn-danger { background: hsl(8 80% 60% / .12); color: var(--danger); border-color: transparent; }
.btn-danger:hover { background: hsl(8 80% 60% / .2); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--c2), var(--c3)); color: #fff; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; flex-shrink: 0; }
.btn-active { border-color: var(--border-strong); background: var(--surface-2); }

/* ---------- dropdown menu ---------- */
.menu-wrap { position: relative; }
.menu { position: absolute; top: calc(100% + 8px); left: 0; min-width: 200px; background: var(--elevated); border: 1px solid var(--border-strong); border-radius: 12px; padding: 6px; box-shadow: var(--shadow); z-index: 60; animation: menu-in .14s ease-out; }
.menu-right { left: auto; right: 0; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: none; color: var(--text); font: inherit; font-size: 13px; padding: 9px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--surface-2); }
.menu-item span { flex: 1; }
.menu-label { font-size: 11px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: .04em; padding: 6px 10px 4px; }
.profile-item { gap: 11px; }
.profile-item span { flex: none; }
.profile-av { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0; }
.profile-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.profile-name { font-size: 13px; font-weight: 600; color: var(--text); }
.profile-role { font-size: 11.5px; color: var(--text-faint); }
.profile-item.active { background: var(--surface-2); }

/* ---------- modal ---------- */
.modal-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(8,10,14,.6); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fade-in .15s ease-out; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal { width: 100%; background: var(--elevated); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: 0 24px 70px -20px rgba(0,0,0,.6); overflow: hidden; animation: modal-pop .18s cubic-bezier(.22,1,.36,1); }
@keyframes modal-pop { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 0; }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border); background: var(--surface); }
.modal-input, .modal-select select { width: 100%; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; color: var(--text); font: inherit; font-size: 14px; outline: none; transition: border-color .15s; }
.modal-input:focus, .modal-select select:focus { border-color: var(--accent); }
.modal-select { position: relative; display: flex; align-items: center; }
.modal-select select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 32px; }
.modal-select svg { position: absolute; right: 11px; pointer-events: none; }
.modal-select select option { background: var(--elevated); }
.viz-row { display: flex; gap: 8px; }
.viz-opt { flex: 1; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); font: inherit; font-size: 13px; font-weight: 600; padding: 9px; border-radius: 10px; cursor: pointer; transition: .15s; }
.viz-opt:hover { color: var(--text); }
.viz-opt.active { background: var(--accent); color: var(--accent-fg); border-color: transparent; }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 210; display: flex; align-items: center; gap: 8px; background: var(--elevated); border: 1px solid var(--border-strong); color: var(--text); font-size: 13.5px; font-weight: 500; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow); animation: toast-up .25s cubic-bezier(.22,1,.36,1); }
.toast svg { color: var(--accent); }
@keyframes toast-up { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
.menu-hint { font-family: var(--font); font-size: 10.5px; color: var(--text-faint); border: 1px solid var(--border-strong); border-radius: 5px; padding: 1px 5px; }
.menu-sep { height: 1px; background: var(--border); margin: 5px 2px; }

/* ---------- inline selects (currency / rows) ---------- */
.cur-select { position: relative; display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 0 8px 0 10px; height: 32px; color: var(--text-muted); }
.cur-select .cur-sym { font-weight: 700; color: var(--text); font-size: 13px; }
.cur-select select { appearance: none; -webkit-appearance: none; background: none; border: none; color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; padding: 0 2px; cursor: pointer; outline: none; }
.cur-select select option { background: var(--elevated); color: var(--text); }

/* ---------- segmented ---------- */
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg-btn { background: none; border: none; color: var(--text-muted); font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 7px; cursor: pointer; transition: .15s; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--surface-2); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
[data-theme="dark"] .seg-btn.active { background: var(--elevated); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: calc(20px * var(--density)); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; gap: 12px; }
.card-head h3, .table-head h3 { font-size: 15px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* ---------- overview bar ---------- */
.overview-bar { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.ob-greeting { display: block; font-size: 20px; font-weight: 600; letter-spacing: -0.025em; }
.ob-right { display: flex; align-items: center; gap: 8px; }

/* ---------- KPI ---------- */
.kpi-grid { display: grid; gap: calc(16px * var(--density)); margin-bottom: calc(16px * var(--density)); }
.kpi { display: flex; flex-direction: column; gap: 10px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); position: relative; }
.live-dot::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 1px solid var(--accent); animation: ping 1.8s ease-out infinite; }
@keyframes ping { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(1.8); opacity: 0; } }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; }
[data-density="compact"] .kpi-value { font-size: 24px; }
.kpi-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 3px 7px; border-radius: 7px; }
.delta.up { color: var(--accent); background: var(--accent-soft); }
.delta.down { color: var(--danger); background: hsl(8 80% 62% / .14); }
.kpi-spark { opacity: .9; }

/* ---------- layouts ---------- */
.layout-classic { display: flex; flex-direction: column; gap: calc(16px * var(--density)); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: calc(16px * var(--density)); }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(16px * var(--density)); }

.layout-focus { display: grid; grid-template-columns: 2fr 1fr; gap: calc(16px * var(--density)); grid-template-areas: "main side" "row row" "table table"; }
.focus-main { grid-area: main; }
.focus-side { grid-area: side; display: grid; grid-template-columns: 1fr 1fr; gap: calc(16px * var(--density)); align-content: start; }
.focus-row { grid-area: row; display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(16px * var(--density)); }
.focus-table { grid-area: table; }

.layout-bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: calc(16px * var(--density)); grid-auto-rows: minmax(0, auto); }
.layout-bento .b-kpi { grid-column: span 1; }
.layout-bento .b-chart { grid-column: span 2; grid-row: span 2; }
.layout-bento .b-donut { grid-column: span 2; }
.layout-bento .b-bars { grid-column: span 2; }
.layout-bento .b-funnel { grid-column: span 4; }
.layout-bento .b-table { grid-column: span 4; }
.layout-bento .card { height: 100%; }

/* ---------- table ---------- */
.table-card { padding: 0; overflow: hidden; }
.table-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; gap: 14px; flex-wrap: wrap; }
.table-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); font: inherit; font-size: 12px; font-weight: 500; padding: 5px 11px; border-radius: 20px; cursor: pointer; transition: .15s; }
.chip:hover { color: var(--text); }
.chip.active { background: var(--accent); color: var(--accent-fg); border-color: transparent; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 10px 16px; color: var(--text-faint); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.data-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.data-table th.sortable:hover { color: var(--text-muted); }
.data-table th.sorted { color: var(--text); }
.data-table th span { display: inline-flex; align-items: center; }
.data-table th.ralign span { justify-content: flex-end; }
.data-table td { padding: 11px 16px; border-bottom: 1px solid var(--border); }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table .ralign { text-align: right; }
.data-table .strong { font-weight: 600; }
.acct { display: flex; align-items: center; gap: 10px; }
.acct-logo { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--accent-fg); flex-shrink: 0; }
.acct-name { font-weight: 600; }
.acct-id { font-size: 11px; color: var(--text-faint); }
.plan-tag { font-size: 11.5px; font-weight: 600; color: var(--text-muted); border: 1px solid var(--border-strong); padding: 2px 8px; border-radius: 6px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 20px; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { color: var(--accent); background: var(--accent-soft); }
.badge-info { color: var(--c2); background: hsl(220 80% 66% / .14); }
.badge-warn { color: var(--c4); background: hsl(38 90% 62% / .15); }
.badge-muted { color: var(--text-faint); background: var(--track); }
.badge-danger { color: var(--danger); background: hsl(8 80% 60% / .14); }
.data-table td.neg { color: var(--danger); }
.modal-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.health { display: flex; align-items: center; gap: 8px; }
.health-track { width: 56px; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.health-track span { display: block; height: 100%; border-radius: 3px; }
.health-num { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; width: 20px; }
.empty-row { text-align: center; color: var(--text-faint); padding: 36px !important; }
.table-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid var(--border); gap: 14px; flex-wrap: wrap; }
.foot-left { display: flex; align-items: center; gap: 12px; }
.pager { display: flex; gap: 6px; align-items: center; }
.pager-num { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; background: none; border: 1px solid transparent; color: var(--text-muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: .12s; font-variant-numeric: tabular-nums; }
.pager-num:hover { background: var(--surface-2); color: var(--text); }
.pager-num.active { background: var(--accent); color: var(--accent-fg); }
.pager-gap { color: var(--text-faint); padding: 0 2px; }

.ph-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--surface-2); color: var(--text-muted); display: grid; place-items: center; margin: 0 auto; }

/* ---------- page stat row ---------- */
.page-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: calc(16px * var(--density)); }
.pstat { display: flex; flex-direction: column; gap: 5px; }
.pstat-label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.pstat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.pstat-value.accent { color: var(--accent); }
.pstat-sub { font-size: 12px; color: var(--text-faint); }

/* ---------- customers grid ---------- */
.cust-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; padding: 20px; }
.cust-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 16px; transition: .15s; }
.cust-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.cust-top { display: flex; align-items: center; gap: 11px; }
.cust-avatar { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--accent-fg); flex-shrink: 0; }
.cust-id { min-width: 0; flex: 1; }
.cust-name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-role { font-size: 12px; color: var(--text-faint); }
.cust-more { background: none; border: none; opacity: 0; transition: opacity .15s; }
.cust-card:hover .cust-more { opacity: 1; }
.cust-meta { display: flex; align-items: center; gap: 7px; margin-top: 14px; font-size: 13px; color: var(--text-muted); }
.cust-meta svg { color: var(--text-faint); }
.cust-email { font-size: 12.5px; color: var(--text-faint); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--border); }

/* ---------- products grid ---------- */
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: calc(16px * var(--density)); }
.prod-card { display: flex; flex-direction: column; gap: 16px; }
.prod-head { display: flex; align-items: flex-start; gap: 12px; }
.prod-mark { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.prod-title { flex: 1; min-width: 0; }
.prod-title h3 { font-size: 16px; }
.prod-metrics { display: flex; align-items: center; gap: 14px; }
.prod-mrr { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; }
.prod-spark { margin-left: auto; opacity: .9; }
.prod-adopt { display: flex; flex-direction: column; gap: 7px; }
.prod-adopt-row { display: flex; justify-content: space-between; align-items: center; }
.prod-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--border); }
.link-btn { display: inline-flex; align-items: center; gap: 3px; background: none; border: none; color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.link-btn:hover { gap: 6px; }

/* ---------- settings ---------- */
.settings-page { max-width: 920px; }
.settings-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.settings-save { flex-shrink: 0; gap: 7px; }
.settings-save.is-saved { background: var(--accent-soft); color: var(--accent); }
.settings-head h2 { font-size: 24px; }
.settings-head p { margin-top: 6px; }
.settings-group { display: grid; grid-template-columns: 260px 1fr; gap: 28px; padding: 28px 0; border-top: 1px solid var(--border); }
.settings-group:first-of-type { border-top: none; padding-top: 0; }
.settings-aside-h { display: flex; align-items: center; gap: 10px; }
.settings-aside-h h3 { font-size: 15.5px; }
.settings-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); color: var(--text-muted); display: grid; place-items: center; flex-shrink: 0; }
.settings-aside p { margin-top: 10px; line-height: 1.5; }
.settings-body { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.settings-body input, .select-box select { width: 100%; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; color: var(--text); font: inherit; font-size: 14px; outline: none; transition: border-color .15s; }
.settings-body input:focus, .select-box select:focus { border-color: var(--accent); }
.settings-body input:disabled { color: var(--text-faint); cursor: not-allowed; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-grid .field:first-child { grid-column: 1 / -1; }
.select-box { position: relative; display: flex; align-items: center; }
.select-box select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 32px; }
.select-box svg { position: absolute; right: 11px; pointer-events: none; }
.select-box select option { background: var(--elevated); }
.setting-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.setting-line + .setting-line { padding-top: 18px; border-top: 1px solid var(--border); }
.sl-title { font-size: 14px; font-weight: 600; }
.switch { width: 42px; height: 24px; border-radius: 13px; background: var(--track); border: none; padding: 0; cursor: pointer; position: relative; transition: background .18s; flex-shrink: 0; }
.switch.on { background: var(--accent); }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .18s cubic-bezier(.22,1,.36,1); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch.on .switch-knob { transform: translateX(18px); }
.accent-swatches { display: flex; gap: 8px; }
.swatch { width: 30px; height: 30px; border-radius: 9px; border: 2px solid transparent; cursor: pointer; display: grid; place-items: center; color: var(--accent-fg); transition: transform .12s; }
.swatch:hover { transform: scale(1.08); }
.swatch.active { border-color: var(--text); }
.profile-row { display: flex; align-items: center; gap: 16px; }
.settings-avatar { width: 56px; height: 56px; border-radius: 14px; background: linear-gradient(135deg, var(--c2), var(--c3)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px; flex-shrink: 0; }
.plan-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.plan-name { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.usage-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.usage-v { font-size: 20px; font-weight: 700; margin-top: 3px; }
.usage-v span { font-size: 13px; font-weight: 500; }
.btn-danger { color: var(--danger); border-color: hsl(8 80% 62% / 0.3); }
.btn-danger:hover { background: hsl(8 80% 62% / 0.1); border-color: var(--danger); }

.scrim { display: none; }
.only-mobile { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .layout-focus { grid-template-columns: 1fr; grid-template-areas: "main" "side" "row" "table"; }
  .focus-side { grid-template-columns: repeat(4, 1fr); }
  .topbar-search { display: none; }
  .three-col, .focus-row { grid-template-columns: repeat(2, 1fr); }
  .layout-bento { grid-template-columns: repeat(2, 1fr); }
  .layout-bento .b-chart, .layout-bento .b-donut, .layout-bento .b-bars, .layout-bento .b-funnel, .layout-bento .b-table { grid-column: span 2; }
  .layout-bento .b-chart { grid-row: auto; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; z-index: 40; height: 100%; box-shadow: var(--shadow); }
  .app.is-collapsed .sidebar { transform: translateX(-100%); width: 232px; }
  .sidebar.collapsed { transform: translateX(-100%); }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 30; }
  .only-mobile { display: grid; }
  .topbar-search { display: none; }
  .kpi-grid { grid-template-columns: 1fr 1fr !important; }
  .page-stats { grid-template-columns: 1fr 1fr; }
  .settings-group { grid-template-columns: 1fr; gap: 16px; }
  .two-col, .three-col, .focus-row { grid-template-columns: 1fr; }
  .focus-side { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 16px; gap: 10px; }
  .topbar-actions { gap: 7px; }
  /* collapse just the New report button to its icon */
  .btn-newreport span { display: none; }
  .btn-newreport { padding: 0 11px; }
  .overview-bar { align-items: flex-start; }
}
@media (max-width: 640px) {
  .modal { max-width: none !important; }
  .modal-grid2 { grid-template-columns: 1fr; }
  .cust-grid { grid-template-columns: 1fr; padding: 14px; }
  .btn-export-label { display: none; }
  .btn-export { padding: 0 11px; }
  .crumb { display: none; }
  .topbar-title h1 { font-size: 16px; }
  .ob-right { flex-wrap: wrap; }
  .table-head { gap: 10px; }
  .table-filters { width: 100%; }
}
@media (max-width: 560px) {
  .content { padding: 14px; }
  .kpi-grid { grid-template-columns: 1fr !important; }
  .page-stats { grid-template-columns: 1fr; }
  .focus-side { grid-template-columns: 1fr; }
  .field-grid, .usage-row { grid-template-columns: 1fr; }
  .toast { left: 14px; right: 14px; transform: none; bottom: 14px; }
}

@media print {
  .sidebar, .topbar, .overview-bar .ob-right, #boot, .tweaks-fab, [data-tweaks-panel] { display: none !important; }
  .app, .main, .content { display: block; height: auto; overflow: visible; }
  .content { padding: 0; }
  body { background: #fff; }
  .card, .table-card { break-inside: avoid; box-shadow: none; }
  .kpi-grid { grid-template-columns: repeat(4, 1fr) !important; }
}
