:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
  --bg: #080d0b;
  --bg-soft: #0c1411;
  --surface: #101c17;
  --surface-strong: #14241d;
  --surface-hover: #172a22;
  --line: #294137;
  --line-soft: #1d3028;
  --text: #edf6f0;
  --muted: #91a79b;
  --muted-strong: #b8c9bf;
  --accent: #79d4a5;
  --accent-strong: #9aebbe;
  --accent-deep: #2e9a67;
  --accent-soft: #102a1e;
  --ra-bg: #302719;
  --ra-line: #80643d;
  --ra-text: #efc37c;
  --ra-row-bg: #302719;
  --google-rating-bg: var(--surface);
  --google-rating-line: var(--line);
  --danger: #ff9c9c;
  --shadow: 0 18px 50px rgba(0, 0, 0, .24);
  --radius: 11px;
  line-height: 1.45;
  font-synthesis: none;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f8f5;
  --bg-soft: #eef5f0;
  --surface: #ffffff;
  --surface-strong: #eff8f2;
  --surface-hover: #e7f4ec;
  --line: #c9ddd0;
  --line-soft: #dcebe1;
  --text: #14251d;
  --muted: #667d70;
  --muted-strong: #3f5e4e;
  --accent: #2b9862;
  --accent-strong: #17633e;
  --accent-deep: #1f8050;
  --accent-soft: #e9f8ef;
  --ra-bg: #c7e4d0;
  --ra-line: #4e9b69;
  --ra-text: #1f6e43;
  --ra-row-bg: #c7e4d0;
  --google-rating-bg: #e9f8ef;
  --google-rating-line: #b8ddc5;
  --shadow: 0 18px 50px rgba(25, 76, 48, .10);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 48% -24%, rgba(54, 135, 94, .11), transparent 37%), var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; border: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; }
.auth-view { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 16px; padding: 28px 18px; }
.auth-brand img { width: 116px; display: block; }
.auth-card { width: min(440px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.auth-card h1 { margin: 0 0 10px; font-size: 2rem; line-height: 1.08; }
.eyebrow { margin: 0 0 7px; color: var(--accent); font-size: .68rem; letter-spacing: .14em; font-weight: 850; }
.muted { color: var(--muted); font-size: .78rem; }
.stack-form { display: grid; gap: 13px; margin-top: 20px; }
.stack-form label, .filter-grid label { display: grid; gap: 6px; color: var(--muted-strong); font-size: .76rem; font-weight: 700; }
input, select { width: 100%; min-height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--bg-soft); color: var(--text); outline: none; }
.password-field { position: relative; }
.password-field input { padding-right: 42px; }
.password-toggle { position: absolute; top: 50%; right: 4px; display: grid; width: 32px; height: 32px; place-items: center; transform: translateY(-50%); border-radius: 6px; background: transparent; color: var(--muted); }
.password-toggle:hover { background: var(--surface-hover); color: var(--accent); }
.password-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.eye-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.password-toggle .eye-off { display: none; }
.password-toggle.is-visible .eye { display: none; }
.password-toggle.is-visible .eye-off { display: block; }
select, select option, textarea { text-transform: uppercase; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(121, 212, 165, .12); }
.primary, .secondary { min-height: 38px; border-radius: 8px; padding: 9px 14px; font-weight: 800; transition: transform .16s ease, background .16s ease, border-color .16s ease; }
.primary { background: var(--accent-deep); color: #fff; }
.primary:hover { background: var(--accent); color: #082014; }
.secondary { border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.secondary:hover { border-color: var(--accent); }
.link-button { margin-top: 12px; padding: 8px 0; background: transparent; color: var(--accent); font-weight: 800; }
.feedback { min-height: 20px; margin: 13px 0 0; color: var(--muted); font-size: .82rem; }
.feedback.error { color: var(--danger); }
.feedback.success { color: var(--accent); }
.build-label, .staging-note { color: var(--muted); font-size: .68rem; text-align: center; }

.topbar { position: sticky; top: 0; z-index: 10; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px clamp(18px, 4vw, 58px); border-bottom: 1px solid var(--line-soft); background: rgba(8, 13, 11, .94); backdrop-filter: blur(14px); }
[data-theme="light"] .topbar { background: rgba(255, 255, 255, .94); }
.topbar-left, .top-actions, .brand-lockup, .session-state { display: flex; align-items: center; }
.topbar-left { min-width: 0; gap: 13px; }
.brand-lockup { min-width: 206px; gap: 10px; }
.brand-lockup img { width: 82px; height: 48px; object-fit: contain; }
.brand-lockup strong, .brand-lockup span { display: block; white-space: nowrap; }
.brand-lockup strong { font-size: .76rem; letter-spacing: .01em; }
.brand-lockup span { margin-top: 2px; color: var(--muted); font-size: .6rem; }
.session-state { gap: 5px; color: var(--muted); font-size: .65rem; white-space: nowrap; }
.session-state i, .migration-badge i { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #d3a84b; box-shadow: 0 0 0 3px rgba(211, 168, 75, .11); }
.top-actions { justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.top-action { min-height: 34px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted-strong); font-size: .66rem; font-weight: 750; text-decoration: none; transition: transform .16s ease, border-color .16s ease, color .16s ease, background .16s ease; }
.top-action:hover { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }
.user-name { max-width: 104px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .66rem; }
.theme-action { color: var(--text); }
.new-case-button { min-height: 40px; padding: 7px 14px; border-radius: 8px; background: var(--accent); color: #092015; font-size: .7rem; font-weight: 900; line-height: 1.1; }
.new-case-button b { margin-right: 4px; font-size: 1rem; }
.coming-soon { }

.dashboard-wrap { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 20px 0 42px; }
.view-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); }
.view-tab { position: relative; padding: 0 0 12px; background: transparent; color: var(--muted); font-size: .72rem; font-weight: 800; }
.view-tab.active { color: var(--text); }
.view-tab.active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; content: ""; background: var(--accent); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 25px 0 23px; }
.page-heading h1 { max-width: 600px; margin: 0 0 8px; font-size: clamp(1.62rem, 2.7vw, 2.1rem); line-height: 1.07; letter-spacing: -.02em; }
.page-heading .muted { margin: 0; font-size: .68rem; }
.heading-aside { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.rating-cards { display: grid; grid-template-columns: repeat(2, minmax(132px, 1fr)); gap: 8px; }
.rating-card { min-width: 132px; padding: 10px 11px 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 8px 22px rgba(0, 0, 0, .08); }
.rating-google { border-color: var(--google-rating-line); background: var(--google-rating-bg); }
.rating-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted-strong); font-size: .6rem; font-weight: 850; white-space: nowrap; }
.rating-source-mark { display: inline-flex; min-width: 19px; height: 19px; align-items: center; justify-content: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: .52rem; font-weight: 900; }
.rating-value { display: flex; align-items: baseline; gap: 3px; margin-top: 6px; }
.rating-value strong { padding: 1px 5px 2px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-strong); font-size: 1.28rem; line-height: 1; letter-spacing: -.02em; }
.rating-value small { color: var(--muted); font-size: .62rem; font-weight: 800; }
.rating-card p { max-width: 145px; min-height: 23px; margin: 6px 0 0; overflow: hidden; color: var(--muted); font-size: .54rem; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.rating-card p span { display: block; overflow: hidden; text-overflow: ellipsis; }
.rating-card .rating-date { margin-top: 2px; color: var(--muted-strong); font-size: .52rem; }
.rating-ra { border-color: var(--ra-line); background: var(--ra-bg); }
.rating-ra .rating-source-mark, .rating-ra .rating-value strong { background: color-mix(in srgb, var(--ra-text) 16%, transparent); color: var(--ra-text); }
.rating-ra .rating-card-head { color: var(--ra-text); }
.rating-ra .rating-value small, .rating-ra p { color: color-mix(in srgb, var(--ra-text) 72%, var(--muted)); }
.migration-badge { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid var(--ra-line); border-radius: 999px; color: var(--ra-text); background: var(--ra-bg); font-size: .61rem; font-weight: 850; white-space: nowrap; }
.migration-badge i { width: 5px; height: 5px; background: var(--ra-text); box-shadow: none; }

.stats-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 9px; margin-bottom: 15px; }
.stat-card { min-width: 0; min-height: 111px; padding: 17px 13px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--text); text-align: left; box-shadow: 0 8px 22px rgba(0, 0, 0, .08); transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.stat-card:hover { transform: translateY(-1px); border-color: var(--accent); background: var(--surface-hover); }
.stat-card.is-ra { border-color: var(--ra-line); background: var(--ra-bg); }
.stat-card.is-ra:hover { border-color: var(--ra-text); }
.stat-label { display: block; min-height: 25px; color: var(--muted-strong); font-size: .61rem; font-weight: 850; line-height: 1.15; }
.stat-value { display: block; margin: 10px 0 3px; color: var(--text); font-size: 29px; font-weight: 850; line-height: 1; letter-spacing: -.05em; }
.stat-meta { display: block; color: var(--muted); font-size: .59rem; line-height: 1.25; }
.stat-card.is-ra .stat-label, .stat-card.is-ra .stat-value { color: var(--ra-text); }
.stat-card.is-ra .stat-meta { color: color-mix(in srgb, var(--ra-text) 72%, var(--muted)); }

.queue-toolbar { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(150px, .9fr) minmax(160px, .95fr) auto; gap: 8px; align-items: center; margin: 0 0 12px; }
.search-box { position: relative; }
.search-box span { position: absolute; top: 7px; left: 11px; color: var(--muted); font-size: 1.1rem; line-height: 1; pointer-events: none; }
.search-box input { min-height: 35px; padding-left: 30px; border-color: var(--line); border-radius: 8px; background: var(--surface); font-size: .7rem; }
.queue-toolbar select { min-height: 35px; border-radius: 8px; background: var(--surface); font-size: .69rem; }
.clear-button { min-height: 35px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--text); font-size: .66rem; font-weight: 800; white-space: nowrap; }
.clear-button:hover { border-color: var(--accent); color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.queue-card { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 10px 30px rgba(0, 0, 0, .08); }
.queue-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 18px 18px 13px; }
.queue-head .eyebrow { margin-bottom: 4px; }
.queue-head h2 { margin: 0; font-size: 1.02rem; letter-spacing: -.01em; }
.queue-count { color: var(--muted); font-size: .63rem; white-space: nowrap; }
.table-scroll { max-height: 505px; overflow: auto; scrollbar-color: var(--accent-deep) var(--surface-strong); }
.case-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.case-table th { position: sticky; top: 0; z-index: 1; padding: 10px 17px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line); background: var(--surface-strong); color: var(--muted); font-size: .59rem; font-weight: 850; letter-spacing: .07em; text-align: left; }
.case-table th:nth-child(1) { width: 19%; }
.case-table th:nth-child(2) { width: 24%; }
.case-table th:nth-child(3) { width: 18%; }
.case-table th:nth-child(4) { width: 24%; }
.case-table th:nth-child(5) { width: 15%; }
.case-table td { padding: 12px 17px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.case-row-button { width: 100%; display: table-row; cursor: pointer; }
.case-row-button:hover td { background: var(--surface-hover); }
.case-row-button.ra td { background: color-mix(in srgb, var(--ra-row-bg) 88%, var(--surface)); }
.case-row-button.ra:hover td { background: var(--surface-hover); }
.case-row-button:not(.header) td, .detail-item strong, .history-line, .rating-card, .status-pill { text-transform: uppercase; }
.cell-protocol strong, .cell-client strong, .cell-category strong, .cell-complaint strong { display: block; overflow: hidden; color: var(--text); font-size: .68rem; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.cell-protocol strong { color: var(--accent); letter-spacing: .03em; }
.cell-protocol small, .cell-client small, .cell-category small, .cell-complaint small { display: block; overflow: hidden; margin-top: 3px; color: var(--muted); font-size: .58rem; text-overflow: ellipsis; white-space: nowrap; }
.cell-client strong { text-transform: uppercase; }
.cell-status { text-align: left; }
.status-pill { display: inline-flex; max-width: 100%; padding: 5px 8px; overflow: hidden; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .58rem; font-weight: 850; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.case-row-button.ra .status-pill { background: var(--ra-bg); color: var(--ra-text); }
.empty-state { padding: 34px 18px; color: var(--muted); font-size: .8rem; text-align: center; }
.staging-note { margin: 13px 0 0; }

.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 21px 22px 16px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 1.22rem; }
.dialog-close { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-strong); color: var(--text); font-size: 1.3rem; line-height: 1; }
.dialog-body { display: grid; gap: 16px; padding: 21px 22px 24px; }
.detail-section { padding-top: 13px; border-top: 1px solid var(--line); }
.detail-section:first-child { padding-top: 0; border-top: 0; }
.detail-section h3 { margin: 0 0 10px; color: var(--accent); font-size: .82rem; letter-spacing: .01em; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.detail-item { min-width: 0; padding: 11px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--surface-strong); }
.detail-item small { display: block; margin-bottom: 3px; color: var(--muted); font-size: .64rem; font-weight: 800; }
.detail-item strong { display: block; overflow-wrap: anywhere; font-size: .78rem; }
.detail-wide { grid-column: 1 / -1; }
.detail-history { padding-top: 13px; border-top: 1px solid var(--line); }
.detail-history h3 { margin: 0 0 10px; font-size: .86rem; }
.history-line { margin: 0 0 8px; padding: 0 0 9px 11px; border-left: 2px solid var(--accent); }
.history-line small { color: var(--muted); font-size: .64rem; }
.history-line p { margin: 3px 0 0; font-size: .76rem; }
.attachment-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.attachment-heading h3 { margin-bottom: 0; }
.attachment-heading > span { color: var(--muted); font-size: .66rem; }
.attachment-list { display: grid; gap: 7px; }
.attachment-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--surface-strong); }
.attachment-info { min-width: 0; }
.attachment-info strong { display: block; overflow: hidden; font-size: .74rem; text-overflow: ellipsis; white-space: nowrap; }
.attachment-info small { display: block; margin-top: 3px; color: var(--muted); font-size: .62rem; }
.attachment-open { flex: 0 0 auto; }
.attachment-empty { margin: 0; }
.attachment-note { margin: 8px 0 0; color: var(--muted); font-size: .64rem; line-height: 1.45; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 22px 18px; border-top: 1px solid var(--line); }
dialog { width: min(720px, calc(100% - 24px)); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.intake-dialog { width: min(900px, calc(100% - 24px)); max-height: min(920px, calc(100vh - 28px)); overflow: hidden; }
.intake-form { max-height: calc(100vh - 120px); overflow: auto; padding: 18px 22px 24px; }
.intake-notice { margin: 0 0 18px; padding: 10px 12px; border: 1px solid var(--ra-line); border-radius: 8px; background: var(--ra-bg); color: var(--ra-text); font-size: .72rem; }
.intake-section { padding: 17px 0; border-top: 1px solid var(--line-soft); }
.intake-section:first-of-type { border-top: 0; }
.intake-section-title { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.intake-section-title > span { display: inline-flex; width: 27px; height: 27px; align-items: center; justify-content: center; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: .65rem; font-weight: 900; }
.intake-section-title h3 { margin: 0; font-size: .9rem; }
.intake-section-title p { margin: 2px 0 0; color: var(--muted); font-size: .66rem; }
.intake-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.field { display: grid; gap: 6px; color: var(--muted-strong); font-size: .7rem; font-weight: 750; }
.field-span-2 { grid-column: 1 / -1; }
.field textarea { resize: vertical; min-height: 86px; }
.file-input { padding: 8px; border: 1px dashed var(--line); background: var(--surface-strong); font-size: .7rem; text-transform: none !important; }
.field-help { color: var(--muted); font-size: .62rem; font-weight: 500; line-height: 1.4; }
.intake-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 15px; border-top: 1px solid var(--line); }
.status-dialog { width: min(540px, calc(100% - 24px)); }
.status-form { display: grid; gap: 12px; padding: 18px 22px 22px; }
.status-form .muted { margin: 0; line-height: 1.5; }
.compact-grid { gap: 10px; }
.compact-grid .field { min-width: 0; }
.status-form select[multiple] { min-height: 110px; }
.reports-dialog { width: min(980px, calc(100% - 24px)); max-height: min(900px, calc(100vh - 24px)); overflow: hidden; }
.reports-form { display: grid; gap: 13px; max-height: min(510px, calc(100vh - 320px)); overflow: auto; padding: 18px 22px 16px; }
.reports-form > .muted { margin: 0; line-height: 1.5; }
.reports-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.reports-filters .field-span-2 { grid-column: span 2; }
.reports-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 13px; border-top: 1px solid var(--line); }
.report-results { padding: 16px 22px 22px; border-top: 1px solid var(--line); }
.report-results-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.report-results-head .eyebrow { margin-bottom: 3px; }
.report-results-head h3 { margin: 0; font-size: .98rem; }
.report-table-scroll { max-height: 300px; border: 1px solid var(--line-soft); border-radius: 8px; }
.report-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.report-table th { position: sticky; top: 0; z-index: 1; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface-strong); color: var(--muted); font-size: .58rem; font-weight: 850; letter-spacing: .06em; text-align: left; }
.report-table th:nth-child(1) { width: 42%; }
.report-table th:nth-child(2) { width: 19%; }
.report-table th:nth-child(3) { width: 19%; }
.report-table th:nth-child(4) { width: 20%; }
.report-table td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); color: var(--muted-strong); font-size: .7rem; }
.report-table td strong { color: var(--text); font-weight: 850; }
.report-table td:nth-child(2), .report-table td:nth-child(3) { color: var(--text); font-weight: 800; }
.report-bar { display: block; height: 7px; overflow: hidden; border-radius: 999px; background: var(--line-soft); }
.report-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.users-dialog { width: min(900px, calc(100% - 24px)); max-height: min(760px, calc(100vh - 24px)); overflow: hidden; }
.users-body { display: grid; gap: 13px; padding: 18px 22px 22px; }
.users-body > .muted { margin: 0; line-height: 1.5; }
.users-notice { padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--muted-strong); font-size: .72rem; line-height: 1.45; }
.users-notice strong { color: var(--text); }
.users-body .feedback { min-height: 1.1em; margin: 0; }
.users-table-scroll { max-height: 420px; border: 1px solid var(--line-soft); border-radius: 8px; }
.users-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.users-table th { position: sticky; top: 0; z-index: 1; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface-strong); color: var(--muted); font-size: .58rem; font-weight: 850; letter-spacing: .06em; text-align: left; }
.users-table th:nth-child(1) { width: 34%; }
.users-table th:nth-child(2) { width: 19%; }
.users-table th:nth-child(3) { width: 13%; }
.users-table th:nth-child(4) { width: 15%; }
.users-table th:nth-child(5) { width: 19%; }
.users-table td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); color: var(--muted-strong); font-size: .7rem; vertical-align: middle; }
.users-table td strong { display: block; color: var(--text); font-weight: 850; }
.users-table td small { display: block; margin-top: 3px; color: var(--muted); font-size: .62rem; overflow-wrap: anywhere; }
.user-state, .auth-state { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 999px; background: var(--line-soft); color: var(--muted-strong); font-size: .59rem; font-weight: 800; white-space: nowrap; }
.user-state::before, .auth-state::before { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); content: ''; }
.user-state.active { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent-strong); }
.user-state.active::before, .auth-state.linked::before { background: var(--accent); }
.auth-state.linked { color: var(--accent-strong); }
.user-role-select { width: 100%; min-width: 0; padding: 7px 8px; font-size: .68rem; }
.user-action { width: 100%; padding: 7px 8px; font-size: .64rem; }
.user-action:disabled { opacity: .55; cursor: not-allowed; }
dialog::backdrop { background: rgba(2, 6, 4, .72); backdrop-filter: blur(3px); }

.toast { position: fixed; right: 18px; bottom: 18px; z-index: 30; max-width: min(360px, calc(100% - 36px)); padding: 10px 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-strong); color: var(--text); font-size: .74rem; opacity: 0; pointer-events: none; transform: translateY(7px); transition: opacity .18s ease, transform .18s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
button:active { transform: scale(.97); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
@media (max-width: 1180px) { .topbar { align-items: flex-start; } .topbar-left { padding-top: 7px; } .session-state { display: none; } .top-actions { max-width: 690px; } }
@media (max-width: 920px) { .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .queue-toolbar { grid-template-columns: 1fr 1fr; } .search-box { grid-column: 1 / -1; } .clear-button { width: 100%; } .case-table { min-width: 790px; } .table-scroll { overflow-x: auto; } }
@media (max-width: 640px) { .topbar { display: block; padding: 10px 14px; } .topbar-left { justify-content: space-between; } .top-actions { justify-content: flex-start; max-width: none; margin-top: 9px; } .user-name { display: none; } .new-case-button { margin-left: auto; } .dashboard-wrap { width: min(100% - 24px, 1180px); padding-top: 14px; } .page-heading { display: block; padding-top: 20px; } .heading-aside { align-items: flex-start; margin-top: 16px; } .rating-cards { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); } .rating-card { min-width: 0; } .migration-badge { margin-top: 0; } .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; } .stat-card { min-height: 99px; padding: 13px 10px; } .stat-value { font-size: 24px; } .view-tabs { gap: 17px; overflow-x: auto; } .view-tab { flex: 0 0 auto; } .queue-toolbar { grid-template-columns: 1fr; } .search-box { grid-column: auto; } .detail-grid, .intake-grid, .reports-filters { grid-template-columns: 1fr; } .detail-wide, .field-span-2, .reports-filters .field-span-2 { grid-column: auto; } .intake-form { padding: 15px; } .intake-dialog, .reports-dialog { width: calc(100% - 14px); } .reports-form { max-height: none; } .reports-actions { flex-wrap: wrap; } .reports-actions button { flex: 1 1 30%; } }
