:root {
  --ink: #0f172a;
  --muted: #475569;
  --green: #1d4ed8;
  --green-dark: #0f172a;
  --lime: #93c5fd;
  --bg: #f3f6fb;
  --line: #dbe3ed;
  --white: #fff;
  --amber: #92400e;
  --radius: 14px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.5; }
button, input, select { font: inherit; }
button, a, input, select { outline-offset: 3px; }
:focus-visible { outline: 3px solid #2563eb; }
button { color: inherit; cursor: pointer; }
a { color: inherit; }
button:disabled { opacity: 1; cursor: not-allowed; color: #526176; background: #e8edf4; border-color: #cbd5e1; box-shadow: none; }
svg { width: 20px; height: 20px; display: block; flex-shrink: 0; }
input[type=checkbox] { accent-color: #1d4ed8; width: 18px; height: 18px; cursor: pointer; flex-shrink: 0; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 272px; background: #0f172a; color: #e2e8f0; padding: 30px 18px 0; display: flex; flex-direction: column; z-index: 5; }
.brand { display: flex; align-items: center; font-size: 34px; font-weight: 700; text-decoration: none; letter-spacing: -1.5px; margin: 0 12px 34px; gap: 12px; color: #fff; }
.brand-icon { width: 38px; height: 38px; background: #3b82f6; border-radius: 10px; color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center; letter-spacing: -4px; padding-right: 4px; font-weight: 750; }
.brand-icon span { color: #fff; }
.brand-dot { color: #93c5fd; margin-left: -12px; }
.workspace-label { font-size: 12px; letter-spacing: 1.3px; font-weight: 650; color: #cbd5e1; margin: 0 12px 12px; }
.company-switch { border: 1px solid #42506a; background: #1c2940; border-radius: 10px; display: flex; text-align: left; align-items: center; gap: 10px; padding: 13px 11px; width: 100%; color: #fff; margin-bottom: 25px; }
.company-switch:hover { background: #243550; }
.company-switch > span:nth-child(2) { min-width: 0; }
.company-avatar { display: grid; place-items: center; background: #304463; color: #fff; width: 36px; height: 36px; border: 1px solid #566d8f; border-radius: 8px; font-size: 13px; font-weight: 650; flex-shrink: 0; }
.company-switch strong { display: block; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.company-switch small { display: block; font-size: 12px; color: #cbd5e1; margin-top: 4px; overflow-wrap: anywhere; }
.chevron { margin-left: auto; color: #cbd5e1; }
nav { display: grid; gap: 8px; }
.nav-item { background: none; border: 1px solid transparent; color: #d3ddea; display: flex; align-items: center; padding: 13px 12px; border-radius: 9px; gap: 11px; text-align: left; font-size: 14px; font-weight: 500; min-height: 48px; }
.nav-item.active { background: #1d4ed8; color: #fff; border-color: #3b6de8; font-weight: 650; }
.nav-item:hover:not(.active) { background: #24324a; color: #fff; }
.nav-item svg { width: 20px; height: 20px; }
.nav-count { margin-left: auto; background: #fff; color: #1e40af; border-radius: 5px; padding: 1px 7px; font-size: 12px; font-weight: 700; }
.sidebar-bottom { margin-top: auto; }
.pilot-note { background: #1c2940; border: 1px solid #3d4c65; padding: 15px 13px 0; border-radius: 10px; margin: 26px 2px 16px; font-size: 13px; }
.pilot-note strong { font-size: 14px; font-weight: 650; color: #fff; }
.live-dot { display: inline-block; height: 7px; width: 7px; background: #93c5fd; border-radius: 50%; margin-right: 7px; }
.pilot-note p { color: #d1dbea; font-size: 13px; line-height: 1.6; margin: 10px 0 13px; }
.pilot-note button { background: none; border: 0; border-top: 1px solid #42516a; color: #fff; width: 100%; text-align: left; font-size: 13px; padding: 13px 0; }
.pilot-note button span { float: right; }
.account { display: flex; align-items: center; gap: 10px; background: none; border: 0; border-top: 1px solid #3a4960; width: 100%; padding: 18px 6px; color: #fff; text-align: left; }
.account > span:nth-child(2) { min-width: 0; }
.account > span:last-child { margin-left: auto; color: #cbd5e1; }
.avatar, .top-avatar { background: #dbeafe; color: #1e40af; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.account strong { font-size: 14px; font-weight: 650; display: block; }
.account small { font-size: 12px; color: #cbd5e1; display: block; margin-top: 4px; overflow-wrap: anywhere; }
.app-shell { margin-left: 272px; min-width: 0; }
.topbar { min-height: 76px; border-bottom: 1px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 14px 36px; gap: 16px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 12px; font-size: 14px; color: #526176; }
.breadcrumb strong { font-weight: 600; color: #0f172a; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.demo-badge { display: flex; align-items: center; gap: 7px; background: #eff6ff; color: #1e40af; padding: 7px 10px; border: 1px solid #bfdbfe; border-radius: 6px; font-size: 12px; letter-spacing: .6px; font-weight: 700; white-space: nowrap; }
.demo-badge span { width: 6px; height: 6px; background: #1d4ed8; border-radius: 50%; }
.icon-button { display: grid; place-items: center; background: none; border: 0; border-radius: 7px; padding: 8px; color: #475569; min-width: 36px; min-height: 36px; }
.icon-button:hover { background: #eaf0f8; color: #1d4ed8; }
.icon-button svg { width: 20px; height: 20px; }
.top-avatar { border: 1px solid #bfdbfe; min-width: 36px; min-height: 36px; }
main { max-width: 1640px; margin: auto; padding: 36px 36px 20px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 22px; margin-bottom: 26px; }
.page-heading > div { min-width: 0; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 1.3px; color: #475569; margin-bottom: 10px; }
h1 { font-size: clamp(28px, 2.5vw, 36px); letter-spacing: -1.2px; font-weight: 700; line-height: 1.2; margin: 0 0 12px; }
h1 > span { color: #2563eb; }
.page-heading p { font-size: 15px; color: #475569; margin: 0; line-height: 1.6; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 1px solid #8293ab; border-radius: 8px; padding: 10px 15px; background: #fff; color: #334155; font-size: 14px; white-space: nowrap; font-weight: 650; min-height: 44px; text-decoration: none; }
.button svg { width: 18px; height: 18px; }
.button.primary { background: #1d4ed8; color: #fff; border-color: #1d4ed8; box-shadow: 0 2px 4px #1d4ed815; }
.button.primary:hover:not(:disabled) { background: #1e40af; border-color: #1e40af; }
.button.subtle { background: #fff; color: #334155; }
.button.subtle:hover:not(:disabled) { background: #f1f5f9; border-color: #94a3b8; }
.button:disabled { background: #e8edf4; color: #526176; border-color: #cbd5e1; box-shadow: none; }
.info-banner { border: 1px solid #bfdbfe; background: #eff6ff; display: flex; align-items: center; gap: 13px; padding: 16px 18px; border-radius: 10px; font-size: 14px; line-height: 1.6; color: #334155; margin-bottom: 26px; }
.info-banner strong { color: #1e3a8a; font-weight: 700; }
.banner-symbol { color: #1d4ed8; font-size: 26px; line-height: 1; flex-shrink: 0; }
.info-banner > button { background: none; border: 0; color: #334155; margin-left: auto; font-size: 24px; padding: 4px 8px; min-width: 32px; min-height: 36px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat { container-type: inline-size; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px; min-height: 150px; box-shadow: 0 2px 5px #0f172a04; min-width: 0; }
.stat-label { font-size: 14px; color: #475569; font-weight: 550; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; line-height: 1.4; min-height: 40px; }
.stat-label svg { width: 18px; height: 18px; color: #526176; }
.stat-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px; font-size: 34px; letter-spacing: -1px; font-weight: 700; margin: 14px 0 10px; line-height: 1.2; min-height: 41px; overflow-wrap: anywhere; }
#stat-total { font-size: clamp(18px, 13cqi, 32px); white-space: nowrap; overflow-wrap: normal; }
.stat-unit { font-size: 13px; color: #475569; letter-spacing: 0; font-weight: 500; }
.stat-foot { font-size: 13px; color: #526176; display: flex; gap: 6px; align-items: center; line-height: 1.5; }
.tiny-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; vertical-align: middle; flex-shrink: 0; }
.tiny-dot.green { background: #047857; }
.tiny-dot.amber { background: #b45309; }
.documents-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: 0 3px 8px #0f172a04; }
.card-heading { padding: 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.card-heading h2 { font-size: 20px; font-weight: 650; letter-spacing: -.4px; margin: 0 0 8px; display: flex; align-items: center; gap: 10px; }
.card-heading h2 > span { background: #eef2f7; border: 1px solid #dbe3ed; color: #334155; font-size: 13px; letter-spacing: 0; padding: 2px 7px; border-radius: 5px; }
.card-heading p { margin: 0; color: #475569; font-size: 14px; line-height: 1.5; }
.tab-bar { display: flex; gap: 25px; border-bottom: 1px solid var(--line); padding: 0 24px; overflow-x: auto; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 15px 0; color: #475569; font-size: 14px; display: flex; align-items: center; gap: 8px; margin-bottom: -1px; white-space: nowrap; min-height: 48px; }
.tab.active { color: #1d4ed8; border-bottom-color: #1d4ed8; font-weight: 700; }
.tab > span { font-size: 12px; padding: 2px 6px; border-radius: 5px; background: #eef2f7; color: #475569; font-weight: 600; }
.tab.active > span { background: #dbeafe; color: #1e40af; }
.filter-bar { padding: 20px 24px; display: flex; flex-wrap: wrap; gap: 12px; border-bottom: 1px solid var(--line); }
.search-field { display: flex; align-items: center; border: 1px solid #7b8da7; background: #fff; border-radius: 8px; padding: 0 12px; gap: 8px; flex: 1 1 220px; min-width: 0; }
.search-field:focus-within, .date-filter:focus-within { outline: 3px solid #2563eb; outline-offset: 2px; }
.search-field svg { width: 18px; height: 18px; color: #526176; }
.search-field input { background: none; border: 0; outline: none; font-size: 14px; width: 100%; min-width: 0; min-height: 44px; color: #0f172a; }
.search-field input::placeholder { color: #526176; opacity: 1; }
.keyboard-hint { display: none; }
.date-filter { display: flex; align-items: center; gap: 9px; font-size: 14px; color: #475569; border: 1px solid #7b8da7; border-radius: 8px; padding: 0 12px; max-width: 100%; }
.date-filter svg { width: 18px; height: 18px; }
.date-filter input { border: 0; background: none; font-size: 14px; color: #334155; min-width: 0; min-height: 44px; width: 130px; outline: none; }
.selection-bar { padding: 13px 24px; background: #f8fafc; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.selection-bar > label { display: flex; align-items: center; gap: 9px; font-size: 14px; color: #334155; }
.selection-bar > div { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.selection-bar select { border: 1px solid #8293ab; border-radius: 7px; padding: 9px; background: #fff; color: #334155; font-size: 14px; max-width: 240px; min-height: 42px; }
.export-button { background: #eaf1ff; border-color: #b7caf8; color: #1e40af; font-size: 14px; }
.export-button:hover:not(:disabled) { background: #dbeafe; }
#selected-count:not(:empty) { background: #fff; color: #1e40af; border-radius: 4px; padding: 1px 5px; }
.table-scroll { overflow: auto; position: relative; }
.table-scroll:has(.empty-state) table { min-width: 0; }
.table-scroll:has(.empty-state) thead { display: none; }
table { width: 100%; min-width: 990px; border-collapse: collapse; text-align: left; white-space: nowrap; }
thead { background: #f1f5f9; }
th { font-size: 12px; color: #475569; letter-spacing: .5px; font-weight: 700; padding: 14px 12px; border-bottom: 1px solid var(--line); }
th.check-col { width: 48px; padding-left: 24px; }
th:last-child { padding-right: 24px; }
td { padding: 17px 12px; border-bottom: 1px solid #e5ebf3; font-size: 14px; color: #334155; }
tr:last-child td { border-bottom: 0; }
td:first-child { padding-left: 24px; width: 48px; }
td:last-child { padding-right: 24px; }
tbody tr:hover { background: #f8fafc; }
.doc-cell { display: flex; align-items: center; gap: 11px; }
.file-symbol { width: 34px; height: 38px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 7px; display: grid; place-items: center; color: #1d4ed8; flex-shrink: 0; }
.file-symbol.service { background: #f5f3ff; border-color: #ddd6fe; color: #6d28d9; }
.file-symbol svg { width: 19px; height: 19px; }
.doc-cell strong { font-size: 14px; font-weight: 650; color: #0f172a; }
.doc-cell small { display: block; font-size: 13px; color: #526176; margin-top: 4px; }
.issuer-cell { max-width: 250px; overflow: hidden; text-overflow: ellipsis; }
.issuer-cell strong { font-size: 14px; font-weight: 550; color: #334155; }
.issuer-cell small { display: block; font-size: 13px; color: #526176; margin-top: 4px; }
.date-cell { font-size: 14px; color: #475569; }
.align-right { text-align: right; }
.amount { font-size: 14px; color: #0f172a; font-weight: 650; font-variant-numeric: tabular-nums; }
.status-pill { padding: 5px 8px; background: #ecfdf5; border: 1px solid #a7d9c2; border-radius: 6px; color: #065f46; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.status-pill.summary { background: #fffbeb; border-color: #ecd49f; color: #854d0e; }
.status-pill svg { width: 14px; height: 14px; }
.detail-button { background: none; border: 0; border-radius: 6px; color: #475569; font-size: 24px; padding: 2px 8px; min-width: 32px; min-height: 32px; vertical-align: middle; }
.detail-button:hover { background: #eaf1ff; color: #1d4ed8; }
.document-actions { white-space: nowrap; }
.document-actions .detail-button { margin-left: 4px; }
.view-note { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; min-width: 32px; min-height: 32px; padding: 7px; border: 0; border-radius: 6px; background: transparent; color: #1d4ed8; text-decoration: none; vertical-align: middle; }
.view-note svg { width: 18px; height: 18px; }
.view-note:hover, .view-note:focus-visible { background: #dbeafe; color: #1e40af; }
.view-note:disabled, .view-note:disabled:hover { background: transparent; color: #64748b; }
.table-footer { border-top: 1px solid var(--line); padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; color: #526176; font-size: 13px; gap: 12px; flex-wrap: wrap; }
.table-footer > span:last-child { display: flex; align-items: center; gap: 6px; }
.page-footer { display: flex; align-items: flex-start; gap: 8px; color: #526176; font-size: 13px; padding: 22px 0 12px; line-height: 1.6; }
.page-footer svg { height: 16px; width: 16px; margin-top: 2px; }
.footer-brand { margin-left: auto; color: #526176; font-size: 13px; white-space: nowrap; }
.companies-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.company-card, .coverage-card, .activity-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 26px; min-width: 0; }
.company-card .company-avatar { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; width: 46px; height: 46px; font-size: 16px; margin-bottom: 18px; }
.company-card h2 { font-size: 21px; font-weight: 650; margin: 0 0 8px; letter-spacing: -.5px; overflow-wrap: anywhere; }
.company-card p { font-size: 15px; color: #475569; }
.company-card .button { margin-top: 16px; white-space: normal; }
.company-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 20px; font-size: 14px; color: #475569; }
.coverage-card { display: flex; gap: 20px; margin-top: 24px; }
.coverage-icon { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; border-radius: 10px; padding: 14px; align-self: flex-start; }
.coverage-card h2 { font-size: 18px; font-weight: 650; margin: 0 0 12px; }
.coverage-card p { font-size: 14px; color: #475569; line-height: 1.8; margin: 0; max-width: 760px; }
.coverage-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.coverage-tags span { font-size: 12px; border: 1px solid #d2ddeb; background: #f8fafc; border-radius: 6px; padding: 7px 10px; color: #334155; }
.activity-row { display: flex; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line); align-items: center; }
.activity-row:last-child { border: 0; }
.activity-row:first-child { padding-top: 0; }
.activity-row > div { min-width: 0; }
.activity-row .file-symbol { width: 38px; height: 38px; }
.activity-row strong { font-size: 15px; font-weight: 650; display: block; margin-bottom: 6px; }
.activity-row small { font-size: 13px; color: #475569; overflow-wrap: anywhere; }
.activity-row time { margin-left: auto; font-size: 13px; color: #475569; white-space: nowrap; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
dialog { border: 1px solid #cbd5e1; box-shadow: 0 24px 90px #0f172a40; border-radius: 16px; padding: 28px; width: min(580px, 94vw); max-height: 92vh; max-height: 92dvh; color: #0f172a; background: #fff; }
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: #0f172a80; backdrop-filter: blur(2px); }
.modal-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 18px; flex-shrink: 0; }
.modal-top .icon-button { font-size: 27px; padding: 0; }
.modal-kicker { font-size: 12px; letter-spacing: 1.1px; color: #475569; font-weight: 700; }
#modal-content { overflow: auto; padding: 3px 6px 3px 3px; margin: -3px -6px -3px -3px; scrollbar-gutter: stable; }
dialog h2 { font-size: 28px; letter-spacing: -.8px; line-height: 1.25; font-weight: 700; margin: 0 0 14px; }
dialog p { font-size: 15px; color: #475569; line-height: 1.65; }
dialog .field { display: flex; flex-direction: column; gap: 7px; margin: 18px 0; font-size: 14px; font-weight: 600; color: #334155; min-width: 0; }
dialog input:not([type=checkbox]), dialog select { border: 1px solid #7b8da7; border-radius: 8px; padding: 11px 12px; background: #fff; color: #0f172a; font-size: 16px; width: 100%; min-height: 46px; }
dialog input::placeholder { color: #526176; opacity: 1; }
dialog input[readonly] { background: #f1f5f9; color: #334155; }
dialog input[type=file] { padding: 9px; font-size: 14px; font-weight: 400; }
dialog input[type=file]::file-selector-button { font: inherit; font-size: 13px; background: #eaf1ff; border: 1px solid #b7caf8; border-radius: 5px; color: #1e40af; padding: 7px; margin-right: 8px; cursor: pointer; }
dialog .button { font-size: 15px; padding: 12px 16px; min-height: 46px; }
dialog form > button[type=submit] { position: sticky; bottom: 0; z-index: 1; box-shadow: 0 -8px 12px #fff; }
dialog .wide { width: 100%; margin-top: 16px; white-space: normal; }
#company-form { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); column-gap: 16px; row-gap: 14px; }
#company-form .field { margin: 0; }
#company-form > :first-child, #company-form > :nth-child(n+4) { grid-column: 1 / -1; }
#company-form .modal-note, #company-form .wide { margin: 0; }
#connect-progress { margin: 0; font-size: 14px; color: #1e40af; }
#connect-progress:empty { display: none; }
.modal-note { border: 1px solid #c7d9f2; background: #eff6ff; border-radius: 9px; padding: 14px; font-size: 14px; color: #334155; line-height: 1.6; margin: 18px 0; overflow-wrap: anywhere; }
.modal-note strong { color: #0f172a; font-weight: 700; }
.modal-note.warning { border-color: #e5c887; background: #fffbeb; color: #854d0e; }
.format-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 22px 0; }
.format-choice { border: 1px solid #8293ab; border-radius: 9px; padding: 16px 8px; background: #fff; color: #334155; display: grid; gap: 8px; text-align: center; font-size: 15px; font-weight: 650; }
.format-choice small { font-size: 12px; color: #475569; font-weight: 400; }
.format-choice.active { border-color: #1d4ed8; background: #eff6ff; box-shadow: 0 0 0 1px #1d4ed8; color: #1e40af; }
.modal-links { display: flex; justify-content: center; gap: 9px; margin-top: 20px; font-size: 14px; color: #475569; }
.text-button { border: 0; background: none; color: #1d4ed8; font: inherit; font-weight: 650; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 24px 0; }
.detail-grid small { display: block; color: #475569; font-size: 12px; font-weight: 600; margin-bottom: 7px; }
.detail-grid strong { font-size: 15px; font-weight: 650; }
.access-key { font-size: 14px; line-height: 1.7; word-break: break-all; background: #f1f5f9; border: 1px solid var(--line); border-radius: 8px; padding: 14px; color: #334155; }
.empty-state { text-align: center; padding: 56px 20px; color: #526176; white-space: normal; }
.empty-state h3 { font-size: 20px; font-weight: 650; color: #334155; margin: 16px 0 10px; }
.empty-state p { font-size: 14px; margin: 0; line-height: 1.6; }
.empty-state svg { margin: auto; width: 34px; height: 34px; color: #526176; }
#toast { position: fixed; bottom: 24px; left: calc(50% + 136px); transform: translateX(-50%) translateY(130px); opacity: 0; background: #0f172a; color: #fff; box-shadow: 0 5px 25px #0f172a25; border: 1px solid #475569; border-radius: 10px; padding: 16px 22px; max-width: min(600px, 90vw); z-index: 100; font-size: 14px; line-height: 1.6; transition: .2s; pointer-events: none; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-heading { align-items: flex-start; flex-wrap: wrap; }
  .stat { min-height: 145px; }
}
@media (max-width: 1120px) {
  .sidebar { width: 250px; padding-left: 14px; padding-right: 14px; }
  .app-shell { margin-left: 250px; }
  .topbar { padding-left: 26px; padding-right: 26px; }
  main { padding: 30px 26px 20px; }
  .nav-item { font-size: 13px; gap: 9px; }
  .companies-grid { grid-template-columns: 1fr; }
  .date-filter { flex: 1 1 auto; justify-content: space-between; }
  .date-filter input { width: 128px; }
}
@media (max-width: 850px) {
  .sidebar { inset: auto 0 0; width: 100%; padding: 8px 8px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid #334155; background: #0f172a; }
  .brand, .workspace-label, .company-switch, .sidebar-bottom { display: none; }
  .sidebar nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .nav-item { display: flex; flex-direction: column; justify-content: center; text-align: center; gap: 5px; font-size: 13px; line-height: 1.3; min-height: 60px; padding: 8px 3px; border-radius: 8px; }
  .nav-item svg { width: 20px; height: 20px; }
  .nav-count { display: none; }
  .app-shell { margin-left: 0; padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  .topbar { min-height: 68px; padding: 14px 22px; }
  .topbar-right { gap: 12px; }
  main { padding: 28px 22px 18px; }
  .page-heading { align-items: flex-start; }
  h1 { font-size: 31px; }
  #toast { left: 50%; bottom: 112px; }
  .footer-brand { display: none; }
}
@media (max-width: 560px) {
  .topbar { padding: 12px 16px; gap: 10px; }
  .breadcrumb { font-size: 13px; gap: 7px; }
  .topbar-right { gap: 8px; }
  .topbar #help-button { display: none; }
  .demo-badge { font-size: 11px; padding: 6px 8px; letter-spacing: .3px; }
  main { padding: 25px 16px 16px; }
  .eyebrow { font-size: 11px; letter-spacing: 1.1px; }
  h1 { font-size: 30px; }
  .page-heading { gap: 18px; }
  .page-heading p { font-size: 15px; }
  .page-heading > .button { width: 100%; }
  .info-banner { align-items: flex-start; padding: 14px; font-size: 14px; gap: 10px; }
  .banner-symbol { font-size: 22px; margin-top: 3px; }
  .info-banner > button { margin-right: -8px; }
  .stats-grid { gap: 12px; }
  .stat { padding: 16px; min-height: 158px; }
  .stat-label { font-size: 13px; }
  .stat-label svg { display: none; }
  .stat-value { font-size: 30px; }
  .stat-foot { font-size: 12px; }
  .stat-unit { font-size: 12px; }
  .card-heading { padding: 20px 16px; flex-wrap: wrap; gap: 14px; }
  .card-heading h2 { font-size: 20px; }
  .card-heading p { font-size: 14px; }
  .tab-bar { gap: 20px; padding: 0 16px; }
  .tab { font-size: 14px; }
  .filter-bar { padding: 16px; }
  .search-field { flex-basis: 100%; }
  .search-field input { font-size: 16px; }
  .date-filter { flex-basis: 100%; width: 100%; padding: 0 9px; gap: 5px; }
  .date-filter svg { display: none; }
  .date-filter input { width: 43%; font-size: 14px; }
  .selection-bar { padding: 14px 16px; }
  .selection-bar > div { width: 100%; justify-content: space-between; gap: 10px; }
  .selection-bar select { width: 100%; max-width: none; }
  .export-button { width: 100%; }
  .table-footer { padding: 16px; font-size: 13px; }
  .page-footer { font-size: 13px; }
  .company-card, .activity-card, .coverage-card { padding: 20px; }
  .coverage-card { display: block; }
  .coverage-icon { display: inline-block; margin-bottom: 16px; }
  .activity-row { flex-wrap: wrap; gap: 12px; }
  .activity-row > div { flex: 1; }
  .activity-row time { margin-left: 50px; white-space: normal; }
  dialog { padding: 20px; width: 94vw; max-width: none; border-radius: 13px; }
  dialog h2 { font-size: 26px; }
  .modal-kicker { font-size: 11px; letter-spacing: .8px; }
  .modal-top { margin-bottom: 14px; }
  #company-form { grid-template-columns: 1fr; row-gap: 16px; }
  #company-form > * { grid-column: 1; }
  .format-options { gap: 7px; }
  .format-choice { padding: 14px 6px; font-size: 14px; }
  .detail-grid { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.sync-status-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.sync-status-item { min-width: 0; border: 1px solid #bfdbfe; border-radius: 10px; background: #fff; padding: 18px; display: flex; flex-direction: column; align-items: flex-start; }
.sync-status-heading { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; width: 100%; }
.sync-status-heading strong { font-size: 15px; color: #0f172a; }
.sync-status-heading span { font-size: 12px; font-weight: 650; color: #1e40af; background: #eff6ff; padding: 4px 7px; border-radius: 5px; }
.sync-status-item p { font-size: 14px; line-height: 1.6; color: #334155; margin: 12px 0; }
.sync-status-item small { font-size: 13px; color: #475569; line-height: 1.6; margin-bottom: 12px; }
.sync-status-item .button { margin-top: auto; }
.sync-error { border-color: #e5c887; }
.sync-error .sync-status-heading span { color: #854d0e; background: #fffbeb; }
#sync-progress { font-size: 14px; line-height: 1.7; color: #1e40af; }
#stop-search { white-space: normal; }
@media (max-width: 700px) { .sync-status-panel { grid-template-columns: 1fr; } }

.company-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.company-actions .button { flex: 1 1 170px; margin-top: 0; }
.certificate-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; color: #065f46; background: #ecfdf5; border: 1px solid #a7d9c2; border-radius: 6px; padding: 6px 9px; }
.certificate-badge.certificate-warning { color: #854d0e; background: #fffbeb; border-color: #e5c887; }
.delete-certificate { display: inline-block; margin-top: 18px; color: #b91c1c; }
.button.danger { background: #b91c1c; color: #fff; border-color: #b91c1c; }
.button.danger:hover:not(:disabled) { background: #991b1b; }
#certificate-progress { font-size: 14px; line-height: 1.6; color: #b91c1c; }

/* ConsultaNF: compact workspace and consistent alignment */
:root { --bg:#f6f7f9; --line:#e2e5eb; --radius:8px; }
.sidebar { width:232px; padding:24px 14px 0; }
.brand { font-size:23px; letter-spacing:-.7px; gap:9px; margin:0 10px 28px; }
.brand-icon { width:30px; height:32px; border-radius:6px; font-size:20px; letter-spacing:0; padding:0; background:#2563eb; }
.app-shell { margin-left:232px; }
.topbar { min-height:60px; padding:10px 28px; }
main { padding:28px; max-width:1600px; }
.eyebrow,.pilot-note,.info-banner,.stats-grid,.coverage-card,.footer-brand { display:none!important; }
.page-heading { margin-bottom:22px; gap:16px; }
h1 { font-size:26px; letter-spacing:-.6px; margin-bottom:6px; }
.page-heading p { font-size:14px; }
.button { min-height:38px; padding:8px 12px; border-radius:6px; font-weight:600; }
.nav-item { min-height:42px; padding:10px; border-radius:6px; }
.company-switch { padding:11px 9px; border-radius:6px; margin-bottom:20px; }
.documents-card { border-radius:8px; box-shadow:none; }
.card-heading { padding:18px 20px; }
.card-heading h2 { font-size:17px; }
.filter-bar,.selection-bar { padding:14px 20px; gap:12px; }
.filter-bar { flex-wrap:wrap; }
.search-field { flex:1 1 260px; min-width:200px; }
.date-filter { flex:0 1 auto; }
input,select { font-size:14px; }
th { font-size:11px; letter-spacing:.4px; }
td { padding-top:14px; padding-bottom:14px; font-size:14px; }
.company-card { padding:20px; border-radius:8px; }
.company-card h2 { font-size:18px; }
.company-actions { flex-wrap:wrap; gap:8px; }
.sync-status-panel { margin-bottom:18px; }
.page-footer { font-size:12px; margin-top:16px; }
@media(max-width:1050px) { .filter-bar { align-items:stretch; } .date-filter { flex-wrap:wrap; } }
@media(max-width:760px) { .sidebar { width:100%; padding:16px; } .app-shell { margin-left:0; } main { padding:20px 16px; } .brand { margin-bottom:16px; } .topbar { padding:12px 16px; } h1 { font-size:24px; } .page-heading { align-items:flex-start; flex-wrap:wrap; } .selection-bar { flex-wrap:wrap; } }

.brand-mark { width:38px; height:38px; flex-shrink:0; }
.brand-word { font-size:22px; font-weight:600; letter-spacing:-.8px; }
.brand-word > span { color:#93c5fd; font-weight:800; }

/* Account and access */
#environment-badge { display:none!important; }
.auth-dialog { width:min(440px,94vw); padding:32px; border:0; border-radius:12px; }
.auth-dialog .modal-top { margin-bottom:28px; }
.auth-dialog .modal-kicker { text-transform:none; font-size:19px; letter-spacing:-.5px; color:#16335b; }
.auth-dialog h2 { font-size:25px; letter-spacing:-.6px; margin-bottom:8px; }
.auth-dialog #modal-content > p { margin:0 0 24px; font-size:14px; }
.auth-dialog .field { margin:16px 0; font-size:13px; }
.auth-dialog input:not([type=checkbox]) { border-color:#cbd5e1; border-radius:6px; font-size:15px; min-height:44px; }
.auth-dialog .modal-links { border-top:1px solid #e2e8f0; padding-top:20px; margin-top:24px; text-align:center; font-size:14px; }
.auth-dialog .text-button { margin-left:6px; }
.account-dialog { width:min(560px,94vw); padding:28px; border-radius:12px; }
.account-dialog h2 { font-size:24px; }
.account-profile { display:flex; align-items:center; gap:14px; padding:12px 0 24px; }
.profile-monogram { display:grid; place-items:center; width:48px; height:48px; border-radius:50%; background:#eaf0ff; color:#234bb0; font-size:20px; font-weight:650; }
.account-profile strong,.account-profile span:not(.profile-monogram) { display:block; }
.account-profile div > span { color:#64748b; font-size:14px; margin-top:4px; }
.account-section { border-top:1px solid #e2e8f0; padding-top:20px; }
.account-section h3 { font-size:14px; margin:0 0 12px; }
.account-section h3 > span { color:#64748b; margin-left:6px; }
.account-company { display:flex; gap:12px; align-items:center; padding:12px 0; border-bottom:1px solid #f1f5f9; }
.account-company > span { color:#64748b; }
.account-company strong { display:block; font-size:14px; }
.account-company small { display:block; color:#64748b; margin-top:3px; }
.account-session { display:flex; gap:12px; justify-content:space-between; align-items:center; border-top:1px solid #e2e8f0; margin-top:24px; padding-top:18px; font-size:12px; color:#64748b; }
.companies-grid { grid-template-columns:1fr; gap:14px; }
.company-card { display:grid; grid-template-columns:44px 1fr; column-gap:16px; padding:22px; }
.company-card .company-avatar { grid-column:1; grid-row:1 / 3; width:40px; height:40px; margin:0; font-size:14px; }
.company-card h2 { grid-column:2; font-size:16px; margin:0; letter-spacing:0; }
.company-card p { grid-column:2; margin:4px 0 0; font-size:13px; }
.company-card .company-meta { grid-column:1 / -1; margin-top:18px; padding-top:16px; align-items:center; font-size:13px; }
.company-card > .choose-card { grid-column:1 / -1; justify-self:start; }
.company-actions { grid-column:1 / -1; display:flex; gap:8px; }
.company-card .delete-certificate { grid-column:1 / -1; justify-self:start; margin-top:14px; }
@media(min-width:1100px) { .companies-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:500px) { .auth-dialog { padding:24px; } .account-session { align-items:flex-start; flex-direction:column; } }

/* Primary navigation: one horizontal workspace bar */
.app-shell { margin-left:0; }
.topbar { min-height:76px; padding:14px 32px; gap:28px; flex-wrap:wrap; }
.topbar .brand { margin:0; color:#16335b; gap:8px; flex-shrink:0; }
.topbar .brand-word > span { color:#2563eb; }
.topbar .brand-mark { background:#16335b; border-radius:6px; padding:3px; }
.topbar .company-switch { width:240px; margin:0; padding:7px 10px; background:#fff; border-color:#dbe1e9; color:#16335b; border-radius:6px; }
.topbar .company-switch strong { font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.topbar .company-switch small { color:#64748b; font-size:11px; margin-top:1px; }
.topbar .company-avatar { width:30px; height:30px; background:#eef2f8; color:#334155; border-color:#e2e8f0; font-size:11px; }
.topbar .chevron { color:#64748b; }
.topbar nav { display:flex; gap:8px; align-self:stretch; align-items:center; }
.topbar .nav-item { color:#526176; font-size:14px; padding:9px 12px; min-height:38px; gap:7px; }
.topbar .nav-item.active { background:#eff4ff; border-color:transparent; color:#1d4ed8; }
.topbar .nav-item:hover:not(.active) { background:#f1f5f9; color:#16335b; }
.topbar .nav-item svg { width:17px; height:17px; }
.topbar .nav-count { display:none; }
.topbar-right { margin-left:auto; gap:12px; }
main { max-width:1520px; padding:30px 32px; }
@media(max-width:1000px) { .topbar { gap:16px; padding:14px 20px; } .topbar .company-switch { width:210px; } .topbar .nav-item { padding:9px 8px; } }
@media(max-width:760px) { .topbar { gap:12px; padding:14px 16px 0; } .topbar .brand-word { font-size:20px; } .topbar .brand-mark { width:32px; height:32px; } .topbar .company-switch { order:3; width:100%; } .topbar nav { order:4; width:100%; border-top:1px solid #e2e8f0; padding:8px 0; gap:8px; } .topbar .nav-item { flex:1; justify-content:center; } .topbar-right { margin-left:auto; } main { padding:22px 16px; } }

/* Roomier content gutters and sortable column controls */
main { padding-left:48px; padding-right:48px; }
.topbar { padding-left:48px; padding-right:48px; }
.sort-column { display:inline-flex; align-items:center; gap:7px; padding:4px 0; border:0; background:transparent; color:inherit; font:inherit; font-weight:inherit; letter-spacing:inherit; text-align:inherit; white-space:nowrap; }
.sort-column span { color:#64748b; font-size:14px; }
th[aria-sort=ascending] .sort-column,th[aria-sort=descending] .sort-column { color:#1d4ed8; }
.sort-column:hover { color:#1d4ed8; }
@media(max-width:1000px) { main,.topbar { padding-left:28px; padding-right:28px; } }
@media(max-width:600px) { main,.topbar { padding-left:20px; padding-right:20px; } }

main { max-width:1600px; padding-left:72px; padding-right:72px; }
.topbar { padding-left:72px; padding-right:72px; }
.topbar-right { position:relative; }
.user-menu { position:absolute; right:0; top:calc(100% + 12px); width:260px; z-index:30; border:1px solid #e2e8f0; border-radius:9px; background:white; padding:6px; box-shadow:0 12px 32px #0f172a1c; }
.user-menu-identity { padding:10px 10px 14px; margin-bottom:4px; border-bottom:1px solid #e2e8f0; }
.user-menu strong,.user-menu small { display:block; overflow-wrap:anywhere; }
.user-menu strong { font-size:14px; }
.user-menu small { font-size:12px; color:#64748b; margin-top:3px; }
.user-menu > button { width:100%; border:0; background:none; text-align:left; padding:10px; border-radius:5px; font-size:14px; }
.user-menu > button:hover { background:#f1f5f9; }
.document-tools { display:flex; flex-direction:column; gap:10px; align-items:stretch; min-width:240px; }
.document-tools .company-switch { width:100%; margin:0; background:white; border-color:#dbe1e9; color:#16335b; padding:8px 10px; }
.document-tools .company-switch small,.document-tools .chevron { color:#64748b; }
.document-tools .company-avatar { width:30px; height:30px; background:#eef2f8; color:#334155; border-color:#e2e8f0; font-size:11px; }
.document-tools .company-switch strong { font-size:13px; }
.document-tools .company-switch small { font-size:11px; margin-top:1px; }
.sync-status-panel { display:flex; flex-direction:column; gap:8px; }
.sync-status-item { flex-direction:row; align-items:center; justify-content:space-between; gap:16px; border-radius:6px; padding:10px 14px; font-size:13px; background:#fffdf7; border-color:#e9dfbf; }
.sync-status-item .text-button { margin:0; white-space:nowrap; font-size:13px; }
@media(max-width:1000px) { main,.topbar { padding-left:36px; padding-right:36px; } }
@media(max-width:600px) { main,.topbar { padding-left:22px; padding-right:22px; } .document-tools { width:100%; } .sync-status-item { align-items:flex-start; } }

/* One-line period toolbar, with comfortable touch targets */
.filter-bar { align-items:center; gap:10px; }
.filter-bar .search-field { flex:1 1 220px; min-width:180px; }
.period-controls { display:flex; align-items:center; gap:10px; flex:0 1 auto; min-width:0; }
.period-controls .date-filter { flex:none; width:auto; padding:0 10px; gap:6px; border:1px solid #cbd5e1; border-radius:6px; background:#fff; }
.period-controls .date-filter input { width:119px; min-height:40px; font-size:13px; }
.period-controls .date-filter svg { width:16px; height:16px; color:#64748b; }
.period-shortcuts { display:flex; align-items:center; gap:5px; }
.period-button { border:1px solid #dbe1e9; border-radius:5px; background:#fff; padding:8px 9px; font-size:12px; font-weight:550; white-space:nowrap; min-height:36px; color:#475569; }
.period-button:hover { background:#f1f5f9; border-color:#94a3b8; }
.period-button[aria-pressed=true] { background:#eff4ff; border-color:#a9c1fa; color:#1d4ed8; }
@media(max-width:1200px) { .period-controls { flex-wrap:wrap; } .filter-bar .search-field { flex-basis:220px; } }
@media(max-width:760px) { .filter-bar .search-field { flex-basis:100%; } .period-controls { flex:1 1 100%; } .period-controls .date-filter { flex:1 1 280px; justify-content:space-between; } .period-controls .date-filter input { width:43%; } .period-shortcuts { flex-wrap:wrap; } }

/* Navy header with centered current company */
.topbar { position:relative; background:#0f172a; border-bottom-color:#26334b; color:#e2e8f0; min-height:78px; }
.topbar .brand { color:#fff; }
.topbar .brand-word > span { color:#93c5fd; }
.topbar .brand-mark { background:#1c2940; }
.topbar .nav-item { color:#cbd5e1; }
.topbar .nav-item.active { background:#243550; color:#fff; }
.topbar .nav-item:hover:not(.active) { background:#243550; color:#fff; }
.topbar > .company-switch { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:240px; background:#1c2940; color:white; border-color:#42506a; }
.topbar .company-switch small,.topbar .chevron { color:#cbd5e1; }
.topbar .company-avatar { background:#304463; color:white; border-color:#566d8f; }
.topbar .icon-button { color:#cbd5e1; }
.topbar .icon-button:hover { background:#243550; color:white; }
.user-menu { color:#0f172a; }
#status-filter { display:none!important; }
@media(max-width:1000px) { .topbar > .company-switch { width:210px; } }
@media(max-width:760px) { .topbar { padding-bottom:14px; } .topbar > .company-switch { position:static; transform:none; order:3; width:100%; max-width:340px; margin:0 auto; } .topbar nav { order:4; border-color:#334155; } }

.tab-bar { overflow:visible; flex-wrap:wrap; gap:8px 24px; }
.tab-bar .tab { white-space:nowrap; }
.topbar .company-picker { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:240px; z-index:20; }
.topbar .company-picker .company-switch { position:static; transform:none; width:100%; margin:0; background:#1c2940; color:white; border-color:#42506a; }
.company-menu { position:absolute; top:calc(100% + 10px); left:50%; transform:translateX(-50%); width:320px; max-width:calc(100vw - 32px); background:white; color:#0f172a; border:1px solid #e2e8f0; border-radius:8px; padding:6px; box-shadow:0 12px 32px #0f172a26; max-height:360px; overflow-y:auto; }
.company-menu-label { padding:8px 10px; font-size:12px; color:#64748b; }
.company-menu .choose-company { display:flex; justify-content:space-between; align-items:center; gap:12px; width:100%; background:white; border:0; border-radius:5px; text-align:left; padding:10px; }
.company-menu .choose-company:hover,.company-menu .selected-company { background:#eff4ff; color:#1d4ed8; }
.company-menu strong { display:block; font-size:13px; overflow-wrap:anywhere; }
.company-menu small { display:block; color:#64748b; font-size:11px; margin-top:3px; }
.company-menu .manage-companies { width:100%; text-align:left; padding:12px 10px; border:0; border-top:1px solid #e2e8f0; margin-top:6px; background:white; color:#334155; font-size:13px; }
@media(max-width:1000px) { .topbar .company-picker { width:210px; } }
@media(max-width:760px) { .topbar .company-picker { position:relative; left:auto; top:auto; transform:none; order:3; width:100%; max-width:340px; margin:0 auto; } .tab-bar { gap:4px 14px; } }

.view-note[data-tooltip] { position:relative; overflow:visible; }
.view-note[data-tooltip]::after { content:attr(data-tooltip); position:absolute; right:calc(100% + 8px); top:50%; transform:translateY(-50%); padding:7px 10px; border-radius:5px; background:#0f172a; color:#fff; font-size:12px; font-weight:500; line-height:1.4; white-space:nowrap; pointer-events:none; opacity:0; visibility:hidden; z-index:40; box-shadow:0 3px 10px #0f172a26; }
.view-note[data-tooltip]:hover::after,.view-note[data-tooltip]:focus-visible::after { opacity:1; visibility:visible; }

#help-button { display:none!important; }
