/* Components. Right-to-left by default; only logical properties, never left/right. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--font-text); font-size: 14.5px; line-height: 1.55; }
h1, h2, h3 { font-family: var(--font-heading); font-weight: 700; margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--deep); }
:focus-visible { outline: 2px solid var(--metal); outline-offset: 2px; }

/* Numbers: aligned columns, always read left to right inside Arabic text. */
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.text-end { text-align: end; }
.muted { color: var(--mute); }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--deep); color: var(--on-deep); display: flex; flex-direction: column; padding: 20px 12px 14px; position: sticky; inset-block-start: 0; block-size: 100vh; overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 18px; text-decoration: none; }
.side-menu { display: grid; gap: 2px; }
.side-summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; font-weight: 600; }
.side-summary::-webkit-details-marker { display: none; }
.side-summary::after { content: ""; inline-size: 7px; block-size: 7px; border-inline-end: 2px solid var(--on-deep-mute); border-block-end: 2px solid var(--on-deep-mute); transform: rotate(45deg); margin-block-end: 3px; }
.side-group-box[open] > .side-summary::after { transform: rotate(-135deg); margin-block-end: -3px; }
.side-children { display: grid; gap: 2px; padding-inline-start: 12px; margin-block: 2px 6px; border-inline-start: 1px solid var(--deep-2); margin-inline-start: 12px; }
.side-brand-mark { inline-size: 36px; block-size: 36px; border-radius: 9px; background: var(--metal); color: var(--deep); display: grid; place-items: center; font-family: var(--font-heading); font-weight: 700; font-size: 18px; flex: none; }
.side-brand-name { font-family: var(--font-heading); font-size: 19px; font-weight: 700; color: #fff; display: block; line-height: 1.2; }
.side-brand-tagline { font-size: 12px; color: var(--on-deep-mute); }
.side-group { font-size: 12px; color: var(--on-deep-mute); padding: 14px 12px 5px; }
.side-link { display: block; inline-size: 100%; text-align: start; text-decoration: none; background: none; border: 0; color: var(--on-deep); padding: 8px 12px; border-radius: 8px; }
.side-link:hover { background: var(--deep-2); }
.side-link[aria-current="page"] { background: var(--deep-3); color: #fff; font-weight: 600; box-shadow: inset -3px 0 0 var(--metal); }
/* A group heading is a link-shaped row with its arrow at the far end. */
.side-link.side-summary { display: flex; }

.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 28px; background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(8px); position: sticky; inset-block-start: 0; z-index: 5; border-block-end: 1px solid var(--line); }
.topbar-search { flex: 1 1 0; min-inline-size: 0; max-inline-size: 460px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 16px; color: var(--mute); }
.topbar-search:focus-within { border-color: var(--deep); box-shadow: 0 0 0 3px color-mix(in srgb, var(--metal) 30%, transparent); }
.topbar-search label { flex: none; cursor: text; }
.topbar-search input { flex: 1; border: 0; outline: 0; background: transparent; min-inline-size: 0; inline-size: 100%; color: var(--ink); }
.topbar-search-key { flex: none; }
.topbar-search:focus-within .topbar-search-key { visibility: hidden; }
.menu-button { display: none; flex: none; place-items: center; inline-size: 40px; block-size: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); }
.menu-button:hover, .menu-button[aria-expanded="true"] { border-color: var(--deep); color: var(--deep); background: var(--sunk); }
.side-close { display: none; }
.side-backdrop { display: none; }
.main { min-inline-size: 0; }
.skip-link { position: fixed; inset-block-start: 8px; inset-inline-start: 8px; z-index: 80; background: var(--deep); color: #fff; padding: 8px 14px; border-radius: var(--r-sm); text-decoration: none; transform: translateY(-200%); }
.skip-link:focus { transform: none; }
.content:focus { outline: 0; }
.content { padding: 24px 28px 48px; }

/* ---------- Page header ---------- */
.page-header { display: flex; align-items: center; gap: 12px; margin-block-end: 18px; flex-wrap: wrap; }
.page-header h1 { font-size: 23px; }
.page-header-actions { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: var(--r-sm); padding: 8px 16px; font-weight: 600; font-size: 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); text-decoration: none; }
.btn:hover { border-color: var(--deep); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--deep); border-color: var(--deep); color: #fff; }
.btn-primary:hover { background: var(--deep-2); }
.btn-danger { color: var(--no); border-color: color-mix(in srgb, var(--no) 40%, var(--line-2)); }
.btn-sm { padding: 4px 11px; font-size: 13px; }

/* ---------- Status chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 2px 11px; border-radius: 999px; }
.chip::before { content: ""; inline-size: 7px; block-size: 7px; border-radius: 50%; background: currentColor; }
.chip-pending { background: var(--pend-bg); color: var(--pend); }
.chip-approved { background: var(--ok-bg); color: var(--ok); }
.chip-rejected { background: var(--no-bg); color: var(--no); }

/* ---------- Panel ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; gap: 10px; padding: 15px 20px; border-block-end: 1px solid var(--line); }
.panel-header h2 { font-size: 15.5px; }
.panel-header-actions { margin-inline-start: auto; }
.panel-body { padding: 18px 20px; }

/* ---------- Data table ---------- */
.table-scroll { overflow-x: auto; }
.data-table { border-collapse: collapse; inline-size: 100%; }
.data-table th { font-size: 12.5px; font-weight: 600; color: var(--mute); text-align: start; padding: 10px 20px; background: var(--sunk); border-block-end: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 12px 20px; border-block-end: 1px solid #f0eae6; }
.data-table tbody tr:last-child td { border-block-end: 0; }
.data-table tbody tr:hover td { background: #fcfaf8; }
.data-table .text-end { text-align: end; }
.data-table small { display: block; color: var(--mute); font-size: 13px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- Pager ---------- */
.pager { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-block-start: 1px solid var(--line); color: var(--mute); font-size: 13.5px; }
.pager-pages { margin-inline-start: auto; display: flex; gap: 4px; }
.pager-pages a, .pager-pages span { min-inline-size: 32px; block-size: 32px; display: grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); text-decoration: none; }
.pager-pages [aria-current="page"] { background: var(--deep); color: #fff; border-color: var(--deep); }

/* ---------- Tabs and segmented control ---------- */
.tabs { display: flex; gap: 4px; border-block-end: 1px solid var(--line); margin-block-end: 16px; overflow-x: auto; scrollbar-width: thin; }
.tabs a { padding: 10px 14px; color: var(--ink-2); border-block-end: 3px solid transparent; white-space: nowrap; text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--deep); font-weight: 600; border-block-end-color: var(--metal); }
.tabs-count { background: var(--sunk); border: 1px solid var(--line); border-radius: 999px; font-size: 12px; padding: 0 7px; margin-inline-start: 5px; }

.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: block; padding: 5px 14px; border-radius: 999px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.seg input:checked + span { background: var(--deep); color: #fff; font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--metal); outline-offset: 2px; }

/* ---------- Forms ---------- */
.field { display: block; }
.field-label { display: block; font-size: 12.5px; color: var(--mute); margin-block-end: 5px; }
.input { inline-size: 100%; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 8px 12px; background: var(--surface); }
.input:focus { border-color: var(--deep); outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--metal) 30%, transparent); }
.input[aria-invalid="true"] { border-color: var(--no); }
.field-error { display: block; color: var(--no); font-size: 12.5px; margin-block-start: 4px; }
.field-hint { display: block; color: var(--mute); font-size: 12.5px; margin-block-start: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.filters { display: flex; gap: 10px; align-items: center; padding: 14px 20px; border-block-end: 1px solid var(--line); flex-wrap: wrap; }
.filters .input { inline-size: auto; flex: 1; min-inline-size: 200px; }

.form-actions { display: flex; gap: 8px; padding: 14px 20px 18px; border-block-start: 1px solid var(--line); }
.check { display: flex; align-items: center; gap: 8px; padding: 8px 0; cursor: pointer; }
.check input { inline-size: 18px; block-size: 18px; accent-color: var(--deep); }
select.input { appearance: auto; }
textarea.input { resize: vertical; min-block-size: 76px; }
.field-wide { grid-column: 1 / -1; }

/* ---------- Searchable select (js/searchable-select.js) ---------- */
.combo { position: relative; }
.combo-list { position: absolute; inset-inline: 0; inset-block-start: calc(100% + 4px); z-index: 20; max-block-size: 264px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); box-shadow: var(--shadow); }
.combo-option { padding: 7px 10px; border-radius: 4px; cursor: pointer; }
.combo-option:hover, .combo-option[aria-selected="true"] { background: var(--sunk); }
.combo-empty { padding: 7px 10px; color: var(--mute); }

/* Long text in a table cell: one line, the rest behind «…»; the full text is in the title. */
.cell-clip { display: inline-block; max-inline-size: 26ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.empty-state { padding: 36px 20px; text-align: center; color: var(--mute); display: grid; gap: 12px; justify-items: center; }

.perm-tree { list-style: none; margin: 0; padding: 0; }
.perm-tree .perm-tree { margin-inline-start: 13px; padding-inline-start: 18px; border-inline-start: 1px solid var(--line); }
.perm-tree .check { padding: 5px 0; }
.perm-group { font-weight: 600; }

/* ---------- Quantity stepper ---------- */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.qty button { border: 0; background: none; padding: 3px 10px; color: var(--mute); }
.qty button:hover { background: var(--sunk); color: var(--ink); }
.qty input { inline-size: 56px; border: 0; border-inline: 1px solid var(--line-2); text-align: center; padding: 3px 4px; font-weight: 600; font-variant-numeric: tabular-nums; direction: ltr; }
.stock { font-size: 12.5px; color: var(--mute); }
.stock-warning { color: var(--no); font-weight: 600; }

/* ---------- Statistic ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; }
.stat-label { font-size: 13px; color: var(--mute); }
.stat-value { display: block; font-family: var(--font-heading); font-size: 27px; font-weight: 700; margin-block-start: 4px; }
.stat-note { font-size: 13px; color: var(--ink-2); }
.stat-attention { border-color: var(--metal); background: linear-gradient(180deg, var(--metal-soft), var(--surface) 70%); }
.stat-feature { background: var(--deep); color: #fff; border-color: var(--deep); box-shadow: var(--shadow); }
.stat-feature .stat-label, .stat-feature .stat-note { color: var(--on-deep-mute); }

/* ---------- Totals ---------- */
.totals-row { display: flex; justify-content: space-between; padding: 7px 0; color: var(--ink-2); }
.totals-net { border-block-start: 2px solid var(--deep); margin-block-start: 8px; padding-block-start: 13px; font-family: var(--font-heading); font-weight: 700; font-size: 23px; color: var(--deep); }

/* ---------- Toast ---------- */
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; border-radius: var(--r); padding: 10px 16px; font-size: 13.5px; inline-size: fit-content; max-inline-size: 100%; flex-wrap: wrap; }
.toast::before { content: ""; inline-size: 8px; block-size: 8px; border-radius: 50%; background: #6fcf97; flex: none; }
.toast-error::before { background: #f08a7b; }
.toast a, .toast button { color: #fff; background: none; border: 0; padding: 0; text-decoration: underline; }

/* ---------- Confirmation dialog ---------- */
.dialog { border: 0; border-radius: var(--r-lg); padding: 0; inline-size: min(440px, calc(100vw - 32px)); box-shadow: 0 24px 64px -16px rgba(0, 0, 0, .45); color: var(--ink); }
.dialog::backdrop { background: rgba(35, 26, 28, .45); }
.dialog-body { padding: 22px 24px 8px; }
.dialog-body h2 { font-size: 17px; margin-block-end: 8px; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 24px 20px; }

/* ---------- Signed-in user, flash, sign-in page ---------- */
.side-user { margin-block-start: auto; padding-block-start: 12px; border-block-start: 1px solid var(--deep-2); }
.side-user-name { display: block; padding: 4px 12px; color: #fff; font-weight: 600; font-size: 14px; }
.flash { margin-block-end: 16px; }

.auth { display: grid; place-items: center; min-block-size: 100vh; padding: 24px 16px; }
.auth main { inline-size: min(400px, 100%); }
.auth-card { padding: 28px 28px 22px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-block-end: 22px; }
.auth-brand h1 { font-size: 24px; line-height: 1.2; }
.auth-form { display: grid; gap: 14px; margin-block-end: 14px; }
.auth-submit { padding: 11px; font-size: 15px; }
.auth-error { background: var(--no-bg); color: var(--no); border-radius: var(--r-sm); padding: 9px 12px; margin-block-end: 14px; font-weight: 600; }

/* ---------- Design system page only ---------- */
.ds-section { margin-block-end: 28px; }
.ds-section > h2 { font-size: 16px; margin-block-end: 12px; }
.ds-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ds-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.ds-swatch { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); font-size: 12.5px; }
.ds-swatch i { display: block; block-size: 44px; }
.ds-swatch span { display: block; padding: 6px 10px; }

/* ---------- Narrow screens: the menu waits behind its button ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .menu-button { display: grid; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 60; inline-size: min(300px, 86vw); block-size: 100vh; block-size: 100dvh; padding-block-start: 14px; box-shadow: 0 0 48px rgba(0, 0, 0, .35); overscroll-behavior: contain;
          translate: 100% 0; visibility: hidden; transition: translate var(--t, 220ms) var(--ease, ease), visibility 0s linear var(--t, 220ms); }
  :root:not([dir="rtl"]) .side { translate: -100% 0; }
  .side.is-open { translate: 0 0; visibility: visible; transition: translate var(--t, 220ms) var(--ease, ease), visibility 0s; }
  .side-close { display: grid; place-items: center; align-self: flex-end; flex: none; inline-size: 36px; block-size: 36px; margin-block-end: 2px; border: 0; border-radius: 50%; background: var(--deep-2); color: var(--on-deep); font-size: 22px; line-height: 1; }
  .side-close:hover { background: var(--deep-3); color: #fff; }
  .side-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(35, 26, 28, .45); opacity: 0; transition: opacity var(--t, 220ms) var(--ease, ease); }
  .side-backdrop.is-open { opacity: 1; }
  .side-backdrop[hidden] { display: none; }
  html.menu-open { overflow: hidden; }
  .topbar { padding: 10px 16px; gap: 10px; }
  .topbar-search { padding: 7px 14px; }
  .topbar-search-key { display: none; }
  .content { padding: 18px 16px 40px; }
  .page-header h1 { font-size: 20px; }
  .page-header-actions { margin-inline-start: 0; flex-wrap: wrap; inline-size: 100%; }
  .panel-header { flex-wrap: wrap; padding-inline: 16px; }
  .panel-body { padding-inline: 16px; }
  .data-table th, .data-table td { padding-inline: 12px; }
  .filters { padding-inline: 16px; }
  .filters .input { min-inline-size: min(200px, 100%); }
  .form-actions { flex-wrap: wrap; padding-inline: 16px; }
  .pager { flex-wrap: wrap; padding-inline: 16px; }
  .pager-pages { flex-wrap: wrap; }
  .row-actions { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .topbar-search label { display: none; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: minmax(0, 1fr); }
}

@media print {
  .side, .side-backdrop, .topbar, .progress-bar, .skip-link { display: none !important; }
  .app { display: block; }
  .content { padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Catalog: product pictures, grouped rows, line picker, printable label ---------- */
[hidden] { display: none !important; }
.thumb { display: block; inline-size: 40px; block-size: 40px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--sunk); }
.thumb-lg { inline-size: 120px; block-size: 120px; }
.data-table tr.group-row td { background: var(--sunk); font-weight: 600; }
.group-row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.line-entry { display: grid; grid-template-columns: 2fr 2fr 1fr 1fr auto; gap: 12px; align-items: end; }
@media (max-width: 800px) { .line-entry { grid-template-columns: 1fr 1fr; } }
.label-card { inline-size: 62mm; margin: 24px auto; padding: 4mm; border: 1px dashed var(--line-2); background: #fff; color: #000; text-align: center; }
.label-card img { inline-size: 40mm; block-size: 40mm; image-rendering: pixelated; }
.label-code { font-size: 20px; font-weight: 700; direction: ltr; }
.label-actions { display: flex; gap: 8px; justify-content: center; margin-block: 16px; }
@media print { .label-actions { display: none; } .label-card { border: 0; margin: 0; } }

/* ---------- Invoices: entry screen, invoice page ---------- */
kbd { font-family: inherit; font-size: 12px; background: var(--sunk); border: 1px solid var(--line-2); border-block-end-width: 2px; border-radius: 4px; padding: 0 6px; }
.notice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--metal-soft); border: 1px solid color-mix(in srgb, var(--metal) 45%, var(--line)); border-radius: var(--r); padding: 10px 16px; margin-block-end: 16px; }
.notice form { display: inline-flex; margin-inline-start: auto; }
.notice-list { display: block; }
.notice-list ul { margin: 8px 0 0; padding-inline-start: 20px; max-block-size: 220px; overflow-y: auto; }
.notice-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.invoice-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.invoice-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; padding: 18px 20px; border-block-end: 1px solid var(--line); }
.invoice-head-notes { grid-column: 1 / -1; }
.invoice-entry { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.7fr) 96px 116px auto; gap: 10px; align-items: end; padding: 14px 20px; background: var(--sunk); border-block-end: 1px solid var(--line); }
.invoice-article { position: relative; }
.invoice-scan { border-color: var(--deep); box-shadow: 0 0 0 3px color-mix(in srgb, var(--metal) 30%, transparent); }
.invoice-entry-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-block-size: 26px; }
.invoice-scan-toggle { padding: 0; font-size: 13px; color: var(--ink-2); }
.invoice-entry-status { font-size: 13.5px; color: var(--ok); font-weight: 600; }
.invoice-entry-status.is-error, #draft-status.is-error { color: var(--no); }
.invoice-undo { border: 0; background: none; padding: 0; color: var(--deep); text-decoration: underline; font-weight: 600; }
.invoice-lines td { vertical-align: middle; }
.invoice-lines .qty input[aria-invalid="true"], .invoice-line-price[aria-invalid="true"] { color: var(--no); }
.invoice-line-price { inline-size: 104px; text-align: end; padding: 5px 8px; }
.invoice-remove { border: 0; background: none; color: var(--mute); font-size: 20px; line-height: 1; padding: 2px 8px; border-radius: var(--r-sm); }
.invoice-remove:hover { color: var(--no); background: var(--no-bg); }
.invoice-summary { position: sticky; inset-block-start: 76px; }
.invoice-summary h2 { font-size: 15.5px; margin-block-end: 8px; }
.invoice-balance { display: grid; gap: 6px; padding: 14px 20px; background: var(--sunk); border-block: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.invoice-balance div { display: flex; justify-content: space-between; gap: 10px; }
.invoice-balance b { font-variant-numeric: tabular-nums; color: var(--ink); }
.invoice-cta { display: grid; gap: 8px; padding: 16px 20px 18px; }
.invoice-cta small { text-align: center; }
.invoice-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px 20px; padding: 18px 20px; }
.invoice-facts dt { font-size: 12.5px; color: var(--mute); }
.invoice-facts dd { margin: 2px 0 0; font-weight: 500; }
.invoice-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.invoice-actions form { display: inline-flex; }
.filters .seg { flex: none; }
.filters input[type="date"].input { flex: none; min-inline-size: 150px; }
@media (max-width: 1100px) {
  .invoice-cols { grid-template-columns: minmax(0, 1fr); }
  .invoice-summary { position: static; }
}
@media (max-width: 800px) { .invoice-entry { grid-template-columns: 1fr 1fr; } }
.invoice-state-note { margin-block-end: 12px; }
.import-errors small { white-space: pre-line; text-align: start; }
.import-errors summary { cursor: pointer; }

/* ---------- Status pages (wrong address, refused request, error) ---------- */
.status-page { padding-block: 48px; }
.status-page p { max-inline-size: 52ch; color: var(--ink-2); }
.status-code { font-family: var(--font-heading); font-size: 54px; font-weight: 700; line-height: 1; color: var(--metal); }
.auth .status-page { padding: 8px 0 4px; }
.auth .status-page h1 { font-size: 21px; }

/* ---------- Search results ---------- */
.search-section + .search-section { margin-block-start: 16px; }
.search-more { padding: 0 20px 14px; }
