:root {
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-muted: #f7f9fc;
    --text: #232738;
    --muted: #7a859b;
    --line: #e8edf5;
    --primary: #4b5dad;
    --primary-2: #6a93eb;
    --primary-soft: #eef0ff;
    --green: #229a73;
    --green-soft: #e9f8f2;
    --red: #d66064;
    --red-soft: #fff0f0;
    --blue: #4d8bd8;
    --blue-soft: #edf6ff;
    --orange: #d98a42;
    --orange-soft: #fff4e8;
    --shadow: 0 12px 35px rgba(49, 63, 100, .07);
    --radius: 20px;
    --font: "Manrope", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
svg { flex: 0 0 auto; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 262px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px 20px; display: flex; flex-direction: column; background: rgba(255,255,255,.95); border-right: 1px solid var(--line); z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 20px; font-weight: 800; letter-spacing: -.6px; color: var(--text); }
.brand-mark { width: 34px; height: 34px; position: relative; display: inline-block; border-radius: 11px; background: linear-gradient(145deg, var(--primary), var(--primary-2)); box-shadow: 0 8px 16px rgba(75,93,173,.25); }
.brand-mark span { position: absolute; width: 5px; height: 15px; top: 9px; left: 10px; border-radius: 9px; background: white; transform: rotate(20deg); }
.brand-mark span:last-child { left: 19px; transform: rotate(-20deg); opacity: .85; }
.main-nav { margin-top: 44px; display: flex; flex-direction: column; gap: 7px; }
.nav-label { padding: 0 12px 8px; color: #a2abbd; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav-label-spaced { margin-top: 18px; }
.nav-link { position: relative; width: 100%; min-height: 48px; display: flex; align-items: center; gap: 13px; padding: 0 14px; color: #657089; border-radius: 13px; font-weight: 600; transition: .2s ease; }
.nav-link:hover { color: var(--primary); background: #f6f7fc; }
.nav-link.active { color: var(--primary); background: var(--primary-soft); }
.nav-link.active::before { content: ""; position: absolute; left: -20px; width: 4px; height: 24px; border-radius: 0 6px 6px 0; background: var(--primary); }
.sidebar-help { margin-top: auto; padding: 17px; border-radius: 16px; background: linear-gradient(145deg, #f3f4ff, #edf5ff); border: 1px solid #e1e6fb; }
.help-icon { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 10px; color: var(--primary); background: white; border-radius: 11px; box-shadow: 0 7px 15px rgba(75,93,173,.1); }
.sidebar-help strong { display: block; font-size: 13px; }
.sidebar-help p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.logout-form { margin-top: 10px; }
.nav-button { border: 0; background: transparent; cursor: pointer; }
.main-column { min-width: 0; }
.topbar { height: 82px; padding: 0 clamp(22px, 4vw, 52px); display: flex; align-items: center; gap: 16px; background: rgba(243,246,251,.88); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(227,233,243,.75); position: sticky; top: 0; z-index: 15; }
.top-search { flex: 0 1 440px; height: 44px; padding: 0 13px; display: flex; align-items: center; gap: 10px; color: #a0a9bb; background: white; border: 1px solid var(--line); border-radius: 13px; }
.top-search input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--text); background: transparent; }
.top-search input::placeholder { color: #a7afbf; }
.search-key { padding: 2px 7px; font-size: 10px; color: #99a3b5; border: 1px solid var(--line); border-radius: 6px; }
.demo-pill { margin-left: auto; padding: 6px 10px; color: var(--primary); background: var(--primary-soft); border-radius: 99px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.icon-button { position: relative; width: 42px; height: 42px; display: inline-grid; place-items: center; color: #6d7890; background: white; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: .2s ease; }
.icon-button:hover { color: var(--primary); border-color: #cbd4f1; transform: translateY(-1px); }
.icon-button.small { width: 34px; height: 34px; border-radius: 10px; }
.notification-dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: #ed6f70; border: 2px solid white; }
.user-chip { min-width: 190px; padding: 5px 8px 5px 5px; display: flex; align-items: center; gap: 10px; border-radius: 13px; transition: .2s; }
.user-chip:hover { background: white; }
.avatar, .profile-avatar { display: grid; place-items: center; color: white; background: linear-gradient(145deg, #7585ce, #4b5dad); font-weight: 800; }
.avatar { width: 37px; height: 37px; border-radius: 12px; }
.user-chip span:nth-child(2) { flex: 1; min-width: 0; }
.user-chip strong, .user-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip strong { font-size: 12px; }
.user-chip small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.mobile-menu { display: none; }
.sidebar-backdrop { display: none; }
.content { width: min(1500px, 100%); margin: 0 auto; padding: 38px clamp(22px, 4vw, 52px) 60px; }

.page-heading { margin-bottom: 30px; }
.page-heading h1 { margin: 4px 0 7px; font-size: clamp(28px, 3vw, 38px); line-height: 1.2; letter-spacing: -.045em; }
.page-heading p { margin: 0; color: var(--muted); font-size: 14px; }
.page-heading p strong { color: var(--text); font-weight: 700; }
.heading-with-action { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.compact-heading { align-items: center; }
.eyebrow { display: inline-block; color: var(--primary); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; }
.eyebrow-light { color: rgba(255,255,255,.66); }
.back-link { display: block; width: max-content; margin-bottom: 18px; color: var(--muted); font-size: 12px; font-weight: 700; }
.back-link:hover { color: var(--primary); }
.button { min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; font-size: 12px; font-weight: 800; cursor: pointer; transition: .2s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: linear-gradient(135deg, var(--primary), #6678ca); box-shadow: 0 10px 22px rgba(75,93,173,.22); }
.button-primary:hover { box-shadow: 0 13px 28px rgba(75,93,173,.28); }
.button-secondary { color: var(--primary); background: white; border-color: #dfe4f0; }
.button-secondary:hover { border-color: #bfc9ea; }
.button-block { width: 100%; }
.text-link { display: inline-flex; align-items: center; gap: 4px; color: var(--primary); font-size: 12px; font-weight: 800; }

.metric-grid { margin-bottom: 36px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric-card { min-height: 126px; padding: 22px; position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid rgba(229,234,243,.85); border-radius: var(--radius); box-shadow: 0 9px 28px rgba(49,63,100,.04); }
.metric-card-primary { color: white; background: linear-gradient(140deg, #4355a5 0%, #6577c9 100%); border-color: transparent; box-shadow: 0 14px 32px rgba(75,93,173,.23); }
.metric-icon { width: 46px; height: 46px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 14px; }
.metric-card-primary .metric-icon { color: white; background: rgba(255,255,255,.16); }
.metric-icon-blue { color: var(--blue); background: var(--blue-soft); }
.metric-icon-red { color: var(--red); background: var(--red-soft); }
.metric-icon-green { color: var(--green); background: var(--green-soft); }
.metric-card div:nth-child(2) { min-width: 0; display: grid; }
.metric-card span { color: var(--muted); font-size: 11px; font-weight: 600; }
.metric-card strong { margin: 1px 0; font-size: 27px; line-height: 1.15; letter-spacing: -.04em; }
.metric-card small { color: #a1a9b8; font-size: 9px; }
.metric-card-primary span, .metric-card-primary small { color: rgba(255,255,255,.72); }
.metric-date { font-size: 20px !important; }
.metric-decoration { position: absolute; width: 115px; height: 115px; right: -32px; bottom: -51px; border-radius: 50%; border: 20px solid rgba(255,255,255,.08); }

.section-block { margin-bottom: 36px; }
.section-heading, .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-heading { margin-bottom: 15px; }
.section-heading h2, .panel-heading h2 { margin: 2px 0 0; font-size: 19px; letter-spacing: -.025em; }
.group-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.group-card { min-height: 98px; padding: 18px; display: flex; align-items: center; gap: 13px; border-radius: 18px; border: 1px solid transparent; transition: .2s ease; }
.group-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.group-card > span:nth-child(2) { flex: 1; min-width: 0; }
.group-card strong, .group-card small { display: block; }
.group-card strong { font-size: 12px; line-height: 1.4; }
.group-card small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.group-symbol { width: 42px; height: 42px; display: grid; place-items: center; color: var(--primary); background: rgba(255,255,255,.72); border-radius: 13px; font-size: 20px; }
.group-purple { background: #f1efff; border-color: #e6e2ff; }
.group-blue { background: #edf6ff; border-color: #ddecfb; }
.group-green { background: #edf9f4; border-color: #daf2e7; }
.group-orange { background: #fff5ea; border-color: #f9e8d4; }

.panel { background: var(--surface); border: 1px solid rgba(228,234,244,.9); border-radius: var(--radius); box-shadow: 0 10px 32px rgba(49,63,100,.045); }
.content-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.attention-panel, .recent-panel { padding: 24px; }
.count-badge { min-width: 30px; height: 30px; padding: 0 9px; display: grid; place-items: center; color: var(--red); background: var(--red-soft); border-radius: 10px; font-size: 12px; font-weight: 800; }
.attention-list, .recent-list { margin-top: 18px; display: grid; gap: 9px; }
.attention-row { min-height: 62px; padding: 10px 14px 10px 10px; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; border-radius: 13px; }
.attention-high { background: #fff3f3; }
.attention-low { background: #f0f7ff; }
.trend-arrow { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; font-size: 17px; font-weight: 800; }
.attention-high .trend-arrow { color: var(--red); background: #ffe2e3; }
.attention-low .trend-arrow { color: var(--blue); background: #dceeff; }
.attention-row strong, .attention-row small { display: block; }
.attention-row strong { font-size: 12px; }
.attention-row small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.attention-value { text-align: right; }
.attention-value strong { font-size: 16px; }
.clinical-note { margin: 15px 0 0; padding: 11px 13px; color: #7d8799; background: #f8f9fc; border-radius: 11px; font-size: 9px; line-height: 1.55; }
.recent-row { min-height: 61px; display: grid; grid-template-columns: 39px 1fr auto; align-items: center; gap: 11px; padding: 8px; border-radius: 13px; transition: .2s; }
.recent-row:hover { background: var(--surface-muted); }
.recent-row strong, .recent-row small { display: block; }
.recent-row strong { font-size: 11px; }
.recent-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.file-icon { width: 38px; height: 42px; display: grid; place-items: center; color: var(--red); background: var(--red-soft); border-radius: 10px; font-size: 8px; font-weight: 800; }
.status { display: inline-flex; align-items: center; justify-content: center; width: max-content; padding: 5px 8px; border-radius: 99px; font-size: 8px; font-weight: 800; white-space: nowrap; }
.status-ready { color: #23815f; background: var(--green-soft); }
.status-queued { color: #a26826; background: var(--orange-soft); }
.status-processing { color: var(--primary); background: var(--primary-soft); }
.status-failed { color: var(--red); background: var(--red-soft); }

.flash { margin: 0 0 18px; padding: 13px 15px; display: flex; align-items: center; gap: 10px; border-radius: 13px; font-size: 12px; font-weight: 650; }
.flash button { margin-left: auto; border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 20px; }
.flash-success { color: #1d7958; background: #e8f8f1; border: 1px solid #cfeee1; }
.flash-warning { color: #976223; background: #fff5e7; border: 1px solid #f4e1c8; }
.flash-error { color: #a7474b; background: #fff0f0; border: 1px solid #f5d7d8; }

.upload-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 20px; align-items: start; }
.upload-card { padding: 24px; }
.upload-drop { min-height: 320px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; text-align: center; background: #f8f9fd; border: 1.5px dashed #cdd6ea; border-radius: 18px; transition: .2s; }
.upload-drop.dragover { background: var(--primary-soft); border-color: var(--primary); }
.upload-drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-drop > *:not(input) { pointer-events: none; }
.upload-drop .button { pointer-events: auto; }
.upload-illustration { width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 15px; color: var(--primary); background: white; border-radius: 20px; box-shadow: 0 12px 25px rgba(75,93,173,.12); }
.upload-drop h2 { margin: 0; font-size: 18px; }
.upload-drop p { margin: 5px 0 17px; color: var(--muted); font-size: 12px; }
.upload-formats { margin-top: 12px; color: #9aa4b6; font-size: 9px; }
.selected-file { margin-top: 12px; padding: 8px 12px; color: var(--primary); background: white; border-radius: 9px; font-size: 10px; font-weight: 700; }
.field { display: grid; gap: 7px; }
.field-spaced { margin-top: 22px; }
.field span { color: #4d5569; font-size: 11px; font-weight: 800; }
.field span small { color: #9ca5b5; font-weight: 500; }
.field input, .field select, .filter-bar select { width: 100%; height: 46px; padding: 0 13px; color: var(--text); background: #fff; border: 1px solid #dfe5ef; border-radius: 11px; outline: 0; transition: .2s; }
.field input:focus, .field select:focus, .filter-bar select:focus { border-color: #9eace2; box-shadow: 0 0 0 3px rgba(75,93,173,.09); }
.field input:disabled { color: #8d96a7; background: #f6f7fa; }
.field em { color: #9ca5b5; font-size: 9px; font-style: normal; }
.consent-row { margin: 18px 0; display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 10px; }
.consent-row input { margin-top: 3px; accent-color: var(--primary); }
.upload-aside { display: grid; gap: 14px; }
.guide-card { padding: 23px; }
.steps { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 21px; }
.steps li { display: grid; grid-template-columns: 31px 1fr; gap: 11px; position: relative; }
.steps li > span { width: 31px; height: 31px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 10px; font-size: 10px; font-weight: 800; }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 36px; height: 18px; border-left: 1px dashed #cbd4e5; }
.steps strong { font-size: 11px; }
.steps p { margin: 2px 0 0; color: var(--muted); font-size: 9px; }
.privacy-card { padding: 18px; display: flex; gap: 12px; color: #375f7d; background: #edf7ff; border: 1px solid #dceefa; border-radius: 17px; }
.privacy-card strong { display: block; font-size: 11px; }
.privacy-card p { margin: 4px 0 0; color: #718ca0; font-size: 9px; }
.supported-card { padding: 17px 19px; background: white; border: 1px solid var(--line); border-radius: 17px; }
.supported-card > span { color: var(--muted); font-size: 9px; }
.supported-card div { margin-top: 8px; display: flex; gap: 14px; flex-wrap: wrap; color: #64708a; font-size: 10px; }

.table-panel { overflow: hidden; }
.table-toolbar { min-height: 76px; padding: 16px 20px; display: flex; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.table-search { width: min(420px, 100%); height: 42px; padding: 0 12px; display: flex; align-items: center; gap: 9px; color: #9aa4b5; background: var(--surface-muted); border: 1px solid transparent; border-radius: 11px; }
.table-search:focus-within { border-color: #cad4ed; background: white; }
.table-search input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 11px; }
.toolbar-caption { margin-left: auto; color: var(--muted); font-size: 10px; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 13px 15px; color: #8a94a8; background: #fafbfc; border-bottom: 1px solid var(--line); text-align: left; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.data-table td { padding: 15px; border-bottom: 1px solid #eef1f6; color: #5d667a; font-size: 10px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcfe; }
.data-table td strong, .data-table td small { display: block; }
.data-table td strong { color: var(--text); font-size: 10px; }
.data-table td small { margin-top: 3px; color: #96a0b2; font-size: 8px; }
.analysis-title { min-width: 230px; display: flex; align-items: center; gap: 10px; }
.row-actions { display: flex; gap: 6px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; }
.empty-state { min-height: 330px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 35px; text-align: center; }
.empty-state > span:first-child { width: 58px; height: 58px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 18px; }
.empty-state h2 { margin: 14px 0 4px; font-size: 18px; }
.empty-state p { max-width: 420px; margin: 0 0 16px; color: var(--muted); font-size: 11px; }
.empty-state.compact { min-height: 130px; }
.empty-state.compact p { margin: 0; }

.details-grid { margin-bottom: 18px; display: grid; grid-template-columns: 1.4fr .6fr; gap: 18px; }
.info-panel { padding: 20px 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 19px 25px; }
.info-panel span, .info-panel strong { display: block; }
.info-panel span { margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.info-panel strong { font-size: 11px; }
.analysis-summary-card { padding: 20px; display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 11px; color: white; background: linear-gradient(140deg, #4355a5, #6b7dce); border-radius: var(--radius); box-shadow: 0 14px 30px rgba(75,93,173,.2); }
.summary-icon { width: 40px; height: 40px; display: grid; place-items: center; background: rgba(255,255,255,.15); border-radius: 12px; }
.analysis-summary-card strong { font-size: 12px; }
.analysis-summary-card p { margin: 3px 0 0; color: rgba(255,255,255,.7); font-size: 9px; }
.analysis-summary-card a { grid-column: 2; display: flex; align-items: center; gap: 3px; color: rgba(255,255,255,.9); font-size: 9px; font-weight: 800; }
.results-panel { padding-top: 21px; }
.results-panel > .panel-heading, .chart-data-table > .panel-heading { padding: 0 22px 18px; }
.legend { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; }
.legend-high { background: #f3b8ba; }
.legend-low { background: #afd2f6; }
.result-high { background: #fff8f8; }
.result-low { background: #f7fbff; }
.result-table td:nth-child(2) { color: var(--text); }
.result-number { font-size: 13px; font-weight: 800; }
.result-flag { padding: 5px 8px; border-radius: 8px; font-size: 8px; font-weight: 800; }
.result-flag.high { color: var(--red); background: #ffe8e8; }
.result-flag.low { color: var(--blue); background: #e6f2ff; }
.result-flag.normal { color: var(--green); background: var(--green-soft); }
.result-flag.unknown { color: var(--muted); background: #f0f2f6; }
.results-panel > .clinical-note { margin: 16px 20px 20px; }

.filter-bar { margin-bottom: 18px; padding: 16px; display: grid; grid-template-columns: 1.4fr .7fr .7fr auto; gap: 12px; align-items: end; }
.filter-bar label { display: grid; gap: 6px; }
.filter-bar label > span { color: var(--muted); font-size: 9px; font-weight: 700; }
.filter-bar select { height: 42px; font-size: 10px; }
.chart-kpis { margin-bottom: 16px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.chart-kpis article { padding: 16px 18px; background: white; border: 1px solid var(--line); border-radius: 15px; }
.chart-kpis span, .chart-kpis strong { display: block; }
.chart-kpis span { color: var(--muted); font-size: 9px; }
.chart-kpis strong { margin-top: 4px; font-size: 17px; }
.chart-panel { margin-bottom: 18px; padding: 23px; }
.chart-hint { color: var(--muted); font-size: 9px; }
.chart-wrap { height: 390px; margin-top: 20px; }
.chart-fallback { padding: 40px; text-align: center; color: var(--muted); }
.chart-data-table { padding-top: 21px; }

.profile-layout { display: grid; grid-template-columns: 290px minmax(0, 680px); gap: 18px; align-items: start; }
.profile-card { padding: 27px; text-align: center; }
.profile-avatar { width: 74px; height: 74px; margin: 0 auto 14px; border-radius: 24px; font-size: 25px; box-shadow: 0 12px 25px rgba(75,93,173,.2); }
.profile-card h2 { margin: 0; font-size: 18px; }
.profile-card > p { margin: 4px 0 12px; color: var(--muted); font-size: 10px; }
.profile-card dl { margin: 22px 0 0; display: grid; text-align: left; }
.profile-card dl div { padding: 12px 0; border-top: 1px solid var(--line); }
.profile-card dt { color: var(--muted); font-size: 9px; }
.profile-card dd { margin: 3px 0 0; font-size: 10px; font-weight: 700; }
.profile-form { padding: 25px; }
.form-grid { margin: 22px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.field-wide { grid-column: 1 / -1; }

.admin-metrics { margin-bottom: 18px; }
.admin-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 18px; align-items: start; }
.admin-grid .table-panel { padding-top: 21px; }
.admin-grid .table-panel > .panel-heading { padding: 0 21px 18px; }
.queue-panel { padding: 22px; }
.queue-list { margin-top: 13px; display: grid; gap: 7px; }
.queue-row { min-height: 57px; padding: 7px; display: grid; grid-template-columns: 37px minmax(0,1fr) auto auto; align-items: center; gap: 9px; border-radius: 12px; }
.queue-row:hover { background: var(--surface-muted); }
.queue-row strong, .queue-row small { display: block; }
.queue-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.queue-row small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.error-page { min-height: 450px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.error-page > span:first-child { width: 72px; height: 72px; display: grid; place-items: center; margin-bottom: 15px; color: var(--red); background: var(--red-soft); border-radius: 23px; }
.error-page h1 { margin: 4px 0; }
.error-page p { color: var(--muted); }

.auth-body { min-height: 100vh; background: white; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(450px, .95fr) minmax(480px, 1.05fr); }
.auth-visual { min-height: 100vh; padding: 48px clamp(38px, 6vw, 90px); position: relative; overflow: hidden; display: flex; flex-direction: column; color: white; background: radial-gradient(circle at 85% 15%, rgba(139,160,242,.55), transparent 34%), linear-gradient(145deg, #303f8f 0%, #5367bc 62%, #6f85d8 100%); }
.auth-visual::before, .auth-visual::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; }
.auth-visual::before { width: 440px; height: 440px; left: -210px; bottom: -180px; }
.auth-visual::after { width: 620px; height: 620px; left: -300px; bottom: -270px; }
.brand-light { position: relative; z-index: 2; color: white; }
.brand-light .brand-mark { background: rgba(255,255,255,.16); box-shadow: none; }
.auth-copy { max-width: 590px; margin: auto 0 26px; position: relative; z-index: 2; }
.auth-copy h1 { margin: 10px 0 17px; font-size: clamp(36px, 4.4vw, 61px); line-height: 1.06; letter-spacing: -.055em; }
.auth-copy p { max-width: 540px; margin: 0; color: rgba(255,255,255,.72); font-size: 14px; line-height: 1.7; }
.auth-preview-card { width: min(530px, 100%); padding: 20px 22px 14px; position: relative; z-index: 2; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.16); border-radius: 20px; backdrop-filter: blur(12px); }
.preview-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; }
.preview-head strong { font-size: 24px; }
.auth-preview-card svg { width: 100%; height: 100px; margin-top: 5px; }
.preview-foot { display: flex; justify-content: space-between; color: rgba(255,255,255,.55); font-size: 8px; }
.auth-note { margin-top: 26px; position: relative; z-index: 2; color: rgba(255,255,255,.56); font-size: 9px; }
.auth-form-wrap { min-height: 100vh; display: grid; place-items: center; padding: 40px; background: #fbfcfe; }
.auth-form-card { width: min(420px, 100%); }
.auth-form-card h2 { margin: 5px 0 4px; font-size: 30px; letter-spacing: -.04em; }
.muted { margin: 0; color: var(--muted); }
.form-stack { margin-top: 27px; display: grid; gap: 16px; }
.form-stack .button { margin-top: 3px; }
.auth-switch { margin: 21px 0 0; text-align: center; color: var(--muted); font-size: 10px; }
.auth-switch a { color: var(--primary); font-weight: 800; }
.demo-login { margin-top: 17px; padding: 14px; background: var(--primary-soft); border-radius: 13px; text-align: center; }
.demo-login > span { color: var(--muted); font-size: 9px; }
.demo-login > div { margin-top: 8px; display: flex; justify-content: center; gap: 8px; }
.demo-login form { margin: 0; }
.demo-login button { padding: 7px 10px; color: var(--primary); background: white; border: 1px solid #dce2f5; border-radius: 8px; font-size: 9px; font-weight: 800; cursor: pointer; }
.auth-flash { position: fixed; top: 18px; left: 50%; z-index: 30; transform: translateX(-50%); box-shadow: var(--shadow); }

@media (max-width: 1180px) {
    .metric-grid, .group-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-grid, .content-grid { grid-template-columns: 1fr; }
    .upload-layout { grid-template-columns: 1fr .55fr; }
    .top-search { max-width: 330px; }
    .user-chip { min-width: 0; }
    .user-chip > span:nth-child(2), .user-chip > svg { display: none; }
}

@media (max-width: 900px) {
    .app-shell { display: block; }
    .sidebar { position: fixed; left: 0; top: 0; width: 270px; transform: translateX(-101%); transition: transform .24s ease; box-shadow: 20px 0 50px rgba(36,44,72,.12); }
    .app-shell.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 19; background: rgba(26,31,50,.35); backdrop-filter: blur(2px); }
    .app-shell.sidebar-open .sidebar-backdrop { display: block; }
    .mobile-menu { display: inline-grid; }
    .top-search { flex: 1; }
    .content { padding-top: 28px; }
    .upload-layout, .details-grid, .profile-layout { grid-template-columns: 1fr; }
    .upload-aside { grid-template-columns: 1fr 1fr; }
    .guide-card { grid-row: span 2; }
    .profile-layout { max-width: 760px; }
    .profile-card { display: none; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-visual { min-height: 430px; padding: 32px; }
    .auth-copy { margin: auto 0 22px; }
    .auth-copy h1 { font-size: 40px; max-width: 660px; }
    .auth-preview-card { display: none; }
    .auth-note { margin-top: 20px; }
}

@media (max-width: 680px) {
    .topbar { height: 68px; padding: 0 15px; gap: 9px; }
    .top-search { display: none; }
    .demo-pill { margin-left: auto; }
    .content { padding: 24px 15px 42px; }
    .heading-with-action { align-items: flex-start; flex-direction: column; }
    .heading-with-action .button { width: 100%; }
    .page-heading h1 { font-size: 29px; }
    .metric-grid, .group-grid, .chart-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
    .metric-card { min-height: 112px; padding: 16px; }
    .metric-icon { width: 40px; height: 40px; }
    .metric-card strong { font-size: 22px; }
    .metric-card span { font-size: 9px; }
    .group-card { min-height: 90px; padding: 14px; }
    .dashboard-bottom { display: block; }
    .recent-panel { margin-top: 14px; }
    .attention-panel, .recent-panel { padding: 18px; }
    .attention-row { grid-template-columns: 32px 1fr; }
    .attention-value { grid-column: 2; text-align: left; }
    .attention-value strong, .attention-value small { display: inline; }
    .upload-card { padding: 14px; }
    .upload-drop { min-height: 285px; padding: 20px; }
    .upload-aside { grid-template-columns: 1fr; }
    .guide-card { grid-row: auto; }
    .filter-bar { grid-template-columns: 1fr 1fr; }
    .filter-bar label:first-child { grid-column: 1 / -1; }
    .filter-bar .button { grid-column: 1 / -1; }
    .chart-wrap { height: 320px; }
    .info-panel { grid-template-columns: 1fr 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
    .auth-visual { min-height: 360px; padding: 27px 23px; }
    .auth-copy h1 { font-size: 31px; }
    .auth-copy p { font-size: 12px; }
    .auth-note { display: none; }
    .auth-form-wrap { min-height: auto; padding: 48px 22px; }
}

@media (max-width: 430px) {
    .metric-grid, .group-grid, .chart-kpis { grid-template-columns: 1fr; }
    .metric-card { min-height: 100px; }
    .group-card { min-height: 80px; }
    .info-panel { grid-template-columns: 1fr; }
    .filter-bar { grid-template-columns: 1fr; }
    .filter-bar label:first-child, .filter-bar .button { grid-column: auto; }
    .auth-copy h1 { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
