/* CallingRoom dashboard: soft neumorphic theme (light + dark), org accent colour in --accent. */
:root {
  --bg: #e7ecf3;
  --surface: #e7ecf3;
  --sh-dark: #c4cbd6;
  --sh-light: #ffffff;
  --text: #253041;
  --text-2: #4a566a;
  --text-3: #5d687b;
  --line: rgba(37, 48, 65, .09);
  --grid: rgba(37, 48, 65, .10);
  --accent: #4f6bed;
  --accent-ink: #ffffff;
  --accent-soft: rgba(79, 107, 237, .14);
  --good: #1a7f37; --good-soft: rgba(26, 127, 55, .12);
  --warn: #9a5b00; --warn-soft: rgba(196, 122, 0, .14);
  --bad: #c0362c;  --bad-soft: rgba(192, 54, 44, .12);
  --info: #2f5fd0; --info-soft: rgba(47, 95, 208, .12);
  --series-1: #257de0;
  --series-2: #f47230;
  --raise: 7px 7px 16px var(--sh-dark), -7px -7px 16px var(--sh-light);
  --raise-sm: 4px 4px 9px var(--sh-dark), -4px -4px 9px var(--sh-light);
  --press: inset 4px 4px 8px var(--sh-dark), inset -4px -4px 8px var(--sh-light);
  --press-sm: inset 2px 2px 5px var(--sh-dark), inset -2px -2px 5px var(--sh-light);
  --radius: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #262b34; --surface: #262b34; --sh-dark: #1a1e25; --sh-light: #323843;
    --text: #e6eaf1; --text-2: #aab3c2; --text-3: #8f99a9; --line: rgba(230, 234, 241, .08); --grid: rgba(230, 234, 241, .10);
    --good: #5cc97a; --good-soft: rgba(92, 201, 122, .14); --warn: #f0b049; --warn-soft: rgba(240, 176, 73, .14);
    --bad: #ff7b6e; --bad-soft: rgba(255, 123, 110, .14); --info: #86a8ff; --info-soft: rgba(134, 168, 255, .14);
    --series-1: #3987e5; --series-2: #f47230;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #262b34; --surface: #262b34; --sh-dark: #1a1e25; --sh-light: #323843;
  --text: #e6eaf1; --text-2: #aab3c2; --text-3: #8f99a9; --line: rgba(230, 234, 241, .08); --grid: rgba(230, 234, 241, .10);
  --good: #5cc97a; --good-soft: rgba(92, 201, 122, .14); --warn: #f0b049; --warn-soft: rgba(240, 176, 73, .14);
  --bad: #ff7b6e; --bad-soft: rgba(255, 123, 110, .14); --info: #86a8ff; --info-soft: rgba(134, 168, 255, .14);
  --series-1: #3987e5; --series-2: #f47230;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.num-font, .num { font-variant-numeric: tabular-nums; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- neumorphic primitives ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--raise); padding: 20px; min-width: 0; overflow: hidden; }
.card h2 { margin: 0; font-size: 15px; font-weight: 650; }
.card .card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card .card-head .sub { color: var(--text-3); font-size: 12.5px; }
.card .card-head .grow { flex: 1; }
.well { background: var(--surface); border-radius: 14px; box-shadow: var(--press); padding: 12px 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer;
  background: var(--surface); box-shadow: var(--raise-sm); border-radius: 12px; padding: 9px 16px; font-weight: 600;
  color: var(--text); transition: box-shadow .15s, transform .05s; white-space: nowrap;
}
.btn:hover { color: var(--accent); }
.btn:active, .btn[aria-pressed="true"] { box-shadow: var(--press-sm); color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--raise-sm); }
.btn.primary:hover { filter: brightness(1.06); color: var(--accent-ink); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 10px; }
.btn.icon-only { padding: 9px; border-radius: 50%; }
.btn:disabled { opacity: .55; cursor: default; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid transparent; background: var(--surface); box-shadow: var(--press-sm);
  border-radius: 12px; padding: 10px 13px; outline: none; min-width: 0; font-weight: 400; color: var(--text);
}
.input:focus { border-color: var(--accent); }
textarea.input { resize: vertical; min-height: 110px; line-height: 1.45; }
label.field { display: grid; gap: 6px; align-content: start; font-size: 13px; font-weight: 600; color: var(--text-2); }
label.field small { font-weight: 400; color: var(--text-3); }
.seg { display: inline-flex; gap: 4px; padding: 5px; border-radius: 14px; box-shadow: var(--press-sm); flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: var(--raise-sm); color: var(--accent); }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; padding: 22px 16px; display: flex; flex-direction: column; gap: 18px;
  overflow-y: auto; z-index: 30; background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px; }
.brand .logo {
  width: 44px; height: 44px; border-radius: 14px; box-shadow: var(--raise-sm); display: grid; place-items: center;
  background: var(--surface); overflow: hidden; flex: none; color: var(--accent); font-weight: 800; font-size: 18px;
}
.brand .logo img { width: 100%; height: 100%; object-fit: contain; }
.brand b { display: block; font-size: 15px; line-height: 1.2; }
.brand span { font-size: 12px; color: var(--text-3); }
.nav { display: grid; gap: 6px; }
.nav .group { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 10px 12px 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; text-decoration: none;
  color: var(--text-2); font-weight: 600;
}
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { box-shadow: var(--press); color: var(--accent); }
.nav a .badge { margin-left: auto; font-size: 11.5px; padding: 1px 8px; border-radius: 99px; background: var(--bad-soft); color: var(--bad); }
.side .foot { margin-top: auto; display: grid; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; box-shadow: var(--raise-sm); }
.me .who { min-width: 0; flex: 1; }
.me b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me span { font-size: 12px; color: var(--text-3); }

.main { padding: 22px 28px 48px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.topbar .titles { flex: 1; min-width: 200px; }
.topbar h1 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.topbar .subtitle { color: var(--text-3); font-size: 13px; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters .input { width: auto; padding: 8px 12px; }
.menu-btn { display: none; }
.scrim { display: none; }

.grid { display: grid; gap: 22px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.span-2 { grid-column: span 2; }
.stack { display: grid; gap: 22px; }

@media (max-width: 1100px) {
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-21 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; width: 272px; transform: translateX(-105%); transition: transform .2s; box-shadow: var(--raise); }
  .side.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .25); z-index: 25; }
  .menu-btn { display: inline-flex; }
  .main { padding: 16px 16px 40px; }
  .g-2, .g-3 { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .topbar h1 { font-size: 20px; }
}

/* ---------- hero + KPIs ---------- */
.hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 26px; align-items: center; }
.ring { position: relative; width: 150px; height: 150px; border-radius: 50%; box-shadow: var(--raise); display: grid; place-items: center; }
.ring svg { position: absolute; inset: 10px; width: 130px; height: 130px; transform: rotate(-90deg); }
.ring .c { text-align: center; }
.ring .c b { font-size: 30px; display: block; line-height: 1.1; }
.ring .c span { font-size: 12px; color: var(--text-3); }
.hero .lbl { font-size: 12.5px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.hero h3 { margin: 4px 0 14px; font-size: 18px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.hero-stats .well .l { font-size: 12px; color: var(--text-3); }
.hero-stats .well .v { font-size: 21px; font-weight: 700; }
.hero-stats .well .s { font-size: 11.5px; color: var(--text-3); min-height: 1.4em; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; box-shadow: var(--raise-sm); font-size: 12.5px; color: var(--text-2); }
.chip.alert { color: var(--bad); cursor: pointer; }
.chip svg.i { width: 15px; height: 15px; }
@media (max-width: 700px) {
  .hero { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); text-align: left; }
  .chips { justify-content: center; }
}

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1250px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }
.kpi { padding: 16px; }
.kpi .top { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.kpi .ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; box-shadow: var(--press-sm); color: var(--accent); flex: none; }
.kpi .ico svg.i { width: 16px; height: 16px; }
.kpi .v { font-size: 26px; font-weight: 750; margin: 8px 0 2px; letter-spacing: -.01em; }
.kpi .v small { font-size: 13px; color: var(--text-3); font-weight: 600; }
.kpi.alert .ico { color: var(--bad); }
.delta { font-size: 12px; font-weight: 600; }
.delta.up { color: var(--good); } .delta.down { color: var(--bad); } .delta.flat { color: var(--text-3); }

/* ---------- tables, lists, pills ---------- */
.table-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 700; padding: 8px 10px; white-space: nowrap; }
td { padding: 11px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
th.num, td.num { text-align: right; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--accent-soft); }
tr.click:hover td:first-child { border-radius: 12px 0 0 12px; }
tr.click:hover td:last-child { border-radius: 0 12px 12px 0; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person b { display: block; white-space: nowrap; }
.person span { font-size: 12px; color: var(--text-3); }
.avatar { width: 34px; height: 34px; border-radius: 50%; box-shadow: var(--raise-sm); display: grid; place-items: center; font-weight: 700; font-size: 12.5px; color: var(--accent); flex: none; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--line); color: var(--text-2); white-space: nowrap; }
.pill svg.i { width: 13px; height: 13px; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.score { display: inline-grid; place-items: center; min-width: 32px; height: 32px; border-radius: 50%; font-weight: 750; font-size: 13px; box-shadow: var(--press-sm); }
.score.good { color: var(--good); } .score.warn { color: var(--warn); } .score.bad { color: var(--bad); } .score.none { color: var(--text-3); }
.progress { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.track { flex: 1; height: 10px; border-radius: 99px; box-shadow: var(--press-sm); overflow: hidden; }
.track .fill { height: 100%; border-radius: 99px; background: var(--accent); }
.progress span { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.list { display: grid; gap: 10px; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; box-shadow: var(--raise-sm); }
.row-item .body { flex: 1; min-width: 0; }
.row-item .body b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { font-size: 12px; color: var(--text-3); }
.overdue { color: var(--bad); font-weight: 600; }
.empty { color: var(--text-3); padding: 18px 4px; text-align: center; }
.banner { padding: 12px 14px; border-radius: 14px; box-shadow: var(--press-sm); color: var(--warn); margin-bottom: 18px; }
.banner.error { color: var(--bad); }
.more-line { text-align: center; color: var(--text-3); font-size: 12.5px; margin-top: 8px; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--text-3); font-size: 11px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tooltip { position: absolute; pointer-events: none; background: var(--surface); box-shadow: var(--raise); border-radius: 12px; padding: 9px 12px; font-size: 12.5px; min-width: 150px; z-index: 5; }
.tooltip .row { display: flex; gap: 8px; align-items: center; }
.tooltip .row span:last-child { margin-left: auto; font-weight: 700; }
.tooltip .sw { width: 9px; height: 9px; border-radius: 3px; }
.linkish { background: none; border: 0; color: var(--accent); cursor: pointer; font-weight: 600; font-size: 12.5px; padding: 0; }
.data-table { margin-top: 12px; }

.hbars { display: grid; gap: 12px; }
.hbar .top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.hbar .top b small { color: var(--text-3); font-weight: 500; margin-left: 6px; }
.hbar .track { margin-top: 6px; height: 12px; }
.hbar .ex { font-size: 12px; color: var(--text-3); margin-top: 4px; }

.funnel { display: grid; gap: 10px; }
.funnel .step { display: grid; grid-template-columns: 110px minmax(0, 1fr) 90px; gap: 12px; align-items: center; font-size: 13px; }
.funnel .bar { height: 30px; border-radius: 10px; box-shadow: var(--press-sm); overflow: hidden; }
.funnel .bar div { height: 100%; background: var(--series-1); border-radius: 10px; }
.funnel .val { text-align: right; } .funnel .val b { display: block; } .funnel .val span { color: var(--text-3); font-size: 12px; }

.heat { display: grid; grid-template-columns: 38px repeat(var(--cols), minmax(0, 1fr)); gap: 4px; font-size: 11px; }
.heat .hl { color: var(--text-3); display: grid; place-items: center; }
.heat .cell { aspect-ratio: 1.3; border-radius: 6px; box-shadow: var(--press-sm); position: relative; }
.heat .cell.has { box-shadow: none; }
.heat-scale { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); margin-top: 10px; }
.heat-scale i { width: 22px; height: 10px; border-radius: 3px; display: inline-block; }

.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 12px; }
.pipeline > div { padding: 12px; border-radius: 14px; box-shadow: var(--press-sm); text-align: center; }
.pipeline .n { font-size: 20px; font-weight: 750; }
.pipeline .l { font-size: 12px; color: var(--text-3); }
.pipeline .won .n { color: var(--good); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.tile { padding: 14px; border-radius: 16px; box-shadow: var(--press-sm); }
.tile .l { font-size: 12px; color: var(--text-3); }
.tile .v { font-size: 22px; font-weight: 750; }
.tile .s { font-size: 12px; color: var(--text-3); }
.tile.bad .v { color: var(--bad); } .tile.good .v { color: var(--good); }

.coach { padding: 12px; border-radius: 14px; box-shadow: var(--raise-sm); cursor: pointer; display: grid; gap: 6px; }
.coach .hd { display: flex; align-items: center; gap: 10px; }
.tip { display: flex; gap: 8px; font-size: 13px; }
.tip.good { color: var(--good); } .tip.try { color: var(--info); }
.tip span { color: var(--text); }

/* ---------- drawer / modal ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(15, 20, 30, .35); z-index: 50; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--bg); z-index: 51;
  box-shadow: -10px 0 30px rgba(0, 0, 0, .15); display: flex; flex-direction: column;
}
.dhead { padding: 22px 24px 16px; position: relative; }
.dhead h3 { margin: 0 0 4px; font-size: 20px; padding-right: 120px; }
.dhead .meta { padding-right: 120px; }
.dhead .pills { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.dhead .close { position: absolute; right: 18px; top: 18px; }
.dscore { position: absolute; right: 70px; top: 16px; text-align: center; }
.dscore .big { width: 52px; height: 52px; border-radius: 50%; box-shadow: var(--press); display: grid; place-items: center; font-size: 22px; font-weight: 800; }
.dscore span { font-size: 11px; color: var(--text-3); }
.drawer .body { padding: 6px 24px 28px; overflow-y: auto; display: grid; gap: 14px; align-content: start; }
.sec { padding: 14px 16px; border-radius: 16px; box-shadow: var(--raise-sm); }
.sec h4 { margin: 0 0 6px; font-size: 13px; color: var(--text-2); }
.sec.good h4 { color: var(--good); } .sec.try h4 { color: var(--info); }
.sec ul { margin: 0; padding-left: 18px; }
.sec audio { width: 100%; }
.transcript { white-space: pre-wrap; font-size: 12.5px; margin-top: 8px; max-height: 360px; overflow-y: auto; }

.modal { position: fixed; z-index: 51; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(520px, calc(100% - 32px)); max-height: calc(100% - 40px); overflow-y: auto; }
.modal form { display: grid; gap: 14px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 560px) { .form-grid { grid-template-columns: minmax(0, 1fr); } }
.secret { font-family: ui-monospace, Consolas, monospace; word-break: break-all; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; padding: 12px 18px; border-radius: 14px; background: var(--surface); box-shadow: var(--raise); font-weight: 600; }
.swatch { width: 40px; height: 40px; border-radius: 12px; border: 0; padding: 0; box-shadow: var(--raise-sm); cursor: pointer; }
.logo-preview { width: 72px; height: 72px; border-radius: 18px; box-shadow: var(--press); display: grid; place-items: center; overflow: hidden; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(400px, 100%); padding: 34px 30px; }
.login .brand { justify-content: center; margin-bottom: 8px; }
.login h1 { text-align: center; font-size: 22px; margin: 10px 0 4px; }
.login p { text-align: center; color: var(--text-3); margin: 0 0 22px; }
.login form { display: grid; gap: 16px; }
.login .error { color: var(--bad); font-size: 13px; min-height: 1.3em; text-align: center; }
