/* SupportDesk: calm working surface, colour reserved for deadlines and state. */
:root {
  --brand: #0E6B5C;
  --bg: #F2F4F3;
  --surface: #FFFFFF;
  --ink: #18231F;
  --ink-2: #3D4A46;
  --muted: #66736F;
  --line: #DDE3E1;
  --line-2: #EBEFED;
  --side: #1B2B27;
  --side-ink: #C9D4D0;
  --ok: #1F7A4D;
  --soon: #B7791F;
  --bad: #B42318;
  --note: #FFF7E6;
  --r-lg: 12px;
  --r: 8px;
  --r-sm: 6px;
  --shadow: 0 1px 2px rgba(24, 35, 31, .06);
  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.35rem; font-weight: 700; }
h2 { font-size: 1.05rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 650; }
p { margin: 0 0 .8rem; }
code { font-size: .85em; background: var(--line-2); padding: .1em .35em; border-radius: 4px; }
.muted { color: var(--muted); }
.small, small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.opt { color: var(--muted); font-weight: 400; font-size: .8rem; }
.icon { width: 18px; height: 18px; flex: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: .5rem 1rem; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .55rem 1rem; border-radius: var(--r-sm);
  border: 1px solid var(--brand); background: var(--brand); color: #fff; font: 600 .9rem/1.2 var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn .icon { width: 16px; height: 16px; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--line-2); filter: none; }
.btn-danger { background: var(--surface); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, white); }
.btn-sm { padding: .3rem .6rem; font-size: .82rem; }
.btn-block { width: 100%; }
.icon-btn { background: none; border: 0; padding: .4rem; border-radius: var(--r-sm); color: var(--ink); cursor: pointer; display: inline-flex; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex: none; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; padding: 1rem .75rem; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .65rem; }
.brand strong { display: block; font-size: .95rem; line-height: 1.2; }
.brand small { display: block; color: var(--muted); font-size: .75rem; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: .8rem; flex: none; }
.sidebar .brand { padding: .25rem .5rem 1.1rem; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: .75rem; }
.sidebar .brand strong { color: #fff; }
.sidebar .brand small { color: #93A39E; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a, .nav-btn { display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem; border-radius: var(--r-sm); color: var(--side-ink);
  font-size: .9rem; font-weight: 500; background: none; border: 0; width: 100%; cursor: pointer; font-family: inherit; text-align: left; }
.nav a:hover, .nav-btn:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: .75rem; display: grid; gap: 2px; }
.me { display: flex; gap: .6rem; align-items: center; padding: .45rem .5rem; border-radius: var(--r-sm); color: var(--side-ink); min-width: 0; }
.me:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.me span { min-width: 0; }
.me strong { display: block; color: #fff; font-size: .85rem; }
.me small { display: block; color: #93A39E; font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: .85rem 1.75rem; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10; }
.topbar h1 { margin: 0; font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: none; }
.search { display: flex; align-items: center; gap: .4rem; margin-left: auto; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 0 .6rem; width: min(340px, 36vw); color: var(--muted); }
.search input { border: 0; background: none; padding: .5rem 0; width: 100%; font: inherit; color: var(--ink); outline: none; }
.search:focus-within { border-color: var(--brand); background: var(--surface); }
.top-actions { display: flex; gap: .5rem; align-items: center; }
.top-actions form { margin: 0; }
.content { padding: 1.5rem 1.75rem 3rem; max-width: 1320px; width: 100%; }
.scrim { display: none; }

/* ---------- Panels & layout ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.25rem; box-shadow: var(--shadow); margin-bottom: 1.25rem; }
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.panel-head.pad { padding: 1.1rem 1.25rem 0; }
.panel-head h2 { margin: 0; }
.panel-head a { font-size: .85rem; }
.panel-note { color: var(--muted); font-size: .82rem; margin-top: -.4rem; }
.cols { display: flex; gap: 1.25rem; align-items: flex-start; margin-bottom: 1.25rem; }
.cols > .panel, .cols > * > .panel:last-child { margin-bottom: 0; }
.grow { flex: 1; min-width: 0; }
.side, .side-stack { width: 330px; flex: none; }
.side-stack > .panel:last-child { margin-bottom: 0; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 0 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.narrow { max-width: 760px; }
.empty { text-align: center; padding: 3rem 1.5rem; color: var(--muted); }
.empty h2 { color: var(--ink); }
.empty-inline { color: var(--muted); font-size: .9rem; padding: .5rem 0; margin: 0; }
.callout { display: flex; gap: 1.5rem; align-items: center; justify-content: space-between; border-left: 4px solid var(--brand); }
.callout p { margin: 0; }
.copy-field { display: flex; gap: .5rem; min-width: min(460px, 100%); }
.copy-field input { flex: 1; }
.danger-zone { margin-top: -.25rem; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; margin-bottom: 1.25rem; box-shadow: var(--shadow); }
.kpis-3 { grid-template-columns: repeat(3, 1fr); }
.kpi { background: var(--surface); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .15rem; }
.kpi-label { color: var(--muted); font-size: .8rem; font-weight: 500; }
.kpi strong { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: .75rem; }
.kpi.warn strong { color: var(--soon); }
.kpi.bad strong { color: var(--bad); }

/* ---------- Forms ---------- */
.form label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 600; color: var(--ink-2); margin-bottom: .9rem; }
.form label small { font-weight: 400; color: var(--muted); }
input, select, textarea { font: 400 .92rem/1.4 var(--font); color: var(--ink); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: .55rem .7rem; width: 100%; }
textarea { resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
input[disabled] { background: var(--line-2); color: var(--muted); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); }
input[type=color] { padding: 2px; height: 40px; width: 64px; }
.form label.check { flex-direction: row; align-items: center; gap: .55rem; font-weight: 500; }
.form fieldset { border: 1px solid var(--line-2); border-radius: var(--r); padding: .9rem 1rem .2rem; margin: 0 0 1rem; }
.form legend { font-weight: 650; font-size: .9rem; padding: 0 .35rem; }
.form h2 { margin-top: .5rem; }
.form h2 + .muted { margin-top: -.25rem; }
.form-actions { display: flex; gap: .6rem; margin-top: .4rem; }
.form.compact label { margin-bottom: .7rem; }
.input-prefix, .input-suffix { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.input-prefix span, .input-suffix span { background: var(--line-2); color: var(--muted); padding: 0 .6rem; display: flex; align-items: center; font-weight: 400; font-size: .85rem; }
.input-prefix input, .input-suffix input { border: 0; border-radius: 0; }
.color-field { display: flex; align-items: center; gap: .7rem; }
.file-drop { flex-direction: row !important; align-items: center; gap: .6rem !important; border: 1px dashed var(--line); border-radius: var(--r); padding: .75rem 1rem;
  cursor: pointer; font-weight: 500 !important; color: var(--muted) !important; position: relative; }
.file-drop:hover { border-color: var(--brand); color: var(--brand) !important; }
.file-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop.small { padding: .45rem .8rem; }
.filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: 1rem; }
.filters label { display: flex; flex-direction: column; gap: .25rem; font-size: .78rem; font-weight: 600; color: var(--muted); min-width: 140px; }
.filters label.grow { flex: 1; min-width: 220px; }
.filters select, .filters input { padding: .45rem .6rem; }
.inline-form select { padding: .5rem .6rem; }
label.inline { display: flex; flex-direction: row; align-items: center; gap: .5rem; font-size: .82rem; font-weight: 500; color: var(--muted); margin: 0; }
label.inline select { width: auto; padding: .35rem .5rem; }

/* ---------- Flash ---------- */
.flash { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: .8rem 1rem; border-radius: var(--r); margin-bottom: 1rem;
  border: 1px solid; font-size: .9rem; }
.flash ul { margin: .35rem 0 0; padding-left: 1.2rem; }
.flash-success { background: #EDF7F1; border-color: #BFE0CC; color: #174D32; }
.flash-error { background: #FDF0EF; border-color: #F2C4BF; color: #7A1C13; }
.flash-info { background: #EEF4F8; border-color: #C8DBE8; color: #1F4460; }
.flash-warn { background: #FFF6E5; border-color: #F0D7A6; color: #6B470C; }
.flash-x { background: none; border: 0; font-size: 1.2rem; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.status-open { background: #E6F0FA; color: #1D4F80; }
.status-in_progress { background: #EAE8FB; color: #43369A; }
.status-pending { background: #FFF1D6; color: #7A5210; }
.status-resolved { background: #E3F4EA; color: #1D6640; }
.status-closed { background: var(--line-2); color: var(--muted); }
.priority-low { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.priority-medium { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px #BCC6C3; }
.priority-high { background: #FFF1E3; color: #93440B; }
.priority-urgent { background: var(--bad); color: #fff; }
.state-active { background: #E3F4EA; color: #1D6640; }
.state-suspended { background: #FDECEA; color: var(--bad); }
.state-draft { background: #FFF1D6; color: #7A5210; }
.role-admin { background: #E7EFEC; color: var(--brand); }
.role-agent { background: var(--line-2); }

/* ---------- SLA: the one loud element ---------- */
.sla { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sla::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sla-ok { color: var(--ok); }
.sla-soon { color: var(--soon); }
.sla-breached { color: var(--bad); }
.sla-met { color: var(--muted); }
.sla-missed { color: #9A5A52; }
.sla-breached::before { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
[class*="rail-"] { position: relative; }
tr.rail-soon > td:first-child, tr.rail-breached > td:first-child, li.rail-soon > a, li.rail-breached > a { box-shadow: inset 4px 0 0 var(--rail); }
.rail-soon { --rail: var(--soon); }
.rail-breached { --rail: var(--bad); }
.ticket-head.rail-soon, .ticket-head.rail-breached { box-shadow: inset 4px 0 0 var(--rail); padding-left: 1rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { text-align: left; font-weight: 600; font-size: .78rem; color: var(--muted); padding: .7rem 1rem; border-bottom: 1px solid var(--line); background: #FAFBFA; white-space: nowrap; }
.table td { padding: .75rem 1rem; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FAFBFA; }
.table tr.dim td { opacity: .55; }
.tickets tr[data-href] { cursor: pointer; }
.tcell { display: flex; flex-direction: column; color: var(--ink); min-width: 240px; }
.tcell:hover { text-decoration: none; }
.tcell:hover strong { color: var(--brand); }
.tcell small { color: var(--muted); }
.tref { font-size: .75rem; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: .35rem; justify-content: flex-end; align-items: center; }
.row-actions form { margin: 0; }
.pager { display: flex; gap: .5rem; align-items: center; justify-content: flex-end; margin: -.25rem 0 1rem; font-size: .85rem; }

/* ticket list (dashboard) */
.tlist { list-style: none; margin: 0; padding: 0; }
.tlist li { border-top: 1px solid var(--line-2); }
.tlist li:first-child { border-top: 0; }
.tlist a { display: grid; grid-template-columns: 92px 1fr auto auto; gap: .9rem; align-items: center; padding: .7rem .6rem; color: var(--ink); border-radius: var(--r-sm); }
.tlist a:hover { background: var(--bg); text-decoration: none; }
.tlist .tsub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.tlist .tsub small { display: block; color: var(--muted); font-weight: 400; }

/* bars */
.hbar { display: grid; grid-template-columns: 150px 1fr 32px; gap: .6rem; align-items: center; font-size: .84rem; margin-bottom: .45rem; }
.hbar strong { text-align: right; font-variant-numeric: tabular-nums; }
.hbar-track { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--brand); border-radius: 999px; min-width: 2px; }
.st-open { background: #3A76B0; } .st-in_progress { background: #6457C4; } .st-pending { background: var(--soon); }
.st-resolved { background: var(--ok); } .st-closed { background: #A9B4B0; }
.pr-low { background: #A9B4B0; } .pr-medium { background: #6D7F79; } .pr-high { background: #D0761E; } .pr-urgent { background: var(--bad); }
.vbars { display: flex; align-items: flex-end; gap: 4px; height: 110px; padding-top: .5rem; }
.vbar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.vbar i { display: block; width: 100%; height: max(var(--v), 3px); background: color-mix(in srgb, var(--brand) 75%, white); border-radius: 3px 3px 0 0; }
.vbar:last-child i { background: var(--brand); }
.vbars-axis { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); margin-top: .35rem; }
.pair-bars { display: flex; align-items: flex-end; gap: 3px; height: 180px; overflow-x: auto; }
.pair { flex: 1 0 8px; height: 100%; display: flex; align-items: flex-end; gap: 1px; }
.pair i, .pair b { flex: 1; height: max(var(--v), 2px); border-radius: 2px 2px 0 0; }
.pair i { background: color-mix(in srgb, var(--brand) 45%, white); }
.pair b { background: var(--brand); }
.legend { display: flex; gap: 1rem; font-size: .8rem; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; }
.lg-created::before { background: color-mix(in srgb, var(--brand) 45%, white); }
.lg-resolved::before { background: var(--brand); }

/* ---------- Ticket view ---------- */
.ticket-head { margin-bottom: 1.25rem; }
.ticket-head h2 { font-size: 1.4rem; font-weight: 700; margin: .1rem 0 .5rem; }
.crumbs { font-size: .82rem; color: var(--muted); margin: 0; }
.meta { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; font-size: .85rem; }
.thread { list-style: none; margin: 0 0 1.25rem; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.msg { display: flex; gap: .8rem; align-items: flex-start; }
.bubble { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: .9rem 1.1rem; box-shadow: var(--shadow); }
.bubble header { display: flex; flex-wrap: wrap; gap: .3rem .75rem; align-items: baseline; margin-bottom: .45rem; font-size: .88rem; }
.bubble header .muted:last-child { margin-left: auto; font-size: .8rem; }
.bubble .body { overflow-wrap: anywhere; }
.from-team .bubble { border-left: 3px solid var(--brand); }
.note .bubble { background: var(--note); border-color: #F0DDB5; border-style: dashed; }
.tag-note { font-size: .72rem; font-weight: 700; color: #7A5210; background: #FFE7B8; padding: .05rem .45rem; border-radius: 4px; }
.files { list-style: none; padding: 0; margin: .6rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.files a { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; padding: .3rem .6rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); }
.files .icon { width: 14px; height: 14px; }
.files small { color: var(--muted); }
.reply { border-top: 3px solid var(--brand); }
.reply.is-note { border-top-color: var(--soon); background: var(--note); }
.reply-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .6rem; flex-wrap: wrap; }
.reply-head h3 { margin: 0; }
.reply .form label, .reply > label { margin-bottom: .6rem; }
.reply textarea { margin-bottom: .6rem; }
.reply-foot { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; }
.reply-foot .btn { margin-left: auto; }
.reply-foot label.check { flex-direction: row; display: flex; align-items: center; gap: .45rem; font-size: .85rem; font-weight: 500; margin: 0; }
.ticket-side h3 { margin-bottom: .75rem; }
.facts { display: grid; grid-template-columns: 110px 1fr; gap: .45rem .75rem; margin: 0 0 .75rem; font-size: .87rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.person { display: flex; gap: .7rem; align-items: center; min-width: 0; }
.person > div { display: flex; flex-direction: column; min-width: 0; font-size: .87rem; }
.person .muted, .person a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-side .person { margin-bottom: .75rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: .75rem; font-weight: 700;
  background: hsl(var(--h) 38% 88%); color: hsl(var(--h) 45% 28%); }
.timeline { list-style: none; padding: 0; margin: 0; font-size: .83rem; max-height: 340px; overflow-y: auto; }
.timeline li { padding: 0 0 .7rem .9rem; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.timeline li:first-child::before { background: var(--brand); }
.timeline span { font-weight: 600; }
.timeline small { display: block; color: var(--muted); font-size: .75rem; }
.stars { color: #C98A12; font-size: 1.15rem; letter-spacing: 2px; margin: 0 0 .3rem; }
.rating { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: .15rem; margin-bottom: .6rem; }
.rating input { position: absolute; opacity: 0; }
.rating label { font-size: 1.8rem !important; color: var(--line) !important; cursor: pointer; margin: 0 !important; line-height: 1; }
.rating label:hover, .rating label:hover ~ label, .rating input:checked ~ label { color: #C98A12 !important; }
.rating input:focus-visible + label { outline: 2px solid var(--brand); border-radius: 4px; }
.sla-list { display: grid; grid-template-columns: auto 1fr; gap: .55rem 1rem; margin: 0 0 1rem; align-items: center; font-size: .9rem; }
.sla-list dd { margin: 0; font-weight: 600; }

/* ---------- Tabs, lists ---------- */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs a { padding: .6rem 1rem; color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--ink); border-color: var(--brand); }
.canned-list { list-style: none; margin: 0; padding: 0; }
.canned-list li { display: flex; gap: 1rem; justify-content: space-between; padding: 1rem 1.25rem; border-top: 1px solid var(--line-2); }
.canned-list li:first-child { border-top: 0; }
.canned-list p { margin: .2rem 0; color: var(--ink-2); font-size: .88rem; }
.plain-links { list-style: none; padding: 0; margin: 0; }
.plain-links li { padding: .45rem 0; border-top: 1px solid var(--line-2); font-size: .9rem; }
.plain-links li:first-child { border-top: 0; }

/* ---------- Articles ---------- */
.article-wrap { padding: 2rem 2.5rem; }
.article { max-width: 70ch; }
.article h1 { font-size: 1.7rem; margin-bottom: .3rem; }
.article-body { font-size: 1rem; line-height: 1.7; margin: 1.5rem 0 2rem; }
.article-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; background: var(--bg); border-radius: var(--r); margin-bottom: 2rem; }
.article-foot p { margin: 0; font-weight: 600; }

/* ---------- Auth ---------- */
.auth-wrap { display: grid; grid-template-columns: minmax(320px, 5fr) 7fr; min-height: 100vh; }
.auth-side { background: var(--side); color: var(--side-ink); padding: 2.5rem; display: flex; flex-direction: column; justify-content: space-between;
  background-image: linear-gradient(180deg, transparent 55%, color-mix(in srgb, var(--brand) 35%, transparent)); }
.auth-side .brand strong { color: #fff; font-size: 1.05rem; }
.auth-copy { max-width: 26rem; }
.auth-copy h2 { color: #fff; font-size: 2rem; line-height: 1.15; font-weight: 700; letter-spacing: -.025em; margin-bottom: 1rem; }
.auth-copy p { font-size: 1rem; color: #AEBBB7; }
.auth-foot { font-size: .8rem; color: #7F8F8A; margin: 0; }
.auth-main { display: grid; place-items: center; padding: 2rem 1.25rem; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 { font-size: 1.6rem; }
.auth-links { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: .9rem; }
.auth-links p { margin-bottom: .4rem; }

/* ---------- Public portal ---------- */
.portal { background: var(--bg); }
.portal-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 2rem; background: var(--surface); border-bottom: 1px solid var(--line); }
.portal-head .brand { color: var(--ink); }
.portal-head .brand:hover { text-decoration: none; }
.portal-head nav { display: flex; gap: .5rem; }
.portal-hero { background: var(--brand); color: #fff; padding: 3.5rem 2rem 3rem; text-align: center; }
.portal-hero h1 { font-size: 2.1rem; letter-spacing: -.02em; margin-bottom: 1.25rem; }
.portal-hero p { opacity: .9; margin: 1rem 0 0; }
.portal-hero a { color: #fff; text-decoration: underline; }
.portal-search { display: flex; align-items: center; gap: .5rem; max-width: 620px; margin: 0 auto; background: #fff; border-radius: var(--r); padding: .35rem .35rem .35rem .9rem; color: var(--muted); }
.portal-search input { border: 0; box-shadow: none !important; padding: .55rem 0; font-size: 1rem; }
.portal-body { max-width: 860px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.article-list { display: grid; gap: .75rem; }
.article-link { display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); }
.article-link:hover { border-color: var(--brand); text-decoration: none; }
.article-link span { color: var(--muted); font-size: .9rem; }
.article-link small { color: var(--brand); font-weight: 600; }
.portal-foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 2rem; }

/* ---------- Installer ---------- */
.install { display: grid; place-items: start center; padding: 2.5rem 1rem; }
.install-card { width: 100%; max-width: 760px; }
.install-card .brand { margin-bottom: 1.5rem; }
.checks { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; font-size: .85rem; margin: 0 0 1.25rem; }
.checks .ok { color: var(--ok); }
.checks .bad { color: var(--bad); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1020px) {
  .cols { flex-direction: column; align-items: stretch; }
  .side, .side-stack { width: auto; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s ease; }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: .7rem 1rem; gap: .6rem; flex-wrap: wrap; }
  .search { order: 5; width: 100%; margin: 0; }
  .top-actions { margin-left: auto; }
  .content { padding: 1rem; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { padding: 1.5rem; }
  .auth-copy, .auth-foot { display: none; }
  .callout { flex-direction: column; align-items: stretch; }
}
@media (max-width: 640px) {
  .kpis, .kpis-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .tlist a { grid-template-columns: 1fr auto; }
  .tlist .tref, .tlist .badge { display: none; }
  .msg > .avatar { display: none; }
  .article-wrap { padding: 1.25rem; }
  .portal-head { padding: 1rem; flex-wrap: wrap; }
  .hbar { grid-template-columns: 130px 1fr 28px; }
  .top-actions .btn span, .top-actions .btn { font-size: .82rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}
@media print {
  .sidebar, .topbar, .reply, .ticket-side form { display: none !important; }
  .content { padding: 0; }
}
