/* Voxa console. Builds on voxa.css tokens. */
body.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; background: var(--bg); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* Sidebar */
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 14px; background: var(--ink); color: #D9D5CD; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; color: var(--bg); }
.side-brand span { font-family: var(--font-display); font-size: 26px; line-height: 1; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px; color: rgba(245,241,234,.66); transition: background-color var(--t-fast) ease, color var(--t-fast) ease; }
@media (hover: hover) and (pointer: fine) { .side-nav a:hover { background: rgba(245,241,234,.06); color: var(--bg); } }
.side-nav a[aria-current='page'] { background: rgba(245,241,234,.1); color: var(--bg); }
.side-nav a[aria-current='page']::before { content: ''; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.side-badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; display: grid; place-items: center; font-weight: 600; }
.side-foot { margin-top: auto; display: grid; gap: 16px; padding: 0 6px; }
.side-org { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: rgba(245,241,234,.05); font-size: 13px; }
.side-org .muted { color: rgba(245,241,234,.5); font-size: 12px; }
.org-dot { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--teal); color: #fff; font-size: 12px; font-weight: 600; }
.side-db { padding-left: 6px; color: rgba(245,241,234,.7); }

/* Main */
.main { min-width: 0; padding: 22px clamp(16px, 3vw, 36px) 40px; }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.top-kicker { font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.top-title { font-family: var(--font-display); font-weight: 400; font-size: 44px; line-height: 1.05; letter-spacing: -.02em; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); width: 300px; transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease; }
.search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(21,23,28,.06); }
.search input { border: 0; outline: 0; background: none; width: 100%; font-size: 14px; color: var(--ink); }

.view[data-entering] { animation: viewIn 380ms var(--ease-out); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.kpi { padding: 18px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.kpi p { font-size: 13px; color: var(--muted); }
.kpi b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 46px; line-height: 1.1; letter-spacing: -.02em; }
.delta { font-size: 12px; color: var(--muted); }
.delta.up { color: var(--teal); }
.delta.up::before { content: '↑ '; }

.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; margin-bottom: 12px; }
.panel-box { padding: 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.box-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.box-head h2 { font-family: var(--font-ui); font-size: 15px; font-weight: 600; letter-spacing: -.01em; max-width: none; line-height: 1.3; }
.link { font-size: 13px; color: var(--accent-deep); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.lg-a { background: var(--accent); }
.lg-b { background: #E3DDD2; }

/* Bar chart */
.chart { position: relative; height: 240px; display: grid; grid-template-columns: repeat(12, 1fr); gap: 10px; align-items: end; padding: 0 2px 26px; }
.chart::before { content: ''; position: absolute; inset: 0 0 26px; background: repeating-linear-gradient(to top, transparent 0 calc(25% - 1px), var(--line) calc(25% - 1px) 25%); pointer-events: none; }
.col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; }
.col i { display: block; border-radius: 5px; transform-origin: bottom; transition: transform 800ms var(--ease-out), opacity var(--t-fast) ease; }
.col .b-conn { background: linear-gradient(var(--accent), #EE8A68); }
.col .b-miss { background: #E3DDD2; }
.col[data-pre] i { transform: scaleY(0.02); }
.col span { position: absolute; bottom: -24px; left: 0; right: 0; text-align: center; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.col .tip { position: absolute; bottom: calc(100% + 8px); left: 50%; z-index: 2; transform: translate(-50%, 4px); opacity: 0; pointer-events: none; white-space: nowrap; padding: 6px 9px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: 12px; transition: opacity 150ms ease, transform 150ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .chart:hover .col i { opacity: .45; }
  .chart .col:hover i { opacity: 1; }
  .col:hover .tip { opacity: 1; transform: translate(-50%, 0); }
}

/* Donut */
.donut-wrap { position: relative; width: 170px; height: 170px; margin: 4px auto 16px; }
.donut { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut circle { fill: none; stroke-width: 14; transition: stroke-dasharray 1100ms var(--ease-out); }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center b { font-family: var(--font-display); font-weight: 400; font-size: 38px; line-height: 1; }
.donut-center span { font-size: 12px; color: var(--muted); }
.outcome-list { display: grid; gap: 8px; }
.outcome-list li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.outcome-list i { width: 10px; height: 10px; border-radius: 3px; }
.outcome-list b { margin-left: auto; font-weight: 600; }

/* Needs attention */
.needs { display: grid; }
.needs li { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 4px; border-top: 1px solid var(--line); cursor: pointer; border-radius: 10px; transition: background-color var(--t-fast) ease; }
.needs li:first-child { border-top: 0; }
@media (hover: hover) and (pointer: fine) { .needs li:hover { background: var(--bg); } }
.needs .why { font-size: 13px; color: var(--muted); }
.needs .who { font-weight: 600; font-size: 14px; }

/* Pills (outcomes) */
.pill { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.o-booked { background: var(--teal-soft); color: var(--teal); }
.o-callback { background: var(--accent-soft); color: var(--accent-deep); }
.o-interested { background: #E8E1F5; color: #5B3FA0; }
.o-not { background: #EEEAE3; color: #6E6960; }
.o-noanswer { background: transparent; color: var(--muted); border: 1px dashed var(--line-2); }

/* Live */
.live-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.live-bar p { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.seg-toggle { display: flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.seg-toggle button { padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted); transition: background-color var(--t-fast) ease, color var(--t-fast) ease; }
.seg-toggle button[aria-pressed='true'] { background: var(--ink); color: var(--bg); }
.live-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 12px; }
.lcard { display: flex; flex-direction: column; padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); min-width: 0; transition: opacity 300ms ease, filter 300ms ease; }
.lcard[data-idle] { opacity: .55; }
.lcard .cc-head { margin-bottom: 12px; }
.lcard canvas { width: 100%; height: 40px; margin-bottom: 10px; }
.lcard .cc-transcript { height: 220px; }
.lcard .line { font-size: 13.5px; }
.lcard .cc-status.idle { background: var(--bg); color: var(--muted); }
.feed { display: grid; }
.feed li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 11px 4px; border-top: 1px solid var(--line); font-size: 14px; transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out), background-color 1.2s ease; }
.feed li:first-child { border-top: 0; }
.feed li[data-enter] { opacity: 0; transform: translateY(-6px); }
.feed li[data-fresh] { background: var(--accent-soft); }
.feed .mono { font-size: 12px; color: var(--muted); }

/* Calls table */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 500; transition: background-color var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease, transform var(--t-press) var(--ease-out); }
.chip:active { transform: scale(.97); }
.chip b { font-weight: 500; color: var(--muted); font-size: 12px; }
.chip[aria-pressed='true'] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip[aria-pressed='true'] b { color: rgba(245,241,234,.6); }
.table-wrap { border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); overflow: auto; }
table.calls { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 720px; }
.calls th { position: sticky; top: 0; text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.calls td { padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.calls tr:last-child td { border-bottom: 0; }
.calls tbody tr { cursor: pointer; transition: background-color 120ms ease; }
@media (hover: hover) and (pointer: fine) { .calls tbody tr:hover { background: var(--bg); } }
.calls tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.calls .num { text-align: right; font-family: var(--font-mono); font-size: 12.5px; }
.calls .ph { display: block; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.calls .nm { font-weight: 500; }
.lang-tag { font-family: var(--font-mono); font-size: 11px; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line-2); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* Campaigns */
.camp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.camp { padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 16px; }
.camp-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.camp h3 { font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1.1; }
.camp .muted { font-size: 13px; }
.status { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.st-run { background: var(--teal-soft); color: var(--teal); }
.st-sched { background: #EEEAE3; color: var(--ink-2); }
.st-done { background: transparent; border: 1px solid var(--line-2); color: var(--muted); }
.progress { height: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transform-origin: left; transform: scaleX(var(--p)); transition: transform 1s var(--ease-out); }
.progress[data-pre] i { transform: scaleX(0); }
.camp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.camp-stats div { padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.camp-stats p { font-size: 11.5px; color: var(--muted); }
.camp-stats b { font-size: 18px; font-weight: 600; }
.camp-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.camp-meta span { font-size: 12px; padding: 3px 9px; border-radius: 6px; background: var(--bg); color: var(--ink-2); }

.demo-note { margin-top: 28px; display: flex; justify-content: center; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }

/* Drawer */
.drawer-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(21,23,28,.32); opacity: 0; transition: opacity 280ms ease; }
.drawer-scrim[data-open] { opacity: 1; }
.drawer { position: fixed; z-index: 90; top: 0; right: 0; bottom: 0; width: min(520px, 100%); display: flex; flex-direction: column; background: var(--surface); box-shadow: -30px 0 80px -30px rgba(21,23,28,.4); transform: translateX(100%); transition: transform 420ms var(--ease-drawer); visibility: hidden; }
.drawer[data-open] { transform: none; visibility: visible; }
.drawer:not([data-open]) { transition: transform 260ms var(--ease-out), visibility 0s 260ms; }
.dr-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); transition: background-color var(--t-fast) ease, transform var(--t-press) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--bg); } }
.dr-body { flex: 1; overflow: auto; padding: 20px; display: grid; gap: 22px; align-content: start; }
.dr-h { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.dr-body p { font-size: 14.5px; color: var(--ink-2); }
.player { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-md); background: var(--bg); }
.play { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); }
.play .i-pause { display: none; }
.play[data-playing] .i-pause { display: block; }
.play[data-playing] .i-play { display: none; }
.scrub { position: relative; flex: 1; height: 36px; cursor: pointer; }
.scrub-bars, .scrub-fill { position: absolute; inset: 0; display: flex; align-items: center; gap: 2px; }
.scrub-bars i, .scrub-fill i { flex: 1; border-radius: 2px; background: var(--line-2); }
.scrub-fill { clip-path: inset(0 calc(100% - var(--p, 0%)) 0 0); }
.scrub-fill i { background: var(--accent); }
.dr-outcome { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-md); background: var(--teal-soft); }
.dr-outcome b { display: block; font-size: 15px; }
.dr-outcome span { font-size: 13px; color: var(--ink-2); }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.fields div { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); }
.fields dt { font-size: 11.5px; color: var(--muted); }
.fields dd { margin: 2px 0 0; font-size: 14px; font-weight: 500; }
.dr-transcript { display: grid; gap: 8px; }
.dr-transcript .line { max-width: 92%; }
.dr-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); }

/* Responsive */
@media (max-width: 1180px) {
  .live-grid { grid-template-columns: 1fr 1fr; }
  .live-grid .lcard:nth-child(3) { display: none; }
}
@media (max-width: 980px) {
  body.app { grid-template-columns: 1fr; padding-bottom: 72px; }
  .side { position: fixed; z-index: 60; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
  .side-brand, .side-foot { display: none; }
  .side-nav { grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
  .side-nav a { flex-direction: column; gap: 4px; padding: 8px 4px; font-size: 11.5px; }
  .side-nav a[aria-current='page']::before { display: none; }
  .side-badge { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 18px; height: 16px; font-size: 10px; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .camp-grid { grid-template-columns: 1fr; }
  .search { width: 100%; }
  .top-actions { width: 100%; }
}
@media (max-width: 680px) {
  .live-grid { grid-template-columns: 1fr; }
  .live-grid .lcard:nth-child(n+2) { display: none; }
  .top-title { font-size: 36px; }
  .kpi b { font-size: 36px; }
  .top-actions .btn span, .top-actions .btn { white-space: nowrap; }
  .camp-stats { grid-template-columns: repeat(2, 1fr); }
  .chart { gap: 5px; }
  .col span { font-size: 9.5px; }
  .fields { grid-template-columns: 1fr; }
}

/* Edge columns: anchor tooltips inward so they never overflow the page. */
.col:nth-child(-n+2) .tip { left: 0; transform: translate(0, 4px); }
.col:nth-last-child(-n+3) .tip { left: auto; right: 0; transform: translate(0, 4px); }
@media (hover: hover) and (pointer: fine) {
  .col:nth-child(-n+2):hover .tip, .col:nth-last-child(-n+3):hover .tip { transform: translate(0, 0); }
}
