:root {
  --bg: #06101a;
  --surface: rgba(13, 28, 42, .78);
  --surface-strong: #102334;
  --line: rgba(148, 180, 202, .14);
  --text: #f4f8fa;
  --muted: #8da5b5;
  --teal: #2dd4bf;
  --blue: #60a5fa;
  --warning: #f59e0b;
  --danger: #fb7185;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; background:
    radial-gradient(circle at 15% -10%, rgba(45,212,191,.12), transparent 30%),
    radial-gradient(circle at 90% 25%, rgba(96,165,250,.1), transparent 25%), var(--bg);
  color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
.ambient { position: fixed; width: 420px; height: 420px; border-radius: 50%; filter: blur(120px); opacity: .08; pointer-events: none; }
.ambient-a { background: var(--teal); top: 10%; left: -250px; }
.ambient-b { background: var(--blue); right: -260px; bottom: 0; }
.topbar {
  height: 76px; padding: 0 max(24px, calc((100vw - 1320px)/2)); display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); background: rgba(6,16,26,.82); backdrop-filter: blur(22px);
}
.brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 12px; }
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 2px; }
.brand-mark {
  width: 40px; height: 40px; border: 1px solid rgba(45,212,191,.38); border-radius: 13px; display: flex; justify-content: center; align-items: center; gap: 3px;
  background: linear-gradient(145deg, rgba(45,212,191,.2), rgba(96,165,250,.08)); box-shadow: 0 0 24px rgba(45,212,191,.12);
}
.brand-mark span { width: 3px; border-radius: 5px; background: var(--teal); }
.brand-mark span:nth-child(1), .brand-mark span:nth-child(3) { height: 11px; opacity: .7; }
.brand-mark span:nth-child(2) { height: 21px; }
.top-actions { display: flex; align-items: center; gap: 16px; }
.live-pill { display: flex; align-items: center; gap: 8px; color: #9be9d9; font-size: 12px; padding: 7px 11px; border-radius: 999px; background: rgba(45,212,191,.08); border: 1px solid rgba(45,212,191,.16); }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 5px rgba(45,212,191,.1); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px rgba(45,212,191,0); } }
.user-name { color: var(--muted); font-size: 13px; }
.logout, .refresh-button { border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--text); padding: 9px 14px; border-radius: 10px; cursor: pointer; }
.nav-link { color: #b8c8d2; font-size: 12px; text-decoration: none; }
.nav-link:hover { color: var(--teal); }
.logout:hover, .refresh-button:hover { border-color: rgba(45,212,191,.4); }
.page { position: relative; width: min(1320px, calc(100% - 48px)); margin: 0 auto; padding: 55px 0 80px; }
.hero { display: flex; align-items: end; justify-content: space-between; margin-bottom: 34px; }
.eyebrow { margin: 0 0 8px; color: var(--teal); font-size: 11px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(31px, 4vw, 48px); letter-spacing: -.045em; line-height: 1.05; }
.hero > div > p:last-child { color: var(--muted); margin: 15px 0 0; }
.last-refresh { color: var(--muted); text-align: right; font-size: 11px; line-height: 1.6; }
.last-refresh strong { color: var(--text); font-size: 13px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 50px; }
.metrics article { display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 12px 40px rgba(0,0,0,.12); }
.metrics small, .card-metrics small { color: var(--muted); display: block; font-size: 11px; }
.metrics strong { font-size: 21px; display: block; margin-top: 3px; }
.metric-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; }
.metric-icon.healthy { color: var(--teal); background: rgba(45,212,191,.1); }
.metric-icon.calls { color: var(--blue); background: rgba(96,165,250,.1); }
.metric-icon.warning { color: var(--warning); background: rgba(245,158,11,.1); }
.metric-icon.refresh { color: #c4b5fd; background: rgba(196,181,253,.1); }
.section-head, .panel-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 17px; }
.section-head h2, .panel-head h2 { margin: 0; font-size: 23px; letter-spacing: -.025em; }
.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.project-card { position: relative; overflow: hidden; padding: 23px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, rgba(18,39,56,.88), rgba(9,23,35,.82)); box-shadow: 0 18px 60px rgba(0,0,0,.16); }
.project-card::before { content: ""; position: absolute; width: 170px; height: 170px; right: -80px; top: -90px; border-radius: 50%; background: var(--accent); filter: blur(70px); opacity: .12; }
.card-top { position: relative; display: flex; align-items: center; gap: 13px; }
.agent-avatar { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 15px; display: grid; place-items: center; color: var(--accent); font-size: 20px; font-weight: 800; background: color-mix(in srgb, var(--accent) 13%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.agent-copy { min-width: 0; }
.agent-copy small { color: var(--accent); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.agent-copy h3 { margin: 2px 0; font-size: 18px; }
.agent-copy p { color: var(--muted); font-size: 12px; margin: 0; }
.state { margin-left: auto; align-self: start; display: flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; text-transform: capitalize; font-size: 10px; font-weight: 700; }
.state i, .component i, .status-dot, .incident-dot { width: 7px; height: 7px; border-radius: 50%; }
.state.healthy { color: #8cebd8; background: rgba(45,212,191,.09); }
.state.healthy i, .status-dot.healthy { background: var(--teal); }
.state.degraded { color: #ffd08a; background: rgba(245,158,11,.1); }
.state.degraded i, .status-dot.degraded { background: var(--warning); }
.state.down { color: #fda4af; background: rgba(251,113,133,.1); }
.state.down i, .status-dot.down { background: var(--danger); }
.components { display: flex; flex-wrap: wrap; gap: 8px; padding: 20px 0; margin: 19px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.component { display: flex; align-items: center; gap: 6px; color: var(--muted); padding: 6px 8px; border-radius: 8px; font-size: 10px; background: rgba(255,255,255,.025); }
.component.ok i { background: var(--teal); }.component.bad i { background: var(--danger); }
.card-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.card-metrics > div { padding: 11px; border-radius: 11px; background: rgba(3,10,17,.28); }
.card-metrics strong { display: block; margin-top: 5px; font-size: 17px; }
.warn-text { color: var(--warning); }
.latest-call { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; margin-top: 17px; font-size: 11px; }
.latest-call > span { color: var(--muted); }
.latest-call strong { font-size: 11px; text-transform: capitalize; text-align: right; }
.latest-call small { grid-column: 1 / -1; color: #657d8e; text-align: right; }
.project-error { color: #fda4af; font-size: 11px; margin: 12px 0 0; }
.lower-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; margin-top: 50px; }
.panel { padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.count-badge { padding: 5px 9px; border-radius: 999px; color: var(--warning); background: rgba(245,158,11,.1); font-size: 11px; }
.incident { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.incident-dot { margin-top: 5px; flex: 0 0 auto; }
.incident.warning .incident-dot { background: var(--warning); }.incident.critical .incident-dot { background: var(--danger); }
.incident strong { font-size: 13px; }.incident p { color: var(--muted); margin: 5px 0; font-size: 11px; line-height: 1.5; }.incident small { color: #637c8d; }
.empty-state { padding: 35px 20px; text-align: center; color: var(--muted); }
.empty-state > span { width: 42px; height: 42px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; color: var(--teal); background: rgba(45,212,191,.1); }
.empty-state strong { display: block; color: var(--text); }.empty-state p { font-size: 12px; }
.history-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.status-dot { flex: 0 0 auto; }.history-row > div { flex: 1; }.history-row strong, .history-row small { display: block; }.history-row strong { font-size: 12px; }.history-row small { color: var(--muted); font-size: 10px; margin-top: 2px; }.latency { color: var(--muted); font-size: 11px; }
.login-body { display: grid; place-items: center; padding: 32px; }
.login-shell { width: min(1000px, 100%); min-height: 610px; display: grid; grid-template-columns: 1.15fr .85fr; overflow: hidden; border: 1px solid var(--line); border-radius: 28px; background: rgba(9,23,35,.78); box-shadow: 0 40px 120px rgba(0,0,0,.38); }
.login-brand { display: flex; flex-direction: column; justify-content: end; padding: 55px; background: radial-gradient(circle at 30% 25%, rgba(45,212,191,.18), transparent 38%), linear-gradient(145deg, #0c2636, #08131f); }
.login-brand .brand-mark { margin-bottom: auto; }
.login-brand h1 { max-width: 520px; margin: 0; font-size: 45px; line-height: 1.05; letter-spacing: -.05em; }
.login-brand > p:last-child { max-width: 460px; color: var(--muted); line-height: 1.7; }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: 50px; }
.login-card h2 { margin: 0; font-size: 30px; }.muted { color: var(--muted); font-size: 13px; margin: 8px 0 27px; }
.login-card label { display: block; color: #b8c8d2; font-size: 11px; font-weight: 650; margin: 17px 0 7px; }
.login-card input { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; outline: none; background: rgba(255,255,255,.035); color: var(--text); }
.login-card input:focus { border-color: rgba(45,212,191,.6); box-shadow: 0 0 0 3px rgba(45,212,191,.08); }
.login-card button { width: 100%; display: flex; justify-content: space-between; margin-top: 25px; padding: 14px 16px; border: 0; border-radius: 11px; background: linear-gradient(100deg, #22c8b4, #55aaf8); color: #04131c; font-weight: 800; cursor: pointer; }
.form-error { padding: 11px; border: 1px solid rgba(251,113,133,.25); border-radius: 9px; color: #fda4af; background: rgba(251,113,133,.08); font-size: 12px; }
.mobile-brand { display: none; }
.hero.compact { margin-bottom: 24px; }
.filters { display: flex; gap: 10px; margin-bottom: 18px; }
.filters select, .filters button { padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface-strong); }
.filters button { cursor: pointer; color: #06151d; border: 0; background: var(--teal); font-weight: 750; }
.calls-table { padding: 0; overflow: hidden; }
.calls-head, .call-row { display: grid; grid-template-columns: 1.5fr .9fr .8fr 70px; align-items: center; gap: 16px; }
.calls-head { padding: 13px 20px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .09em; background: rgba(255,255,255,.025); }
.call-row { color: inherit; text-decoration: none; padding: 16px 20px; border-top: 1px solid var(--line); transition: background .15s ease; }
.call-row:hover { background: rgba(45,212,191,.035); }
.call-row strong, .call-row small { display: block; }.call-row strong { font-size: 13px; }.call-row small { color: var(--muted); font-size: 10px; margin-top: 4px; }
.call-row .state { width: max-content; margin: 0 0 4px; }
.risk-ring { width: 42px; height: 42px; display: grid; place-items: center; border: 3px solid rgba(45,212,191,.5); border-radius: 50%; color: var(--teal); font-size: 12px; font-weight: 800; }
.risk-ring.medium { color: var(--warning); border-color: rgba(245,158,11,.55); }.risk-ring.high { color: var(--danger); border-color: rgba(251,113,133,.6); }
.call-detail-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.call-detail-head h1 { margin: 0; font-size: 36px; letter-spacing: -.04em; }.call-detail-head p:last-child { color: var(--muted); font-size: 12px; }
.risk-hero { width: 92px; height: 92px; display: grid; place-content: center; text-align: center; border: 5px solid rgba(45,212,191,.4); border-radius: 50%; color: var(--teal); }
.risk-hero strong { font-size: 27px; }.risk-hero span { font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }.risk-hero.medium { color: var(--warning); border-color: rgba(245,158,11,.45); }.risk-hero.high { color: var(--danger); border-color: rgba(251,113,133,.48); }
.analysis-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.analysis-metrics article { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.analysis-metrics small { display: block; color: var(--muted); font-size: 10px; }.analysis-metrics strong { display: block; margin-top: 5px; font-size: 16px; }
.audio-panel { margin-bottom: 18px; }.audio-panel audio { width: 100%; margin-top: 7px; }
.detail-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 18px; }
.turn { padding: 14px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); }
.turn.assistant { margin-left: 35px; border-color: rgba(45,212,191,.16); background: rgba(45,212,191,.035); }.turn.caller { margin-right: 35px; }
.turn-label { display: flex; justify-content: space-between; color: var(--teal); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }.turn-label small { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
.turn p { margin: 8px 0 0; color: #d7e2e8; font-size: 13px; line-height: 1.55; }
.issue-card { padding: 13px; margin-bottom: 9px; border-left: 3px solid var(--warning); border-radius: 9px; background: rgba(245,158,11,.06); }
.issue-card.error { border-color: var(--danger); background: rgba(251,113,133,.06); }.issue-card strong { font-size: 12px; text-transform: capitalize; }.issue-card p { color: var(--muted); font-size: 11px; line-height: 1.5; }.issue-card small { color: #637c8d; font-size: 9px; }
@media (max-width: 900px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .project-grid, .lower-grid { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; min-height: auto; max-width: 480px; }
  .login-brand { display: none; }.mobile-brand { display: block; margin-bottom: 35px; }
  .detail-grid { grid-template-columns: 1fr; }.analysis-metrics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .page { width: min(100% - 28px, 1320px); padding-top: 32px; }
  .topbar { height: 66px; padding: 0 14px; }.brand small, .live-pill span, .user-name { display: none; }
  .live-pill { padding: 8px; }.logout { font-size: 11px; padding: 8px 10px; }
  .hero { align-items: flex-start; }.last-refresh { display: none; }
  .hero h1 { font-size: 32px; }.hero > div > p:last-child { font-size: 13px; line-height: 1.5; }
  .metrics { gap: 9px; margin-bottom: 38px; }.metrics article { padding: 13px; gap: 10px; }.metric-icon { width: 34px; height: 34px; }.metrics strong { font-size: 17px; }
  .project-card { padding: 17px; }.card-top { align-items: flex-start; }.agent-avatar { width: 42px; height: 42px; flex-basis: 42px; }
  .agent-copy h3 { font-size: 16px; }.agent-copy p { display: none; }.state { padding: 5px 7px; }
  .card-metrics { gap: 7px; }.card-metrics > div { padding: 9px 7px; }.card-metrics strong { font-size: 14px; }
  .panel { padding: 17px; }.login-body { padding: 15px; }.login-card { padding: 30px 23px 40px; }
  .top-actions .nav-link { display: none; }.filters { display: grid; grid-template-columns: 1fr 1fr; }.filters button { grid-column: 1 / -1; }
  .calls-head { display: none; }.call-row { grid-template-columns: 1fr auto; gap: 12px; }.call-row > div:nth-child(3) { display: none; }
  .call-detail-head { align-items: flex-start; }.call-detail-head h1 { font-size: 27px; }.risk-hero { width: 72px; height: 72px; flex: 0 0 72px; }
  .analysis-metrics { gap: 8px; }.analysis-metrics article { padding: 12px; }.turn.assistant { margin-left: 15px; }.turn.caller { margin-right: 15px; }
}
