:root {
  --navy: #0f2234;
  --navy-2: #18364f;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe4ec;
  --line-soft: #edf2f7;
  --background: #f4f7fb;
  --surface: #ffffff;
  --teal: #14b8a6;
  --teal-dark: #0f766e;
  --teal-soft: #e8faf7;
  --danger: #c2414a;
  --danger-soft: #fff1f2;
  --warning: #d97706;
  --warning-soft: #fff7e8;
  --blue: #3976d3;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(15, 34, 52, .07);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; background: var(--background); color: var(--ink); font-size: 15px; line-height: 1.5; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; }

.skip-link { position: fixed; top: 8px; left: 8px; z-index: 200; padding: 9px 14px; border-radius: 9px; background: var(--navy); color: #fff; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid rgba(20, 184, 166, .35); outline-offset: 3px; }
.eyebrow { margin: 0 0 6px; color: var(--teal-dark); font-size: .7rem; font-weight: 800; letter-spacing: .13em; }
.eyebrow--light { color: #75e5d8; }
.eyebrow--danger { color: var(--danger); }
.muted { color: var(--muted); }

.brand-lockup { display: inline-flex; align-items: center; gap: 12px; color: var(--navy); }
.brand-lockup > span:last-child { display: grid; }
.brand-lockup strong { font-size: .95rem; line-height: 1.15; letter-spacing: .025em; }
.brand-lockup small { margin-top: 3px; color: var(--teal-dark); font-size: .58rem; font-weight: 800; letter-spacing: .13em; }
.brand-lockup--light { color: #fff; }
.brand-lockup--light small { color: #75e5d8; }
.brand-mark { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 12px 3px 12px 3px; background: var(--teal); color: var(--navy); font-size: 1.35rem; font-weight: 900; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 42%) 1fr; background: #fff; }
.login-brand { position: relative; min-height: 100vh; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; padding: clamp(32px, 5vw, 72px); color: #fff; background: var(--navy); }
.login-brand::before, .login-brand::after { content: ""; position: absolute; border: 1px solid rgba(117, 229, 216, .16); border-radius: 50%; }
.login-brand::before { width: 540px; height: 540px; right: -290px; top: 8%; }
.login-brand::after { width: 260px; height: 260px; right: -95px; bottom: -90px; background: rgba(20, 184, 166, .08); }
.login-message { position: relative; z-index: 1; max-width: 560px; margin: auto 0; }
.login-message h1 { max-width: 11ch; margin: 0; font-size: clamp(2.5rem, 5vw, 4.7rem); line-height: 1.02; letter-spacing: -.055em; }
.login-message > p:last-child { max-width: 48ch; margin: 28px 0 0; color: #c8d5df; font-size: 1.05rem; }
.login-brand-foot { position: relative; z-index: 1; margin: 0; color: #91a6b7; font-size: .8rem; }
.login-form-wrap { display: grid; place-items: center; padding: 32px; background: linear-gradient(135deg, #fff 20%, #f6fbfb); }
.login-card { width: min(440px, 100%); padding: clamp(28px, 4vw, 46px); border: 1px solid var(--line); border-radius: 26px; background: #fff; box-shadow: 0 30px 80px rgba(15, 34, 52, .1); }
.login-card h2 { margin: 0; font-size: 2rem; letter-spacing: -.035em; }
.login-card > .muted { margin: 8px 0 26px; }
.login-mobile-brand { display: none; margin-bottom: 32px; }

.form-field { display: grid; gap: 7px; margin: 17px 0; }
label { color: #334155; font-size: .82rem; font-weight: 700; }
input, select { width: 100%; min-height: 46px; padding: 10px 13px; border: 1px solid #cdd8e2; border-radius: 11px; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { border-color: var(--teal); outline: 0; box-shadow: 0 0 0 4px rgba(20, 184, 166, .1); }
.password-field { position: relative; }
.password-field input { padding-right: 86px; }
.password-toggle { position: absolute; top: 50%; right: 11px; padding: 3px 5px; border: 0; background: transparent; color: var(--teal-dark); font-size: .75rem; font-weight: 800; cursor: pointer; transform: translateY(-50%); }
.form-error { margin: 9px 0; color: var(--danger); font-size: .82rem; }
.transport-alert, .transport-banner { border: 1px solid #f1c675; border-radius: 12px; background: var(--warning-soft); color: #8a5208; font-size: .8rem; }
.transport-alert { margin: 18px 0 0; padding: 11px 13px; }
.transport-banner { margin-bottom: 20px; padding: 11px 15px; }

.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 17px; border: 1px solid transparent; border-radius: 999px; cursor: pointer; font-size: .83rem; font-weight: 800; transition: transform .12s, background .15s, border-color .15s, color .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button--primary { background: var(--teal); color: #092f31; box-shadow: 0 7px 18px rgba(20, 184, 166, .2); }
.button--primary:hover { background: #30c8b6; }
.button--secondary { border-color: #bdd1d7; background: #fff; color: var(--navy); }
.button--secondary:hover, .button--ghost:hover { border-color: var(--teal); color: var(--teal-dark); }
.button--ghost { border-color: var(--line); background: transparent; color: #526579; }
.button--danger { border-color: #fecdd3; background: var(--danger-soft); color: var(--danger); }
.button--wide { width: 100%; }

.app-shell { min-height: 100vh; }
.app-header { position: sticky; top: 0; z-index: 50; height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px); }
.header-actions { position: relative; display: flex; align-items: center; gap: 11px; }
.service-state { display: flex; align-items: center; gap: 8px; margin-right: 8px; color: #496074; font-size: .78rem; font-weight: 700; }
.service-state i { width: 8px; height: 8px; border-radius: 50%; background: #31c878; box-shadow: 0 0 0 4px rgba(49, 200, 120, .1); }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--navy); cursor: pointer; font-size: 1.2rem; }
.profile-button { min-width: 205px; display: flex; align-items: center; gap: 10px; padding: 4px 9px 4px 5px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--navy); cursor: pointer; text-align: left; }
.profile-button > span:nth-child(2) { min-width: 0; flex: 1; display: grid; }
.profile-button strong, .profile-button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-button strong { font-size: .78rem; }
.profile-button small { color: var(--muted); font-size: .66rem; }
.avatar { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; }
.profile-menu { position: absolute; top: 51px; right: 0; width: 190px; overflow: hidden; padding: 6px; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: var(--shadow); }
.profile-menu a, .profile-menu button { width: 100%; display: block; padding: 9px 11px; border: 0; border-radius: 8px; background: transparent; color: var(--navy); cursor: pointer; font-size: .82rem; text-align: left; }
.profile-menu a:hover, .profile-menu button:hover { background: var(--background); }

.app-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); align-items: start; }
.sidebar { position: sticky; top: 78px; height: calc(100vh - 78px); display: flex; flex-direction: column; padding: 26px 17px 17px; background: var(--navy); color: #fff; }
.main-nav { display: grid; gap: 5px; }
.main-nav a { min-height: 47px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 8px 13px; border-radius: 12px; color: #aebfcb; font-size: .85rem; font-weight: 700; transition: color .15s, background .15s; }
.main-nav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.main-nav a.is-active { color: #fff; background: rgba(20, 184, 166, .15); }
.nav-icon { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .14); border-radius: 8px; font-size: .9rem; }
.main-nav a.is-active .nav-icon { border-color: rgba(117, 229, 216, .32); color: #75e5d8; }
.nav-count { min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .67rem; }
.sidebar-help { margin-top: auto; padding: 16px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; background: rgba(255, 255, 255, .045); }
.sidebar-help strong { font-size: .78rem; }
.sidebar-help p { margin: 6px 0 0; color: #8fa5b6; font-size: .7rem; }
.sidebar-version { margin-top: 16px; color: #6f899d; font-size: .63rem; font-weight: 800; letter-spacing: .08em; }

.main-content { width: 100%; max-width: 1520px; min-width: 0; padding: 35px clamp(20px, 3.2vw, 52px) 70px; }
.view { animation: view-in .2s ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } }
.page-heading { min-height: 76px; display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-heading h1 { margin: 0; color: var(--navy); font-size: clamp(2rem, 3vw, 2.85rem); line-height: 1.1; letter-spacing: -.045em; }
.page-heading p:last-child { max-width: 62ch; margin: 8px 0 0; color: var(--muted); }
.range-switch { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.range-switch button { min-height: 35px; padding: 6px 13px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; font-size: .77rem; font-weight: 800; }
.range-switch button.is-active { background: var(--navy); color: #fff; }

.card, .kpi-card { border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card { padding: 23px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi-card { min-height: 134px; display: flex; align-items: center; gap: 17px; padding: 20px; }
.kpi-card > div { min-width: 0; display: grid; }
.kpi-card small { color: var(--muted); font-size: .72rem; font-weight: 700; }
.kpi-card strong { margin: 5px 0; color: var(--navy); font-size: clamp(1.65rem, 2.4vw, 2.35rem); line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.kpi-card div > span { overflow: hidden; color: #8998a8; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.kpi-icon { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 14px; font-size: 1.05rem; font-weight: 900; }
.kpi-icon--navy { background: #e9eff4; color: var(--navy); }
.kpi-icon--teal { background: var(--teal-soft); color: var(--teal-dark); }
.kpi-icon--amber { background: var(--warning-soft); color: var(--warning); }
.kpi-icon--blue { background: #edf4ff; color: var(--blue); }
.overview-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, .72fr); gap: 14px; margin-top: 14px; }
.card-heading { display: flex; align-items: start; justify-content: space-between; gap: 15px; }
.card-heading h2, .card h2 { margin: 0; color: var(--navy); font-size: 1.1rem; }
.chart-legend { color: var(--muted); font-size: .7rem; }
.chart-legend i { width: 9px; height: 9px; display: inline-block; margin-right: 4px; border-radius: 3px; background: var(--teal); }
.chart-card figure { margin: 20px 0 0; }
#documentsChart { width: 100%; height: auto; min-height: 230px; overflow: visible; }
.chart-card figcaption { color: var(--muted); font-size: .72rem; }
.quota-card { display: flex; flex-direction: column; align-items: stretch; }
.quota-ring { --progress: 0deg; width: 138px; height: 138px; display: grid; place-items: center; margin: 18px auto; border-radius: 50%; background: conic-gradient(var(--teal) var(--progress), #e7eef3 var(--progress)); }
.quota-ring::before { content: ""; width: 108px; height: 108px; grid-area: 1 / 1; border-radius: 50%; background: #fff; }
.quota-ring span { z-index: 1; grid-area: 1 / 1; display: grid; text-align: center; }
.quota-ring strong { color: var(--navy); font-size: 1.35rem; }
.quota-ring small { color: var(--muted); font-size: .65rem; }
.quota-numbers { display: grid; margin-bottom: 16px; text-align: center; }
.quota-numbers strong { color: var(--navy); font-size: 1.12rem; }
.quota-numbers small { color: var(--muted); }
.text-link { color: var(--teal-dark); font-size: .78rem; font-weight: 800; }
.quota-card > .text-link { margin-top: auto; }
.recent-card { margin-top: 14px; padding: 0; overflow: hidden; }
.recent-card > .card-heading { padding: 21px 23px 12px; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .78rem; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; white-space: nowrap; }
th { color: #718399; background: #f9fbfd; font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafdfd; }
.cell-title { display: block; color: var(--navy); font-weight: 800; }
.cell-note { display: block; max-width: 280px; overflow: hidden; margin-top: 3px; color: var(--muted); font-size: .67rem; text-overflow: ellipsis; }
.mono { font-family: Consolas, "SFMono-Regular", monospace; font-size: .72rem; }
.status-badge { min-height: 25px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid #b9ddce; border-radius: 999px; background: #f0fbf6; color: #16784d; font-size: .67rem; font-weight: 800; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge--active, .status-badge[data-kind="success"] { border-color: #b9ddce; background: #f0fbf6; color: #16784d; }
.status-badge[data-kind="danger"] { border-color: #fecdd3; background: var(--danger-soft); color: var(--danger); }
.status-badge[data-kind="warning"] { border-color: #f7d897; background: var(--warning-soft); color: #a55f05; }
.status-badge[data-kind="info"] { border-color: #c6dafa; background: #eff5ff; color: #336ab6; }
.row-button { min-height: 31px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--teal-dark); cursor: pointer; font-size: .68rem; font-weight: 800; }
.empty-state { margin: 0; padding: 38px 20px; color: var(--muted); text-align: center; }

.upload-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, .7fr); gap: 16px; }
.upload-card { min-height: 480px; }
.drop-zone { min-height: 312px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 34px; border: 2px dashed #b9cbd7; border-radius: 17px; background: #f9fcfd; color: var(--navy); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--teal); background: var(--teal-soft); }
.drop-zone strong { margin-top: 15px; font-size: 1.08rem; }
.drop-zone > span:not(.drop-icon) { margin-top: 5px; color: var(--muted); font-size: .8rem; }
.drop-zone small { margin-top: 17px; color: #8292a2; font-size: .68rem; }
.drop-zone input { position: absolute; width: 1px; height: 1px; min-height: 0; overflow: hidden; opacity: 0; }
.drop-icon { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 18px; background: var(--navy); color: #fff; font-size: 1.8rem; }
.file-list { display: grid; gap: 7px; margin: 15px 0 0; padding: 0; list-style: none; }
.file-list li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--line-soft); border-radius: 10px; }
.file-list strong { overflow: hidden; color: var(--navy); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.file-list span { color: var(--muted); font-size: .67rem; }
.file-list button { border: 0; background: transparent; color: var(--danger); cursor: pointer; }
.upload-options { align-self: start; }
.upload-options h2 { margin-bottom: 19px; }
.auto-detect { display: flex; gap: 11px; padding: 15px; border-radius: 13px; background: var(--teal-soft); color: var(--teal-dark); }
.auto-detect > span { font-size: 1.2rem; }
.auto-detect div, .switch-row > span { display: grid; }
.auto-detect small, .switch-row small { margin-top: 3px; color: var(--muted); font-size: .68rem; }
.switch-row { display: flex; align-items: flex-start; gap: 11px; margin: 18px 0; cursor: pointer; }
.switch-row input { width: 38px; min-height: 22px; flex: 0 0 auto; margin: 1px 0 0; padding: 0; accent-color: var(--teal); }
.option-note { padding: 13px 0; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: .72rem; }

.filter-bar { display: flex; align-items: end; gap: 11px; margin-bottom: 13px; }
.filter-bar label { width: 230px; display: grid; gap: 6px; }
.table-card { padding: 0; overflow: hidden; }
.pager { min-height: 58px; display: flex; align-items: center; justify-content: flex-end; gap: 13px; padding: 8px 15px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: .72rem; }

.api-key-card { max-width: 900px; }
.api-key-card > header { display: flex; align-items: center; gap: 14px; }
.api-key-card > header > div:nth-child(2) { min-width: 0; flex: 1; }
.api-key-card header small { color: var(--muted); font-size: .62rem; font-weight: 800; letter-spacing: .08em; }
.api-key-card h2 { margin-top: 3px; }
.key-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--teal-soft); color: var(--teal-dark); font-size: 1.4rem; }
.masked-key { display: grid; gap: 7px; margin: 26px 0; }
.masked-key code { min-height: 56px; display: flex; align-items: center; overflow-wrap: anywhere; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; color: var(--navy); font: .93rem Consolas, monospace; letter-spacing: .07em; }
.key-details { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border: solid var(--line-soft); border-width: 1px 0; }
.key-details div { padding: 16px; border-right: 1px solid var(--line-soft); }
.key-details div:last-child { border-right: 0; }
.key-details dt { color: var(--muted); font-size: .68rem; }
.key-details dd { margin: 5px 0 0; color: var(--navy); font-size: .8rem; font-weight: 800; }
.info-note { display: flex; align-items: start; gap: 12px; margin-top: 23px; padding: 15px; border-radius: 13px; background: #eff6fc; color: #405d75; }
.info-note > span { width: 23px; height: 23px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: #fff; font-family: serif; font-weight: 800; }
.info-note p { margin: 0; font-size: .72rem; }

.profile-grid { display: grid; grid-template-columns: minmax(260px, .65fr) minmax(380px, 1.35fr); gap: 15px; max-width: 980px; margin-bottom: 17px; }
.identity-card { align-self: start; display: flex; align-items: center; gap: 16px; }
.avatar--large { width: 68px; height: 68px; font-size: 1.45rem; }
.identity-card h2 { margin: 0; }
.identity-card p { margin: 5px 0 12px; color: var(--muted); }
.password-card > p { margin: 5px 0 20px; color: var(--muted); font-size: .75rem; }
.password-card > .password-required { padding: 11px 13px; border: 1px solid #f7d897; border-radius: 11px; background: var(--warning-soft); color: #8a5208; font-weight: 700; }
.password-card .form-field { max-width: 480px; }

.result-dialog { width: min(1120px, calc(100vw - 32px)); height: min(860px, calc(100dvh - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow: hidden; border: 0; border-radius: 20px; background: #fff; color: var(--ink); box-shadow: 0 28px 100px rgba(15, 34, 52, .3); }
.result-dialog::backdrop { background: rgba(15, 34, 52, .62); backdrop-filter: blur(4px); }
.result-dialog__shell { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.result-dialog__header, .result-dialog__footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 21px; }
.result-dialog__header { border-bottom: 1px solid var(--line-soft); }
.result-dialog h2 { margin: 0; font-size: 1.1rem; }
.result-dialog__header > div > p:last-child { margin: 4px 0 0; color: var(--muted); font-size: .68rem; overflow-wrap: anywhere; }
.result-dialog__footer { justify-content: flex-end; border-top: 1px solid var(--line-soft); }
.dialog-close { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--navy); cursor: pointer; font-size: 1.4rem; }
.result-dialog__body { min-height: 0; overflow: auto; padding: 20px; background: var(--background); overscroll-behavior: contain; }
.result-documents { display: grid; grid-auto-rows: max-content; align-content: start; gap: 14px; }
.result-document { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 8px 25px rgba(15, 34, 52, .04); }
.result-document__summary { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 17px; cursor: pointer; list-style: none; }
.result-document__summary::-webkit-details-marker { display: none; }
.result-document__summary::after { content: "⌄"; order: 3; color: var(--muted); font-size: 1.1rem; transition: transform .15s ease; }
.result-document[open] > .result-document__summary::after { transform: rotate(180deg); }
.result-document__summary-text { min-width: 0; flex: 1; display: grid; }
.result-document__summary-text strong, .result-document__summary-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-document__summary-text strong { color: var(--navy); font-size: .8rem; }
.result-document__summary-text small { margin-top: 3px; color: var(--muted); font-size: .68rem; }
.result-document__content { display: grid; gap: 18px; padding: 20px; border-top: 1px solid var(--line-soft); }
.document-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px; border-radius: 14px; background: var(--navy); color: #fff; }
.document-heading h3 { margin: 3px 0 0; color: #fff; font-size: 1.3rem; overflow-wrap: anywhere; }
.document-heading .eyebrow { color: #75e5d8; }
.confidence-badge { flex: 0 0 auto; padding: 6px 10px; border: 1px solid rgba(117, 229, 216, .32); border-radius: 999px; background: rgba(20, 184, 166, .12); color: #a7f3e9; font-size: .66rem; font-weight: 800; }
.result-section-title { margin: 3px 0 -7px; color: var(--navy); font-size: .88rem; }
.result-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.result-field { min-width: 0; padding: 12px 13px; border: 1px solid var(--line-soft); border-radius: 11px; background: #f8fafc; }
.result-field dt, .party-fields dt { color: var(--muted); font-size: .64rem; }
.result-field dd, .party-fields dd { margin: 4px 0 0; color: var(--navy); font-size: .76rem; font-weight: 750; overflow-wrap: anywhere; }
.party-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.party-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.party-card h5 { margin: 5px 0 12px; color: var(--navy); font-size: .86rem; overflow-wrap: anywhere; }
.party-role { color: var(--teal-dark); font-size: .62rem; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.party-fields { display: grid; gap: 8px; margin: 0; }
.party-fields .result-field { padding: 0; border: 0; background: transparent; }
.result-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.result-table { width: 100%; min-width: 1280px; border-collapse: collapse; background: #fff; font-size: .7rem; }
.result-table th, .result-table td { padding: 10px 11px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.result-table th { background: #f3f7fa; color: var(--muted); font-size: .61rem; letter-spacing: .05em; text-transform: uppercase; }
.result-table td:first-child, .result-table th:first-child { width: 42px; text-align: center; }
.result-table tbody tr:last-child td { border-bottom: 0; }
.result-table--transactions { min-width: 1180px; }
.totals-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.total-card { display: grid; gap: 5px; padding: 12px 13px; border: 1px solid var(--line-soft); border-radius: 11px; background: #f8fafc; }
.total-card small { color: var(--muted); font-size: .64rem; }
.total-card strong { color: var(--navy); font-size: .9rem; overflow-wrap: anywhere; }
.total-card--grand { border-color: #91ddd4; background: var(--teal-soft); }
.total-card--grand strong { color: var(--teal-dark); }
.result-error, .result-empty { margin: 0; padding: 15px; border-radius: 12px; }
.result-error { border: 1px solid #fecaca; background: var(--danger-soft); color: #991b1b; }
.result-empty { background: #f8fafc; color: var(--muted); text-align: center; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; max-width: min(390px, calc(100% - 44px)); padding: 13px 17px; border-left: 4px solid var(--teal); border-radius: 11px; background: var(--navy); color: #fff; box-shadow: 0 18px 55px rgba(15, 34, 52, .28); font-size: .8rem; }

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .quota-card { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 20px; }
  .quota-card .card-heading, .quota-card > .text-link { grid-column: 1 / -1; }
  .quota-ring { grid-column: 2; grid-row: 2 / span 2; }
  .quota-numbers { text-align: left; }
}

@media (max-width: 900px) {
  .app-header { height: 70px; padding: 0 16px; }
  .service-state { display: none; }
  .app-layout { display: block; }
  .sidebar { position: sticky; top: 70px; z-index: 40; width: 100%; height: auto; padding: 8px 12px; overflow-x: auto; }
  .main-nav { display: flex; width: max-content; gap: 4px; }
  .main-nav a { min-height: 40px; display: flex; padding: 6px 10px; }
  .nav-icon { display: none; }
  .sidebar-help, .sidebar-version { display: none; }
  .main-content { padding-top: 24px; }
  .upload-layout { grid-template-columns: 1fr; }
  .upload-options { width: 100%; }
  .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .login-page { display: block; background: var(--background); }
  .login-brand { display: none; }
  .login-form-wrap { min-height: 100vh; padding: 18px; }
  .login-card { padding: 28px 22px; }
  .login-mobile-brand { display: inline-flex; }
  .app-header .brand-lockup small { display: none; }
  .app-header .brand-lockup strong { font-size: .82rem; }
  .app-header .brand-mark { width: 36px; height: 36px; font-size: 1.05rem; }
  .profile-button { min-width: 0; padding-right: 6px; }
  .profile-button > span:nth-child(2), .profile-button > span:last-child { display: none; }
  .page-heading { min-height: 0; align-items: start; flex-direction: column; }
  .page-heading h1 { font-size: 2rem; }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card { min-height: 112px; }
  .card { padding: 18px; border-radius: 16px; }
  .recent-card, .table-card { padding: 0; }
  .quota-card { display: flex; }
  .quota-numbers { text-align: center; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .filter-bar label { width: 100%; }
  .filter-bar .button { width: 100%; }
  .key-details { grid-template-columns: 1fr; }
  .key-details div { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .key-details div:last-child { border-bottom: 0; }
  .pager { justify-content: center; }
  .pager .button { padding-inline: 11px; }
  .drop-zone { min-height: 260px; padding: 25px 15px; }
  .result-dialog { width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; border-radius: 0; }
  .result-dialog__header, .result-dialog__footer { padding: 13px 14px; }
  .result-dialog__footer { align-items: stretch; flex-direction: column; }
  .result-dialog__footer .button { width: 100%; }
  .result-dialog__body { padding: 12px; }
  .result-document__summary { padding: 11px 13px; }
  .result-document__content { padding: 13px; }
  .document-heading { align-items: stretch; flex-direction: column; padding: 15px; }
  .confidence-badge { align-self: flex-start; }
  .result-fields, .party-grid { grid-template-columns: 1fr; }
  .totals-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dialog-close { width: 44px; height: 44px; }
}

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