/* SPOC Helpdesk — 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); }
.note.private { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 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; }
.tpl-edit-grid { display: grid; grid-template-columns: 1fr 230px; gap: 14px; }
@media (max-width: 640px) { .tpl-edit-grid { grid-template-columns: 1fr; } }
.ph-list { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; }
.ph-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--panel-2); cursor: pointer; }
.ph-item:hover { border-color: var(--accent); }
.ph-item code { font-size: 11.5px; color: var(--accent); }
.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; }

/* ================================================================ 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(210px, 1fr)); gap: 14px; 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: 8px; }
.tile-t { font-weight: 700; display: block; margin-bottom: 4px; }
.tile-d { color: var(--text-dim); font-size: 12.5px; display: block; line-height: 1.45; }

/* 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; }
