@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700&display=swap');

:root {
    --ink: #1b2420;
    --ink-2: #46514c;
    --muted: #77817c;
    --line: #e6e8e4;
    --line-strong: #d7dbd5;
    --canvas: #f5f6f2;
    --paper: #ffffff;
    --cream: #f0efe8;
    --forest: #163a2d;
    --forest-2: #225640;
    --forest-soft: #e8f0eb;
    --sage: #93ab9c;
    --amber: #a5671f;
    --amber-soft: #fff4df;
    --red: #a7453d;
    --red-soft: #fbecea;
    --blue: #3b617a;
    --blue-soft: #eaf2f6;
    --shadow: 0 1px 2px rgba(24, 41, 34, .04), 0 6px 22px rgba(24, 41, 34, .045);
    --radius: 15px;
    --radius-sm: 10px;
    --sidebar: 246px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 14px/1.5 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, strong { font-family: 'Manrope', 'DM Sans', sans-serif; }
h1 { margin-bottom: 7px; font-size: clamp(27px, 3vw, 35px); line-height: 1.16; letter-spacing: -.04em; font-weight: 700; }
h2 { margin-bottom: 5px; font-size: 17px; line-height: 1.35; letter-spacing: -.02em; }
p { color: var(--muted); }
code { padding: 3px 7px; border-radius: 6px; color: var(--forest); background: var(--forest-soft); font: 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: var(--sidebar); position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; flex-direction: column; padding: 0 14px 14px; background: var(--paper); border-right: 1px solid var(--line); }
.brand { height: 73px; display: flex; align-items: center; gap: 11px; padding: 0 10px; }
.brand-mark { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px 4px 9px 4px; color: #fff; background: var(--forest); font: 700 16px/1 'Manrope', sans-serif; transform: rotate(-2deg); }
.brand-name { font: 700 14px/1 'Manrope', sans-serif; letter-spacing: -.025em; white-space: nowrap; }
.main-nav { display: grid; gap: 4px; padding-top: 18px; border-top: 1px solid var(--line); }
.nav-item { min-height: 43px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-radius: 9px; color: #5d6863; font-weight: 600; transition: .18s ease; }
.nav-item:hover { color: var(--ink); background: #f5f6f3; }
.nav-item.active { color: var(--forest); background: var(--forest-soft); }
.nav-item svg { width: 19px; height: 19px; }
.nav-badge { margin-left: auto; padding: 2px 7px; border-radius: 999px; color: var(--forest); background: #dce8e0; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.sidebar-spacer { flex: 1; }
.nav-bottom { padding: 0 0 12px; border: 0; }
.account-card { display: flex; align-items: center; gap: 9px; padding: 11px 9px 4px; border-top: 1px solid var(--line); }
.account-card .avatar { width: 34px; height: 34px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--forest); background: #e9eee9; font-size: 11px; font-weight: 700; }
.account-copy { min-width: 0; flex: 1; display: grid; }
.account-copy strong, .account-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: 12px; }
.account-copy small { color: var(--muted); font-size: 10px; }
.account-card > svg { width: 14px; color: var(--muted); }
.page-shell { min-width: 0; width: calc(100% - var(--sidebar)); margin-left: var(--sidebar); }
.topbar { height: 73px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 0 32px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
.global-search { width: min(430px, 44vw); position: relative; display: flex; align-items: center; }
.global-search svg { position: absolute; left: 13px; width: 17px; color: #89928e; }
.global-search input { width: 100%; height: 39px; padding: 0 50px 0 40px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: #f7f8f5; transition: .18s ease; }
.global-search input:focus { border-color: #a7b6ae; background: var(--paper); box-shadow: 0 0 0 3px rgba(37,86,65,.08); }
.global-search kbd { position: absolute; right: 9px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--paper); font-size: 10px; box-shadow: 0 1px 1px rgba(0,0,0,.03); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.live-status { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.live-status i { width: 7px; height: 7px; border-radius: 50%; background: #5d9c75; box-shadow: 0 0 0 3px #eaf3ed; }
.main-content { width: min(1460px, 100%); margin: 0 auto; padding: 34px 34px 52px; }
.mobile-menu { display: none !important; }
.sidebar-backdrop { display: none; }

.button { min-height: 41px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-weight: 700; font-size: 13px; transition: transform .15s ease, border-color .15s ease, background .15s ease, color .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .52; transform: none; }
.button svg { width: 16px; height: 16px; }
.button-primary { color: #fff; background: var(--forest); box-shadow: 0 3px 8px rgba(22,58,45,.13); }
.button-primary:hover { background: #0f3025; }
.button-secondary { color: var(--ink); background: var(--paper); border-color: var(--line-strong); }
.button-secondary:hover { border-color: #b9c3bd; }
.button-ghost { color: var(--ink-2); background: transparent; }
.button-light { color: var(--forest); background: #f4f5f1; }
.button-small { min-height: 34px; padding: 0 12px; font-size: 12px; }
.button-compact { min-height: 38px; }
.button-block { width: 100%; }
.icon-button { width: 35px; height: 35px; display: inline-grid; flex: 0 0 auto; place-items: center; padding: 0; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; }
.icon-button:hover { color: var(--ink); background: #f1f3ef; }
.icon-button svg { width: 17px; height: 17px; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 27px; }
.page-heading > div:first-child > p:last-child { margin: 0; font-size: 14px; }
.page-heading-dashboard h1 { font-size: 31px; }
.eyebrow { margin-bottom: 7px; color: #718078; font-size: 10px; line-height: 1.2; letter-spacing: .15em; font-weight: 700; text-transform: uppercase; }
.heading-actions { display: flex; gap: 10px; }
.dashboard-actions-panel { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: -8px 0 15px; padding: 16px 18px; }
.dashboard-actions-copy { min-width: 205px; display: flex; align-items: center; gap: 12px; }
.dashboard-actions-copy h2 { margin: 0; font-size: 15px; }
.dashboard-actions-copy p { margin: 2px 0 0; font-size: 10px; }
.quick-actions-mark { width: 38px; height: 38px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 10px; color: var(--forest); background: var(--forest-soft); }
.quick-actions-mark svg { width: 17px; }
.dashboard-action-buttons { min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(145px, 1fr)); gap: 9px; }
.dashboard-action-buttons .button { min-height: 43px; padding-inline: 13px; white-space: nowrap; }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--muted); font-size: 12px; font-weight: 600; }
.back-link:hover { color: var(--forest); }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.panel-heading h2 { margin: 0; }
.panel-heading p { margin: 3px 0 0; font-size: 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 18px; }
.metric-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-card { min-width: 0; padding: 19px 19px 17px; background: var(--paper); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #63706a; font-size: 12px; font-weight: 600; }
.metric-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--forest); background: #edf2ee; }
.metric-icon svg { width: 15px; height: 15px; }
.metric-card > strong { display: block; margin: 12px 0 10px; font-size: clamp(22px, 2vw, 27px); line-height: 1; letter-spacing: -.04em; }
.metric-meta { min-height: 20px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.metric-meta a { margin-left: auto; display: flex; align-items: center; gap: 4px; color: var(--forest); font-weight: 700; }
.metric-meta a svg { width: 12px; }
.metric-primary { border-top: 3px solid var(--forest); padding-top: 17px; }
.metric-danger { border-top: 3px solid #c77b71; padding-top: 17px; }
.metric-danger .metric-icon { color: var(--red); background: var(--red-soft); }
.trend-up { color: #347050; font-weight: 700; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(295px, .72fr); gap: 18px; margin-bottom: 18px; }
.dashboard-grid-wide { grid-template-columns: minmax(0, 1fr); }
.chart-panel { min-width: 0; padding: 20px 22px 11px; }
.select-wrap select, .filter-form select { height: 34px; padding: 0 31px 0 11px; border: 1px solid var(--line); border-radius: 8px; outline: none; background: var(--paper); color: var(--ink-2); font-size: 11px; }
.chart-summary { display: flex; align-items: center; gap: 9px; margin-top: 18px; }
.chart-summary strong { font-size: 21px; letter-spacing: -.03em; }
.trend-pill { padding: 3px 7px; border-radius: 999px; color: #347050; background: #eaf4ed; font-size: 10px; font-weight: 700; }
.revenue-chart { margin: 5px 0 0; }
.revenue-chart svg { width: 100%; height: auto; overflow: visible; }
.revenue-chart text { fill: #8b948f; font: 10px 'DM Sans', sans-serif; }
.grid-lines path { fill: none; stroke: #edf0ec; stroke-width: 1; }
.chart-line { fill: none; stroke: var(--forest); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.chart-dot { fill: #fff; stroke: var(--forest); stroke-width: 2.2; }
.action-panel { padding: 20px; }
.quick-actions { margin-top: 12px; display: grid; }
.quick-action { width: 100%; min-height: 59px; display: flex; align-items: center; gap: 11px; padding: 10px 1px; border: 0; border-bottom: 1px solid var(--line); text-align: left; background: transparent; cursor: pointer; }
.quick-action:last-child { border-bottom: 0; }
.quick-action:hover strong { color: var(--forest); }
.quick-action > span:nth-child(2) { min-width: 0; flex: 1; display: grid; }
.quick-action strong { font-size: 12px; transition: color .15s ease; }
.quick-action small { color: var(--muted); font-size: 10px; }
.quick-icon { width: 34px; height: 34px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 9px; color: var(--forest); background: var(--forest-soft); }
.quick-icon.dark { color: #fff; background: var(--forest); }
.quick-icon svg { width: 16px; }
.quick-action .chevron { width: 14px; color: #a4ada8; }

.documents-panel { margin-bottom: 18px; overflow: visible; }
.documents-panel > .panel-heading { padding: 20px 22px 12px; }
.text-link { display: inline-flex; align-items: center; gap: 7px; color: var(--forest); font-size: 12px; font-weight: 700; }
.text-link svg { width: 13px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 18px; color: #8a938f; background: #fafbf9; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; font-size: 9px; letter-spacing: .08em; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
td { height: 66px; padding: 10px 18px; border-bottom: 1px solid #edf0ec; color: #53605a; font-size: 12px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: #fbfcfa; }
.align-right { text-align: right; }
.amount-cell { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.document-id { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.document-id > span:last-child { display: grid; }
.document-id strong { font-size: 12px; }
.document-id small { color: var(--muted); font-size: 10px; }
.document-icon { width: 31px; height: 35px; display: grid; place-items: center; border-radius: 6px; color: var(--forest); background: var(--forest-soft); }
.document-icon svg { width: 15px; }
.customer-cell { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.customer-cell i { width: 27px; height: 27px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--forest); background: #eef1ec; font-style: normal; font-size: 9px; font-weight: 700; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; color: var(--ink-2); background: #f0f2ef; font-size: 10px; font-weight: 700; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: #8d9792; }
.status-paid, .status-accepted { color: #33684c; background: #e7f2eb; }
.status-paid i, .status-accepted i { background: #4e8a66; }
.status-overdue { color: var(--red); background: var(--red-soft); }
.status-overdue i { background: #c65d54; }
.status-partial { color: var(--amber); background: var(--amber-soft); }
.status-partial i { background: #c88b3a; }
.status-sent { color: var(--blue); background: var(--blue-soft); }
.status-sent i { background: #56809a; }
.status-cancelled, .status-declined { color: #7d7f7d; background: #eceeeb; text-decoration: line-through; }
.einvoice-strip { min-height: 114px; display: flex; align-items: center; gap: 20px; padding: 20px 24px; overflow: hidden; border-radius: var(--radius); color: #fff; background: var(--forest); box-shadow: 0 7px 20px rgba(22,58,45,.12); }
.einvoice-art { width: 61px; height: 61px; position: relative; display: grid; flex: 0 0 auto; place-items: center; border: 1px solid rgba(255,255,255,.19); border-radius: 14px; background: rgba(255,255,255,.08); }
.einvoice-art > svg { width: 27px; height: 27px; }
.check-dot { width: 19px; height: 19px; position: absolute; right: -5px; bottom: -3px; display: grid; place-items: center; border: 2px solid var(--forest); border-radius: 50%; color: var(--forest); background: #bad5c4; }
.check-dot svg { width: 10px; }
.einvoice-strip > div:nth-child(2) { flex: 1; }
.einvoice-strip .eyebrow { margin-bottom: 4px; color: #afc8ba; }
.einvoice-strip h2 { margin-bottom: 2px; font-size: 16px; }
.einvoice-strip p { margin: 0; color: #bed0c6; font-size: 11px; }

.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.panel-flat { padding: 0; }
.search-field { width: min(380px, 100%); position: relative; display: flex; align-items: center; }
.search-field svg { position: absolute; left: 12px; width: 16px; color: var(--muted); }
.search-field input { width: 100%; height: 40px; padding: 0 12px 0 38px; border: 1px solid var(--line-strong); border-radius: 9px; outline: none; background: var(--paper); }
.search-field input:focus { border-color: #9cad9f; box-shadow: 0 0 0 3px rgba(37,86,65,.08); }
.toolbar-meta { margin-left: auto; color: var(--muted); font-size: 12px; }
.toolbar-meta strong { color: var(--ink); }
.filter-form { margin-left: auto; }
.customer-panel { overflow: hidden; }
.customer-main { display: flex; align-items: center; gap: 11px; }
.customer-main > span:last-child, .customer-table td:nth-child(2) { display: grid; }
.customer-main small, .customer-table td:nth-child(2) small { color: var(--muted); font-size: 10px; }
.customer-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--forest); background: var(--forest-soft); font-size: 10px; font-weight: 700; }
.customer-table td:nth-child(2) a { color: var(--ink-2); }
.table-empty { padding: 30px; color: var(--muted); text-align: center; }

.document-tabs { display: flex; gap: 23px; margin-bottom: 17px; border-bottom: 1px solid var(--line-strong); }
.document-tabs a { display: flex; align-items: center; gap: 6px; padding: 0 1px 12px; color: var(--muted); border-bottom: 2px solid transparent; font-size: 12px; font-weight: 700; }
.document-tabs a.active { color: var(--forest); border-color: var(--forest); }
.document-tabs span { min-width: 19px; padding: 1px 5px; border-radius: 999px; background: #e9ece8; text-align: center; font-size: 9px; }
.full-list { overflow: visible; }
.full-list > .table-wrap { overflow: visible; }
.row-highlight { background: #f2f7f3; animation: highlight 1.8s ease both; }
@keyframes highlight { from { background: #dfeee3; } to { background: #f2f7f3; } }
.row-menu { position: relative; display: inline-block; }
.row-menu summary { list-style: none; }
.row-menu summary::-webkit-details-marker { display: none; }
.row-menu-popover { width: 190px; position: absolute; right: 0; top: 39px; z-index: 10; display: grid; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); box-shadow: 0 12px 30px rgba(30,45,39,.14); text-align: left; }
.row-menu-popover a, .row-menu-popover button { width: 100%; min-height: 34px; display: flex; align-items: center; padding: 0 9px; border: 0; border-radius: 6px; color: var(--ink-2); background: transparent; cursor: pointer; text-align: left; font-size: 11px; }
.row-menu-popover a:hover, .row-menu-popover button:hover { background: #f2f4f1; }
.row-menu-popover .danger-link { color: var(--red); }
.list-footnote { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); font-size: 11px; }
.list-footnote svg { width: 13px; color: #54846a; }
.text-danger { color: var(--red); }

.readiness-badge { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 999px; color: #33684c; background: #e4f1e8; font-size: 11px; font-weight: 700; }
.readiness-badge svg { width: 14px; }
.einvoice-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(310px, .75fr); gap: 48px; margin-bottom: 18px; padding: 34px; background: linear-gradient(140deg, #fff 0%, #fff 58%, #f1f5f1 100%); }
.einvoice-hero-copy { align-self: center; }
.einvoice-hero-copy h2 { max-width: 590px; margin-bottom: 12px; font-size: clamp(24px, 3vw, 33px); line-height: 1.2; }
.einvoice-hero-copy > p { max-width: 620px; font-size: 14px; }
.hero-actions { display: flex; gap: 9px; margin-top: 22px; }
.format-stack { display: grid; gap: 9px; }
.format-card { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.78); }
.format-card > span:nth-child(2) { min-width: 0; flex: 1; display: grid; }
.format-card strong { font-size: 12px; }
.format-card small { color: var(--muted); font-size: 10px; }
.format-card > svg { width: 16px; color: #4d8262; }
.file-mark { width: 36px; height: 39px; display: grid; place-items: center; border-radius: 7px; color: var(--forest); background: var(--forest-soft); font-size: 9px; font-weight: 700; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.info-grid > .panel { padding: 23px; }
.timeline { display: grid; gap: 0; margin-top: 19px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding-bottom: 20px; }
.timeline-item:not(:last-child)::after { content: ''; width: 1px; position: absolute; left: 16px; top: 29px; bottom: 0; background: var(--line-strong); }
.timeline-item > span { width: 33px; height: 33px; display: grid; place-items: center; z-index: 1; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--muted); background: var(--paper); font-size: 9px; font-weight: 700; }
.timeline-item.done > span, .timeline-item.current > span { color: #fff; border-color: var(--forest); background: var(--forest); }
.timeline-item strong { font-size: 12px; }
.timeline-item p { margin: 3px 0 0; font-size: 11px; }
.source-link { display: inline-flex; align-items: center; gap: 6px; color: var(--forest); font-size: 10px; font-weight: 700; }
.source-link svg { width: 12px; }
.check-list { display: grid; gap: 15px; padding: 0; margin: 19px 0 20px; list-style: none; }
.check-list li { display: flex; align-items: flex-start; gap: 11px; }
.check-list li > span { width: 28px; height: 28px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 8px; color: #3f7656; background: #e7f2eb; }
.check-list li > span.pending { color: var(--amber); background: var(--amber-soft); }
.check-list svg { width: 14px; }
.check-list strong { font-size: 12px; }
.check-list p { margin: 2px 0 0; font-size: 10px; }
.notice { display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px; border: 1px solid transparent; border-radius: 10px; }
.notice > span:first-child { width: 25px; height: 25px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 7px; font-weight: 700; }
.notice strong { font-size: 11px; }
.notice p { margin: 2px 0 0; font-size: 10px; }
.notice-neutral { color: #50635a; border-color: #dce5df; background: #f2f6f3; font-size: 10px; }
.notice-warning { border-color: #f1d7a7; background: var(--amber-soft); }
.notice-warning > span:first-child { color: #fff; background: #bf7d2d; }
.notice-warning p { color: #81633e; }
.notice-success { border-color: #cfe4d6; background: #edf7f0; }
.notice-success > span:first-child { color: #fff; background: #4f8464; }
.small-business-note { display: flex; align-items: center; gap: 17px; padding: 20px 23px; }
.small-business-note .note-icon { width: 44px; height: 44px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 11px; color: var(--forest); background: var(--forest-soft); font-weight: 700; }
.small-business-note > div { flex: 1; }
.small-business-note h2 { margin: 0; }
.small-business-note p { margin: 3px 0 0; font-size: 11px; }

.settings-layout, .invoice-editor { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 19px; align-items: start; }
.settings-main, .editor-main { min-width: 0; display: grid; gap: 16px; }
.settings-section, .editor-section { padding: 23px; }
.section-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 22px; }
.section-number { width: 27px; height: 27px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 7px; color: var(--forest); background: var(--forest-soft); font-size: 9px; font-weight: 700; }
.section-heading h2 { margin: 1px 0 2px; }
.section-heading p { margin: 0; font-size: 11px; }
.form-grid { display: grid; gap: 15px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { min-width: 0; display: grid; gap: 6px; color: var(--ink-2); font-size: 11px; font-weight: 700; }
.field-span-2 { grid-column: 1 / -1; }
.field input, .field select, .field textarea, .line-item input, .line-item select { width: 100%; min-width: 0; border: 1px solid var(--line-strong); border-radius: 8px; outline: none; background: var(--paper); font-weight: 400; transition: .15s ease; }
.field input, .field select { height: 40px; padding: 0 11px; }
.field textarea { padding: 10px 11px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .line-item input:focus, .line-item select:focus { border-color: #97aa9f; box-shadow: 0 0 0 3px rgba(37,86,65,.08); }
.input-suffix { position: relative; display: flex; align-items: center; }
.input-suffix input { padding-right: 40px !important; }
.input-suffix > span { position: absolute; right: 11px; color: var(--muted); font-size: 10px; font-weight: 600; }
.tax-mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.tax-mode-card { min-height: 75px; position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; }
.tax-mode-card:has(input:checked) { border-color: var(--forest); background: #f2f7f3; box-shadow: 0 0 0 1px var(--forest); }
.tax-mode-card input { position: absolute; opacity: 0; }
.radio-mark { width: 17px; height: 17px; position: relative; flex: 0 0 auto; border: 1px solid #aab3ae; border-radius: 50%; background: #fff; }
.tax-mode-card input:checked + .radio-mark { border: 5px solid var(--forest); }
.tax-mode-card > span:last-child { display: grid; }
.tax-mode-card strong { font-size: 11px; }
.tax-mode-card small { color: var(--muted); font-size: 9px; }
.sticky-card { position: sticky; top: 92px; padding: 22px; }
.sticky-card > h2 { font-size: 20px; }
.sticky-card > p:not(.eyebrow) { font-size: 11px; }
.sticky-card dl { margin: 22px 0; display: grid; gap: 11px; }
.sticky-card dl div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.sticky-card dt { color: var(--muted); font-size: 10px; }
.sticky-card dd { margin: 0; color: var(--ink); font-size: 10px; font-weight: 700; text-align: right; }
.save-hint { display: block; margin-top: 10px; color: var(--muted); font-size: 9px; text-align: center; }

.storage-section { margin-top: 28px; scroll-margin-top: 92px; }
.storage-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.storage-section-heading h2 { margin: 0 0 4px; font-size: 21px; }
.storage-section-heading p { margin-bottom: 0; font-size: 12px; }
.privacy-note { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #d9e4dc; border-radius: 999px; color: var(--forest); background: #eef5f0; font-size: 10px; font-weight: 700; white-space: nowrap; }
.privacy-note svg { width: 14px; }
.storage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.storage-card { min-width: 0; display: flex; flex-direction: column; padding: 23px; }
.storage-card-cloud { background: linear-gradient(145deg, #fff 0%, #f7faf7 100%); }
.storage-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 17px; }
.storage-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 11px; color: var(--forest); background: var(--forest-soft); }
.storage-icon svg { width: 20px; height: 20px; }
.storage-icon-cloud { color: #fff; background: var(--forest); box-shadow: 0 5px 13px rgba(22,58,45,.17); }
.plan-badge { padding: 4px 9px; border: 1px solid #dbe0dc; border-radius: 999px; color: #68736d; background: #f5f6f4; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.plan-badge-active { color: #347050; border-color: #cfe2d5; background: #eaf4ed; }
.storage-card h3 { margin-bottom: 5px; font-size: 18px; }
.storage-card > p { min-height: 42px; margin-bottom: 18px; font-size: 11px; }
.storage-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 0 0 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.storage-summary div { display: grid; gap: 2px; padding: 11px 8px; background: #fafbf9; text-align: center; }
.storage-summary dt { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.storage-summary dd { margin: 0; color: var(--ink); font: 700 15px/1.2 'Manrope', sans-serif; }
.backup-download-form { margin-top: auto; }
.storage-divider { display: flex; align-items: center; gap: 10px; margin: 15px 0; color: #949c98; font-size: 9px; text-transform: uppercase; }
.storage-divider::before, .storage-divider::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.backup-upload-form { display: grid; gap: 9px; }
.backup-file-control { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; cursor: pointer; }
.backup-file-control input { width: 1px; height: 1px; position: absolute; overflow: hidden; opacity: 0; pointer-events: none; }
.backup-file-control small { min-width: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.cloud-feature-list { display: grid; gap: 13px; margin: 2px 0 20px; padding: 0; list-style: none; }
.cloud-feature-list li { display: flex; align-items: flex-start; gap: 10px; }
.cloud-feature-list li > svg { width: 19px; height: 19px; flex: 0 0 auto; padding: 4px; border-radius: 50%; color: #347050; background: #e7f2eb; }
.cloud-feature-list li > span { display: grid; }
.cloud-feature-list strong { font-size: 11px; }
.cloud-feature-list small { color: var(--muted); font-size: 9px; }
.quota-note { margin-top: auto; margin-bottom: 14px; padding: 12px 13px; border: 1px dashed #cad6ce; border-radius: 9px; background: rgba(232,240,235,.5); }
.quota-note span { color: var(--forest); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.quota-note p { margin: 3px 0 0; font-size: 10px; }

.editor-heading { align-items: flex-start; }
.stepper { display: flex; align-items: center; gap: 6px; margin-top: 24px; }
.stepper span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 700; }
.stepper span:not(:last-child)::after { content: ''; width: 25px; height: 1px; margin: 0 4px; background: var(--line-strong); }
.stepper i { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; background: #e8ebe7; font-style: normal; font-size: 9px; }
.stepper .active { color: var(--forest); }
.stepper .active i { color: #fff; background: var(--forest); }
.notice-page { margin-bottom: 16px; }
.notice-page > div { flex: 1; }
.notice-page > a { align-self: center; color: var(--forest); font-size: 10px; font-weight: 700; }
.line-items { display: grid; gap: 7px; }
.line-item { display: grid; grid-template-columns: minmax(170px, 2.3fr) .65fr .8fr 1fr .72fr .8fr 32px; gap: 7px; align-items: center; }
.line-item input, .line-item select { height: 38px; padding: 0 8px; font-size: 11px; }
.line-item strong { text-align: right; font-size: 11px; white-space: nowrap; }
.line-item-head { color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.line-item-head span:nth-last-child(2) { text-align: right; }
.remove-line { width: 31px; height: 31px; }
.add-line { margin-top: 13px; }
.invoice-summary { position: sticky; top: 92px; padding: 22px; }
.invoice-summary h2 { margin-bottom: 2px; font-size: 21px; }
.summary-number { display: block; color: var(--muted); font-size: 9px; }
.invoice-summary dl { margin: 25px 0 20px; display: grid; gap: 11px; }
.invoice-summary dl > div { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.invoice-summary dd { margin: 0; color: var(--ink-2); font-weight: 600; }
.invoice-summary .summary-total { margin-top: 3px; padding-top: 14px; border-top: 1px solid var(--line-strong); color: var(--ink); font-weight: 700; }
.invoice-summary .summary-total dd { color: var(--ink); font: 700 20px 'Manrope', sans-serif; letter-spacing: -.03em; }
.summary-tax-note { margin: -7px 0 17px; padding: 8px; border-radius: 7px; color: var(--forest); background: var(--forest-soft); font-size: 9px; text-align: center; }
.invoice-summary .button + .button { margin-top: 7px; }
.invoice-summary .save-hint { display: flex; align-items: center; justify-content: center; gap: 5px; }
.invoice-summary .save-hint svg { width: 11px; color: #4f8064; }
.field-hint { margin-top: -2px; color: var(--muted); font-size: 9px; font-weight: 500; }

.creation-method-grid { max-width: 980px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-bottom: 18px; }
.creation-method-card { min-height: 285px; position: relative; display: flex; flex-direction: column; align-items: flex-start; padding: 28px; overflow: hidden; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.creation-method-card:hover { transform: translateY(-3px); border-color: #bdc9c1; box-shadow: 0 12px 30px rgba(24, 41, 34, .09); }
.creation-method-card-ai { background: linear-gradient(145deg, #fff 10%, #eef5f0 100%); }
.creation-method-card-ai::after { content: ''; width: 180px; height: 180px; position: absolute; right: -75px; bottom: -80px; border-radius: 50%; background: rgba(147,171,156,.14); pointer-events: none; }
.creation-method-card-disabled { cursor: default; opacity: .78; }
.creation-method-card-disabled:hover { transform: none; border-color: var(--line); box-shadow: var(--shadow); }
.creation-method-card-disabled .creation-method-icon-ai { background: #789087; box-shadow: none; }
.creation-method-card-disabled .creation-method-action { color: var(--muted); }
.creation-method-icon { width: 52px; height: 52px; display: grid; place-items: center; margin-bottom: 25px; border-radius: 14px; color: var(--forest); background: var(--forest-soft); }
.creation-method-icon svg { width: 23px; height: 23px; }
.creation-method-icon-ai { color: #fff; background: var(--forest); box-shadow: 0 7px 17px rgba(22,58,45,.18); }
.creation-method-copy { display: grid; }
.creation-method-copy .eyebrow { margin-bottom: 7px; }
.creation-method-copy > strong { font-size: 22px; letter-spacing: -.035em; }
.creation-method-copy > small { max-width: 340px; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.creation-method-action { display: flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 25px; color: var(--forest); font-size: 12px; font-weight: 700; }
.creation-method-action svg { width: 14px; transition: transform .15s ease; }
.creation-method-card:hover .creation-method-action svg { transform: translateX(3px); }
.creation-method-status { position: absolute; top: 25px; right: 25px; padding: 4px 9px; border: 1px solid #ead7b7; border-radius: 999px; color: var(--amber); background: var(--amber-soft); font-size: 9px; font-weight: 700; }
.creation-method-status.is-ready { color: #347050; border-color: #cfe2d5; background: #eaf4ed; }
.creation-layout-note { max-width: 980px; }
.creation-layout-note > span svg { width: 16px; }

.ai-model-badge { display: inline-flex; align-items: center; gap: 7px; margin-top: 20px; padding: 8px 11px; border: 1px solid #cfddd4; border-radius: 999px; color: var(--forest); background: #edf5ef; font-size: 10px; font-weight: 700; }
.ai-model-badge svg { width: 14px; }
.ai-document-form { max-width: 920px; padding: 27px; }
.ai-document-form .section-heading { margin-bottom: 18px; }
.ai-brief-heading { margin-top: 29px; padding-top: 25px; border-top: 1px solid var(--line); }
.ai-document-form textarea { min-height: 190px; font-size: 13px; line-height: 1.6; }
.ai-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 23px; padding-top: 20px; border-top: 1px solid var(--line); }
.ai-form-footer > p { max-width: 510px; display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 10px; line-height: 1.55; }
.ai-form-footer > p svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px; color: var(--forest); }
.ai-form-footer > div { display: flex; flex: 0 0 auto; gap: 8px; }

.modal { width: min(630px, calc(100% - 32px)); max-height: calc(100vh - 40px); padding: 0; overflow: auto; border: 0; border-radius: 16px; background: var(--paper); box-shadow: 0 26px 70px rgba(16,38,29,.24); }
.modal::backdrop { background: rgba(15,28,23,.53); backdrop-filter: blur(3px); }
.modal-small { width: min(470px, calc(100% - 32px)); }
.modal-form { padding: 24px; }
.modal-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.modal-heading h2 { margin-bottom: 3px; font-size: 22px; }
.modal-heading p:last-child { margin: 0; font-size: 11px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 18px; border-radius: 9px; background: #f0f2ef; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { height: 34px; display: grid; place-items: center; border-radius: 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.segmented input:checked + span { color: var(--forest); background: var(--paper); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 23px; padding-top: 18px; border-top: 1px solid var(--line); }
.toast { min-height: 48px; display: flex; align-items: center; gap: 10px; margin: -12px 0 22px; padding: 9px 11px 9px 15px; border: 1px solid; border-radius: 10px; background: var(--paper); font-size: 12px; box-shadow: var(--shadow); }
.toast > svg { width: 16px; }
.toast > span { flex: 1; }
.toast-success { color: #2f6849; border-color: #cfe1d5; background: #f0f7f2; }
.toast-error { color: var(--red); border-color: #ecc8c4; background: #fdf2f1; }
.database-state { max-width: 660px; margin: 70px auto; padding: 35px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); text-align: center; box-shadow: var(--shadow); }
.empty-icon { width: 50px; height: 50px; display: grid; margin: 0 auto 17px; place-items: center; border-radius: 12px; color: var(--forest); background: var(--forest-soft); }
.code-block { margin: 18px 0; padding: 13px; overflow: auto; border-radius: 8px; background: #f2f3f0; text-align: left; }
.code-block code { padding: 0; color: var(--red); background: transparent; white-space: pre-wrap; }

@media (max-width: 1120px) {
    :root { --sidebar: 216px; }
    .main-content { padding-inline: 25px; }
    .topbar { padding-inline: 24px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-actions-panel { align-items: flex-start; flex-direction: column; gap: 13px; }
    .dashboard-action-buttons { width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .settings-layout, .invoice-editor { grid-template-columns: minmax(0, 1fr) 260px; }
    .line-item { grid-template-columns: minmax(160px, 2fr) .65fr .8fr 1fr .72fr .8fr 30px; }
}

@media (max-width: 920px) {
    :root { --sidebar: 246px; }
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: 12px 0 35px rgba(20,38,30,.14); }
    body.menu-open .sidebar { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(15,28,23,.4); }
    body.menu-open .sidebar-backdrop { display: block; }
    .page-shell { width: 100%; margin-left: 0; }
    .mobile-menu { display: inline-grid !important; }
    .topbar { padding-inline: 18px; }
    .global-search { width: min(390px, 48vw); }
    .live-status { display: none; }
    .dashboard-grid, .info-grid { grid-template-columns: 1fr; }
    .settings-layout, .invoice-editor { grid-template-columns: 1fr; }
    .storage-grid { grid-template-columns: 1fr; }
    .settings-aside, .editor-aside { order: -1; }
    .sticky-card, .invoice-summary { position: static; }
    .invoice-summary dl { grid-template-columns: repeat(2, 1fr); }
    .invoice-summary .summary-total { grid-column: 1/-1; }
    .line-item { min-width: 780px; }
    .line-items { overflow-x: auto; padding-bottom: 4px; }
    .einvoice-hero { grid-template-columns: 1fr; gap: 25px; }
}

@media (max-width: 660px) {
    .topbar { height: 64px; gap: 8px; padding-inline: 12px; }
    .global-search { flex: 1; width: auto; }
    .global-search kbd { display: none; }
    .global-search input { padding-right: 10px; font-size: 12px; }
    .topbar-actions .button { width: 38px; padding: 0; }
    .topbar-actions .button span { display: none; }
    .main-content { padding: 24px 15px 40px; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
    .page-heading .heading-actions { width: 100%; }
    .page-heading .heading-actions .button { flex: 1; }
    .page-heading > .button { width: 100%; }
    .metric-grid, .metric-grid-three { grid-template-columns: 1fr; }
    .dashboard-actions-panel { margin-top: -4px; padding: 16px; }
    .dashboard-action-buttons { grid-template-columns: 1fr 1fr; }
    .dashboard-action-buttons .button { white-space: normal; }
    .chart-panel, .action-panel, .settings-section, .editor-section { padding: 18px; }
    .chart-panel { overflow: hidden; }
    .revenue-chart { min-width: 520px; }
    .einvoice-strip { align-items: flex-start; flex-wrap: wrap; }
    .einvoice-strip .button { margin-left: 81px; }
    .toolbar { align-items: stretch; flex-direction: column; }
    .search-field { width: 100%; }
    .toolbar-meta, .filter-form { margin-left: 0; }
    .filter-form select { width: 100%; height: 40px; }
    .document-tabs { gap: 14px; overflow-x: auto; }
    .document-tabs a { flex: 0 0 auto; }
    .einvoice-hero { padding: 22px; }
    .hero-actions { flex-direction: column; }
    .small-business-note { align-items: flex-start; flex-wrap: wrap; }
    .small-business-note .text-link { margin-left: 61px; }
    .two-columns, .tax-mode-grid { grid-template-columns: 1fr; }
    .creation-method-grid { grid-template-columns: 1fr; }
    .creation-method-card { min-height: 245px; padding: 22px; }
    .creation-method-status { top: 20px; right: 20px; }
    .ai-document-form { padding: 20px; }
    .ai-form-footer { align-items: stretch; flex-direction: column; }
    .ai-form-footer > div { flex-direction: column-reverse; }
    .ai-form-footer .button { width: 100%; }
    .storage-section-heading { align-items: flex-start; flex-direction: column; }
    .storage-card { padding: 18px; }
    .storage-summary { grid-template-columns: repeat(2, 1fr); }
    .field-span-2 { grid-column: auto; }
    .stepper { display: none; }
    .invoice-summary dl { grid-template-columns: 1fr; }
    .modal-form { padding: 19px; }
    .modal-actions { flex-direction: column-reverse; }
    .modal-actions .button { width: 100%; }
}

@media print {
    .sidebar, .topbar, .sidebar-backdrop { display: none !important; }
    .page-shell { width: 100%; margin: 0; }
    .main-content { padding: 0; }
}
