/* Borveo Voice uses the Callflow Core light theme palette and spacing rhythm. */
:root {
  color-scheme: light;
  --frame: #15203a;
  --frame-raised: #1f2c4b;
  --frame-line: #33426a;
  --on-frame: #c3cce0;
  --canvas: #f1f3f7;
  --surface: #ffffff;
  --surface-sunken: #f6f7fa;
  --surface-hover: #eaeef5;
  --line: #dde2ea;
  --ink: #16203a;
  --ink-muted: #515c72;
  --accent: #2a52cc;
  --accent-hover: #1f43b0;
  --accent-soft: #e6ecfc;
  --positive: #08737a;
  --positive-soft: #dcf2f1;
  --danger: #bf332c;
  --danger-soft: #fce9e6;
  --shadow-card: 0 1px 2px rgba(22,32,58,.06), 0 1px 1px rgba(22,32,58,.04);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
:where(a, button, input):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; padding: 26px 16px 22px; background: var(--frame); color: #fff; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px; font-size: 20px; font-weight: 700; letter-spacing: -.03em; white-space: nowrap; }
.brand strong { color: #9db4ff; font-weight: 700; }
.brand-mark, .login-symbol { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: white; font-weight: 800; }
.side-label { margin: 44px 10px 12px; color: var(--on-frame); font-size: 11px; font-weight: 700; letter-spacing: .09em; }
.sidebar nav a { display: block; min-height: 40px; padding: 9px 12px; border-radius: 6px; color: var(--on-frame); text-decoration: none; font-weight: 600; }
.sidebar nav a:hover { background: var(--frame-raised); color: white; }
.sidebar nav a.nav-current { background: var(--frame-raised); color: white; box-shadow: inset 3px 0 0 #9db4ff; }
.side-foot { margin-top: auto; padding: 16px 10px 0; border-top: 1px solid var(--frame-line); color: var(--on-frame); font-size: 12px; line-height: 1.5; }
.login-aside { display: none; }

.login-mode .shell { grid-template-columns: minmax(280px, 38%) minmax(0, 1fr); }
.login-mode .sidebar { padding: 36px; }
.login-mode .sidebar nav, .login-mode .side-label, .login-mode .side-foot, .login-mode .topbar { display: none; }
.login-mode .login-aside { display: block; margin: auto 0 48px; color: #fff; font-size: clamp(25px, 3vw, 42px); line-height: 1.14; font-weight: 700; letter-spacing: -.035em; }
.login-mode main { display: grid; place-items: center; max-width: none; padding: 32px; }
.login-mode .login-card { margin: 0; }

main { width: 100%; max-width: 1500px; margin: 0 auto; padding: 30px clamp(20px, 3vw, 48px) 42px; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 16px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--ink-muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; }
h1 { margin: 3px 0 0; font-size: clamp(26px, 3vw, 32px); line-height: 1.15; letter-spacing: -.035em; }
h2 { margin: 0; font-size: 18px; line-height: 1.3; letter-spacing: -.015em; }
p { margin: 0; }
.text-button { min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--accent); font-weight: 600; }
.text-button:hover { background: var(--accent-soft); }

.login-card { width: min(100%, 445px); margin: clamp(38px, 8vh, 94px) auto 0; padding: 32px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 8px 24px rgba(22,32,58,.08), var(--shadow-card); }
.login-symbol { width: 48px; height: 48px; margin-bottom: 24px; font-size: 24px; }
.login-card h2 { font-size: 23px; }
.login-card > p { margin-top: 9px; color: var(--ink-muted); font-size: 14px; }
.login-card form { display: flex; flex-direction: column; margin-top: 22px; }
.login-card label { display: block; margin: 13px 0 7px; font-size: 13px; font-weight: 700; }
#code-row[hidden] { display: none; }
.login-card input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #aeb8c9; border-radius: 6px; background: var(--surface-sunken); color: var(--ink); }
.login-card input:hover { border-color: #7f8aa0; }
.login-card input:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); outline-offset: 1px; }
.primary { min-height: 44px; margin-top: 24px; padding: 0 18px; border: 0; border-radius: 6px; background: var(--accent); color: white; font-weight: 700; }
.primary:hover { background: var(--accent-hover); }
.login-card .error { margin-top: 14px; color: var(--danger); font-size: 13px; }

.intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 30px 0 20px; }
.intro h2 { font-size: 22px; }
.intro p, .panel-head p, .control p { margin-top: 5px; color: var(--ink-muted); font-size: 14px; }
.pill { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 11px; border-radius: 999px; background: var(--positive-soft); color: var(--positive); font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.off { background: var(--danger-soft); color: var(--danger); }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.metric, .panel { min-width: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-card); }
.metric { padding: 20px; }
.metric span, .metric small { display: block; color: var(--ink-muted); font-size: 13px; }
.metric strong { display: block; margin: 7px 0 3px; font-size: 29px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.metric small { font-size: 12px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(270px, 1fr); gap: 16px; }
.panel { padding: 22px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 19px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th { padding: 10px 8px; border-bottom: 1px solid var(--line); color: var(--ink-muted); font-size: 11px; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; white-space: nowrap; }
td { padding: 15px 8px; border-bottom: 1px solid var(--line); }
td:first-child { font-weight: 700; }
.control p { margin: 9px 0 20px; }
.danger { min-height: 40px; padding: 0 14px; border: 1px solid var(--danger); border-radius: 6px; background: var(--surface); color: var(--danger); font-weight: 700; }
.danger:hover { background: var(--danger-soft); }
.danger.restore { border-color: var(--positive); color: var(--positive); }
.danger.restore:hover { background: var(--positive-soft); }
.muted { color: var(--ink-muted); font-size: 12px; }
.events { margin-top: 16px; }
.event-list { display: grid; }
.event { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 13px; }
.event span:last-child { color: var(--ink-muted); white-space: nowrap; }
footer { margin-top: 22px; color: var(--ink-muted); font-size: 12px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { min-height: 64px; flex-direction: row; align-items: center; justify-content: space-between; padding: 12px 20px; }
  .side-label, .side-foot { display: none; }
  .sidebar nav a { padding: 9px 12px; }
  main { padding: 24px 20px 36px; }
  .login-mode .shell { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .login-mode .sidebar { min-height: 72px; padding: 16px 20px; }
  .login-mode .login-aside { display: none; }
  .login-mode main { padding: 32px 20px; }
}
@media (max-width: 650px) {
  .content-grid, .metrics { grid-template-columns: 1fr; }
  .sidebar nav { display: none; }
  .intro { align-items: flex-start; flex-direction: column; }
  .login-card { margin-top: 34px; padding: 26px; }
  .event { flex-direction: column; gap: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; animation-duration: 0s !important; }
}
