:root {
    --ink: #242033;
    --muted: #777286;
    --line: #e9e7ef;
    --surface: #ffffff;
    --canvas: #f7f7fb;
    --purple: #6657f3;
    --purple-dark: #4a3ad1;
    --nav: #242038;
    --coral: #fb765f;
    --green: #22a878;
    --blue: #4c8df6;
    --amber: #f2a93b;
    --radius: 18px;
    --shadow: 0 10px 38px rgba(38, 30, 78, .07);
    color-scheme: light;
}

* { box-sizing: border-box; user-select: none; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { overflow-x: hidden; }
button, input, select, textarea { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(26px, 3vw, 36px); line-height: 1.18; letter-spacing: -.035em; }
h2 { margin-bottom: 6px; font-size: 19px; line-height: 1.3; letter-spacing: -.015em; }
h3 { margin-bottom: 8px; }
.muted, .page-header p, .panel-heading p { color: var(--muted); }
.eyebrow { display: block; margin-bottom: 9px; color: var(--purple); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow.light { color: #c8c1ff; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; display: flex; width: 248px; flex-direction: column; padding: 25px 17px 18px; color: #e8e6f1; background: var(--nav); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.brand-light { margin: 0 11px 30px; color: white; }
.brand-mark { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 11px; color: white; background: linear-gradient(145deg, #7c6aff, #5140da); box-shadow: 0 7px 18px #6c5afa42; font-weight: 900; }
.main-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-heading { margin: 20px 12px 7px; color: #8e899f; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.nav-link { display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 8px 12px; border-radius: 11px; color: #bdb9c9; font-size: 13px; font-weight: 600; transition: .18s ease; }
.nav-link:hover { color: white; background: #ffffff0b; }
.nav-link.active { color: white; background: linear-gradient(90deg, #7162f5, #5e4fe6); box-shadow: 0 8px 25px #0d092f40; }
.nav-icon { display: grid; width: 22px; place-items: center; font-size: 17px; }
.sidebar-bottom { margin-top: auto; }
.user-card { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 14px 9px 4px; border-top: 1px solid #ffffff12; }
.user-card > span:last-child { min-width: 0; }
.user-card strong, .user-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card strong { color: white; font-size: 12px; }
.user-card small { color: #9994aa; font-size: 10px; }
.user-card:hover { border-color: #ffffff24; background: #ffffff08; }
.sidebar-logout-form { margin: 6px 9px 0; }
.sidebar-logout { width: 100%; padding: 7px 10px; border: 1px solid #ffffff18; border-radius: 9px; cursor: pointer; color: #c8c3d4; background: transparent; font-size: 11px; font-weight: 700; text-align: center; }
.sidebar-logout:hover { color: white; border-color: #ffffff2e; background: #ffffff0b; }
.avatar { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border-radius: 11px; color: white; background: #6959ef; font-size: 12px; font-weight: 800; }

.main-area { min-width: 0; min-height: 100vh; margin-left: 248px; }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; min-height: 72px; align-items: center; justify-content: space-between; padding: 12px 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(14px); }
.top-actions { display: flex; align-items: center; gap: 23px; }
.status-dot { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 600; }
.status-dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px #22a87818; }
.menu-button, .mobile-brand { display: none; }
.content { width: min(1390px, 100%); min-width: 0; margin: 0 auto; padding: 32px 34px 60px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 27px; }
.page-header > div { min-width: 0; }
.page-header > div:first-child { flex: 1 1 auto; }
.page-header p { max-width: 680px; margin-bottom: 0; overflow-wrap: anywhere; }

.button { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; gap: 8px; padding: 10px 17px; border: 1px solid transparent; border-radius: 11px; cursor: pointer; font-weight: 750; line-height: 1.25; text-align: center; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--purple); box-shadow: 0 7px 18px #6657f329; }
.button.primary:hover { background: var(--purple-dark); box-shadow: 0 10px 24px #6657f33d; }
.button.secondary { color: var(--purple); border-color: #d9d4ff; background: #f5f3ff; }
.button.ghost { color: #625e70; border-color: var(--line); background: white; box-shadow: none; }
.button.light { color: var(--purple-dark); background: white; }
.button.tax-button { color: white; background: #16714f; }
.button.tax-outline { color: #126947; border-color: #b9dfcf; background: #edf9f4; }
.button.tax-outline:hover { border-color: #8dcbb6; background: #e2f5ed; }
.button.danger-outline { color: #b74738; border-color: #efc2bb; background: #fff5f3; }
.button.compact { min-height: 38px; padding: 7px 13px; font-size: 12px; }
.button.large { min-height: 50px; }
.button.full { width: 100%; }
.icon-button { border: 0; cursor: pointer; background: transparent; }

.panel { border: 1px solid #eeecf3; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel, .hero-grid > *, .content-grid > *, .split-layout > *, .vat-view-grid > *, .invoice-view-grid > *, .balance-grid > * { min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px 17px; }
.panel-heading h2, .panel-heading p { margin-bottom: 0; }
.panel-heading p { margin-top: 3px; font-size: 12px; }
.panel-heading > a { color: var(--purple); font-size: 12px; font-weight: 750; }

.hero-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 18px; margin-bottom: 18px; }
.welcome-card { position: relative; display: flex; min-height: 210px; align-items: center; justify-content: space-between; overflow: hidden; padding: 31px 34px; border-radius: var(--radius); color: white; background: linear-gradient(125deg, #5143c6, #6c5bf0 62%, #8070ff); box-shadow: 0 14px 35px #5546c82b; }
.welcome-card::after { position: absolute; right: 110px; bottom: -80px; width: 280px; height: 280px; border: 1px solid #ffffff14; border-radius: 50%; box-shadow: 0 0 0 38px #ffffff09, 0 0 0 76px #ffffff07; content: ""; }
.welcome-card > * { position: relative; z-index: 1; }
.welcome-card > div:first-child { min-width: 0; max-width: 100%; }
.welcome-card h2 { margin: 5px 0 9px; font-size: clamp(24px, 2.5vw, 33px); font-weight: 650; letter-spacing: -.04em; }
.welcome-card h2 em { color: #c9c2ff; font-style: normal; }
.welcome-card p { max-width: 410px; margin: 0; overflow-wrap: anywhere; color: #dedaff; }
.card-kicker { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .72; }
.completion-ring { position: relative; display: grid; flex: 0 0 104px; width: 104px; height: 104px; place-items: center; text-align: center; }
.completion-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
.completion-ring circle { fill: none; stroke-width: 7; }
.completion-ring-track { stroke: #ffffff30; }
.completion-ring-value { stroke: white; stroke-linecap: round; }
.completion-ring-label { position: relative; z-index: 1; }
.completion-ring strong { display: block; font-size: 22px; }
.completion-ring span { font-size: 9px; text-transform: uppercase; }
.deadline-card { display: flex; flex-direction: column; justify-content: space-between; padding: 25px; border: 1px solid #eee9df; border-radius: var(--radius); background: #fffefa; box-shadow: var(--shadow); }
.deadline-top { display: flex; align-items: center; gap: 13px; }
.deadline-top small, .deadline-top strong { display: block; }
.deadline-top small { color: var(--muted); }
.deadline-top strong { margin-top: 2px; font-size: 18px; }
.icon-tile { display: grid; width: 45px; height: 45px; place-items: center; border-radius: 13px; font-size: 21px; }
.icon-tile.amber { color: #bd7811; background: #fff2d9; }
.deadline-amount { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 18px; padding-top: 17px; border-top: 1px solid #eee9df; }
.deadline-amount span { color: var(--muted); font-size: 12px; }
.deadline-amount strong { font-size: 25px; }
.deadline-card > a { margin-top: 12px; color: var(--purple); font-size: 12px; font-weight: 800; }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metric-grid.two { grid-template-columns: repeat(2, 1fr); }
.metric-grid.three { grid-template-columns: repeat(3, 1fr); }
.metric-card { display: flex; min-height: 124px; align-items: center; gap: 17px; padding: 22px 24px; border: 1px solid #eeecf3; border-radius: 15px; background: white; box-shadow: 0 6px 25px #261e4e08; }
.metric-icon { display: grid; flex: 0 0 42px; width: 42px; height: 42px; padding: 0; place-items: center; border-radius: 13px; font-family: "Segoe UI Symbol", "Segoe UI", sans-serif; font-size: 19px; font-weight: 700; line-height: 1; text-align: center; }
.ui-icon { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.purple { color: var(--purple); background: #eeebff; }
.coral { color: var(--coral); background: #fff0ed; }
.blue { color: var(--blue); background: #eaf2ff; }
.green { color: var(--green); background: #e8f8f2; }
.metric-card > div > small, .metric-card > div > strong, .metric-card > div > span { display: block; }
.metric-card small { color: var(--muted); font-size: 11px; font-weight: 650; }
.metric-card strong { margin: 3px 0 1px; font-size: 21px; letter-spacing: -.03em; }
.metric-card div > span { color: #aaa6b4; font-size: 10px; }
.metric-card.featured { border-color: #d7efe6; background: #f9fffc; }
.content-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 18px; margin-bottom: 18px; }
.quick-actions { padding: 0 13px 14px; }
.quick-actions a { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: 11px; }
.quick-actions a:hover { background: var(--canvas); }
.quick-actions a > span { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 10px; color: var(--purple); background: #efedff; }
.quick-actions a div { flex: 1; }
.quick-actions strong, .quick-actions small { display: block; }
.quick-actions strong { font-size: 12px; }
.quick-actions small { color: var(--muted); font-size: 10px; }
.quick-actions b { color: #aaa5b5; font-size: 20px; }

.activity-list { padding: 0 13px 14px; }
.activity-item { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-top: 1px solid #f2f0f5; }
.activity-item:first-child { border-top: 0; }
.activity-icon { display: grid; flex: 0 0 36px; width: 36px; height: 36px; padding: 0; place-items: center; border-radius: 11px; color: var(--purple); background: #f0edff; font-family: "Segoe UI Symbol", "Segoe UI", sans-serif; font-weight: 800; line-height: 1; text-align: center; }
.activity-item > div { flex: 1; min-width: 0; }
.activity-item strong, .activity-item small { display: block; }
.activity-item strong { font-size: 12px; }
.activity-item small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; justify-content: center; padding: 4px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.badge.draft, .badge.neutral { color: #696475; background: #f1f0f4; }
.badge.sent, .badge.ready { color: #5141c5; background: #eeebff; }
.badge.paid { color: #16825b; background: #e5f7f0; }
.badge.overdue { color: #cd4d3a; background: #ffebe7; }
.badge.submitted { color: #246dbb; background: #e8f3ff; }
.badge.warning { color: #8a5b13; background: #fff0d8; }
.badge.correction_required { color: #a95816; background: #fff0d8; }
.empty-state { padding: 48px 25px 54px; text-align: center; }
.empty-state > span { display: grid; width: 50px; height: 50px; margin: 0 auto 15px; place-items: center; border-radius: 15px; color: var(--purple); background: #efedff; font-size: 23px; }
.empty-state h3 { margin-bottom: 4px; }
.empty-state p { max-width: 440px; margin: 0 auto 18px; color: var(--muted); font-size: 13px; }
.compact-empty { padding-block: 30px 36px; }

.bank-import-grid { display: grid; grid-template-columns: minmax(300px, .7fr) minmax(0, 1.3fr); gap: 18px; margin-bottom: 18px; align-items: stretch; }
.bank-upload-card { padding-bottom: 24px; }
.bank-upload-card .stack { padding: 0 24px; }
.bank-metrics { height: 100%; margin-bottom: 0; }
.bank-metrics .metric-card { height: 100%; }
.bank-review-panel { margin-bottom: 18px; }
.bank-table { min-width: 1180px; }
.bank-table td:nth-child(2) { max-width: 420px; }
.bank-table td:nth-child(2) strong, .bank-table td:nth-child(2) small, .bank-table td.numeric small { display: block; }
.bank-table td:nth-child(2) small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.bank-amount { white-space: nowrap; }
.bank-amount.outgoing { color: #c24c3b; }
.bank-amount.incoming { color: #16825b; }
.bank-actions { display: flex; min-width: 590px; flex-direction: column; align-items: flex-start; gap: 8px; }
.bank-action-buttons { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; }
.bank-actions form { margin: 0; }
.bank-actions .button.is-disabled { cursor: not-allowed; opacity: .52; }
.bank-quick-menu { position: relative; }
.bank-quick-menu > summary { list-style: none; }
.bank-quick-menu > summary::-webkit-details-marker { display: none; }
.bank-quick-menu[open] > summary { color: var(--purple-dark); border-color: #cfc9ff; background: #efedff; }
.bank-quick-panel { width: min(540px, 70vw); margin-top: 7px; padding: 13px; border: 1px solid #ddd9ec; border-radius: 12px; background: #faf9fd; box-shadow: 0 9px 24px rgba(43, 35, 79, .09); }
.bank-quick-panel > strong, .bank-quick-panel > small { display: block; }
.bank-quick-panel > small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.bank-inline-form { display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: 9px; margin-top: 11px !important; }
.bank-inline-form label { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.bank-inline-form label.wide { grid-column: 1 / -1; }
.bank-inline-form label > span { color: #625d6f; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.bank-inline-form select { min-height: 38px; padding: 7px 9px; font-size: 11px; }
.bank-inline-form > .button { align-self: end; }
.bank-history-grid { margin-top: 0; }
.bank-settings-note { margin-bottom: 0; }
.button-link { padding: 0; border: 0; cursor: pointer; background: transparent; font: inherit; }

.alert { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 19px; padding: 13px 15px; border: 1px solid; border-radius: 12px; }
.alert > span { display: grid; flex: 0 0 23px; width: 23px; height: 23px; place-items: center; border-radius: 50%; font-weight: 900; }
.alert p { flex: 1; margin: 0; }
.alert button { border: 0; cursor: pointer; background: transparent; font-size: 19px; }
.alert.success { color: #176d4f; border-color: #c8eadf; background: #effaf6; }
.alert.error { color: #a33a2c; border-color: #f1c7c0; background: #fff2f0; }
.alert.warning { color: #855b18; border-color: #eed9b6; background: #fff9ed; }

.app-modal { width: min(470px, calc(100vw - 30px)); max-width: none; margin: auto; padding: 0; overflow: visible; border: 0; outline: 0; color: var(--ink); background: transparent; }
.app-modal::backdrop { background: rgba(23, 19, 39, .58); backdrop-filter: blur(5px); animation: modal-backdrop-in .18s ease-out both; }
.app-modal[open] { animation: modal-card-in .22s cubic-bezier(.2, .8, .2, 1) both; }
.app-modal-card { position: relative; display: flex; flex-direction: column; align-items: center; padding: 34px 34px 29px; border: 1px solid rgba(255,255,255,.85); border-radius: 23px; background: rgba(255,255,255,.98); box-shadow: 0 28px 90px rgba(30, 23, 62, .28); text-align: center; }
.app-modal-close { position: absolute; top: 14px; right: 14px; display: grid; width: 34px; height: 34px; padding: 0; place-items: center; border: 0; border-radius: 10px; cursor: pointer; color: #8d8799; background: #f5f4f8; font-size: 21px; line-height: 1; transition: color .15s, background .15s, transform .15s; }
.app-modal-close:hover { color: var(--ink); background: #ebe9f0; transform: rotate(4deg); }
.app-modal button:focus-visible { outline: 3px solid rgba(102,87,243,.24); outline-offset: 3px; }
.app-modal-icon { display: grid; width: 58px; height: 58px; margin-bottom: 17px; place-items: center; border-radius: 18px; color: var(--purple); background: #efedff; box-shadow: 0 10px 28px rgba(102,87,243,.16); font-size: 25px; font-weight: 900; }
.app-modal-kicker { margin-bottom: 6px; color: #9690a3; font-size: 10px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.app-modal h2 { max-width: 360px; margin-bottom: 8px; font-size: 23px; letter-spacing: -.025em; }
.app-modal p { max-width: 390px; margin: 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; white-space: pre-line; }
.app-modal-actions { display: flex; width: 100%; justify-content: center; gap: 10px; margin-top: 25px; }
.app-modal-actions .button { min-width: 130px; }
.app-modal [hidden] { display: none; }
.app-modal.is-success .app-modal-icon { color: #167956; background: #e7f8f1; box-shadow: 0 10px 28px rgba(34,168,120,.15); }
.app-modal.is-warning .app-modal-icon { color: #a7670f; background: #fff1d8; box-shadow: 0 10px 28px rgba(242,169,59,.16); }
.app-modal.is-error .app-modal-icon, .app-modal.is-danger .app-modal-icon { color: #b74738; background: #fff0ed; box-shadow: 0 10px 28px rgba(251,118,95,.15); }
.app-modal.is-danger [data-modal-confirm] { color: white; background: #c94f3e; box-shadow: 0 7px 18px rgba(201,79,62,.25); }
.app-modal.is-danger [data-modal-confirm]:hover { background: #ae3e30; }
body:has(.app-modal[open]) { overflow: hidden; }

@keyframes modal-card-in {
    from { opacity: 0; transform: translateY(14px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes modal-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.table-panel { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 18px; color: #9b96a7; background: #faf9fc; font-size: 10px; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
td { padding: 15px 18px; border-top: 1px solid #f0eef3; font-size: 12px; }
td.numeric, th.numeric { text-align: right; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #fbfaff; }

.form-panel { padding-bottom: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 0 24px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.form-panel > .stack { padding: 0 24px; }
.span-2 { grid-column: span 2; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 6px; }
.field > span, .vat-prepare label > span { color: #5f5a6b; font-size: 11px; font-weight: 750; }
.field small { color: #9b96a5; font-size: 9px; }
input, select, textarea { width: 100%; min-width: 0; max-width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #dedbe6; outline: 0; border-radius: 10px; background: white; transition: border .15s, box-shadow .15s; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #9085f5; box-shadow: 0 0 0 3px #6657f312; }
input[type="color"] { padding: 5px; }
input[type="file"] { font-size: 11px; }
.check-row { display: flex; align-items: flex-start; gap: 9px; color: #645f70; font-size: 12px; }
.check-row input { flex: 0 0 17px; width: 17px; min-height: 17px; margin-top: 2px; accent-color: var(--purple); }
.choice-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.choice-field legend { margin-bottom: 7px; color: #5f5a6b; font-size: 11px; font-weight: 750; }
.choice-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice-cards label { position: relative; cursor: pointer; }
.choice-cards input { position: absolute; opacity: 0; pointer-events: none; }
.choice-cards label > span { display: flex; min-height: 76px; flex-direction: column; justify-content: center; padding: 13px 15px; border: 1px solid #dedbe6; border-radius: 11px; background: white; transition: border .15s, background .15s, box-shadow .15s; }
.choice-cards label > span::before { position: absolute; top: 13px; right: 13px; display: grid; width: 17px; height: 17px; place-items: center; border: 1px solid #c9c5d2; border-radius: 50%; color: white; content: ""; font-size: 10px; }
.choice-cards input:checked + span { border-color: #8175ef; background: #f7f5ff; box-shadow: 0 0 0 3px #6657f30c; }
.choice-cards input:checked + span::before { border-color: var(--purple); background: var(--purple); content: "✓"; }
.choice-cards strong, .choice-cards small { display: block; padding-right: 22px; }
.choice-cards strong { font-size: 12px; }
.choice-cards small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.choice-help { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; }
.form-section { margin-top: 10px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-section:first-child { margin-top: 0; padding-top: 0; border: 0; }
.form-section h2, .form-section p { margin-bottom: 3px; }
.form-section p { color: var(--muted); font-size: 12px; }
.settings-panel { max-width: 900px; }
.narrow-panel { width: min(660px, 100%); margin-top: 18px; }
.account-grid { display: grid; max-width: 900px; grid-template-columns: minmax(240px, .72fr) minmax(340px, 1.28fr); gap: 18px; align-items: start; }
.account-profile { padding: 24px; }
.account-profile-heading { display: flex; align-items: center; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.account-profile-heading h2, .account-profile-heading p { margin: 0; }
.account-profile-heading p { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.account-avatar { width: 48px; height: 48px; flex-basis: 48px; border-radius: 14px; font-size: 17px; }
.account-details { margin: 0 0 22px; }
.account-details > div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.account-details dt { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.account-details dd { margin: 2px 0 0; font-size: 13px; font-weight: 700; }
.account-password-panel .stack { padding: 0 24px 24px; }

.invoice-layout { display: flex; flex-direction: column; gap: 17px; }
.invoice-layout > .form-panel > .field { padding: 20px 24px 0; }
.invoice-lines { padding: 0 24px; }
.invoice-line { display: grid; grid-template-columns: minmax(220px, 3fr) 90px 125px 120px 110px 32px; gap: 10px; align-items: end; padding: 14px 0; border-top: 1px solid var(--line); }
.invoice-line:first-child { border-top: 0; }
.line-total { display: flex; min-height: 44px; flex-direction: column; justify-content: center; text-align: right; }
.line-total span { color: var(--muted); font-size: 9px; }
.line-total strong { font-size: 13px; }
.remove-line { width: 30px; height: 40px; border: 0; border-radius: 9px; cursor: pointer; color: #b04d40; background: #fff0ee; font-size: 20px; }
.invoice-summary { width: min(350px, calc(100% - 48px)); margin: 10px 24px 0 auto; padding-top: 13px; border-top: 1px solid var(--line); }
.invoice-summary div { display: flex; justify-content: space-between; padding: 4px 0; font-size: 12px; }
.invoice-summary .grand { margin-top: 7px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 18px; }

.invoice-view-grid { display: grid; grid-template-columns: minmax(0, 850px) 290px; gap: 20px; align-items: start; }
.invoice-paper { min-height: 920px; padding: clamp(28px, 5vw, 62px); border: 1px solid #ebe8f0; background: white; box-shadow: 0 17px 50px #2e275b0c; }
.invoice-paper > header { display: flex; align-items: center; justify-content: space-between; }
.invoice-paper > header > div:first-child { display: flex; align-items: center; gap: 12px; }
.invoice-paper > header strong, .invoice-paper > header small { display: block; }
.invoice-paper > header small { color: var(--muted); }
.invoice-logo { display: grid; width: 45px; height: 45px; place-items: center; border-radius: 13px; color: white; background: var(--brand); font-size: 21px; font-weight: 900; }
.invoice-word { color: #dedbe8; font-size: 30px; font-weight: 850; letter-spacing: .12em; }
.invoice-addresses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; margin: 60px 0 45px; }
.invoice-addresses div { display: flex; flex-direction: column; font-size: 12px; }
.invoice-addresses small { margin-bottom: 10px; color: #a19cab; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.invoice-addresses strong { margin-bottom: 4px; }
.invoice-addresses span { color: var(--muted); }
.invoice-subject { margin-bottom: 20px; font-size: 17px; }
.invoice-table th { padding-left: 10px; background: #f7f6fa; }
.invoice-table td { padding: 13px 10px; }
.invoice-table th:not(:first-child), .invoice-table td:not(:first-child) { text-align: right; }
.invoice-totals { width: min(300px, 100%); margin: 28px 0 50px auto; }
.invoice-totals div { display: flex; justify-content: space-between; padding: 5px 0; }
.invoice-totals div:last-child { margin-top: 7px; padding-top: 13px; border-top: 2px solid var(--ink); font-size: 19px; }
.invoice-paper footer { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.invoice-paper footer > div { display: flex; flex-wrap: wrap; gap: 20px; }
.invoice-side { display: flex; flex-direction: column; gap: 16px; }
.invoice-side .panel { padding: 20px; }
.invoice-side p { color: var(--muted); font-size: 12px; }
.large-status { margin-bottom: 12px; }
.tip-card { border-color: #e4dfff; background: #f8f6ff; }
.tip-card > span { color: var(--purple); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.correction-card { border-color: #f0d5d0; background: #fffaf9; }
.top-gap { margin-top: 10px; }

.split-layout { display: grid; grid-template-columns: minmax(370px, .85fr) minmax(0, 1.15fr); gap: 18px; align-items: start; }
.sticky-form { position: sticky; top: 90px; }
.calculation { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: 11px; background: #f6f4ff; }
.calculation span { color: var(--muted); font-size: 11px; }
.calculation strong { color: var(--purple-dark); font-size: 19px; }
.expense-list { padding: 0 13px 14px; }
.expense-list article, .contact-list article { display: flex; align-items: center; gap: 12px; padding: 13px 10px; border-top: 1px solid #f1eff4; }
.expense-list article:first-child, .contact-list article:first-child { border-top: 0; }
.expense-list article > div:nth-child(2), .contact-list article > div { flex: 1; min-width: 0; }
.expense-list strong, .expense-list small, .contact-list strong, .contact-list small { display: block; }
.expense-list small, .contact-list small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.expense-list .document-link { display: inline-block; margin-top: 3px; color: var(--purple); font-size: 10px; font-weight: 750; }
.edit-link { position: relative; z-index: 1; display: inline-flex; min-height: 30px; flex: 0 0 auto; align-items: center; justify-content: center; padding: 6px 10px; border-radius: 8px; color: var(--purple); background: #f2efff; font-size: 9px; font-weight: 800; line-height: 1; }
.edit-link:hover { background: #e8e3ff; }
.expense-amount { text-align: right; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; border-radius: 12px; background: #f0eef4; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; padding: 9px; border-radius: 9px; cursor: pointer; text-align: center; font-size: 12px; font-weight: 750; }
.segmented input:checked + span { color: var(--purple); background: white; box-shadow: 0 3px 12px #2c245015; }
.callout { display: flex; align-items: center; gap: 13px; margin: 18px 0; padding: 16px 18px; border: 1px solid; border-radius: 14px; }
.callout > span { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; border-radius: 50%; font-weight: 900; }
.callout > div { flex: 1; min-width: 0; }
.callout strong, .callout p { display: block; margin: 0; }
.callout p { font-size: 12px; }
.callout.info { color: #3b4c71; border-color: #d8e2f6; background: #f4f8ff; }
.callout.tax-help { color: #235f49; border-color: #cce7dc; background: #f0faf6; }
.callout.tax-help > span { color: #176f50; background: #d9f1e7; }
.callout.warning { color: #805816; border-color: #edd9b6; background: #fff9ed; }
.compact-callout { margin-top: 10px; padding: 11px; }

.vat-hero { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 18px; padding: 28px 31px; border-radius: var(--radius); color: white; background: linear-gradient(120deg, #26213d, #443b72); box-shadow: var(--shadow); }
.vat-hero h2 { font-size: 25px; }
.vat-hero p { max-width: 610px; margin-bottom: 0; color: #cac5dd; font-size: 12px; }
.vat-prepare { display: flex; align-items: end; gap: 9px; }
.vat-prepare label { min-width: 100px; }
.vat-prepare label > span { display: block; margin-bottom: 5px; color: #c7c2d9; }
.vat-prepare input, .vat-prepare select { border-color: #ffffff25; color: white; background: #ffffff13; }
.vat-prepare option { color: var(--ink); }
.vat-import-panel { margin-bottom: 18px; }
.vat-import-panel .panel-heading { align-items: center; }
.vat-import-content { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); gap: 24px; padding: 0 24px 24px; }
.vat-import-help { color: #5f5a6b; font-size: 12px; }
.vat-import-help strong { color: var(--ink); }
.vat-import-help ol { margin: 8px 0 10px; padding-left: 20px; }
.vat-import-help li + li { margin-top: 5px; }
.vat-import-help p { margin: 0; }
.vat-import-form { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 17px; border: 1px solid #e5e1f2; border-radius: 13px; background: #faf9ff; }
.vat-manual-start { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 16px; border: 1px solid #e5e1f2; border-radius: 13px; background: #fff; }
.vat-manual-start strong, .vat-manual-start small { display: block; }
.vat-manual-start small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.vat-manual-start .button { flex: 0 0 auto; }
.vat-csv-fallback { margin-top: 15px; }
.vat-csv-fallback summary, .vat-csv-upload summary { cursor: pointer; color: var(--purple); font-weight: 750; }
.vat-csv-fallback .button { margin-top: 10px; }
.vat-csv-upload { padding: 0 5px; }
.vat-csv-upload form { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.vat-pdf-review { margin-bottom: 18px; overflow: hidden; border-color: #d9d4ff; }
.vat-review-hint { margin: 0 24px 20px; }
.vat-pdf-review-list { display: grid; gap: 16px; padding: 0 24px 22px; }
.vat-pdf-review-card { overflow: hidden; border: 1px solid #e7e3f1; border-radius: 14px; background: #fff; }
.vat-pdf-review-title { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 18px; background: #faf9ff; }
.vat-pdf-review-title strong, .vat-pdf-review-title small { display: block; }
.vat-pdf-review-title small { margin-top: 2px; color: var(--muted); }
.vat-pdf-document-fields { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 12px; padding: 16px 18px; border-top: 1px solid var(--line); }
.vat-pdf-payment-field { grid-column: span 2; }
.vat-pdf-review-card table { margin: 0; }
.vat-pdf-review-card th, .vat-pdf-review-card td { padding-block: 9px; }
.vat-review-table th:nth-child(2), .vat-review-table th:nth-child(3), .vat-review-table td:nth-child(2), .vat-review-table td:nth-child(3) { width: 190px; }
.vat-review-table td:first-child strong, .vat-review-table td:first-child small { display: block; }
.vat-review-table td:first-child small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.vat-amount-input { display: inline-grid; width: 150px; max-width: 100%; grid-template-columns: auto minmax(0, 1fr); align-items: center; overflow: hidden; border: 1px solid #dedbe6; border-radius: 9px; background: #fff; transition: border .15s, box-shadow .15s; }
.vat-amount-input:focus-within { border-color: #9085f5; box-shadow: 0 0 0 3px #6657f312; }
.vat-amount-input > span { padding-left: 10px; color: var(--muted); font-size: 11px; }
.vat-amount-input input { width: 100%; min-height: 36px; padding: 7px 9px 7px 5px; border: 0; border-radius: 0; background: transparent; box-shadow: none; text-align: right; }
.vat-amount-input input:focus { border: 0; box-shadow: none; }
.vat-pdf-total-row { background: #f5f3ff; }
.vat-pdf-total-row .vat-amount-input { border-color: #cfc8f5; }
.vat-pdf-total-row .vat-amount-input input { font-weight: 800; }
.vat-pdf-review-actions { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 18px 24px; border-top: 1px solid #e8e4f3; background: #faf9ff; }
.vat-pdf-review-actions > form:first-child { flex: 1 1 620px; max-width: 620px; }
.confirm-check { display: flex; width: fit-content; max-width: 100%; align-items: flex-start; gap: 10px; cursor: pointer; color: #514c60; font-size: 12px; line-height: 1.5; }
.confirm-check input[type="checkbox"] { flex: 0 0 18px; width: 18px; min-width: 18px; max-width: 18px; height: 18px; min-height: 18px; margin: 0; padding: 0; cursor: pointer; accent-color: var(--purple); }
.vat-view-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .65fr); gap: 18px; align-items: start; }
.vat-form { overflow: hidden; }
.vat-row { display: flex; align-items: center; gap: 13px; padding: 14px 22px; border-top: 1px solid #efedf3; }
.vat-row .rubric { display: grid; flex: 0 0 34px; width: 34px; height: 28px; place-items: center; border-radius: 8px; color: var(--purple); background: #f0edff; font-size: 11px; font-weight: 850; }
.vat-row > div { flex: 1; }
.vat-row > div strong, .vat-row > div small { display: block; }
.vat-row > div strong { font-size: 12px; }
.vat-row > div small { color: var(--muted); font-size: 10px; }
.vat-row > strong { font-size: 13px; }
.vat-total { display: flex; justify-content: space-between; padding: 20px 23px; color: white; background: var(--nav); font-size: 18px; }
.vat-total strong { font-size: 22px; }
.checklist, .vat-status-card { padding: 21px; }
.checklist label { display: flex; gap: 9px; margin: 12px 0; font-size: 11px; }
.checklist input { flex: 0 0 16px; width: 16px; min-height: 16px; accent-color: var(--green); }
.checklist .button { margin-top: 17px; }
.center { display: block; margin-top: 8px; color: var(--muted); text-align: center; }
.success-text { color: var(--green); font-weight: 700; }

.year-filter { display: flex; align-items: center; margin: 0; }
.year-filter select { width: auto; min-width: 118px; min-height: 43px; padding-right: 36px; cursor: pointer; }
.report-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }
.report-actions .button, .page-header > .button { flex: 0 0 auto; white-space: nowrap; }
.balance-date-form { display: flex; align-items: flex-end; gap: 9px; }
.balance-date-form label > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 750; }
.balance-date-form input { min-width: 155px; min-height: 38px; padding-block: 7px; }
.balance-summary { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; padding: 19px 23px; border: 1px solid #e8e5ef; border-radius: 16px; background: linear-gradient(110deg, #fff, #faf9ff); box-shadow: var(--shadow); }
.balance-summary article { display: flex; flex: 1; min-width: 0; flex-direction: column; }
.balance-summary article > span { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.balance-summary article strong { margin: 2px 0; font-size: 24px; letter-spacing: -.03em; }
.balance-summary article small { color: #a29dab; font-size: 10px; }
.balance-equals { color: #b0abb9; font-size: 23px; font-weight: 400; }
.balance-check { padding: 7px 11px; border-radius: 999px; font-size: 10px; font-weight: 850; white-space: nowrap; }
.balance-check.ok { color: #177a57; background: #e5f7ef; }
.balance-check.error { color: #b74334; background: #ffebe7; }
.balance-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.balance-column { overflow: hidden; }
.balance-column-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 22px 23px; border-bottom: 1px solid var(--line); background: #fbfaff; }
.balance-column-head > div { display: flex; align-items: center; gap: 12px; }
.balance-column-head > div > span { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; color: var(--purple); background: #ece9ff; font-weight: 900; }
.balance-column-head h2, .balance-column-head p { margin: 0; }
.balance-column-head p { color: var(--muted); font-size: 10px; }
.balance-column-head > strong { font-size: 18px; }
.balance-group { padding: 18px 23px 8px; }
.balance-group + .balance-group { border-top: 1px solid var(--line); }
.balance-group h3 { margin-bottom: 9px; color: #928d9e; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.balance-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid #f2f0f5; font-size: 12px; }
.balance-line:first-of-type { border-top: 0; }
.balance-line > span { display: flex; align-items: center; gap: 8px; }
.balance-line small { display: inline-block; min-width: 36px; color: #aaa5b4; font-size: 9px; }
.balance-line.result { margin-top: 7px; padding: 11px 10px; border: 0; border-radius: 9px; background: #f3f1ff; }
.balance-line.result strong { color: var(--purple-dark); }
.balance-empty { margin: 8px 0 13px; color: var(--muted); font-size: 11px; }
.balance-column-total { display: flex; justify-content: space-between; margin-top: 9px; padding: 17px 23px; color: white; background: var(--nav); font-size: 14px; }
.balance-column-total strong { font-size: 17px; }
.report-list { padding: 0 21px 20px; }
.report-list > div { display: flex; justify-content: space-between; gap: 15px; padding: 10px 3px; border-top: 1px solid #f0eef3; font-size: 12px; }
.report-list > div:first-child { border-top: 0; }
.report-list span small { display: inline-block; width: 42px; color: #a09baa; }
.report-list .report-total { margin-top: 10px; padding-top: 14px; border-top: 2px solid var(--ink); font-size: 15px; }
.chart-panel { padding-bottom: 20px; }
.bars { display: grid; height: 230px; grid-template-columns: repeat(12, 1fr); gap: 14px; align-items: end; padding: 20px 30px 0; border-bottom: 1px solid var(--line); }
.bar-month { display: flex; height: 100%; flex-direction: column; justify-content: flex-end; gap: 6px; text-align: center; }
.bar-stack { display: flex; height: calc(100% - 25px); align-items: end; justify-content: center; gap: 3px; }
.bar { display: block; width: min(13px, 45%); min-height: 2px; border-radius: 4px 4px 0 0; }
.bar.revenue { background: var(--purple); }
.bar.expense { background: var(--coral); }
.bar-month > span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.chart-legend { display: flex; justify-content: center; gap: 20px; padding-top: 14px; color: var(--muted); font-size: 10px; }
.chart-legend i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; }
.legend-purple { background: var(--purple); }.legend-coral { background: var(--coral); }

.contact-list { padding: 0 13px 14px; }
.trade-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.trade-card { position: relative; display: flex; align-items: center; gap: 14px; padding: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: var(--shadow); }
.trade-card::after { position: absolute; inset: auto 0 0; height: 3px; background: var(--trade); content: ""; }
.trade-letter { display: grid; flex: 0 0 45px; width: 45px; height: 45px; place-items: center; border-radius: 13px; color: white; background: var(--trade); font-size: 18px; font-weight: 850; }
.trade-card div { flex: 1; min-width: 0; }
.trade-card h2, .trade-card p { overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; }
.trade-card p { color: var(--muted); font-size: 10px; }
.security-panel { display: flex; max-width: 900px; align-items: center; gap: 15px; margin-top: 17px; padding: 20px; }
.security-panel > div { flex: 1; }
.security-panel h3, .security-panel p { margin: 0; }
.security-panel p { color: var(--muted); font-size: 11px; }

.help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.help-card { position: relative; padding: 25px; }
.help-card > span { color: #c9c5d3; font-size: 11px; font-weight: 850; letter-spacing: .1em; }
.help-card h2 { margin-top: 15px; }
.help-card p, .help-card dd { color: var(--muted); font-size: 12px; }
.help-card dl { margin-bottom: 0; }
.help-card dt { margin-top: 9px; font-size: 12px; font-weight: 750; }
.help-card dd { margin-left: 0; }
.help-card.accent { color: white; border: 0; background: linear-gradient(135deg, #5d4de0, #7b6bfa); }
.help-card.accent p, .help-card.accent > span { color: #ddd8ff; }
.source-strip { display: flex; align-items: center; gap: 20px; margin-top: 18px; padding: 18px 22px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.source-strip div { flex: 1; }
.source-strip strong, .source-strip span { display: block; }
.source-strip span { color: var(--muted); font-size: 10px; }
.source-strip > a { color: var(--purple); font-size: 11px; font-weight: 750; }

.auth-page { min-height: 100vh; background: #f7f6fb; }
.setup-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(330px, .78fr) minmax(600px, 1.22fr); }
.auth-intro { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(30px, 5vw, 70px); color: white; background: radial-gradient(circle at 80% 18%, #8676ff 0, transparent 30%), linear-gradient(145deg, #29233f, #443976); }
.auth-intro .brand { margin: 0; }
.auth-intro h1 { max-width: 520px; font-size: clamp(36px, 5vw, 60px); }
.auth-intro p { max-width: 520px; color: #d1cce5; font-size: 17px; }
.trust-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; color: #d8d3e7; font-size: 12px; }
.trust-list li::before { margin-right: 9px; color: #8ee0c1; content: "✓"; }
.auth-form-panel { display: grid; place-items: center; padding: 45px 25px; }
.auth-form-wide { width: min(720px, 100%); }
.auth-form-wide > h2 { margin: 12px 0 5px; font-size: 28px; }
.auth-form-wide .form-grid { padding: 0; }
.step-chip { display: inline-block; padding: 6px 10px; border-radius: 999px; color: var(--purple); background: #ebe8ff; font-size: 10px; font-weight: 800; }
.login-shell { display: grid; min-height: 100vh; place-items: center; padding: 25px; background: radial-gradient(circle at 15% 20%, #e7e2ff, transparent 30%), radial-gradient(circle at 85% 80%, #dff7ef, transparent 28%), #f7f6fb; }
.login-card { display: flex; width: min(440px, 100%); flex-direction: column; gap: 30px; padding: 40px; border: 1px solid white; border-radius: 22px; background: rgba(255,255,255,.92); box-shadow: 0 24px 70px #2c235815; }
.login-card h1 { margin-top: 7px; }
.security-note { margin: -8px 0 0; color: #9994a4; font-size: 9px; text-align: center; }

@media (max-width: 1080px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .invoice-line { grid-template-columns: 2fr 80px 110px 100px 95px 30px; }
    .help-grid, .trade-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .setup-shell { grid-template-columns: 360px minmax(0, 1fr); }
    .page-header { align-items: flex-start; }
    .page-header > :last-child { flex: 0 0 auto; }
}

@media (max-width: 850px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
    body.menu-open .sidebar { transform: translateX(0); }
    .sidebar-overlay { position: fixed; z-index: 25; inset: 0; display: none; background: #17132788; }
    body.menu-open .sidebar-overlay { display: block; }
    .main-area { margin-left: 0; }
    .menu-button { display: block; font-size: 21px; }
    .mobile-brand { display: inline; margin-left: 10px; font-weight: 800; }
    .topbar > div:first-of-type { flex: 1; }
    .status-dot { display: none; }
    .content { padding: 25px 20px 50px; }
    .hero-grid, .content-grid, .split-layout, .bank-import-grid, .vat-import-content, .vat-view-grid, .invoice-view-grid, .balance-grid { grid-template-columns: minmax(0, 1fr); }
    .sticky-form { position: static; }
    .invoice-side { grid-row: 1; }
    .invoice-paper { min-height: 0; }
    .vat-hero { align-items: flex-start; flex-direction: column; }
    .setup-shell { grid-template-columns: minmax(0, 1fr); }
    .auth-intro { min-height: 420px; }
}

@media (max-width: 620px) {
    .topbar { min-height: 64px; padding: 10px 15px; }
    .topbar .top-actions .button { display: none; }
    .content { width: 100%; max-width: 100%; overflow-x: clip; padding: 20px 14px 42px; }
    .page-header { align-items: flex-start; flex-direction: column; }
    .page-header > div:first-child { width: 100%; }
    .metric-grid, .metric-grid.two, .metric-grid.three, .help-grid, .trade-grid, .account-grid { grid-template-columns: minmax(0, 1fr); }
    .welcome-card { align-items: flex-start; flex-direction: column; gap: 24px; }
    .welcome-card { width: 100%; padding: 27px 24px; }
    .welcome-card > div:first-child { width: 100%; }
    .completion-ring { align-self: center; }
    .app-modal-card { padding: 30px 20px 23px; border-radius: 19px; }
    .app-modal-actions { flex-direction: column-reverse; }
    .app-modal-actions .button { width: 100%; }
    .deadline-card { width: 100%; }
    .form-grid { grid-template-columns: minmax(0, 1fr); padding: 0 17px; }
    .form-panel > .stack { padding-inline: 17px; }
    .choice-cards { grid-template-columns: minmax(0, 1fr); }
    .span-2 { grid-column: span 1; }
    .panel-heading { padding: 18px 17px 14px; }
    .invoice-lines { padding: 0 17px; }
    .invoice-line { position: relative; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-right: 35px; }
    .line-description, .line-total { grid-column: span 2; }
    .line-total { text-align: left; }
    .remove-line { position: absolute; top: 15px; right: 0; }
    .invoice-addresses { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 35px 0; }
    .invoice-addresses div:last-child { grid-column: span 2; }
    .invoice-word { display: none; }
    .invoice-paper { padding: 24px 18px; }
    .invoice-layout > .form-panel > .field { padding-inline: 17px; }
    .vat-prepare { width: 100%; flex-wrap: wrap; }
    .vat-prepare label { flex: 1; }
    .vat-prepare .button { width: 100%; }
    .vat-import-panel .panel-heading { align-items: flex-start; }
    .vat-import-panel .panel-heading .button { width: 100%; }
    .vat-import-content { padding: 0 17px 17px; }
    .vat-manual-start { align-items: stretch; flex-direction: column; }
    .vat-manual-start .button { width: 100%; }
    .vat-review-hint { margin-inline: 17px; }
    .vat-pdf-review-list { padding: 0 17px 17px; }
    .vat-pdf-review-title, .vat-pdf-review-actions { align-items: stretch; flex-direction: column; }
    .vat-pdf-review-actions form, .vat-pdf-review-actions .button { width: 100%; }
    .vat-pdf-document-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .vat-pdf-payment-field { grid-column: span 2; }
    .bars { gap: 5px; padding-inline: 15px; }
    .source-strip { align-items: flex-start; flex-direction: column; }
    .callout { align-items: flex-start; flex-wrap: wrap; }
    .callout > .button { width: calc(100% - 43px); margin-left: 43px; }
    .expense-list article, .contact-list article { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
    .expense-list .edit-link, .contact-list .edit-link { grid-column: 2 / 4; justify-self: end; }
    .trade-card { flex-wrap: wrap; }
    .trade-card .edit-link { margin-left: auto; }
    .activity-item { flex-wrap: wrap; }
    .activity-item .edit-link { margin-left: auto; }
    .report-actions { width: 100%; flex-wrap: wrap; }
    .report-actions > * { flex: 1 1 auto; }
    .report-actions .button { white-space: normal; }
    .balance-summary { align-items: stretch; flex-direction: column; }
    .balance-equals { display: none; }
    .balance-date-form { width: 100%; }
    .balance-date-form label { flex: 1; }
    .auth-intro { min-height: 360px; padding: 30px 25px; }
    .auth-intro h1 { font-size: 38px; }
    .auth-form-panel { padding: 35px 16px; }
    .login-card { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
    .app-modal[open], .app-modal::backdrop { animation: none; }
}

@media print {
    body { background: white; }
    .sidebar, .topbar, .page-header, .no-print, .alert { display: none !important; }
    .main-area { margin: 0; }
    .content { width: 100%; padding: 0; }
    .invoice-view-grid { display: block; }
    .invoice-paper { min-height: 0; border: 0; box-shadow: none; }
}
.api-key-output {
    width: min(100%, 760px);
    margin-top: 12px;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

/* Compact, mobile-first ledger and correction views reuse the application's form styles. */
.booking-section, .booking-filter { padding: 20px; margin-bottom: 20px; }
.booking-section h2, .booking-section h3 { margin-bottom: 12px; }
.booking-section > p { margin: 12px 0; }
.booking-table-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
.booking-table { border-collapse: collapse; width: 100%; font-size: .875rem; }
.booking-table th, .booking-table td { padding: 12px; border-bottom: 1px solid #e8e6ef; text-align: left; vertical-align: top; }
.booking-table th { white-space: nowrap; color: #635d73; }
.booking-table td:first-child { white-space: nowrap; }
.booking-pagination { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 16px; }
.booking-editor-line { min-width: 0; padding: 16px; margin: 12px 0; border: 1px solid #e8e6ef; border-radius: 12px; }
.booking-history-item { padding: 16px 0; border-bottom: 1px solid #e8e6ef; }
.booking-history-item p { margin: 8px 0; overflow-wrap: anywhere; }
[data-modal-message] { white-space: pre-line; max-height: 55vh; overflow-y: auto; }
@media (min-width: 900px) { .booking-filter .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
