/* SPOC — single stylesheet, light + dark via CSS custom properties. */

:root {
  --bg: #f4f5fb;
  --panel: #ffffff;
  --panel-2: #f8f8fe;
  --border: #e3e4ef;
  --border-strong: #cfd1e3;
  --text: #1d2033;
  --text-dim: #6b6f88;
  --accent: #5b5bd6;
  --accent-strong: #4646c6;
  --accent-soft: #ececfd;
  --red: #d92d20;
  --red-soft: #fee4e2;
  --amber: #b54708;
  --amber-soft: #fef0c7;
  --green: #067647;
  --green-soft: #d1fadf;
  --blue: #175cd3;
  --blue-soft: #d1e9ff;
  --gray-soft: #eaecf0;
  --gold: #b8860b;
  --shadow: 0 1px 2px rgba(20, 22, 40, .05), 0 4px 16px rgba(20, 22, 40, .06);
  --shadow-lg: 0 8px 40px rgba(20, 22, 40, .18);
  --radius: 10px;
}

html[data-theme="dark"] {
  --bg: #14151f;
  --panel: #1d1f2d;
  --panel-2: #232536;
  --border: #2e3044;
  --border-strong: #41435c;
  --text: #e6e7f2;
  --text-dim: #9a9db6;
  --accent: #8385f0;
  --accent-strong: #9d9ffa;
  --accent-soft: #2b2c4a;
  --red: #f97066;
  --red-soft: #45201f;
  --amber: #fdb022;
  --amber-soft: #3d2c10;
  --green: #47cd89;
  --green-soft: #14342a;
  --blue: #84caff;
  --blue-soft: #16294a;
  --gray-soft: #2c2e40;
  --gold: #f5c542;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 0 0 8px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
code { background: var(--panel-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; font-size: 12.5px; }
pre { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow-x: auto; }
pre code { border: 0; padding: 0; background: transparent; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* ---------- top bar ---------- */
#topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  padding: 0 22px; height: 54px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}
#topbar .brand {
  font-weight: 700; font-size: 16px; letter-spacing: .01em;
  color: var(--text); display: flex; align-items: center; gap: 9px; white-space: nowrap;
}
#topbar .brand .logo {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
}
#nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; }
#nav a {
  padding: 6px 12px; border-radius: 8px; color: var(--text-dim);
  font-weight: 500; white-space: nowrap;
}
#nav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
#nav a.active { color: var(--accent); background: var(--accent-soft); }
#userbox { display: flex; align-items: center; gap: 10px; }
#userbox .who { text-align: right; line-height: 1.2; }
#userbox .who .nm { font-weight: 600; font-size: 13px; }
#userbox .who .rl { font-size: 11px; color: var(--text-dim); text-transform: capitalize; }

/* ---------- layout ---------- */
#view { max-width: 1240px; margin: 0 auto; padding: 22px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 18px; margin-bottom: 16px;
}
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 980px) { .two-col { grid-template-columns: 1fr; } }
.dim { color: var(--text-dim); }
.small { font-size: 12.5px; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mt { margin-top: 12px; }
.loading { color: var(--text-dim); padding: 40px; text-align: center; }

/* ---------- buttons / inputs ---------- */
button, .btn {
  font: inherit; cursor: pointer;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 6px 13px; font-weight: 500;
  transition: background .12s, border-color .12s;
}
button:hover, .btn:hover { border-color: var(--accent); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
button.danger { color: var(--red); border-color: var(--red); background: transparent; }
button.ghost { background: transparent; border-color: transparent; color: var(--text-dim); padding: 4px 8px; }
button.ghost:hover { color: var(--accent); border-color: transparent; }
button.tiny { padding: 2px 8px; font-size: 12px; border-radius: 6px; }
input, select, textarea {
  font: inherit; color: var(--text);
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 7px 10px; max-width: 100%;
}
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent);
}
textarea { width: 100%; resize: vertical; min-height: 80px; }
label.fld { display: block; margin-bottom: 12px; }
label.fld > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-dim); margin-bottom: 4px; }
label.fld input, label.fld select { width: 100%; }
.radio-row { display: flex; flex-direction: column; gap: 6px; }
.radio-row label { display: flex; gap: 8px; align-items: baseline; cursor: pointer; }
.radio-row input { accent-color: var(--accent); }

/* ---------- pills & chips ---------- */
.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.prio-p1 { background: var(--red-soft); color: var(--red); }
.prio-p2 { background: var(--amber-soft); color: var(--amber); }
.prio-p3 { background: var(--blue-soft); color: var(--blue); }
.prio-p4 { background: var(--gray-soft); color: var(--text-dim); }
.status-new { background: var(--blue-soft); color: var(--blue); }
.status-assigned { background: var(--accent-soft); color: var(--accent); }
.status-in_progress { background: var(--accent-soft); color: var(--accent); }
.status-pending { background: var(--amber-soft); color: var(--amber); }
.status-resolved { background: var(--green-soft); color: var(--green); }
.status-closed { background: var(--gray-soft); color: var(--text-dim); }
.kb-draft { background: var(--amber-soft); color: var(--amber); }
.kb-published { background: var(--green-soft); color: var(--green); }
.kb-archived { background: var(--gray-soft); color: var(--text-dim); }
.chip {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 600;
}
.chip-red { background: var(--red-soft); color: var(--red); }
.chip-amber { background: var(--amber-soft); color: var(--amber); }
.vip { color: var(--gold); font-size: 12px; letter-spacing: 1px; }
.overdue { color: var(--red); font-weight: 600; }

/* filter chips */
.fchip {
  border: 1px solid var(--border-strong); background: var(--panel);
  border-radius: 999px; padding: 4px 12px; font-size: 12.5px; cursor: pointer;
  color: var(--text-dim); font-weight: 500;
}
.fchip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-dim); padding: 8px 10px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover { background: var(--panel-2); }
.ref { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--accent); font-weight: 600; white-space: nowrap; }

/* ---------- notes timeline ---------- */
.note { border: 1px solid var(--border); border-radius: 8px; padding: 10px 13px; margin-bottom: 10px; background: var(--panel); }
/* owner-mandated note tints: email = light green, public web note = orange
   (the tint internal notes used to carry), private internal = light red */
.note.email { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.note.public { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.note.private { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.note.system { background: var(--panel-2); }
.note .meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--text-dim); margin-bottom: 5px; flex-wrap: wrap; }
.note .body { white-space: pre-wrap; word-break: break-word; }
.tag-internal { background: var(--amber); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 4px; padding: 1px 6px; text-transform: uppercase; letter-spacing: .04em; }
.tag-system { background: var(--gray-soft); color: var(--text-dim); font-size: 10.5px; font-weight: 700; border-radius: 4px; padding: 1px 6px; text-transform: uppercase; }

/* ---------- ticket detail ---------- */
.tk-title-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tk-title-row h1 { font-size: 20px; }
.banner {
  border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-weight: 500;
  background: var(--amber-soft); color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent);
}
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.kv dt { color: var(--text-dim); }
.kv dd { margin: 0; text-align: right; }
.panel-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.panel-list { list-style: none; margin: 0; padding: 0; }
.panel-list li:last-child { border-bottom: 0; }
.task-done { text-decoration: line-through; color: var(--text-dim); }
details.audit summary { cursor: pointer; font-weight: 600; color: var(--text-dim); }
.audit-row { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.audit-row:last-child { border-bottom: 0; }
.audit-row .topic { font-weight: 600; }
.audit-row .pl { color: var(--text-dim); word-break: break-all; }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 18px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 36px)); }
.toast {
  background: var(--panel); border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow-lg); border-radius: 8px; padding: 10px 14px;
  animation: slide-in .18s ease-out; word-break: break-word;
}
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }
@keyframes slide-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- modal ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(10, 11, 20, .45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 8vh 16px 16px; overflow-y: auto;
  animation: fade-in .15s ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 20px 22px; width: 100%; max-width: 560px;
}
.modal h2 { margin-bottom: 14px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ---------- drawer ---------- */
.drawer-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(10, 11, 20, .35); animation: fade-in .15s ease-out; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 71;
  width: min(400px, 92vw); background: var(--panel);
  border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  padding: 20px 22px; overflow-y: auto;
  animation: drawer-in .18s ease-out;
}
@keyframes drawer-in { from { transform: translateX(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer .close-x { float: right; }
.profile-head { margin-bottom: 14px; }
.profile-head .nm { font-size: 18px; font-weight: 700; }
.profile-kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: 13px; margin: 14px 0; }
.profile-kv dt { color: var(--text-dim); }
.profile-kv dd { margin: 0; word-break: break-word; }

/* ---------- login ---------- */
.login-wrap { min-height: calc(100vh - 54px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 34px 36px; width: 100%; max-width: 380px;
}
.login-card .logo-big {
  width: 44px; height: 44px; border-radius: 12px; margin-bottom: 14px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800;
}
.login-card h1 { margin-bottom: 2px; }
.login-card .sub { color: var(--text-dim); margin-bottom: 20px; }
.login-card button { width: 100%; padding: 9px; }
.login-err { color: var(--red); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ---------- dashboard ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.tile .num { font-size: 30px; font-weight: 700; line-height: 1.1; }
.tile .lbl { color: var(--text-dim); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.tile.alert .num { color: var(--red); }
.bar-row { display: grid; grid-template-columns: 110px 1fr 40px; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.bar-track { background: var(--panel-2); border-radius: 6px; height: 18px; overflow: hidden; border: 1px solid var(--border); }
.bar-fill { height: 100%; background: var(--accent); border-radius: 5px; min-width: 2px; transition: width .3s; }
.bar-fill.red { background: var(--red); }
.bar-fill.amber { background: var(--amber); }
.bar-fill.blue { background: var(--blue); }
.bar-fill.gray { background: var(--border-strong); }
.bar-fill.green { background: var(--green); }
.bar-val { text-align: right; color: var(--text-dim); }

/* ---------- KB ---------- */
.kb-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .kb-grid { grid-template-columns: 1fr; } }
.kb-cats { list-style: none; margin: 0; padding: 0; }
.kb-cats li { padding: 7px 10px; border-radius: 8px; cursor: pointer; color: var(--text-dim); font-weight: 500; }
.kb-cats li:hover { background: var(--panel-2); color: var(--text); }
.kb-cats li.on { background: var(--accent-soft); color: var(--accent); }
.kb-item { padding: 12px 4px; border-bottom: 1px solid var(--border); cursor: pointer; }
.kb-item:last-child { border-bottom: 0; }
.kb-item:hover .kb-t { color: var(--accent); }
.kb-t { font-weight: 600; }
.article-body h1, .article-body h2, .article-body h3 { color: var(--text); text-transform: none; letter-spacing: 0; margin: 18px 0 8px; }
.article-body h1 { font-size: 20px; } .article-body h2 { font-size: 17px; } .article-body h3 { font-size: 14.5px; font-weight: 700; }
.article-body p { margin: 8px 0; }
.article-body ul, .article-body ol { margin: 8px 0; padding-left: 24px; }
.kb-preview { border: 1px dashed var(--border-strong); border-radius: 8px; padding: 12px 14px; background: var(--panel-2); overflow-x: auto; }
.kb-suggest { border: 1px solid var(--border); border-radius: 8px; padding: 10px 13px; margin-bottom: 8px; cursor: pointer; background: var(--panel); }
.kb-suggest:hover { border-color: var(--accent); }
.kb-suggest .snip { color: var(--text-dim); font-size: 12.5px; margin-top: 2px; }

/* ---------- pagination ---------- */
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 12px; color: var(--text-dim); font-size: 13px; }

/* ---------- misc ---------- */
.inline-edit input { font-size: 18px; font-weight: 700; width: min(560px, 100%); }
.hint { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.empty { color: var(--text-dim); font-style: italic; padding: 8px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- admin tabs (Imported Users / Create User / KB Categories / Roles / Groups) ---------- */
.tabbar { display: flex; gap: 4px; margin: -6px 0 16px; border-bottom: 1px solid var(--border-strong); flex-wrap: wrap; }
.tabbar a { padding: 8px 14px; font-size: 13.5px; font-weight: 600; color: var(--text-dim); text-decoration: none; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; margin-bottom: -1px; }
.tabbar a:hover { color: var(--text); }
.tabbar a.active { color: var(--accent); background: var(--panel); border-color: var(--border-strong); border-bottom: 1px solid var(--panel); }

/* ---------- group pills (selectable/deselectable) ---------- */
.pillbox { display: flex; flex-wrap: wrap; gap: 6px; }
.gpill { font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--panel-2); color: var(--text-dim); cursor: pointer; line-height: 1.2; }
.gpill:hover { border-color: var(--accent); color: var(--accent); }
.gpill.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.gpill.tiny-pill { font-size: 10.5px; padding: 1px 8px; cursor: default; }

/* ---------- VIP: one star tinted per tier, admin-eyes-only ---------- */
.vip-star { font-size: 14px; text-shadow: 0 0 1px rgba(0,0,0,.25); }

/* ---------- hidden-account badge ---------- */
.badge-hidden { background: var(--gray-soft); color: var(--text-dim); border: 1px dashed var(--border-strong); font-size: 10px; }

/* ---------- roles capability matrix ---------- */
.cap-list { margin: 0; padding-left: 18px; }
.cap-list li { margin: 2px 0; }

/* ---------- new-ticket right column ---------- */
.nt-dev { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer; }
.nt-dev:last-child { border-bottom: 0; }
.nt-dev input { margin-top: 2px; }
.subcat { color: var(--text-dim); }

/* ---------- ticket sub-tabs (Tasks / Linked tickets / Assets) ---------- */
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.stab { font-size: 12.5px; font-weight: 600; padding: 5px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--panel-2); color: var(--text-dim); cursor: pointer; }
.stab:hover { border-color: var(--accent); color: var(--accent); }
.stab.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.stab-n { font-weight: 700; }

/* ---------- SLA line in the ticket header ---------- */
.sla-line { margin-top: 8px; color: var(--text-dim); }
.sla-line strong { color: var(--text); font-weight: 600; }
.sla-line strong.overdue { color: var(--red); }

/* ---------- impersonation banner ---------- */
.imp-banner { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 7px 16px; background: var(--amber-soft, #fef3c7); color: #92400e; font-size: 13px; border-bottom: 1px solid var(--border-strong); }
:root[data-theme="dark"] .imp-banner { background: #423006; color: #fcd34d; }

/* ---------- VIP star picker (edit user) ---------- */
.star-row { display: flex; gap: 4px; }
.star-opt { font-size: 20px; line-height: 1; padding: 4px 7px; border-radius: 8px; border: 1px solid transparent; background: none; cursor: pointer; }
.star-opt:hover { border-color: var(--border-strong); }
.star-opt.on { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- sprint 3 ---------- */
.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sort:hover { color: var(--accent); }
.sort-arrow { color: var(--accent); font-size: 10px; }
.upd-by { display: inline-block; margin-left: 5px; font-size: 9.5px; font-weight: 800; padding: 0 5px; border-radius: 4px; line-height: 15px; vertical-align: 1px; }
.upd-agent { background: var(--accent-soft); color: var(--accent); }
.upd-user { background: var(--gray-soft); color: var(--text-dim); }
.vip-star { font-size: 11.5px; opacity: .9; text-shadow: none; }
.tk-desc { border-top: 1px solid var(--border); padding-top: 10px; }
.det-grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(240px, 1fr); gap: 8px 28px; }
@media (max-width: 800px) { .det-grid { grid-template-columns: 1fr; } }
.det-contact { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 12.5px; padding: 4px 0 2px; }
.det-bit .dim { font-weight: 600; font-size: 11px; }
/* (the template placeholder modal's grid/ph-list styles left with it,
   2026-08-09 — the routed editor uses the rt-toolbar field picker) */
.suggest-pop { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; background: var(--panel); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 260px; overflow-y: auto; }
.suggest-item { padding: 7px 11px; cursor: pointer; border-bottom: 1px solid var(--border); }
.suggest-item:last-child { border-bottom: 0; }
.suggest-item:hover { background: var(--accent-soft); }
.chip-green { background: #d1fae5; color: #065f46; }
:root[data-theme="dark"] .chip-green { background: #064e3b; color: #6ee7b7; }
.notice-modal { max-width: 560px; }
/* the To/CC fields need a positioning context of their own — .suggest-pop is
   absolute, and without this it anchors to the whole composer */
.recip-wrap { position: relative; display: flex; }
.recip-wrap > input { flex: 1; min-width: 0; }
/* The Send button on a knowledge hit. A pill, not the borderless `ghost`
   it started as — that read as a line of text and nobody could tell it was
   clickable (owner 2026-09-09). It sits UNDER the snippet rather than beside
   the title, so a long title still wraps normally. */
.kb-hits .kb-send {
  display: inline-block; margin-top: 7px;
  padding: 3px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.6;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid transparent; cursor: pointer;
}
.kb-hits .kb-send:hover:not(:disabled) {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.kb-hits .kb-send:disabled { opacity: .6; cursor: default; }

/* A pill button for an action that sits INSIDE a panel rather than in an
   actions row — same shape the Send button on a knowledge hit uses, because
   the borderless `ghost` reads as a line of text and nobody can tell it is
   clickable (owner 2026-09-09, and again for Change requester). */
.pill-btn {
  display: inline-block;
  padding: 3px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.6;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid transparent; cursor: pointer;
}
.pill-btn:hover:not(:disabled) {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.pill-btn:disabled { opacity: .6; cursor: default; }

/* The people list inside the change-requester dialog. Each row is bordered
   rather than bare: a line of text that happens to be clickable is the same
   mistake the KB Send button made, and nobody clicks what does not look
   like a control. */
.pick-list { max-height: 260px; overflow-y: auto; margin-top: 6px; }
.pick-list .suggest-item {
  cursor: pointer; padding: 7px 10px; margin-bottom: 4px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel-2);
}
.pick-list .suggest-item:hover {
  background: var(--accent-soft); border-color: var(--accent);
}

/* ================================================================ sprint 4 */
/* consistent field spacing everywhere (div.fld previously had no margins) */
.fld { margin-bottom: 12px; }
.fld-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-dim); margin-bottom: 4px; }

/* company logo branding */
#topbar .brand img { height: 30px; display: block; }
.login-logo { max-width: 250px; max-height: 56px; margin: 0 auto 12px; display: block; }

/* landing page */
.home-hero { text-align: center; padding: 34px 24px 28px; }
.home-logo { max-width: 360px; max-height: 68px; width: auto; margin: 0 auto 16px; display: block; }
.home-hero h1 { font-size: 26px; margin-bottom: 6px; }
.home-hero .sub { color: var(--text-dim); max-width: 580px; margin: 0 auto 18px; }
.home-search { position: relative; max-width: 580px; margin: 0 auto; }
.home-search input { width: 100%; padding: 11px 14px; font-size: 15px; border-radius: 10px; }
.home-results { text-align: left; margin-top: 8px; background: var(--panel); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 320px; overflow-y: auto; padding: 6px; }
.home-results .kb-item { display: block; text-decoration: none; color: inherit; }
.home-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.tile { display: block; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 18px 16px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s, box-shadow .15s; }
.tile:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.tile-ico { font-size: 24px; display: block; margin-bottom: 6px; }
.tile-t { font-weight: 700; display: block; }
.tile-d { color: var(--text-dim); font-size: 12.5px; display: block; line-height: 1.45; }

/* ---- sprint 30: tiles lost their blurb, so they are half the height; a
   person's own tiles carry a remove button and there is one to add more */
.home-tiles .tile { position: relative; padding: 14px 14px; }
.tile-x {
  position: absolute; top: 4px; right: 4px; border: 0; background: transparent;
  color: var(--text-dim); font-size: 13px; line-height: 1; padding: 4px 6px;
  border-radius: 6px; opacity: 0; transition: opacity .12s;
}
.tile:hover .tile-x { opacity: 1; }
.tile-x:hover { color: var(--red); background: var(--red-soft); }
.tile-add {
  border-style: dashed; color: var(--text-dim); text-align: left;
  font: inherit; cursor: pointer;
}
.tile-add:hover { color: var(--accent); }

/* ticket page: main column + right sidebar (Requestor Details, Automation) */
.tk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
@media (max-width: 1020px) { .tk-layout { grid-template-columns: 1fr; } }
.side-card h3 { margin-bottom: 8px; }
.kv-left dd { text-align: left; }
#tk-runbooks select { width: 100%; }
#rb-form input { width: 100%; }

/* add-note: choose Public / Private on every press */
.note-add-wrap { position: relative; display: inline-block; }
.note-choice { position: absolute; right: 0; bottom: calc(100% + 6px); background: var(--panel); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); display: flex; flex-direction: column; min-width: 250px; overflow: hidden; z-index: 40; }
.note-choice button { text-align: left; padding: 10px 12px; border: 0; background: none; border-radius: 0; font-size: 13px; }
.note-choice button:hover { background: var(--accent-soft); }
.note-recips input { font-size: 12.5px; }

/* ============================== fleet / maintenance (FMS) */
/* work-order lifecycle pills — requested is the triage bucket */
.status-requested { background: var(--amber-soft); color: var(--amber); }
.status-open { background: var(--blue-soft); color: var(--blue); }
.status-on_hold { background: var(--amber-soft); color: var(--amber); }
.status-completed { background: var(--green-soft); color: var(--green); }
/* work-order type pills */
.wotype-repair { background: var(--blue-soft); color: var(--blue); }
.wotype-pm { background: var(--green-soft); color: var(--green); }
.wotype-inspection { background: var(--accent-soft); color: var(--accent); }
.wotype-request { background: var(--amber-soft); color: var(--amber); }
/* unit status pills */
.unit-active { background: var(--green-soft); color: var(--green); }
.unit-out_of_service { background: #fee2e2; color: var(--red); }
:root[data-theme="dark"] .unit-out_of_service { background: #7f1d1d; color: #fca5a5; }
.unit-retired { background: var(--gray-soft); color: var(--text-dim); }
/* request / WO cards — the tap-friendly list on phones */
.req-card { display: block; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; text-decoration: none; color: inherit; background: var(--panel); transition: border-color .15s; }
.req-card:hover { border-color: var(--accent); }
.req-card .req-title { font-weight: 600; margin: 6px 0 4px; }

/* checklist execution — big tap targets for gloves-on phones */
.ckl-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--border); }
.ckl-item:last-of-type { border-bottom: 0; }
.ckl-text { flex: 1; }
.ckl-failtext { color: var(--red); font-weight: 600; }
.ckl-btns { display: flex; gap: 6px; }
.ckl-btn { min-width: 44px; min-height: 36px; font-size: 16px; border-radius: 8px; }
.ckl-btn.pass.on { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.ckl-btn.fail.on { background: #fee2e2; color: var(--red); border-color: var(--red); }
:root[data-theme="dark"] .ckl-btn.fail.on { background: #7f1d1d; color: #fca5a5; }
.part-row { border-bottom: 1px solid var(--border); padding: 6px 0; }
.part-row:last-of-type { border-bottom: 0; }

/* ================================================================ sprint 5 */
/* rich-text KB editor */
.rt-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; border: 1px solid var(--border-strong); border-bottom: 0; border-radius: 8px 8px 0 0; background: var(--panel-2); }
.rt-btn { padding: 4px 9px; font-size: 13px; border: 1px solid var(--border); background: var(--panel); border-radius: 6px; cursor: pointer; color: var(--text); line-height: 1.4; }
.rt-btn:hover { background: var(--accent-soft); border-color: var(--accent); }
/* template editor: the Insert-field picker sits in the toolbar as one more control */
.rt-toolbar .rt-field { padding: 4px 6px; font-size: 13px; border: 1px solid var(--border); background: var(--panel); border-radius: 6px; color: var(--text); max-width: 230px; }
/* the ticket note composer: same editor, shorter, and resizable — the
   height a person drags it to is remembered (see bindNoteForm) */
.note-editor { min-height: 120px; max-height: none; height: 160px; resize: vertical; }
.note-editor:empty:before { content: attr(data-placeholder); color: var(--text-dim); }
.rt-editor { min-height: 320px; max-height: 62vh; overflow-y: auto; border: 1px solid var(--border-strong); border-radius: 0 0 8px 8px; padding: 14px 16px; background: var(--panel); }
.rt-editor:focus { outline: 2px solid var(--accent-soft); outline-offset: -2px; }
.rt-editor img, .article-body img { max-width: 100%; height: auto; border-radius: 6px; }
.article-body table, .rt-editor table { border-collapse: collapse; }
.article-body td, .article-body th, .rt-editor td, .rt-editor th { border: 1px solid var(--border-strong); padding: 4px 8px; }

/* hamburger — hidden on desktop, shown on narrow screens */
.nav-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; font-size: 18px; line-height: 1; padding: 5px 10px; cursor: pointer; color: var(--text); }

/* ---------- responsive: phone & small tablet ---------- */
@media (max-width: 760px) {
  #topbar { flex-wrap: wrap; height: auto; padding: 8px 14px; gap: 10px; position: relative; }
  .nav-toggle { display: inline-flex; align-items: center; }
  #userbox { margin-left: auto; gap: 8px; }
  #userbox .who { display: none; }               /* keep the bar compact */
  /* nav collapses into a dropdown below the bar */
  #nav { display: none; order: 10; flex-basis: 100%; flex-direction: column; overflow: visible; gap: 2px; }
  #topbar.nav-open #nav { display: flex; }
  #nav a { padding: 10px 12px; border-radius: 8px; font-size: 15px; }
  #view { padding: 14px; }
  .page-head h1 { font-size: 20px; }
  .card { padding: 13px 14px; }
  /* selects/inputs comfortable to tap */
  input, select, textarea, button { font-size: 16px; }   /* 16px avoids iOS zoom-on-focus */
  .home-tiles { grid-template-columns: 1fr 1fr; }
  .home-hero { padding: 24px 16px 20px; }
  .home-hero h1 { font-size: 22px; }
  .rt-editor { max-height: none; }
}
@media (max-width: 420px) {
  .home-tiles { grid-template-columns: 1fr; }
}
/* tablets: nav still fits inline but tighten layout gutters */
@media (min-width: 761px) and (max-width: 1024px) {
  #view { padding: 18px; }
  #nav a { padding: 6px 9px; }
}

/* ================================================================ sprint 6 */
.fs-bar { height: 10px; background: var(--gray-soft); border-radius: 6px; overflow: hidden; }
.fs-bar > div { height: 100%; background: var(--accent); transition: width .3s ease; }

/* ================================================================ sprint 8 */
.inst-badge { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); vertical-align: middle; margin-left: 4px; white-space: nowrap; }
/* per-instance tints: AFLBM green, Littfin light-red (owner request) */
.inst-badge.inst-aflbm { background: var(--green-soft); color: var(--green); }
.inst-badge.inst-littfin { background: var(--red-soft); color: var(--red); }

/* ================================================================ sprint 10 */
/* expense reports: right-aligned money columns, clickable rows, line form grid */
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rowlink { cursor: pointer; }
.rowlink:hover td { background: var(--accent-soft); }
.exp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; }

/* ================================================================ sprint 13 */
/* import-source tags on Imported Users: LDAP (Entra) blue, UKG green */
.src-tag { display: inline-block; font-size: 9.5px; font-weight: 700; letter-spacing: .4px; padding: 1px 5px; border-radius: 4px; vertical-align: middle; margin-left: 5px; }
.src-tag.src-ldap { background: var(--accent-soft); color: var(--accent-strong); }
.src-tag.src-ukg { background: var(--green-soft); color: var(--green); }

/* ================================================================ sprint 11 */
/* KB editor: floating save bar — always visible while the article scrolls */
.kb-savebar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 10px 0; margin-top: 10px; background: var(--panel); border-top: 1px solid var(--border); z-index: 5; }

/* ================================================================ sprint 9 */
/* pill-style back button on the ticket view */
.tk-back { display: inline-block; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--text-dim); font-size: 13px; font-weight: 600; padding: 4px 14px; margin-bottom: 10px; cursor: pointer; }
.tk-back:hover { color: var(--accent); border-color: var(--accent); }

/* ================================================================ sprint 14 */
/* Safety (SMS): risk pills use the same soft palette as priorities so the
 * H/M/L scale reads at a glance; corrective actions get their own status
 * tint. The people picker needs a positioned parent for its suggest pop. */
.risk-high { background: var(--red-soft); color: var(--red); }
.risk-medium { background: var(--amber-soft); color: var(--amber); }
.risk-low { background: var(--green-soft); color: var(--green); }
.sr-open { background: var(--blue-soft); color: var(--blue); }
.sr-closed { background: var(--gray-soft); color: var(--text-dim); }
.act-open { background: var(--blue-soft); color: var(--blue); }
.act-overdue { background: var(--red-soft); color: var(--red); }
.act-completed { background: var(--green-soft); color: var(--green); }
.person-fld { position: relative; }
.sr-action-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 14px; padding: 10px 0; border-top: 1px solid var(--border); }
.sr-action { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.sr-action .row { gap: 8px; align-items: center; margin-bottom: 4px; }
.sr-text { white-space: pre-wrap; }

/* ================================================================ sprint 15 */
/* Safety inspections: the walk-around form is a checklist of cards that only
 * open up when the inspector unticks "All good"; the segmented Mine/Everyone
 * switch replaces what used to be two top-level tabs. */
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 999px; overflow: hidden; }
.seg a { padding: 4px 14px; font-size: 13px; font-weight: 600; color: var(--text-dim); text-decoration: none; }
.seg a.on { background: var(--accent); color: #fff; }
.tabbar.sub a { font-size: 13px; }
.insp-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.insp-item.has-finding { border-color: var(--amber); background: var(--amber-soft); }
.insp-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.insp-ok { display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; color: var(--text-dim); white-space: nowrap; }
.insp-qs { margin: 6px 0 0; padding-left: 18px; color: var(--text-dim); font-size: 12.5px; }
.insp-qs li { margin: 2px 0; }
.insp-finding { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.hml-legend { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 14px; font-size: 12px; color: var(--text-dim); }
.hml-legend div + div { margin-top: 3px; }
.insp-tbl td { font-size: 12.5px; }
.insp-tbl tr.ok td { color: var(--text-dim); }
.ii-f + .ii-f { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.ii-note { width: 100%; margin-top: 8px; }

/* ---- sprint 17: accounting-connector placeholder + home tile admin */
.conn-list { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.conn-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; }
.conn-row + .conn-row { border-top: 1px solid var(--border); }
.conn-row .pill { background: var(--surface-2); color: var(--text-dim); }
.linkish { background: none; border: 0; color: inherit; cursor: pointer; padding: 0 0 0 4px; font-size: 12px; opacity: .7; }
.linkish:hover { opacity: 1; }

/* ---- sprint 18: dashboards. Every figure is a link into its module. */
a.tile.linky, a.bar-row.linky { text-decoration: none; color: inherit; }
a.tile.linky:hover { border-color: var(--accent); transform: translateY(-1px); }
a.bar-row.linky:hover .bar-label { color: var(--accent); }
.tile-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ---- sprint 19: expense test mode. Loud on purpose — a hand-picked
   approver must never be something you forget is happening. */
.btn.test-mode, button.test-mode { border: 2px solid var(--red); }
.banner.test-banner { background: var(--amber-soft); border-left: 3px solid var(--amber); }
.pill.test-pill { background: var(--red-soft); color: var(--red); }
.warn-text { color: var(--red); }

/* ---- sprint 20: attachment buttons (camera + file) */
.attach-btn { cursor: pointer; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; }
.attach-btn:hover { border-color: var(--accent); }

/* ---- sprint 28: the audit trail on a report */
.audit-list { margin: 0; padding-left: 20px; max-height: 60vh; overflow-y: auto; }
.audit-list li { padding: 7px 0; border-top: 1px solid var(--border); line-height: 1.45; }
.audit-list li:first-child { border-top: 0; }

/* ---- sprint 27: expense list filters, and the title/banner now edited on
   the report itself rather than on a create page of their own */
.filter-row { margin-bottom: 12px; align-items: flex-end; }
.inline-fld { display: flex; flex-direction: column; gap: 3px; }
.inline-fld > span { font-size: 11.5px; font-weight: 600; color: var(--text-dim); }
.title-inp {
  font-size: 22px; font-weight: 700; padding: 2px 6px; width: 100%;
  border: 1px solid transparent; background: transparent; color: var(--text);
}
.title-inp:hover { border-color: var(--border); }
.pill-select { padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }

/* ---- sprint 31: the create page is gone, so the report itself has to ask
   for the title. An empty one stays outlined until it is answered — it is
   required before submitting, and a placeholder alone reads as optional. */
.title-inp.needs-title { border-color: var(--amber); border-style: dashed; }
.banner.warn-banner { background: var(--amber-soft); border-left: 3px solid var(--amber); }

/* ---- sprint 32: the banner reads the same wherever it is listed — the
   expense queues and the helpdesk queue both use .banner-pill */
.pill.banner-pill { background: var(--blue-soft); color: var(--blue); }

/* ---- sprint 55: payment status. Money that has moved reads differently
   from money that has not, so paid is the only confident colour here. */
.pill.pay-paid { background: var(--green-soft); color: var(--green); }
.pill.pay-pending { background: var(--amber-soft); color: var(--amber); }
.pill.pay-failed { background: var(--red-soft); color: var(--red); }
.pill.pay-cancelled { background: var(--gray-soft); color: var(--text-dim); }
.pill.pay-refunded { background: var(--blue-soft); color: var(--blue); }
/* the banner chips on the Payments tab read as banners, like everywhere else */
.fchip.pay-chip.on { background: var(--blue-soft); color: var(--blue);
  border-color: var(--blue); }

/* ---- sprint 50: the PRTG alarm ticker.
   It scrolls, but every item is a link into PRTG, so it stops for anyone
   trying to click one — on hover, on keyboard focus, and permanently for
   anyone who has asked their OS for reduced motion. */
.prtg-bar {
  display: flex; align-items: center; gap: 10px; overflow: hidden;
  margin: 0 0 12px; padding: 7px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--panel);
}
.prtg-bar.prtg-down { border-color: var(--red); background: var(--red-soft); }
.prtg-bar.prtg-warn { border-color: var(--amber); background: var(--amber-soft); }
.prtg-bar.prtg-bad  { border-color: var(--amber); background: var(--amber-soft); }
.prtg-tag {
  flex: 0 0 auto; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; text-decoration: none; color: var(--text-dim);
  padding: 3px 8px; border-radius: 999px; background: var(--gray-soft);
}
.prtg-tag:hover { color: var(--text); }
.prtg-count {
  flex: 0 0 auto; font-size: 12px; font-weight: 600; text-decoration: none;
  color: var(--red);
}
.prtg-bar.prtg-warn .prtg-count { color: var(--amber); }
.prtg-clear, .prtg-err { font-size: 12px; color: var(--text-dim); min-width: 0; }

.prtg-track { flex: 1 1 auto; display: flex; overflow: hidden; min-width: 0; }
.prtg-run { display: flex; gap: 18px; padding-right: 18px; flex: 0 0 auto; }
.prtg-track.prtg-move .prtg-run { animation: prtg-scroll 40s linear infinite; }
.prtg-track:hover .prtg-run,
.prtg-track:focus-within .prtg-run { animation-play-state: paused; }
@keyframes prtg-scroll { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) {
  .prtg-track.prtg-move .prtg-run { animation: none; }
  .prtg-track { overflow-x: auto; }
}

.prtg-item {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font-size: 12px; text-decoration: none; color: var(--text);
}
.prtg-item:hover { text-decoration: underline; }
.prtg-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.prtg-item.prtg-down .prtg-dot { background: var(--red); }
.prtg-item.prtg-warning .prtg-dot { background: var(--amber); }
.prtg-item.prtg-other .prtg-dot { background: var(--text-dim); }
.prtg-sensor { color: var(--text-dim); }
.prtg-state { font-weight: 600; }
.prtg-item.prtg-down .prtg-state { color: var(--red); }
.prtg-item.prtg-warning .prtg-state { color: var(--amber); }
.prtg-since { color: var(--text-dim); }

.pill.prtg-down { background: var(--red-soft); color: var(--red); }
.pill.prtg-warning { background: var(--amber-soft); color: var(--amber); }
.pill.prtg-other { background: var(--gray-soft); color: var(--text-dim); }

/* the configuration checklist on Admin → Monitoring */
.cfg-list { list-style: none; padding: 0; margin: 10px 0 0; font-size: 13px; }
.cfg-list li { padding: 3px 0; }
.cfg-list .cfg-ok { color: var(--green); }
.cfg-list .cfg-bad { color: var(--amber); }
.code-block {
  background: var(--gray-soft); border-radius: 8px; padding: 10px 12px;
  font-size: 12px; overflow-x: auto; white-space: pre; margin: 6px 0;
}

/* ---- sprint 49: the queue a ticket waits in. "unqueued" is deliberately
   legible rather than blank — unrouted work is work, and an empty cell
   hides it from the person whose job is to route it. */
.pill.queue-pill { background: var(--gray-soft); color: var(--text); font-weight: 600; }
.pill.queue-pill.queue-none {
  background: transparent; color: var(--text-dim); font-weight: 400;
  border: 1px dashed var(--border);
}

/* ---- sprint 33: a person named inside a pill — default approver and
   processor are the same kind of thing and now look it */
.pill-link { text-decoration: none; color: inherit; }
.pill-link:hover { text-decoration: underline; }

/* ---- sprint 40: a field the receipt reader filled in. Marked because a
   suggestion nobody can tell from something they typed is not a suggestion —
   the mark clears the moment the person edits the field. */
.ocr-filled { border-color: var(--blue); background: var(--blue-soft); }

/* ---- sprint 39: files hanging off a knowledge article */
.attach-chip { display: inline-flex; align-items: center; gap: 2px; }
#kb-att-list { gap: 8px; }

/* ---- sprint 26: the per-line action icons were too small to hit, on a
   phone especially (owner 2026-07-29) */
.tbl .icon-btn { font-size: 17px; line-height: 1; padding: 6px 9px; border-radius: 8px; }
.tbl .icon-btn.danger:hover { background: var(--red-soft); }

/* ---- sprint 25: the Knowledge Base tile on a ticket */
.kb-hits { list-style: none; margin: 0; padding: 0; }
.kb-hits li { padding: 6px 0; border-top: 1px solid var(--border); }
.kb-hits li:first-child { border-top: 0; }
.kb-snip { margin-top: 2px; line-height: 1.4;
           display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
           overflow: hidden; }

/* ---- sprint 22: a line with no attachment says so where the approver is
   already looking, and the certification is a paragraph, not a label */
.pill.warn-pill { background: var(--amber-soft); color: var(--amber); cursor: help; }
.cert-box { display: flex; gap: 10px; align-items: flex-start; line-height: 1.5;
            padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.cert-box input { margin-top: 3px; flex: none; }


/* ================================================================ CRM */
/* The board scrolls sideways inside its card — a pipeline with six stages
   must not make the whole page scroll horizontally. */
.crm-board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.crm-col { flex: 0 0 230px; display: flex; flex-direction: column; gap: 8px; }
.crm-col-head { display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px; border-radius: 8px; background: var(--bg);
  border: 1px solid var(--border); }
.crm-card { display: block; padding: 9px 11px; border-radius: 8px;
  background: var(--panel); border: 1px solid var(--border);
  text-decoration: none; color: inherit; }
.crm-card:hover { border-color: var(--accent); }
.crm-card-title { font-weight: 600; font-size: 13.5px; }
.crm-card-foot { display: flex; justify-content: space-between;
  margin-top: 6px; font-size: 12.5px; font-weight: 600; }
.crm-empty { padding: 10px; text-align: center; }
.err-text { color: var(--red); }

.stat-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.stat-card { flex: 1 1 150px; margin: 0; }
.stat-big { font-size: 28px; font-weight: 700; line-height: 1.25; }
