/* Pontano Sans: iVi house font (SIL Open Font License, fonts/OFL.txt) */
@font-face {
  font-family: "Pontano Sans";
  src: url("fonts/PontanoSans-Variable.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #dde1e7;
  --text: #434343;
  --heading: #1f2a36;
  --muted: #666666;
  --accent: #00558b;
  --accent-text: #ffffff;
  --accent-soft: #e3eef6;
  --nrtc-ink: #010000;
  --nrtc-accent: #d4261a;
  --ok: #107c41;
  --ok-soft: #e5f4ea;
  --warn: #9a5b00;
  --warn-soft: #fdf1dc;
  --bad: #b3261e;
  --bad-soft: #fbe7e6;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --surface: #1a2029;
    --surface-2: #222a35;
    --border: #2f3a48;
    --text: #e6ebf1;
    --heading: #f3f6f9;
    --muted: #9aa8b8;
    --accent: #5aa9e0;
    --accent-text: #0b1520;
    --accent-soft: #17304a;
    --nrtc-ink: #ffffff;
    --nrtc-accent: #f0473b;
    --ok: #5cc98a;
    --ok-soft: #173326;
    --warn: #f0b552;
    --warn-soft: #3a2c12;
    --bad: #f28b82;
    --bad-soft: #3b1d1b;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14.5px/1.5 "Pontano Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[x-cloak] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; font-weight: 600; color: var(--heading); }
h2 { font-size: 15.5px; margin: 0 0 12px; font-weight: 700; color: var(--accent); }
code, .mono { font-family: var(--mono); font-size: 12.5px; }

/* ---- shell ---- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px; height: 56px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; white-space: nowrap; color: var(--heading); }
.brand:hover { text-decoration: none; }
.brand .product { font-size: 18px; font-weight: 600; letter-spacing: .01em; }
.brand-sep { width: 1px; height: 26px; background: var(--border); }

/* ---- brand marks ---- */
.nrtc-logo { height: 28px; width: auto; display: block; }
.nrtc-logo .nrtc-ink { fill: var(--nrtc-ink); }
.nrtc-logo .nrtc-accent { fill: var(--nrtc-accent); }
.ivi-logo { height: 26px; width: auto; display: block; }
/* The iVi logo is dark blue on transparent: give it a white plate on dark backgrounds. */
.logo-plate { display: inline-flex; border-radius: 8px; }
@media (prefers-color-scheme: dark) { .logo-plate { background: #fff; padding: 4px 8px; } }
.lockup { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 22px; }
.lockup .nrtc-logo { height: 40px; }
.lockup .ivi-logo { height: 36px; }
.card .lockup { margin-bottom: 14px; }
.site-footer {
  max-width: 1240px; margin: 8px auto 0; padding: 18px 24px 28px;
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--border);
}
.site-footer .ivi-logo { height: 24px; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a {
  padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 550; white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.user { display: flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--muted); }
main { max-width: 1240px; margin: 0 auto; padding: 24px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ---- surfaces ---- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px;
}
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2 { padding: 16px 20px 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; }
.stat b { display: block; font-size: 22px; font-weight: 650; line-height: 1.2; }
.stat span { color: var(--muted); font-size: 12.5px; }
.meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); margin-top: 6px; }
.meta b { color: var(--text); font-weight: 550; }
.muted { color: var(--muted); }
.empty { padding: 28px; text-align: center; color: var(--muted); }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- controls ---- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
input[type=text], input[type=search], input[type=number], select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; min-width: 0;
}
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=search] { width: 260px; max-width: 100%; }
label.field { display: flex; flex-direction: column; gap: 5px; font-weight: 550; font-size: 13px; }
label.check { display: flex; gap: 8px; align-items: flex-start; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
button, .btn {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 8px; padding: 7px 14px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); display: inline-flex; align-items: center; gap: 6px;
}
button:hover, .btn:hover { background: var(--surface-2); text-decoration: none; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.primary:hover { filter: brightness(1.08); background: var(--accent); }
button.danger { color: var(--bad); border-color: var(--bad); }
button.danger.solid { background: var(--bad); color: #fff; }
button.small { padding: 4px 10px; font-size: 12.5px; }
button:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; padding: 3px; background: var(--surface-2); gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; padding: 6px 14px; color: var(--muted); }
.segmented.fill { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
.segmented.fill button { padding: 6px 8px; justify-content: center; font-size: 13px; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---- pills & chips ---- */
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--accent-soft); color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 12px; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.chip b { font-weight: 650; }
.chip.add { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.chip.upd { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.chip.del { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.level { display: inline-flex; gap: 2px; vertical-align: middle; }
.level i { width: 6px; height: 12px; border-radius: 2px; background: var(--border); }
.level i.on { background: var(--accent); }

/* ---- alerts ---- */
.alert { border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; border: 1px solid transparent; }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.info { background: var(--accent-soft); color: var(--accent); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert .actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 50; max-width: 420px;
  padding: 12px 16px; border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0,0,0,.18);
  background: var(--text); color: var(--bg); font-weight: 550;
}
.toast.bad { background: var(--bad); color: #fff; }

/* ---- upload ---- */
.drop {
  display: block; border: 2px dashed var(--border); border-radius: var(--radius); padding: 30px; text-align: center;
  color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s;
}
.drop.over, .drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.drop b { color: var(--text); }
.file-info { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
pre.report { white-space: pre-wrap; background: var(--surface-2); border-radius: 8px; padding: 12px; margin: 0; max-height: 360px; overflow: auto; font-family: var(--mono); font-size: 12.5px; }
.steps { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.steps .on { color: var(--accent); font-weight: 650; }
.spinner { width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { min-height: 70vh; display: grid; place-items: center; text-align: center; }

@media (max-width: 860px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .topbar { padding: 0 16px; gap: 12px; height: auto; min-height: 56px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .nav { order: 3; flex-basis: 100%; }
  main { padding: 16px; }
  th, td { padding: 8px 10px; }
  input[type=search] { width: 100%; }
}

/* member portal */
.nav-group { display: contents; }
.transcript { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.turn { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); max-width: 85%; }
.turn.agent { align-self: flex-start; border-left: 3px solid var(--accent); }
.turn.customer { align-self: flex-end; background: var(--accent-soft); }
.turn .who { font-weight: 650; font-size: 12px; }
.turn .at { font-size: 11px; margin-left: 6px; }
.turn p { margin: 2px 0 0; }

/* wallboard */
.wb { display: flex; flex-direction: column; gap: 16px; }
.wb-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.wb-tile { padding: 14px 16px; margin: 0; }
.wb-label { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.wb-big { font-size: 34px; font-weight: 700; line-height: 1.1; margin: 4px 0; font-variant-numeric: tabular-nums; }
.wb-split { display: flex; gap: 4px; }
.seg { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px;
       border-radius: 4px; color: #fff; font-size: 12px; font-weight: 650; }
.seg.avail { background: #2e9e57; }
.seg.oncontact { background: #7b4fd1; }
.seg.acw { background: #e0a400; color: #222; }
.seg.unavail { background: #d23b2f; }
.seg.inq { background: #ee7d1a; }
.wb-legend { display: flex; gap: 6px 14px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.wb-legend .seg { min-width: 12px; width: 12px; height: 12px; padding: 0; margin-right: -8px; }
.wb-bars { display: flex; flex-direction: column; gap: 8px; }
.wb-bar-row { display: grid; grid-template-columns: 110px 1fr 110px; gap: 10px; align-items: center; }
.wb-bar-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-bar { display: flex; height: 24px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.wb-bar .seg { border-radius: 0; min-width: 0; padding: 0; }
.wb-bar-wait { font-size: 12px; text-align: right; }
.wb-lists { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.wb-lists .card { margin: 0; }
.wb-alert-amber { background: #fff1c2; color: #6b4b00; font-weight: 650; }
.wb-alert-red { background: #d23b2f; color: #fff; font-weight: 650; }
body.mode-tv main, body.mode-embed main { max-width: none; padding: 12px 16px; }
body.mode-tv .wb-big { font-size: 48px; }
body.mode-tv { font-size: 17px; }
body.mode-embed .page-head { margin-bottom: 8px; }
body.mode-embed .wb-big { font-size: 28px; }
.wb table { font-size: 13px; }
.wb th, .wb td { padding: 6px 10px; white-space: nowrap; }
.wb td:first-child { white-space: normal; }
@media (min-width: 900px) { .wb-lists .wb-contacts { grid-column: span 2; } }
.wb-why { margin-top: 3px; font-size: 12px; color: var(--muted); white-space: normal; max-width: 34em; }
.wb-why.ok { color: var(--ok); }
.wb-why.warn { color: var(--warn); font-weight: 600; }
.wb-why.bad { color: var(--bad); font-weight: 650; }
.wb-skill { font-size: 12px; }
.wb-row.clickable { cursor: pointer; }
.wb-row.clickable:hover td { background: var(--surface-2); }
.wb-row.selected td { background: var(--accent-soft); }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
select.small { padding: 4px 8px; font-size: 12.5px; width: auto; }
/* contact drill-down panel */
.wb-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); margin: 0; border-radius: 0;
  overflow-y: auto; z-index: 40; box-shadow: -8px 0 24px rgba(0,0,0,.12); padding: 16px 18px; }
.wb-panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.wb-panel-head h2 { margin: 0 0 2px; }
.wb-panel-body h3 { font-size: 13px; margin: 16px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.wb-dl { display: grid; grid-template-columns: 8.5em 1fr; gap: 4px 10px; margin: 8px 0 0; font-size: 13.5px; }
.wb-dl dt { color: var(--muted); }
.wb-dl dd { margin: 0; }
.wb-steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 13.5px; }
.wb-steps li.inactive { color: var(--muted); }
.wb-steps li .pill { margin-left: 8px; }
.wb-q { margin: 0 6px 6px 0; }
.wb-actions { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.wb-live { display: grid; gap: 4px; font-size: 13px; max-height: 260px; overflow-y: auto; }
.wb-live p { margin: 0; padding: 4px 8px; border-left: 3px solid var(--border); }
.wb-live p.mood-negative { border-left-color: var(--bad); }
.wb-live p.mood-positive { border-left-color: var(--ok); }
.wb-menu td { white-space: normal; background: var(--surface-2); }
.wb-menu button { margin: 0 4px 4px 0; }
.wb-total td { font-weight: 650; border-top: 1px solid var(--border); }
.wb-changed { margin-left: 6px; font-size: 11px; }
h3.sub { font-size: 13px; margin: 14px 0 4px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
/* queue page */
.wallboard tr.selected td { background: var(--accent-soft); }
.q-picker { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.q-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--warn-soft); color: var(--warn); font-size: 11px; font-weight: 650; }
.wb-cov tr.wb-sub td:first-child { padding-left: 26px; }
.wb-note { font-size: 12px; margin: 8px 12px 10px; }
body.mode-tv .wb-why { font-size: 15px; }

/* About page */
.about-note { margin: 0; padding: 12px 20px 16px; }
td.nowrap { white-space: nowrap; }
button.pw { font: inherit; min-width: 9.5em; text-align: left; }
