:root {
    color-scheme: light;
    --ink: #14263f;
    --muted: #52647a;
    --nav: #132742;
    --blue: #224f81;
    --blue-dark: #183d66;
    --border: #d8e1eb;
    --surface: #fff;
    --background: #f0f4f8;
    --radius: 12px;
    font-family: "Segoe UI", system-ui, sans-serif;
    line-height: 1.5;
    color: var(--ink);
    background: var(--background);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 1rem; }
h1, h2, h3, p, dl { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.8rem,3.5vw,2.7rem); line-height: 1.12; letter-spacing: -.035em; overflow-wrap: anywhere; }
h2 { margin-bottom: .9rem; font-size: 1.22rem; letter-spacing: -.015em; }
h3 { margin-bottom: 0; font-size: 1.05rem; }
a { color: #174b82; text-underline-offset: .19rem; }
:focus-visible { outline: 3px solid #118277; outline-offset: 3px; }
[hidden] { display: none !important; }
.skip { position: fixed; z-index: 10; top: .5rem; left: .5rem; transform: translateY(-150%); background: white; padding: .5rem; }
.skip:focus { transform: none; }
.top { color: white; background: var(--nav); }
.top-inner { max-width: 1280px; min-height: 4.25rem; margin: auto; padding: .5rem 1.5rem; display: flex; align-items: center; gap: 1.8rem; }
.top a { color: white; }
.brand { display: flex; align-items: center; gap: .65rem; font-size: .98rem; font-weight: 700; text-decoration: none; }
.brand img { object-fit: contain; max-width: 4rem; max-height: 2.75rem; background: white; padding: .15rem; border-radius: 6px; }
.brand-icon { display: inline-grid; place-items: center; min-height: 2.35rem; min-width: 2.35rem; border-radius: 9px; background: #d9eeec; color: #133c44; font-size: .9rem; font-weight: 800; letter-spacing: -.05em; flex: none; }
.top nav { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.top nav a { display: block; padding: .5rem .75rem; border-radius: 6px; text-decoration: none; color: #edf4fe; }
.top nav a:hover, .top nav a[aria-current] { background: #29486b; }
.account { margin-left: auto; display: flex; align-items: center; gap: .7rem; font-size: .91rem; }
.text-button { border: 1px solid #7289a4; border-radius: 7px; color: white; background: transparent; font: inherit; cursor: pointer; padding: .35rem .6rem; }
.wrap { max-width: 1280px; margin: auto; padding: 2.2rem 1.5rem 4rem; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.4rem; }
.section-label { margin: 0 0 .35rem; color: #365e7a; font-weight: 700; font-size: .88rem; }
.actions, .form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.form-actions { margin-top: 1rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; min-height: 2.5rem; padding: .5rem .83rem; border: 1px solid #a7bbce; border-radius: 8px; background: white; color: #1b405f; font: inherit; font-size: .92rem; font-weight: 650; text-decoration: none; cursor: pointer; text-align: center; }
.button:hover { background: #edf5fa; }
.button.primary { background: var(--blue); border-color: var(--blue); color: white; }
.button.primary:hover { background: var(--blue-dark); }
.button.danger { color: #a32735; border-color: #d7a6ad; }
.button:disabled { opacity: .62; cursor: default; }
.card, .filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; min-width: 0; box-shadow: 0 1px 3px #172a4110; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,235px),1fr)); gap: .9rem; }
.module { min-height: 5.5rem; display: flex; flex-direction: column; justify-content: center; color: var(--ink); text-decoration: none; margin: 0; }
.module:hover { border-color: #547499; background: #f8fbff; }
.module span, .help, small, .muted { color: var(--muted); }
.help, small { font-size: .88rem; }
.help { margin-bottom: .3rem; }
.filters, .form-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,11rem),1fr)); gap: .9rem; align-items: end; }
.form-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,14rem),1fr)); align-items: start; }
.field { display: grid; gap: .25rem; min-width: 0; font-size: .92rem; font-weight: 650; }
input:not([type=checkbox]):not([type=file]), textarea, select {
    display: block; width: 100%; min-width: 0; min-height: 2.55rem; border: 1px solid #a7bbce; border-radius: 7px;
    padding: .5rem .65rem; color: var(--ink); background-color: white; font: inherit; font-weight: 400;
}
input[readonly] { background: #eef3f7; }
select { appearance: none; padding-right: 1.9rem; background-image: linear-gradient(45deg, transparent 50%, #36536c 50%),linear-gradient(135deg,#36536c 50%,transparent 50%); background-position: calc(100% - 16px) 52%,calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { resize: vertical; }
.check { display: flex; gap: .5rem; align-items: flex-start; margin: 1rem 0; }
input[type=checkbox] { margin: .3rem .25rem 0 0; accent-color: var(--blue); width: 1rem; height: 1rem; }
.badge { display: inline-block; padding: .22rem .65rem; border-radius: 999px; font-size: .83rem; font-weight: 700; white-space: nowrap; }
.badge.green { background: #ddf4e6; color: #1a5639; }
.badge.blue { background: #dfeeff; color: #174b7a; }
.badge.amber { background: #f8eacb; color: #684614; }
.badge.gray { background: #ececf0; color: #4c5360; }
.badge.slate { background: #e6edf5; color: #304b60; }
.status-row { display: flex; flex-wrap: wrap; gap: .45rem; margin: -.5rem 0 1rem; }
.table-wrap { background: white; border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.table-wrap.inner { border: 0; border-radius: 0; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { background: #e9f1f8; color: #284461; font-size: .88rem; }
th, td { padding: .72rem .8rem; vertical-align: top; border-bottom: 1px solid #e4ebf2; }
td small { display: block; margin-top: .1rem; }
tbody tr:last-child td { border-bottom: 0; }
.numeric { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: .9rem; color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,27rem),1fr)); gap: 1rem; }
.key-values { display: grid; gap: .55rem; grid-template-columns: repeat(auto-fit,minmax(min(100%,10.5rem),1fr)); margin-bottom: 1rem; }
.key-values dt { color: var(--muted); font-size: .86rem; font-weight: 650; }
.key-values dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.totals div { display: flex; gap: .5rem; justify-content: space-between; padding: .32rem .55rem; border-bottom: 1px solid #e4ebf2; }
.totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.grand-total { background: #e2edf8; font-size: 1.15rem; font-weight: 750; color: #194975; }
.words { font-weight: 650; color: #254e70; font-size: .92rem; }
.multiline { white-space: pre-wrap; overflow-wrap: anywhere; }
.line-head, .line-controls { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; }
.line-head { margin-bottom: .8rem; }
.catalog-controls { display: flex; align-items: end; flex-wrap: wrap; gap: .55rem; }
.bank-options { display: flex; gap: .5rem 1rem; flex-wrap: wrap; }
.image-widget { display: grid; gap: .4rem; padding-top: .6rem; }
.image-title { font-weight: 700; }
.image-thumbs, .photo-strip { display: flex; flex-wrap: wrap; gap: .5rem; }
.issuer-logo { display: block; max-width: 10rem; max-height: 4.5rem; object-fit: contain; margin-bottom: .75rem; }
.photo-strip img, .thumb img { display: block; object-fit: contain; width: 5.5rem; height: 4rem; border: 1px solid var(--border); background: #f8fafc; border-radius: 5px; }
.thumb { padding: .4rem; border: 1px solid var(--border); border-radius: 7px; max-width: 100%; }
.thumb-actions { margin-top: .35rem; display: flex; flex-wrap: wrap; gap: .2rem; }
.thumb-actions .button { min-height: 1.9rem; padding: .18rem .4rem; font-size: .83rem; }
.file-action { display: inline-flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.file-action span { font-size: .9rem; font-weight: 650; }
.file-action span.help { flex-basis: 100%; font-weight: 400; }
.file-action input { max-width: 100%; }
.image-feedback { min-height: 1em; margin: 0; color: #962534; }
.timeline { padding: 0 0 0 1.35rem; margin: 1rem 0 0; }
.timeline li { padding: .5rem .5rem .7rem; white-space: pre-wrap; overflow-wrap: anywhere; border-bottom: 1px solid #e4ebf2; }
.timeline small { display: block; }
.message { margin: 0 0 1rem; border: 1px solid; border-radius: 8px; padding: .7rem 1rem; }
.error { background: #fff0f1; border-color: #dd9ca4; color: #831b2a; }
.success { background: #e4f5e9; border-color: #a7ccae; color: #235633; }
.field-error { color: #831b2a; font-size: .88rem; font-weight: 600; }
.document-input-row { display: grid; grid-template-columns: minmax(0,1fr) 2.75rem; gap: .375rem; }
.document-lookup-button { min-height: 2.75rem; padding: 0; }
.document-lookup .help { margin: 0; font-weight: 400; }
.document-lookup-apply { justify-self: start; }
.lookup-status:empty { display: none; }
.field [aria-invalid=true] { border-color: #ab3541; }
.auth-wrap { min-height: 80vh; display: grid; align-content: center; justify-items: center; }
.auth-card { width: min(100%,27rem); padding: 1.6rem; }
.auth-card .brand-icon { margin-bottom: .8rem; }
.auth-card .field { margin-bottom: .8rem; }
.auth-card form > .button { width: 100%; margin-top: .3rem; }
.empty { text-align: center; padding: 1.7rem; color: var(--muted); }
.sticky { position: sticky; bottom: 0; z-index: 2; padding: .65rem; margin: 0; background: #f0f4f8f5; border-top: 1px solid var(--border); }
.print-preview { margin: auto; display: grid; gap: 1.5rem; justify-items: center; }
.print-preview img { display: block; width: min(100%, 210mm); height: auto; box-shadow: 0 2px 12px #152a4760; }
.with-sidebar { display: grid; grid-template-columns: clamp(13.5rem,19vw,16.5rem) minmax(0,1fr); min-height: 100vh; }
.with-sidebar .wrap { margin: 0 auto; width: 100%; min-width: 0; }
.top { position: sticky; top: 0; align-self: start; min-height: 100vh; }
.top-inner { max-height: 100vh; min-height: 100vh; overflow-y: auto; flex-direction: column; align-items: stretch; gap: 1.05rem; padding: 1.15rem .95rem; }
.top .brand { min-height: 2.5rem; overflow-wrap: anywhere; }
.top .brand img { max-width: 4.75rem; }
.top nav { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: .25rem; }
.top nav a { padding: .6rem .7rem; }
.top .account { margin: auto 0 0; justify-content: space-between; border-top: 1px solid #496587; padding-top: .8rem; }
.global-search { position: relative; min-width: 0; }
.global-search .field { color: #eef5ff; }
.global-results { color: var(--ink); background: white; border-radius: 8px; padding: .25rem .6rem; margin-top: .3rem; max-height: 42vh; overflow: auto; }
.global-results a { color: #174b82; }
.search-list { list-style: none; padding: 0; margin: 0; }
.search-list li { border-bottom: 1px solid var(--border); padding: .45rem .15rem; overflow-wrap: anywhere; }
.search-list li:last-child { border-bottom: 0; }
.search-list small { display: block; }
.auth-card .login-logo { display: block; max-height: 6rem; max-width: min(100%,14rem); object-fit: contain; margin: 0 auto 1.25rem; }
.report-period { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.kpi-grid, .record-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,12.5rem),1fr)); gap: .85rem; }
.kpi { display: grid; gap: .2rem; min-height: 6.25rem; align-content: center; border-top: 3px solid #328479; }
.kpi span { color: var(--muted); font-weight: 650; }
.kpi strong { font-size: 1.87rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.report-chart ul { padding: 0; margin: 0; list-style: none; }
.report-chart li { display: grid; grid-template-columns: minmax(5rem,8rem) minmax(3rem,1fr) 2.7rem; align-items: center; gap: .55rem; margin-bottom: .55rem; font-size: .88rem; }
.report-chart li strong { text-align: right; }
.report-chart progress { width: 100%; height: .65rem; appearance: none; border: 0; border-radius: 999px; background: #e9f0f5; }
.report-chart progress::-webkit-progress-bar { background: #e9f0f5; border-radius: 999px; }
.report-chart progress::-webkit-progress-value { background: #287d71; border-radius: 999px; }
.report-chart progress::-moz-progress-bar { background: #287d71; border-radius: 999px; }
.report-chart.states progress::-webkit-progress-value { background: #315e90; }
.report-chart.states progress::-moz-progress-bar { background: #315e90; }
.record-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,17rem),1fr)); }
.record-card { padding: 0; overflow: hidden; }
.record-image { display: grid; place-items: center; min-height: 5.5rem; background: #e8f1f7; color: var(--muted); font-size: .9rem; }
.record-image img { display: block; height: 7.25rem; width: 100%; object-fit: contain; }
.record-content { padding: .95rem; }
.record-title { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.record-title h2 { margin: 0 0 .4rem; line-height: 1.25; overflow-wrap: anywhere; }
.record-title .badge { flex: 0 0 auto; }
.record-card .key-values { grid-template-columns: repeat(auto-fit,minmax(min(100%,6.4rem),1fr)); margin: .65rem 0; }
.record-meta { color: var(--muted); margin-bottom: .55rem; overflow-wrap: anywhere; }
.record-link { font-size: .92rem; font-weight: 650; }
.cards-grid:has(.module) + .no-modules { display: none; }
@media (max-width: 720px) {
    .with-sidebar { display: block; }
    .top { position: static; min-height: 0; }
    .top-inner { display: grid; grid-template-columns: minmax(0,1fr) auto; min-height: 0; max-height: none; padding: .65rem .85rem; gap: .55rem; }
    .top nav, .global-search, .top .account { grid-column: 1 / -1; }
    .top nav[data-collapsed] { display: none; }
    .top .account { margin-top: 0; padding-top: .5rem; }
    .top nav a { padding: .35rem .55rem; font-size: .92rem; }
    .menu-toggle { display: inline-block; align-self: center; }
    .account { gap: .4rem; }
    .account a { overflow-wrap: anywhere; }
    .wrap { padding: 1.25rem .8rem 2.5rem; }
    .page-head { align-items: flex-start; flex-direction: column; gap: .75rem; }
    .card, .filters { padding: .85rem; }
    .table-wrap table { min-width: 630px; }
}
@media (min-width: 721px) { .menu-toggle { display: none !important; } }
@media (max-width: 390px) { .form-grid { grid-template-columns: minmax(0,1fr); } }
@page { size: A4 portrait; margin: 0; }
@media print {
    .with-sidebar { display: block; }
    html, body, .wrap { margin: 0; padding: 0; background: white; max-width: none; }
    .top, .skip, .page-head, [data-print-status] { display: none !important; }
    .print-preview { display: block; }
    .print-preview img { width: 210mm; height: 296.8mm; box-shadow: none; break-after: page; }
    .print-preview img:last-child { break-after: auto; }
}

