/* BoxxSoft Support Hub. Utilitarian, compact, calm. Tokens first. */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --sidebar: #1f2a37;
  --sidebar-fg: #c9d2dc;
  --sidebar-fg-strong: #ffffff;
  --sidebar-hover: #2a3746;
  --sidebar-active: #33465a;
  --line: #e2e5ea;
  --line-strong: #cfd4db;
  --fg: #1d2530;
  --fg-2: #4d5866;
  --muted: #7a8593;
  --accent: #2f6fdf;
  --accent-fg: #ffffff;
  --focus: #2f6fdf;
  --row-hover: #f1f5fc;
  --row-sel: #e5eefc;
  --danger: #c93a32;
  --danger-bg: #fdecea;
  --warn: #a5650a;
  --warn-bg: #fff4e0;
  --ok: #26804f;
  --ok-bg: #e5f5ec;
  --note-bg: #fff8e6;
  --note-line: #ecd59a;
  --ai-bg: #f1edfd;
  --ai-line: #cfc3f3;
  --tv: #3b7ff0;
  --tv-bg: #e6effe;
  --pn: #23955a;
  --pn-bg: #e2f4ea;
  --shadow: 0 6px 24px rgba(20, 30, 45, .14);
  --radius: 6px;
  --row-h: 32px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12161c; --surface: #191e26; --surface-2: #1d232c; --sidebar: #0e1217; --sidebar-fg: #a9b4c0;
    --sidebar-hover: #1a212b; --sidebar-active: #243142; --line: #2a313c; --line-strong: #39424f;
    --fg: #e3e8ee; --fg-2: #b4bdc8; --muted: #8590a0; --accent: #5b93f5; --focus: #78a8ff;
    --row-hover: #1f2631; --row-sel: #233149; --danger: #f07167; --danger-bg: #3a1f1d; --warn: #e8b05a;
    --warn-bg: #3a2c15; --ok: #5cc98d; --ok-bg: #173226; --note-bg: #2b2616; --note-line: #574a22;
    --ai-bg: #231f36; --ai-line: #443a6e; --tv: #6ea1ff; --tv-bg: #1c2a45; --pn: #4fc888; --pn-bg: #17321f;
    --shadow: 0 8px 28px rgba(0, 0, 0, .5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12161c; --surface: #191e26; --surface-2: #1d232c; --sidebar: #0e1217; --sidebar-fg: #a9b4c0;
  --sidebar-hover: #1a212b; --sidebar-active: #243142; --line: #2a313c; --line-strong: #39424f;
  --fg: #e3e8ee; --fg-2: #b4bdc8; --muted: #8590a0; --accent: #5b93f5; --focus: #78a8ff;
  --row-hover: #1f2631; --row-sel: #233149; --danger: #f07167; --danger-bg: #3a1f1d; --warn: #e8b05a;
  --warn-bg: #3a2c15; --ok: #5cc98d; --ok-bg: #173226; --note-bg: #2b2616; --note-line: #574a22;
  --ai-bg: #231f36; --ai-line: #443a6e; --tv: #6ea1ff; --tv-bg: #1c2a45; --pn: #4fc888; --pn-bg: #17321f;
  --shadow: 0 8px 28px rgba(0, 0, 0, .5); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--fg); font: 13px/1.4 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-radius: 3px; }
svg { width: 16px; height: 16px; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--line-strong);
  background: var(--surface); border-radius: var(--radius); cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.small { height: 24px; padding: 0 8px; font-size: 12px; }
.btn.wide { width: 100%; justify-content: center; height: 34px; }
.btn:disabled { opacity: .55; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.icon-btn { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; background: none; border-radius: var(--radius); cursor: pointer; color: inherit; }
.icon-btn:hover { background: rgba(127, 140, 160, .16); }
select, input[type=search], input[type=email], input[type=password], textarea {
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--radius); }
select { height: 26px; padding: 0 6px; font-size: 12px; max-width: 160px; }

/* ---------- auth ---------- */
.auth { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 340px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px; box-shadow: var(--shadow); }
.auth-mark { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 18px; color: var(--fg-2); }
.auth-mark b { color: var(--fg); }
.mark-dot { width: 10px; height: 10px; border-radius: 3px; background: linear-gradient(135deg, var(--tv) 50%, var(--pn) 50%); }
.fld { display: block; margin-bottom: 10px; }
.fld span { display: block; font-size: 12px; color: var(--fg-2); margin-bottom: 3px; }
.fld input { width: 100%; height: 34px; padding: 0 9px; }
#si-reset { display: block; margin: 10px auto 0; font-size: 12px; }
.auth-msg { min-height: 18px; margin: 10px 0 0; font-size: 12px; color: var(--fg-2); text-align: center; }
.auth-msg.err { color: var(--danger); }
.denied { margin: 0 0 4px; color: var(--danger); }
.env-note { margin: 8px 0 0; font-size: 11px; color: var(--warn); text-align: center; }

/* ---------- shell ---------- */
.shell { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar { width: 216px; flex: none; background: var(--sidebar); color: var(--sidebar-fg); display: flex; flex-direction: column; transition: width .15s; z-index: 30; }
.sb-head { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 8px 0 14px; border-bottom: 1px solid rgba(255,255,255,.06); }
.sb-mark { display: flex; align-items: center; gap: 8px; color: var(--sidebar-fg-strong); font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; }
.sb-close { display: none; }
.sb-nav { flex: 1; overflow-y: auto; padding: 6px 6px 10px; }
.sb-group { margin-top: 4px; }
.sb-ghead { display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; padding: 0 8px; border: 0; background: none; color: var(--sidebar-fg-strong);
  border-radius: var(--radius); cursor: pointer; font-weight: 600; font-size: 12.5px; text-align: left; }
.sb-ghead:hover { background: var(--sidebar-hover); }
a.sb-ghead { text-decoration: none; }
a.sb-ghead[aria-current="page"] { background: var(--sidebar-active); }
.sb-ghead .chev { margin-left: auto; width: 12px; height: 12px; transition: transform .15s; opacity: .6; }
.sb-ghead[aria-expanded="true"] .chev { transform: rotate(90deg); }
.sb-items { list-style: none; margin: 0 0 4px; padding: 0; }
.sb-item { display: flex; align-items: center; gap: 8px; height: 27px; padding: 0 8px 0 32px; border-radius: var(--radius); color: var(--sidebar-fg);
  text-decoration: none; font-size: 12.5px; }
.sb-item:hover { background: var(--sidebar-hover); color: var(--sidebar-fg-strong); }
.sb-item[aria-current="page"] { background: var(--sidebar-active); color: var(--sidebar-fg-strong); }
.sb-item .cnt { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 11.5px; opacity: .85; }
.sb-item .cnt.hot { color: #ff8f86; opacity: 1; font-weight: 600; }
.sb-item .bdot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.sb-foot { border-top: 1px solid rgba(255,255,255,.06); padding: 8px 12px 10px; display: grid; gap: 6px; font-size: 12px; }
.tgl { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.tgl input { margin: 0; accent-color: var(--tv); }
.sb-row select { width: 100%; max-width: none; background: var(--sidebar-hover); border-color: rgba(255,255,255,.1); color: var(--sidebar-fg); }
.sb-user { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.sb-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sidebar-fg-strong); }
.sb-user .link { color: var(--sidebar-fg); }
.env-badge { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: #f2c46d; }

/* collapsed rail */
.shell.rail .sidebar { width: 52px; }
.shell.rail .sb-text, .shell.rail .sb-item .cnt, .shell.rail .sb-ghead .chev, .shell.rail .sb-items, .shell.rail .sb-user .link, .shell.rail .env-badge { display: none; }
.shell.rail .sb-head { padding: 0 6px; justify-content: center; }
.shell.rail .sb-mark { flex: 0; }
.shell.rail .sb-collapse svg { transform: rotate(180deg); }
.shell.rail .sb-ghead { justify-content: center; padding: 0; }
.shell.rail .sb-foot { padding: 8px 6px; justify-items: center; }
.shell.rail .tgl { justify-content: center; }

.scrim { position: fixed; inset: 0; background: rgba(10, 15, 22, .45); z-index: 25; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; background: var(--surface); border-bottom: 1px solid var(--line); flex: none; }
.topbar h1 { margin: 0; font-size: 14px; font-weight: 600; white-space: nowrap; }
.hamburger { display: none; }
.search { margin-left: auto; display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; width: min(340px, 50vw);
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface-2); color: var(--muted); }
.search:focus-within { outline: 2px solid var(--focus); outline-offset: 0; }
.search input { border: 0; background: none; outline: none; flex: 1; min-width: 0; height: 26px; color: var(--fg); font-size: 12.5px; }

/* ---------- queue ---------- */
.queue-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 6px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.summary { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--fg-2); }
.summary b { font-variant-numeric: tabular-nums; color: var(--fg); }
.summary .late b { color: var(--danger); }
.summary a { color: inherit; text-decoration: none; }
.summary a:hover { text-decoration: underline; }
.filters { display: flex; flex-wrap: wrap; gap: 5px; margin-left: auto; align-items: center; }
.table-wrap { flex: 1; min-height: 0; overflow: auto; background: var(--surface); }
table.q { width: 100%; border-collapse: collapse; table-layout: fixed; }
.q th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; font-weight: 600; font-size: 11.5px; color: var(--fg-2);
  height: 28px; padding: 0 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.q td { height: var(--row-h); padding: 0 8px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q tbody tr { cursor: pointer; }
.q tbody tr:hover { background: var(--row-hover); }
.q tbody tr.sel { background: var(--row-sel); box-shadow: inset 3px 0 0 var(--accent); }
.q tbody tr.attn td.c-no { box-shadow: inset 3px 0 0 var(--danger); }
.c-no { width: 76px; font-family: var(--mono); font-size: 12px; }
.c-brand { width: 104px; } .c-subj { width: auto; } .c-cust { width: 112px; } .c-cat { width: 92px; }
.c-pri { width: 74px; } .c-st { width: 140px; } .c-as { width: 96px; } .c-act { width: 136px; } .c-wait { width: 64px; text-align: right; }
.q th.c-wait { text-align: right; }
.c-menu { width: 34px; padding: 0 2px !important; text-align: center; }
.subj { cursor: pointer; color: var(--fg); text-decoration: none; font-weight: 500; }
.subj:hover, .subj:focus-visible { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.subj .clip { width: 12px; height: 12px; vertical-align: -1px; margin-left: 4px; color: var(--muted); }
td.c-cust, td.c-cat, td.c-as { color: var(--fg-2); }
td.c-act { color: var(--fg-2); font-size: 12px; }
td.c-act .who { color: var(--muted); }
td.c-wait { font-variant-numeric: tabular-nums; }
td.c-wait.late { color: var(--danger); font-weight: 600; }

.pill { display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 10px; font-size: 11.5px; font-weight: 500; line-height: 1; white-space: nowrap; }
.pill.b-mytvguide { background: var(--tv-bg); color: var(--tv); }
.pill.b-picturenamer { background: var(--pn-bg); color: var(--pn); }
.pill.s-new { background: var(--danger-bg); color: var(--danger); font-weight: 600; }
.pill.s-us { background: var(--warn-bg); color: var(--warn); }
.pill.s-open { background: var(--warn-bg); color: var(--warn); }
.pill.s-customer { background: var(--tv-bg); color: var(--fg-2); }
.pill.s-resolved { background: var(--ok-bg); color: var(--ok); }
.pill.s-closed { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pri { font-size: 12px; }
.pri-urgent { color: var(--danger); font-weight: 600; }
.pri-high { color: var(--warn); font-weight: 600; }
.pri-low { color: var(--muted); }
.q-empty { padding: 28px 14px; color: var(--muted); text-align: center; }
.f-toggle { display: none !important; }
.q-foot { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 8px; }

/* row menu + preview */
.rowmenu { position: fixed; z-index: 60; min-width: 190px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; }
.rowmenu h6 { margin: 4px 8px 2px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.rowmenu button { display: flex; width: 100%; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border: 0; background: none; border-radius: 4px; cursor: pointer; text-align: left; font-size: 12.5px; }
.rowmenu button:hover, .rowmenu button:focus-visible { background: var(--row-hover); outline: none; }
.rowmenu button[aria-checked="true"]::after { content: "✓"; margin-left: auto; color: var(--accent); }
.rowmenu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.preview { position: fixed; z-index: 55; width: min(380px, calc(100vw - 32px)); max-height: 240px; overflow: hidden; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 8px; box-shadow: var(--shadow); padding: 9px 11px; font-size: 12.5px; }
.preview .pv-h { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.preview .pv-b { white-space: pre-wrap; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.preview .btn { margin-top: 8px; }

/* ---------- detail panel ---------- */
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--surface); border-left: 1px solid var(--line-strong);
  box-shadow: var(--shadow); z-index: 40; display: flex; flex-direction: column; outline: none; }
.p-head { padding: 8px 12px 8px 14px; border-bottom: 1px solid var(--line); flex: none; }
.p-top { display: flex; align-items: center; gap: 8px; }
.p-top .lbl { font-family: var(--mono); font-size: 12px; color: var(--fg-2); }
.p-top .icon-btn { margin-left: auto; }
.p-subj { margin: 4px 0 6px; font-size: 15px; font-weight: 600; line-height: 1.3; }
.p-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--fg-2); }
.p-meta b { font-weight: 500; color: var(--fg); }
.p-ctl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 7px; }
.p-ctl label { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.p-body { flex: 1; overflow-y: auto; padding: 10px 14px 14px; }
.p-sec { margin-bottom: 14px; }
.p-sec h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.p-sec h3 .btn { margin-left: auto; text-transform: none; letter-spacing: 0; }
.msg { border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; margin-bottom: 6px; background: var(--surface); }
.msg.staff { background: var(--surface-2); margin-left: 28px; }
.msg.customer { margin-right: 28px; }
.msg .mh { display: flex; gap: 8px; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.msg .mh b { color: var(--fg-2); font-weight: 600; }
.msg .mb { white-space: pre-wrap; word-break: break-word; }
.note { border: 1px dashed var(--note-line); background: var(--note-bg); border-radius: 7px; padding: 7px 10px; margin-bottom: 6px; }
.note.ai { border: 1px solid var(--ai-line); background: var(--ai-bg); }
.note .mh { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; display: flex; gap: 8px; align-items: center; }
.note .mb { white-space: pre-wrap; word-break: break-word; }
.note .mb.clamped { max-height: 9.8em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.compose textarea { width: 100%; padding: 7px 9px; resize: vertical; line-height: 1.45; }
.compose .row { display: flex; align-items: center; gap: 8px; margin-top: 5px; flex-wrap: wrap; }
.compose .row .muted { margin-right: auto; }
.compose.notebox textarea { background: var(--note-bg); border-color: var(--note-line); }
.att { display: flex; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.att:last-child { border-bottom: 0; }
.att code { font-family: var(--mono); font-size: 11.5px; }
.ai-result { border: 1px solid var(--ai-line); background: var(--ai-bg); border-radius: 7px; padding: 7px 10px; margin-bottom: 8px; font-size: 12px; }
.err-line { color: var(--danger); font-size: 12px; margin: 4px 0; }
.cust dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 0; font-size: 12px; }
.cust dt { color: var(--muted); } .cust dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- pages: staff, settings (phase 3) ---------- */
.page { flex: 1; overflow-y: auto; padding: 14px 18px 28px; }
.page-head { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.page-head h2 { margin: 0; font-size: 15px; }
.page-head .btn { margin-left: auto; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 0 0 12px; max-width: 1100px; }
.card h3 { margin: 0 0 6px; font-size: 13px; }
.card h4 { margin: 10px 0 4px; font-size: 12px; color: var(--fg-2); }
.card p { margin: 0 0 8px; }
.card .row, .edit .row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.card .row .muted, .edit .row .muted { margin-right: auto; }
.frow { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-start; }
.fl { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--fg-2); }
.fl input[type=text], .fl input[type=email] { height: 28px; padding: 0 8px; width: 230px; max-width: 100%; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--radius); }
.fl select { height: 28px; max-width: none; }
fieldset.fl { border: 0; padding: 0; margin: 0; }
fieldset.fl legend { padding: 0; margin-bottom: 3px; }
fieldset.brands { flex-direction: row; flex-wrap: wrap; gap: 4px 12px; padding-top: 18px; position: relative; }
fieldset.brands legend { position: absolute; top: 0; }
.chk { display: inline-flex; align-items: center; gap: 5px; color: var(--fg); cursor: pointer; white-space: nowrap; }
.chk input { margin: 0; }
table.q.staff { table-layout: auto; }
.q.staff tbody tr { cursor: default; }
.q.staff td { max-width: 260px; }
.q.staff td.s-brands .pill { margin-right: 2px; }
.q.staff tr.off td { opacity: .6; }
.q.staff tr.edit-row td { white-space: normal; height: auto; padding: 10px 12px 12px; background: var(--surface-2); overflow: visible; max-width: none; }
.q.staff th.s-act, .q.staff td.s-act { width: 60px; text-align: right; }
table.grid { border-collapse: collapse; margin: 4px 0 6px; }
.grid th { font-size: 11.5px; font-weight: 600; color: var(--fg-2); text-align: center; padding: 4px 12px; border-bottom: 1px solid var(--line); }
.grid th:first-child { text-align: left; padding-left: 0; }
.grid td { padding: 5px 12px; text-align: center; border-bottom: 1px solid var(--line); }
.grid td:first-child { text-align: left; padding-left: 0; }
.kinds { margin: 6px 0 0; padding-left: 18px; }
.kinds li { margin: 2px 0; }
.foot-note { margin: 8px 0 0; }
.no-access { margin: 8px 0; padding: 12px; border: 1px solid var(--line); border-left: 3px solid var(--danger); background: var(--danger-bg); border-radius: var(--radius); line-height: 1.6; }
/* Read-only staff: no reply, note or Ask Claude (the server refuses them too). */
body.ro [data-reply], body.ro [data-notebox], body.ro [data-ask] { display: none !important; }
@media (max-width: 680px) {
  .page { padding: 10px 12px 24px; }
  .q.staff th.s-email, .q.staff td.s-email, .q.staff th.s-alerts, .q.staff td.s-alerts, .q.staff th.s-last, .q.staff td.s-last { display: none; }
  table.q.staff, .q.staff tbody { display: table-row-group; }
  .q.staff thead { display: table-header-group; }
  .q.staff tbody tr { display: table-row; padding: 0; }
  .q.staff td { display: table-cell; height: var(--row-h); padding: 0 6px; border-bottom: 1px solid var(--line); }
  .q.staff tr.edit-row td { display: table-cell; }
  .grid th, .grid td { padding: 4px 6px; }
}

/* ---------- placeholder ---------- */
.placeholder { flex: 1; padding: 28px 18px; color: var(--fg-2); background: var(--surface); }
.placeholder h2 { margin: 0 0 6px; font-size: 15px; color: var(--fg); }
.placeholder p { margin: 0 0 6px; max-width: 60ch; }

.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 70; background: var(--fg); color: var(--bg); padding: 7px 14px; border-radius: 6px; font-size: 12.5px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast.err { background: var(--danger); color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .c-cat { width: 84px; } .c-act { width: 118px; } .c-as { width: 84px; }
}
@media (max-width: 1100px) {
  .c-cat, td.c-cat { display: none; }
  .c-brand { width: 34px; }
  .c-brand .pill { width: 10px; height: 10px; padding: 0; font-size: 0; border-radius: 3px; }
  .pill.b-mytvguide.dotonly { background: var(--tv); } .pill.b-picturenamer.dotonly { background: var(--pn); }
  .act-who { display: none; }
  .q th.c-brand { font-size: 0; }
}
@media (max-width: 900px) {
  .shell:not(.drawer-open) .sidebar { width: 52px; }
  .shell:not(.drawer-open) .sb-text, .shell:not(.drawer-open) .sb-item .cnt, .shell:not(.drawer-open) .sb-ghead .chev,
  .shell:not(.drawer-open) .sb-items, .shell:not(.drawer-open) .sb-user .link, .shell:not(.drawer-open) .env-badge { display: none; }
  .shell:not(.drawer-open) .sb-ghead { justify-content: center; padding: 0; }
  .shell:not(.drawer-open) .sb-head { padding: 0 6px; justify-content: center; }
  .shell:not(.drawer-open) .sb-mark { flex: 0; }
  .shell:not(.drawer-open) .sb-foot { padding: 8px 6px; justify-items: center; }
  .sb-collapse { display: none; }
  .shell.drawer-open .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 248px; }
  .shell.drawer-open .sb-close { display: inline-grid; }
  .c-as, td.c-as, .c-cust, td.c-cust { display: none; }
  .c-act { width: 86px; }
  .toolbar .filters { margin-left: 0; }
}
@media (max-width: 680px) {
  .shell .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 248px; transform: translateX(-100%); transition: transform .18s; }
  .shell.drawer-open .sidebar { transform: none; }
  .shell:not(.drawer-open) .sidebar { width: 248px; }
  .shell:not(.drawer-open) .sb-text, .shell:not(.drawer-open) .sb-item .cnt, .shell:not(.drawer-open) .sb-ghead .chev,
  .shell:not(.drawer-open) .sb-items, .shell:not(.drawer-open) .sb-user .link { display: revert; }
  .hamburger { display: inline-grid; }
  .topbar { padding: 0 8px 0 6px; gap: 6px; }
  .search { width: auto; flex: 1; }
  .topbar h1 { display: none; }
  .toolbar { padding: 6px 10px; }
  .filters { display: none; width: 100%; }
  .filters.show { display: flex; }
  .filters select { max-width: none; flex: 1 1 30%; }
  .f-toggle { display: inline-flex !important; margin-left: auto; }
  /* phone table: two-line cards built from the same rows */
  table.q, .q tbody, .q tr, .q td { display: block; }
  .q thead { display: none; }
  .q tbody tr { display: grid; grid-template-columns: 86px 1fr auto auto; gap: 1px 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); align-items: center; }
  .q td { height: auto; border: 0; padding: 0; }
  .q td.c-no { grid-column: 1; grid-row: 1; width: auto; }
  .q td.c-subj { grid-column: 2 / 4; grid-row: 1; width: auto; }
  .q td.c-menu { grid-column: 4; grid-row: 1 / 3; width: 30px; }
  .q td.c-brand { grid-column: 1; grid-row: 2; width: auto; display: block; }
  .q td.c-st { grid-column: 2; grid-row: 2; width: auto; display: flex; gap: 6px; align-items: center; overflow: hidden; }
  .q td.c-wait { grid-column: 3; grid-row: 2; width: auto; font-size: 12px; }
  .q td.c-cust, .q td.c-cat, .q td.c-pri, .q td.c-as, .q td.c-act { display: none; }
  .q td.c-brand .pill { width: auto; height: 17px; padding: 0 6px; font-size: 11px; border-radius: 9px; }
  .q td.c-brand .pill.dotonly { background: var(--tv-bg); } .q td.c-brand .pill.b-picturenamer.dotonly { background: var(--pn-bg); }
  .q tbody tr.attn td.c-no { box-shadow: none; color: var(--danger); }
  .panel { width: 100vw; border-left: 0; }
  .msg.staff { margin-left: 12px; } .msg.customer { margin-right: 12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
