:root {
  --bg: #f2f5fb;
  --surface: #fff;
  --surface-alt: #eef3fa;
  --border: #d6e0ee;
  --text: #10233f;
  --muted: #56657f;
  --sidebar: #0f1b33;
  --sidebar-hover: #17274a;
  --sidebar-active: #23406f;
  --answered: #0f9d58;
  --missed: #c62828;
  --transferred: #6a1b9a;
  --outbound: #1565c0;
  --pending: #b26a00;
  --missing: #455a64;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 24px;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(16, 35, 63, .08);
}
body { margin: 0; font-family: Inter, Arial, sans-serif; background: var(--bg); color: var(--text); }
.top-alert { background: #ffe7b3; border-bottom: 1px solid #f8cc65; padding: var(--space-2) var(--space-3); font-weight: 700; }
.layout { display: grid; grid-template-columns: 260px 1fr; gap: var(--space-3); max-width: 1600px; margin: 0 auto; padding: var(--space-3); }
.ops-sidebar { background: var(--sidebar); color: #d7e3fb; border-radius: var(--radius); padding: var(--space-3); position: sticky; top: 12px; height: fit-content; }
.brand { display: flex; gap: var(--space-2); align-items: center; margin-bottom: var(--space-3); }
.brand-icon { width: 36px; height: 36px; border-radius: 10px; background: #3b6ac0; display: grid; place-items: center; font-weight: 700; }
.brand-title { margin: 0; font-weight: 700; }
.brand-subtitle { margin: 2px 0 0; color: #9fb5de; font-size: 12px; }
.sidebar-toggle { display: none; width: 100%; margin-bottom: var(--space-2); }
.ops-sidebar ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.nav-link { width: 100%; text-align: left; background: transparent; border: 1px solid transparent; color: #d7e3fb; padding: 10px; border-radius: 8px; }
.nav-link:hover { background: var(--sidebar-hover); }
.nav-link.active { background: var(--sidebar-active); border-color: #7ea5ea; font-weight: 700; }
main { min-width: 0; }
.card, .state-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--space-3); }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--muted); }
.topbar h1 { margin: 6px 0; }
.phase { margin: 0; color: var(--muted); }
.topbar-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.viewer { margin: 0; color: var(--muted); }
.pbx-note { margin: 10px 0 16px; color: var(--muted); }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-2); margin: var(--space-3) 0; }
.kpi-card { border-top: 4px solid #2f6fed; }
.kpi-label { margin: 0; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.kpi-value { font-size: 24px; display: block; margin-top: var(--space-1); }
.kpi-helper { color: var(--muted); font-size: 13px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: var(--space-1); }
input, select, button { border: 1px solid var(--border); border-radius: 8px; padding: 10px; font-size: 14px; }
button { cursor: pointer; background: var(--surface-alt); }
button:focus-visible, input:focus-visible, select:focus-visible, .nav-link:focus-visible { outline: 3px solid #7cb4ff; outline-offset: 1px; }
.split { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--space-2); margin: var(--space-3) 0; }
.call-card { border: 1px solid var(--border); border-radius: 10px; padding: var(--space-2); background: var(--surface-alt); margin-top: 10px; }
.pill { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #e8eef8; display: inline-block; }
.tone-answered { color: var(--answered); } .tone-missed { color: var(--missed); } .tone-transferred { color: var(--transferred); }
.tone-outbound { color: var(--outbound); } .tone-pending { color: var(--pending); } .tone-missing { color: var(--missing); }
.table-wrap { overflow-x: auto; }
.simple-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.simple-table th, .simple-table td { border: 1px solid var(--border); padding: 8px; text-align: left; vertical-align: top; }
.row-selected { background: #f0f6ff; }
.empty-state { text-align: center; }

.ops-workflow { grid-template-columns: 300px 1fr 1fr; align-items: start; }
.ops-list { display: grid; gap: 10px; }
.ops-list-head, .ops-row { display:grid; grid-template-columns: 1.2fr 1fr 1fr 1fr auto; gap: 10px; align-items: start; }
.ops-list-head { font-weight: 700; color: var(--muted); border-bottom:1px solid var(--border); padding-bottom:8px; }
.ops-row { border:1px solid var(--border); border-left:4px solid transparent; border-radius:10px; padding:10px; background: var(--surface-alt); }
.ops-row.tone-missed { border-left-color: var(--missed); }
.ops-row.tone-answered { border-left-color: var(--answered); }
.ops-row.tone-outbound { border-left-color: var(--outbound); }
.ops-row.tone-pending, .ops-row.tone-transferred { border-left-color: var(--pending); }
.ops-label { margin:0; font-size:12px; color:var(--muted); text-transform: uppercase; }
.muted { color: var(--muted); font-size: 13px; margin: 4px 0 0; }

.event-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-1); }
.event { background: var(--surface-alt); border-left: 4px solid #2f6fed; padding: var(--space-1) var(--space-2); }
@media (max-width: 1000px) {
  .layout, .split, .ops-workflow { grid-template-columns: 1fr; }
  .ops-sidebar { position: static; }
  .sidebar-toggle { display: block; }
  .ops-sidebar nav { display: none; }
  .ops-sidebar.collapsed nav { display: none; }
  .ops-sidebar:not(.collapsed) nav { display: block; }
  .simple-table { min-width: 760px; }
}
@media (max-width: 680px) {
  .layout { padding: var(--space-2); }
  .kpi-grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; }
  .topbar-actions { justify-content: flex-start; }
  input,select,button{font-size:16px;}
}
.dept-grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(250px,1fr)); gap: 12px; }
.dept-card { border:1px solid var(--border); border-radius:10px; padding:12px; background:var(--surface-alt); }
.progress-track { width:100%; height:10px; background:#dbe5f4; border-radius:999px; overflow:hidden; }
.progress-fill { display:block; height:100%; background:linear-gradient(90deg,#2f6fed,#0f9d58); }
.traffic-list { display:grid; gap:8px; }
.traffic-row { display:grid; grid-template-columns: 70px 1fr 40px; align-items:center; gap:10px; }
