/* Blu-ray Technologies Support Desk */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/inter-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/inter-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/inter-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/inter-Bold.woff2') format('woff2'); }
:root {
  --brand: #0b3d91;
  --brand-600: #0a3478;
  --brand-50: #eef3fc;
  --brand-100: #dbe6f8;
  --ink: #16202e;
  --ink-2: #3b4757;
  --muted: #667085;
  --line: #e1e6ee;
  --line-2: #eef1f6;
  --bg: #f4f6fa;
  --card: #ffffff;
  --ok: #157f4a;
  --ok-bg: #e6f5ec;
  --warn: #9a5b00;
  --warn-bg: #fff4dd;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --info-bg: #e8f1fd;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); font-feature-settings: 'cv11', 'ss01'; -webkit-font-smoothing: antialiased; color: var(--ink); background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-600); }
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
code { font-family: var(--mono); font-size: .88em; background: var(--line-2); padding: .1em .35em; border-radius: 4px; word-break: break-all; }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .87rem; }
.opt { color: var(--muted); font-weight: 400; font-size: .85em; }
:focus-visible { outline: 3px solid rgba(11, 61, 145, .35); outline-offset: 2px; }

/* ---------- top bar ---------- */
.topbar { background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: .55rem 1rem; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: inherit; text-decoration: none; min-width: 0; }
.brand:hover { color: inherit; }
.brand img { flex: none; border-radius: 8px; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand strong { font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { font-size: .74rem; opacity: .78; letter-spacing: .02em; }
.nav { margin-left: auto; display: flex; align-items: center; gap: .15rem; }
.nav > a { color: #fff; text-decoration: none; padding: .45rem .7rem; border-radius: var(--radius-sm); opacity: .86; font-weight: 500; font-size: .94rem; }
.nav > a:hover { opacity: 1; background: rgba(255, 255, 255, .1); }
.nav > a.active { opacity: 1; background: rgba(255, 255, 255, .16); }
.nav > a.nav-cta { background: #fff; color: var(--brand); opacity: 1; margin-left: .4rem; font-weight: 600; }
.nav > a.nav-cta:hover { background: var(--brand-50); }
.nav-toggle { display: none; margin-left: auto; background: rgba(255, 255, 255, .14); color: #fff; border: 0; padding: .45rem .8rem; border-radius: var(--radius-sm); font: inherit; font-weight: 600; cursor: pointer; }
.usermenu { position: relative; margin-left: .4rem; }
.usermenu summary { list-style: none; cursor: pointer; display: flex; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu .avatar { background: rgba(255, 255, 255, .2); color: #fff; width: 34px; height: 34px; }
.usermenu-pop { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(16, 24, 40, .14); min-width: 230px; padding: .35rem; z-index: 30; }
.usermenu-who { padding: .55rem .7rem .6rem; border-bottom: 1px solid var(--line-2); margin-bottom: .3rem; display: flex; flex-direction: column; }
.usermenu-who span { color: var(--muted); font-size: .84rem; word-break: break-all; }
.usermenu-pop a, .usermenu-pop button { display: block; width: 100%; text-align: left; padding: .5rem .7rem; border-radius: 6px; color: var(--ink); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.usermenu-pop a:hover, .usermenu-pop button:hover { background: var(--line-2); }
.subnav { background: var(--brand-600); }
.subnav-inner { max-width: 1200px; margin: 0 auto; padding: 0 1rem; display: flex; gap: .2rem; overflow-x: auto; }
.subnav a { color: #fff; opacity: .8; text-decoration: none; padding: .55rem .8rem; font-size: .9rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.subnav a.active { opacity: 1; border-bottom-color: #fff; }

/* ---------- page ---------- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem 3rem; flex: 1; }
.footer { border-top: 1px solid var(--line); padding: 1.1rem 1rem; display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; justify-content: center; color: var(--muted); font-size: .86rem; background: #fff; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.page-head p { margin: .25rem 0 0; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: .7rem; }
.crumbs a { text-decoration: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.25rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .8rem; }
.card-head a { font-size: .88rem; text-decoration: none; }
.card-title { font-size: 1.02rem; font-weight: 650; margin-bottom: .85rem; }
.card-head .card-title { margin-bottom: 0; }
.card-title.spaced { margin-top: 1.4rem; }
.side-sub { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.2rem 0 .6rem; font-weight: 650; }
.narrow { max-width: 760px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.1rem; }

/* ---------- flash ---------- */
.flash { padding: .75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; border: 1px solid transparent; font-size: .95rem; }
.flash-success { background: var(--ok-bg); color: #0d5c35; border-color: #bfe5cf; }
.flash-error { background: var(--bad-bg); color: #8f1c13; border-color: #f6c8c3; }
.flash-info { background: var(--info-bg); color: #163f78; border-color: #c9dbf6; }
.flash .btn-link { padding: 0; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600; font-size: .94rem; padding: .58rem 1.05rem; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); color: #fff; }
.btn-secondary { background: #fff; color: var(--ink); border-color: #cfd6e1; }
.btn-secondary:hover { background: var(--line-2); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--brand-100); }
.btn-ghost:hover { background: var(--brand-50); }
.btn-link, button.btn-link { background: none; border: 0; color: var(--brand); font: inherit; font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; padding: .58rem .4rem; }
.btn-sm { padding: .35rem .7rem; font-size: .86rem; }
.btn-lg { padding: .75rem 1.35rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .6; cursor: not-allowed; }

/* ---------- forms ---------- */
.form .field { margin-bottom: 1rem; }
.field label { display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; color: var(--ink-2); }
.label-link { font-weight: 500; font-size: .85rem; margin-left: auto; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #cdd4df; border-radius: var(--radius-sm); padding: .58rem .7rem; min-height: 42px;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11, 61, 145, .15); }
input[disabled], input[readonly], select[disabled], textarea[readonly] { background: var(--line-2); color: var(--ink-2); }
input[type=file] { font: inherit; font-size: .9rem; max-width: 100%; }
.help { color: var(--muted); font-size: .84rem; margin: .3rem 0 0; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.field-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: .6rem; margin-top: .5rem; flex-wrap: wrap; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 35%); padding: 1rem 0 .4rem; }
.check { display: flex !important; align-items: center; gap: .5rem; font-weight: 500 !important; cursor: pointer; margin: .3rem 0 .8rem; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.input-with-btn { display: flex; gap: .5rem; }
.input-with-btn input { flex: 1; min-width: 0; font-family: var(--mono); font-size: .88rem; }
.input-sm { max-width: 90px; }
.test-email { max-width: 760px; }
.test-email .input-with-btn input { font-family: var(--font); font-size: .95rem; }

.file-preview { list-style: none; padding: 0; margin: .5rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.file-preview li { background: var(--brand-50); color: var(--brand); border-radius: 999px; padding: .2rem .7rem; font-size: .82rem; }
.file-preview li.too-big { background: var(--bad-bg); color: var(--bad); }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; padding: .9rem 1rem; }
.filters .field { margin: 0; min-width: 150px; }
.filters .field.grow { flex: 1 1 260px; }
.filter-actions { display: flex; gap: .3rem; align-items: center; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1.1rem; }
.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: .15rem; box-shadow: var(--shadow); }
a.stat:hover { border-color: var(--brand-100); background: #fbfcff; color: var(--ink); }
.stat-n { font-size: 1.55rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-l { color: var(--muted); font-size: .85rem; }
.stat-attn { border-color: #b8cdf0; background: var(--info-bg); }
.stat-hot { border-color: #f4c7b4; background: #fff4ef; }
.stat-hot .stat-n { color: #b4400f; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; padding: .55rem .6rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .7rem .6rem; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr:hover { background: #fafbfd; }
.row-off td { opacity: .6; }
.t-main a { text-decoration: none; color: var(--ink); font-weight: 600; }
.t-main a:hover { color: var(--brand); }
.t-num { font-family: var(--mono); font-size: .82rem; color: var(--brand); font-weight: 600; margin-right: .25rem; }
.t-sub { display: block; color: var(--muted); font-size: .83rem; margin-top: .1rem; }
.table-form td { vertical-align: middle; }
.empty { color: var(--muted); padding: 1.2rem 0; margin: 0; text-align: center; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; padding-top: 1rem; color: var(--muted); font-size: .9rem; }

/* ---------- badges ---------- */
.badge, .prio, .tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: .16rem .55rem; border-radius: 999px; white-space: nowrap; line-height: 1.4; }
.badge-new { background: #e0ebfd; color: #1849a9; }
.badge-assigned { background: #e8e6fc; color: #4a3aa8; }
.badge-in_progress { background: var(--warn-bg); color: var(--warn); }
.badge-waiting_customer { background: #f6e8fb; color: #7a2a91; }
.badge-solved { background: var(--ok-bg); color: var(--ok); }
.badge-closed { background: #edf0f4; color: #4a5565; }
.prio { background: transparent; padding-left: 0; font-weight: 500; color: var(--ink-2); }
.prio::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .35rem; background: #98a2b3; vertical-align: 1px; }
.prio-normal::before { background: #4f7fd1; }
.prio-high { color: #b4400f; }
.prio-high::before { background: #e8590c; }
.prio-urgent { color: var(--bad); font-weight: 700; }
.prio-urgent::before { background: var(--bad); box-shadow: 0 0 0 3px rgba(180, 35, 24, .18); }
.tag { background: var(--line-2); color: var(--ink-2); font-size: .74rem; padding: .1rem .5rem; }
.tag-note { background: #fff2cc; color: #7a5600; }
.tag-time { background: var(--brand-50); color: var(--brand); }

.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-100); color: var(--brand); font-size: .78rem; font-weight: 700; letter-spacing: .02em; }

/* ---------- ticket page ---------- */
.ticket-head { margin-bottom: 1.1rem; }
.t-num-lg { font-family: var(--mono); color: var(--brand); font-weight: 600; margin: 0 0 .2rem; font-size: .9rem; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: center; margin: .6rem 0 0; font-size: .9rem; }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1.2rem; align-items: start; }
.ticket-side { position: sticky; top: 80px; }
.thread { list-style: none; margin: 0 0 1.1rem; padding: 0; display: flex; flex-direction: column; gap: .8rem; }
.msg { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .95rem 1.1rem; box-shadow: var(--shadow); }
.msg-staff { border-left: 4px solid var(--brand); }
.msg-customer { border-left: 4px solid #c3cbd8; }
.msg-note { background: #fffbeb; border-color: #f3e2a6; border-left: 4px solid #e2b33c; }
.msg-head { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-bottom: .6rem; font-size: .92rem; }
.msg-head time { margin-left: auto; color: var(--muted); font-size: .83rem; }
.msg-body { overflow-wrap: anywhere; }
.msg-event { display: flex; justify-content: space-between; gap: 1rem; font-size: .83rem; color: var(--muted); padding: 0 .4rem 0 1.1rem; position: relative; }
.msg-event::before { content: ""; position: absolute; left: .2rem; top: .5rem; width: 7px; height: 7px; border-radius: 50%; background: #c3cbd8; }
.msg-event time { flex: none; }
.attachments { list-style: none; padding: .7rem 0 0; margin: .7rem 0 0; border-top: 1px dashed var(--line); display: flex; flex-wrap: wrap; gap: .6rem 1rem; font-size: .88rem; }
.attachments li { display: flex; flex-direction: column; gap: .2rem; max-width: 220px; }
.attachments .thumb img { display: block; width: 160px; height: 110px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--line-2); }
.reply-box { border-top: 3px solid var(--brand); }
.reply-row { display: flex; flex-wrap: wrap; gap: 0 1rem; align-items: flex-start; }
.reply-row .field { flex: 1 1 220px; }
.reply-row .small-field { flex: 0 1 200px; }
.reply-box.is-note { border-top-color: #e2b33c; background: #fffdf5; }
.segmented { display: inline-flex; background: var(--line-2); border-radius: var(--radius-sm); padding: 3px; margin-bottom: .8rem; }
.segmented label { margin: 0; padding: .4rem .85rem; border-radius: 5px; cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--ink-2); display: flex; gap: .4rem; align-items: center; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.segmented label:has(input:focus-visible) { outline: 3px solid rgba(11, 61, 145, .35); }
.kv { margin: 0; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: .55rem .8rem; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv-inline { font-size: .9rem; margin-bottom: .6rem; }
.card-callout { border-color: #b8dcc6; background: #f3fbf6; }
.callout-actions { display: flex; flex-wrap: wrap; gap: .7rem; align-items: flex-start; }
.reopen summary { list-style: none; }
.reopen summary::-webkit-details-marker { display: none; }
.reopen[open] { flex-basis: 100%; }
.reopen[open] summary { margin-bottom: .8rem; }
.inline-form { display: inline; }

/* ---------- dashboard ---------- */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { display: flex; gap: .8rem; padding: .65rem 0; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.activity li:last-child { border-bottom: 0; }
.activity li > div { flex: 1; min-width: 0; }
.activity a { text-decoration: none; color: var(--ink); }
.activity a strong { font-family: var(--mono); color: var(--brand); font-size: .85rem; }
.activity p { margin: .1rem 0 0; font-size: .88rem; overflow-wrap: anywhere; }
.activity time { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.act-dot { width: 9px; height: 9px; border-radius: 50%; background: #c3cbd8; margin-top: .45rem; flex: none; }
.act-reply { background: var(--brand); }
.act-note { background: #e2b33c; }

/* ---------- reports ---------- */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 170px; overflow-x: auto; padding-bottom: 1.6rem; }
.bar { flex: 1 0 22px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.bar-fill { width: 100%; max-width: 34px; background: var(--brand); border-radius: 4px 4px 0 0; opacity: .85; }
.bar:hover .bar-fill { opacity: 1; }
.bar-n { font-size: .74rem; color: var(--muted); margin-bottom: 2px; }
.bar-l { position: absolute; bottom: -1.45rem; font-size: .7rem; color: var(--muted); white-space: nowrap; }
.chips { list-style: none; padding: 0; margin: 0 0 .6rem; display: flex; flex-wrap: wrap; gap: .45rem; }
.chips li { background: var(--brand-50); color: var(--brand); padding: .3rem .8rem; border-radius: 999px; font-size: .9rem; font-weight: 500; }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: 1.15fr 1fr; gap: 2rem; align-items: center; margin: 1rem 0 1.6rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; color: var(--brand); margin-bottom: .6rem; }
.hero h1 { font-size: 2.15rem; line-height: 1.15; margin-bottom: .9rem; }
.lead { font-size: 1.07rem; color: var(--ink-2); max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.2rem; }
.steps { list-style: none; margin: 0; padding: 1.2rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 1rem; box-shadow: var(--shadow); }
.steps li { display: flex; gap: .9rem; align-items: flex-start; }
.steps li > span { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: .9rem; }
.steps strong { display: block; }
.steps li div { color: var(--ink-2); font-size: .93rem; }

/* ---------- plain pages (sign in, installer) ---------- */
body.plain { background: linear-gradient(180deg, var(--brand) 0, var(--brand) 220px, var(--bg) 220px); }
.plain-wrap { width: 100%; max-width: 560px; margin: 0 auto; padding: 2.2rem 1rem 3rem; }
.plain-wrap:has(.auth-card-wide) { max-width: 760px; }
.brand-plain { display: flex; align-items: center; gap: .9rem; color: #fff; text-decoration: none; margin-bottom: 1.4rem; }
.brand-plain:hover { color: #fff; }
.brand-plain img { height: 56px; width: auto; }
.brand-plain span { border-left: 1px solid rgba(255,255,255,.35); padding-left: .9rem; font-size: .9rem; opacity: .85; }
.auth-card { background: #fff; border-radius: 14px; padding: 1.8rem 1.6rem; box-shadow: 0 12px 40px rgba(16, 24, 40, .12); border: 1px solid var(--line); }
.auth-card h1 { font-size: 1.45rem; margin-bottom: .35rem; }
.auth-card > .muted { margin-bottom: 1.3rem; }
.auth-alt { text-align: center; margin: 1.2rem 0 0; font-size: .93rem; }
.checks { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .3rem; font-size: .92rem; }
.checks li span { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; margin-right: .3rem; }
.checks .ok span { background: var(--ok-bg); color: var(--ok); }
.checks .bad { color: var(--bad); }
.checks .bad span { background: var(--bad-bg); color: var(--bad); }
.empty-state { text-align: center; padding: 3rem 1.5rem; max-width: 560px; margin: 2rem auto; }
.error-code { font-family: var(--mono); color: var(--brand); font-weight: 700; font-size: 1.1rem; }
.empty-state h1 { margin-bottom: .6rem; }

/* ---------- small screens ---------- */
@media (max-width: 980px) {
  .ticket-layout { grid-template-columns: 1fr; }
  .ticket-side { position: static; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav:not(.nav-guest) { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--brand); flex-direction: column; align-items: stretch; padding: .4rem 1rem 1rem; gap: .1rem; box-shadow: 0 12px 24px rgba(0, 0, 0, .15); }
  .nav.open { display: flex; }
  .nav > a.nav-cta { margin: .4rem 0; text-align: center; }
  .usermenu { margin: .3rem 0 0; }
  .usermenu-pop { position: static; margin-top: .5rem; box-shadow: none; }
  .brand small { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  h1 { font-size: 1.35rem; }
  .hero h1 { font-size: 1.65rem; }
  .container { padding: 1rem .75rem 2.5rem; }
  .card { padding: 1rem; }
  .field-grid, .field-grid.three { grid-template-columns: 1fr; }
  .stats-3 { grid-template-columns: 1fr 1fr 1fr; }
  .stats-4 { grid-template-columns: 1fr 1fr; }
  .stat-n { font-size: 1.3rem; }
  .page-head > .btn { width: 100%; }
  .filters .field { flex: 1 1 140px; min-width: 0; }
  .filter-actions { width: 100%; }
  /* tables turn into cards */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: .7rem 0; border-bottom: 1px solid var(--line); }
  .table tr:last-child { border-bottom: 0; }
  .table td { border: 0; padding: .15rem 0; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  .table td::before { content: attr(data-label); color: var(--muted); font-size: .82rem; text-align: left; flex: none; }
  .table td.t-main { display: block; text-align: left; padding-bottom: .35rem; }
  .table td.t-main::before, .table td:not([data-label])::before { content: none; }
  .table td .t-sub { display: inline; margin-left: .3rem; }
  .table td.t-main .t-sub { display: block; margin: 0; }
  .table-form td { text-align: left; }
  .msg-head time { width: 100%; margin-left: 38px; margin-top: -.3rem; }
  .msg-event { flex-direction: column; gap: 0; }
  .kv { grid-template-columns: 90px minmax(0, 1fr); }
  .auth-card { padding: 1.4rem 1.1rem; }
  .input-with-btn { flex-direction: column; }
}
@media print {
  .topbar, .footer, .reply-box, .ticket-side form, .filters, .btn { display: none !important; }
  body { background: #fff; }
  .card, .msg { box-shadow: none; }
}

/* =================================================================
   Staff workspace: sidebar layout, KPI cards, charts
   ================================================================= */
body.shell { display: block; background: #f5f7fb; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 40;
  background: linear-gradient(180deg, #0a2f6e 0%, #0b3d91 55%, #0c4aa6 100%);
  color: #dbe6f8; display: flex; flex-direction: column; padding: 1.1rem .8rem .8rem;
}
.side-brand { display: block; padding: .3rem .55rem 1.3rem; }
.side-brand img { height: 44px; width: auto; display: block; }
.side-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.side-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: rgba(219, 230, 248, .55); margin: 1.1rem .7rem .4rem; font-weight: 600; }
.side-label:first-child { margin-top: 0; }
.side-nav a { display: flex; align-items: center; gap: .75rem; padding: .62rem .75rem; border-radius: 9px; color: #dbe6f8; text-decoration: none; font-weight: 500; font-size: .93rem; transition: background .15s, color .15s; }
.side-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side-nav a.active { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: inset 3px 0 0 #5cc2f2; }
.side-nav .ic { opacity: .9; flex: none; }
.side-badge { margin-left: auto; background: #5cc2f2; color: #062a5f; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: .05rem .5rem; }
.side-foot { display: flex; align-items: center; gap: .3rem; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: .8rem; margin-top: .6rem; }
.side-me { display: flex; align-items: center; gap: .65rem; flex: 1; min-width: 0; padding: .35rem .45rem; border-radius: 9px; color: #fff; text-decoration: none; }
.side-me:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.side-me .avatar { background: rgba(255, 255, 255, .18); color: #fff; width: 34px; height: 34px; }
.side-me span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.side-me strong { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-me small { font-size: .74rem; color: rgba(219, 230, 248, .7); }
.side-out { background: none; border: 0; color: rgba(219, 230, 248, .8); padding: .5rem; border-radius: 8px; cursor: pointer; display: flex; }
.side-out:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.side-scrim { display: none; }

.shell-main { margin-left: 248px; min-height: 100vh; display: flex; flex-direction: column; }
.shell-top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .8rem;
  padding: .7rem 1.6rem; background: rgba(245, 247, 251, .82); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid rgba(225, 230, 238, .7);
}
.shell-menu { display: none; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: .45rem; color: var(--ink); cursor: pointer; }
.shell-search { flex: 1; max-width: 520px; position: relative; display: flex; align-items: center; }
.shell-search .ic { position: absolute; left: .8rem; color: var(--muted); pointer-events: none; }
.shell-search input { padding-left: 2.3rem !important; background: #fff; border-color: var(--line) !important; border-radius: 10px !important; min-height: 40px !important; }
.shell-new { margin-left: auto; }
.container-shell { max-width: 1320px; padding: 1.6rem 1.6rem 3rem; margin: 0; width: 100%; }

.eyebrow-sm { font-size: .78rem; font-weight: 600; color: var(--muted); margin: 0 0 .2rem; letter-spacing: .01em; }
.head-actions { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; }
.btn .ic { flex: none; }
.btn-icon { padding: .5rem .8rem; font-size: 1.1rem; line-height: 1; }
.card-sub { color: var(--muted); font-size: .84rem; margin: .15rem 0 0; }
.card-head > div .card-title { margin-bottom: 0; }
body.shell .card { border-color: #e6eaf1; border-radius: 14px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .03); }

/* KPI cards */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpis-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi {
  position: relative; background: #fff; border: 1px solid #e6eaf1; border-radius: 14px; padding: 1.05rem 1.15rem 1rem;
  display: flex; flex-direction: column; gap: .2rem; text-decoration: none; color: var(--ink); overflow: hidden;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04); transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
a.kpi:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -12px rgba(11, 61, 145, .28); border-color: #cfdcf3; color: var(--ink); }
.kpi-ic { position: absolute; top: 1rem; right: 1rem; width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.ic-blue { background: #e8f0fe; color: #1f6feb; }
.ic-green { background: #e3f6ee; color: #0e9f6e; }
.ic-violet { background: #f0ebfe; color: #7c3aed; }
.ic-amber { background: #fff3dc; color: #c27803; }
.kpi-l { font-size: .84rem; color: var(--muted); font-weight: 500; padding-right: 2.6rem; }
.kpi-n { font-size: 1.95rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; font-variant-numeric: tabular-nums; margin-top: .15rem; }
.kpi-f { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-top: .25rem; }
.trend { display: inline-flex; align-items: center; gap: .15rem; font-weight: 600; font-size: .76rem; padding: .1rem .45rem; border-radius: 999px; font-variant-numeric: tabular-nums; }
.trend-good { background: #e3f6ee; color: #067647; }
.trend-bad { background: #fdecec; color: #b42318; }
.trend-flat { background: #eef1f6; color: #4a5565; }

.quick { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.1rem; }
.quick a { background: #fff; border: 1px solid #e6eaf1; border-radius: 999px; padding: .38rem .85rem; font-size: .86rem; color: var(--ink-2); text-decoration: none; transition: border-color .15s, background .15s; }
.quick a strong { color: var(--ink); font-variant-numeric: tabular-nums; margin-right: .15rem; }
.quick a:hover { border-color: #b9cbec; background: #f8fbff; }
.quick a.hot { border-color: #b8cdf0; background: #eaf2fe; }

.grid-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 0 1rem; align-items: start; }
.grid-main > .card, .grid-2 > .card { min-width: 0; }

/* Smooth line chart */
.chart { position: relative; padding-left: 34px; padding-bottom: 26px; }
.chart-plot { position: relative; height: var(--chart-h, 240px); }
.chart-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart-grid { stroke: #eceff5; stroke-width: 1; }
.chart-line { filter: drop-shadow(0 4px 6px rgba(31, 111, 235, .12)); }
.chart-y { position: absolute; left: 0; top: 0; width: 28px; height: var(--chart-h, 240px); }
.chart-y span { position: absolute; right: 0; transform: translateY(-50%); font-size: .72rem; color: #98a2b3; font-variant-numeric: tabular-nums; }
.chart-x { position: absolute; left: 34px; right: 0; bottom: 0; height: 18px; }
.chart-x span { position: absolute; transform: translateX(-50%); font-size: .72rem; color: #98a2b3; white-space: nowrap; }
.chart-x span:first-child { transform: none; }
.chart-x span:last-child:not(:first-child) { transform: translateX(-100%); }
.chart-hover { position: absolute; top: 0; bottom: 0; width: 1px; background: linear-gradient(#c7d4ea, rgba(199, 212, 234, 0)); pointer-events: none; }
.chart-hover i { position: absolute; left: -5px; width: 11px; height: 11px; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(16, 24, 40, .25); transform: translateY(-50%); }
.chart-tip {
  position: absolute; top: 4px; background: #0f1b2d; color: #fff; border-radius: 10px; padding: .55rem .7rem; font-size: .8rem;
  pointer-events: none; white-space: nowrap; box-shadow: 0 10px 30px -8px rgba(15, 27, 45, .45); z-index: 5; min-width: 120px;
}
.chart-tip strong { display: block; font-weight: 600; margin-bottom: .25rem; color: #c8d6ee; font-size: .75rem; }
.chart-tip div { display: flex; align-items: center; gap: .45rem; }
.chart-tip div b { margin-left: auto; padding-left: .8rem; font-variant-numeric: tabular-nums; }
.chart-tip i, .chart-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chart-legend { display: flex; gap: 1rem; font-size: .82rem; color: var(--ink-2); margin: -.2rem 0 .8rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.card-chart .card-head { margin-bottom: .4rem; }

/* Donut */
.donut { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.donut-svg { width: 100%; max-width: 190px; height: auto; }
.donut-track { stroke: #eef1f6; }
.donut-seg { transition: opacity .15s; }
.donut-svg:hover .donut-seg { opacity: .55; }
.donut-svg .donut-seg:hover { opacity: 1; }
.donut-num { font-size: 32px; font-weight: 700; fill: var(--ink); letter-spacing: -.02em; font-family: var(--font); }
.donut-lbl { font-size: 12px; fill: #98a2b3; font-family: var(--font); }
.donut-legend { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: .45rem; font-size: .87rem; }
.donut-legend li { display: flex; align-items: center; gap: .55rem; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.donut-legend span { flex: 1; color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend strong { font-variant-numeric: tabular-nums; }
.donut-legend em { font-style: normal; color: #98a2b3; width: 3rem; text-align: right; font-variant-numeric: tabular-nums; }

/* Bar list */
.barlist { list-style: none; padding: 0; margin: 0; display: grid; gap: .85rem; }
.barlist-top { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; margin-bottom: .35rem; }
.barlist-top span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barlist-top a { color: var(--ink); text-decoration: none; font-weight: 500; }
.barlist-top a:hover { color: var(--brand); }
.barlist-top em { font-style: normal; color: #98a2b3; font-size: .8rem; }
.barlist-top strong { font-variant-numeric: tabular-nums; }
.barlist-track { height: 8px; background: #eef2f8; border-radius: 999px; overflow: hidden; }
.barlist-track span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #1f6feb, #17a2dd); transform-origin: left; animation: grow .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Sparkline */
.spark { width: 110px; height: 28px; display: block; }
.spark-cell { width: 130px; }

/* Toolbars and filters */
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .75rem .9rem; }
.toolbar .field { margin: 0; }
.toolbar select, .toolbar input[type=month], .toolbar input[type=date] { width: auto !important; }
.month-bar { display: flex; flex-wrap: wrap; align-items: center; }
.month-nav { display: flex; gap: .4rem; align-items: center; }
.month-bar { padding: 0; margin: 0 0 1rem; background: none; border: 0; box-shadow: none; }
.month-bar-note { font-size: .88rem; margin-left: .4rem; }
.segmented.seg-wrap { flex-wrap: wrap; margin: 0; }
.segmented a { padding: .4rem .8rem; border-radius: 6px; font-size: .85rem; font-weight: 600; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.segmented a:hover { color: var(--ink); }
.segmented a.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.range-inputs { display: flex; align-items: center; gap: .4rem; }
.report-filters select { max-width: 240px; }

/* Organizations */
.org-dot, .org-avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; background: linear-gradient(135deg, #e8f0fe, #dcecfb); color: #0b3d91; font-weight: 700; flex: none; }
.org-dot { width: 30px; height: 30px; font-size: .72rem; margin-right: .6rem; vertical-align: middle; }
.table-orgs .t-main a { display: inline-flex; align-items: center; }
.big-num { font-size: 1.05rem; font-weight: 700; }
.org-hero { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.org-id { display: flex; gap: 1rem; align-items: center; min-width: 0; }
.org-avatar { width: 56px; height: 56px; border-radius: 14px; font-size: 1.15rem; }
.org-id h1 { font-size: 1.45rem; }
.org-contact { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; margin: .35rem 0 0; font-size: .88rem; }
.org-contact a { display: inline-flex; align-items: center; gap: .35rem; text-decoration: none; }
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--line-2); }
.people li:last-child { border-bottom: 0; }
.people li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.people li > div a { text-decoration: none; color: var(--ink); }
.people li > div > span { color: var(--muted); font-size: .83rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people li > div .tag { align-self: flex-start; margin-top: .25rem; }
.people b { font-variant-numeric: tabular-nums; background: #eef2f8; border-radius: 8px; padding: .15rem .55rem; font-size: .85rem; }
.choice-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1rem .2rem; margin-bottom: 1rem; }
.choice-box .check { align-items: flex-start; }
.choice-box .check input { margin-top: .2rem; }
.avatar-sm { width: 24px; height: 24px; font-size: .64rem; vertical-align: middle; margin-right: .3rem; }

/* Organization x month heat table */
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.matrix td:first-child a { color: var(--ink); text-decoration: none; font-weight: 500; }
.matrix td:first-child a:hover { color: var(--brand); }
.heat { display: inline-flex; min-width: 38px; justify-content: center; padding: .28rem .45rem; border-radius: 7px; font-weight: 600; font-variant-numeric: tabular-nums; text-decoration: none; color: var(--ink); }
.heat-0 { color: #c3cbd8; font-weight: 400; }
.heat-1 { background: #eaf2fe; color: #1849a9; }
.heat-2 { background: #c9dcfb; color: #123f8f; }
.heat-3 { background: #8fb6f5; color: #0b2f6e; }
.heat-4 { background: #1f6feb; color: #fff; }
a.heat:hover { outline: 2px solid #1f6feb; outline-offset: 1px; }

/* Responsive workspace */
@media (max-width: 1180px) {
  .kpis-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 1020px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 0 40px rgba(0, 0, 0, .25); }
  body.side-open .sidebar { transform: none; }
  body.side-open .side-scrim { display: block; position: fixed; inset: 0; background: rgba(15, 27, 45, .45); z-index: 35; }
  .shell-main { margin-left: 0; }
  .shell-menu { display: inline-flex; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .shell-top { padding: .6rem .75rem; gap: .5rem; }
  .shell-new span { display: none; }
  .shell-new { padding: .55rem .7rem; }
  .container-shell { padding: 1rem .75rem 2.5rem; }
  .kpis, .kpis-5 { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .kpi { padding: .85rem .9rem; }
  .kpi-ic { display: none; }
  .kpi-l { padding-right: 0; font-size: .8rem; }
  .kpi-n { font-size: 1.5rem; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .chart { padding-left: 26px; }
  .chart-y { width: 22px; }
  .chart-x { left: 26px; }
  .toolbar { padding: .7rem; }
  .toolbar > * { flex: 1 1 auto; }
  .month-bar > .btn-icon { flex: 0 0 auto; }
  .month-bar-note { flex-basis: 100%; margin: .2rem 0 0; }
  .range-inputs input { flex: 1; min-width: 0; }
  .report-filters select { max-width: none; }
  .org-avatar { width: 46px; height: 46px; }
  .spark-cell { width: auto; }
  .spark { margin-left: auto; }
  .matrix td { text-align: right; }
  .matrix td:first-child { text-align: left; font-weight: 600; }
}
@media print {
  .sidebar, .shell-top, .toolbar, .head-actions, .quick { display: none !important; }
  .shell-main { margin: 0; }
  .kpi, .card { break-inside: avoid; }
}
