:root {
  color-scheme: light;
  --bg: #f3f6f9;
  --panel: #ffffff;
  --ink: #14212b;
  --muted: #667783;
  --line: #dbe4e9;
  --brand: #0d6c66;
  --brand-dark: #084c49;
  --brand-soft: #dff2ef;
  --warning: #9a5b00;
  --danger: #a52a2a;
  --shadow: 0 18px 48px rgba(25, 48, 61, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: inherit; }
.topbar { height: 70px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 5vw, 72px); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: white; background: var(--brand); font-size: 13px; }
.page { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 70px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.page-heading, .call-hero, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
h1, h2 { margin: 0; letter-spacing: -.035em; }
h1 { font-size: clamp(30px, 4vw, 48px); line-height: 1.03; }
h2 { font-size: 22px; }
p { line-height: 1.65; }
.eyebrow { color: var(--brand); font-size: 12px; text-transform: uppercase; letter-spacing: .13em; font-weight: 800; margin: 0 0 8px; }
.muted { color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; border-radius: 11px; border: 1px solid var(--line); background: white; color: var(--ink); font-weight: 700; cursor: pointer; text-decoration: none; }
.button-primary { border-color: var(--brand); background: var(--brand); color: white; }
.button-primary:hover { background: var(--brand-dark); }
.button-ghost { background: transparent; }
input { width: 100%; min-height: 44px; border: 1px solid #cbd8df; border-radius: 10px; padding: 10px 12px; font: inherit; color: inherit; background: white; }
input:focus { outline: 3px solid rgba(13,108,102,.15); border-color: var(--brand); }
label { display: grid; gap: 7px; font-weight: 700; }
.stack { display: grid; gap: 18px; margin-top: 28px; }
.login-shell { min-height: calc(100vh - 190px); display: grid; place-items: center; }
.login-card { width: min(460px, 100%); padding: clamp(26px, 5vw, 48px); }
.alert { padding: 12px 14px; border-radius: 10px; margin-top: 20px; }
.alert-error { color: var(--danger); background: #fff0f0; border: 1px solid #f2caca; }
.search { display: flex; gap: 8px; width: min(460px, 100%); }
.call-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 26px; }
.call-tab { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.72); color: var(--muted); text-decoration: none; font-weight: 750; }
.call-tab:hover { background: white; color: var(--ink); }
.call-tab.active { border-color: var(--brand); background: var(--brand); color: white; box-shadow: 0 12px 30px rgba(13,108,102,.18); }
.call-tab strong { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 999px; background: rgba(20,33,43,.08); font-size: 13px; }
.call-tab.active strong { background: rgba(255,255,255,.18); }
.table-panel { margin-top: 28px; overflow: hidden; }
.call-list { display: grid; }
.call-row { display: flex; justify-content: space-between; gap: 18px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.call-row:last-child { border-bottom: 0; }
.call-row:hover { background: #f8fbfc; }
.call-row-link { display: flex; justify-content: space-between; gap: 24px; flex: 1 1 auto; min-width: 0; text-decoration: none; }
.call-main { min-width: 0; flex: 1 1 auto; }
.call-row strong, .call-summary { display: block; }
.call-summary { color: var(--muted); margin-top: 5px; max-width: 760px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.booking-preview { display: block; color: var(--brand-dark); margin-top: 7px; max-width: 820px; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { display: grid; justify-items: end; align-content: center; gap: 8px; flex: 0 0 auto; }
.row-meta time { color: var(--muted); font-size: 13px; }
.callback-control { min-width: 205px; padding-left: 18px; border-left: 1px solid var(--line); display: grid; align-content: center; justify-items: stretch; gap: 7px; }
.callback-control small, .callback-stamp { color: var(--muted); font-size: 12px; line-height: 1.35; }
.callback-stamp { font-weight: 750; }
.button-callback { width: 100%; min-height: 38px; border-color: var(--brand); color: var(--brand-dark); }
.button-callback:hover { background: var(--brand-soft); }
.callback-elapsed { font-size: 13px; font-weight: 850; }
.callback-sla-good { color: #177245; }
.callback-sla-late { color: var(--danger); }
.callback-detail { display: grid; gap: 10px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.callback-detail form { margin: 0; }
.badge { display: inline-flex; width: fit-content; max-width: 100%; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 800; line-height: 1.25; }
.badge-waiting { background: #fff0cc; color: var(--warning); }
.badge-completed { background: var(--brand-soft); color: var(--brand-dark); }
.badge-outcome-success { background: #dff2e8; color: #17603b; }
.badge-outcome-failure { background: #fff0f0; color: var(--danger); }
.badge-outcome-neutral { background: #edf1f4; color: #52626d; }
.empty-state { text-align: center; padding: 70px 24px; }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--brand-dark); font-weight: 700; text-decoration: none; }
.call-hero { padding: clamp(24px, 4vw, 40px); }
.phone { margin: 10px 0 0; color: var(--muted); font-size: 19px; }
.status-block { display: grid; justify-items: end; gap: 12px; }
.priority { font-size: 13px; font-weight: 750; }
.priority-high, .priority-urgent { color: var(--danger); }
.detail-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 20px; margin-top: 20px; }
.detail-grid > .panel, .section-card { padding: clamp(24px, 4vw, 34px); }
.highlight-card { background: linear-gradient(145deg, #ffffff, #eef9f7); }
.summary { font-size: 17px; white-space: pre-line; }
.section-card { margin-top: 20px; }
.facts, .result-grid { margin: 22px 0 0; display: grid; gap: 12px; }
.facts div, .result-grid div { display: grid; grid-template-columns: minmax(120px, .45fr) 1fr; gap: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.facts dt, .result-grid dt { color: var(--muted); font-size: 13px; font-weight: 750; }
.facts dd, .result-grid dd { margin: 0; line-height: 1.45; }
.result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.result-grid div { grid-template-columns: 1fr; gap: 5px; }
.transcript { display: grid; gap: 12px; margin-top: 24px; }
.turn { max-width: 82%; padding: 14px 16px; border-radius: 14px; background: #f0f4f6; }
.turn p { margin: 6px 0 0; }
.turn-agent { margin-left: auto; background: var(--brand-soft); }
.turn strong { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
@media (max-width: 760px) {
  .page-heading, .call-hero, .section-heading { align-items: flex-start; flex-direction: column; }
  .search { width: 100%; }
  .call-tabs { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .call-row, .call-row-link { flex-direction: column; }
  .callback-control { min-width: 0; padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--line); justify-items: start; }
  .button-callback { width: auto; }
  .row-meta, .status-block { justify-items: start; }
  .turn { max-width: 94%; }
  .result-grid { grid-template-columns: 1fr; }
}
