:root {
    font-family:Inter,"Segoe UI",Arial,sans-serif;
    color:#22334b;
    background:#f6f8fb;
    font-synthesis:none;
}

textarea {
    display: block;
    width: 100%;
    border: 1px solid #d9e1ec;
    border-radius: 7px;
    padding: 12px;
    margin: 8px 0 18px;
    color: #253954;
    font: inherit;
    resize: vertical;
}
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset:disabled input, fieldset:disabled textarea { background: #f5f7fa; color: #67788c; }
.site-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-link + .nav-link { margin-top: 12px; }
.nav-link:hover { background: #20364f; }
.nav-link.active { background: #315fba; color: white; font-weight: 650; }
.sidebar-company { margin-top: 26px; padding-top: 22px; border-top: 1px solid #304158; }
.sidebar-company .eyebrow { font-size: 9px; color: #8da0b8; letter-spacing: 1.3px; }
.sidebar-company h2 { margin: 10px 0 16px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.sidebar-access { display: block; color: #c6b5e5; font-size: 11px; margin: -8px 0 16px; }
.company-nav { display: grid; gap: 6px; }
.company-nav .nav-link { margin: 0; }
.sidebar .company-nav { gap: 4px; }
.company-nav-group { padding: 0; margin: 0; border: 0; }
.company-nav-toggle { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; cursor: pointer; padding: 10px 8px; color: #b9c7d8; font-size: 12px; font-weight: 600; text-align: left; }
.company-nav-toggle::before { content: '›'; font-size: 15px; transition: transform .1s; }
.company-nav-toggle[aria-expanded="true"] { color: white; }
.company-nav-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.company-nav-entries { display: grid; gap: 3px; padding: 2px 0 6px; }
.company-nav-entries[hidden] { display: none !important; }
.company-nav-entries .nav-link { margin: 0; padding: 9px 12px; }
.administration-nav { margin-top: 8px; }
.sidebar-company { margin-top: 18px; padding-top: 16px; }
.company-subnav { display: grid; gap: 4px; margin: -2px 0 6px 14px; padding-left: 9px; border-left: 1px solid #405169; }
.company-subnav .nav-link { padding: 8px 12px; font-size: 12px; }
.workspace-tabs { display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 1px solid #d9e1ec; margin: 20px 0 24px; }
.workspace-tabs a { display: block; padding: 12px 16px; color: #557092; border-bottom: 3px solid transparent; }
.workspace-tabs a[aria-current="page"] { border-color: #315fba; color: #22334b; font-weight: 650; }
.workspace-tabs a:hover { background: #edf2fa; }
.workspace-tabs > span { display: block; padding: 12px 16px; color: #557092; border-bottom: 3px solid transparent; }
.workspace-tabs > span[aria-current="step"] { border-color: #315fba; color: #22334b; font-weight: 650; }
.invoice-list .invoice-select { display: block; }
select { display: block; width: 100%; padding: 12px; margin: 8px 0 18px; border: 1px solid #d9e1ec; border-radius: 7px; background: white; color: #253954; font: inherit; min-width: 0; }
.checkbox-row { display: flex; align-items: center; gap: 9px; margin: 10px 0 20px; }
.checkbox-row input { width: auto; margin: 0; padding: 0; }
.journal-line { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr) minmax(0,1fr) auto; gap: 12px; align-items: center; }
.journal-line .button { margin-top: 6px; }
.journal-table { overflow-x: auto; }
.posting-detail { margin-top: 24px; padding: 20px; }
.payments-panel { margin-top: 26px; border-top: 1px solid #e7edf4; padding-top: 22px; }
.payment-form { margin-top: 22px; }
.payment-form .form-grid { gap: 0 10px; }
.payment-history { border-bottom: 1px solid #edf1f6; padding: 10px 0; }
.status.outstanding { color: #9a721d; background: #fff2d5; }
.settings-form { max-width: 900px; }
.settings-form h2 { margin-bottom: 20px; }
.settings-form h2:not(:first-child) { margin-top: 20px; }
.settings-history { max-width: 900px; margin-top: 30px; }
.settings-history details { margin: 12px 0; padding: 16px 20px; font-size: 12px; }
.settings-history summary { cursor: pointer; color: #557092; }
.settings-history dl { margin-top: 20px; }
.settings-history dt { font-weight: 650; margin-top: 12px; }
.settings-history dd { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty-state { padding: 20px; font-size: 12px; }
.document-table { overflow-x: auto; }
.document-table td:first-child { overflow-wrap: anywhere; }

@media (max-width: 720px) {
    .sidebar nav { display: flex !important; flex-wrap: wrap; gap: 10px; margin-top: 15px; }
    .sidebar .nav-link { margin: 0; padding: 9px; }
    .sidebar form { display: block !important; }
    .sidebar-company { margin-top: 18px; padding-top: 16px; }
    .sidebar .company-nav .nav-link { margin: 0; }
    .journal-line { grid-template-columns: 1fr 1fr; }
    .journal-line label:first-child { grid-column: 1 / -1; }
}

* {
    box-sizing:border-box;
}

body {
    margin:0;
}

a {
    color:inherit;
    text-decoration:none;
}

button,input {
    font:inherit;
}

button,a,input {
    touch-action:manipulation;
}

button:focus-visible,a:focus-visible {
    outline:3px solid #b5cafa;
    outline-offset:3px;
}

button {
    cursor:pointer;
}

h1 {
    font-size:36px;
    line-height:1.2;
    letter-spacing:-1.2px;
    margin:10px 0;
}

h2 {
    font-size:19px;
    letter-spacing:-.35px;
    margin:0;
}

h3 {
    margin-top:0;
}

p {
    line-height:1.6;
    margin:8px 0;
}

.shell {
    display:grid;
    grid-template-columns:245px minmax(0,1fr);
    min-height:100vh;
}

.sidebar {
    background:#142438;
    color:#e4edf8;
    padding:35px 24px;
    display:flex;
    flex-direction:column;
    position:sticky;
    top:0;
    height:100vh;
    overflow-y:auto;
}

.brand {
    font-size:23px;
    font-weight:750;
    letter-spacing:-1px;
    display:flex;
    align-items:center;
    gap:8px;
}

.brand-mark {
    background:#5481f5;
    border-radius:9px;
    padding:1px 9px;
    color:white;
    font-size:24px;
}

.brand-dot {
    color:#71a0ff;
    margin-left:-8px;
}

.edition {
    color:#8297b0;
    font-size:9px;
    letter-spacing:1.9px;
    margin:18px 0 45px;
}

.nav-link {
    display:flex;
    gap:13px;
    align-items:center;
    font-size:13px;
    background:transparent;
    border-radius:8px;
    padding:15px;
}

.nav-link span {
    font-size:21px;
}

.sidebar-note {
    color:#8da0b8;
    font-size:12px;
    line-height:1.9;
    margin-top:auto;
    padding-top:60px;
    padding-bottom:26px;
    border-bottom:1px solid #304158;
}

.signed-in {
    display:flex;
    gap:10px;
    align-items:center;
    padding:25px 0 10px;
    font-size:11px;
}

.signed-in strong,.signed-in small {
    display:block;
}

.signed-in small {
    color:#8da0b8;
    margin-top:5px;
}

.avatar {
    width:35px;
    height:35px;
    border-radius:50%;
    background:#31465e;
    display:grid;
    place-items:center;
    color:#b3caff;
    font-weight:bold;
}

.signout {
    background:none;
    color:#a9b9cc;
    border:0;
    padding:12px 0;
    font-size:12px;
}

.main-content {
    padding:30px 45px 55px;
    max-width:1660px;
    width:100%;
    margin:0 auto;
}

.page-top {
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:42px;
}

.breadcrumb {
    font-size:12px;
    color:#718099;
}

.pill {
    color:#65768d;
    border:1px solid #dce4ee;
    background:white;
    border-radius:6px;
    padding:6px 11px;
    font-size:11px;
}

.page-heading {
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:30px;
    gap:20px;
}

.eyebrow {
    font-size:10px;
    letter-spacing:1.7px;
    color:#58749b;
    font-weight:750;
}

.intro {
    color:#74829a;
    font-size:14px;
}

.muted {
    color:#7c899d;
}

.small {
    font-size:12px;
}

.company-count {
    font-size:12px;
    background:#e9eef7;
    padding:9px 13px;
    border-radius:20px;
    color:#637b9b;
}

.company-grid {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:23px;
    max-width:1000px;
}

.company-card {
    border:1px solid #dfe6ef;
    border-radius:13px;
    background:white;
    padding:25px;
    transition:box-shadow .2s,transform .2s;
}

.company-card:hover {
    box-shadow:0 8px 30px #1d3d6b0e;
    transform:translateY(-2px);
}

.company-card-top {
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:25px;
}

.company-icon {
    display:grid;
    place-items:center;
    background:#edf2ff;
    color:#5277cb;
    border-radius:11px;
    width:49px;
    height:49px;
    font-size:22px;
    font-weight:700;
}

.role,.status {
    font-size:10px;
    font-weight:650;
    border-radius:5px;
    background:#edf3ff;
    color:#5279b4;
    padding:6px 9px;
    white-space:nowrap;
}

.role.viewer {
    background:#f2eef9;
    color:#8063a9;
}

.company-card p {
    color:#8190a6;
    font-size:12px;
    margin-top:12px;
}

.card-footer {
    border-top:1px solid #edf0f5;
    margin-top:25px;
    padding-top:19px;
    font-size:12px;
    font-weight:600;
    color:#4e71a7;
    display:flex;
    justify-content:space-between;
}

.workspace-note {
    display:flex;
    align-items:center;
    gap:16px;
    margin-top:32px;
    border:1px solid #e0e7ef;
    background:#f0f4f9;
    padding:21px;
    border-radius:10px;
    max-width:1000px;
    font-size:12px;
}

.workspace-note p {
    color:#7b8a9f;
    margin:5px 0 0;
}

.note-icon {
    color:#7395bd;
    border:1px solid #bbcee2;
    width:29px;
    height:29px;
    border-radius:50%;
    display:grid;
    place-items:center;
}

.login-container {
    max-width:480px;
    margin:65px auto;
}

.login-card {
    margin-top:28px;
    padding:30px;
    background:white;
    border:1px solid #dfe6ef;
    border-radius:12px;
}

.login-card h2 {
    margin-bottom:25px;
}

label {
    display:block;
    font-size:12px;
    color:#536880;
    font-weight:600;
}

input {
    display:block;
    width:100%;
    border:1px solid #d9e1ec;
    border-radius:7px;
    background:white;
    color:#253954;
    padding:12px;
    margin:8px 0 18px;
    min-width:0;
}

input:focus {
    outline:3px solid #e0e9ff;
    border-color:#82a0e6;
}

.button {
    display:inline-flex;
    justify-content:center;
    align-items:center;
    gap:12px;
    font-size:12px;
    font-weight:600;
    padding:11px 16px;
    border:1px solid #d8e1ed;
    border-radius:7px;
    background:white;
    color:#4b6180;
    white-space:nowrap;
}

.button.primary {
    background:#416fd9;
    color:white;
    border-color:#416fd9;
}

.button:hover {
    filter:brightness(.97);
}

.button:disabled {
    opacity:.5;
    cursor:wait;
}

.button.full {
    width:100%;
    justify-content:space-between;
}

.stat-grid {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:20px;
    margin:20px 0 38px;
}

.stat-card {
    padding:23px;
    background:white;
    border:1px solid #e0e6ef;
    border-radius:9px;
}

.stat-card span,.stat-card small {
    display:block;
    font-size:11px;
    color:#7f8ca1;
}

.stat-card strong {
    display:block;
    margin:15px 0 11px;
    font-size:29px;
    letter-spacing:-.8px;
}

.stat-card .balanced {
    font-size:24px;
    color:#2b8e76;
}

.section-heading {
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin:25px 0 16px;
    gap:12px;
}

.section-heading p {
    font-size:11px;
    margin-bottom:0;
}

.panel {
    background:white;
    border:1px solid #dfe6f0;
    border-radius:10px;
    overflow:hidden;
}

.utility-panel { padding:24px; margin-bottom:20px; }
.utility-panel > h2:first-child { margin-top:0; }
.utility-panel .pagination { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:20px; }
.utility-panel details { padding:12px 0; border-bottom:1px solid #dfe6f0; }
.utility-panel summary { cursor:pointer; font-weight:600; }
.utility-panel p, .utility-panel dd { overflow-wrap:anywhere; }
.utility-panel .editor-actions { flex-wrap:wrap; }
.utility-summary { display:grid; grid-template-columns:minmax(140px,1fr) minmax(0,2fr); gap:12px 24px; margin:20px 0; }
.utility-summary dt { color:#65758b; }
.utility-summary dd { margin:0; }
@media(max-width:600px) {
    .utility-panel { padding:16px; }
    .utility-summary { grid-template-columns:1fr; gap:5px; }
    .utility-summary dd { margin-bottom:12px; }
}

.invoice-grid {
    display:grid;
    grid-template-columns:minmax(0,1.35fr) minmax(310px,1fr);
    gap:23px;
    align-items:start;
}

table {
    width:100%;
    border-collapse:collapse;
    font-size:11px;
}

th {
    text-align:left;
    background:#f9fbfd;
    color:#8491a5;
    font-size:10px;
    font-weight:600;
    padding:16px;
}

td {
    padding:16px;
    border-top:1px solid #edf1f6;
}

th.number,td.number {
    text-align:right;
    white-space:nowrap;
}

.invoice-select {
    background:none;
    border:0;
    text-align:left;
    padding:0;
    color:#526b8d;
    font-size:11px;
}

.invoice-select strong,.invoice-select span {
    display:block;
}

.invoice-select span {
    color:#8491a5;
    font-size:10px;
    margin-top:7px;
}

.selected {
    background:#f4f7ff;
}

.invoice-detail {
    padding:24px;
    font-size:12px;
}

.detail-header {
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:26px;
}

.detail-header h2 {
    font-size:23px;
    margin-top:7px;
}

.status {
    background:#eaf5f0;
    color:#438c76;
}

.invoice-detail hr {
    border:0;
    border-top:1px solid #e7edf4;
    margin:21px 0;
}

.amount-row {
    display:flex;
    justify-content:space-between;
    gap:15px;
    font-size:11px;
    margin:13px 0;
}

.amount-row small {
    display:block;
    color:#8e9aac;
    font-size:10px;
    margin-top:5px;
}

.amount-row.total {
    font-size:15px;
    padding-top:12px;
}

.document-actions {
    display:flex;
    gap:9px;
    flex-wrap:wrap;
    margin-top:25px;
}

.document-actions .button {
    flex:1;
}

.text-link {
    font-size:10px;
    color:#5679b3;
    padding:7px 0;
    text-decoration:underline;
}

button.text-link {
    border:0;
    background:transparent;
    cursor:pointer;
    font-family:inherit;
    font-size:12px;
}

.ledger-section {
    margin-top:35px;
}

tfoot {
    background:#f7f9fc;
    font-weight:bold;
}

.account-code {
    color:#a2adbc;
    margin-right:16px;
}

.notice {
    border:1px solid #d9e4f4;
    background:#edf3fe;
    color:#5d78a5;
    padding:14px 17px;
    border-radius:8px;
    font-size:12px;
}

.notice.error,.validation-message,.validation-errors {
    color:#ad3d4f;
    background:#fff2f2;
}

.editor {
    padding:25px;
    margin-bottom:20px;
}

.form-grid {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:0 20px;
}

.line-editor {
    display:grid;
    grid-template-columns:2fr 1fr 1fr;
    gap:15px;
}

.editor-actions {
    display:flex;
    align-items:center;
    gap:20px;
}

.editor-actions label {
    margin-left:auto;
    max-width:100px;
}

.editor-actions input {
    margin:5px 0;
}

#blazor-error-ui {
    display:none;
}

@media(min-width:1500px) {
    .main-content {
        padding:35px 65px 60px;
    }
}

@media(max-width:1100px) {
    .shell {
        grid-template-columns:195px minmax(0,1fr);
    }
    .sidebar {
        padding:30px 17px;
    }
    .brand {
        font-size:19px;
    }
    .main-content {
        padding:25px;
    }
    .invoice-grid {
        grid-template-columns:1fr;
    }
    .company-grid {
        gap:15px;
    }
    .stat-card {
        padding:17px;
    }
    .stat-card strong {
        font-size:23px;
    }
}

@media(max-width:720px) {
    .shell {
        display:block;
    }
    .sidebar {
        position:static;
        width:100%;
        height:auto;
        padding:18px 22px;
        display:block;
    }
    .sidebar nav,.sidebar-note,.edition,.signed-in,.sidebar form {
        display:none;
    }
    .main-content {
        padding:22px 17px;
    }
    .page-top {
        margin-bottom:26px;
    }
    h1 {
        font-size:29px;
    }
    .company-grid {
        grid-template-columns:1fr;
    }
    .stat-grid {
        gap:8px;
    }
    .stat-card {
        padding:13px 10px;
    }
    .stat-card strong {
        font-size:19px;
    }
    .stat-card .balanced {
        font-size:16px;
    }
    .page-heading {
        gap:12px;
    }
    .form-grid,.line-editor {
        grid-template-columns:1fr;
    }
    .login-container {
        margin:35px auto;
    }
    .editor-actions {
        flex-wrap:wrap;
    }
    .stat-card small {
        font-size:9px;
    }
}

/* Bank statements keep their original columns in a scrollable table. */
.bank-table-scroll { overflow-x: auto; max-width: 100%; margin-top: 18px; }
.bank-records { min-width: 1160px; font-size: .8rem; }
.bank-records td { vertical-align: top; }
.bank-description { min-width: 180px; white-space: pre-wrap; }
.duplicate-warning { display: block; color: #965500; font-size: .7rem; min-width: 95px; }
.import-preview, .import-detail { margin: 24px 0; min-width: 0; }
.main-content { min-width: 0; }
.import-file-list { margin-top: 20px; table-layout: fixed; }
.import-file-list th:first-child { width: 55px; }
.import-file-list td { vertical-align: top; overflow-wrap: anywhere; }
.import-file-list td span { display: block; }
.import-file-list select { min-width: 0; }
.import-file-error { color: #a03030; margin-top: 5px; }
.financial-report { margin-top: 24px; padding: 28px; }
.report-filter { min-width: 210px; }
.report-total { background: #f4f7fb; font-weight: 700; }
.report-downloads { display: flex; gap: 8px; flex-wrap: wrap; }
.record-search { display: flex; gap: 16px; align-items: end; margin: 20px 0; flex-wrap: wrap; }
.record-search > label:first-child { flex: 1; min-width: 200px; }
.record-search .checkbox-row { margin-bottom: 12px; }
.record-paging { display: flex; gap: 16px; align-items: center; justify-content: end; margin: 16px 0; flex-wrap: wrap; }
.record-detail { padding: 28px; margin-top: 24px; }
.record-editor { margin-top: 24px; }
.record-section { margin: 20px 0; }
.record-section summary { cursor: pointer; font-weight: 600; margin-bottom: 16px; }
.preserve-lines { white-space: pre-line; }
.record-picker { margin: 12px 0; }
.record-lookup { width: min(640px, calc(100vw - 32px)); max-height: min(760px, calc(100dvh - 32px)); padding: 0; border: 1px solid #dbe3ec; border-radius: 14px; color: #202f40; background: #fff; box-shadow: 0 24px 80px #10233f40; }
.record-lookup::backdrop { background: #10233f66; }
.record-lookup[open] { display: flex; flex-direction: column; }
.lookup-header, .lookup-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 22px; flex-shrink: 0; }
.lookup-header { border-bottom: 1px solid #e2e8f0; }
.lookup-header h2 { font-size: 1.2rem; margin: 0; }
.lookup-close { border: 0; background: transparent; font-size: 1.8rem; color: #526176; cursor: pointer; padding: 0 8px; }
.lookup-search { padding: 16px 22px 0; }
.lookup-search label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.lookup-search > div { display: flex; gap: 8px; }
.lookup-search input { flex: 1; min-width: 0; }
.lookup-status { padding: 0 22px; margin: 10px 0; min-height: 20px; }
.lookup-results { overflow-y: auto; min-height: 120px; max-height: 440px; padding: 0 12px 12px; }
.lookup-option { display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; gap: 20px; padding: 12px 10px; border: 0; border-bottom: 1px solid #edf0f5; background: white; color: inherit; cursor: pointer; }
.lookup-option:hover, .lookup-option:focus-visible { background: #edf3ff; outline: 2px solid #5269cf; outline-offset: -2px; border-radius: 6px; }
.lookup-option strong, .lookup-option small { display: block; overflow-wrap: anywhere; }
.lookup-option small { margin-top: 3px; color: #637186; }
.lookup-select { color: #3e56b4; font-size: .8rem; flex-shrink: 0; }
.lookup-footer { border-top: 1px solid #e2e8f0; }
.record-lookup .notice { margin: 0 22px 12px; }
.account-select-value { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; min-height: 42px; }
.account-select-value .record-picker { margin: 0; }
.account-select-label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; }
.picker-content { padding: 18px; background: #f5f8fc; border: 1px solid #dbe3ec; border-radius: 8px; margin: 10px 0; }
.picker-content > button { margin-right: 10px; }
.picker-choice { display: block; width: 100%; text-align: left; border: 1px solid #dce4ed; background: white; border-radius: 6px; padding: 12px; margin-top: 8px; cursor: pointer; }
.picker-choice span { display: block; color: #637186; font-size: .8rem; margin-top: 4px; }
.invoice-editor-line { border-bottom: 1px solid #e0e6ed; padding-bottom: 16px; margin: 16px 0; }
.bill-editor-line { border-bottom: 1px solid #e0e6ed; padding-bottom: 16px; margin: 16px 0; }
.posting-detail td small { display: block; margin-top: 4px; }
.journal-table td > small { display: block; margin-top: 4px; }
.bank-category-line { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1fr) auto; gap: 12px; align-items: center; }
.picker-choice.chosen { border-color: #5269cf; background: #edf1ff; }
.reconciliation-summary { margin-top: 22px; }
.auth-shell { min-height: 100vh; padding: 32px 24px; }
.auth-brand { max-width: 1120px; margin: 0 auto; }
.auth-brand .brand { display: inline-flex; }
.auth-content { max-width: 1120px; margin: 0 auto; }
.auth-switch { text-align: center; margin-top: 24px; font-size: 13px; }
.audit-values { max-width: 36rem; }
.audit-values dt { font-weight: 600; margin-top: 10px; }
.audit-values dd { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.table-scroll { overflow-x: auto; max-width: 100%; margin-top: 18px; }
.format-columns { min-width: 800px; }
.format-columns td { vertical-align: top; }
.format-columns input, .format-columns select { min-width: 110px; }
.statement-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 28rem; overflow-y: auto; font-size: 12px; }
.statement-csv { font-family: Consolas, monospace; font-size: 12px; white-space: pre; overflow-x: auto; }
