:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172634; background: #f4f7fb;
  font-size: 14px; line-height: 1.45;
  --ink: #172634; --subtle: #526477; --border: #dce5ef; --paper: #fff;
  --blue: #1467b8; --blue-dark: #0d4f91; --green: #156648;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, select, summary { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
:focus-visible { outline: 3px solid #86c4ff; outline-offset: 2px; }
h1,h2,p { margin: 0; }
h1 { font-size: clamp(27px, 3vw, 37px); letter-spacing: -.045em; line-height: 1.13; }
h2 { font-size: 20px; letter-spacing: -.024em; }
small,.muted { color: var(--subtle); }
.shell { min-height: 100vh; display: grid; grid-template-columns: 222px minmax(0,1fr); }
.sidebar { background: #fdfefe; border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 24px 15px 18px; height: 100vh; position: sticky; top: 0; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); padding: 0 5px 25px; }
.brand strong,.company strong { font-size: 14px; display: block; }
.brand small,.company small { display: block; font-size: 11px; }
.mark { background: #144d77; color: #fff; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; font-size: 23px; font-weight: 800; letter-spacing: -.08em; flex: 0 0 auto; }
.navigation { display: flex; flex-direction: column; gap: 5px; }
.nav-link { display: flex; align-items: center; gap: 10px; border: 0; padding: 10px 11px; border-radius: 8px; background: transparent; text-align: left; color: #40556a; }
.nav-link span { font-weight: 700; width: 18px; text-align: center; font-size: 17px; }
.nav-link:hover,.nav-link.current { background: #e8f2fd; color: #13548e; font-weight: 650; }
.sidebar-bottom { margin-top: auto; }
.company { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--border); padding: 15px 4px 10px; }
.company > span { display: grid; place-items: center; background: #eaf0f7; color: #365269; border-radius: 8px; width: 34px; height: 34px; font-size: 11px; font-weight: 750; }
.signout { border: 0; background: transparent; color: var(--subtle); padding: 5px; width: 100%; text-align: left; font-size: 12px; }
.signout span { float: right; }
.main { min-width: 0; width: 100%; max-width: 1600px; padding: 0 clamp(16px, 3.2vw, 54px) 40px; }
.topline { min-height: 62px; display: flex; justify-content: space-between; align-items: center; color: var(--subtle); border-bottom: 1px solid var(--border); font-size: 13px; }
.topline strong { color: var(--ink); }
.slash { padding: 0 6px; color: #8da0b2; }
.top-status { display: flex; align-items: center; gap: 7px; font-size: 12px; white-space: nowrap; }
.top-status i { width: 7px; height: 7px; border-radius: 50%; background: #208763; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin: 29px 0 24px; }
.page-head p { margin-top: 7px; color: var(--subtle); }
.actions,.editor-actions { display: flex; align-items: center; gap: 9px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 37px; padding: 8px 13px; border: 1px solid #cad9e7; border-radius: 8px; color: #243f58; background: #fff; font-weight: 650; white-space: nowrap; }
.button:hover { background: #eff6fd; }
.button.primary { background: var(--blue); border-color: var(--blue); color: white; }
.button.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 19px; }
.stat { padding: 15px 16px; background: #fff; border: 1px solid var(--border); border-radius: 11px; min-height: 86px; }
.stat span { display: block; color: var(--subtle); font-size: 12px; font-weight: 650; }
.stat strong { display: block; font-size: clamp(18px,2vw,26px); letter-spacing: -.04em; margin-top: 5px; line-height: 1.13; font-variant-numeric: tabular-nums; }
.stat.highlight { background: #eaf4fe; border-color: #cfe2f6; }
.panel { border: 1px solid var(--border); border-radius: 12px; background: #fff; min-width: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 9px; padding: 13px 14px; }
input, select, textarea { color: var(--ink); border: 1px solid #cbd9e7; border-radius: 7px; min-height: 37px; background: #fff; padding: 7px 10px; min-width: 0; }
textarea { resize: vertical; }
.search { flex: 1 1 180px; display: flex; align-items: center; gap: 8px; border: 1px solid #cbd9e7; padding: 0 10px; border-radius: 7px; font-weight: 400; }
.search span { font-size: 21px; line-height: 1; color: #546c82; }
.search input { border: 0; background: transparent; padding: 6px 0; width: 100%; }
.search input:focus-visible { outline-offset: -1px; }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; min-width: 735px; }
th { font-size: 11px; letter-spacing: .045em; text-transform: uppercase; color: #566b7f; background: #f5f8fc; text-align: left; }
th,td { border-bottom: 1px solid #e8eef4; padding: 11px 13px; vertical-align: middle; }
td:first-child,th:first-child { padding-left: 16px; white-space: nowrap; }
td:last-child,th:last-child { padding-right: 16px; }
tbody tr:hover { background: #f8fbff; }
td:nth-child(2) { min-width: 210px; max-width: 340px; }
td:nth-child(3) { width: 24%; color: #3d5367; }
.right { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.positive { color: var(--green); }
.negative { color: #a73a42; }
.operation-link { background: transparent; border: 0; padding: 0; text-align: left; color: #173a55; font-weight: 720; width: 100%; }
.operation-link:hover { color: var(--blue); text-decoration: underline; }
.operation-link,.op-detail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.op-detail { font-size: 11px; color: var(--subtle); margin-top: 3px; }
.tag { display: inline-block; border-radius: 7px; padding: 3px 7px; white-space: nowrap; font-size: 11px; font-weight: 680; }
.tag.pending { background: #fff0d7; color: #74440d; }
.tag.suggested { background: #e8f3fe; color: #145385; }
.tag.validated { background: #dff4e9; color: #14543e; }
.pagination { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 10px 14px; min-height: 55px; color: var(--subtle); }
.pagination span { margin-right: auto; }
.icon-button { min-width: 35px; padding: 5px 9px; font-size: 18px; }
.empty { color: var(--subtle); padding: 25px !important; text-align: center; }
.notice { margin-top: 12px; background: #e7f4ed; color: #20533c; border: 1px solid #bee2ce; border-radius: 8px; padding: 9px 12px; }
.notice.error { background: #fff1f1; border-color: #edc6c6; color: #8e2828; }
.vat-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; align-items: start; }
.section-panel { padding: 20px; }
.section-panel h2 { margin-bottom: 10px; }
.form-grid { display: grid; gap: 13px; }
label { display: grid; gap: 4px; font-size: 13px; font-weight: 650; color: #344d63; }
.field-pair { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.file-slot { border: 1px dashed #a7bed6; border-radius: 9px; padding: 14px; background: #f7fbff; }
.file-slot input { border: 0; padding-left: 0; background: transparent; width: 100%; }
.file-slot small { font-weight: 400; }
.vat-line,.history { display: flex; justify-content: space-between; gap: 8px; padding: 9px 0; border-bottom: 1px solid #e6edf4; }
.vat-line strong { white-space: nowrap; }
.section-panel > .button { margin-top: 15px; }
.rule-note { background: #edf5fc; padding: 9px 11px; border-radius: 7px; color: #355d7b; font-size: 13px; }
#vat-details .rule-note { margin-top: 12px; }
dialog { width: min(570px,calc(100vw - 28px)); padding: 22px; border: 1px solid var(--border); border-radius: 13px; max-height: 90vh; }
dialog::backdrop { background: #162b42a0; }
.editor-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.editor-header h2 { overflow-wrap: anywhere; }
.editor-amount { font-size: 26px; line-height: 1.1; font-weight: 750; letter-spacing: -.04em; }
.editor-actions { justify-content: flex-end; }
.eyebrow { font-size: 11px; letter-spacing: .1em; font-weight: 750; color: #52728d; }
.bank-detail { color: var(--subtle); border: 1px solid var(--border); padding: 9px 11px; border-radius: 7px; overflow-wrap: anywhere; }
.bank-detail div { font-size: 12px; white-space: pre-wrap; padding-top: 7px; }
.danger { color: #a22a35; }
.lock { min-height: 100vh; display: grid; place-items: center; padding: 18px; background: radial-gradient(ellipse at top left,#dcecfb,#f5f9fc 63%); }
.login-card { width: min(100%,420px); background: #fff; border: 1px solid var(--border); border-radius: 15px; padding: 28px; box-shadow: 0 20px 55px #183c5a13; }
.login-card .eyebrow { margin: 16px 0 4px; }
.login-card .muted { margin-top: 9px; }
.login-card form { display: grid; gap: 8px; margin-top: 22px; }
.login-card button { margin-top: 7px; }
@media(max-width: 1000px) { .shell { grid-template-columns: 173px minmax(0,1fr); } .sidebar { padding-inline: 10px; } }
@media(max-width: 760px) {
  .shell { display: block; } .sidebar { position: static; height: auto; padding: 12px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { padding-bottom: 10px; } .navigation { flex-direction: row; flex-wrap: wrap; } .nav-link { padding: 5px 8px; }
  .sidebar-bottom { position: absolute; right: 14px; top: 18px; } .company { display: none; }
  .main { padding-inline: 12px; } .topline { min-height: 43px; } .page-head { margin: 18px 0 15px; flex-wrap: wrap; }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; } .stat { min-height: 69px; padding: 11px; }
  .vat-grid { grid-template-columns: 1fr; }
}
