:root {
  --navy-950: #102238;
  --navy-900: #182c47;
  --navy-800: #213b5e;
  --navy-100: #e8eef5;
  --ink: #162235;
  --muted: #647184;
  --line: #dce3eb;
  --surface: #ffffff;
  --canvas: #f4f7fa;
  --teal: #0f837b;
  --teal-dark: #0b6963;
  --teal-soft: #e3f4f1;
  --blue: #3169a8;
  --blue-soft: #e9f1fb;
  --amber: #a56208;
  --amber-soft: #fff3dc;
  --red: #ad3535;
  --red-soft: #fdeaea;
  --shadow: 0 12px 35px rgba(18, 40, 68, .08);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--canvas); line-height: 1.45; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(49, 105, 168, .25); outline-offset: 2px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.prototype-bar { height: 30px; display: flex; justify-content: center; align-items: center; gap: 8px; background: #0c1725; color: #dbe6f3; font-size: .78rem; font-weight: 700; letter-spacing: .03em; }
.prototype-bar span { color: #8fa4bc; font-weight: 500; }
.app-shell { min-height: calc(100vh - 30px); display: grid; grid-template-columns: 250px minmax(0, 1fr); }

.sidebar { position: sticky; top: 0; height: calc(100vh - 30px); z-index: 30; display: flex; flex-direction: column; padding: 22px 14px; background: var(--navy-950); color: #dbe5f1; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 23px; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 10px; background: var(--teal); color: white; font-weight: 800; letter-spacing: -.04em; }
.brand strong, .brand span { display: block; }
.brand strong { color: white; font-size: .98rem; }
.brand span { color: #91a6bd; font-size: .78rem; }
.sidebar nav { display: grid; gap: 4px; }
.nav-label { margin: 19px 12px 7px; color: #7087a0; font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.nav-item { display: grid; grid-template-columns: 23px 1fr auto; align-items: center; gap: 10px; width: 100%; border: 0; border-radius: 9px; padding: 10px 12px; background: transparent; color: #aebed0; text-align: left; font-size: .9rem; }
.nav-item:hover { background: rgba(255,255,255,.06); color: white; }
.nav-item.active { background: #24415f; color: white; box-shadow: inset 3px 0 0 #22a89e; }
.nav-item svg { width: 18px; height: 18px; }
.nav-count { min-width: 23px; padding: 2px 7px; border-radius: 99px; background: #d98b2b; color: #fff; text-align: center; font-size: .72rem; font-weight: 800; }
.sidebar-status { margin-top: auto; padding: 14px; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; background: rgba(255,255,255,.035); }
.sidebar-status strong { font-size: .78rem; color: white; }
.sidebar-status > span { display: block; margin: 5px 0 0 15px; color: #8398b0; font-size: .7rem; }
.status-line { display: flex; align-items: center; gap: 7px; }
.status-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #34c59d; box-shadow: 0 0 0 4px rgba(52,197,157,.12); }
.sidebar-close { display: none; position: absolute; top: 18px; right: 12px; color: white; }

.main-shell { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; height: 70px; display: flex; align-items: center; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(10px); }
.search, .inline-search { position: relative; display: flex; align-items: center; }
.search { width: min(440px, 44vw); }
.search svg, .inline-search svg { position: absolute; left: 13px; width: 17px; color: #8090a3; }
.search input, .inline-search input { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: #f8fafc; padding: 10px 12px 10px 40px; color: var(--ink); }
.search input { border-color: transparent; background: transparent; }
.top-actions { position: relative; display: flex; align-items: center; gap: 12px; margin-left: auto; }
.icon-button, .row-action { display: grid; place-items: center; border: 0; background: transparent; color: #596a7e; }
.icon-button { width: 40px; height: 40px; border-radius: 9px; }
.icon-button:hover, .row-action:hover { background: #edf2f6; color: var(--ink); }
.notification-button { position: relative; }
.notification-button span { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border: 2px solid white; border-radius: 50%; background: #e25858; }
.profile-button { display: flex; align-items: center; gap: 9px; border: 0; background: transparent; padding: 5px 7px; border-radius: 9px; color: var(--ink); text-align: left; }
.profile-button:hover { background: #f1f4f7; }
.avatar, .person-avatar { display: grid; place-items: center; flex: none; border-radius: 50%; font-weight: 800; }
.avatar { width: 38px; height: 38px; background: #dce9f8; color: #275c98; font-size: .75rem; }
.profile-copy strong, .profile-copy small { display: block; }
.profile-copy strong { font-size: .84rem; }
.profile-copy small { color: var(--muted); font-size: .72rem; }
.chevron { color: #8492a2; }
.profile-menu { position: absolute; top: 52px; right: 0; display: none; width: 170px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow); }
.profile-menu.open { display: grid; }
.profile-menu button { border: 0; border-radius: 7px; background: transparent; padding: 9px 10px; color: var(--ink); text-align: left; font-size: .85rem; }
.profile-menu button:hover { background: #f1f4f7; }
.menu-button { display: none; margin-right: 8px; }

main { min-width: 0; max-width: 1480px; margin: 0 auto; padding: 29px 32px 60px; overflow-x: hidden; }
.screen { display: none; animation: fade-in .2s ease; }
.screen.active { display: block; }
@keyframes fade-in { from { opacity: .25; transform: translateY(3px); } }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 23px; }
.page-header h1 { margin: 1px 0 4px; font-size: clamp(1.65rem, 2.3vw, 2.15rem); line-height: 1.12; letter-spacing: -.035em; }
.page-header p { margin: 0; color: var(--muted); }
.eyebrow { color: var(--teal) !important; font-size: .71rem !important; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
h2 { margin: 0; font-size: 1.03rem; letter-spacing: -.015em; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 3px 14px rgba(18,40,68,.035); }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: .82rem; }
.primary-button, .secondary-button, .text-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 8px; font-weight: 750; font-size: .86rem; }
.primary-button { border: 1px solid var(--teal); background: var(--teal); color: white; padding: 10px 15px; box-shadow: 0 4px 10px rgba(15,131,123,.16); }
.primary-button:hover { background: var(--teal-dark); }
.primary-button svg { width: 17px; height: 17px; }
.secondary-button { border: 1px solid #cfd8e3; background: white; color: #33445a; padding: 9px 14px; }
.secondary-button:hover { background: #f5f8fa; }
.secondary-button.compact { padding: 7px 10px; font-size: .78rem; }
.text-button { border: 0; background: transparent; color: var(--teal-dark); padding: 4px 0; }
.full { width: 100%; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.metric-card { display: flex; align-items: center; gap: 14px; min-height: 112px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.metric-icon { width: 45px; height: 45px; display: grid; place-items: center; flex: none; border-radius: 12px; }
.metric-icon.blue { background: var(--blue-soft); color: var(--blue); }
.metric-icon.amber { background: var(--amber-soft); color: var(--amber); }
.metric-icon.teal { background: var(--teal-soft); color: var(--teal); }
.metric-icon.red { background: var(--red-soft); color: var(--red); }
.metric-card span, .metric-card strong, .metric-card small { display: block; }
.metric-card span { color: var(--muted); font-size: .77rem; font-weight: 700; }
.metric-card strong { margin: 1px 0; font-size: 1.65rem; line-height: 1.1; }
.metric-card small { color: #8190a0; font-size: .72rem; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(330px, .8fr); gap: 16px; min-width: 0; margin-bottom: 16px; }
.dashboard-grid > *, .content-grid > *, .review-layout > * { min-width: 0; }
.workflow-panel, .attention-panel, .recent-panel { padding: 20px; }
.pill { display: inline-flex; align-items: center; width: max-content; padding: 4px 9px; border-radius: 99px; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.pill.success { background: var(--teal-soft); color: var(--teal-dark); }
.pill.warning { background: var(--amber-soft); color: var(--amber); }
.pill.danger { background: var(--red-soft); color: var(--red); }
.pill.processing { background: var(--blue-soft); color: var(--blue); }
.pill.neutral { background: #edf0f4; color: #617083; }
.workflow-track { display: grid; grid-template-columns: auto 1fr auto 1fr auto 1fr auto; align-items: start; margin: 31px 4px 25px; }
.flow-step { text-align: center; color: #8b97a6; }
.flow-step span { width: 31px; height: 31px; display: grid; place-items: center; margin: 0 auto 7px; border: 2px solid #d6dde5; border-radius: 50%; background: white; font-size: .75rem; font-weight: 800; }
.flow-step strong, .flow-step small { display: block; white-space: nowrap; }
.flow-step strong { color: #516074; font-size: .74rem; }
.flow-step small { margin-top: 2px; font-size: .65rem; }
.flow-step.complete span { border-color: var(--teal); background: var(--teal); color: white; }
.flow-step.complete strong, .flow-step.active strong { color: var(--ink); }
.flow-step.active span { border-color: var(--blue); color: var(--blue); box-shadow: 0 0 0 5px var(--blue-soft); }
.flow-line { height: 2px; margin-top: 15px; background: #dce2e9; }
.flow-line.complete { background: var(--teal); }
.flow-line.active { background: linear-gradient(90deg, var(--teal), var(--blue)); }
.batch-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 15px; border-radius: 10px; background: #f6f8fa; }
.batch-summary span, .batch-summary strong { display: block; }
.batch-summary span { color: var(--muted); font-size: .67rem; text-transform: uppercase; letter-spacing: .06em; }
.batch-summary strong { margin-top: 3px; font-size: .77rem; }
.attention-panel .panel-heading { margin-bottom: 9px; }
.attention-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 12px 4px; border: 0; border-bottom: 1px solid #e7ebf0; background: white; color: var(--ink); text-align: left; }
.attention-row:last-child { border-bottom: 0; }
.attention-row:hover { background: #fafcfd; }
.person-avatar { width: 34px; height: 34px; color: #33445a; font-size: .7rem; }
.attention-row strong, .attention-row small, .user-cell strong, .user-cell small { display: block; }
.attention-row strong { font-size: .78rem; }
.attention-row small { margin-top: 2px; color: var(--muted); font-size: .69rem; }
.blue-bg { background: #dce9f8 !important; color: #275c98 !important; }
.teal-bg { background: #dff3ef !important; color: #0b766e !important; }
.amber-bg { background: #ffedcf !important; color: #965b0a !important; }
.red-bg { background: #fbe0e0 !important; color: #a63b3b !important; }
.gray-bg { background: #e8ecf0 !important; color: #687688 !important; }
.recent-panel .panel-heading { align-items: center; margin-bottom: 16px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 12px; border-bottom: 1px solid #ccd6e1; color: #718094; font-size: .69rem; text-align: left; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
td { padding: 13px 12px; border-bottom: 1px solid #e6ebf0; color: #3d4c60; font-size: .8rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcfd; }
td strong { color: var(--ink); }
.row-action { width: 31px; height: 31px; border-radius: 7px; }
.row-action svg { width: 17px; height: 17px; }
.table-panel { overflow: hidden; }
.table-panel .panel-heading { padding: 18px 20px; border-bottom: 1px solid var(--line); align-items: center; }
.cell-meta { display: block; margin-top: 2px; color: #8391a1; font-size: .66rem; }
.table-footer { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; }
.table-footer button { margin-left: 6px; border: 1px solid var(--line); border-radius: 6px; background: white; padding: 6px 10px; color: #47576a; }
.table-footer button:disabled { color: #a7b0bb; background: #f5f7f9; }
.clickable-row { cursor: pointer; }
.confidence { display: inline-block; vertical-align: middle; width: 52px; height: 5px; margin-right: 6px; overflow: hidden; border-radius: 9px; background: #e5e9ee; }
.confidence i { display: block; height: 100%; background: var(--teal); }
.confidence.low i { background: var(--amber); }

.content-grid { display: grid; gap: 17px; }
.upload-layout { grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr); }
.upload-card, .upload-details { padding: 22px; }
.step-heading { display: flex; gap: 12px; margin-bottom: 20px; }
.step-heading > span { width: 28px; height: 28px; display: grid; place-items: center; flex: none; border-radius: 50%; background: var(--navy-900); color: white; font-size: .76rem; font-weight: 800; }
.step-heading p { margin: 3px 0 0; color: var(--muted); font-size: .78rem; }
.dropzone { min-height: 315px; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1.5px dashed #9eb0c4; border-radius: 13px; background: #f8fbfd; color: var(--muted); }
.dropzone:hover { border-color: var(--teal); background: #f2faf8; }
.dropzone strong { margin-top: 5px; color: var(--ink); font-size: 1rem; }
.dropzone span { font-size: .8rem; }
.dropzone em { margin-top: 10px; color: #8290a0; font-size: .69rem; font-style: normal; }
.upload-illustration { width: 55px; height: 55px; display: grid; place-items: center; border-radius: 15px; background: var(--teal-soft); color: var(--teal); }
.upload-illustration svg { width: 27px; height: 27px; }
.selected-files { display: grid; gap: 8px; margin-top: 12px; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.file-row span { flex: 1; font-size: .8rem; font-weight: 700; }
.file-row small { color: var(--muted); }
.upload-details label, .settings-panel > label, .modal > label, .extracted-panel > label { display: grid; gap: 6px; margin-bottom: 15px; color: #3d4c60; font-size: .76rem; font-weight: 750; }
input, select, textarea { width: 100%; border: 1px solid #ccd6e1; border-radius: 8px; background: white; padding: 10px 11px; color: var(--ink); font-size: .84rem; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
textarea { min-height: 79px; resize: vertical; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field-row label { min-width: 0; }
.optional { color: #8995a4; font-weight: 500; }
.secure-note { display: flex; gap: 9px; margin: 8px 0 19px; padding: 11px; border-radius: 9px; background: #f0f6fb; color: #567087; font-size: .72rem; }
.secure-note svg { width: 16px; flex: none; color: var(--teal); }

.filter-panel { display: grid; grid-template-columns: minmax(230px, 1fr) 190px 210px auto; gap: 10px; align-items: center; margin-bottom: 14px; padding: 14px; }
.filter-panel select { height: 42px; }
.inline-search.small { width: 235px; }
.priority { display: inline-flex; padding: 4px 8px; border-radius: 5px; font-size: .69rem; font-weight: 800; }
.priority.high { background: var(--red-soft); color: var(--red); }
.priority.medium { background: var(--amber-soft); color: var(--amber); }
.priority.low { background: #edf1f5; color: #657487; }
.queue-summary { display: flex; gap: 10px; margin-bottom: 14px; }
.queue-tab { min-width: 130px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; background: white; padding: 9px 12px; color: var(--muted); }
.queue-tab.active { border-color: var(--navy-800); box-shadow: inset 0 -2px 0 var(--navy-800); color: var(--ink); }
.queue-tab strong { color: var(--ink); font-size: 1.1rem; }
.queue-tab span { font-size: .78rem; }

.breadcrumb { display: flex; gap: 8px; margin-bottom: 13px; color: var(--muted); font-size: .76rem; }
.breadcrumb button { border: 0; background: transparent; color: var(--teal-dark); padding: 0; }
.review-header { align-items: center; }
.title-line { display: flex; align-items: center; gap: 12px; }
.header-actions { display: flex; gap: 9px; }
.review-layout { display: grid; grid-template-columns: minmax(360px, .88fr) minmax(460px, 1.12fr); gap: 16px; align-items: start; }
.source-panel { position: sticky; top: 90px; padding: 19px; }
.paper-stage { margin-top: 15px; padding: 24px; border-radius: 11px; background: #dfe6ec; }
.paper-sheet { min-height: 620px; padding: 31px 27px; background: #fffdfa; box-shadow: 0 8px 20px rgba(31,46,60,.18); transform: rotate(-.6deg); color: #27303a; font-family: Georgia, serif; }
.paper-logo { color: #4d5966; font-size: .64rem; letter-spacing: .13em; }
.paper-sheet h3 { margin: 11px 0 20px; border-bottom: 2px solid #303943; padding-bottom: 10px; font-size: 1.12rem; text-align: center; }
.paper-meta { display: grid; gap: 8px; margin-bottom: 18px; font-size: .67rem; }
.paper-sheet table { font-family: "Segoe UI", sans-serif; }
.paper-sheet th, .paper-sheet td { border: 1px solid #69727d; padding: 8px 6px; font-size: .68rem; text-transform: none; color: #303943; }
.paper-sheet .marked { position: relative; background: #fff0a8; font-family: "Comic Sans MS", cursive; font-size: .83rem; }
.paper-total { margin-top: 17px; text-align: right; font-size: .76rem; }
.signature { margin-top: 40px; border-top: 1px solid #7d858f; padding-top: 6px; font-size: .65rem; font-style: italic; }
.review-column { display: grid; gap: 14px; }
.validation-panel { overflow: hidden; }
.validation-alert { display: flex; gap: 11px; padding: 15px; border-left: 4px solid var(--red); background: var(--red-soft); color: var(--red); }
.validation-alert svg { flex: none; }
.validation-alert p { margin: 3px 0 0; color: #7c4545; font-size: .76rem; }
.extracted-panel, .comparison-panel { padding: 19px; }
.extracted-panel .panel-heading { margin-bottom: 18px; }
.confidence-score { color: var(--amber); font-size: .72rem; font-weight: 800; }
.form-section-title { margin: 4px 0 10px; color: #617083; font-size: .73rem; text-transform: uppercase; letter-spacing: .07em; }
.hours-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.hours-grid label { display: grid; gap: 5px; color: var(--muted); font-size: .68rem; font-weight: 750; }
.field-error input { border-color: #d5963c; background: #fffaf1; }
.field-error small { color: var(--amber); font-size: .61rem; }
.totals-box { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 18px 0 15px; padding: 13px; border-radius: 9px; background: #f5f7fa; }
.totals-box span { font-size: .77rem; }
.totals-box strong { margin-left: 7px; }
.totals-box label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .72rem; }
.totals-box input { width: 85px; }
.comparison-panel .panel-heading { margin-bottom: 6px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.check-row svg { color: var(--teal); }
.check-row strong, .check-row small { display: block; }
.check-row strong { font-size: .77rem; }
.check-row small { margin-top: 2px; color: var(--muted); font-size: .68rem; }

.info-banner { display: flex; gap: 11px; margin-bottom: 15px; padding: 13px 15px; border: 1px solid #cfe1f1; border-radius: 10px; background: #f0f6fb; color: #366286; }
.info-banner p { margin: 2px 0 0; font-size: .75rem; }
.prompt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.prompt-card { display: flex; flex-direction: column; min-height: 300px; padding: 20px; }
.prompt-card-top { display: flex; align-items: center; justify-content: space-between; }
.prompt-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; background: var(--blue-soft); color: var(--blue); font-size: .73rem; font-weight: 850; }
.prompt-card h2 { margin: 19px 0 8px; font-size: 1rem; }
.prompt-card > p { margin: 0; color: var(--muted); font-size: .78rem; }
.prompt-meta { display: flex; gap: 14px; margin-top: auto; padding-top: 20px; color: #8491a0; font-size: .68rem; }
.card-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.muted-card { opacity: .75; }

.role-strip { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 15px; padding: 16px; }
.role-strip > div { display: grid; grid-template-columns: auto 1fr auto; gap: 11px; align-items: center; padding: 5px 18px; border-right: 1px solid var(--line); }
.role-strip > div:last-child { border-right: 0; }
.role-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 9px; font-size: .75rem; font-weight: 850; }
.role-icon.admin { background: #e5edf7; color: #315c8e; }
.role-icon.reviewer { background: var(--teal-soft); color: var(--teal); }
.role-icon.operator { background: var(--amber-soft); color: var(--amber); }
.role-strip strong, .role-strip small { display: block; }
.role-strip strong { font-size: .8rem; }
.role-strip small { color: var(--muted); font-size: .66rem; }
.role-strip b { font-size: 1.35rem; }
.user-cell { display: flex; align-items: center; gap: 9px; }
.user-cell strong { font-size: .78rem; }
.user-cell small { color: var(--muted); font-size: .66rem; }

.settings-layout { display: grid; grid-template-columns: 215px minmax(0, 760px); gap: 18px; align-items: start; }
.settings-nav { display: grid; gap: 4px; padding: 7px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.settings-nav button { border: 0; border-radius: 7px; background: transparent; padding: 10px 11px; color: #5e6d80; text-align: left; font-size: .8rem; }
.settings-nav button.active { background: var(--navy-900); color: white; font-weight: 750; }
.settings-panel { display: none; padding: 22px; }
.settings-panel.active { display: block; }
.settings-panel .panel-heading { margin-bottom: 21px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.toggle-row { display: flex !important; flex-direction: row; align-items: center; justify-content: space-between; gap: 22px; margin: 0 !important; padding: 15px 0; border-top: 1px solid var(--line); }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row small { margin-top: 3px; color: var(--muted); font-weight: 400; }
.toggle-row input { width: 42px; height: 22px; accent-color: var(--teal); }
.settings-actions { display: flex; align-items: center; gap: 13px; margin-top: 4px; }
.last-tested { color: var(--muted); font-size: .72rem; }
.rule-list { border-bottom: 1px solid var(--line); }

.health-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 15px; }
.health-card { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 17px; }
.health-card strong, .health-card small { display: block; }
.health-card strong { font-size: .78rem; }
.health-card small { margin-top: 3px; color: var(--muted); font-size: .67rem; }
.health-card b { color: var(--teal); font-size: .72rem; }
.audit-panel { padding: 20px; }
.audit-panel .panel-heading { padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.audit-list > div { display: flex; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.audit-list > div:last-child { border-bottom: 0; }
.audit-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border-radius: 9px; }
.audit-icon svg { width: 17px; }
.audit-list strong, .audit-list small { display: block; }
.audit-list strong { font-size: .8rem; }
.audit-list p { margin: 3px 0; color: #536377; font-size: .76rem; }
.audit-list small { color: #8995a4; font-size: .66rem; }

.modal-backdrop, .login-overlay { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 20px; background: rgba(10,22,36,.65); backdrop-filter: blur(3px); }
.modal-backdrop.open, .login-overlay.open { display: grid; }
.modal { width: min(680px, 100%); max-height: 92vh; overflow-y: auto; border-radius: 15px; background: white; padding: 23px; box-shadow: 0 25px 70px rgba(8,20,33,.32); }
.small-modal { width: min(480px, 100%); }
.modal-header { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 21px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.modal-header h2 { font-size: 1.25rem; }
.prompt-editor { min-height: 190px; }
.modal-note { padding: 12px; border-radius: 8px; background: #f3f6f9; color: #556579; font-size: .75rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.login-overlay { background: radial-gradient(circle at 25% 20%, #244b70 0, var(--navy-950) 45%, #09121d 100%); }
.login-card { width: min(430px, 100%); border-radius: 17px; background: white; padding: 34px; box-shadow: 0 30px 90px rgba(0,0,0,.35); }
.login-brand { padding: 0 0 34px; }
.login-brand strong { color: var(--ink); }
.login-brand span { color: var(--muted); }
.login-card h1 { margin: 2px 0 5px; font-size: 1.85rem; }
.login-card > p:not(.eyebrow) { margin: 0 0 23px; color: var(--muted); }
.login-card form > label { display: grid; gap: 6px; margin-bottom: 14px; color: #3f5063; font-size: .78rem; font-weight: 750; }
.login-options { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 19px; }
.check-label { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 7px !important; margin: 0 !important; font-weight: 500 !important; }
.check-label input { width: auto; }
.login-note { display: block; margin-top: 17px; color: #8794a3; text-align: center; }
.toast { position: fixed; z-index: 150; right: 25px; bottom: 25px; display: flex; align-items: center; gap: 9px; transform: translateY(120px); opacity: 0; padding: 12px 16px; border-radius: 10px; background: var(--navy-950); color: white; box-shadow: var(--shadow); transition: .25s ease; font-size: .82rem; font-weight: 700; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast svg { width: 17px; color: #62dbc3; }

@media (max-width: 1100px) {
  .metric-grid, .health-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .upload-layout { grid-template-columns: minmax(0, 1fr); }
  .attention-panel { min-width: 0; }
  .prompt-grid { grid-template-columns: repeat(2, 1fr); }
  .review-layout { grid-template-columns: 1fr; }
  .source-panel { position: static; }
  .paper-stage { display: grid; place-items: center; }
  .paper-sheet { width: min(540px, 100%); }
}

@media (max-width: 850px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 30px; left: 0; width: 270px; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 18px 0 60px rgba(5,17,30,.35); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close, .menu-button { display: grid; }
  .topbar { padding: 0 16px; }
  main { padding: 25px 20px 50px; }
  .search { width: min(360px, 48vw); }
  .profile-copy, .chevron { display: none; }
  .filter-panel { grid-template-columns: 1fr 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { grid-template-columns: repeat(5, max-content); overflow-x: auto; }
  .role-strip { grid-template-columns: 1fr; }
  .role-strip > div { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 5px; }
  .role-strip > div:last-child { border-bottom: 0; }
}

@media (max-width: 640px) {
  .prototype-bar { justify-content: flex-start; padding-left: 14px; }
  .search { display: none; }
  .page-header { align-items: flex-start; flex-direction: column; gap: 14px; }
  .dashboard-heading .primary-button, .page-header > .primary-button, .page-header > .secondary-button { width: 100%; }
  .metric-grid, .health-grid, .prompt-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 96px; }
  .workflow-track { overflow-x: auto; grid-template-columns: 90px 55px 90px 55px 90px 55px 90px; padding-bottom: 8px; }
  .batch-summary { grid-template-columns: 1fr; }
  .field-row, .hours-grid { grid-template-columns: 1fr 1fr; }
  .filter-panel { grid-template-columns: 1fr; }
  .queue-summary { overflow-x: auto; }
  .review-header .header-actions { width: 100%; }
  .review-header .header-actions button { flex: 1; }
  .title-line { align-items: flex-start; flex-direction: column; }
  .paper-stage { padding: 12px; }
  .paper-sheet { min-height: 500px; padding: 20px 15px; }
  .settings-nav { grid-template-columns: repeat(5, max-content); }
  .settings-panel { padding: 17px; }
  .inline-search.small { width: 100%; }
  .table-panel .panel-heading { align-items: flex-start; flex-direction: column; }
  .login-card { padding: 25px; }
}
