:root {
  color-scheme: light;
  --ink: #183239;
  --muted: #506569;
  --line: #dce7e4;
  --canvas: #f3f7f5;
  --paper: #ffffff;
  --brand: #0c7066;
  --brand-dark: #07544e;
  --brand-soft: #e2f3ef;
  --brand-pale: #f0f8f5;
  --warning: #86550f;
  --warning-soft: #fff4dc;
  --danger: #9b3d3d;
  --danger-soft: #fff0ee;
  --info: #365f85;
  --info-soft: #eaf3fb;
  --shadow: 0 12px 32px rgba(25, 61, 58, 0.055);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--canvas);
  color: var(--ink);
}

* { box-sizing: border-box; }
html { overflow-x: clip; }
body { margin: 0; min-width: 320px; background: radial-gradient(ellipse at 82% 0, #e5f1ec 0, transparent 35rem), var(--canvas); font-size: 15px; line-height: 1.55; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }
button, input, select, textarea { font: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(1.9rem, 3.2vw, 2.7rem); letter-spacing: -0.045em; line-height: 1.12; }
h2 { margin-bottom: 0; font-size: 1.22rem; letter-spacing: -0.025em; }
h3 { margin-bottom: 5px; font-size: 1rem; letter-spacing: -0.01em; }

.skip-link { position: fixed; z-index: 20; top: 8px; left: 8px; padding: 9px 13px; transform: translateY(-160%); border-radius: 7px; background: var(--ink); color: white; font-weight: 700; }
.skip-link:focus { transform: translateY(0); color: white; }
.topbar { position: sticky; z-index: 5; top: 0; border-bottom: 1px solid rgba(204, 220, 215, 0.9); background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(14px); }
.topbar-inner { display: flex; width: min(1320px, calc(100% - 52px)); min-height: 70px; align-items: center; gap: 30px; margin: 0 auto; }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 10px; color: var(--ink); font-size: 1rem; font-weight: 800; letter-spacing: -0.035em; }
.brand:hover { color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 11px; background: linear-gradient(145deg, #117d71, #07554e); box-shadow: 0 5px 13px rgba(10, 103, 94, 0.2); color: white; font-size: 1rem; font-weight: 850; }
.brand-copy { display: flex; align-items: baseline; gap: 5px; line-height: 1; }
.brand-copy strong { color: var(--ink); }
.brand-copy > span { color: var(--brand); font-weight: 650; }
.topnav { display: flex; min-width: 0; flex: 1; align-items: center; gap: 5px; }
.nav-link { display: inline-flex; min-height: 40px; align-items: center; padding: 8px 13px; border-radius: 9px; color: #52696d; font-size: 0.88rem; font-weight: 650; white-space: nowrap; }
.nav-link:hover { background: #f2f7f5; color: var(--ink); text-decoration: none; }
.nav-link[aria-current="page"] { background: var(--brand-soft); color: var(--brand-dark); }
.account { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; color: var(--muted); font-size: 0.84rem; }
.account-avatar { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid #c9dfd9; border-radius: 50%; background: var(--brand-pale); color: var(--brand-dark); font-size: 0.74rem; font-weight: 800; }
.account-name { max-width: 180px; overflow: hidden; color: #42595d; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.account form { margin: 0; }
.page-shell { width: min(1320px, calc(100% - 52px)); min-height: calc(100vh - 150px); margin: 0 auto; padding: 42px 0 64px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 28px; }
.page-heading p { margin-bottom: 0; }
.heading-actions, .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.back-link { display: inline-block; margin-bottom: 14px; color: var(--muted); font-size: 0.84rem; font-weight: 650; }
.eyebrow { margin-bottom: 7px; color: var(--brand); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; }
.muted { color: var(--muted); }
.small-text { font-size: 0.78rem; }
.panel { border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 9px; font-weight: 700; cursor: pointer; transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease; }
.button:hover { text-decoration: none; transform: translateY(-1px); }
.button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid rgba(12, 112, 102, 0.28); outline-offset: 3px; }
.button-primary { background: var(--brand); color: white; }
.button-primary:hover { background: var(--brand-dark); color: white; }
.button-secondary { border-color: var(--line); background: white; color: #33494e; }
.button-secondary:hover { border-color: #a9c8c2; background: #f8fbfa; color: var(--ink); }
.button-quiet { border-color: transparent; background: transparent; color: #455b60; }
.button-small { min-height: 30px; padding: 5px 10px; font-size: 0.78rem; }
.text-link { font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
.text-button { padding: 4px 0; border: 0; background: none; color: var(--danger); font-size: 0.78rem; font-weight: 700; cursor: pointer; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip, .count-pill, .status-pill, .step-pill { display: inline-flex; align-items: center; border-radius: 999px; white-space: nowrap; }
.chip { padding: 3px 9px; background: #edf3f1; color: #49605e; font-size: 0.73rem; font-weight: 650; }
.count-pill { min-width: 24px; justify-content: center; padding: 2px 8px; background: #edf3f1; color: #44575b; font-size: 0.78rem; font-weight: 750; }
.count-warning { background: var(--warning-soft); color: var(--warning); }
.status-pill { padding: 4px 9px; background: #eef2f1; color: #58696d; font-size: 0.72rem; font-weight: 750; }
.status-queued { background: #e8f1ff; color: #335887; }
.status-processing { background: #e6f4f3; color: #16655e; }
.status-completed, .status-resolved { background: var(--brand-soft); color: var(--brand-dark); }
.status-review_required, .status-review { background: var(--warning-soft); color: var(--warning); }
.status-failed, .status-blocked, .status-cancelled { background: var(--danger-soft); color: var(--danger); }
.row-excluded td { background: var(--warning-soft); }
.row-excluded strong { color: var(--warning); }
.row-unclassified td { background: var(--info-soft); }
.row-unclassified strong { color: var(--info); }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 0 0 28px; }
.metric-card { display: flex; min-height: 136px; flex-direction: column; gap: 4px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow); }
.metric-card > span { color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.metric-card strong { margin-top: 2px; font-size: 1.85rem; letter-spacing: -0.04em; }
.metric-card small { color: var(--muted); font-size: 0.75rem; }
.metric-card a { margin-top: auto; font-size: 0.75rem; font-weight: 700; }
.metric-warning strong { color: var(--warning); }
.case-list-card { overflow: hidden; padding: 24px 0 8px; }
.case-list-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 0 24px 20px; }
.case-list-header h2 { margin-bottom: 5px; }
.case-list-header p { margin-bottom: 0; font-size: 0.84rem; }
.case-search-controls { display: flex; align-items: flex-end; gap: 10px; padding: 0 24px 20px; }
.case-search-controls .field { flex: 0 1 26rem; min-width: 0; }
.case-search-controls .button:disabled { color: var(--muted); cursor: default; transform: none; }
.case-search-controls :is(input, button):focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.case-search-empty { margin: 0 24px; padding: 20px 0; border-top: 1px solid var(--line); }
.case-search-empty p { margin-bottom: 0; }
.case-count-pill { display: inline-flex; min-height: 40px; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdfc; color: var(--muted); font-size: 0.78rem; white-space: nowrap; }
.case-count-pill strong { color: var(--ink); font-size: 1.05rem; }
.account-role { display: block; margin-top: 4px; color: var(--muted); font-size: 0.72rem; font-weight: 500; }
.account-status { display: inline-flex; align-items: center; min-height: 27px; padding: 4px 9px; border-radius: 7px; background: #eef2f1; color: #425b60; font-size: 0.76rem; font-weight: 700; white-space: nowrap; }
.account-status-active { background: #e5f4ed; color: #226343; }
.account-status-pending { background: #f8eed9; color: #765312; }
.account-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.account-actions form { margin: 0; }
.text-action { padding: 0; border: 0; background: transparent; color: var(--brand-dark); font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; }
.text-action:hover { text-decoration: underline; }
.text-action:focus-visible { outline: 3px solid rgba(12, 112, 102, 0.28); outline-offset: 3px; }
.account-empty { margin: 0; padding: 28px 24px 34px; color: var(--muted); }
.case-table-scroll { position: relative; padding: 0 12px; }
.cases-table { width: 100%; min-width: 900px; border-collapse: collapse; text-align: left; }
.cases-table th { padding-top: 12px; padding-bottom: 12px; background: #f7faf8; }
.cases-table td { height: 76px; }
.cases-table tbody tr { transition: background 120ms ease; }
.cases-table tbody tr:hover { background: #f8fbf9; }
.cases-table tbody tr:last-child td { border-bottom: 0; }
.case-client-link { display: flex; align-items: center; gap: 11px; color: var(--ink); }
.case-client-link:hover { color: var(--brand-dark); text-decoration: none; }
.case-avatar { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border: 1px solid #c9e1db; border-radius: 11px; background: var(--brand-soft); color: var(--brand-dark); font-size: 0.84rem; font-weight: 800; }
.case-client-name { display: flex; min-width: 0; flex-direction: column; gap: 3px; font-weight: 750; overflow-wrap: anywhere; }
.case-client-name small { color: var(--muted); font-size: 0.7rem; font-weight: 500; }
.case-period { color: #435b60; font-size: 0.82rem; font-weight: 650; white-space: nowrap; }
.table-count { display: inline-grid; min-width: 29px; min-height: 29px; place-items: center; border-radius: 8px; background: #f0f5f3; color: #41595d; font-size: 0.78rem; font-weight: 750; }
.case-open-link { display: inline-flex; align-items: center; gap: 5px; }
.case-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0 0; color: var(--muted); font-size: 0.88rem; }
.case-meta-separator { color: #a1b0ae; }
.status-case { border: 1px solid #dce8e3; background: #f6faf8; color: #4a6264; }
.case-section-nav { position: relative; display: flex; gap: 4px; overflow-x: auto; margin: -6px 0 28px; padding: 7px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255, 0.82); scrollbar-width: thin; }
.case-section-nav a { display: inline-flex; min-height: 34px; flex: 0 0 auto; align-items: center; padding: 6px 10px; border-radius: 8px; color: #586d70; font-size: 0.76rem; font-weight: 650; white-space: nowrap; }
.case-section-nav a:hover { background: var(--brand-soft); color: var(--brand-dark); text-decoration: none; }
.detail-section { scroll-margin-top: 94px; }
.section-block { margin-top: 24px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 15px; }
.section-heading .eyebrow { margin-bottom: 3px; }
.module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.module-card { padding: 19px 20px; }
.module-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.module-card p { min-height: 45px; margin: 14px 0 12px; font-size: 0.87rem; }
.approval-lock { display: inline-flex; padding: 5px 9px; border-radius: 6px; background: var(--warning-soft); color: var(--warning); font-size: 0.72rem; font-weight: 750; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.table-panel { padding: 21px; }
.table-panel table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 10px 12px; border-bottom: 1px solid var(--line); color: #617277; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.055em; text-transform: uppercase; white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid #edf1ef; color: #34494e; font-size: 0.84rem; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.table-panel > table { margin: -8px -8px 0; width: calc(100% + 16px); }
.table-link { color: var(--ink); font-weight: 750; }
.table-scroll { overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-color: #bfd3ce transparent; scrollbar-width: thin; }
.table-scroll table { min-width: 800px; }
.case-preview { position: relative; }
.case-preview .efd-preview-row td { height: 56px; }
.case-preview:has(.efd-preview-row, .document-preview) .table-footer {
  position: absolute; inset-inline: 0; bottom: 0; height: 56px; margin: 0;
  display: grid; place-items: center; pointer-events: none;
}
.case-preview .table-footer a { pointer-events: auto; }
.efd-preview-row { mask-image: linear-gradient(#000 42%, transparent 56%); }
.table-footer { margin: 12px 0 0; text-align: center; }
.document-list { display: flex; flex-direction: column; }
.document-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 14px 0; border-top: 1px solid #edf1ef; }
.document-row:first-child { border-top: 0; }
.document-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.document-main strong { display: inline-block; max-width: 480px; overflow-wrap: anywhere; }
.file-mark { display: grid; width: 38px; height: 42px; flex: 0 0 38px; place-items: center; border: 1px solid #cbded9; border-radius: 7px; background: #f0f7f5; color: var(--brand); font-size: 0.62rem; font-weight: 850; }
.document-state { display: flex; min-width: 260px; flex-direction: column; align-items: flex-end; gap: 5px; }
.step-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.step-pill { padding: 2px 7px; background: #f0f3f2; color: #66777a; font-size: 0.66rem; }
.step-completed { background: var(--brand-soft); color: var(--brand-dark); }
.step-processing { background: #e8f1ff; color: #335887; }
.step-failed { background: var(--danger-soft); color: var(--danger); }
.error-summary { max-width: 360px; color: var(--danger); font-size: 0.75rem; text-align: right; }
.compact-list { display: flex; flex-direction: column; }
.compact-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 11px 0; border-top: 1px solid #edf1ef; }
.compact-row:first-child { border-top: 0; }
.subsection-heading { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; }
.subsection-heading h3 { margin: 0; }
.competence-chips { padding-bottom: 4px; }
.empty-inline { margin: 0; padding: 15px 0; color: var(--muted); font-size: 0.85rem; }
.empty-state { display: flex; min-height: 320px; flex-direction: column; align-items: center; justify-content: center; padding: 32px; text-align: center; }
.empty-state h2 { margin: 13px 0 8px; }
.empty-state p { max-width: 420px; }
.empty-icon { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 16px; background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.section-count { display: inline-flex; align-items: center; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfdfc; color: var(--muted); font-size: 0.75rem; font-weight: 650; white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

.form-panel { max-width: 760px; padding: 26px; }
.form-panel-intro { margin-bottom: 23px; padding-bottom: 17px; border-bottom: 1px solid #edf2f0; }
.form-panel-intro .eyebrow { margin-bottom: 5px; }
.form-panel-intro p { margin-bottom: 0; font-size: 0.84rem; }
.stack-form { display: flex; flex-direction: column; gap: 17px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field-set legend { color: #354b50; font-size: 0.83rem; font-weight: 750; }
.field input, .field select, .field textarea, .stack-form > input, .stack-form > textarea, .stack-form > select { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #cdd9d6; border-radius: 7px; background: #fff; color: var(--ink); }
.field textarea { min-height: 92px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid rgba(14, 101, 94, 0.14); border-color: var(--brand); }
.field-help { margin: -8px 0 0; color: var(--muted); font-size: 0.76rem; }
.field-set { padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; }
.field-set ul { display: flex; flex-wrap: wrap; gap: 18px; margin: 10px 0 0; padding: 0; list-style: none; }
.field-set li label { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.account-case-scope { padding: 18px 0; border-top: 1px solid var(--line); }
.account-case-scope h2 { margin-bottom: 9px; font-size: 1rem; }
.account-case-scope ul { margin: 0 0 14px; padding-left: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.errorlist { margin: 2px 0 0; padding: 0; color: var(--danger); font-size: 0.78rem; list-style: none; }
.resolve-form { margin-top: 15px; gap: 9px; }
.resolve-form textarea { min-height: 72px; padding: 9px; border: 1px solid #cdd9d6; border-radius: 7px; }
.resolve-form .button { align-self: flex-start; }
.inline-form { display: flex; align-items: flex-end; gap: 14px; }
.grow-field { min-width: 0; flex: 1; }

.upload-card { max-width: 900px; padding: clamp(20px, 4vw, 32px); }
.upload-security-note { display: flex; align-items: center; gap: 13px; margin-bottom: 28px; padding: 14px 16px; border: 1px solid #d5e9e0; border-radius: 11px; background: #f2faf6; }
.upload-security-note p { margin: 3px 0 0; color: var(--muted); font-size: 0.77rem; }
.upload-card-heading { margin-bottom: 22px; }
.upload-card-heading h2 { margin-bottom: 5px; }
.upload-card-heading p { margin-bottom: 0; font-size: 0.84rem; }
.upload-form { gap: 20px; }
.upload-dropzone { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(260px, 1.25fr); align-items: center; gap: 15px; padding: 15px; border: 1px dashed #9cbbb3; border-radius: 12px; background: #fbfdfc; }
.upload-icon { display: grid; width: 43px; height: 43px; place-items: center; border-radius: 12px; background: var(--brand-soft); color: var(--brand-dark); font-size: 1.35rem; font-weight: 700; }
.upload-dropzone-copy { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.upload-dropzone-copy strong { color: #314c50; font-size: 0.82rem; }
.upload-dropzone-copy span { color: var(--muted); font-size: 0.73rem; }
.upload-dropzone input[type="file"] { width: 100%; min-width: 0; min-height: 40px; padding: 5px; border: 0; background: transparent; color: var(--muted); font-size: 0.76rem; }
.upload-dropzone input[type="file"]::file-selector-button { min-height: 34px; margin-right: 8px; padding: 6px 10px; border: 1px solid #cbded8; border-radius: 7px; background: white; color: #35565a; font: inherit; font-weight: 650; cursor: pointer; }
.upload-dropzone input[type="file"]::file-selector-button:hover { background: var(--brand-pale); }
.upload-meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.upload-actions { padding-top: 3px; }
.upload-result-card { max-width: 900px; padding: clamp(22px, 4vw, 34px); }
.upload-result-heading { display: flex; align-items: flex-start; gap: 16px; }
.upload-result-heading h2 { max-width: 700px; margin-bottom: 7px; overflow-wrap: anywhere; }
.upload-result-heading p { margin-bottom: 0; font-size: 0.84rem; }
.upload-result-icon { display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; border-radius: 15px; background: var(--brand-soft); color: var(--brand-dark); font-size: 1.35rem; font-weight: 800; }
.upload-result-details { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(170px, 0.5fr); gap: 12px; margin: 25px 0; }
.result-detail { display: flex; min-width: 0; flex-direction: column; gap: 6px; padding: 13px 15px; border: 1px solid #e5edeb; border-radius: 10px; background: #fbfdfc; }
.result-detail > span:first-child { color: var(--muted); font-size: 0.71rem; font-weight: 700; }
.result-detail code, .processing-result code { color: #536a6e; font-size: 0.73rem; overflow-wrap: anywhere; }
.processing-result { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; margin-bottom: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #f8fbfa; }
.processing-result .eyebrow { margin-bottom: 4px; }
.processing-result > code { grid-column: 1 / -1; padding-top: 8px; border-top: 1px solid #e5edeb; }
.upload-review-note { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 20px; padding: 14px; border: 1px solid #ead9b4; border-radius: 10px; background: #fffaf0; }
.upload-review-note p { margin: 2px 0 0; color: #725a34; font-size: 0.82rem; }
.upload-result-actions { padding-top: 6px; }

.review-list { padding: 22px; }
.issue-card { padding: 18px 0; border-top: 1px solid #edf1ef; }
.issue-card:first-of-type { border-top: 0; }
.issue-card p { margin: 8px 0; color: #455a5e; font-size: 0.88rem; white-space: pre-line; }
.issue-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.issue-heading h3 { margin-bottom: 0; }
.review-open { padding: 24px; }
.review-open .section-heading { margin-bottom: 8px; }
.review-open .issue-card { padding: 22px 0; }
.review-open .issue-card:first-of-type { border-top: 0; }
.review-resolved { padding: 22px; }
.review-empty { display: flex; align-items: center; gap: 13px; padding: 28px 0 12px; }
.review-empty-mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 12px; background: var(--brand-soft); color: var(--brand-dark); font-size: 1.1rem; font-weight: 800; }
.review-empty strong { color: #304a4e; }
.review-empty p { margin: 3px 0 0; color: var(--muted); font-size: 0.8rem; }
.status-blocking { background: var(--danger-soft); color: var(--danger); }
.status-warning { background: var(--warning-soft); color: var(--warning); }
.status-info { background: var(--info-soft); color: var(--info); }
.task-status-banner { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 22px; padding: 15px 17px; border: 1px solid #ead9b4; border-radius: 11px; background: #fffaf0; }
.task-status-banner strong { color: #5e4c2c; font-size: 0.88rem; }
.task-status-banner .eyebrow { margin-bottom: 3px; }
.task-status-failed { border-color: #efceca; background: var(--danger-soft); }
.task-status-failed strong { color: var(--danger); }
.artifact-results { min-width: 0; }
.artifact-table { min-width: 980px; }
.artifact-table td { max-width: 320px; }
.artifact-hash { display: inline-block; max-width: 210px; overflow-wrap: anywhere; color: #63777b; font-size: 0.7rem; }
.report-generation-panel { max-width: 940px; }
.report-generate-form { margin-top: 18px; }
.messages { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.message { padding: 11px 14px; border: 1px solid #bbddd4; border-radius: 8px; background: #eaf7f2; color: #24564e; font-size: 0.85rem; }
.message-error { border-color: #e9c6c1; background: var(--danger-soft); color: var(--danger); }
.message-warning { border-color: #ead7ae; background: var(--warning-soft); color: var(--warning); }
.message-info { border-color: #c9dced; background: var(--info-soft); color: var(--info); }
.site-footer { display: flex; width: min(1320px, calc(100% - 52px)); justify-content: space-between; gap: 20px; margin: 0 auto; padding: 17px 0 24px; border-top: 1px solid rgba(204, 220, 215, 0.9); color: var(--muted); font-size: 0.72rem; }
.site-footer > div { display: flex; gap: 8px; }
.site-footer strong { color: #40585c; }
.footer-note { text-align: right; }
.login-layout { display: grid; width: min(100%, 1040px); min-height: min(680px, calc(100vh - 210px)); grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr); align-items: center; gap: clamp(36px, 7vw, 96px); margin: 0 auto; padding: 32px 0; }
.login-intro { max-width: 470px; }
.login-brand { display: inline-flex; align-items: center; gap: 11px; margin-bottom: 54px; }
.login-intro h1 { max-width: 460px; margin-bottom: 16px; font-size: clamp(2.3rem, 4vw, 3.45rem); }
.login-intro > p { max-width: 390px; color: var(--muted); font-size: 1.04rem; }
.login-local-note { display: flex; align-items: center; gap: 12px; margin-top: 34px; padding: 15px 17px; border: 1px solid #d9e9e3; border-radius: 12px; background: rgba(255, 255, 255, 0.64); color: var(--muted); font-size: 0.8rem; }
.login-local-note strong { color: var(--ink); }
.local-indicator { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: #3f9a72; box-shadow: 0 0 0 5px #e3f3eb; }
.login-layout-centered { grid-template-columns: minmax(0, 1fr); justify-items: center; }
.login-card { width: min(440px, 100%); padding: clamp(26px, 4vw, 38px); }
.document-preview { height: 56px; overflow: hidden; mask-image: linear-gradient(#000 45%, transparent); }
.login-card .login-brand { margin-bottom: 20px; }
.login-card #login-title { margin-bottom: 20px; }
.login-card h1 { font-size: clamp(1.3rem, 4vw, 1.65rem); }
.login-card h2 { margin: 0 0 8px; font-size: 1.65rem; }
.login-card > p { margin-bottom: 25px; font-size: 0.9rem; }
.login-card .field input { min-height: 47px; }
.login-card .button { width: 100%; margin-top: 5px; }

@media (max-width: 900px) {
  #case-results .cases-table { display: block; min-width: 0; }
  #case-results thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  #case-results tbody { display: block; }
  #case-results tbody tr:not([hidden]) {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
    padding: 16px 6px; border-top: 1px solid var(--line);
  }
  #case-results td { min-width: 0; height: auto; padding: 0; border: 0; overflow-wrap: anywhere; }
  #case-results td::before { content: attr(data-label); display: block; margin-bottom: 2px; color: var(--muted); font-size: .75rem; }
  #case-results [data-label="Caso"] { grid-column: 1 / -1; order: -3; }
  #case-results [data-label="Cliente"] { order: -2; }
  #case-results [data-label="Pendências"] { order: -1; }
  #case-results [data-label="Caso"]::before, #case-results [data-label="Ações"]::before,
  #case-results .case-client-name small, #case-results .case-open-link, #case-results .case-actions-divider { display: none; }
  #case-results [data-label="Ações"]:not(:has(.case-actions-divider)) { display: none; }
  #case-results .case-client-link { color: var(--brand-dark); text-decoration: underline; }
  #case-results .chip, #case-results .case-period { white-space: normal; }
}

@media (max-width: 760px) {
  .topbar-inner { min-height: 64px; flex-wrap: wrap; gap: 8px 16px; padding: 10px 0 8px; }
  .topnav { order: 3; flex-basis: 100%; overflow-x: auto; scrollbar-width: thin; }
  .account { margin-left: auto; }
  .account-avatar { display: none; }
  .account-name { max-width: 120px; }
  .page-shell { min-height: calc(100vh - 160px); padding: 30px 0 46px; }
  .page-heading { align-items: flex-start; }
  .site-footer { flex-direction: column; gap: 7px; }
  .footer-note { text-align: left; }
  .login-layout { min-height: 0; grid-template-columns: 1fr; gap: 28px; padding: 12px 0 32px; }
  .login-intro { max-width: 600px; }
  .login-brand { margin-bottom: 30px; }
  .login-intro h1 { max-width: 600px; font-size: clamp(2rem, 7vw, 2.8rem); }
  .login-local-note { margin-top: 22px; }
  .login-card { width: 100%; max-width: 560px; }
}

@media (max-width: 900px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .case-list-header { align-items: flex-start; }
  .upload-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .document-row { flex-direction: column; }
  .document-state { min-width: 0; align-items: flex-start; padding-left: 50px; }
  .step-row { justify-content: flex-start; }
  .error-summary { text-align: left; }
}
@media (max-width: 680px) {
  .page-shell { width: calc(100% - 28px); padding-top: 24px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; }
  .metric-grid, .module-grid, .content-grid, .form-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 116px; }
  .table-panel { padding: 16px; }
  .case-list-card { padding: 19px 0 5px; }
  .case-list-header { flex-direction: column; gap: 13px; padding: 0 17px 17px; }
  .case-search-controls { padding: 0 17px 17px; }
  .case-search-empty { margin-inline: 17px; }
  .case-section-nav { margin-bottom: 22px; }
  .detail-section { scroll-margin-top: 108px; }
  .section-heading { align-items: flex-start; }
  .upload-card { padding: 19px; }
  .upload-security-note { align-items: flex-start; padding: 12px; }
  .upload-dropzone { grid-template-columns: auto minmax(0, 1fr); gap: 11px; padding: 12px; }
  .upload-dropzone input[type="file"] { grid-column: 1 / -1; }
  .upload-meta-grid { grid-template-columns: 1fr; }
  .upload-result-details { grid-template-columns: 1fr; }
  .upload-result-heading { gap: 12px; }
  .upload-result-icon { width: 40px; height: 40px; border-radius: 12px; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .inline-form .button { width: 100%; }
  .review-open, .review-resolved { padding: 17px; }
  .issue-heading { flex-direction: column; }
  .task-status-banner { align-items: flex-start; flex-direction: column; }
  .document-main strong { max-width: 250px; }
  .document-state { padding-left: 0; }
  .form-panel, .login-card { padding: 21px; }
  .field-set ul { flex-direction: column; gap: 9px; }
}

.acquisition-card { border-inline-start: 4px solid var(--brand); }
.acquisition-card p { margin: 10px 0; }
.acquisition-card p:last-child { margin-top: 18px; }
#efd-purchases :is(td, th):nth-child(n+4):nth-child(-n+5),
#efd-totals :is(td, th):nth-child(n+4):nth-child(-n+6) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: normal;
}
:is(#efd-purchases, #efd-totals) td:first-child { font-weight: 700; }
.analysis-controls { align-items: end; }
.case-metrics { margin-top: 24px; }
.case-metrics small { margin-top: auto; }

.case-preview .table-scroll table { min-width: 0; table-layout: fixed; }
.case-preview .table-scroll :is(td, th) { overflow-wrap: anywhere; white-space: normal; }
.case-preview .document-main > div, .case-preview .document-state { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .case-preview table thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .case-preview table, .case-preview tbody { display: block; }
  .case-preview tbody tr { display: grid; padding-block: 8px; border-bottom: 1px solid var(--line); }
  .case-preview tbody td { display: grid; grid-template-columns: 38% minmax(0, 1fr); gap: 8px; padding: 4px; border: 0; }
  .case-preview tbody td::before { content: attr(data-label); font-weight: 600; text-align: left; }
  .case-preview tbody .efd-preview-row { height: 56px; overflow: hidden; }
}

@media (min-width: 761px) {
  .case-preview .table-scroll .efd-preview-row td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

.period-layout { width: min(100%, 39rem); margin: clamp(0px, 3vh, 32px) auto; }
.period-card { padding: clamp(18px, 3vw, 28px); }
.upload-period { max-width: 39rem; }
.period-heading { display: flex; align-items: flex-start; gap: 14px; }
.period-heading h1, .period-heading h2 { margin: 0; font-size: clamp(1.25rem, 3vw, 1.55rem); }
.period-heading p { margin: 5px 0 0; font-size: .9rem; }
.period-mark { display: grid; flex: 0 0 42px; height: 42px; place-items: center; border-radius: 10px; color: var(--brand-dark); background: var(--brand-soft); }
.period-fields { margin-top: 24px; align-items: start; }
.period-fields .field, .period-fields input { min-width: 0; }
.period-note { margin: 12px 0 0; color: var(--muted); font-size: .82rem; }
.period-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.competence-heading { flex-wrap: wrap; justify-content: space-between; }
.competence-heading h3 { display: inline-flex; gap: 8px; align-items: center; }
