:root {
    --green: #7cfc00;
    --green-strong: #69d900;
    --charcoal: #13210f;
    --charcoal-2: #1b2d16;
    --forest: #254b1f;
    --mist: #f4f8f1;
    --mist-2: #edf4e8;
    --line: #dce6d7;
    --muted: #667160;
    --white: #fff;
    --danger: #b42318;
    --shadow: 0 16px 40px rgba(19, 33, 15, .08);
    --sidebar: 270px;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; color: var(--charcoal); background: #f7faf5; font-family: "Segoe UI", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; width: var(--sidebar); display: flex; flex-direction: column; overflow-y: auto; color: #fff; background: var(--charcoal); }
.brand { display: flex; min-height: 104px; align-items: center; padding: 22px 28px; border-bottom: 1px solid rgba(255,255,255,.09); }
.brand img { display: block; width: 160px; max-height: 60px; }
.nav-list { padding: 20px 16px; }
.nav-label { margin: 24px 12px 9px; color: #8fa589; font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.nav-item { min-height: 46px; margin: 4px 0; padding: 0 12px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 9px; border-radius: 12px; color: #cbd7c7; text-decoration: none; font-size: .91rem; font-weight: 650; transition: .18s ease; }
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.active { color: var(--charcoal); background: var(--green); box-shadow: 0 9px 24px rgba(124,252,0,.18); }
.nav-icon { width: 28px; text-align: center; font-size: 1.12rem; font-weight: 800; }
.nav-item small { padding: 3px 6px; border: 1px solid rgba(255,255,255,.13); border-radius: 999px; color: #8fa589; font-size: .6rem; text-transform: uppercase; }
.nav-item.disabled { cursor: default; opacity: .72; }
.sidebar-foot { margin-top: auto; padding: 22px 28px 26px; border-top: 1px solid rgba(255,255,255,.09); }
.sidebar-foot p { margin: 11px 0 0; color: #9cad96; font-size: .78rem; }
.release-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border-radius: 999px; background: rgba(124,252,0,.08); color: #dbe8d7; font-size: .68rem; font-weight: 700; }
.release-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(124,252,0,.1); }

.app-main { min-width: 0; grid-column: 2; }
.topbar { position: sticky; top: 0; z-index: 30; min-height: 78px; display: flex; align-items: center; gap: 18px; padding: 12px 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); }
.company-switcher { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.company-switcher strong { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; }
.company-switcher form { margin: 0; }
.company-switcher select { max-width: 360px; padding: 2px 24px 2px 0; border: 0; outline: 0; color: var(--charcoal); background: transparent; font-weight: 750; }
.eyebrow, .page-kicker { color: var(--forest); font-size: .68rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.icon-button { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; color: var(--forest); background: white; cursor: pointer; }
.icon-button:hover { border-color: #b7c9b1; background: var(--mist); }
.mobile-menu { display: none; }
.user-menu { position: relative; }
.user-menu summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.user-menu summary::-webkit-details-marker { display: none; }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--charcoal); background: var(--green); font-weight: 900; }
.user-copy { display: flex; flex-direction: column; max-width: 190px; }
.user-copy strong, .user-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: .84rem; }
.user-copy small { color: var(--muted); font-size: .7rem; }
.user-menu-panel { position: absolute; top: calc(100% + 12px); right: 0; width: 250px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: var(--shadow); }
.user-menu-panel > span { display: block; padding: 3px 5px 13px; color: var(--muted); font-size: .76rem; line-height: 1.45; overflow-wrap: anywhere; }
.user-menu-panel button { width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; color: var(--charcoal); background: var(--mist); cursor: pointer; font-weight: 700; text-align: left; }

.content { width: min(1460px, 100%); margin: 0 auto; padding: 36px 38px 70px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-header.compact { align-items: center; }
.page-header h1 { max-width: 760px; margin: 5px 0 7px; font-size: clamp(1.7rem, 2.6vw, 2.45rem); line-height: 1.12; letter-spacing: -.035em; }
.page-header p { margin: 0; color: var(--muted); font-size: .94rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.back-link { display: inline-block; margin-bottom: 8px; color: var(--forest); font-size: .8rem; font-weight: 750; text-decoration: none; }
.button { min-height: 44px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 12px; cursor: pointer; text-decoration: none; font-weight: 800; transition: .17s ease; }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button-primary { color: var(--charcoal); background: var(--green); border-color: var(--green-strong); box-shadow: 0 8px 22px rgba(105,217,0,.16); }
.button-primary:hover:not(:disabled) { transform: translateY(-1px); background: #8bff1d; }
.button-secondary { color: var(--charcoal); border-color: var(--line); background: white; }
.button-ghost { color: var(--forest); background: transparent; }
.button-full { width: 100%; }

.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric-card, .panel { border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 7px 28px rgba(19,33,15,.04); }
.metric-card { position: relative; min-height: 148px; padding: 21px; overflow: hidden; }
.metric-card.accent::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--green); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .79rem; font-weight: 700; }
.metric-top i { padding: 4px 7px; border-radius: 999px; color: var(--forest); background: var(--mist); font-size: .62rem; font-style: normal; text-transform: uppercase; }
.metric-card > strong { display: block; margin: 22px 0 6px; font-size: 1.72rem; line-height: 1; letter-spacing: -.03em; }
.metric-card > small { color: var(--muted); font-size: .74rem; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(330px, .75fr); align-items: start; gap: 20px; margin-bottom: 20px; }
.panel { padding: 22px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.panel-head h2 { margin: 4px 0 0; font-size: 1.16rem; }
.panel-head > span, .data-state { color: var(--muted); font-size: .74rem; }
.data-state { padding: 7px 9px; border-radius: 9px; background: var(--mist); }
.chart-placeholder { position: relative; height: 250px; border-radius: 14px; overflow: hidden; background: repeating-linear-gradient(to bottom, #fff 0, #fff 61px, #edf2ea 62px, #fff 63px); }
.chart-rule { position: absolute; inset: 10px auto auto 10px; color: #91a08b; font-size: .63rem; }
.bars { position: absolute; inset: 35px 24px 25px 42px; display: flex; align-items: flex-end; gap: clamp(5px, 1.7vw, 18px); }
.bars i { flex: 1; min-width: 6px; border-radius: 6px 6px 2px 2px; background: linear-gradient(to top, var(--forest), var(--green)); opacity: .82; }
.panel-note { margin: 13px 0 0; color: var(--muted); font-size: .74rem; }
.cash-flow-chart { min-height: 270px; padding: 12px 12px 0; display: flex; flex-direction: column; border-radius: 14px; background: repeating-linear-gradient(to bottom, #fff 0, #fff 61px, #edf2ea 62px, #fff 63px); }
.cash-flow-legend { display: flex; justify-content: flex-end; gap: 15px; color: var(--muted); font-size: .65rem; }
.cash-flow-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cash-flow-legend i { width: 9px; height: 9px; border-radius: 3px; }
.cash-flow-legend .money-in { background: var(--green-strong); }
.cash-flow-legend .money-out { background: var(--forest); }
.cash-flow-bars { min-height: 220px; flex: 1; display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(8px, 2vw, 24px); align-items: end; }
.cash-flow-month { min-width: 0; height: 210px; display: grid; grid-template-rows: 1fr auto; gap: 8px; }
.cash-flow-pair { min-height: 0; display: flex; align-items: flex-end; justify-content: center; gap: 5px; }
.cash-flow-pair i { width: min(24px, 36%); min-height: 0; border-radius: 6px 6px 2px 2px; }
.cash-flow-pair .money-in { background: linear-gradient(to top, var(--green-strong), var(--green)); }
.cash-flow-pair .money-out { background: linear-gradient(to top, var(--charcoal), #4b7343); }
.cash-flow-month > span { color: var(--muted); font-size: .64rem; font-weight: 750; text-align: center; }
.setup-list { margin: 0; padding: 0; list-style: none; }
.setup-list li { display: grid; grid-template-columns: 34px 1fr; gap: 11px; padding: 11px 0; border-bottom: 1px solid #edf2ea; }
.setup-list li > span { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; color: var(--muted); background: var(--mist); font-size: .75rem; font-weight: 850; }
.setup-list li.done > span { color: var(--charcoal); background: var(--green); }
.setup-list div { display: flex; flex-direction: column; gap: 3px; }
.setup-list strong { font-size: .81rem; }
.setup-list small { color: var(--muted); font-size: .7rem; line-height: 1.35; }
.text-link { display: inline-block; margin-top: 16px; color: var(--forest); font-size: .78rem; font-weight: 800; text-decoration: none; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.quick-grid > * { min-height: 112px; padding: 15px; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; }
.quick-grid a:hover { border-color: var(--green-strong); background: #fbfff8; }
.quick-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--forest); background: var(--mist); font-weight: 900; }
.quick-grid strong { margin-top: 5px; font-size: .83rem; }
.quick-grid small { color: var(--muted); font-size: .7rem; }
.quick-disabled { opacity: .55; }

.alert { margin: -9px 0 22px; padding: 13px 15px; border-radius: 12px; font-size: .84rem; font-weight: 700; }
.alert-success { border: 1px solid #bfe7a8; color: #21451b; background: #effbe8; }
.alert-error { border: 1px solid #efbbb5; color: var(--danger); background: #fff0ef; }
.table-panel { padding: 0; overflow: hidden; }
.table-toolbar { min-height: 70px; padding: 13px 18px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.search-field { width: min(420px, 100%); min-height: 42px; padding: 0 13px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 11px; background: #fbfdf9; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; }
.record-count { margin-left: auto; color: var(--muted); font-size: .76rem; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.data-table th, .data-table td { padding: 14px 18px; border-bottom: 1px solid #e7eee3; text-align: left; white-space: nowrap; }
.data-table th { color: var(--muted); background: var(--mist); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; }
.data-table tbody tr:hover { background: #fbfef9; }
.account-code { color: var(--forest); font-family: Consolas, monospace; }
.status-badge { padding: 5px 8px; border-radius: 999px; font-size: .67rem; font-weight: 800; }
.status-badge.active { color: #244719; background: #eaf8e2; }
.status-badge.inactive { color: #6c2f2f; background: #fff0f0; }
.status-badge.fullydepreciated { color: #174d67; background: #e6f6ff; }
.status-badge.disposed { color: #6c2f2f; background: #fff0f0; }
.status-badge.approved { color: #244719; background: #eaf8e2; }
.info-note { margin-top: 18px; padding: 17px 19px; border-left: 4px solid var(--green); border-radius: 0 12px 12px 0; background: #eef8e7; }
.info-note strong { font-size: .8rem; }
.info-note p { margin: 4px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }

/* v0.11 MyInvois sandbox */
.einvoice-boundary { margin-top: 0; font-weight: 500; line-height: 1.55; }
.einvoice-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.toolbar-subcopy { margin-top: 4px; display: block; color: var(--muted); font-size: .68rem; font-weight: 500; }
.empty-state.compact { padding: 24px; }
.empty-state.compact span { margin-top: 6px; display: block; color: var(--muted); font-size: .74rem; }
.status-badge.notprepared { color: #586457; background: #edf1eb; }
.status-badge.ready { color: #17455f; background: #e6f6ff; }
.status-badge.submitted { color: #6b4e08; background: #fff7d8; }
.status-badge.valid { color: #244719; background: #eaf8e2; }
.status-badge.validationfailed, .status-badge.invalid, .status-badge.rejected { color: #6c2f2f; background: #fff0f0; }
.text-success { color: #2f6b22; }
.text-danger { color: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.connection-panel, .tin-check-panel, .cancellation-panel { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.connection-panel h2, .tin-check-panel h2, .cancellation-panel h2 { margin: 4px 0 6px; font-size: 1.05rem; }
.connection-panel p, .tin-check-panel p, .cancellation-panel p { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.connection-result { max-width: 480px; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; color: var(--muted); font-size: .7rem; text-align: right; }
.mapping-panel + .mapping-panel { margin-top: 20px; }
.mapping-row { width: 100%; display: grid; grid-template-columns: minmax(120px, 180px) minmax(100px, 140px) auto; align-items: center; justify-content: end; gap: 8px; }
.mapping-row.tax { grid-template-columns: minmax(250px, 420px) auto; }
.mapping-row input, .mapping-row select { width: 100%; height: 35px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.einvoice-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.einvoice-summary strong { overflow-wrap: anywhere; }
.einvoice-review-grid { margin-bottom: 20px; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 20px; align-items: start; }
.lifecycle-panel h2 { margin: 5px 0 7px; font-size: 1.1rem; }
.lifecycle-panel p { margin: 0 0 18px; color: var(--muted); font-size: .76rem; line-height: 1.55; }
.api-error-panel { margin-bottom: 20px; border-color: #efbbb5; }
.api-error-panel pre { max-height: 260px; margin: 12px 0 0; padding: 14px; overflow: auto; border-radius: 10px; color: #6c2f2f; background: #fff7f6; white-space: pre-wrap; font-size: .7rem; line-height: 1.5; }
.payload-panel { margin-bottom: 20px; padding: 0; overflow: hidden; }
.payload-panel summary { padding: 18px 21px; display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }
.payload-panel summary span { display: flex; flex-direction: column; gap: 4px; }
.payload-panel summary small { color: var(--muted); font-family: Consolas, monospace; font-size: .65rem; overflow-wrap: anywhere; }
.payload-panel summary b { color: var(--forest); font-size: .72rem; }
.payload-panel pre { max-height: 520px; margin: 0; padding: 20px; overflow: auto; border-top: 1px solid var(--line); background: #10200d; color: #d9f5ce; font-size: .68rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.cancellation-panel form { min-width: min(520px, 100%); display: grid; grid-template-columns: minmax(220px, 1fr) auto; align-items: end; gap: 10px; }
.event-panel { margin-top: 20px; }
.wrap-cell { min-width: 300px; white-space: normal !important; line-height: 1.45; }

@media (max-width: 1050px) {
    .einvoice-metrics, .einvoice-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .einvoice-review-grid { grid-template-columns: 1fr; }
    .connection-panel, .tin-check-panel, .cancellation-panel { align-items: flex-start; flex-direction: column; }
    .connection-result { align-items: flex-start; text-align: left; }
    .cancellation-panel form { width: 100%; }
}

@media (max-width: 700px) {
    .einvoice-metrics, .einvoice-summary { grid-template-columns: 1fr; }
    .mapping-row, .mapping-row.tax { grid-template-columns: 1fr; justify-content: stretch; }
    .cancellation-panel form { grid-template-columns: 1fr; }
}

/* v0.10 period-end accounting */
.period-end-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-card > .metric-text { font-size: 1.15rem; line-height: 1.25; }
.period-end-action-grid { margin-bottom: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.period-end-action { min-height: 132px; display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 16px; color: var(--charcoal); text-decoration: none; transition: .18s ease; }
.period-end-action:hover { transform: translateY(-2px); border-color: #b7caaf; box-shadow: var(--shadow); }
.period-end-action > span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; color: var(--forest); background: var(--mist); font-size: .76rem; font-weight: 900; }
.period-end-action strong { display: block; margin-bottom: 5px; font-size: .95rem; }
.period-end-action p { margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.period-end-action b { color: var(--green-strong); font-size: 1.15rem; }
.period-history-panel .panel-head { padding: 20px 22px 0; }
.period-close-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.close-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr); gap: 20px; align-items: start; }
.close-checklist ul { margin: 0; padding: 0; list-style: none; }
.close-checklist li { padding: 14px 0; display: grid; grid-template-columns: 34px 1fr; gap: 12px; border-bottom: 1px solid #e8eee5; }
.close-checklist li:last-child { border-bottom: 0; }
.close-checklist li > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; font-weight: 900; }
.close-checklist li.ready > span { color: #244719; background: #eaf8e2; }
.close-checklist li.blocked > span { color: var(--danger); background: #fff0ef; }
.close-checklist li.review > span { color: #17455f; background: #edf8ff; }
.close-checklist li div { display: flex; flex-direction: column; gap: 4px; }
.close-checklist li strong { font-size: .8rem; }
.close-checklist li small { color: var(--muted); font-size: .7rem; line-height: 1.45; }
.confirmation-list { margin-bottom: 20px; display: grid; gap: 10px; }
.confirmation-list label { min-height: 46px; padding: 11px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fbfdf9; color: var(--charcoal); font-size: .75rem; font-weight: 700; cursor: pointer; }
.confirmation-list input { width: 17px; height: 17px; accent-color: var(--green-strong); }
.close-state { margin-bottom: 22px; padding: 22px; border-radius: 14px; background: var(--mist); text-align: center; }
.close-state > span { width: 42px; height: 42px; margin: 0 auto 10px; display: grid; place-items: center; border-radius: 12px; color: var(--charcoal); background: var(--green); font-weight: 900; }
.close-state h2 { margin: 0 0 5px; font-size: 1rem; }
.close-state p { margin: 0; color: var(--muted); font-size: .74rem; line-height: 1.45; }

@media (max-width: 1050px) {
    .period-end-metrics, .period-close-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .close-layout { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .period-end-action-grid, .period-end-metrics, .period-close-metrics { grid-template-columns: 1fr; }
}

.edit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.form-panel { padding: 26px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 21px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 8px; color: var(--charcoal); font-size: .78rem; font-weight: 750; }
.field input, .field select, .field textarea { width: 100%; min-height: 47px; padding: 0 13px; border: 1px solid #cfdacb; border-radius: 11px; outline: 0; color: var(--charcoal); background: white; }
.field textarea { padding-block: 12px; resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green-strong); box-shadow: 0 0 0 4px rgba(124,252,0,.14); }
.field small { color: var(--muted); font-size: .68rem; font-weight: 400; line-height: 1.4; }
.field-error { color: var(--danger); font-size: .69rem; }
.input-validation-error { border-color: #efaaa3 !important; }
.validation-summary { margin-bottom: 18px; padding: 11px 13px; border-radius: 10px; color: var(--danger); background: #fff0ef; font-size: .78rem; }
.validation-summary:empty { display: none; }
.validation-summary ul { margin: 0; padding-left: 19px; }
.switch-field { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch-field > input { position: absolute; opacity: 0; }
.switch-ui { position: relative; flex: 0 0 46px; height: 27px; border-radius: 999px; background: #cbd6c7; transition: .18s ease; }
.switch-ui::after { content: ""; position: absolute; top: 4px; left: 4px; width: 19px; height: 19px; border-radius: 50%; background: white; box-shadow: 0 2px 6px rgba(0,0,0,.15); transition: .18s ease; }
.switch-field input:checked + .switch-ui { background: var(--green-strong); }
.switch-field input:checked + .switch-ui::after { transform: translateX(19px); }
.switch-field > span:last-child { display: flex; flex-direction: column; gap: 4px; }
.switch-field strong { font-size: .8rem; }
.switch-field small { color: var(--muted); font-size: .69rem; }
.form-actions-panel { position: sticky; top: 100px; padding: 21px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 7px 28px rgba(19,33,15,.04); }
.form-actions-panel h2 { margin: 0 0 12px; font-size: 1rem; }
.form-actions-panel ul { margin: 0 0 20px; padding-left: 18px; color: var(--muted); font-size: .75rem; line-height: 1.65; }
.form-actions-panel .button + .button { margin-top: 7px; }
.wide-aside { grid-template-columns: minmax(0, 1fr) 350px; }
.form-section-title { margin: 3px 0 17px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: .96rem; }
.form-section-title:not(:first-of-type) { margin-top: 32px; }
.aside-copy { margin: 0 0 18px; color: var(--muted); font-size: .76rem; line-height: 1.55; }

.subnav { margin: -10px 0 24px; padding: 6px; display: flex; gap: 4px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: white; scrollbar-width: thin; }
.subnav a { flex: 0 0 auto; padding: 9px 12px; border-radius: 9px; color: var(--muted); font-size: .74rem; font-weight: 800; text-decoration: none; }
.subnav a:hover { color: var(--forest); background: var(--mist); }
.subnav a.active { color: var(--charcoal); background: var(--green); }
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.settings-card { min-height: 155px; padding: 21px; display: grid; grid-template-columns: 45px 1fr auto; align-items: start; gap: 14px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 7px 28px rgba(19,33,15,.04); text-decoration: none; transition: .18s ease; }
.settings-card:hover { transform: translateY(-2px); border-color: #b7caaf; box-shadow: var(--shadow); }
.settings-card.primary { background: linear-gradient(145deg, #142411, #213b1b); color: white; border-color: #294b23; }
.settings-icon { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 13px; color: var(--forest); background: var(--mist); font-size: .8rem; font-weight: 900; }
.settings-card.primary .settings-icon { color: var(--charcoal); background: var(--green); }
.settings-card h2 { margin: 2px 0 7px; font-size: 1rem; }
.settings-card p { margin: 0; color: var(--muted); font-size: .74rem; line-height: 1.5; }
.settings-card.primary p { color: #aec0a8; }
.settings-card b { color: var(--green-strong); }
.split-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.create-panel { position: sticky; top: 100px; }
.create-panel h2 { margin: 5px 0 4px; font-size: 1.05rem; }
.compact-stack { margin-top: 20px; gap: 14px; }
.fiscal-tabs { gap: 7px; overflow-x: auto; }
.fiscal-tabs a { min-width: 90px; padding: 8px 11px; display: flex; flex-direction: column; gap: 2px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: .76rem; font-weight: 800; }
.fiscal-tabs a small { font-size: .58rem; font-weight: 600; }
.fiscal-tabs a.active { color: var(--charcoal); background: var(--green); }
.table-action { text-align: right !important; }
.table-button { min-height: 33px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--forest); background: white; cursor: pointer; font-size: .68rem; font-weight: 800; }
.table-button:hover { border-color: var(--green-strong); background: var(--mist); }
.sequence-panel { padding: 0; overflow: hidden; }
.sequence-head, .sequence-row { display: grid; grid-template-columns: minmax(150px, 1.3fr) 110px 125px 75px 105px 125px 65px; gap: 10px; align-items: center; }
.sequence-head { padding: 13px 16px; color: var(--muted); background: var(--mist); font-size: .64rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.sequence-row { padding: 11px 16px; border-top: 1px solid #e8eee5; }
.sequence-row strong { font-size: .76rem; }
.sequence-row input:not([type="checkbox"]) { width: 100%; height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; }
.sequence-row code { padding: 7px 8px; border-radius: 7px; color: var(--forest); background: var(--mist); font-size: .7rem; }
.mini-check { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .68rem; }
.mini-check input { accent-color: var(--green-strong); }
.inline-form { display: flex; align-items: center; gap: 8px; }
.inline-form select { min-width: 145px; height: 35px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.you-label { margin-left: 7px; padding: 3px 6px; border-radius: 999px; color: var(--forest); background: var(--mist); font-size: .58rem; text-transform: uppercase; }
.role-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.role-grid article { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.role-grid strong { font-size: .77rem; }
.role-grid p { margin: 6px 0 0; color: var(--muted); font-size: .68rem; line-height: 1.45; }
.stacked-cell { display: flex; flex-direction: column; gap: 3px; }
.stacked-cell small { color: var(--muted); font-size: .67rem; }
.master-three-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.compact-master { min-width: 0; }
.mini-master-list { max-height: 330px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.mini-master-list li { padding: 10px 0; display: grid; grid-template-columns: 90px 1fr; gap: 10px; border-bottom: 1px solid #e9efe6; }
.mini-master-list strong { color: var(--forest); font-family: Consolas, monospace; font-size: .74rem; }
.mini-master-list span { font-size: .75rem; }
.mini-master-list small { margin-left: 5px; padding: 2px 5px; border-radius: 999px; color: var(--forest); background: var(--mist); font-size: .56rem; }
.mini-create { margin-top: 16px; padding-top: 16px; display: grid; gap: 8px; border-top: 1px solid var(--line); }
.mini-create input { width: 100%; height: 39px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; }
.mini-create button { height: 39px; border: 1px solid var(--green-strong); border-radius: 9px; color: var(--charcoal); background: var(--green); cursor: pointer; font-weight: 850; }

.alert-info { border: 1px solid #bad8ea; color: #17455f; background: #edf8ff; }
.alert a { color: inherit; font-weight: 900; }
.status-badge.draft { color: #6b4e08; background: #fff7d8; }
.status-badge.posted { color: #244719; background: #eaf8e2; }
.status-badge.reversed { color: #6c2f2f; background: #fff0f0; }
.button-small { min-height: 36px; padding-inline: 12px; font-size: .72rem; }
.button-danger { color: white; border-color: #9b1c13; background: var(--danger); }
.amount-cell { text-align: right !important; font-variant-numeric: tabular-nums; }
.account-name { display: block; margin-top: 3px; color: var(--muted); font-size: .67rem; }
.clickable-row { cursor: pointer; }
.clickable-row:focus { outline: 2px solid var(--green-strong); outline-offset: -2px; }
.empty-table { padding: 34px 18px; display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--muted); text-align: center; }
.empty-table strong { color: var(--charcoal); font-size: .86rem; }
.empty-table span { font-size: .73rem; }
.empty-state { padding: 45px; text-align: center; }
.empty-state strong { font-size: 1.1rem; }
.empty-state p { margin: 7px 0 0; color: var(--muted); }

.filter-panel { margin-bottom: 18px; padding: 16px 18px; }
.report-filter { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.report-filter .field { min-width: 170px; }
.report-filter .field input, .report-filter .field select { min-height: 41px; }
.report-filter .account-pick { min-width: min(430px, 100%); flex: 1; }
.report-check { min-height: 41px; padding: 0 8px; }

.journal-edit { display: flex; flex-direction: column; gap: 18px; }
.journal-header-form { padding: 22px; }
.form-grid.three-column { grid-template-columns: 1fr 1fr 1fr; }
.journal-lines-panel { padding: 0; overflow: hidden; }
.journal-lines-panel .panel-head { padding: 19px 20px 0; }
.journal-lines-table { min-width: 980px; }
.journal-lines-table th:nth-child(2) { width: 30%; }
.journal-lines-table th:nth-child(3) { width: 30%; }
.journal-lines-table th:nth-child(4), .journal-lines-table th:nth-child(5) { width: 14%; }
.journal-lines-table td { padding: 9px 8px; vertical-align: top; }
.journal-lines-table td:first-child { padding-left: 18px; }
.journal-lines-table td:last-child { padding-right: 18px; }
.journal-lines-table select, .journal-lines-table input { width: 100%; height: 39px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: white; }
.journal-lines-table select:focus, .journal-lines-table input:focus { border-color: var(--green-strong); box-shadow: 0 0 0 3px rgba(124,252,0,.12); }
.journal-lines-table .field-error { display: block; max-width: 210px; margin-top: 4px; white-space: normal; }
.journal-lines-table tfoot td, .data-table tfoot td { border-top: 2px solid #d3e0ce; border-bottom: 0; background: var(--mist); }
.journal-lines-table tfoot td:first-child { white-space: normal; }
.journal-lines-table tfoot small { display: block; margin-top: 3px; color: var(--muted); font-size: .65rem; }
.journal-lines-table tfoot small.balanced { color: #32731f; font-weight: 800; }
.budget-lines-table { min-width: 850px; }
.budget-lines-table th:nth-child(2) { width: 25%; }
.budget-lines-table th:nth-child(3) { width: 45%; }
.budget-lines-table th:nth-child(4) { width: 18%; }
.budget-lines-table td { padding: 9px 8px; vertical-align: top; }
.budget-lines-table select, .budget-lines-table input { width: 100%; height: 39px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: white; }
.budget-lines-table select:focus, .budget-lines-table input:focus { border-color: var(--green-strong); box-shadow: 0 0 0 3px rgba(124,252,0,.12); }
.asset-metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.muted-copy { color: var(--muted); font-size: .76rem; line-height: 1.55; }
.line-number-cell { width: 48px; color: var(--muted); text-align: center !important; }
.line-remove { width: 34px; height: 34px; border: 1px solid #ecd2cf; border-radius: 9px; color: var(--danger); background: #fff7f6; cursor: pointer; font-size: 1.15rem; }
.journal-action-bar { position: sticky; bottom: 16px; z-index: 12; padding: 14px 17px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid #cfe0c7; border-radius: 16px; background: rgba(255,255,255,.96); box-shadow: 0 12px 36px rgba(19,33,15,.12); backdrop-filter: blur(10px); }
.journal-action-bar > div:first-child { display: flex; flex-direction: column; gap: 3px; }
.journal-action-bar strong { font-size: .8rem; }
.journal-action-bar span { color: var(--muted); font-size: .68rem; }

.title-with-status { display: flex; align-items: center; flex-wrap: wrap; gap: 11px; }
.title-with-status h1 { margin-right: 3px; }
.journal-summary-grid { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.journal-summary-grid article { min-height: 90px; padding: 16px; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.journal-summary-grid span { color: var(--muted); font-size: .67rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.journal-summary-grid strong { font-size: .91rem; }
.journal-audit-strip { margin-top: 18px; padding: 15px 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.journal-audit-strip div { display: flex; flex-direction: column; gap: 4px; }
.journal-audit-strip span { color: var(--muted); font-size: .64rem; text-transform: uppercase; }
.journal-audit-strip strong { font-size: .73rem; }
.danger-zone { margin-top: 18px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #efd3d0; border-radius: 14px; background: #fff8f7; }
.danger-zone > div { display: flex; flex-direction: column; gap: 4px; }
.danger-zone strong { font-size: .8rem; }
.danger-zone span { color: var(--muted); font-size: .69rem; }
.reversal-summary { margin-bottom: 24px; padding: 18px; display: flex; flex-direction: column; gap: 5px; border-radius: 13px; background: var(--mist); }
.reversal-summary span, .reversal-summary small { color: var(--muted); font-size: .68rem; }
.reversal-summary strong { font-size: 1rem; }

.report-health { margin-bottom: 18px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-radius: 14px; }
.report-health > div { display: flex; align-items: center; gap: 12px; }
.report-health > div > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; font-weight: 900; }
.report-health > div > div { display: flex; flex-direction: column; gap: 3px; }
.report-health strong { font-size: .82rem; }
.report-health small, .report-health time { color: var(--muted); font-size: .69rem; }
.report-health.balanced { border: 1px solid #bfe3ac; background: #f0faea; }
.report-health.balanced > div > span { color: #234f18; background: var(--green); }
.inventory-value-summary { width: fit-content; max-width: 100%; padding: 10px 12px; gap: 0; }
.inventory-value-summary > div { gap: 10px; }
.inventory-value-summary > div > span { width: 28px; height: 28px; border-radius: 8px; font-size: .62rem; }
.inventory-value-summary > div > div { min-width: 0; }
.report-health.unbalanced { border: 1px solid #efbbb5; background: #fff0ef; }
.report-health.unbalanced > div > span { color: white; background: var(--danger); }
.trial-table { min-width: 1050px; }
.trial-table .group-heading { text-align: center !important; }
.trial-table thead tr:first-child th { border-bottom-color: #cedbc9; }
.trial-table tfoot small { display: block; margin-top: 3px; color: var(--muted); }
.audit-table { min-width: 1150px; }
.audit-table td { vertical-align: top; }
.audit-details { display: block; max-width: 420px; white-space: normal; overflow-wrap: anywhere; color: #365331; font-size: .66rem; line-height: 1.45; }

.status-badge.confirmed { color: #174d67; background: #e6f6ff; }
.status-badge.converted { color: #533c78; background: #f1eaff; }
.status-badge.cancelled, .status-badge.reversed { color: #6c2f2f; background: #fff0f0; }
.sales-create-actions { flex-wrap: wrap; }
.sales-flow-strip { margin-top: 18px; padding: 15px 18px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); background: white; font-size: .7rem; font-weight: 800; }
.sales-flow-strip span { padding: 7px 10px; border-radius: 999px; color: var(--forest); background: var(--mist); }
.sales-flow-strip i { color: var(--green-strong); font-style: normal; }
.sales-document-form, .receipt-edit { display: flex; flex-direction: column; gap: 18px; }
.form-grid .two-column { grid-column: span 2; }
.sales-lines-panel { padding: 0; overflow: hidden; }
.sales-lines-panel .panel-head { padding: 19px 20px 0; }
.sales-lines-table { min-width: 1240px; }
.sales-lines-table th:nth-child(2) { width: 235px; }
.sales-lines-table th:nth-child(3) { width: 210px; }
.sales-lines-table td { padding: 9px 7px; vertical-align: top; }
.sales-lines-table td:first-child { padding-left: 17px; }
.sales-lines-table td:last-child { padding-right: 17px; }
.sales-lines-table select, .sales-lines-table input { width: 100%; height: 39px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: white; }
.sales-lines-table select:focus, .sales-lines-table input:focus, .allocation-input:focus { border-color: var(--green-strong); box-shadow: 0 0 0 3px rgba(124,252,0,.12); }
.sales-lines-table tfoot small { display: block; margin-top: 3px; color: var(--muted); font-size: .64rem; }
.sales-number { min-width: 92px; text-align: right; }
.sales-summary { grid-template-columns: repeat(4, 1fr); }
.sales-post-actions { margin-top: 18px; padding: 19px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.sales-post-actions h2 { margin: 4px 0; font-size: 1rem; }
.sales-post-actions p { margin: 0; color: var(--muted); font-size: .7rem; }
.sales-post-actions .page-actions { flex-wrap: wrap; }
.allocation-input { width: 135px; height: 38px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; text-align: right; }
.negative { color: var(--danger) !important; }
.ageing-table { min-width: 1050px; }
.ageing-table tfoot td { font-variant-numeric: tabular-nums; }

.banking-metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.banking-account-panel { margin-bottom: 20px; }
.bank-account-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.bank-account-card { min-height: 190px; padding: 18px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg, #fff, #f7fbf4); text-decoration: none; transition: .17s ease; }
.bank-account-card:hover { transform: translateY(-2px); border-color: var(--green-strong); box-shadow: 0 12px 28px rgba(19,33,15,.08); }
.bank-account-card.inactive { opacity: .62; }
.bank-account-card > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bank-code { color: var(--forest); font-family: Consolas, monospace; font-size: .75rem; font-weight: 800; }
.bank-account-card h3 { margin: 17px 0 4px; font-size: 1rem; }
.bank-account-card p { margin: 0; color: var(--muted); font-size: .7rem; }
.bank-account-card > strong { margin-top: auto; padding-top: 22px; font-size: 1.45rem; letter-spacing: -.025em; }
.bank-account-card > small { margin-top: 7px; color: var(--muted); font-size: .67rem; }
.no-margin { margin-top: 0; }
.compact-empty { grid-column: 1 / -1; padding: 25px; }
.document-tabs { margin: -8px 0 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.document-tabs a { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: white; text-decoration: none; font-size: .71rem; font-weight: 800; }
.document-tabs a.active, .document-tabs a:hover { color: var(--charcoal); border-color: var(--green-strong); background: var(--green); }
.banking-detail-panel { margin-bottom: 18px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.banking-detail-panel > div { display: flex; flex-direction: column; gap: 5px; }
.banking-detail-panel > div.full { grid-column: 1 / -1; }
.banking-detail-panel span { color: var(--muted); font-size: .66rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.banking-detail-panel strong { font-size: .82rem; }
.cash-book-table { min-width: 1120px; }
.status-badge.completed { color: #244719; background: #eaf8e2; }
.reconciliation-form { display: flex; flex-direction: column; gap: 18px; }
.reconciliation-header { margin: 0; }
.reconciliation-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.reconciliation-summary-grid article { min-height: 94px; padding: 16px; display: flex; flex-direction: column; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.reconciliation-summary-grid article.balanced { border-color: #bfe3ac; background: #f0faea; }
.reconciliation-summary-grid article.unbalanced { border-color: #efbbb5; background: #fff0ef; }
.reconciliation-summary-grid span { color: var(--muted); font-size: .65rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.reconciliation-summary-grid strong { font-size: .92rem; }
.reconciliation-table { min-width: 930px; }
.reconciliation-table td:first-child, .reconciliation-table th:first-child { width: 62px; text-align: center; }
.reconciliation-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green-strong); }
.bank-reconciliation-actions { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.bank-reconciliation-actions h2 { margin: 4px 0; font-size: 1rem; }
.bank-reconciliation-actions p { margin: 0; color: var(--muted); font-size: .7rem; }

/* v0.8 reporting and control */
.report-metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.report-metric-grid article { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: white; box-shadow: var(--shadow); }
.report-metric-grid span, .statement-heading span { display: block; color: var(--muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.report-metric-grid strong { display: block; margin: 12px 0 6px; font-size: clamp(1.05rem, 1.7vw, 1.45rem); letter-spacing: -.035em; white-space: nowrap; }
.report-metric-grid small { display: block; color: var(--muted); font-size: .67rem; line-height: 1.35; }
.negative-amount { color: var(--danger) !important; }
.report-catalog { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.report-card { min-height: 140px; padding: 21px; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: start; gap: 15px; border: 1px solid var(--line); border-radius: 17px; color: inherit; background: white; box-shadow: var(--shadow); text-decoration: none; transition: transform .18s ease, border-color .18s ease; }
.report-card:hover { transform: translateY(-2px); border-color: #9bd878; }
.report-card-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; color: var(--forest); background: var(--green); font-size: .75rem; font-weight: 900; }
.report-card strong { display: block; margin-top: 2px; font-size: .9rem; }
.report-card p { margin: 8px 0 0; color: var(--muted); font-size: .71rem; line-height: 1.5; }
.report-card b { color: var(--green-strong); }
.financial-statement { max-width: 1050px; margin-inline: auto; padding: 0; overflow: hidden; }
.statement-heading { padding: 18px 20px; display: flex; justify-content: flex-end; gap: 34px; border-bottom: 1px solid var(--line); background: var(--mist); }
.statement-heading > div:first-child { margin-right: auto; }
.statement-heading strong { display: block; margin-top: 4px; font-size: .74rem; }
.statement-table { min-width: 680px; }
.statement-table .statement-section th { padding-top: 19px; color: var(--forest); background: #f5f9f2; font-size: .73rem; text-transform: uppercase; letter-spacing: .06em; }
.statement-table .statement-empty td { color: var(--muted); font-style: italic; }
.statement-table .statement-total td, .statement-table .statement-subtotal td { font-weight: 850; }
.statement-table .statement-total td { border-top: 1px solid #c8d6c1; background: #fbfdf9; }
.statement-table .statement-subtotal td { border-top: 2px solid var(--forest); background: #f2f8ee; }
.statement-table .statement-grand-total td { color: var(--charcoal); background: var(--green); font-size: .84rem; font-weight: 900; }
.warning-note { border-color: #e8d493; background: #fffbea; }
.analysis-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.analysis-grid .panel { min-width: 0; margin-bottom: 0; }

@media print {
    @page { size: A4; margin: 13mm; }
    body { color: #000; background: #fff; }
    .sidebar, .topbar, .sidebar-backdrop, .no-print, .page-actions, .info-note { display: none !important; }
    .app-shell, .app-main { display: block; width: 100%; min-height: auto; }
    .content { max-width: none; padding: 0; }
    .page-header { margin-bottom: 14px; }
    .page-header h1 { font-size: 22pt; }
    .panel, .report-health, .journal-summary-grid article { break-inside: avoid; box-shadow: none; }
    .table-wrap { overflow: visible; }
    .data-table { min-width: 0; font-size: 8pt; }
    .data-table th, .data-table td { padding: 6px 7px; }
    .statement-heading { background: #f3f3f3; }
    .statement-table .statement-grand-total td { background: #d8efc9 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .journal-summary-grid { break-inside: avoid; }
    a { color: inherit !important; text-decoration: none !important; }
}

.auth-body { background: var(--charcoal); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(400px, .95fr) minmax(480px, 1.05fr); }
.login-brand-panel { position: relative; min-height: 100vh; padding: 54px clamp(38px, 6vw, 90px); display: flex; flex-direction: column; overflow: hidden; color: white; background: radial-gradient(circle at 80% 20%, rgba(124,252,0,.18), transparent 34%), linear-gradient(145deg, #0e180c, #1b3217); }
.login-brand-panel::after { content: ""; position: absolute; right: -18%; bottom: -20%; width: 560px; height: 560px; border: 1px solid rgba(124,252,0,.15); border-radius: 50%; box-shadow: 0 0 0 70px rgba(124,252,0,.025), 0 0 0 140px rgba(124,252,0,.018); }
.login-logo { position: relative; z-index: 1; width: 190px; }
.login-logo img { width: 100%; }
.login-message { position: relative; z-index: 1; margin: auto 0; max-width: 630px; }
.login-kicker { color: var(--green); font-size: .73rem; font-weight: 850; letter-spacing: .16em; }
.login-message h1 { margin: 18px 0; font-size: clamp(2.6rem, 5vw, 4.9rem); line-height: .98; letter-spacing: -.06em; }
.login-message p { max-width: 540px; margin: 0; color: #bdcbb9; font-size: 1.03rem; line-height: 1.65; }
.login-tagline { position: relative; z-index: 1; margin: 0; color: #9eb099; font-size: .78rem; letter-spacing: .08em; }
.login-form-panel { min-height: 100vh; padding: 48px; display: grid; place-items: center; background: #f7faf5; }
.login-card { width: min(440px, 100%); }
.status-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--forest); background: white; font-size: .67rem; font-weight: 800; text-transform: uppercase; }
.status-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--green-strong); }
.login-card h2 { margin: 25px 0 7px; font-size: 2.25rem; letter-spacing: -.045em; }
.login-card > p { margin: 0; color: var(--muted); }
.form-stack { margin-top: 31px; display: flex; flex-direction: column; gap: 19px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 70px; }
.password-wrap button { position: absolute; right: 7px; top: 7px; height: 33px; padding: 0 9px; border: 0; border-radius: 8px; color: var(--forest); background: var(--mist); cursor: pointer; font-size: .67rem; font-weight: 800; }
.check-field { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .75rem; cursor: pointer; }
.check-field input { width: 17px; height: 17px; accent-color: var(--green-strong); }
.login-help { margin-top: 23px !important; font-size: .72rem; text-align: center; }
.simple-state { min-height: 100vh; display: grid; place-items: center; padding: 30px; background: var(--mist); }
.state-card { width: min(540px, 100%); padding: 45px; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: var(--shadow); text-align: center; }
.state-card.in-app { margin: 70px auto; }
.state-code { width: 54px; height: 54px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 16px; color: var(--charcoal); background: var(--green); font-weight: 900; }
.state-card h1 { margin: 0 0 10px; font-size: 1.55rem; }
.state-card p { margin: 0 0 22px; color: var(--muted); line-height: 1.55; }
.sidebar-backdrop { display: none; }

@media (max-width: 1180px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .quick-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: repeat(2, 1fr); }
    .master-three-grid { grid-template-columns: 1fr 1fr; }
    .sequence-panel { overflow-x: auto; }
    .sequence-head, .sequence-row { min-width: 920px; }
    .role-grid { grid-template-columns: repeat(2, 1fr); }
    .bank-account-grid { grid-template-columns: repeat(2, 1fr); }
    .report-metric-grid { grid-template-columns: repeat(3, 1fr); }
    .report-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .app-shell { display: block; }
    .app-main { width: 100%; }
    .sidebar { transform: translateX(-102%); transition: transform .22s ease; box-shadow: 20px 0 50px rgba(0,0,0,.2); }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(6,15,5,.45); }
    body.sidebar-open .sidebar-backdrop { display: block; }
    .mobile-menu { display: grid; }
    .content { padding: 28px 22px 58px; }
    .topbar { padding: 10px 20px; }
    .edit-layout { grid-template-columns: 1fr; }
    .wide-aside, .split-workspace { grid-template-columns: 1fr; }
    .form-actions-panel { position: static; }
    .create-panel { position: static; }
    .login-shell { grid-template-columns: 1fr; }
    .login-brand-panel { min-height: 310px; padding: 35px; }
    .login-message { margin: 45px 0; }
    .login-message h1 { font-size: 2.6rem; }
    .login-message p { display: none; }
    .login-form-panel { min-height: auto; padding: 55px 28px; }
    .form-grid.three-column { grid-template-columns: 1fr 1fr; }
    .journal-summary-grid { grid-template-columns: 1fr 1fr; }
    .sales-post-actions { align-items: flex-start; flex-direction: column; }
    .banking-metric-grid { grid-template-columns: 1fr; }
    .reconciliation-summary-grid { grid-template-columns: 1fr 1fr; }
    .report-metric-grid { grid-template-columns: repeat(2, 1fr); }
    .analysis-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .user-copy { display: none; }
    .topbar { gap: 10px; padding: 9px 13px; }
    .company-switcher { max-width: calc(100vw - 150px); }
    .company-switcher strong, .company-switcher select { max-width: 100%; }
    .topbar-actions { gap: 7px; }
    .topbar-actions > .icon-button { display: none; }
    .page-header { align-items: flex-start; flex-direction: column; }
    .page-actions, .page-actions .button { width: 100%; }
    .metric-grid { grid-template-columns: 1fr; }
    .quick-grid { grid-template-columns: 1fr; }
    .settings-grid, .master-three-grid, .role-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .full { grid-column: auto; }
    .content { padding-inline: 15px; }
    .panel, .form-panel { padding: 18px; }
    .table-panel { padding: 0; }
    .record-count { display: none; }
    .login-brand-panel { min-height: 250px; padding: 28px; }
    .login-message { margin: 34px 0 20px; }
    .login-message h1 { font-size: 2.15rem; }
    .login-form-panel { padding: 45px 22px 55px; }
    .login-card h2 { font-size: 1.85rem; }
    .form-grid.three-column { grid-template-columns: 1fr; }
    .journal-action-bar, .danger-zone, .report-health { align-items: stretch; flex-direction: column; }
    .journal-action-bar .page-actions { flex-direction: column-reverse; }
    .journal-summary-grid, .journal-audit-strip { grid-template-columns: 1fr; }
    .sales-summary { grid-template-columns: 1fr; }
    .sales-create-actions { flex-direction: column; }
    .sales-flow-strip { align-items: stretch; flex-direction: column; text-align: center; }
    .sales-flow-strip i { transform: rotate(90deg); }
    .form-grid .two-column { grid-column: auto; }
    .report-filter, .report-filter .field, .report-filter .button { width: 100%; }
    .report-health time { align-self: flex-start; }
    .bank-account-grid, .reconciliation-summary-grid, .banking-detail-panel { grid-template-columns: 1fr; }
    .banking-detail-panel > div.full { grid-column: auto; }
    .bank-reconciliation-actions { align-items: stretch; flex-direction: column; }
    .report-metric-grid, .report-catalog { grid-template-columns: 1fr; }
    .statement-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
    .statement-heading > div:first-child { margin-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
