:root {
  --navy: #2E3984; --cyan: #02B6CC; --white: #FEFEFE;
  --ink: #1d2340; --muted: #5d6385; --line: #e3e6f0; --bg: #f4f6fb;
  --good: #1a8f5a; --warn: #b7791f; --bad: #c0392b;
  --radius: 10px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Montserrat, system-ui, sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; }
.hidden { display: none !important; }
h1 { font-size: 22px; margin: 0; } h2 { font-size: 15px; margin: 0 0 12px; color: var(--navy); } h3 { font-size: 14px; margin: 18px 0 8px; color: var(--navy); }
.muted { color: var(--muted); } .small { font-size: 12px; } .mono { font-family: ui-monospace, monospace; }
.hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.error { color: var(--bad); min-height: 1em; } .spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 12px; }

.top { display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: var(--navy); color: var(--white); position: sticky; top: 0; z-index: 5; }
.brand, .brand-lg { font-weight: 700; letter-spacing: .3px; } .brand span, .brand-lg span { color: var(--cyan); }
.brand-lg { font-size: 26px; color: var(--navy); margin-bottom: 8px; }
.pill { background: rgba(255,255,255,.12); padding: 4px 10px; border-radius: 99px; font-size: 12px; }
.pill.warn { background: #f6c34333; color: #ffe08a; } .pill.bad { background: #c0392b55; }
.badge { background: var(--cyan); color: var(--navy); font-weight: 700; font-size: 11px; padding: 3px 8px; border-radius: 6px; margin-right: 6px; }

.grid { display: grid; grid-template-columns: 320px 1fr 360px; gap: 16px; padding: 16px 20px; align-items: start; }
@media (max-width: 1200px) { .grid { grid-template-columns: 300px 1fr; } .phone { grid-column: 1 / -1; } }
@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; padding: 12px 16px; }
  .top { flex-wrap: wrap; padding: 10px 16px; }
  .top .pill, #userName { display: none; }
  .badge { font-size: 10px; }
}
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }

label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 12px; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
input, select, textarea { width: 100%; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
input[type=checkbox] { width: auto; margin: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cyan); border-color: transparent; }

.btn { border: 1px solid var(--line); background: #fff; color: var(--navy); padding: 9px 16px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--navy); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); } .btn.primary:hover { background: #232c6b; }
.btn.ghost { background: transparent; } .top .muted { color: rgba(255,255,255,.8); }
.top .btn.ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.btn.sm { padding: 5px 10px; font-size: 12px; } .btn.full { width: 100%; }
.btn.live { background: var(--cyan); border-color: var(--cyan); color: var(--navy); }

.count { background: var(--cyan); color: var(--navy); border-radius: 99px; padding: 1px 8px; font-size: 12px; margin-left: 6px; }
.queue { list-style: none; padding: 0; margin: 0; max-height: 55vh; overflow: auto; }
.queue li { padding: 9px 8px; border-bottom: 1px solid var(--line); cursor: pointer; display: flex; gap: 8px; align-items: center; border-radius: 6px; }
.queue li:hover { background: #eef1fa; } .queue li.active { background: #e0f7fa; }
.queue .qname { font-weight: 600; } .queue .qsub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue .qscore { margin-left: auto; font-weight: 700; color: var(--navy); }
.queue .off { color: var(--warn); font-size: 11px; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.score { background: var(--navy); color: #fff; font-weight: 700; border-radius: 10px; padding: 8px 12px; font-size: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chip { background: #e0f7fa; color: #035e6a; padding: 3px 8px; border-radius: 99px; font-size: 12px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 16px; margin: 12px 0; }
.facts div.wide { grid-column: 1 / -1; } dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; } dd { margin: 2px 0 0; font-weight: 500; }
@media (max-width: 760px) { .facts { grid-template-columns: 1fr 1fr; } }
.phones { display: flex; flex-wrap: wrap; gap: 8px; }
.phone-opt { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.phone-opt.sel { border-color: var(--navy); background: #eef1fa; font-weight: 600; }
.warn { background: #fff6e0; color: #7a5200; padding: 8px 10px; border-radius: 8px; margin-top: 10px; }
.notice { background: #e0f7fa; border-left: 4px solid var(--cyan); padding: 10px 12px; border-radius: 8px; margin: 12px 0; }
.notice .check { margin: 8px 0 0; }
.callbar { display: flex; gap: 8px; align-items: center; margin: 16px 0 6px; flex-wrap: wrap; }
.callstate { margin-left: auto; font-weight: 600; color: var(--muted); }
.callstate.on { color: var(--good); } .callstate.ring { color: var(--warn); }
.dispos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.dispo { text-align: left; } .dispo kbd { background: var(--bg); border-radius: 4px; padding: 0 5px; margin-right: 6px; font-size: 11px; }
.dispo.good { border-color: var(--good); } .dispo.bad { border-color: var(--bad); color: var(--bad); }

.phone-card iframe { width: 100%; height: 640px; border: 0; border-radius: 8px; }
.mockphone { display: flex; flex-direction: column; gap: 8px; }
.login { min-height: 100vh; display: grid; place-items: center; }
.login-card { width: min(360px, calc(100vw - 32px)); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: 0 6px 20px #0003; }

/* ---------- Pop-out notice and tabs (tabs only show in slim mode) ---------- */
.popped { background: #fff6e0; color: #6b4a00; padding: 10px 20px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid #f0dca8; }
.tabs { display: none; }
.count.sm { font-size: 11px; padding: 0 6px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-left: 4px; vertical-align: middle; }
.livestrip { display: none; }

/* ---------- Slim mode: one narrow column like a phone sidebar ---------- */
body.slim { font-size: 13px; }
body.slim .top { padding: 8px 12px; gap: 8px; }
body.slim .brand { font-size: 14px; }
body.slim #todayPill, body.slim #userName, body.slim #popoutBtn, body.slim #logoutBtn { display: none; }
#expandBtn { display: none; }
body.slim #expandBtn { display: inline-block; }
body.slim #modeBadges .badge { font-size: 9px; padding: 2px 5px; margin-right: 3px; }
body.slim #syncPill { font-size: 11px; padding: 3px 8px; }
body.slim .tabs { display: flex; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 42px; z-index: 4; }
body.slim .tabs button { flex: 1; background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 4px 8px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
body.slim .tabs button.active { color: var(--navy); border-bottom-color: var(--cyan); }
body.slim .livestrip.on { display: flex; align-items: center; gap: 8px; background: #e7f7ee; color: #145c3a; padding: 8px 12px; font-weight: 600; border-bottom: 1px solid #c6ebd5; }
body.slim .livestrip .btn { margin-left: auto; }
.livedot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

body.slim .grid { display: block; padding: 10px; }
body.slim .col { display: contents; }
body.slim [data-pane] { display: none; }
body.slim[data-tab="call"] [data-pane="call"],
body.slim[data-tab="queue"] [data-pane="queue"],
body.slim[data-tab="list"] [data-pane="list"] { display: block; }
/* The phone pane stays loaded when hidden so a live call is never cut off. */
body.slim [data-pane="phone"] { display: block; position: absolute; left: -10000px; top: 0; width: 340px; }
body.slim[data-tab="phone"] [data-pane="phone"] { position: static; width: auto; }
body.slim .phone-card iframe { height: calc(100vh - 150px); min-height: 480px; }

body.slim .card { padding: 12px; border-radius: 8px; }
body.slim h1 { font-size: 18px; }
body.slim h2 { font-size: 14px; margin-bottom: 8px; }
body.slim h3 { margin: 12px 0 6px; }
body.slim .score { font-size: 14px; padding: 5px 8px; }
body.slim .facts { grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 8px 0; }
body.slim .chips { margin: 6px 0; }
body.slim .chip { font-size: 11px; padding: 2px 7px; }
body.slim .phones { gap: 6px; }
body.slim .phone-opt { padding: 4px 8px; font-size: 12px; }
body.slim .callbar { margin: 10px 0 4px; gap: 6px; }
body.slim .callbar .btn { padding: 7px 10px; }
body.slim .callstate { flex-basis: 100%; margin-left: 0; font-size: 12px; }
body.slim .dispos { grid-template-columns: 1fr 1fr; gap: 6px; }
body.slim .dispo { padding: 8px 8px; font-size: 12.5px; }
body.slim .notice { padding: 8px 10px; font-size: 12.5px; margin: 8px 0; }
body.slim textarea { min-height: 70px; }
body.slim .queue { max-height: none; }
body.slim .empty { padding: 24px 8px; }
.slim-only { display: none; }
body.slim .slim-only { display: inline-block; }
body.slim .full-only { display: none; }
body.slim .top { flex-wrap: nowrap; }
body.slim .top #syncPill { display: inline-block; white-space: nowrap; }
body.slim #expandBtn { padding: 4px 8px; font-size: 11px; white-space: nowrap; }
