/*!
 * Group44 HelpDesk — UI
 * © Copyright 2026 Group44 Pty Ltd ABN: 24 703 434 664 ACN: 703 434 664
 * Parent Company GIGA Pty Ltd ABN: 68 079 638 547 · 079 638 547
 */
:root {
  --brand: #4f46e5;
  --brand-ink: #fff;
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e5e7ef;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #8a94a6;
  --sidebar: #0f1222;
  --sidebar-2: #181c33;
  --sidebar-text: #a9b0c7;
  --ok: #16a34a; --warn: #d97706; --bad: #dc2626; --info: #0284c7;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 10px 30px -10px rgba(16,24,40,.18);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0b0d17; --surface: #121527; --surface-2: #171b31; --border: #262b45;
  --text: #e8eaf3; --text-2: #b4bad0; --muted: #7c84a0; --sidebar: #080a13; --sidebar-2: #12152a;
  --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 12px 30px -10px rgba(0,0,0,.6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); font-size: 14px; line-height: 1.55; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 1em; }
code, pre { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; }
pre { background: #0f1222; color: #e2e8f0; padding: 14px 16px; border-radius: var(--radius-sm); overflow: auto; }
pre code { background: none; border: 0; padding: 0; color: inherit; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; }
.row.between { justify-content: space-between; }
.row.flexwrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 16px; }
.ic { width: 18px; height: 18px; fill: currentColor; flex: none; }
.hidden { display: none !important; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; text-decoration: none !important; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); box-shadow: 0 1px 2px rgba(79,70,229,.3); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: rgba(220,38,38,.08); border-color: rgba(220,38,38,.35); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; height: 42px; }
.btn .ic { width: 16px; height: 16px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font: inherit; }
.link-btn.danger { color: var(--bad); }

/* ---------- forms ---------- */
.form .field, .field { margin-bottom: 14px; }
label { display: block; font-weight: 550; font-size: 13px; margin-bottom: 5px; color: var(--text); }
.help { font-size: 12px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=url], input[type=datetime-local], select, textarea {
  width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s; }
input:not([type]) { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
textarea { height: auto; min-height: 110px; padding: 10px 12px; 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[type=color] { width: 54px; height: 38px; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.form-actions { display: flex; gap: 10px; align-items: center; padding-top: 6px; }
.checks { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; font-size: 13px; }
.checks .ok { color: var(--ok); } .checks .bad { color: var(--bad); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; }
.chip-check span { display: inline-flex; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); font-size: 12.5px; cursor: pointer; background: var(--surface); }
.chip-check input:checked + span { background: color-mix(in srgb, var(--bc, var(--brand)) 14%, transparent); border-color: var(--bc, var(--brand)); color: var(--bc, var(--brand)); font-weight: 600; }

/* ---------- alerts ---------- */
.alert { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; border: 1px solid; font-weight: 500; display: flex; gap: 10px; align-items: flex-start; }
.alert.success { background: #ecfdf3; border-color: #abefc6; color: #067647; }
.alert.error { background: #fef3f2; border-color: #fecdca; color: #b42318; }
.alert.info { background: #eff8ff; border-color: #b2ddff; color: #175cd3; }
[data-theme="dark"] .alert.success { background: #0b2a1a; border-color: #14532d; color: #86efac; }
[data-theme="dark"] .alert.error { background: #2d0f0f; border-color: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .alert.info { background: #0c1f33; border-color: #1e3a5f; color: #93c5fd; }
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.toast-wrap .alert { box-shadow: var(--shadow-lg); margin: 0; animation: slidein .25s ease-out; }
@keyframes slidein { from { transform: translateY(10px); opacity: 0; } }

/* ---------- badges / avatars ---------- */
.badge { --bc: #64748b; display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  color: var(--bc); background: color-mix(in srgb, var(--bc) 12%, transparent); border: 1px solid color-mix(in srgb, var(--bc) 25%, transparent); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--bc); }
.badge.plain::before { display: none; }
.avatar { --av: #4f46e5; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--av); color: #fff; font-weight: 650; font-size: 12px; flex: none; letter-spacing: .02em; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.pill-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 11.5px; font-weight: 650; color: var(--text-2); }

/* ---------- cards / tables ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-h h2, .card-h h3 { margin: 0; }
.card-b { padding: 18px; }
.card-f { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .t-title { font-weight: 600; color: var(--text); }
.table .t-title:hover { color: var(--brand); }
.table td.cb, .table th.cb { width: 36px; padding-right: 0; }
.table tr.unread .t-title::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 7px; border-radius: 50%; background: var(--brand); vertical-align: middle; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ic { width: 42px; height: 42px; opacity: .35; margin-bottom: 8px; }
.pager { display: flex; gap: 4px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.pager a, .pager .current { min-width: 32px; height: 32px; padding: 0 10px; display: inline-grid; place-items: center; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 550; }
.pager .current { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager .muted { margin-left: auto; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 500; word-break: break-word; }

/* ============================================================ ADMIN */
.admin { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; font-weight: 700; font-size: 15px; }
.sb-brand img { height: 26px; }
.sb-brand small { display: block; font-weight: 500; color: var(--sidebar-text); font-size: 11px; }
.sb-section { padding: 14px 18px 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #5f6788; font-weight: 700; }
.sb-nav a { display: flex; align-items: center; gap: 11px; margin: 1px 10px; padding: 8px 10px; border-radius: 8px; color: var(--sidebar-text); font-weight: 520; text-decoration: none; }
.sb-nav a:hover { background: var(--sidebar-2); color: #fff; }
.sb-nav a.active { background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 35%, transparent), color-mix(in srgb, var(--brand) 12%, transparent)); color: #fff; }
.sb-nav a.active .ic { color: #fff; }
.sb-nav a .pill-count { margin-left: auto; background: rgba(255,255,255,.08); border-color: transparent; color: #fff; }
.sb-nav a .pill-count.hot { background: var(--bad); }
.sb-foot { margin-top: auto; padding: 14px 18px; font-size: 11px; color: #5f6788; border-top: 1px solid rgba(255,255,255,.06); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 62px; display: flex; align-items: center; gap: 14px; padding: 0 26px; background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar .search { flex: 1; max-width: 520px; position: relative; }
.topbar .search input { padding-left: 38px; background: var(--surface-2); }
.topbar .search .ic { position: absolute; left: 12px; top: 10px; color: var(--muted); }
.topbar .kbd { position: absolute; right: 10px; top: 9px; font-size: 11px; color: var(--muted); border: 1px solid var(--border); padding: 0 6px; border-radius: 5px; background: var(--surface); }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 9px; padding: 4px 6px; border-radius: 10px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { background: var(--surface-2); }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; }
.menu-pop a, .menu-pop button { display: flex; width: 100%; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; text-decoration: none; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); }
.content { padding: 26px; max-width: 1480px; width: 100%; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-h h1 { margin: 0; }
.page-h p { margin: 3px 0 0; color: var(--muted); }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { padding: 16px 18px; display: flex; gap: 14px; align-items: center; text-decoration: none !important; color: inherit; }
.stat:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.stat .si { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--c, var(--brand)) 12%, transparent); color: var(--c, var(--brand)); }
.stat .sv { font-size: 24px; font-weight: 750; line-height: 1.1; letter-spacing: -.02em; }
.stat .sl { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.chart { display: flex; align-items: flex-end; gap: 8px; height: 190px; padding: 10px 4px 0; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.chart .bars { display: flex; gap: 3px; align-items: flex-end; height: calc(100% - 22px); width: 100%; justify-content: center; }
.chart .bar { width: 42%; max-width: 16px; border-radius: 4px 4px 2px 2px; background: var(--brand); min-height: 2px; transition: opacity .15s; }
.chart .bar.r { background: #10b981; }
.chart .col:hover .bar { opacity: .8; }
.chart .lbl { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; background: var(--brand); vertical-align: -1px; }
.legend span.r::before { background: #10b981; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.meter > i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.list-rows > div { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.list-rows > div:last-child { border-bottom: 0; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--text-2); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; display: flex; gap: 7px; align-items: center; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--brand); border-color: var(--brand); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.filters select, .filters input { width: auto; height: 34px; font-size: 13px; }
.filters input[type=search] { min-width: 220px; }
.bulkbar { display: none; gap: 8px; align-items: center; padding: 10px 14px; background: color-mix(in srgb, var(--brand) 8%, var(--surface)); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.bulkbar.show { display: flex; }
.bulkbar select { width: auto; height: 32px; font-size: 13px; }

/* ticket view */
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.ticket-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; }
.ticket-head h1 { font-size: 21px; margin: 0 0 6px; }
.thread { display: flex; flex-direction: column; gap: 14px; }
.msg { display: flex; gap: 12px; }
.msg .bubble { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.msg .mh { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13px; flex-wrap: wrap; }
.msg .mh strong { font-weight: 650; }
.msg .mb { padding: 14px 16px; overflow-wrap: anywhere; }
.msg.op .bubble { border-left: 3px solid var(--brand); }
.msg.note .bubble { background: #fffbeb; border-color: #fde68a; border-left: 3px solid #f59e0b; }
[data-theme="dark"] .msg.note .bubble { background: #2a210a; border-color: #5b4712; }
.msg.note .mh { border-color: #fde68a; }
[data-theme="dark"] .msg.note .mh { border-color: #5b4712; }
.atts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 14px; }
.att { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font-size: 12.5px; color: var(--text); text-decoration: none !important; max-width: 260px; }
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att img { width: 36px; height: 36px; object-fit: cover; border-radius: 5px; }
.composer { margin-top: 18px; }
.composer .ctabs { display: flex; gap: 4px; padding: 8px 10px 0; border-bottom: 1px solid var(--border); }
.composer .ctabs button { background: none; border: 0; padding: 8px 12px; font: inherit; font-weight: 600; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.composer .ctabs button.active { color: var(--brand); border-color: var(--brand); }
.composer.note-mode .ctabs button.active { color: #d97706; border-color: #d97706; }
.composer.note-mode textarea { background: #fffbeb; }
[data-theme="dark"] .composer.note-mode textarea { background: #2a210a; }
.composer textarea { border: 0; border-radius: 0; min-height: 150px; box-shadow: none !important; padding: 14px 16px; }
.composer .cbar { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; border-radius: 0 0 var(--radius) var(--radius); }
.composer .cbar select { width: auto; height: 34px; font-size: 13px; }
.file-label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text-2); font-weight: 550; font-size: 13px; padding: 6px 8px; border-radius: 7px; margin: 0; }
.file-label:hover { background: var(--surface); }
.file-label input { display: none; }
.file-names { font-size: 12px; color: var(--muted); }
.side-card .card-b { padding: 16px; }
.side-card .field { margin-bottom: 12px; }
.side-card select, .side-card input { height: 34px; font-size: 13px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 12px 18px; font-size: 12.5px; color: var(--text-2); }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.timeline li::after { content: ""; position: absolute; left: 6px; top: 15px; bottom: 0; width: 1px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.sla { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }
.sla.over { color: var(--bad); background: rgba(220,38,38,.08); border-color: rgba(220,38,38,.25); }
.sla .ic { width: 13px; height: 13px; }
.stars { display: inline-flex; gap: 2px; color: #f59e0b; font-size: 15px; letter-spacing: 1px; }

/* editor */
.editor { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.editor:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.editor .tb { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.editor .tb button { height: 28px; min-width: 30px; padding: 0 8px; border: 0; background: none; border-radius: 6px; cursor: pointer; font: inherit; font-weight: 650; color: var(--text-2); }
.editor .tb button:hover { background: var(--surface); color: var(--text); }
.editor .area { min-height: 260px; padding: 14px 16px; outline: none; }
.editor textarea.src { border: 0; border-radius: 0; min-height: 260px; font-family: var(--mono); font-size: 12.5px; }
.prose { line-height: 1.7; }
.prose img { max-width: 100%; border-radius: 8px; }
.prose h2 { font-size: 19px; margin-top: 1.4em; } .prose h3 { font-size: 16px; margin-top: 1.2em; }
.prose blockquote { margin: 0 0 1em; padding: 6px 16px; border-left: 3px solid var(--border); color: var(--text-2); }
.prose table { border-collapse: collapse; } .prose td, .prose th { border: 1px solid var(--border); padding: 6px 10px; }

/* api docs */
.endpoint { display: grid; grid-template-columns: 74px 1fr; gap: 4px 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.endpoint:last-child { border-bottom: 0; }
.method { font-family: var(--mono); font-size: 11.5px; font-weight: 700; padding: 3px 0; border-radius: 6px; text-align: center; color: #fff; height: fit-content; }
.method.GET { background: #0284c7; } .method.POST { background: #16a34a; } .method.PUT { background: #d97706; } .method.DELETE { background: #dc2626; }
.endpoint .path { font-family: var(--mono); font-size: 13px; font-weight: 600; }
.endpoint .params { grid-column: 2; font-size: 12.5px; color: var(--muted); }
.token-box { display: flex; gap: 8px; align-items: center; padding: 12px; border: 1px dashed var(--ok); border-radius: var(--radius-sm); background: #ecfdf3; font-family: var(--mono); word-break: break-all; }
[data-theme="dark"] .token-box { background: #0b2a1a; }

/* auth */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px;
  background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--brand) 22%, transparent), transparent), radial-gradient(900px 500px at 110% 110%, rgba(16,185,129,.14), transparent), var(--bg); }
.auth-card { width: 100%; max-width: 410px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 30px; }
.auth-card.wide { max-width: 620px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; font-weight: 700; }
.auth-brand small { font-weight: 500; color: var(--muted); }
.copyright { margin: 22px 0 0; font-size: 11px; color: var(--muted); text-align: center; line-height: 1.5; }

/* ============================================================ PORTAL */
.portal-nav { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.portal-nav .in { max-width: 1140px; margin: 0 auto; padding: 0 22px; height: 64px; display: flex; align-items: center; gap: 22px; }
.portal-nav .logo { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 16px; color: var(--text); text-decoration: none; }
.portal-nav .logo .mark { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; color: #fff; }
.portal-nav nav { display: flex; gap: 4px; }
.portal-nav nav a { padding: 7px 12px; border-radius: 8px; color: var(--text-2); font-weight: 550; text-decoration: none; }
.portal-nav nav a:hover, .portal-nav nav a.active { background: var(--surface-2); color: var(--text); }
.portal-nav .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.hero { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #0ea5e9)); color: #fff; padding: 64px 22px 84px; text-align: center; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 300px at 80% 0%, rgba(255,255,255,.18), transparent), radial-gradient(500px 260px at 0% 100%, rgba(255,255,255,.1), transparent); pointer-events: none; }
.hero h1 { font-size: 34px; font-weight: 800; letter-spacing: -.025em; margin-bottom: 8px; position: relative; }
.hero p { opacity: .88; font-size: 16px; position: relative; }
.hero form { max-width: 620px; margin: 22px auto 0; position: relative; z-index: 1; }
.hero input { height: 54px; border-radius: 14px; border: 0; padding: 0 20px 0 50px; font-size: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.hero form .ic { position: absolute; left: 18px; top: 18px; color: var(--muted); }
.wrap { max-width: 1140px; margin: 0 auto; padding: 30px 22px 50px; }
.wrap.narrow { max-width: 820px; }
.lift { margin-top: -50px; position: relative; z-index: 2; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.tile { padding: 20px; display: block; color: inherit; text-decoration: none !important; transition: transform .15s, box-shadow .15s, border-color .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 35%, var(--border)); }
.tile .ti { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); margin-bottom: 12px; }
.tile h3 { margin-bottom: 4px; }
.tile p { color: var(--muted); margin: 0; font-size: 13px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 34px 0 14px; }
.section-title h2 { margin: 0; font-size: 19px; }
.article-list a { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.article-list a:last-child { border-bottom: 0; }
.article-list a:hover { background: var(--surface-2); }
.article-list .ic { color: var(--brand); }
.portal-foot { border-top: 1px solid var(--border); background: var(--surface); }
.portal-foot .in { max-width: 1140px; margin: 0 auto; padding: 22px; display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.portal-foot img { height: 22px; opacity: .85; }
.cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; margin-top: 30px; flex-wrap: wrap; }
.vote { display: flex; gap: 8px; align-items: center; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.rating-form { display: flex; gap: 4px; flex-direction: row-reverse; justify-content: flex-end; }
.rating-form input { display: none; }
.rating-form label { font-size: 26px; color: var(--border); cursor: pointer; margin: 0; transition: color .1s; }
.rating-form input:checked ~ label, .rating-form label:hover, .rating-form label:hover ~ label { color: #f59e0b; }

@media (max-width: 1100px) { .ticket-layout, .dash-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  body.sb-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .content { padding: 18px; }
  .topbar { padding: 0 14px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .portal-nav nav { display: none; }
  .hero h1 { font-size: 26px; }
  .topbar .kbd { display: none; }
}
@media (min-width: 861px) { .sb-toggle { display: none !important; } }
