/* TaskBlink Dialer: one small stylesheet, no framework. */
:root {
  --bg: #f5f6f8; --panel: #ffffff; --ink: #1c2330; --muted: #677084; --line: #e1e4ea;
  --brand: #2f5bea; --brand-ink: #ffffff; --ok: #1a8f4c; --warn: #b7791f; --bad: #c53030;
  --ready: #1a8f4c; --talk: #2f5bea; --wrap: #b7791f; --pause: #677084; --off: #9aa3b2;
  --radius: 10px; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11151c; --panel: #1a2029; --ink: #e6e9ef; --muted: #98a2b3; --line: #2b3340;
          --brand: #5b82ff; --off: #5d6675; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
h1 { font-size: 20px; margin: 0 0 8px; }
h2 { font-size: 13px; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
a { color: var(--brand); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.small { font-size: 13px; }

header.top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--panel);
  border-bottom: 1px solid var(--line); flex-wrap: wrap; }
header.top .brand { font-weight: 700; }
header.top .spacer { flex: 1; }
main.page { max-width: 1180px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.grid2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card.narrow { max-width: 420px; width: 100%; }

.btn { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 8px 14px; border-radius: 8px; cursor: pointer; }
.btn:hover:not(:disabled) { border-color: var(--brand); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.ready { background: var(--ready); color: #fff; border-color: var(--ready); }
.btn.danger { color: var(--bad); }
.btn.big { padding: 12px 22px; font-size: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; max-width: 100%; }
textarea { width: 100%; font-family: var(--mono); }
label { display: block; font-size: 13px; color: var(--muted); margin: 8px 0 4px; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  letter-spacing: .04em; color: #fff; background: var(--off); }
.pill.READY { background: var(--ready); } .pill.TALKING, .pill.RESERVED { background: var(--talk); }
.pill.WRAP { background: var(--wrap); } .pill.PAUSED, .pill.CONNECTING { background: var(--pause); }

.meter { height: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.meter > span { display: block; height: 100%; width: 0; background: var(--ok); transition: width .08s; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-family: var(--mono); }

.callcard .number { font-size: 26px; font-weight: 700; font-family: var(--mono); }
.callcard.live { border-color: var(--talk); box-shadow: 0 0 0 2px color-mix(in srgb, var(--talk) 25%, transparent); }
.rec { font-weight: 700; } .rec.on { color: var(--bad); }
.dispo { border-color: var(--wrap); }
.dispo .codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.dispo .codes .btn { text-align: left; }
kbd { font-family: var(--mono); font-size: 12px; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 4px; padding: 0 5px; background: var(--bg); }

.msg { min-height: 1.4em; font-size: 14px; }
.msg.err { color: var(--bad); } .msg.ok { color: var(--ok); }
.log { font-family: var(--mono); font-size: 12px; max-height: 160px; overflow: auto; color: var(--muted);
  white-space: pre-wrap; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
.tablewrap { overflow-x: auto; }
.bar { position: relative; height: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ok); border-radius: 7px; }
.bar > i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--bad); }
.bar > i.target { background: var(--warn); }
.big-number { font-size: 34px; font-weight: 700; }
.warnbox { border-left: 4px solid var(--warn); padding: 8px 12px; background: var(--bg); border-radius: 6px; }
