:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --border: #dfe4ec;
  --text: #1c2434;
  --muted: #64748b;
  --primary: #0a5cff;
  --primary-dark: #084ad0;
  --primary-soft: #e8f0ff;
  --success: #0f9d58;
  --success-soft: #e6f6ee;
  --warn: #b7791f;
  --warn-soft: #fdf3e0;
  --danger: #d3455b;
  --danger-soft: #fbe9ec;
  --info-soft: #eef2f8;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 30, 54, 0.08), 0 4px 16px rgba(16, 30, 54, 0.06);
  /* Headings, links, quiet fills and chips: one name each, so the dark
     theme below can give them its own values. */
  --heading: #0f1e33;
  --link: #1b5fbf;
  --link-border: #9cbbe3;
  --border-soft: #e6eaf1;
  --input-border: #c9d3e0;
  --track: #dbe2ec;
  --tint: #f4f6fa;
  --tint-blue: #e8f0fc;
  --tint-quiet: #eef2f8;
  --quiet-text: #475569;
  --amber-soft: #fdf3e0;
  --amber-text: #8a5a12;
  --teal-soft: #e2f4f4;
  --teal-text: #0b5f64;
  color-scheme: light;
  font-size: 15px;
}

/* The dark theme: the whole site, chosen with the sun/moon button (or the
   device's setting until someone chooses). Navy panels stay navy. */
:root[data-theme="dark"] {
  --bg: #0b1422;
  --surface: #131f33;
  --border: #2a3a55;
  --text: #dbe4f0;
  --muted: #9aa8ba;
  --primary: #4d8dff;
  --primary-dark: #3a7af0;
  --primary-soft: #1c2f52;
  --success: #3ccf8e;
  --success-soft: #12352a;
  --warn: #e7b04d;
  --warn-soft: #3a2d14;
  --danger: #ff6b81;
  --danger-soft: #3d1a22;
  --info-soft: #1a2840;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
  --heading: #f1f5fb;
  --link: #8cb8ff;
  --link-border: #3f5f93;
  --border-soft: #22324c;
  --input-border: #34476a;
  --track: #2a3a55;
  --tint: #18253b;
  --tint-blue: #1c2f52;
  --tint-quiet: #22324c;
  --quiet-text: #b5c1d1;
  --amber-soft: #3a2d14;
  --amber-text: #f0c070;
  --teal-soft: #123a3a;
  --teal-text: #7fe3d4;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
h1, h2, h3 { line-height: 1.25; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.loading-screen { padding: 4rem; text-align: center; color: var(--muted); }

/* ---------- layout ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.65rem 1.4rem;
  position: sticky; top: 0; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand .sub { font-weight: 400; color: var(--muted); font-size: 0.8rem; display: inline-flex; align-items: center; gap: 0.4rem; }
.brand-ringcentral { height: 18px; width: auto; vertical-align: middle; }
.login-card .brand-ringcentral { height: 22px; }
@media (max-width: 560px) { .brand .sub { display: none; } }
.topbar .actions { display: flex; align-items: center; gap: 0.9rem; }
.container { max-width: 1080px; margin: 0 auto; padding: 1.6rem 1.4rem 5rem; }
/* Sections whose table runs to a dozen columns (Users & Extensions) use the
   width of the screen instead, so the fields can be seen rather than scrolled
   to. Every block on such a page shares that width — an instructions panel or
   a terms card set narrower than the table beneath it just reads as a
   mistake. */
.container.wide { max-width: min(1760px, 97vw); }

/* ---------- cards & badges ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.2rem;
}
.card h2 { margin-top: 0; }
.grid { display: grid; gap: 1rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.badge {
  display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; white-space: nowrap;
}
.badge.not_started { background: var(--info-soft); color: var(--muted); }
.badge.in_progress { background: var(--warn-soft); color: var(--warn); }
.badge.submitted { background: var(--primary-soft); color: var(--primary-dark); }
.badge.approved, .badge.complete { background: var(--success-soft); color: var(--success); }
.badge.changes_requested, .badge.blocked { background: var(--danger-soft); color: var(--danger); }
.badge.pending { background: var(--info-soft); color: var(--muted); }
.badge.active { background: var(--success-soft); color: var(--success); }
.badge.archived { background: var(--info-soft); color: var(--muted); }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface); color: var(--text);
  padding: 0.5rem 1rem; font-size: 0.92rem; font-weight: 600;
  cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--info-soft); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-danger { background: var(--surface); border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.82rem; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.icon-btn { background: none; border: none; font-size: 1rem; cursor: pointer; color: var(--muted); }

.field { display: block; margin-bottom: 0.9rem; }
.field > .lbl { display: block; font-weight: 600; font-size: 0.86rem; margin-bottom: 0.25rem; }
.req { color: var(--danger); }
.upload-current {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 0.6rem; padding: 0.6rem 0.8rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
}
.field .hint { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 400; margin-top: 0.2rem; }
input[type="text"], input[type="email"], input[type="date"], input[type="password"], select, textarea {
  width: 100%; padding: 0.5rem 0.65rem;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.92rem; font-family: inherit; background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10, 92, 255, 0.15);
}
textarea { min-height: 84px; resize: vertical; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 1.2rem; }
.form-grid .span-2 { grid-column: 1 / -1; }

/* ---------- user (extension) multi-picker ---------- */
.user-pick .pick-search { margin-bottom: 0.4rem; }
.pick-list {
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  max-height: 190px; overflow-y: auto; padding: 0.25rem;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.pick-opt {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0.45rem; border-radius: 6px; cursor: pointer;
  font-size: 0.9rem; min-width: 0;
}
.pick-opt:hover { background: var(--info-soft); }
.pick-opt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-opt input[type="checkbox"] { width: 16px; height: 16px; flex: none; accent-color: var(--primary); }
.pick-opt.orphan span { color: var(--warn); }
.pick-foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 0.5rem; margin-top: 0.3rem; font-size: 0.78rem; color: var(--muted);
}
.pick-actions { display: flex; gap: 0.8rem; }
.link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--primary); font: inherit; font-size: 0.78rem;
}
.link-btn:hover { text-decoration: underline; }
.pick-chosen { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.pick-chosen li {
  background: var(--info-soft); border-radius: 999px;
  padding: 0.1rem 0.6rem; font-size: 0.82rem;
}

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-card { width: 100%; max-width: 400px; }
.login-card .brand { justify-content: center; margin-bottom: 1rem; flex-direction: column; text-align: center; }
.login-card .login-logo { height: 36px; max-width: 100%; margin-bottom: 0.4rem; }

/* ---------- progress ---------- */
.progress-wrap { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.progress-ring { position: relative; width: 110px; height: 110px; flex-shrink: 0; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring .pct {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.35rem;
}
.progress-bar { height: 8px; border-radius: 999px; background: var(--info-soft); overflow: hidden; }
.progress-bar > div { height: 100%; border-radius: 999px; background: var(--primary); transition: width 0.3s; }

/* ---------- section list ---------- */
.section-card {
  display: flex; align-items: center; gap: 0.9rem;
  padding: 0.95rem 1.1rem; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.1s;
}
.section-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.section-card .icon { font-size: 1.5rem; }
.section-card .title { font-weight: 700; }
.section-card .meta { margin-left: auto; text-align: right; }

/* ---------- stage timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 0.9rem; position: relative; padding-bottom: 1.1rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .dot-col { display: flex; flex-direction: column; align-items: center; width: 26px; flex-shrink: 0; }
.timeline .dot {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; color: #fff; z-index: 1;
}
.timeline .line { flex: 1; width: 2px; background: var(--border); margin-top: 2px; }
.timeline li:last-child .line { display: none; }
.timeline li.complete .dot { background: var(--success); border-color: var(--success); }
.timeline li.in_progress .dot { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 4px rgba(10,92,255,0.18); }
.timeline li.blocked .dot { background: var(--danger); border-color: var(--danger); }
.timeline .stage-name { font-weight: 700; }
.timeline .stage-desc { color: var(--muted); font-size: 0.83rem; }
.timeline .stage-meta { font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; }

/* ---------- wizard ---------- */
.wizard-head { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.wizard-head h1 { margin: 0; font-size: 1.45rem; }
.wizard-nav { display: flex; justify-content: space-between; gap: 0.8rem; margin-top: 1.4rem; flex-wrap: wrap; }
.instructions {
  background: var(--primary-soft); border: 1px solid #c6dbff;
  border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1.2rem;
}
.instructions ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.instructions li { margin-bottom: 0.25rem; font-size: 0.88rem; }
.review-note {
  background: var(--danger-soft); border: 1px solid #f2c4cc;
  border-radius: var(--radius); padding: 0.8rem 1.1rem; margin-bottom: 1.2rem;
}

/* A subsection completed on its parent's page (Number Blocks & Ranges under
   Phone Numbers). The rule and heading say "still the same section, next part
   of the job" — a card of its own would read as a separate section. */
.section-block + .section-block { margin-top: 1.6rem; }
.subsection-head {
  display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap;
  border-top: 2px solid var(--border); padding-top: 1.2rem; margin-bottom: 0.9rem;
}
.subsection-head h2 { margin: 0; font-size: 1.15rem; }

/* data tables */
.table-wrap { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-size: 0.86rem; }
table.data th {
  text-align: left; padding: 0.45rem 0.5rem; white-space: nowrap;
  border-bottom: 2px solid var(--border); font-size: 0.78rem;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em;
}
table.data td { padding: 0.3rem 0.3rem; border-bottom: 1px solid var(--border); vertical-align: top; min-width: 98px; }
/* Inputs fill their cell rather than setting their own floor, so the column
   widths below decide the layout and nothing forces the table wider than it
   needs to be. They are set a little tighter than a standalone form field
   too — a dozen columns of full-size inputs is what pushes this table off
   the side of the screen. */
table.data td input, table.data td select, table.data td textarea {
  width: 100%; min-width: 0;
  padding: 0.35rem 0.45rem; font-size: 0.85rem;
}
/* Sized by what the field holds: an email address needs room, a Yes/No
   dropdown does not. */
/* Columns TelcoDataCloud fills in during the build (the temporary numbers a
   destination answers on until its real number ports). On the reviewer's
   copy of a section these are the only editable cells in an otherwise
   read-only table, so they are tinted to say so. */
table.data td.col-admin input:not(:disabled) { background: var(--warn-soft); border-color: #e8d3ab; }

table.data th.col-email, table.data td.col-email { min-width: 168px; }
table.data th.col-select, table.data td.col-select,
table.data th.col-siteRef, table.data td.col-siteRef,
table.data th.col-numberRef, table.data td.col-numberRef,
table.data th.col-userRefs, table.data td.col-userRefs { min-width: 126px; }
table.data th.col-date, table.data td.col-date { min-width: 128px; }
table.data th.col-textarea, table.data td.col-textarea { min-width: 220px; }
table.data td.rm { min-width: 0; }
/* A full national number (08 9318 8000, or +61 8 9318 8000) has to be legible
   in the row without opening the picker, so this column gets its own floor. */
table.data td select.number-ref { min-width: 170px; }
table.data td.rm { min-width: 30px; width: 30px; }

/* row cards (sites, queues, ivrs) */
.row-card { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.9rem; overflow: hidden; }
.row-card > summary {
  list-style: none; cursor: pointer; padding: 0.8rem 1.1rem;
  display: flex; align-items: center; gap: 0.7rem;
  background: var(--info-soft); font-weight: 700;
}
.row-card > summary::-webkit-details-marker { display: none; }
.row-card > summary .chev { transition: transform 0.15s; color: var(--muted); }
.row-card[open] > summary .chev { transform: rotate(90deg); }
.row-card .body { padding: 1rem 1.1rem 0.4rem; }
.row-card .rm-row { text-align: right; padding: 0 1.1rem 0.8rem; }
.group-label { grid-column: 1 / -1; font-weight: 700; font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin: 0.6rem 0 0.4rem; border-top: 1px dashed var(--border); padding-top: 0.7rem; }

/* ---------- admin ---------- */
.client-row {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr auto; gap: 0.8rem;
  align-items: center; padding: 0.85rem 1.1rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); margin-bottom: 0.7rem; cursor: pointer;
  box-shadow: var(--shadow);
}
.client-row:hover { border-color: var(--primary); }
.client-row .company { font-weight: 700; }
@media (max-width: 720px) { .client-row { grid-template-columns: 1fr; } }

.tabs { display: flex; gap: 0.3rem; border-bottom: 1px solid var(--border); margin-bottom: 1.2rem; flex-wrap: wrap; }
.tabs button {
  background: none; border: none; padding: 0.55rem 0.95rem; cursor: pointer;
  font-size: 0.92rem; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1rem; font-size: 0.9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16, 24, 40, 0.45);
  /* The page behind a modal is blurred, so the modal stands out. */
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 1rem;
}
@media (prefers-reduced-transparency: reduce) {
  .modal-backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(16, 24, 40, 0.6); }
}
.modal { background: var(--surface); border-radius: var(--radius); max-width: 480px; width: 100%; padding: 1.4rem 1.5rem; max-height: 90vh; overflow-y: auto; }
.modal h3 { margin-top: 0; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 1rem; }
.admin-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.8rem;
  padding: 0.6rem 0; border-bottom: 1px solid var(--border);
}
.admin-row:last-child { border-bottom: none; }
.admin-row .company { font-weight: 700; }

/* ---------- toast ---------- */
#toast {
  position: fixed; bottom: 1.4rem; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 0.6rem 1.2rem;
  border-radius: 999px; font-size: 0.9rem; z-index: 200;
  opacity: 0; transition: opacity 0.25s; pointer-events: none; max-width: 90vw;
}
#toast.show { opacity: 1; }
#toast.error { background: var(--danger); }

/* ---------- copilot ---------- */
.copilot-fab {
  position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 90;
  width: 56px; height: 56px; border-radius: 50%;
  border: none; cursor: pointer; font-size: 1.5rem; color: #fff;
  background: linear-gradient(135deg, var(--primary), #6a3df5);
  box-shadow: 0 6px 20px rgba(10, 92, 255, 0.4);
}
.copilot-panel {
  position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 95;
  width: 370px; max-width: calc(100vw - 2rem); height: 520px; max-height: calc(100vh - 3rem);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 12px 40px rgba(16, 30, 54, 0.25);
  display: flex; flex-direction: column; overflow: hidden;
}
.copilot-header {
  padding: 0.85rem 1.1rem; display: flex; justify-content: space-between; align-items: flex-start;
  background: linear-gradient(135deg, var(--primary), #6a3df5); color: #fff;
}
.copilot-header .copilot-sub { font-size: 0.75rem; opacity: 0.85; }
.copilot-header .icon-btn { color: #fff; }
.copilot-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.copilot-msg { max-width: 88%; padding: 0.55rem 0.85rem; border-radius: 14px; font-size: 0.88rem; white-space: pre-wrap; }
.copilot-msg.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.copilot-msg.assistant { align-self: flex-start; background: var(--info-soft); border-bottom-left-radius: 4px; }
.copilot-msg.typing { color: var(--muted); font-style: italic; }
.copilot-input { display: flex; gap: 0.5rem; padding: 0.7rem; border-top: 1px solid var(--border); }
.copilot-input input { flex: 1; }

/* ---------- admin client view (impersonation) ---------- */
.impersonation-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 0.6rem 1.4rem; font-size: 0.86rem;
  background: var(--warn-soft); color: #7c5510; border-bottom: 2px solid #e6c98a;
  position: sticky; top: 0; z-index: 90;
}
.impersonation-bar .btn { background: #fff; border-color: #d9b36a; white-space: nowrap; }
.impersonation-bar > span:first-child { flex: 1 1 420px; min-width: 0; }
.cv-hide {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid #d9b36a; background: #fff; color: #7c5510;
  font-size: 0.85rem; cursor: pointer; display: grid; place-items: center;
}
.cv-hide:hover { background: #fdf3e0; }
/* The banner, hidden: a small yellow eye pinned top right brings it back. The
   button is a 26px target around a 16px badge, so it stays easy to hit. */
.cv-eye {
  position: fixed; top: 3px; right: 3px; z-index: 95; width: 26px; height: 26px; padding: 0;
  display: grid; place-items: center; cursor: pointer; background: none; border: 0; border-radius: 50%;
}
.cv-eye-face {
  position: relative; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center;
  background: #ffd58a; color: #5c3d06; box-shadow: 0 0 0 1.5px #fff, 0 1px 4px rgba(12, 35, 64, 0.35);
}
.cv-eye-face svg { width: 11px; height: 11px; }
.cv-eye:hover .cv-eye-face { background: #ffc85c; }
.cv-eye:focus-visible, .cv-hide:focus-visible { outline: 2px solid #1f6fd0; outline-offset: 2px; }
.cv-eye-dot { position: absolute; top: -2px; right: -2px; width: 6px; height: 6px; border-radius: 50%; background: #e0702a; box-shadow: 0 0 0 1px #fff; }
.cv-eye-on .cp-band, .cv-eye-on .topbar { padding-right: 2.2rem; }
.impersonation-bar-end { display: flex; align-items: center; gap: 0.7rem; margin-left: auto; flex-shrink: 0; }
.client-row-actions { display: flex; align-items: center; gap: 0.5rem; justify-content: flex-end; flex-wrap: wrap; }

/* Deep link to an external tool from a timeline stage (e.g. number porting) */
.stage-link {
  font-size: 0.78rem; font-weight: 600; text-decoration: none; white-space: nowrap;
  color: var(--primary); background: var(--primary-soft);
  border: 1px solid #c6dbff; border-radius: 999px; padding: 0.1rem 0.55rem;
}
.stage-link:hover { background: #d9e7ff; }

/* ---------- bulk spreadsheet upload ---------- */
.bulk-panel {
  display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: var(--info-soft); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 0.9rem 1.1rem; margin-bottom: 1rem;
}
.bulk-panel .bulk-copy { flex: 1; min-width: 260px; }
.bulk-panel .bulk-copy p { margin: 0.25rem 0 0; }
.bulk-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.bulk-result {
  border-radius: var(--radius); padding: 0.8rem 1.1rem; margin-bottom: 1rem; font-size: 0.88rem;
}
.bulk-result.ok { background: var(--success-soft); border: 1px solid #b7e3cb; color: #0b6b3d; }
.bulk-result.error { background: var(--danger-soft); border: 1px solid #f2c4cc; color: #96233a; }
.bulk-problems { margin: 0.5rem 0 0; padding-left: 1.1rem; max-height: 240px; overflow-y: auto; }
.bulk-problems li { margin-bottom: 0.15rem; }

/* ---------- settings ---------- */
.toggle-row {
  display: flex; gap: 0.7rem; align-items: flex-start; cursor: pointer;
  padding: 0.55rem 0; border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row input[type="checkbox"] { width: 17px; height: 17px; margin-top: 0.15rem; flex: none; accent-color: var(--primary); }
.toggle-row .toggle-label { display: block; font-weight: 600; font-size: 0.9rem; }
.toggle-row .muted { display: block; }
.toggle-master { border-bottom: none; padding: 0; }
table.settings-table th {
  text-transform: none; letter-spacing: 0; font-size: 0.82rem;
  width: 190px; vertical-align: top; padding: 0.5rem 0.8rem 0.5rem 0;
}
table.settings-table td { min-width: 0; padding: 0.5rem 0; }
.setup-steps { margin: 0; padding-left: 1.2rem; font-size: 0.88rem; line-height: 1.65; }
.setup-steps li { margin-bottom: 0.5rem; }
.setup-steps code, .settings-table code {
  background: var(--info-soft); border-radius: 5px; padding: 0.05rem 0.35rem; font-size: 0.85em;
}

/* ---------- audit log ---------- */
.audit-filters {
  display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end;
}
.audit-filter-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
table.audit-table td { min-width: 0; font-size: 0.83rem; }
table.audit-table td.nowrap, .audit-pager .nowrap { white-space: nowrap; }
table.audit-table .audit-action { font-weight: 600; }
table.audit-table .audit-detail { min-width: 220px; }
table.audit-table tr.audit-warning td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
table.audit-table tr.audit-error td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
table.audit-table tr.audit-error { background: var(--danger-soft); }
.audit-pager {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.8rem; flex-wrap: wrap; margin-top: 0.9rem;
}

/* ---------- multi-file uploads ---------- */
.upload-current + .upload-current { margin-top: 0.5rem; }
.upload-add {
  display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-top: 0.7rem;
}
/* A value the browser flags as not matching the column's pattern (e.g. a
   malformed MAC address) — the wizard also blocks submission on it. */
/* Only flag a field once someone has tried it, not on an empty form. */
input:user-invalid, textarea:user-invalid, select:user-invalid { border-color: var(--danger); background: var(--danger-soft); }

/* Shown when the tab is running an older build than the server (see
   checkForNewVersion in app.js). Pinned to the bottom so it never covers the
   form the user is mid-way through filling in. */
.update-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  gap: 1rem; flex-wrap: wrap; padding: 0.75rem 1.4rem; font-size: 0.88rem;
  background: var(--warn-soft); color: #7c5510;
  border-top: 2px solid #e6c98a; box-shadow: 0 -4px 18px rgba(16, 30, 54, 0.12);
}
.update-bar .btn { background: #fff; border-color: #d9b36a; }
.update-bar .btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }

/* A cell whose extension or login email is already used elsewhere in the BRD.
   Flagged live while typing; blocks submitting the section. */
input.dup, select.dup {
  border-color: var(--danger); background: var(--danger-soft);
  box-shadow: 0 0 0 2px rgba(211, 69, 91, 0.12);
}
#section-problems { margin-top: 1.2rem; }

/* ---------- stage detail: build checklist & training ---------- */
.stage-detail {
  margin-top: 0.7rem; padding: 0.7rem 0.9rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
}
.stage-detail-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 0.6rem; margin-bottom: 0.4rem; font-size: 0.88rem;
}
.stage-note {
  margin-top: 0.6rem; padding: 0.5rem 0.8rem; font-size: 0.83rem;
  background: var(--primary-soft); border: 1px solid #c6dbff; border-radius: 8px;
}
.stage-note .btn { padding: 0.1rem 0.5rem; }

.task-list { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.task-list li {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.6rem; padding: 0.25rem 0; font-size: 0.88rem;
}
.task-list li label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.task-list li.done > label > span { color: var(--muted); text-decoration: line-through; }
.task-list input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--success); }

/* Per-site build steps. A site that isn't switched on is still listed — the
   point of the panel is that an admin can see which sites are being tracked
   separately and turn the rest on — so an off group is deliberately quiet. */
.site-step-group {
  padding: 0.5rem 0 0.1rem;
  border-top: 1px solid var(--border);
}
.site-step-group:first-of-type { border-top: none; }
.site-step-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.6rem; flex-wrap: wrap; font-size: 0.88rem;
}
.site-toggle { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.site-toggle input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.site-toggle .site-name { font-weight: 600; }
.site-step-group:not(.on) .site-name { font-weight: 500; color: var(--muted); }
.site-step-group .task-list { margin-left: 1.6rem; }

/* Go-live per site. The cut-over dates are the thing an admin scans for, so
   the row leads with the site and keeps the control on the right. */
.site-date-list { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.site-date-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.6rem; flex-wrap: wrap;
  padding: 0.4rem 0; border-top: 1px solid var(--border);
}
.site-date-row:first-child { border-top: none; }
.site-date-main { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; min-width: 0; }
.site-date-main .site-name { font-weight: 600; font-size: 0.9rem; }
.site-date-actions { display: flex; align-items: center; gap: 0.4rem; }
.site-date-actions input[type="date"] { width: auto; }
.site-date-row.scheduled .site-date-actions input[type="date"] { border-color: var(--primary); }
.site-date-note { flex-basis: 100%; margin-top: -0.15rem; }

.session-list { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.session-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 0.8rem; flex-wrap: wrap;
  padding: 0.6rem 0; border-bottom: 1px solid var(--border);
}
.session-row:last-child { border-bottom: none; }
.session-label { font-weight: 600; font-size: 0.89rem; }
.session-when { font-size: 0.86rem; }
.session-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.badge.session-unscheduled { background: var(--info-soft); color: var(--muted); }
.badge.session-requested { background: var(--warn-soft); color: var(--warn); }
.badge.session-confirmed { background: var(--primary-soft); color: var(--primary-dark); }
.badge.session-completed { background: var(--success-soft); color: var(--success); }
.badge.session-cancelled { background: var(--danger-soft); color: var(--danger); }
.session-add {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  margin-top: 0.7rem; padding-top: 0.6rem; border-top: 1px dashed var(--border);
}
.avail-note {
  font-size: 0.85rem; padding: 0.5rem 0.7rem; border-radius: 6px; margin-bottom: 0.6rem;
  background: var(--info-soft); color: var(--muted);
}
.avail-note.ok { background: var(--success-soft); color: var(--success); }
.avail-note.busy { background: var(--danger-soft); color: var(--danger); }
.avail-note.checking { background: var(--info-soft); color: var(--muted); }

/* ---------- project contacts, team & help ---------- */
.contact-list { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.contact-list li {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 0.8rem; flex-wrap: wrap;
  padding: 0.55rem 0; border-bottom: 1px solid var(--border);
}
.contact-list li:last-child { border-bottom: none; }
.contact-name { font-weight: 600; font-size: 0.9rem; }
.contact-links { display: flex; flex-direction: column; align-items: flex-end; font-size: 0.83rem; }
.contact-links a { color: var(--primary); text-decoration: none; }
.contact-links a:hover { text-decoration: underline; }

.tab-count {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 0.3rem;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: 0.72rem; line-height: 18px; text-align: center;
}
/* The same pill, for a figure rather than a warning: a tab badge in the
   danger colour means somebody needs to act, and a duration does not. */
.tab-note {
  display: inline-block; padding: 0 7px; margin-left: 0.3rem;
  border-radius: 999px; background: var(--bg); color: var(--muted);
  border: 1px solid var(--border);
  font-size: 0.72rem; line-height: 17px; font-variant-numeric: tabular-nums;
}
.help-request { padding: 0.8rem 0; border-bottom: 1px solid var(--border); }
/* A ticket folds to its heading; the heading is the button that opens it. */
.tk-list-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.6rem 1rem; flex-wrap: wrap; }
.tk-fold-all { display: flex; gap: 0.4rem; }
.tk-toggle {
  display: flex; align-items: flex-start; gap: 0.5rem; width: 100%; padding: 0.35rem 0.5rem; margin: -0.35rem -0.5rem;
  box-sizing: content-box; background: none; border: 0; border-radius: 8px; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.tk-toggle:hover { background: var(--tint); }
.tk-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 0; }
.tk-toggle-main { display: block; min-width: 0; flex: 1; }
.tk-toggle-main .help-head { margin-bottom: 0.15rem; }
.tk-toggle-meta { display: block; }
.tk-chev { flex: none; margin-top: 0.3rem; color: var(--muted); transition: transform 0.15s ease; }
.tk-open .tk-chev { transform: rotate(90deg); }
.tk-body { padding: 0.4rem 0 0 1.5rem; }
@media (max-width: 720px) { .tk-body { padding-left: 0; } }
@media (prefers-reduced-motion: reduce) { .tk-chev { transition: none; } }
.help-request:last-child { border-bottom: none; }
.help-request.resolved { opacity: 0.65; }
.help-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.help-message {
  white-space: pre-wrap; font-size: 0.88rem; margin: 0.5rem 0;
  padding: 0.6rem 0.8rem; background: var(--bg); border-radius: 8px;
}

/* Help requests are a two-way chat, so they're laid out like one: their
   messages on the left, yours on the right, newest at the bottom. */
.chat-log {
  display: flex; flex-direction: column; gap: 0.55rem;
  max-height: 340px; overflow-y: auto;
  padding: 0.7rem 0.8rem; margin: 0.6rem 0;
  background: var(--bg); border-radius: 10px;
}
.chat-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 82%; }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-bubble {
  white-space: pre-wrap; overflow-wrap: anywhere;
  font-size: 0.88rem; padding: 0.5rem 0.75rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px 12px 12px 3px;
}
.chat-msg.mine .chat-bubble {
  background: var(--primary-soft); border-color: var(--primary-soft);
  border-radius: 12px 12px 3px 12px;
}
.chat-meta { font-size: 0.72rem; color: var(--muted); margin-top: 0.15rem; }
.chat-composer { display: flex; gap: 0.5rem; align-items: flex-end; margin-bottom: 0.5rem; }
.chat-composer textarea {
  flex: 1; resize: vertical; font: inherit; font-size: 0.88rem;
  padding: 0.5rem 0.7rem; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text);
}
.chat-composer textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }

/* Sections TelcoDataCloud fills in on the client's behalf */
.owned-note {
  background: var(--info-soft); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.8rem 1.1rem; margin-bottom: 1.2rem; font-size: 0.9rem;
}
/* An outstanding request to unlock an approved section — someone is waiting on
   the other side, so it reads as pending rather than as neutral information. */
.owned-note.unlock-pending { background: var(--warn-soft); border-color: var(--warn); }
.section-card.admin-owned { opacity: 0.85; }

/* Section terms (number porting responsibilities) */
.terms-card { border-left: 4px solid var(--warn); }
.terms-points { margin: 0.4rem 0 0.8rem; padding-left: 1.2rem; font-size: 0.88rem; line-height: 1.6; }
.terms-points li { margin-bottom: 0.4rem; }
.terms-accept {
  border-top: 1px solid var(--border); border-bottom: none;
  padding-top: 0.8rem; margin-top: 0.4rem;
}

/* Terms acceptance — a permanent record once made, so it reads as a receipt
   rather than an editable setting. */
.terms-status {
  padding: 0.6rem 0.9rem; border-radius: 8px; font-size: 0.88rem;
}
.terms-status.accepted { background: var(--success-soft); color: #0b6b3d; }
.terms-status.pending { background: var(--warn-soft); color: #7c5510; }
.terms-accept.accepted { background: var(--success-soft); border-radius: 8px; padding: 0.8rem; }
.terms-accept.accepted input[type="checkbox"] { accent-color: var(--success); }
.terms-accept.accepted input[disabled] { cursor: default; }

/* ---------- single sign-on ---------- */
.sso-block { margin-bottom: 1.1rem; }
.sso-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.55rem;
  width: 100%; margin-bottom: 0.5rem; text-decoration: none;
  font-weight: 600; padding: 0.6rem 1rem;
}
.sso-btn span { font-size: 1.05rem; }
.sso-btn:hover { border-color: var(--primary); background: var(--primary-soft); }
.sso-divider {
  display: flex; align-items: center; gap: 0.7rem;
  margin: 1rem 0 0.2rem; color: var(--muted); font-size: 0.8rem;
}
.sso-divider::before, .sso-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ---------- client login management ---------- */
.login-row.is-disabled { opacity: 0.6; }
.login-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- admin analytics ---------- */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem; margin: 1rem 0 1.4rem;
}
.stat-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 1rem 1.1rem;
}
.stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1.1; color: var(--primary-dark, var(--primary)); }
.stat-label { font-size: 0.85rem; color: var(--muted); margin-top: 0.2rem; }
.stat-hint { margin-top: 0.15rem; }
.bar-row { display: grid; grid-template-columns: 9rem 1fr 3rem; align-items: center; gap: 0.6rem; margin: 0.45rem 0; }
.bar-label { font-size: 0.85rem; }
.bar-track { height: 10px; border-radius: 999px; background: var(--info-soft); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--primary); }
/* A long bill is extracted chunk by chunk; the bar is how someone knows the
   minutes it takes are work and not a hang. */
.extract-progress { margin-top: 0.8rem; }
.extract-progress .bar-fill { transition: width 0.4s ease; }
.bar-value { font-size: 0.82rem; text-align: right; font-weight: 600; color: var(--muted); }
.velocity-chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; margin-top: 0.5rem; }
.velocity-col { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 100%; }
.velocity-bar { width: 45%; min-height: 2px; border-radius: 3px 3px 0 0; }
.velocity-bar.approved { background: var(--success); }
.velocity-bar.submitted { background: var(--primary); }
.velocity-legend { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.5rem; }
.velocity-legend .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.velocity-legend .dot.approved { background: var(--success); }
.velocity-legend .dot.submitted { background: var(--primary); margin-left: 0.6rem; }
/* What clients ask about, as a tally rather than a chart: the words are the
   content, so they are sized evenly and the count rides alongside. */
.topic-cloud { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.2rem 0 0.8rem; }
.topic-chip {
  display: inline-flex; align-items: baseline; gap: 0.35rem;
  background: var(--info-soft); border: 1px solid var(--border); border-radius: 999px;
  padding: 0.2rem 0.7rem; font-size: 0.85rem;
}
.topic-chip b { color: var(--primary-dark); font-size: 0.78rem; }
.plain-list { list-style: none; margin: 0.3rem 0 0; padding: 0; }
.plain-list li { padding: 0.25rem 0; font-size: 0.9rem; border-bottom: 1px solid var(--border); }
.plain-list li:last-child { border-bottom: none; }

.data-table { width: 100%; border-collapse: collapse; margin-top: 0.6rem; }
.data-table th, .data-table td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.data-table th { color: var(--muted); font-weight: 600; font-size: 0.8rem; }
.data-table td.nowrap { white-space: nowrap; }
.data-table tr.warn td { background: var(--warn-soft); }
.data-table tr.danger td { background: var(--danger-soft); }

/* ---------- copilot review / prefill ---------- */
/* The number check's headline counts, above the per-block table. */
/* The pre-fill action above the BRD section cards. */
/* The clock on a client page. Deliberately visible to the person being timed
   — this is a record of work, not a watch nobody knows about. */
.client-clock-line { margin-top: 0.25rem; }
#client-clock { font-variant-numeric: tabular-nums; }
.clock-live { color: var(--success); font-weight: 600; }
/* Paused: the clock is still on screen, but it is plainly not counting. */
.clock-paused { color: var(--muted); font-style: italic; }

/* The Time tab: spent and projected side by side, then the ledger they are
   made of. */
.time-headline {
  display: flex; flex-wrap: wrap; gap: 2rem;
  margin: 0.4rem 0 0.9rem;
}
.time-figure { display: flex; flex-direction: column; gap: 0.1rem; }
.time-big { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ledger-scroll { max-height: 22rem; overflow-y: auto; }
/* An entry that has not happened yet reads as a forecast, not a record. */
tr.ledger-todo td { color: var(--muted); }

.brd-tab-actions {
  display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.nr-totals {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem;
  padding: 0.6rem 0.8rem; margin-bottom: 0.6rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.88rem;
}

.review-findings { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.review-findings li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; line-height: 1.5; }
.review-findings li:last-child { border-bottom: none; }
.review-findings .badge { margin-right: 0.4rem; }
.ai-preview-head { margin: 0.8rem 0 0.4rem; font-size: 0.9rem; }
.wc-summary { font-size: 0.92rem; line-height: 1.6; }
/* ---------- RingCentral push (admin, allowlisted) ---------- */
/* The environment is the one thing an admin must never misread: sandbox is
   quiet, PRODUCTION is loud, and a production Access card carries a red edge. */
.rc-env {
  display: inline-block; padding: 1px 9px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em;
}
.rc-env-sandbox { background: var(--info-soft); color: var(--primary-dark); }
.rc-env-production { background: var(--danger); color: #fff; }
.rc-env-none { background: var(--bg); color: var(--muted); font-weight: 500; }
.rc-access.rc-production { border-left: 4px solid var(--danger); }

.rc-fields { border-collapse: collapse; margin: 0.6rem 0; width: 100%; max-width: 640px; }
.rc-fields th { text-align: left; font-weight: 600; color: var(--muted); padding: 0.3rem 1rem 0.3rem 0; width: 180px; vertical-align: top; }
.rc-fields td { padding: 0.3rem 0; }
.rc-set { font-family: ui-monospace, Consolas, monospace; color: var(--text); }
.rc-ok { color: var(--success); font-weight: 600; }
.rc-bad { color: var(--danger); font-weight: 600; }
.rc-warn { color: var(--warn); font-weight: 600; }

.rc-scopes { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0; }
.rc-scope { padding: 2px 9px; border-radius: 999px; font-size: 0.78rem; border: 1px solid var(--border); }
.rc-scope.on { background: var(--success-soft); color: var(--success); border-color: transparent; }
.rc-scope.off { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.rc-warnings { margin: 0.4rem 0; padding-left: 1.2rem; color: var(--warn); font-size: 0.85rem; }

.rc-section-grid {
  display: grid; gap: 1rem; margin-top: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.rc-section-card { margin: 0; }
/* Push previews and runs. A plan is a table you can check row by row: what
   happens to each site, what is sent, and anything that stops it. */
.modal.modal-wide { max-width: 1000px; }
.rc-items-scroll { max-height: 55vh; overflow: auto; margin: 0.6rem 0; }
.rc-items td { vertical-align: top; }
.rc-op, .rc-run-status {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; white-space: nowrap;
}
.rc-op-create { background: var(--primary-soft); color: var(--primary-dark); }
.rc-op-update { background: var(--info-soft); color: var(--primary-dark); }
.rc-op-skip { background: var(--bg); color: var(--muted); }
.rc-op-blocked { background: var(--danger-soft); color: var(--danger); }
.rc-op-drift { background: var(--warn-soft); color: var(--warn); }
.rc-run-succeeded, .rc-run-skipped { background: var(--success-soft); color: var(--success); }
.rc-run-failed, .rc-run-blocked, .rc-run-interrupted { background: var(--danger-soft); color: var(--danger); }
.rc-run-partial, .rc-run-drift { background: var(--warn-soft); color: var(--warn); }
.rc-run-running, .rc-run-planned, .rc-run-previewed { background: var(--info-soft); color: var(--primary-dark); }
.rc-run-expired { background: var(--bg); color: var(--muted); }
.rc-note { font-size: 0.8rem; margin-top: 0.25rem; }
.rc-note-block { color: var(--danger); }
.rc-note-warn { color: var(--warn); }
.rc-note-info { color: var(--muted); }
.rc-request pre {
  font-size: 0.75rem; background: var(--bg); padding: 0.5rem; border-radius: 6px;
  max-height: 240px; overflow: auto; margin: 0.3rem 0 0;
}
.rc-reasons { margin: 0.3rem 0; padding-left: 1.2rem; color: var(--muted); font-size: 0.85rem; }
.rc-section-later { opacity: 0.7; }
.rc-prod-ack {
  display: flex; gap: 0.5rem; align-items: center; margin: 0.6rem 0;
  padding: 0.6rem 0.8rem; border-radius: 8px; background: var(--danger-soft); color: var(--danger);
}
/* Roles: the custom roles on the card, and the permission picker. */
.rc-custom-roles { margin: 0.5rem 0; padding: 0.5rem 0.7rem; border-radius: 8px; background: var(--bg); }
.rc-custom-role { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-top: 0.35rem; }
.rc-custom-role > span:first-child { flex: 1 1 auto; }
.rc-perm-list { max-height: 50vh; overflow: auto; }
.rc-perm-group { border: 1px solid var(--border); border-radius: 8px; margin: 0 0 0.6rem; padding: 0.4rem 0.7rem; }
.rc-perm-group legend { font-weight: 600; font-size: 0.85rem; padding: 0 0.3rem; }
.rc-perm { display: block; font-size: 0.85rem; padding: 0.12rem 0; }

/* ---------- client portal: header band, sidebar, Overview ---------- */
/* The client's own support portal: a navy band naming them, a full-height
   sidebar, and white cards on the page background. */
.cp-band {
  display: flex; align-items: center; gap: 0.9rem 1.2rem; flex-wrap: wrap;
  padding: 0.75rem 1.75rem; min-height: 80px; position: relative; z-index: 5;
}
/* Dark (the portal's navy) and light (white) banners. Each shows its own
   version of the RingCentral and TelcoDataCloud logos. */
.cp-band-dark {
  background: #0c2340; color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 2px 10px rgba(12, 35, 64, 0.18);
}
.cp-band-light {
  background: var(--surface); color: var(--heading); border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(12, 35, 64, 0.06);
}
:root:not([data-theme="dark"]) .cp-on-dark, :root[data-theme="dark"] .cp-on-light { display: none !important; }
.topbar-theme-btn {
  width: 36px; height: 36px; padding: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--heading); border: 1px solid var(--border);
}
.topbar-theme-btn:hover { background: var(--tint-blue); }
.topbar-theme-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.cp-badge {
  width: 48px; height: 48px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center; background: #fff; color: #0c2340;
  font-weight: 800; font-size: 1.05rem; letter-spacing: 0.02em;
}
.cp-band-light .cp-badge:not(.cp-badge-logo) { background: #0c2340; color: #fff; }
.cp-badge:hover { text-decoration: none; }
/* A light logo made for a dark bar sits straight on the navy, and larger. */
.cp-badge.cp-badge-bare { background: none; padding: 0; border-radius: 0; max-width: 210px; }
.cp-badge.cp-badge-bare img { height: 50px; max-width: 210px; }
/* The client's full-colour logo, for the light banner, sits bare on white. */
.cp-badge .cp-logo-light { display: none; }
.cp-band-light .cp-badge-has-light { background: none; padding: 0; border-radius: 0; max-width: 210px; }
.cp-band-light .cp-badge-has-light .cp-logo-main { display: none; }
.cp-band-light .cp-badge-has-light .cp-logo-light { display: block; height: 50px; max-width: 210px; }
/* Only a white logo and a light banner: give it a navy tile so it shows. */
.cp-band-light .cp-badge-bare:not(.cp-badge-has-light) { background: #0c2340; padding: 6px 10px; border-radius: 10px; }
.cp-band-light .cp-badge-bare:not(.cp-badge-has-light) img { height: 40px; }
.cp-band-rule { align-self: stretch; width: 1px; margin: 0.25rem 0; background: rgba(255, 255, 255, 0.18); }
.cp-band-light .cp-band-rule { background: var(--border); }
.cp-band-title { flex: 1 1 260px; min-width: 0; }
.cp-band-name { display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap; font-weight: 700; font-size: 1.32rem; line-height: 1.2; letter-spacing: -0.01em; }
.cp-band-name img { display: block; height: 22px; width: auto; }
.cp-band-sub { display: flex; align-items: center; gap: 0.45rem; font-size: 0.78rem; margin-top: 0.35rem; color: #c5d0e0; }
.cp-band-light .cp-band-sub { color: var(--muted); }
.cp-band-sub img { display: block; height: 16px; width: auto; }
.cp-band-actions { display: flex; align-items: center; gap: 0.6rem 0.9rem; flex-wrap: wrap; }
.cp-band-raise {
  min-height: 44px; padding: 0 1rem; border-radius: 999px; font: inherit; font-weight: 600; white-space: nowrap; cursor: pointer;
  background: #1f6fd0; border: 0; color: #fff;
}
/* Same solid blue as the support-number button beside it, in both modes. */
.cp-band-raise:hover { filter: brightness(1.08); }
.cp-band-raise:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.cp-after-hours {
  display: inline-flex; align-items: center; min-height: 44px; box-sizing: border-box;
  background: #1f6fd0; color: #fff; font-weight: 600; white-space: nowrap;
  padding: 0 1rem; border-radius: 999px;
}
.cp-after-hours:hover { text-decoration: none; filter: brightness(1.08); }
.cp-demo-pill {
  font-size: 0.78rem; font-weight: 700; white-space: nowrap; letter-spacing: 0.01em;
  color: #0f2240; background: #ffd58a; border-radius: 999px; padding: 0.2rem 0.65rem;
}
.cp-account { position: relative; }
/* The account button is a round profile icon; the name is in its menu. */
.cp-account-btn, .cp-theme-btn {
  width: 44px; height: 44px; padding: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: rgba(255, 255, 255, 0.08); color: #fff; border: 1px solid rgba(255, 255, 255, 0.22);
}
.cp-account-btn:hover, .cp-account-btn[aria-expanded="true"], .cp-theme-btn:hover { background: rgba(255, 255, 255, 0.16); }
.cp-band-light .cp-account-btn, .cp-band-light .cp-theme-btn { background: var(--tint); color: var(--heading); border-color: var(--border); }
.cp-band-light .cp-account-btn:hover, .cp-band-light .cp-account-btn[aria-expanded="true"], .cp-band-light .cp-theme-btn:hover { background: var(--tint-blue); }
.cp-account-btn:focus-visible, .cp-theme-btn:focus-visible { outline: 2px solid #1f6fd0; outline-offset: 2px; }
.cp-avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  background: #fff; color: #0c2340; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.02em;
}
.cp-band-light .cp-avatar { background: #0c2340; color: #fff; }
.cp-account-who { padding: 0.45rem 0.7rem 0.4rem; font-weight: 700; border-bottom: 1px solid var(--border); margin-bottom: 0.2rem; }
.cp-account-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 180px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow); padding: 0.3rem; display: flex; flex-direction: column;
}
.cp-account-menu button {
  text-align: left; padding: 0.5rem 0.7rem; border: 0; background: none; border-radius: 6px;
  font: inherit; color: inherit; cursor: pointer;
}
.cp-account-menu button:hover { background: var(--info-soft); }

.cp-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); min-height: calc(100vh - 76px); }
.cp-nav {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 0.9rem 0.7rem 2rem; display: flex; flex-direction: column; gap: 0.1rem;
}
.cp-nav-group {
  margin: 1.3rem 0 0.35rem; padding: 0 0.8rem; font-size: 0.73rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.cp-nav-link {
  position: relative; display: flex; align-items: center; gap: 0.7rem;
  min-height: 42px; box-sizing: border-box; padding: 0.45rem 0.8rem; border-radius: 10px;
  color: var(--text); font: inherit; font-size: 0.97rem; line-height: 1.3;
  background: none; border: 0; text-align: left; cursor: pointer;
}
.cp-nav-icon { flex: none; color: var(--muted); }
.cp-nav-label { flex: 1 1 auto; min-width: 0; }
.cp-nav-link:hover { background: var(--tint); text-decoration: none; }
.cp-nav-link:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.cp-nav-link.active { background: var(--primary-soft); color: var(--link); font-weight: 650; }
.cp-nav-link.active .cp-nav-icon { color: var(--link); }
/* A short bar on the left edge marks the page you're on. */
.cp-nav-link.active::before {
  content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--primary);
}
.cp-nav-aside {
  flex: none; font-size: 0.78rem; font-weight: 600; line-height: 1; white-space: nowrap;
  padding: 0.28rem 0.55rem; border-radius: 999px; background: var(--tint-quiet); color: var(--quiet-text);
}
.cp-nav-aside.is-blue { background: var(--primary-soft); color: var(--link); }
.cp-nav-aside.is-amber { background: var(--amber-soft); color: var(--amber-text); }

.cp-main { min-width: 0; padding: 1.6rem 2rem 3rem; }
.cp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.cp-head h1 { margin: 0; font-size: 2.1rem; letter-spacing: -0.02em; color: var(--heading); }
.cp-raise-btn { background: #1f6fd0; border-color: #1f6fd0; padding: 0.6rem 1.1rem; font-weight: 600; }
.cp-sub { margin: 0.3rem 0 0; color: var(--muted); font-size: 1.05rem; }
.cp-meta { color: var(--muted); font-size: 0.88rem; }

.cp-section { margin-bottom: 2.4rem; }
.cp-section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.4rem 0.8rem; flex-wrap: wrap; margin-bottom: 0.9rem;
}
.cp-section-head > div { display: flex; align-items: baseline; gap: 0.8rem; flex-wrap: wrap; }
.cp-section-head h2 { margin: 0; font-size: 1.45rem; letter-spacing: -0.01em; color: var(--heading); }
.cp-section-head a { font-weight: 600; font-size: 0.93rem; }

/* The Project panel: the rollout at a glance, on the portal's navy. */
.cp-hero { background: #0f2240; color: #fff; border-radius: 20px; padding: 1.9rem 2.2rem 2rem; }
.cp-hero a { color: #bcd6fb; }
.cp-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; flex-wrap: wrap; }
.cp-hero-top h2 { margin: 0; font-size: 1rem; font-weight: 700; color: #c5d0e0; }
.cp-hero-top a { font-weight: 600; font-size: 0.93rem; }
.cp-hero-figures {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.2rem 2.6rem; margin-top: 0.6rem;
}
.cp-hero a.cp-hero-main { display: flex; align-items: baseline; gap: 0.9rem; flex-wrap: wrap; color: #fff; }
.cp-hero a.cp-hero-main:hover { text-decoration: none; }
.cp-hero-num { font-size: 4.6rem; font-weight: 700; line-height: 1; letter-spacing: -0.03em; }
.cp-hero-num-text { font-size: 2.6rem; }
.cp-hero-of { font-size: 1.45rem; color: #dbe4f0; }
.cp-hero-stats { display: flex; flex-wrap: wrap; gap: 0.8rem 2.4rem; }
.cp-hero-stat { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.cp-hero-stat-label { font-size: 0.87rem; color: #c5d0e0; }
.cp-hero-ends {
  display: flex; justify-content: space-between; gap: 0.5rem 1rem; flex-wrap: wrap; margin-top: 2rem;
  font-size: 0.87rem; color: #c5d0e0;
}
.cp-hero-ends strong { color: #fff; }
/* Room above the track for the "Today" tag, clear of the kick-off and close dates. */
.cp-hero-timeline { display: flex; flex-wrap: wrap; gap: 2.4rem 6px; margin-top: 2.5rem; }
.cp-hero a.cp-hero-phase { flex: 1 1 0; min-width: 190px; display: block; color: #fff; border-radius: 10px; }
.cp-hero a.cp-hero-phase:hover { text-decoration: none; }
.cp-hero a.cp-hero-phase:hover .cp-hero-track { background: #38507c; }
.cp-hero a:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.cp-hero-track { display: block; position: relative; height: 16px; background: #2c4166; border-radius: 8px; }
.cp-hero-track-solo { margin-top: 1.6rem; }
.cp-hero-fill { display: flex; gap: 3px; height: 100%; }
.cp-hero-fill i { display: block; border-radius: 8px; }
.cp-hero-done { background: #7fe3d4; }
.cp-hero-going { background: #5d9bea; }
.cp-hero-today-line { position: absolute; top: -8px; width: 2px; height: 32px; margin-left: -1px; background: #fff; border-radius: 1px; }
.cp-hero-today {
  position: absolute; top: -31px; transform: translateX(-50%); white-space: nowrap;
  font-size: 0.78rem; font-weight: 700; color: #0f2240; background: #fff; border-radius: 999px; padding: 0.05rem 0.6rem;
}
.cp-hero-phase-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.9rem; font-size: 1.12rem; }
.cp-hero-chip { font-size: 0.78rem; font-weight: 700; color: #0f2240; background: #7fe3d4; border-radius: 999px; padding: 0.1rem 0.6rem; }
.cp-hero-phase-dates { display: block; font-size: 0.93rem; color: #dbe4f0; margin-top: 0.25rem; }
.cp-hero-phase-count { display: block; font-size: 0.87rem; color: #c5d0e0; margin-top: 0.1rem; }
.cp-hero-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin-top: 1.4rem; font-size: 0.87rem; color: #dbe4f0; }
.cp-hero-legend span { display: flex; align-items: center; gap: 0.45rem; }
.cp-hero-legend i { width: 10px; height: 10px; border-radius: 3px; }
.cp-hero-idle { background: #2c4166; border: 1px solid #6f84a8; box-sizing: border-box; }
.cp-hero-note { margin: 0.8rem 0 0; color: #dbe4f0; }
.cp-hero-dates { margin-top: 1.5rem; padding-top: 1.1rem; border-top: 1px solid #2c4166; font-size: 0.95rem; color: #dbe4f0; }
.cp-hero-dates h3 { margin: 0 0 0.4rem; font-size: 0.87rem; font-weight: 700; color: #c5d0e0; }
.cp-hero-dates div { padding: 0.15rem 0; }
.cp-hero-dates strong { color: #fff; }

.cp-brd-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.7rem; margin-top: 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.1rem 1.5rem;
}
.cp-mini-ring { flex-shrink: 0; }
.cp-brd-card-text { flex: 1 1 300px; min-width: 0; }
.cp-brd-card-title { font-size: 1.12rem; font-weight: 700; color: var(--heading); }
/* Hardware Order: the client's orders, then a new one. */
.hw-section { margin-bottom: 2.4rem; }
.hw-order { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; margin-bottom: 0.8rem; overflow: hidden; }
.hw-order-act { border: 2px solid #1f6fd0; }
.hw-order-head {
  width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.2rem; text-align: left; cursor: pointer;
  background: none; border: 0; font: inherit; color: inherit; padding: 1rem 1.4rem; min-height: 64px;
}
.hw-order-head:hover { background: var(--tint); }
.hw-order-head:focus-visible { outline: 2px solid #1f6fd0; outline-offset: -2px; }
.hw-order-ref { flex: 0 0 auto; min-width: 74px; font-weight: 700; color: var(--heading); }
.hw-order-what { flex: 1 1 300px; min-width: 0; }
.hw-order-what strong { display: block; color: var(--heading); }
.hw-order-what span { display: block; font-size: 0.87rem; color: var(--muted); }
.hw-order-total { text-align: right; }
.hw-order-total strong { display: block; font-size: 1.35rem; letter-spacing: -0.02em; color: var(--heading); }
.hw-order-total span { font-size: 0.82rem; color: var(--muted); }
.hw-order-total b { color: var(--amber-text); }
.hw-chip { font-size: 0.75rem; font-weight: 700; border-radius: 999px; padding: 0.2rem 0.7rem; white-space: nowrap; }
.hw-chip-quiet { color: var(--quiet-text); background: var(--tint-quiet); }
.hw-chip-act { color: #fff; background: #1f6fd0; }
.hw-chip-go { color: var(--link); background: var(--tint-blue); }
.hw-chip-due { color: var(--amber-text); background: var(--amber-soft); }
.hw-chip-done { color: var(--teal-text); background: var(--teal-soft); }
.hw-steps { list-style: none; margin: 0; padding: 0 1.4rem 1rem; display: flex; flex-wrap: wrap; gap: 6px; }
.hw-steps li { flex: 1 1 100px; min-width: 0; font-size: 0.78rem; color: var(--muted); }
.hw-steps li span { display: block; height: 6px; border-radius: 3px; background: var(--track); margin-bottom: 0.35rem; }
.hw-steps li.done { color: var(--teal-text); font-weight: 600; }
.hw-steps li.done span { background: #0e7a80; }
.hw-steps li.now { color: var(--link); font-weight: 700; }
.hw-steps li.now span { background: #1f6fd0; }
.hw-steps li.stuck { color: var(--amber-text); font-weight: 700; }
.hw-steps li.stuck span { background: #e0a93b; }
.hw-detail { display: flex; flex-wrap: wrap; border-top: 1px solid var(--border-soft); }
.hw-detail-main { flex: 3 1 480px; min-width: 0; padding: 0.6rem 1.4rem 1.1rem; }
.hw-lines-wrap { overflow-x: auto; }
.hw-lines { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 420px; }
.hw-lines th { text-align: left; font-size: 0.75rem; font-weight: 600; color: var(--muted); padding: 0.6rem 0.5rem 0.5rem 0; }
.hw-lines td { padding: 0.65rem 0.5rem 0.65rem 0; border-top: 1px solid var(--border-soft); vertical-align: top; }
.hw-lines .num { text-align: right; white-space: nowrap; padding-left: 0.5rem; }
.hw-lines tfoot td { border-top: 0; padding: 0.15rem 0 0.15rem 0.5rem; color: var(--text); }
.hw-lines tfoot tr:first-child td { border-top: 1px solid var(--border-soft); padding-top: 0.6rem; }
.hw-lines .hw-total td { font-weight: 700; color: var(--heading); }
.hw-sub { display: block; font-size: 0.82rem; color: var(--muted); }
.hw-line-note { display: inline-block; margin-top: 0.25rem; font-size: 0.8rem; font-weight: 600; color: var(--amber-text); background: var(--amber-soft); border-radius: 6px; padding: 0.1rem 0.45rem; }
.hw-tag { font-size: 0.7rem; font-weight: 600; color: var(--quiet-text); background: var(--tint-quiet); border-radius: 999px; padding: 0.05rem 0.45rem; }
.hw-facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0.9rem 0 0; font-size: 0.9rem; }
.hw-facts dt { color: var(--muted); }
.hw-facts dd { margin: 0; }
.hw-cancel { margin-top: 0.9rem; }
.hw-accept { flex: 2 1 300px; min-width: 0; background: var(--tint); border-left: 1px solid var(--border-soft); padding: 1.1rem 1.4rem 1.2rem; display: flex; flex-direction: column; gap: 0.2rem; }
.hw-accept h3 { margin: 0 0 0.4rem; font-size: 1.08rem; color: var(--heading); }
.hw-accept input[type="text"] { min-height: 44px; }
.hw-check { display: flex; align-items: flex-start; gap: 0.55rem; font-size: 0.93rem; margin: 0.2rem 0 0.7rem; }
.hw-check input { width: 20px; height: 20px; margin: 1px 0 0; flex: 0 0 auto; }
.hw-accept-actions .btn { min-height: 44px; padding: 0 1.1rem; }
.hw-step { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.5rem 1.6rem; margin-bottom: 0.9rem; }
.hw-step h3 { margin: 0 0 0.2rem; font-size: 1.12rem; color: var(--heading); }
.hw-step h3 + .hw-grid, .hw-step h3 + .hw-catalogue { margin-top: 0.9rem; }
.hw-step > .cp-meta { margin: 0 0 1rem; }
.hw-catalogue { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.9rem; }
.hw-product { border: 1px solid var(--border); border-radius: 14px; padding: 0.95rem; display: flex; flex-direction: column; gap: 0.45rem; }
.hw-product.picked { border: 2px solid #1f6fd0; padding: calc(0.95rem - 1px); background: var(--tint); }
.hw-product img, .hw-noimg { width: 100%; height: 120px; object-fit: contain; display: block; }
.hw-noimg { background: #f4f6fa; border-radius: 10px; }
.hw-product strong { color: var(--heading); }
.hw-product .cp-meta { flex: 1 1 auto; }
.hw-qty { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.9rem; font-weight: 600; }
.hw-stepper { display: flex; }
.hw-stepper button { width: 44px; height: 44px; border: 1px solid var(--input-border); background: var(--surface); font-size: 1.1rem; cursor: pointer; color: var(--heading); }
.hw-stepper button:first-child { border-radius: 10px 0 0 10px; }
.hw-stepper button:last-child { border-radius: 0 10px 10px 0; }
.hw-stepper button:hover { background: var(--tint); }
.hw-stepper input { width: 58px; height: 44px; box-sizing: border-box; text-align: center; border: 1px solid var(--input-border); border-left: 0; border-right: 0; border-radius: 0; font: inherit; }
.hw-other-h { margin: 1.5rem 0 0.2rem; font-size: 1rem; color: var(--heading); }
.hw-other-row { display: grid; grid-template-columns: minmax(180px, 2.2fr) minmax(150px, 2fr) 90px minmax(130px, 1.6fr) 44px; gap: 0.6rem; align-items: end; margin-top: 0.7rem; }
.hw-other-row .field { margin: 0; }
/* Number and phone boxes match the text boxes beside them. */
.hw-step input[type="number"], .hw-step input[type="tel"], .ah-lines input[type="number"], .hw-accept input[type="text"] {
  width: 100%; padding: 0.5rem 0.65rem; border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.92rem; font-family: inherit; background: var(--surface); color: var(--text); box-sizing: border-box;
}
.hw-step .hw-stepper input[type="number"] { width: 58px; border-radius: 0; border-color: var(--input-border); border-left: 0; border-right: 0; padding: 0; }
.hw-other-row input { min-height: 44px; }
.hw-remove { width: 44px; height: 44px; border: 1px solid var(--input-border); border-radius: 10px; background: var(--surface); color: var(--danger); cursor: pointer; }
.hw-add-other { margin-top: 0.8rem; border-style: dashed; border-color: var(--link-border); color: var(--link); font-weight: 600; min-height: 44px; }
.hw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 0.9rem; }
.hw-grid input, .hw-grid select, .hw-step > .field input { min-height: 44px; }
.hw-submit {
  background: #0c2340; color: #fff; border-radius: 18px; padding: 1.3rem 1.6rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.9rem 1.8rem;
}
.hw-submit > div { flex: 1 1 340px; min-width: 0; }
.hw-submit-title { font-size: 1.1rem; font-weight: 700; }
.hw-submit-sub { font-size: 0.9rem; color: #c5d0e0; margin-top: 0.2rem; }
.hw-submit-sub:empty { display: none; }
.hw-submit-btn { min-height: 48px; padding: 0 1.4rem; background: #fff; color: #0c2340; border-color: #fff; font-weight: 700; }
.hw-submit-btn:hover { background: #e8f0fb; }
@media (max-width: 760px) {
  .hw-other-row { grid-template-columns: 1fr 1fr; }
  .hw-accept { border-left: 0; border-top: 1px solid var(--border-soft); }
  .hw-order-total { text-align: left; }
}

.ah-order { margin-bottom: 1rem; }
.ah-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.ah-head .hw-chip { vertical-align: middle; margin-left: 0.4rem; }
.ah-total { text-align: right; }
.ah-total strong { display: block; font-size: 1.3rem; }
.ah-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 0.8rem; margin-top: 0.9rem; }
.ah-lines td input { width: 100%; }
.ah-lines .ah-qty { max-width: 80px; }
.ah-lines .ah-price { max-width: 120px; }
.ah-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 0.9rem; }
.hc-row { display: flex; gap: 1rem; align-items: flex-start; padding: 0.8rem 0; border-top: 1px solid var(--border); }
.hc-photo { flex: 0 0 72px; width: 72px; height: 72px; border-radius: 10px; background: #f4f6fa; display: grid; place-items: center; overflow: hidden; }
.hc-photo img { width: 100%; height: 100%; object-fit: contain; }
.hc-fields { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.hc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.hc-active { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.88rem; }
.hc-add { display: grid; grid-template-columns: 2fr 2fr auto; gap: 0.5rem; }
@media (max-width: 700px) { .hc-add { grid-template-columns: 1fr; } }

/* Your TDC team: a card per person, then how to reach the team at large. */
.tm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.8rem; }
.tm-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.6rem 0.9rem 0.5rem;
  display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0;
}
.tm-photo { display: block; width: 136px; height: 136px; border-radius: 50%; padding: 4px; border: 3px solid #1f6fd0; box-sizing: border-box; }
.tm-photo img, .tm-initials { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.tm-initials { display: grid; place-items: center; background: #0c2340; color: #fff; font-size: 2.4rem; font-weight: 700; letter-spacing: 0.02em; }
.tm-name { margin: 1rem 0 0; font-size: 1.25rem; letter-spacing: -0.01em; color: var(--heading); }
.tm-role { font-size: 0.93rem; font-weight: 600; color: var(--link); margin-top: 0.15rem; }
.tm-primary { display: inline-block; margin-left: 0.3rem; font-size: 0.72rem; color: var(--teal-text); background: var(--teal-soft); border-radius: 999px; padding: 0.05rem 0.5rem; }
.tm-links { margin-top: auto; padding-top: 1rem; width: 100%; display: flex; flex-direction: column; font-size: 0.9rem; }
.tm-links a { display: flex; align-items: center; justify-content: center; min-height: 44px; border-top: 1px solid var(--border-soft); overflow-wrap: anywhere; }
.tm-links a.tm-phone { color: var(--heading); font-weight: 600; }
.tm-reach {
  background: #0c2340; color: #fff; border-radius: 20px; padding: 1.8rem 2rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem 3rem;
}
.tm-reach a { color: #bcd6fb; font-weight: 600; font-size: 0.93rem; }
.tm-reach-main { flex: 2 1 320px; min-width: 0; }
.tm-reach h2 { margin: 0; font-size: 1rem; font-weight: 700; color: #c5d0e0; }
.tm-reach-label { font-size: 1rem; color: #c5d0e0; margin-top: 0.6rem; }
.tm-reach a.tm-reach-number { display: inline-block; font-size: 2.6rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; color: #fff; }
.tm-reach-side { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 0.8rem; align-items: flex-start; }
.tm-reach-side p { margin: 0; color: #dbe4f0; }
.tm-reach-btn { background: #fff; color: #0c2340; border-color: #fff; font-weight: 700; }
.tm-reach-btn:hover { background: #e8f0fb; }
.admin-photo {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: #0c2340; color: #fff; font-size: 0.8rem; font-weight: 700;
}
.admin-photo img { width: 100%; height: 100%; object-fit: cover; }
.admin-row-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.cp-brd-card-phases { display: block; padding: 1.1rem 1.5rem 1.25rem; }
.cp-brd-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.3rem 0.8rem; flex-wrap: wrap; }
.cp-brd-card-head h3 { margin: 0; font-size: 1.12rem; color: var(--heading); }
.cp-brd-cols { display: flex; flex-wrap: wrap; gap: 1.1rem 2rem; margin-top: 0.9rem; }
.cp-brd-col { flex: 1 1 220px; min-width: 0; display: block; color: var(--text); }
.cp-brd-col:hover { text-decoration: none; }
.cp-brd-col:hover .cp-brd-go { text-decoration: underline; }
.cp-brd-col-head { display: flex; justify-content: space-between; gap: 0.6rem; font-size: 1rem; }
.cp-brd-col-head strong { color: var(--heading); }
.cp-brd-state { font-weight: 600; color: var(--muted); white-space: nowrap; }
.cp-brd-state-done { color: var(--teal-text); }
.cp-brd-state-going { color: var(--link); }
.cp-brd-bar { display: flex; height: 8px; margin-top: 0.5rem; background: var(--track); border-radius: 4px; }
.cp-brd-bar i { display: block; background: #1f6fd0; border-radius: 4px; }
.cp-brd-bar i.cp-brd-bar-done { background: #0e7a80; }
.cp-brd-go { display: block; margin-top: 0.6rem; font-size: 0.93rem; font-weight: 600; color: var(--link); }
.cp-brd-list { display: flex; flex-direction: column; gap: 0.9rem; }
.cp-brd-item { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.4rem; color: var(--text); padding: 1.1rem 1.5rem; }
.cp-brd-item:hover { text-decoration: none; border-color: var(--link-border); }
.cp-brd-item-main { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.cp-brd-item-title { font-size: 1.15rem; font-weight: 700; color: var(--heading); }
.phase-brd-tag {
  margin-left: 0.6rem; font-size: 0.78rem; font-weight: 600; color: var(--link); background: var(--tint-blue);
  border-radius: 999px; padding: 0.15rem 0.6rem; white-space: nowrap;
}
.phase-brd-row {
  display: grid; grid-template-columns: minmax(120px, 1.2fr) auto minmax(90px, 1.5fr) minmax(0, 1.5fr) auto; align-items: center;
  gap: 0.4rem 1rem; padding: 0.65rem 0; border-top: 1px solid var(--border); color: var(--text);
}
.phase-brd-row:hover { text-decoration: none; background: var(--info-soft); }
.phase-brd-row .progress-bar { display: block; }
.phase-brd-row .progress-bar span { display: block; height: 100%; background: var(--primary); border-radius: inherit; }
.client-row-phase { margin-left: 1.6rem; background: var(--tint); }
@media (max-width: 700px) { .phase-brd-row { grid-template-columns: 1fr 1fr; } }
.cp-btn-outline { border-color: #1f6fd0; color: var(--link); background: var(--surface); font-weight: 600; padding: 0.6rem 1.05rem; }
.cp-btn-outline:hover { background: var(--tint); text-decoration: none; }

/* The Support panel: the figures, what's open, and how to reach us. */
.cp-support {
  display: flex; flex-wrap: wrap; align-items: stretch; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
}
.cp-support-stats { flex: 1 1 170px; min-width: 0; padding: 0.5rem 1.5rem; display: flex; flex-direction: column; justify-content: flex-start; }
.cp-support-stat { padding: 0.9rem 0; border-bottom: 1px solid var(--border-soft); }
.cp-support-stat:last-child { border-bottom: 0; }
.cp-support-value { font-size: 2rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; color: var(--heading); }
.cp-support-stat-critical .cp-support-value { color: #c8372d; }
.cp-support-label { font-size: 0.93rem; color: var(--muted); margin-top: 0.2rem; }
.cp-support-requests { flex: 3 1 400px; min-width: 0; padding: 1.25rem 1.6rem 0.5rem; border-left: 1px solid var(--border-soft); }
.cp-support-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.cp-support h3 { margin: 0; font-size: 1.12rem; color: var(--heading); }
.cp-waiting { font-size: 0.87rem; font-weight: 600; color: var(--amber-text); }
.cp-support-empty { margin: 0.9rem 0 1rem; }
.cp-support-requests .cp-request:last-child { border-bottom: 0; }
.cp-support-help {
  flex: 1.5 1 260px; min-width: 0; background: var(--tint); border-left: 1px solid var(--border-soft); padding: 1.35rem 1.5rem;
  display: flex; flex-direction: column; gap: 0.9rem; align-items: flex-start;
}
.cp-help-number { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.01em; color: var(--heading); }
.cp-help-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; font-size: 0.93rem; font-weight: 600; }
@media (max-width: 760px) {
  .cp-hero { padding: 1.4rem 1.2rem 1.5rem; border-radius: 16px; }
  .cp-hero-num { font-size: 3.6rem; }
  .cp-support-requests, .cp-support-help { border-left: 0; border-top: 1px solid var(--border-soft); }
}

.cp-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.cp-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.2rem 1.5rem 1.4rem; margin: 0; }
.cp-card h2 { font-size: 1.2rem; margin: 0; color: var(--heading); }
.cp-card-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem;
  padding-bottom: 0.75rem; margin-bottom: 0.2rem; border-bottom: 1px solid var(--border);
}
.cp-card-head a { font-size: 0.95rem; color: var(--link); }
.cp-subhead { font-size: 1.05rem; margin: 1rem 0 0.2rem; color: var(--heading); }

.cp-request {
  display: flex; align-items: center; gap: 0.9rem; padding: 0.9rem 0;
  border-bottom: 1px solid var(--border); color: var(--text);
}
.cp-request:hover { text-decoration: none; }
.cp-request:hover .cp-request-title { color: var(--link); }
.cp-request-main { flex: 1 1 auto; min-width: 0; }
.cp-request-title { font-weight: 600; font-size: 1.05rem; color: var(--heading); line-height: 1.3; }
.cp-request .tk-sev { min-width: 2.6em; padding: 0.3rem 0.45rem; font-size: 0.8rem; }

.cp-bar { display: flex; gap: 3px; height: 12px; }
.cp-bar span { display: block; height: 100%; border-radius: 4px; }
.cp-bar-live { background: #179aa8; }
.cp-bar-scheduled { background: #1f6fd0; }
.cp-bar-unscheduled { background: #5d6b7c; }
.cp-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin-top: 0.5rem; font-size: 0.85rem; color: var(--muted); }
.cp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 0.35rem; vertical-align: -1px; }
.cp-date-row { padding: 0.7rem 0; border-bottom: 1px solid var(--border); }
.cp-date-site { font-weight: 700; color: var(--heading); }
.cp-date-detail { color: var(--muted); text-align: right; font-size: 0.95rem; margin-top: 0.15rem; }

.cp-video {
  display: flex; justify-content: space-between; align-items: baseline; gap: 0.8rem;
  padding: 0.8rem 0; border-bottom: 1px solid var(--border); color: var(--heading); font-weight: 600;
}
.cp-video:hover { text-decoration: none; color: var(--link); }
.cp-escalation { margin: 0.6rem 0 0; padding-left: 1.4rem; font-size: 1.02rem; color: var(--heading); }
.cp-escalation li { padding: 0.3rem 0; line-height: 1.55; }

.cp-site-list { margin-top: 0.8rem; }
.cp-site-row {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.75rem 0; border-bottom: 1px solid var(--border);
}

.cp-roster-filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.6rem 0.9rem; margin: 1rem 0 0.4rem;
}
.cp-roster-filters label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.85rem; color: var(--muted); }
.cp-roster-filters select, .cp-roster-filters input { min-width: 150px; max-width: 100%; }
.cp-roster-search { flex: 1 1 180px; }
.cp-roster-search input {
  width: 100%; padding: 0.5rem 0.6rem; font: inherit; font-size: 0.95rem;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
}
.cp-site-tags { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.cp-phase-tag {
  font-size: 0.78rem; font-weight: 600; color: var(--link); background: var(--tint-blue);
  border-radius: 999px; padding: 0.15rem 0.55rem; white-space: nowrap;
}
.cp-phase-line { display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; font-size: 0.95rem; color: var(--muted); }
.cp-phase-line strong { color: var(--heading); font-weight: 600; margin-right: 0.25rem; }
.cp-phases { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.6rem; margin-top: 0.8rem; }
.cp-phase {
  display: flex; flex-direction: column; gap: 0.2rem; text-align: left; font: inherit; color: inherit;
  padding: 0.7rem 0.85rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
}
button.cp-phase { cursor: pointer; }
button.cp-phase:hover { border-color: var(--link-border); }
.cp-phase.active { border-color: #1f6fd0; box-shadow: 0 0 0 1px #1f6fd0 inset; background: var(--tint); }
.cp-phase-name { font-weight: 700; color: var(--heading); }
.cp-bar-sm { height: 8px; gap: 2px; margin-top: 0.3rem; }
.cp-bar-empty { background: var(--border); }
.cp-phase-dates { font-size: 0.92rem; color: var(--heading); }
.cp-roster-empty { margin-top: 1rem; }
.roster-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 0.6rem 0; font-size: 0.88rem; }
.roster-add { display: grid; grid-template-columns: 2fr 1.5fr 90px 120px 120px auto; gap: 0.4rem; align-items: center; }
.roster-bulk {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.4rem 0 0.6rem;
  padding: 0.5rem 0.7rem; background: var(--bg, #f5f7fa); border: 1px solid var(--border); border-radius: 8px; font-size: 0.88rem;
}
.roster-bulk select { width: auto; min-width: 150px; }
table.data th.roster-check, table.data td.roster-check { min-width: 0; width: 28px; text-align: center; }
.roster-over { color: var(--warn); }
.rollout-plan-form > label, .rollout-plan-actions label { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; white-space: nowrap; }
.rollout-plan-table { margin: 0.6rem 0; max-width: 760px; }
.rollout-plan-table input { max-width: 110px; }
.rollout-plan-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.rollout-plan-actions input { width: 70px; }
@media (max-width: 700px) {
  .roster-add { grid-template-columns: 1fr 1fr; }
  .cp-roster-filters label { flex: 1 1 140px; }
  .cp-roster-filters select { min-width: 0; width: 100%; }
}

.cp-form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.cp-video-edit { display: grid; grid-template-columns: 2fr 3fr 70px auto; gap: 0.4rem; margin-bottom: 0.4rem; align-items: center; }

@media (max-width: 1100px) {
  .cp-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .cp-layout { grid-template-columns: 1fr; min-height: 0; }
  .cp-nav {
    flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border);
    padding: 0.5rem 16px; gap: 0.3rem;
  }
  .cp-nav-group { display: none; }
  .cp-nav-link { flex: 0 0 auto; white-space: nowrap; padding: 0.45rem 0.75rem; font-size: 0.92rem; gap: 0.5rem; }
  .cp-nav-link.active::before { top: auto; bottom: 0; left: 10px; right: 10px; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
  .cp-main { padding: 1.2rem 16px 2.5rem; }
  /* Narrow: the logo and the account button share the first line, the title
     takes the second, and the after-hours number sits under it. */
  .cp-band { padding: 0.7rem 16px; gap: 0.55rem 0.6rem; }
  .cp-band-actions { display: contents; }
  .cp-badge { order: 1; }
  .cp-account { order: 2; margin-left: auto; }
  .cp-theme-btn { order: 3; }
  .cp-band-title { order: 4; flex-basis: 100%; }
  .cp-demo-pill { order: 5; }
  .cp-band-raise { order: 6; flex: 1 1 0; }
  .cp-after-hours { order: 7; flex: 1.3 1 0; justify-content: center; }
  .cp-band-rule { display: none; }
  .cp-badge.cp-badge-bare img, .cp-band-light .cp-badge-has-light .cp-logo-light { height: 40px; max-width: 150px; }
}
@media (max-width: 560px) {
  .cp-head h1 { font-size: 1.6rem; }
  .cp-band-name { font-size: 1.05rem; }
  .cp-form-row, .cp-video-edit { grid-template-columns: 1fr; }
  .cp-date-detail { text-align: left; }
}

/* ---------- tickets: severity, status, the raise form, the agent panel ---------- */
/* Solid chips: S1 red, S2 amber, S3 blue, S4 grey. */
.tk-sev {
  display: inline-block; min-width: 2.1em; text-align: center; font-size: 0.72rem; font-weight: 700;
  padding: 0.12rem 0.4rem; border-radius: 6px; flex: 0 0 auto; color: #fff;
}
.tk-sev-s1 { background: #c8372d; }
.tk-sev-s2 { background: #c98a00; }
.tk-sev-s3 { background: #2f6fd6; }
.tk-sev-s4 { background: #7b8796; }
.tk-status { font-size: 0.75rem; font-weight: 600; padding: 0.15rem 0.55rem; border-radius: 999px; white-space: nowrap; }
.tk-status-new, .tk-status-acknowledged, .tk-status-in_progress { background: #eef1f5; color: #4a5768; }
.tk-status-with_ringcentral { background: #efe9fb; color: #6a4fb6; }
.tk-status-waiting_on_client { background: var(--warn-soft); color: var(--warn); }
.tk-status-resolved, .tk-status-closed { background: var(--success-soft); color: var(--success); }
.tk-tag { font-size: 0.72rem; padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); color: var(--muted); }
.help-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }

.tk-answers { display: grid; grid-template-columns: max-content 1fr; gap: 0.15rem 0.8rem; margin: 0.5rem 0; font-size: 0.85rem; }
.tk-answers dt { color: var(--muted); }
.tk-answers dd { margin: 0; }
.tk-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.tk-attach { cursor: pointer; }

.chat-msg.internal .chat-bubble { background: var(--warn-soft); border: 1px dashed var(--warn); color: var(--text); }
.chat-internal-tag { display: block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; color: var(--warn); margin-bottom: 0.2rem; }
.chat-file { display: block; margin-top: 0.3rem; font-size: 0.85rem; }
.chat-msg.mine .chat-file { color: inherit; text-decoration: underline; }
.chat-composer:has(.chat-composer-extra) { flex-wrap: wrap; }
.chat-composer-extra { flex: 1 0 100%; display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; font-size: 0.85rem; }
.tk-inline { display: inline-flex; gap: 0.35rem; align-items: center; }
.tk-inline select { width: auto; }

.tk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 1rem; align-items: start; margin-top: 0.5rem; }
.tk-props {
  display: flex; flex-direction: column; gap: 0.5rem; padding: 0.7rem; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border); font-size: 0.85rem;
}
.tk-props label { display: flex; flex-direction: column; gap: 0.15rem; font-weight: 600; }
.tk-props select, .tk-props input { font-weight: normal; }

.tk-type-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
.tk-type, .tk-sev-option {
  display: flex; gap: 0.5rem; align-items: flex-start; padding: 0.5rem 0.6rem; cursor: pointer;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
}
.tk-type > span { display: flex; flex-direction: column; gap: 0.1rem; }
.tk-sev-option > span { display: block; }
.tk-sev-option .tk-sev { margin-right: 0.35rem; vertical-align: 1px; }
.tk-sev-option .muted { display: block; margin-top: 0.15rem; }
.tk-type:has(input:checked), .tk-sev-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.tk-sev-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; }
/* Raise a ticket fits on a laptop screen without scrolling: wide enough for
   three request types and four severities a row, with tight spacing. */
.modal.modal-raise { max-width: 1060px; max-height: calc(100vh - 2rem); padding: 1.1rem 1.4rem 1rem; }
.modal-raise h3 { margin-bottom: 0.15rem; }
.modal-raise > .muted { margin: 0 0 0.7rem; }
.modal-raise .field { margin-bottom: 0.65rem; }
.modal-raise .tk-type, .modal-raise .tk-sev-option { padding: 0.45rem 0.6rem; }
.modal-raise .tk-type .muted, .modal-raise .tk-sev-option .muted { font-size: 0.8rem; line-height: 1.3; }
.modal-raise .tk-sev-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.modal-raise textarea { min-height: 0; }
/* The extra questions for a request type sit two to a row; a long answer box takes the full width. */
.modal-raise #hr-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem; }
.modal-raise #hr-fields .field:has(textarea) { grid-column: 1 / -1; }
@media (max-width: 720px) { .modal-raise #hr-fields { grid-template-columns: 1fr; } }
.hr-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.6rem 1rem; flex-wrap: wrap; }
.hr-foot .field { margin-bottom: 0; }
.hr-foot .modal-actions { margin-top: 0; }
.tk-s1-callout {
  margin: 0 0 0.8rem; padding: 0.6rem 0.8rem; border-radius: 8px;
  background: var(--danger-soft); color: var(--danger); font-size: 0.9rem;
}
.tk-s1-callout a { color: var(--danger); font-weight: 700; }

@media (max-width: 900px) {
  .modal-raise .tk-sev-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .tk-layout { grid-template-columns: 1fr; }
  .modal-raise .tk-sev-pick { grid-template-columns: 1fr; }
  .tk-type-grid, .tk-sev-pick { grid-template-columns: 1fr; }
}

/* ---------- SLAs: chips on a ticket, support plan settings ---------- */
.tk-sla-row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.35rem 0 0; }
.tk-sla { font-size: 0.75rem; font-weight: 600; padding: 0.12rem 0.55rem; border-radius: 6px; white-space: nowrap; }
.tk-sla-ok { background: var(--success-soft); color: var(--success); }
.tk-sla-warn { background: var(--warn-soft); color: var(--warn); }
.tk-sla-bad { background: var(--danger); color: #fff; }
.tk-sla-idle { background: var(--info-soft); color: var(--muted); }
.tk-card-head { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.sp-plan { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 0.7rem 0; border-top: 1px solid var(--border); }
.sp-hours { display: grid; grid-template-columns: 9rem 8rem 8rem; gap: 0.35rem 0.6rem; align-items: center; margin-bottom: 0.8rem; }
.sp-targets { border-collapse: collapse; margin-bottom: 0.8rem; }
.sp-targets th { font-size: 0.8rem; text-align: left; color: var(--muted); padding: 0.2rem 0.5rem; }
.sp-targets td { padding: 0.2rem 0.5rem; }
.sp-targets input[type="number"] { width: 7rem; }
@media (max-width: 560px) {
  .sp-hours { grid-template-columns: 1fr 1fr; }
  .sp-hours .tk-inline { grid-column: 1 / -1; }
}

/* ---------- the agent queue, presence, macros, request types ---------- */
.tk-queue { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1rem; align-items: start; margin-top: 1rem; }
.tk-views { display: flex; flex-direction: column; gap: 0.15rem; position: sticky; top: 1rem; }
.tk-view { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.45rem 0.7rem; border-radius: 8px; color: var(--text); }
.tk-view:hover { background: var(--info-soft); text-decoration: none; }
.tk-view.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.tk-view-count { font-size: 0.8rem; color: var(--muted); }
.tk-queue-main { margin: 0; }
.tk-filters { display: grid; grid-template-columns: 2fr 1.4fr 1fr 1fr; gap: 0.5rem; margin-bottom: 0.6rem; }
.tk-row {
  display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.65rem 0.3rem;
  border-top: 1px solid var(--border); color: var(--text);
}
.tk-row:first-child { border-top: 0; }
.tk-row:hover { background: var(--bg); text-decoration: none; }
.tk-row-main { flex: 1 1 auto; min-width: 0; }
.tk-row-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-row .tk-sla-row { margin-top: 0.25rem; }

.tk-presence {
  margin: 0 0 0.4rem; padding: 0.35rem 0.6rem; border-radius: 6px; font-size: 0.85rem;
  background: var(--info-soft); color: var(--text);
}
.tk-presence.typing { background: var(--warn-soft); color: var(--warn); }
.tk-macro { width: auto; max-width: 14rem; }
.tk-macro-note { flex-basis: 100%; }

.tr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem 1rem; margin-bottom: 0.8rem; }
.tr-grid label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; }
.tr-grid input[type="number"] { width: 5.5rem; }
.rt-field { display: grid; grid-template-columns: 2fr 1fr 2fr auto auto; gap: 0.4rem; align-items: center; margin-bottom: 0.4rem; }

@media (max-width: 900px) {
  .tk-queue { grid-template-columns: 1fr; }
  .tk-views { position: static; flex-direction: row; flex-wrap: wrap; }
  .tk-view { border: 1px solid var(--border); background: var(--surface); }
  .tk-filters { grid-template-columns: 1fr 1fr; }
  .tr-grid, .rt-field { grid-template-columns: 1fr; }
}

/* ---------- CCs on a ticket ---------- */
.tk-ccs { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.3rem; }
.tk-cc { display: inline-flex; align-items: center; gap: 0.2rem; margin: 0 0.3rem 0.2rem 0; padding: 0.05rem 0.2rem 0.05rem 0.5rem;
  border-radius: 999px; background: var(--bg); border: 1px solid var(--border); font-size: 0.8rem; }
.tk-cc-x { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 0.95rem; line-height: 1; padding: 0 0.25rem; }
.tk-cc-add { display: flex; gap: 0.35rem; }
.tk-cc-add input { flex: 1 1 auto; min-width: 0; }
.tk-props .tk-ccs { font-weight: normal; }

/* ---------- what a ticket is about, and time on it ---------- */
.tk-link { margin: 0.5rem 0; padding: 0.6rem 0.75rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); }
.tk-link-head { display: flex; flex-direction: column; margin-bottom: 0.2rem; }
.tk-time { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.3rem; font-weight: normal; }
.tk-time-list { margin: 0; padding-left: 1rem; color: var(--muted); }

/* ---------- client logos ---------- */
/* In the portal header: a white tile the logo sits on, wider for a wide logo. */
.cp-badge-logo { width: auto; min-width: 48px; max-width: 160px; padding: 5px; }
.cp-badge-logo img { display: block; height: 38px; width: auto; max-width: 150px; object-fit: contain; }
/* In the Edit client form. */
.ec-logo { display: flex; gap: 0.9rem; align-items: center; }
.ec-logo-preview.ec-logo-preview-light { background: #fff; }
.ec-logo-preview {
  width: 64px; height: 64px; flex: 0 0 auto; border-radius: 10px; border: 1px solid var(--border);
  display: grid; place-items: center; background: #0c2340; overflow: hidden;
}
.ec-logo-preview span { color: #fff; font-weight: 800; }
.ec-logo-preview img { width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 4px; }
.ec-logo-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.ec-logo-actions .hint { flex-basis: 100%; }

/* ---------- dark theme: the few colours that aren't shared settings ---------- */
:root[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]) {
  background-color: var(--surface); color: var(--text); border-color: var(--input-border);
}
:root[data-theme="dark"] input:disabled, :root[data-theme="dark"] select:disabled, :root[data-theme="dark"] textarea:disabled {
  background-color: var(--tint); color: var(--muted);
}
:root[data-theme="dark"] ::placeholder { color: #6f7f96; }
:root[data-theme="dark"] .instructions, :root[data-theme="dark"] .stage-note, :root[data-theme="dark"] .stage-link { border-color: var(--link-border); }
:root[data-theme="dark"] .stage-link:hover { background: var(--tint-blue); }
:root[data-theme="dark"] .review-note, :root[data-theme="dark"] .bulk-result.error { border-color: #6b2a36; }
:root[data-theme="dark"] .bulk-result.ok { border-color: #1f5a42; color: var(--success); }
:root[data-theme="dark"] .bulk-result.error { color: var(--danger); }
:root[data-theme="dark"] .terms-status.accepted { color: var(--success); }
:root[data-theme="dark"] .terms-status.pending { color: var(--amber-text); }
:root[data-theme="dark"] table.data td.col-admin input:not(:disabled) { background: var(--warn-soft); border-color: #6b5320; }
:root[data-theme="dark"] .impersonation-bar, :root[data-theme="dark"] .update-bar { color: var(--amber-text); border-color: #6b5320; }
:root[data-theme="dark"] .impersonation-bar .btn, :root[data-theme="dark"] .update-bar .btn:not(.btn-primary) { background: var(--surface); border-color: #6b5320; color: var(--text); }
:root[data-theme="dark"] .cv-hide { background: var(--surface); border-color: #6b5320; color: var(--amber-text); }
:root[data-theme="dark"] #toast { background: #e7edf6; color: #0b1422; }
:root[data-theme="dark"] .tk-status-new, :root[data-theme="dark"] .tk-status-acknowledged, :root[data-theme="dark"] .tk-status-in_progress { background: var(--tint-quiet); color: var(--quiet-text); }
:root[data-theme="dark"] .tk-status-with_ringcentral { background: #2a2147; color: #c4b2ff; }
:root[data-theme="dark"] .badge.submitted, :root[data-theme="dark"] .badge.session-confirmed { color: var(--link); }
:root[data-theme="dark"] .cp-hero, :root[data-theme="dark"] .hw-submit, :root[data-theme="dark"] .tm-reach { box-shadow: 0 0 0 1px #2a3a55; }

:root[data-theme="dark"] .cv-hide:hover { background: var(--warn-soft); }

/* ---------- Service levels ---------- */
.sl-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 0.6rem 1rem; flex-wrap: wrap; }
.sl-head > a { color: var(--link); font-weight: 650; white-space: nowrap; }
.sl-hero {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem 2.4rem; margin-bottom: 1.1rem;
  background: #0c2340; color: #fff; border-radius: 18px; padding: 1.4rem 1.7rem;
}
.sl-hero-kicker { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.06em; color: #9fb6d6; }
.sl-hero-big { font-size: 2.9rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.sl-hero-sub { color: #c5d0e0; }
.sl-hero-stats { display: flex; flex-wrap: wrap; gap: 1rem 2.2rem; margin-left: auto; }
.sl-hero-stats strong { display: block; font-size: 1.8rem; font-weight: 800; line-height: 1.15; }
.sl-hero-stats span { color: #c5d0e0; font-size: 0.88rem; }
.sl-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; }
.sl-card {
  display: flex; flex-direction: column; gap: 0.75rem; padding: 1.1rem 1.25rem;
  background: var(--surface); border: 1px solid var(--border); border-top: 5px solid var(--sl-colour, var(--muted)); border-radius: 16px;
}
.sl-s1 { --sl-colour: #c62f45; } .sl-s2 { --sl-colour: #c27c0e; } .sl-s3 { --sl-colour: #2f6fd0; } .sl-s4 { --sl-colour: #6b7789; }
.sl-card-head { display: flex; align-items: center; gap: 0.55rem; }
.sl-card-head h2 { margin: 0; font-size: 1.18rem; color: var(--heading); }
.sl-def { margin: 0; font-size: 0.93rem; min-height: 6em; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border-soft); }
.sl-fig strong { display: block; font-size: 1.55rem; font-weight: 800; color: var(--heading); line-height: 1.2; letter-spacing: -0.01em; }
.sl-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.sl-note { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 0.15rem; }
.sl-updates { font-size: 0.9rem; color: var(--muted); }
.sl-updates strong { color: var(--text); }
.sl-track { margin-top: auto; padding: 0.65rem 0.8rem; border-radius: 10px; background: var(--tint); }
.sl-track-head { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.85rem; color: var(--muted); }
.sl-track-head strong { color: var(--success); }
.sl-bar { height: 6px; border-radius: 3px; background: var(--border-soft); margin-top: 0.4rem; overflow: hidden; }
.sl-bar span { display: block; height: 100%; border-radius: 3px; background: var(--success); }
.sl-track-foot { font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }
.sl-footnote { font-size: 0.85rem; color: var(--muted); margin: 0.8rem 0.1rem 1.1rem; }
.sl-terms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.sl-h2 { margin: 0 0 0.8rem; font-size: 1.15rem; color: var(--heading); }
.sl-row { display: flex; justify-content: space-between; gap: 0.8rem; padding: 0.6rem 0; border-top: 1px solid var(--border-soft); }
.sl-row strong { color: var(--heading); text-align: right; }
.sl-ticks { list-style: none; margin: 0; padding: 0; }
.sl-ticks li { position: relative; padding-left: 1.5rem; margin-top: 0.55rem; font-size: 0.93rem; }
.sl-ticks li::before { content: '✓'; position: absolute; left: 0.1rem; color: var(--link); font-weight: 800; }
@media (max-width: 1200px) { .sl-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sl-terms { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .sl-cards { grid-template-columns: 1fr; } .sl-hero-stats { margin-left: 0; } .sl-def { min-height: 0; } }

/* ---------- Support path and escalation ---------- */
.sp-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; margin-bottom: 1.1rem; }
.sp-step { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.2rem 1.35rem; }
.sp-step-first, .sp-step-night { background: #0c2340; border-color: #0c2340; color: #fff; }
.sp-step-night { background: #1a2b47; border-color: #1a2b47; }
.sp-step h2 { margin: 0.55rem 0 0.35rem; font-size: 1.7rem; letter-spacing: -0.02em; color: #fff; }
.sp-step-first p { color: #c5d0e0; margin: 0; }
.sp-kicker { display: flex; align-items: center; gap: 0.55rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.sp-step-first .sp-kicker, .sp-step-night .sp-kicker { color: #9fb6d6; }
.sp-step-night .sp-kicker svg { color: #ffd58a; }
.sp-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; letter-spacing: 0; background: var(--tint); border: 1px solid var(--border); color: var(--heading); }
.sp-num-gold { background: #ffd58a; border-color: #ffd58a; color: #0c2340; }
.sp-points { list-style: none; padding: 0; margin: 0.75rem 0 0; display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; font-size: 0.9rem; color: #dbe4f0; }
.sp-points li::before { content: '✓'; color: #7fe3d4; font-weight: 800; margin-right: 0.4rem; }
.sp-raise { margin-top: 1rem; display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; padding: 0 1.2rem; border-radius: 999px; background: #fff; color: #0c2340; border-color: #fff; font-weight: 700; }
.sp-call-label { margin-top: 0.7rem; font-weight: 700; color: var(--heading); }
.sp-step-night .sp-call-label { color: #fff; }
.sp-call { display: block; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.01em; color: var(--heading); }
.sp-options { list-style: none; padding: 0; margin: 0.4rem 0 0; }
.sp-options li { display: flex; gap: 0.6rem; align-items: flex-start; margin-top: 0.5rem; font-size: 0.92rem; color: #dbe4f0; }
.sp-key { width: 22px; height: 22px; flex: none; border-radius: 6px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 800; font-size: 0.8rem; }
.sp-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1rem; align-items: stretch; }
/* The chain fills the height of the cards beside it, its steps spread evenly. */
.sp-chain { display: flex; flex-direction: column; }
.sp-chain .sp-ladder { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.sp-chain .sp-ladder { position: relative; gap: 0.9rem; }
.sp-chain .sp-ladder li { padding-bottom: 0; }
.sp-chain .sp-ladder li::after { display: none; }
.sp-chain .sp-ladder::before { content: ''; position: absolute; left: 21px; top: 22px; bottom: 22px; width: 2px; background: var(--border-soft); }
.sp-side { display: flex; flex-direction: column; gap: 1rem; }
.sp-ladder { list-style: none; padding: 0; margin: 0.9rem 0 0; }
.sp-ladder li { position: relative; display: flex; align-items: center; gap: 0.9rem; padding-bottom: 1.1rem; }
.sp-ladder li:last-child { padding-bottom: 0; }
.sp-ladder li:not(:last-child)::after { content: ''; position: absolute; left: 21px; top: 46px; bottom: -2px; width: 2px; background: var(--border-soft); }
.sp-ladder-icon { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--tint); border: 1px solid var(--border); color: var(--link); position: relative; z-index: 1; }
.sp-ladder li.is-tdc .sp-ladder-icon { background: #1f6fd0; border-color: #1f6fd0; color: #fff; }
.sp-ladder-text { flex: 1; min-width: 0; }
.sp-ladder-text strong { display: block; color: var(--heading); font-size: 1.02rem; }
.sp-ladder-text span { display: block; font-size: 0.92rem; }
.sp-faces { display: flex; padding-left: 8px; }
.sp-face { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; margin-left: -8px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); flex: none; }
.sp-face-initials { display: grid; place-items: center; background: #0c2340; color: #fff; font-size: 0.75rem; font-weight: 800; }
.sp-person { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0; border-top: 1px solid var(--border-soft); }
.sp-person .sp-face { width: 40px; height: 40px; margin-left: 0; }
.sp-person strong { display: block; color: var(--heading); }
.sp-person span { font-size: 0.85rem; color: var(--muted); }
.sp-s1 li::before { content: '✓'; color: var(--danger); }
.sp-sla { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; margin-top: 1rem; padding: 1rem 1.25rem; border-radius: 16px; background: var(--primary-soft); color: var(--text); }
.sp-sla:hover { text-decoration: none; filter: brightness(0.98); }
.sp-sla strong { display: block; color: var(--heading); }
.sp-sla-go { color: var(--link); font-weight: 650; white-space: nowrap; }
@media (max-width: 1100px) { .sp-steps { grid-template-columns: 1fr; } .sp-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .sp-steps { grid-template-columns: 1fr; } .sp-ladder li { flex-wrap: wrap; } }

