:root {
    color-scheme: light;
    --ink: #1c1412;
    --muted: #5c524e;
    --line: #e4dcd6;
    --paper: #f7f3ee;
    --navy: #4f1f25;
    --blue: #722f37;
    --blue-deep: #4f1f25;
    --card: #fffcf8;
    --soft: #f0e4e6;
    --focus: #1a5fad;
    font-family: "Schibsted Grotesk", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; }

.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    background: var(--navy);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 18px 12px 14px;
    position: sticky;
    top: 0;
    height: 100vh;
}
.brand, .logout { color: #fff; text-decoration: none; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 16px; }
.brand strong { display: block; font-size: 16px; }
.brand small { color: #f0d9de; }
.brand-mark {
    width: 32px; height: 32px; border-radius: 8px;
    display: grid; place-items: center; background: var(--blue); font-weight: 700;
}
.sidebar nav { overflow: auto; flex: 1; }
.nav-group { margin: 0 0 4px; }
.nav-group > summary {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    margin: 2px 0; padding: 7px 10px; border-radius: 8px; cursor: pointer;
    list-style: none; font-size: 11px; letter-spacing: .06em;
    text-transform: uppercase; color: #f0d9de; font-weight: 650;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::marker { content: ''; }
.nav-group > summary::after {
    content: ''; width: 7px; height: 7px; flex: 0 0 auto;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(-45deg); margin-right: 2px;
}
.nav-group[open] > summary::after { transform: rotate(45deg) translate(-1px, -1px); }
.nav-group > summary:hover { background: rgba(255,255,255,.08); }
.nav-group a, .logout {
    display: block; color: #fffcf8; text-decoration: none;
    border-radius: 8px; padding: 7px 10px; font-size: 14px;
}
.nav-group:not([open]) > a { display: none; }
.nav-group a:hover, .nav-group a.active { background: rgba(255,255,255,.1); }
.nav-group a.active { font-weight: 650; }
.logout { margin-top: 8px; color: #f0d9de; }
.account-company { margin: 0 4px 14px; }
.account-company-label {
    margin: 0 8px 6px; font-size: 11px; letter-spacing: .06em;
    text-transform: uppercase; color: #f0d9de; font-weight: 650;
}
.account-company-menu { position: relative; }
.account-company-menu > summary {
    display: block; list-style: none; cursor: pointer; color: #fff;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
    border-radius: 12px; padding: 10px 28px 10px 12px; position: relative;
}
.account-company-menu > summary::-webkit-details-marker { display: none; }
.account-company-menu > summary::marker { content: ''; }
.account-company-menu > summary::after {
    content: ''; position: absolute; right: 12px; top: 18px;
    width: 7px; height: 7px; border-right: 2px solid #f0d9de; border-bottom: 2px solid #f0d9de;
    transform: rotate(-45deg);
}
.account-company-menu[open] > summary::after { transform: rotate(45deg) translate(-2px, -2px); }
.account-company-menu > summary strong, .account-company-menu > summary span { display: block; }
.account-company-menu > summary strong {
    font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-company-menu > summary span { margin-top: 2px; color: #f0d9de; font-size: 12px; }
.account-company-list {
    position: absolute; z-index: 6; left: 0; right: 0; margin-top: 6px;
    background: #fff; color: var(--ink); border-radius: 12px; padding: 6px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .18);
}
.account-company-menu:not([open]) > .account-company-list { display: none; }
.account-company-list form { margin: 0; }
.account-company-list button, .account-company-list a {
    display: block; width: 100%; box-sizing: border-box; text-align: left;
    background: transparent; border: 0; border-radius: 8px; padding: 8px 10px;
    color: inherit; font: inherit; cursor: pointer; text-decoration: none;
}
.account-company-list button small { display: block; color: var(--muted); font-size: 12px; }
.account-company-list button:hover, .account-company-list a:hover,
.account-company-list button.is-current { background: var(--soft); }
.account-company-list a { color: var(--blue); font-weight: 650; }

.main { min-width: 0; }
.topbar {
    display: flex; align-items: center; gap: 16px;
    padding: 18px 28px; background: var(--card); border-bottom: 1px solid var(--line);
}
.topbar > div { min-width: 0; }
.topbar h1 { margin: 0; font-size: 22px; }
.eyebrow { margin: 0 0 2px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.menu-button { display: none; }
.content { padding: 24px 28px 48px; }
.lead { margin-top: 0; color: var(--muted); max-width: 68ch; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 14px; }
.cards article, .cards a, .panel, .sheet, .empty-hero {
    background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px;
}
.cards a { color: inherit; text-decoration: none; display: block; }
.cards a:hover { border-color: var(--blue); }
.cards h2, .panel h2 { margin: 0; font-size: 14px; color: var(--muted); font-weight: 650; }
.figure { margin: 10px 0 4px; font-size: 28px; font-weight: 700; }
.cards span, .quiet { color: var(--muted); }
.overview-toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; margin-bottom: 16px; }
.period-label { margin: 0; font-weight: 700; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.button-light { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.panel-head, .year-nav { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.year-nav { justify-content: flex-end; }
.year-nav a { font-size: 14px; font-weight: 650; text-decoration: none; }
.year-panel { margin-bottom: 14px; }
.todo-panel .table-wrap { margin-top: 12px; }
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; margin: 18px 0 8px; }
.months a { display: grid; gap: 6px; justify-items: center; color: var(--muted); font-size: 11px; text-decoration: none; }
.months i { width: 100%; height: 36px; border-radius: 6px; background: var(--soft); display: block; }
.months a.active { color: var(--blue); font-weight: 700; }
.months a.active i { background: var(--blue); }
.table-wrap { overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-weight: 650; }
.sheet { display: grid; gap: 14px; max-width: 460px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 650; }
input, select, textarea { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-weight: 450; background: var(--card); color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--focus); outline-offset: 1px; }
.button {
    display: inline-block; width: fit-content; background: var(--blue); color: #fff;
    text-decoration: none; border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 650; cursor: pointer;
}
.button:hover { background: var(--blue-deep); }
.button-light:hover { background: var(--soft); color: var(--ink); }
.empty-hero { max-width: 640px; }
.error { color: #6b0f1a; }
.inbox-form { margin-bottom: 22px; }
.sheet.inbox-form { max-width: 640px; }
.company-sheet { max-width: 760px; }
.company-sheet h2 { margin: 8px 0 0; font-size: 18px; }
.company-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.company-wide { grid-column: 1 / -1; }
.company-sheet input, .company-sheet select { width: 100%; box-sizing: border-box; }
.company-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.company-logo { max-width: 180px; max-height: 72px; object-fit: contain; }
.user-layout { display: grid; gap: 16px; align-items: start; }
.user-fields, .user-perms { display: grid; gap: 10px; }
.user-fields input, .user-fields select { width: 100%; box-sizing: border-box; }
.user-perm { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.user-perm summary { display: flex; align-items: center; cursor: pointer; }
.user-perm summary label, .user-children label { display: flex; align-items: center; gap: 8px; }
.user-children { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.user-children label { font-weight: 450; font-size: 13px; }
.user-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.user-row form { margin: 0; }
.chart-fields { display: grid; gap: 10px; align-items: end; }
.chart-fields input, .chart-fields select, #chart-search { width: 100%; box-sizing: border-box; }
.chart-fields input[readonly], .chart-fields select:disabled { background: #f3f4f6; }
.chart-lock { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; padding: 10px; border-radius: 10px; font-weight: 700; }
.chart-actions { text-align: right; white-space: nowrap; }
.chart-actions form { display: inline; }
.chart-actions .button { padding: 6px 10px; }
.chart-actions .is-muted { opacity: 0.45; }
#chart-count { font-weight: 700; }
.notice { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; padding: 12px; border-radius: 12px; font-weight: 700; }
.fiscal-fields { display: grid; gap: 10px; align-items: end; }
.fiscal-fields input, .fiscal-fields select { width: 100%; box-sizing: border-box; }
.fiscal-check { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.fiscal-table { min-width: 700px; }
.fiscal-actions { white-space: nowrap; text-align: right; }
.fiscal-actions form { display: inline; }
.fiscal-actions .button { padding: 6px 10px; }
.fiscal-open, .fiscal-locked { display: inline-block; padding: 4px 8px; border-radius: 999px; font-weight: 700; white-space: nowrap; }
.fiscal-open { background: #dcfce7; color: #166534; }
.fiscal-locked { background: #e5e7eb; color: #111827; }
.moms-fields { display: grid; gap: 10px; align-items: end; }
.moms-fields input, .moms-fields select, .moms-inline select { width: 100%; box-sizing: border-box; }
.moms-table { min-width: 600px; }
.moms-actions, .moms-inline { white-space: nowrap; }
.moms-actions form, .moms-inline { display: inline; }
.moms-actions .button, .moms-inline .button { padding: 6px 10px; }
.moms-status { display: inline-block; padding: 4px 8px; border-radius: 999px; font-weight: 700; font-size: 12px; white-space: nowrap; }
.moms-status.is-open { background: #dcfce7; color: #166534; }
.moms-status.is-locked { background: #fee2e2; color: #991b1b; }
.moms-fixed { color: #6b7280; }
.moms-empty { padding: 14px; background: #f9fafb; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-weight: 700; }
.invoice-company-grid, .invoice-bank-grid, .invoice-format-grid { display: grid; gap: 14px; }
.invoice-company-grid span, .invoice-format-text, .invoice-auto .quiet { color: var(--muted); font-weight: 450; }
.invoice-company-grid strong { display: block; }
.invoice-settings-number, .invoice-settings-add { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 8px 0 16px; }
.invoice-settings-number input, .invoice-settings-add input { width: 160px; }
.invoice-check { display: flex; align-items: flex-start; gap: 8px; font-weight: 700; }
.invoice-check input { width: auto; margin-top: 2px; }
.closing-card select[name="terms"] { width: 180px; }
.invoice-bank-grid input, .closing-card textarea { width: 100%; box-sizing: border-box; }
.invoice-settings-form h2:not(:first-child) { margin-top: 22px; }
.invoice-auto { margin: 8px 0 16px; padding: 14px 16px; border: 1px solid #bfdbfe; border-radius: 10px; background: #eff6ff; }
.invoice-auto .quiet { display: block; margin-top: 4px; }
.invoice-account-list { display: grid; gap: 8px; margin-bottom: 8px; }
.invoice-account { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; max-width: 100%; }
.invoice-account span { min-width: 0; overflow-wrap: anywhere; }
.invoice-account-remove { border: 0; background: transparent; color: #dc2626; font-weight: 700; cursor: pointer; flex: none; }
.button-dark { background: #111827; }
.invoice-format { position: relative; display: grid; gap: 8px; text-align: left; border: 2px solid #e2e8f0; border-radius: 14px; padding: 14px; background: #fff; cursor: pointer; }
.invoice-format input { position: absolute; opacity: 0; pointer-events: none; }
.invoice-format.is-selected, .invoice-format:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(114, 47, 55, 0.16); background: #fbf7f6; }
.invoice-format-title { display: flex; align-items: center; gap: 8px; }
.invoice-format-mark { width: 16px; height: 16px; border: 2px solid var(--blue); border-radius: 50%; box-sizing: border-box; }
.invoice-format.is-selected .invoice-format-mark, .invoice-format:has(input:checked) .invoice-format-mark { background: var(--blue); box-shadow: inset 0 0 0 3px #fff; }
.invoice-format-preview { height: 92px; border: 1px solid #cbd5e1; border-radius: 5px; padding: 9px; }
.invoice-format-bar { display: block; width: 52%; height: 6px; border-radius: 2px; margin-bottom: 9px; background: #111; }
.invoice-format.is-blue .invoice-format-bar { background: var(--blue); }
.invoice-format.is-blue .invoice-format-preview { background: var(--soft); border-color: #e4c9ce; }
.invoice-format.is-blue .invoice-format-line { background: #d7b8bd; }
.invoice-format.is-blue .invoice-format-pay { border-top-color: var(--navy); background: repeating-linear-gradient(to bottom, var(--card) 0, var(--card) 7px, #ead6d9 8px); }
.invoice-format-line { display: block; width: 88%; height: 3px; background: #cbd5e1; border-radius: 2px; margin-bottom: 5px; }
.invoice-format-line.is-short { width: 72%; }
.invoice-format-box { display: block; height: 24px; width: 48%; margin-left: auto; border: 1px solid #64748b; margin-bottom: 7px; }
.invoice-format-pay { display: block; height: 39px; margin-top: 8px; border-top: 2px solid #64748b; background: repeating-linear-gradient(to bottom, #fff 0, #fff 7px, #e2e8f0 8px); }
.invoice-format.is-minimal .invoice-format-pay { border: 0; }
.invoice-format-number { position: absolute; top: 10px; right: 12px; width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; background: #e2e8f0; font-weight: 800; color: #334155; }
.invoice-footer { margin-top: 16px; }
.invoice-format-2 .table-wrap { border: 2px solid #64748b; }
.invoice-format-3 .table-wrap td, .invoice-format-3 .table-wrap th { padding: 6px 8px; }
.sie-grid { display: grid; gap: 14px; margin-top: 12px; }
.sie-grid span, .sie-batch p { color: var(--muted); font-weight: 450; }
.sie-grid strong { display: block; }
.sie-file { font-weight: 800; }
input[type="file"] { max-width: 100%; }
.import-card .quiet { overflow-wrap: anywhere; }
.import-card .notice, .import-card .error { margin-top: 12px; }
.import-card form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.import-card .button { white-space: normal; max-width: 100%; }
.export-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 12px; }
.export-card .button { display: block; width: 100%; box-sizing: border-box; text-align: center; white-space: normal; }
.export-year { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px 18px; margin-top: 10px; }
.export-year p { margin: 4px 0 0; }
.export-year .button { white-space: normal; max-width: 100%; }
.audit-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 0 0 16px; }
.audit-filters label, .audit-filters .list-actions { min-width: 0; }
.audit-filters input { width: 11rem; max-width: 100%; }
.audit-table { min-width: 720px; }
.audit-skapad { color: #166534; font-weight: 700; }
.audit-andrad { color: #92400e; font-weight: 700; }
.audit-borttagen { color: #991b1b; font-weight: 700; }
.audit-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.audit-pager div { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.contact-sheet { max-width: 640px; }
.contact-sheet input, .contact-sheet textarea { width: 100%; box-sizing: border-box; }
.contact-sheet textarea { resize: vertical; font: inherit; }
.contact-sheet .button { width: 100%; box-sizing: border-box; text-align: center; white-space: normal; }
.archive-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin: 0 0 18px; }
#capture-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.capture-name { flex: 1 1 16rem; min-width: 0; }
.capture-name input { width: 100%; min-width: 0; box-sizing: border-box; }
#capture-save[hidden] { display: none; }
#capture-match:empty { display: none; }
#capture-match { flex: 1 1 100%; margin: 0; }
#capture-status:empty { display: none; }
.correction-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin: 0 0 16px; }
.correction-choices button { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; font: inherit; font-weight: 700; color: inherit; cursor: pointer; }
.correction-choices button.is-selected { border-color: var(--blue); background: var(--soft); }
.correction-choices small { display: block; margin-top: 4px; color: var(--muted); font-weight: 450; line-height: 1.35; }
.correction-panel { display: none; margin: 0 0 16px; }
.correction-panel.is-on { display: block; }
.correction-line { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; margin: 0 0 8px; }
.correction-line label, .correction-field { display: flex; flex-direction: column; gap: 4px; font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.correction-line input, .correction-field input, .correction-field select, .correction-field textarea { width: 100%; box-sizing: border-box; font: inherit; font-weight: 650; color: var(--ink); }
.correction-field textarea { min-height: 72px; resize: vertical; }
@media (max-width: 900px) {
    .correction-line { grid-template-columns: 1fr; }
}
.archive-tools .button, .archive-tools summary.button { white-space: nowrap; }
.archive-fetch { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.archive-pop { position: relative; }
.archive-pop > summary { list-style: none; }
.archive-pop > summary::-webkit-details-marker { display: none; }
.archive-panel { margin: 8px 0 16px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.archive-pop .archive-panel { position: absolute; z-index: 5; width: min(520px, 92vw); }
.archive-mail { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.archive-mail input, .archive-mail select, .archive-search input, .archive-search select, .archive-note { width: 100%; box-sizing: border-box; }
.archive-mobile input { width: 100%; box-sizing: border-box; margin: 0 0 10px; }
.archive-code { font-size: 22px; font-weight: 800; letter-spacing: 2px; }
.archive-box { border: 1px solid var(--line); border-radius: 12px; margin: 0 0 16px; background: var(--card); }
.archive-box > summary { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 16px; cursor: pointer; font-weight: 700; }
.archive-box .when-open { display: none; }
.archive-box[open] .when-open { display: inline; }
.archive-box[open] .when-closed { display: none; }
.archive-count { display: inline-flex; min-width: 1.6rem; justify-content: center; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: #fffbeb; color: #92400e; }
.archive-empty { padding: 8px 16px 18px; }
.archive-bulk { padding: 0 16px 10px; }
.archive-search { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 0 16px 12px; }
.archive-search input { max-width: 240px; }
.archive-search select { max-width: 220px; }
.archive-table { min-width: 720px; }
.archive-table .quiet { display: block; }
.archive-note { max-width: 220px; }
.archive-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.archive-actions select { min-width: 9rem; }
.archive-status { color: #15803d; font-weight: 700; }
.cash-fields, .cash-settings .cash-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.cash-fields input, .cash-fields select, .cash-fields textarea, .cash-settings input, .cash-settings select { width: 100%; max-width: 100%; box-sizing: border-box; }
.contact-sheet .quiet { display: block; margin-top: 6px; font-weight: 450; }
.contact-sent { max-width: 640px; }
.contact-sent form { margin-top: 14px; }
.contact-sent .button { width: auto; }
.sie-year { max-width: 320px; margin: 12px 0; }
.sie-year select, .sie-table input { width: 100%; box-sizing: border-box; }
.sie-table { min-width: 640px; }
.sie-actions, .sie-batch { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.sie-batch { justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #f8fafc; }
.sie-batch p { margin: 4px 0 0; }
.sie-batches { display: grid; gap: 12px; }
.sie-diff { color: #b91c1c; }
.sie-ok { color: #047857; }
.sie-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; padding: 14px; border-radius: 12px; font-weight: 700; margin: 12px 0; }
.sie-dupes { background: #111827; color: #e5e7eb; padding: 16px; border-radius: 12px; max-height: 250px; overflow: auto; }
@media (min-width: 901px) {
    .user-layout { grid-template-columns: minmax(0, 1fr) 340px; }
    .user-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 140px; }
    .chart-fields { grid-template-columns: 160px minmax(0, 1fr) 180px auto auto; }
    .fiscal-fields { grid-template-columns: 120px 150px 150px 130px minmax(160px, 1fr) auto auto; }
    .moms-fields { grid-template-columns: 180px 220px auto; }
    .invoice-company-grid, .invoice-bank-grid, .invoice-format-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sie-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .user-perms { grid-template-columns: 1fr 1fr; }
}
.inbox-actions { display: flex; gap: 12px; align-items: center; }
.inbox-actions form { margin: 0; }
.guide-top { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.guide-top h2, .guide-step h2, .list-panel h2 { margin: 0 0 8px; }
.guide-contents { margin: 0; padding-left: 1.2rem; display: grid; gap: 8px; }
.guide-ways { display: grid; gap: 8px; }
.guide-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.guide-facts span { border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 13px; }
.guide-step { scroll-margin-top: 16px; }
.guide-series { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.guide-shot { margin: 0; display: grid; gap: 8px; align-content: start; }
.guide-shot svg { width: 100%; height: auto; display: block; }
.guide-shot figcaption { display: grid; gap: 2px; font-size: 14px; }
.guide-shot figcaption b { font-size: 14px; }
.guide-shot figcaption span { color: var(--muted); }
@media (max-width: 900px) {
    .guide-top, .guide-series { grid-template-columns: 1fr; }
}
.receipt-vats { display: grid; gap: 8px; flex: 1 1 100%; min-width: 0; }
.receipt-vats-label { font-size: 14px; font-weight: 650; }
.receipt-vat { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; min-width: 0; }
.receipt-vat label { min-width: 0; }
.receipt-vat select, .receipt-vat input { width: 9rem; max-width: 100%; box-sizing: border-box; }
.receipt-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 8px; }
.receipt-toolbar label { min-width: 140px; }
.receipt-account-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; width: 100%; }
.receipt-account-tools input { width: 8rem; }
.receipt-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 1fr); gap: 16px; align-items: start; }
.receipt-layout > .list-panel { min-width: 0; }
.receipt-book { container-type: inline-size; container-name: receipt-book; }
.receipt-preview { width: 100%; height: 520px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.receipt-templates { display: grid; gap: 6px; margin: 8px 0 12px; }
.receipt-templates button { display: grid; justify-items: start; gap: 2px; }
.receipt-templates button.is-selected { background: var(--soft); }
.receipt-templates small { color: var(--muted); font-weight: 450; }
.receipt-head, .receipt-line { display: grid; grid-template-columns: minmax(4.5rem, 5.5rem) minmax(0, 1fr) minmax(5rem, 6rem) minmax(5rem, 6rem) auto; gap: 6px; align-items: center; }
.receipt-head { color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.receipt-head > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt-line { margin-bottom: 6px; min-width: 0; }
.receipt-line label { display: block; min-width: 0; font-weight: 450; }
.receipt-line label span { display: none; }
.receipt-line input { width: 100%; min-width: 0; box-sizing: border-box; }
.receipt-line label:nth-child(3) input, .receipt-line label:nth-child(4) input { text-align: right; }
.receipt-line > button { max-width: 100%; }
@container receipt-book (max-width: 34rem) {
    .receipt-head { display: none; }
    .receipt-line {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 8px 10px;
        align-items: end;
        margin: 0 0 12px;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--line);
    }
    .receipt-line label { display: grid; gap: 4px; }
    .receipt-line label span { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
    .receipt-line > button { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 900px) {
    .receipt-layout { grid-template-columns: 1fr; }
    .receipt-preview { height: 320px; }
}
.status {
    display: inline-block; background: var(--soft); color: var(--navy);
    border-radius: 999px; padding: 3px 8px; font-size: 13px; font-weight: 650;
}
.text-button {
    border: 0; background: transparent; color: var(--blue); padding: 0; cursor: pointer; font-weight: 650;
}
.tools-bar { display: grid; gap: 12px; margin-bottom: 22px; }
.tools-bar input { max-width: 420px; }
.tools-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.tools-filters button {
    border: 1px solid var(--line); background: var(--card); color: var(--ink);
    border-radius: 999px; padding: 8px 12px; font-weight: 700; cursor: pointer;
}
.tools-filters button.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.tools-group { margin-bottom: 22px; }
.tools-group h2 { margin: 0 0 10px; font-size: 18px; color: var(--ink); }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.tool-card {
    display: grid; gap: 6px; background: var(--card); border: 1px solid var(--line);
    border-radius: 14px; padding: 16px 18px; color: inherit; text-decoration: none;
}
.tool-card:hover { border-color: var(--blue); }
.tool-card span { color: var(--muted); font-size: 14px; }
.tool-form { margin-bottom: 16px; }
.tool-result p { display: flex; justify-content: space-between; gap: 16px; margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tool-total strong { font-size: 20px; }
.tool-result .quiet { display: block; border: 0; padding-top: 12px; }
.handling-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.handling-bar input { max-width: 360px; }
.handling-filters { margin-bottom: 8px; }
.handling-filters a {
    border: 1px solid var(--line); background: var(--card); color: var(--ink);
    border-radius: 999px; padding: 8px 12px; font-weight: 700; text-decoration: none;
}
.handling-filters a.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.handling-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem); gap: 14px; align-items: start; max-width: 100%; }
.handling-layout a { text-decoration: none; font-weight: 650; }
.template-groups tr.is-selected td { background: var(--soft); }
.handling-bar select { max-width: 260px; }
.handling-ocr { display: block; color: var(--muted); font-size: 12px; font-weight: 450; }
.handling-layout tr.is-selected td { background: var(--soft); }
.handling-detail { display: grid; gap: 12px; min-width: 0; max-width: 100%; }
.handling-detail h2 { color: var(--ink); font-size: 18px; overflow-wrap: anywhere; }
.handling-detail form { min-width: 0; max-width: 100%; }
.handling-detail input, .handling-detail select { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
.handling-lines p { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: baseline; margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); }
.handling-lines span { min-width: 0; overflow-wrap: anywhere; }
.handling-lines strong { white-space: nowrap; }
.handling-note { margin: 0 0 12px; font-weight: 700; color: #2f6b4f; }
.template-detail { display: grid; gap: 8px; margin-bottom: 16px; }
.template-detail h2 { color: var(--ink); font-size: 18px; }
.template-grid { display: grid; grid-template-columns: minmax(240px, 360px) minmax(0, 1fr); gap: 18px; align-items: start; }
.template-fields { display: grid; gap: 10px; }
.template-fields textarea { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; font-weight: 450; background: var(--card); color: var(--ink); resize: vertical; }
.template-fields textarea:focus { outline: 3px solid var(--focus); outline-offset: 1px; }
.template-actions { display: flex; gap: 8px; }
.account-add { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.voucher-meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.voucher-meta p { margin: 0 0 12px; }
.voucher-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: end; margin-bottom: 14px; }
.voucher-lines { width: 100%; }
.voucher-lines input { width: 100%; padding: 8px 10px; }
.voucher-lines td:nth-child(4) input, .voucher-lines td:nth-child(5) input, .voucher-lines tfoot td:nth-child(2), .voucher-lines tfoot td:nth-child(3) { text-align: right; }
.voucher-lines tfoot td { font-weight: 700; }
.voucher-check { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 8px 0 14px; color: var(--muted); }
.voucher-check .is-ok { color: #2f6b4f; font-weight: 700; }
.list-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: end; margin: 0 0 14px; }
.list-filters label { min-width: 0; }
.list-filters input, .list-filters select { width: 100%; min-width: 0; max-width: 100%; }
.list-actions { display: flex; gap: 8px; align-items: center; }
.list-panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin: 0 0 16px; }
.list-panel h2, .list-panel h3 { margin: 0 0 8px; }
.list-panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 8px; }
.list-panel-head h2 { margin: 0; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; background: var(--soft); color: var(--navy); font-size: 12px; font-weight: 650; white-space: nowrap; }
.badge.is-void { background: #f3d6d6; color: #6b0f1a; }
tr.is-cancelled { opacity: .58; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num, .cell-amount { white-space: nowrap; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions .button, .row-actions button { padding: 6px 8px; font-size: 13px; }
.row-actions form { margin: 0; }
.action-menu { display: inline-block; }
.action-menu > summary { list-style: none; cursor: pointer; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-menu > summary::marker { content: ''; }
.action-menu-list { position: fixed; z-index: 40; margin: 0; min-width: 180px; padding: 6px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(15, 23, 42, .12); display: grid; }
.action-menu-list[hidden] { display: none; }
.action-menu-list a, .action-menu-list button { display: block; width: 100%; box-sizing: border-box; text-align: left; background: transparent; border: 0; border-radius: 8px; padding: 8px 10px; color: inherit; font: inherit; cursor: pointer; text-decoration: none; }
.action-menu-list a:hover, .action-menu-list button:hover:not(:disabled) { background: var(--soft); }
.action-menu-list form { margin: 0; }
button:disabled { opacity: .5; cursor: default; }
.pager { display: flex; gap: 12px; align-items: center; margin-top: 12px; }
.document-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.document-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.document-list small { display: block; color: var(--muted); font-weight: 450; }
.upload-row { display: grid; gap: 8px; margin: 8px 0 18px; }
.voucher-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.voucher-actions input[name="mallnamn"] { width: 220px; max-width: 100%; }
@media (max-width: 900px) {
    .voucher-head { grid-template-columns: 1fr; }
}
.template-lines { width: 100%; }
.template-lines td:nth-child(3), .template-lines td:nth-child(4), .template-lines tfoot td { text-align: right; font-variant-numeric: tabular-nums; }
.template-lines tfoot td { font-weight: 700; }
.template-lines tfoot td:first-child { text-align: left; }
@media (max-width: 900px) {
    .handling-layout, .template-grid { grid-template-columns: 1fr; }
    .handling-bar { flex-wrap: wrap; }
    .handling-bar input { flex: 1 1 12rem; max-width: none; min-width: 0; }
    .handling-table, .voucher-list-wrap, .voucher-open {
        overflow: visible;
        background: transparent;
        border: 0;
        border-radius: 0;
    }
    .handling-table table, .handling-table tbody,
    .voucher-list-wrap table, .voucher-list-wrap tbody,
    .voucher-open table, .voucher-open tbody, .voucher-open tfoot { display: block; width: 100%; }
    .handling-table thead, .voucher-list-wrap thead, .voucher-open thead { display: none; }
    .handling-row, .voucher-list-wrap .voucher-row, .voucher-line,
    .handling-table tbody tr:not(.handling-row),
    .voucher-list-wrap tbody tr:not(.voucher-row) {
        display: block;
        margin: 0 0 10px;
        padding: 4px 14px 6px;
        background: var(--card);
        border: 1px solid var(--line);
        border-radius: 16px;
        box-shadow: 0 12px 32px rgba(79, 31, 37, 0.06);
    }
    .handling-row td, .voucher-list-wrap .voucher-row td, .voucher-line td,
    .handling-table tbody tr:not(.handling-row) td,
    .voucher-list-wrap tbody tr:not(.voucher-row) td {
        display: grid;
        grid-template-columns: 8.4rem minmax(0, 1fr);
        gap: 8px;
        align-items: start;
        width: auto;
        min-width: 0;
        padding: 11px 0;
        border: 0;
        border-bottom: 1px solid var(--line);
        text-align: left;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .handling-row td:last-child, .voucher-list-wrap .voucher-row td:last-child, .voucher-line td:last-child { border-bottom: 0; }
    .handling-table tbody tr:not(.handling-row) td,
    .voucher-list-wrap tbody tr:not(.voucher-row) td { grid-template-columns: 1fr; border-bottom: 0; }
    .handling-row td::before, .voucher-list-wrap .voucher-row td::before, .voucher-line td::before {
        color: var(--muted);
        font-size: 13px;
        font-weight: 800;
        line-height: 1.35;
    }
    .handling-row .cell-date::before { content: "Datum"; }
    .handling-row .cell-text::before { content: "Beskrivning"; }
    .handling-row .cell-account::before { content: "Konto"; }
    .handling-row .cell-amount::before { content: "Belopp"; }
    .handling-row .cell-status::before { content: "Status"; }
    .voucher-list-wrap .voucher-row .cell-date::before { content: "Datum"; }
    .voucher-list-wrap .voucher-row .cell-number::before { content: "Ver.nr"; }
    .voucher-list-wrap .voucher-row .cell-type::before { content: "Typ"; }
    .voucher-list-wrap .voucher-row .cell-title::before { content: "Titel"; }
    .voucher-list-wrap .voucher-row .cell-party::before { content: "Leverantör/Kund"; }
    .voucher-list-wrap .voucher-row .cell-amount::before { content: "Belopp"; }
    .voucher-list-wrap .voucher-row .cell-source::before { content: "Källa"; }
    .voucher-list-wrap .voucher-row .cell-actions::before { content: "Åtgärder"; }
    .voucher-line .cell-account::before { content: "Konto"; }
    .voucher-line .cell-name::before { content: "Kontonamn"; }
    .voucher-line .cell-text::before { content: "Text"; }
    .voucher-line .cell-debit::before { content: "Debet"; }
    .voucher-line .cell-credit::before { content: "Kredit"; }
    .handling-row .cell-text::before, .voucher-line .cell-text::before { grid-row: 1 / span 2; }
    .handling-row .cell-text > *, .voucher-line .cell-text > * { grid-column: 2; }
    .handling-row td.cell-amount, .voucher-list-wrap .voucher-row td.cell-amount, .voucher-line td.cell-debit, .voucher-line td.cell-credit {
        font-weight: 800;
        line-height: 1.25;
        white-space: nowrap;
        overflow-wrap: normal;
    }
    .voucher-list-wrap .voucher-row .cell-party.is-blank, .voucher-line .cell-text:empty { display: none; }
    .handling-row.is-selected { border-color: var(--blue); background: var(--soft); }
    .voucher-list-wrap .voucher-row .cell-actions .button { padding: 6px 8px; }
    .voucher-line.is-sum .cell-account { grid-template-columns: 1fr; font-weight: 800; }
    .voucher-line.is-sum .cell-account::before { content: none; }
    .voucher-head input, .voucher-head select, .receipt-toolbar input, .receipt-toolbar select { width: 100%; min-width: 0; box-sizing: border-box; }
    .voucher-form .table-wrap, .receipt-layout .list-panel { overflow: visible; }
    .voucher-form .table-wrap { background: transparent; border: 0; border-radius: 0; }
    .voucher-lines, .voucher-lines tbody, .voucher-lines tfoot { display: block; width: 100%; }
    .voucher-lines thead { display: none; }
    .voucher-lines tr {
        display: block;
        margin: 0 0 10px;
        padding: 4px 14px 6px;
        background: var(--card);
        border: 1px solid var(--line);
        border-radius: 16px;
        box-shadow: 0 12px 32px rgba(79, 31, 37, 0.06);
    }
    .voucher-lines td {
        display: grid;
        grid-template-columns: 8.4rem minmax(0, 1fr);
        gap: 8px;
        align-items: center;
        min-width: 0;
        padding: 11px 0;
        border: 0;
        border-bottom: 1px solid var(--line);
        text-align: left;
    }
    .voucher-lines td:last-child { border-bottom: 0; }
    .voucher-lines td::before { color: var(--muted); font-size: 13px; font-weight: 800; }
    .voucher-lines tbody td:nth-child(1)::before { content: "Konto"; }
    .voucher-lines tbody td:nth-child(2)::before { content: "Kontonamn"; }
    .voucher-lines tbody td:nth-child(3)::before { content: "Text"; }
    .voucher-lines tbody td:nth-child(4)::before { content: "Debet"; }
    .voucher-lines tbody td:nth-child(5)::before { content: "Kredit"; }
    .voucher-lines tbody td:nth-child(6) { grid-template-columns: 1fr; }
    .voucher-lines tbody td:nth-child(6)::before { content: none; }
    .voucher-lines input, .voucher-lines button { width: 100%; min-width: 0; box-sizing: border-box; }
    .voucher-lines tfoot td:nth-child(1) { grid-template-columns: 1fr; font-weight: 800; }
    .voucher-lines tfoot td:nth-child(1)::before { content: none; }
    .voucher-lines tfoot td:nth-child(2)::before { content: "Debet"; }
    .voucher-lines tfoot td:nth-child(3)::before { content: "Kredit"; }
    .voucher-lines tfoot td:nth-child(4) { display: none; }
    .voucher-lines tfoot td:nth-child(2), .voucher-lines tfoot td:nth-child(3) { font-weight: 800; line-height: 1.25; }
    .receipt-head { display: none; }
    .receipt-line {
        display: block;
        margin: 0 0 10px;
        padding: 4px 14px 6px;
        background: var(--card);
        border: 1px solid var(--line);
        border-radius: 16px;
        box-shadow: 0 12px 32px rgba(79, 31, 37, 0.06);
    }
    .receipt-line label {
        display: grid;
        grid-template-columns: 8.4rem minmax(0, 1fr);
        gap: 8px;
        align-items: center;
        padding: 11px 0;
        border-bottom: 1px solid var(--line);
    }
    .receipt-line label span { display: block; color: var(--muted); font-size: 13px; font-weight: 800; }
    .receipt-line label:nth-child(3) input, .receipt-line label:nth-child(4) input { text-align: left; font-weight: 800; }
    .receipt-line button { margin-top: 8px; }
}
.todo { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.todo a { font-weight: 650; text-decoration: none; }
.todo span { display: block; color: var(--muted); font-size: 13px; }

body.is-overview .content { padding: 0; }
body.is-overview .topbar { display: none; }

.dashboard-page {
    padding: 28px;
    background: var(--paper);
    min-height: 100%;
    color: var(--ink);
}
.dash-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px minmax(240px, 320px);
    gap: 16px;
    align-items: stretch;
    margin-bottom: 16px;
}
.dash-title { grid-column: 1; align-self: end; }
.quick-tools-card { grid-column: 2; }
.period-box { grid-column: 3; }
.dash-title h1 { margin: 0 0 8px; font-size: 34px; letter-spacing: -0.04em; }
.company-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.dashboard-page .company-name { font-size: 18px; font-weight: 800; }
.dashboard-page .company-orgnr {
    color: var(--muted); font-size: 13px; font-weight: 650;
    background: var(--soft); border-radius: 999px; padding: 2px 8px;
}
.quick-tools-card, .period-box, .kpi-card, .dashboard-page .panel, .side-card {
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: 0 12px 32px rgba(79, 31, 37, 0.06);
}
.quick-tools-card, .period-box { border-radius: 18px; padding: 12px 16px; position: relative; }
.quick-tools-title { font-size: 14px; font-weight: 800; color: var(--ink); margin-bottom: 8px; }
.quick-tools-box { display: grid; gap: 6px; }
.quick-tools-box button {
    border: 1px solid var(--line); background: var(--paper); color: var(--ink);
    border-radius: 10px; padding: 8px 10px; font-weight: 700; font-size: 14px;
    text-align: left; cursor: pointer;
}
.quick-tools-box button:hover { background: var(--soft); }
.period-box .period-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.period-value { color: var(--blue); font-weight: 800; margin: 4px 0 8px; }
.fy-select, .month-filter {
    width: 100%; border-radius: 8px; font-weight: 700;
}
.fy-select { border: 1px solid var(--line); background: var(--soft); color: var(--navy); padding: 6px 10px; }
.month-filter {
    display: inline-block; margin-top: 10px; text-align: center; text-decoration: none;
    background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 999px;
}
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 10px; }
.kpi-card { border-radius: 16px; padding: 14px 16px; }
.kpi-card.loss .kpi-value { color: #111827; }
.kpi-title { color: var(--muted); font-weight: 800; font-size: 14px; }
.kpi-value { font-size: 21px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.main-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 9px; margin-bottom: 10px; }
.dashboard-page .panel { border-radius: 22px; padding: 12px 14px; }
.dashboard-page .panel h2 { margin: 0; color: var(--ink); font-size: 18px; letter-spacing: -0.02em; }
.panel-header { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.month-pick { margin-bottom: 10px; }
.month-row { display: flex; flex-wrap: wrap; gap: 7px; }
.month-btn {
    border: 1px solid var(--line); background: var(--paper); color: var(--muted);
    padding: 5px 10px; border-radius: 999px; font-weight: 800; font-size: 13px; text-decoration: none;
}
.month-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.trend-chart { width: 100%; height: auto; display: block; }
.trend-chart line { stroke: var(--line); }
.trend-chart .month-mark { stroke: var(--blue); stroke-dasharray: 3 3; }
.trend-chart text { fill: var(--muted); font-size: 11px; }
.trend-chart text.selected { fill: var(--blue); font-weight: 800; }
.line-income, .line-cost, .line-result { fill: none; stroke-width: 3; }
.line-income { stroke: #2f6b4f; }
.line-cost { stroke: var(--focus); }
.line-result { stroke: var(--blue); }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 4px; font-size: 12px; font-weight: 800; }
.swatch { width: 18px; height: 3px; border-radius: 999px; display: inline-block; }
.swatch.income { background: #2f6b4f; }
.swatch.cost { background: var(--focus); }
.swatch.result { background: var(--blue); }
.chart-footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.chart-hint, .side-subtitle, .todo-row small { color: var(--muted); font-size: 12px; }
.side-stack { display: grid; gap: 10px; }
.side-card {
    border-radius: 16px; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center;
    color: inherit; text-decoration: none;
}
.side-title { font-weight: 800; }
.side-value { font-size: 24px; font-weight: 800; }
.side-card.muted .side-value { color: #94a3b8; }
.side-card.green .side-value { color: #16a34a; }
.side-card.orange .side-value { color: #c2410c; }
.side-card.red .side-value { color: #b91c1c; }
.bottom-grid { display: grid; grid-template-columns: 1fr; gap: 9px; margin-bottom: 10px; }
.dashboard-page .empty-state { color: #94a3b8; text-align: center; padding: 24px 0; }
.todo-row {
    display: grid; grid-template-columns: 1fr auto; gap: 14px;
    padding: 13px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none;
}
.todo-date { color: #b91c1c; font-weight: 800; font-size: 13px; white-space: nowrap; }
.tool-pop {
    position: absolute; top: 78px; right: 0; z-index: 5; width: 280px;
    background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px;
    box-shadow: 0 22px 55px rgba(79, 31, 37, 0.16);
}
.tool-pop-notes { width: 320px; }
.tool-pop-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800; margin-bottom: 8px; }
.tool-pop-head button { border: 0; background: transparent; font-size: 20px; cursor: pointer; }
.calc-screen, .timer-readout {
    background: var(--navy); color: #fff; border-radius: 12px; text-align: right;
    padding: 12px; font-size: 28px; font-weight: 800; margin-bottom: 8px;
}
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.calc-keys button, .timer-keys button, #notes-save {
    border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 10px; font-weight: 800; cursor: pointer;
}
.calc-clear { grid-column: 1 / -1; }
.timer-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tool-pop textarea { width: 100%; height: 140px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.tool-note, .tool-saved { color: var(--muted); font-size: 12px; }
#notes-save { width: 100%; margin-top: 8px; background: var(--blue); color: #fff; border: 0; }
.invoice-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; }
.invoice-top p { margin: 0; }
.invoice-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.invoice-stats a, .invoice-stats .stat { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; color: inherit; text-decoration: none; }
.invoice-stats a.is-on { outline: 2px solid var(--blue); }
.invoice-stats span { color: var(--muted); font-size: 13px; font-weight: 650; }
.invoice-stats strong { display: block; margin-top: 8px; font-size: 22px; }
.invoice-stats .is-zero, td.is-zero { color: var(--muted); font-weight: 450; }
.invoice-stats a.is-late strong:not(.is-zero) { color: #6b0f1a; }
.invoice-stats a.is-over strong:not(.is-zero) { color: #2f6b4f; }
.invoice-tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.invoice-tabs a { text-decoration: none; border-radius: 8px; padding: 8px 14px; background: var(--paper); color: var(--ink); font-weight: 650; }
.invoice-tabs a.is-on { background: var(--navy); color: #fff; }
.badge.is-paid, .badge.is-sent { background: #e5f2ea; color: #2f6b4f; }
.badge.is-late, .badge.is-credit { background: #f3d6d6; color: #6b0f1a; }
.badge.is-open { background: #f8e6d4; color: #8a4b12; }
.badge.is-part, .badge.is-over { background: #f8efd2; color: #7a5b10; }
.badge.is-draft, .badge.is-unsent { background: #efe6f4; color: #5c3d6e; }
.badge.is-unknown { background: var(--soft); color: var(--muted); }
td.is-negative { color: #6b0f1a; font-weight: 700; }
.check-line { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 14px; font-weight: 450; }
.check-line input { width: auto; margin-top: 4px; }
.invoice-pay { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.invoice-pay label { font-size: 13px; }
.invoice-pay input { width: 150px; }
.empty-hero h2 { margin: 0 0 8px; }
.invoice-stats.rot-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.invoice-stats.sales-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hp { position: absolute; left: -9999px; height: 0; width: 0; opacity: 0; }
.sidebar nav > a { display: block; color: #fff; text-decoration: none; border-radius: 8px; padding: 7px 10px; }
.site { background: var(--paper); }
.site-bar {
    display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
    padding: 16px 24px; background: var(--navy); color: #fff;
}
.site-bar .brand small { color: #f0d9de; }
.site-bar nav { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.site-bar nav a { color: #fff; text-decoration: none; }
.site-bar nav .button { color: var(--ink); background: #fff; }
.site main { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0 72px; }
.site-hero { max-width: 760px; }
.site-hero h1 { margin: 0 0 12px; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05; }
.site-kicker { margin: 0 0 8px; letter-spacing: .06em; text-transform: uppercase; font-size: 12px; font-weight: 700; color: var(--blue); }
.site-lead { font-size: 1.15rem; line-height: 1.5; max-width: 40rem; }
.site-price { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: baseline; margin: 20px 0 0; }
.site-price strong { font-size: 2.4rem; }
.site-price-note { margin-top: 4px; color: var(--muted); }
.site-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.site section { margin-top: 56px; }
.site section h2 { margin: 0 0 16px; font-size: clamp(1.5rem, 3vw, 2rem); }
.site-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.site-steps li { margin: 0; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.site-steps strong { display: block; margin-bottom: 6px; }
.site-steps span { color: var(--muted); line-height: 1.45; }
.site-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.site-cards article { margin: 0; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.site-cards h3 { margin: 0 0 8px; font-size: 1.05rem; }
.site-cards p { margin: 0; line-height: 1.45; }
.site-offer { padding: 28px; background: var(--navy); color: #fff; border-radius: 18px; }
.site-offer h2, .site-offer p { color: #fff; }
.site-offer p { max-width: 40rem; line-height: 1.5; }
.site-offer .button { background: #fff; color: var(--ink); }
.site-offer .button-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.site-legal { max-width: 42rem; }
.site-legal h2 { margin: 28px 0 8px; font-size: 1.2rem; }
.site-legal p { margin: 0; line-height: 1.55; }
.site-faq { display: grid; gap: 10px; }
.site-faq details { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; }
.site-faq summary { cursor: pointer; font-weight: 650; }
.site-faq p { margin: 10px 0 0; line-height: 1.5; }
.site-foot { display: flex; flex-wrap: wrap; gap: 12px 20px; padding: 22px 24px 32px; background: var(--navy); }
.site-foot a { color: #fff; text-decoration: none; }
@media (max-width: 800px) {
    .site-steps, .site-cards { grid-template-columns: 1fr; }
    .site-bar nav { gap: 10px 14px; }
}
.tax-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 16px; margin: 0 0 12px; }
.tax-compare section { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.tax-compare h2 { margin: 0 0 10px; font-size: 1rem; }
.tax-compare label { display: block; margin: 0 0 10px; }
.tax-compare input { width: 100%; }
.sales-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; align-items: end; margin: 0 0 10px; }
.sales-filters label, .sales-filters .list-actions { min-width: 0; }
.sales-filters input, .sales-filters select { width: 100%; min-width: 0; }
.sales-filters .list-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.register-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; align-items: end; margin-bottom: 14px; }
.register-grid label, .register-grid .list-actions { min-width: 0; }
.register-grid input, .register-grid select { width: 100%; min-width: 0; }
.row-actions input[name="betalt"] { width: 110px; }
.payroll-table input { width: 7.5rem; max-width: 100%; }
.sales-table tfoot td { font-weight: 700; }
.sales-table tr.is-section th { text-align: left; font-size: 15px; padding-top: 16px; }
.sales-table tr.is-block th { text-align: left; padding-top: 12px; }
.sales-table tr.is-sum td { font-weight: 700; }
.ledger-head, .ledger-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 150px 28px; gap: 8px; align-items: center; }
.ledger-head { color: var(--muted); font-size: 13px; padding: 0 12px 8px; border-bottom: 1px solid var(--line); }
.ledger-row { padding: 12px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.ledger-row:hover { background: var(--soft); }
.ledger-arrow { text-align: right; font-size: 18px; }
.ledger-detail { background: var(--soft); padding: 8px 12px 14px; border-bottom: 1px solid var(--line); }
.ledger-tools { display: flex; gap: 16px; align-items: center; margin: 4px 0 10px; }
.ledger-tools a, .ledger-tools button { border: 0; background: none; color: var(--blue); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.ledger-empty { padding: 8px 12px 16px; }
.ledger-print-head { display: none; }
.asset-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.asset-form { margin-top: 18px; max-width: 860px; }
.asset-form .register-grid { margin-top: 8px; }
.asset-span { grid-column: 1 / -1; }
.vat-sub { display: block; color: var(--muted); font-size: 13px; font-weight: 450; }
.vat-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; }
.vat-actions .button { white-space: nowrap; }
.esl-file { white-space: pre; overflow: auto; background: var(--soft); padding: 12px; border-radius: 8px; font-family: ui-monospace, monospace; font-size: 13px; }
.analysis-table { font-size: 13px; }
.analysis-table th, .analysis-table td { white-space: nowrap; }
.analysis-table td:first-child, .analysis-table th:first-child { white-space: normal; }
.closing-steps { display: flex; flex-direction: column; gap: 4px; margin: 0 0 18px; }
.closing-steps a, .closing-steps span { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: inherit; text-decoration: none; }
.closing-steps .is-current { background: #eff6ff; font-weight: 700; }
.closing-steps .is-wait { color: #94a3b8; }
.closing-num { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 26px; background: #e2e8f0; font-size: 12px; font-weight: 700; }
.closing-steps .is-current .closing-num { background: #0755b8; color: #fff; }
.closing-steps .is-done .closing-num { background: #15803d; color: #fff; }
.closing-card { border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px 16px; margin: 12px 0; }
.closing-card h2 { margin: 0 0 8px; font-size: 18px; }
.closing-card p { margin: 0 0 10px; }
.closing-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sales-table tr.is-sum td { font-weight: 700; }
.annual-sheet { display: none; }
.annual-step-kontroll .annual-sheet { display: block; margin-top: 18px; }
.annual-sheet h2, .annual-sheet h3 { margin: 18px 0 8px; }
.annual-sheet h2 { font-size: 20px; }
.annual-sheet h3 { font-size: 16px; }
label textarea { width: 100%; box-sizing: border-box; resize: vertical; }
.button-danger { background: #6b0f1a; }
.sales-table form { display: inline; }
.sales-table td .text-button { margin-left: 8px; }
.invoice-stats small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 500; }
.rot-pick { width: auto; padding: 8px; }
.rot-cases td span.quiet { display: block; }
@media (max-width: 900px) {
    .invoice-stats, .invoice-top { grid-template-columns: 1fr; display: grid; }
    .invoice-stats.rot-tabs, .invoice-stats.sales-stats { grid-template-columns: 1fr 1fr; }
    .sales-filters.asset-filters, .sales-filters.vat-filters, .sales-filters.esl-filters, .sales-filters.analysis-filters, .sales-filters.cashflow-filters, .sales-filters.closing-filters, .sales-filters.annual-filters, .sales-filters.sru-filters, .list-filters { grid-template-columns: 1fr; }
    .company-grid { grid-template-columns: 1fr; }
    .user-children { grid-template-columns: 1fr; }
    .chart-fields { grid-template-columns: 1fr; }
    .fiscal-fields { grid-template-columns: 1fr; }
    .moms-fields { grid-template-columns: 1fr; }
    .invoice-company-grid, .invoice-bank-grid, .invoice-format-grid { grid-template-columns: 1fr; }
    .sie-grid, .export-grid { grid-template-columns: 1fr; }
    .export-year { flex-wrap: wrap; }
    .audit-filters { display: grid; grid-template-columns: 1fr; }
    .archive-tools { display: grid; grid-template-columns: 1fr; }
    .archive-tools .button, .archive-tools summary.button, .archive-fetch .button { width: 100%; box-sizing: border-box; text-align: center; }
    .archive-mail, .archive-search { display: grid; grid-template-columns: 1fr; }
    .archive-search input, .archive-search select { max-width: none; }
    .archive-pop .archive-panel { position: static; width: auto; }
    .cash-fields, .cash-settings .cash-fields { grid-template-columns: 1fr; }
    .audit-filters input { width: 100%; }
    .export-year .button { width: 100%; box-sizing: border-box; text-align: center; }
    .closing-steps a, .closing-steps span { min-width: 0; }
    .list-panel-head { flex-wrap: wrap; }
    .list-panel-head h2 { flex: 1 1 10rem; min-width: 0; }
    .list-panel-head .button { white-space: nowrap; }
    .ledger-head, .ledger-row { grid-template-columns: minmax(0, 1fr) 92px 92px 20px; }
}
.guide-open {
    position: fixed; right: 22px; bottom: 22px; z-index: 30;
    border: 1px solid var(--navy); border-radius: 999px; padding: 12px 18px;
    background: var(--card); color: var(--navy); font-weight: 650; cursor: pointer;
    box-shadow: 0 10px 24px rgba(28, 20, 18, .18);
}
.guide-open:hover { background: var(--soft); }
.guide[hidden] { display: none; }
.guide {
    position: fixed; top: 0; right: 0; z-index: 40;
    width: min(420px, 100vw); height: 100vh;
    display: flex; flex-direction: column;
    background: var(--card); border-left: 1px solid var(--line);
    box-shadow: -12px 0 32px rgba(28, 20, 18, .08);
}
.guide-bar, .guide-ask { padding: 14px 16px; background: var(--card); }
.guide-bar { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.guide-bar span { display: flex; gap: 8px; }
.guide-bar button, .guide-chips button {
    border: 1px solid var(--line); background: var(--paper); border-radius: 999px;
    padding: 6px 10px; cursor: pointer;
}
.guide-body { overflow: auto; padding: 16px 18px 8px; }
.guide-body h2 { margin: 0 0 8px; font-size: 22px; }
.guide-body img { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); margin: 8px 0 14px; }
.guide-steps { margin: 0 0 16px; padding: 0; list-style: none; display: grid; gap: 12px; }
.guide-steps li { display: grid; gap: 2px; }
.guide-steps span, .guide-field span { color: var(--muted); }
.guide-ask { border-top: 1px solid var(--line); display: grid; gap: 10px; }
.guide-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.guide-field { display: grid; gap: 4px; }
.guide-field input { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
body.guide-pinned .main { margin-right: min(420px, 100vw); }
body.guide-pinned .guide-open { display: none; }
@media (max-width: 900px) {
    body.guide-pinned .main { margin-right: 0; }
    .guide { width: 100vw; }
}
@media print {
    .sidebar, .topbar, .no-print, .guide, .guide-open { display: none !important; }
    .app { display: block; }
    .content { padding: 0; }
    body { background: #fff; }
    .ledger-account:not(.is-open), .ledger-head { display: none !important; }
    .ledger-print-head { display: block; margin: 0 0 12px; }
    .annual-work { display: none !important; }
    .annual-sheet { display: block !important; }
}

@media (max-width: 1100px) {
    .kpi-grid, .main-grid, .bottom-grid, .dash-top { grid-template-columns: 1fr; }
    .dash-title, .quick-tools-card, .period-box { grid-column: auto; }
}

#vinst-form { display: grid; gap: 14px; min-width: 0; }
.vinst-app .button.button-light { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.vinst-app label,
.vinst-app input,
.vinst-app select { min-width: 0; max-width: 100%; }
.vinst-app input,
.vinst-app select { width: 100%; }
.vinst-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr); gap: 16px; align-items: start; }
.vinst-layout > * { min-width: 0; }
.vinst-layout .list-panel { margin: 0; }
.vinst-pack { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 10px; }
.vinst-pack > * { min-width: 0; }
.vinst-vara, .vinst-extra { display: grid; gap: 10px; min-width: 0; border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--paper); }
.vinst-vara-top, .vinst-extra-top { display: flex; gap: 8px; align-items: center; min-width: 0; }
.vinst-vara-top input, .vinst-extra-top input { flex: 1; width: auto; }
.vinst-varor, .vinst-extras { display: grid; gap: 10px; }
.vinst-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.vinst-sum, .vinst-note { margin: 0; color: var(--muted); font-size: 14px; }
.vinst-label { margin: 4px 0 0; font-size: 16px; }
.vinst-result { display: grid; gap: 12px; position: sticky; top: 16px; min-width: 0; overflow-wrap: anywhere; }
.vinst-kicker { margin: 0; color: var(--muted); font-size: 13px; font-weight: 650; }
.vinst-pct { margin: 0; font-size: 28px; font-weight: 700; }
.vinst-sub { margin: 0; }
.vinst-cmp.loss .vinst-pct, .vinst-hero.loss .vinst-pct { color: #6b0f1a; }
.vinst-cmp.low .vinst-pct, .vinst-hero.low .vinst-pct { color: #8a5a12; }
.vinst-cmp.ok .vinst-pct, .vinst-hero.ok .vinst-pct { color: var(--focus); }
.vinst-cmp.good .vinst-pct, .vinst-hero.good .vinst-pct { color: #1d6b3a; }
.vinst-bar, .vinst-track { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--paper); }
.vinst-bar i, .vinst-track i { display: block; height: 100%; }
.vinst-bar .cost, .vinst-track .ditt { background: #8d6a70; }
.vinst-bar .tax, .vinst-track .mal { background: #c4a35a; }
.vinst-bar .gain, .vinst-track .minsta { background: #1d6b3a; }
.vinst-legend { display: flex; gap: 14px; margin: 0; color: var(--muted); font-size: 13px; }
.vinst-cmp-row { display: grid; grid-template-columns: 9em minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-top: 6px; }
.vinst-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin: 0; }
.vinst-kpis div { display: grid; gap: 2px; }
.vinst-kpis dt { color: var(--muted); font-size: 13px; }
.vinst-kpis dd { margin: 0; font-weight: 700; }
.vinst-kpis small { display: block; color: var(--muted); font-weight: 450; }
.vinst-break { width: 100%; border-collapse: collapse; font-size: 14px; }
.vinst-break th, .vinst-break td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.vinst-saved button { display: block; width: 100%; text-align: left; margin-top: 6px; }
@media (max-width: 900px) {
    .vinst-layout, .vinst-pack, .vinst-kpis { grid-template-columns: 1fr; }
    .vinst-result { position: static; }
}

@media (max-width: 900px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { position: fixed; z-index: 5; transform: translateX(-105%); transition: transform .18s ease; width: 260px; }
    .sidebar.show { transform: none; }
    .menu-button { display: inline-flex; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 8px 10px; }
    body.is-overview .topbar { display: flex; }
    body.is-overview .topbar .eyebrow,
    body.is-overview .topbar h1 { display: none; }
    .cards { grid-template-columns: 1fr; }
    .months { grid-template-columns: repeat(6, 1fr); }
    .overview-toolbar { flex-direction: column; align-items: flex-start; }
    .topbar, .content { padding-left: 16px; padding-right: 16px; }
}
