/* Faktura – Oberfläche */
:root {
  --navy: #1e3756;
  --navy-800: #172b44;
  --navy-900: #112135;
  --navy-100: #e3e9f1;
  --navy-50: #f1f4f8;
  --rust: #b53f15;
  --rust-50: #fbeee8;
  --ground: #f5f3ee;
  --surface: #ffffff;
  --line: #ddd8ce;
  --line-soft: #ebe7df;
  --text: #18212c;
  --muted: #5a6270;
  --ok: #1f6f4a;
  --ok-50: #e7f3ec;
  --warn: #855600;
  --warn-50: #fbf3df;
  --err: #a3271a;
  --err-50: #fbeceb;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(17, 33, 53, .06);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--ground); line-height: 1.45; }
a { color: var(--navy); }
a:hover { color: var(--rust); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 1.55rem; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.12rem; font-weight: 650; }
h3 { font-size: .98rem; font-weight: 650; }
p { margin: 0 0 .6rem; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .85rem; }
.pre { white-space: pre-line; }
.hidden { display: none !important; }

/* ---------- Grundgerüst ---------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--navy-900); color: #d5dee9; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { padding: 18px 18px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-name { color: #fff; font-weight: 700; font-size: 1.02rem; line-height: 1.25; }
.brand-sub { font-size: .76rem; color: #8fa3bb; letter-spacing: .06em; text-transform: uppercase; margin-top: 3px; }
.nav { padding: 10px 8px; display: flex; flex-direction: column; gap: 1px; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: #7d93ad; padding: 12px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; color: #d5dee9; text-decoration: none; padding: 7px 10px; border-radius: 5px; font-size: .93rem; }
.nav a svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: var(--navy); color: #fff; box-shadow: inset 3px 0 0 #e07a4f; }
.nav .count { margin-left: auto; background: var(--rust); color: #fff; font-size: .72rem; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.sidebar-foot { margin-top: auto; padding: 12px 18px 16px; font-size: .78rem; color: #7d93ad; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-foot a { color: #b8c6d6; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 28px; border-bottom: 1px solid var(--line); background: var(--surface); min-height: 54px; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: .88rem; color: var(--muted); }
.topbar form { margin: 0; }
.menu-toggle { display: none; }
.content { padding: 24px 28px 48px; max-width: 1320px; width: 100%; }
.banner { padding: 9px 28px; font-size: .9rem; display: flex; gap: 10px; align-items: center; }
.banner-kanzlei { background: var(--warn-50); color: var(--warn); border-bottom: 1px solid #ecdcb0; }
.banner-readonly { background: var(--navy-100); color: var(--navy); border-bottom: 1px solid #c9d5e3; }

.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .title { flex: 1; min-width: 240px; }
.page-head .eyebrow { font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Bausteine ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card, .card + .grid, .grid + .card { margin-top: 18px; }
.grid > .card + .card, .grid > .card { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--line-soft); }
.card-head h2, .card-head h3 { flex: 1; }
.card-body { padding: 16px 18px; }
.card-body > :last-child { margin-bottom: 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }

.kpi { padding: 16px 18px; }
.kpi .label { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi .value { font-size: 1.6rem; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi .hint { font-size: .84rem; color: var(--muted); margin-top: 2px; }
.kpi.alert .value { color: var(--rust); }

.bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; align-items: end; height: 150px; padding-top: 6px; }
.bar { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; height: 100%; gap: 4px; }
.bar span.fill { display: block; background: var(--navy); border-radius: 3px 3px 0 0; min-height: 2px; }
.bar.current span.fill { background: var(--rust); }
.bar small { text-align: center; color: var(--muted); font-size: .72rem; }

.alert { padding: 11px 14px; border-radius: var(--radius); margin-bottom: 14px; border: 1px solid; font-size: .93rem; white-space: pre-line; }
.alert-success { background: var(--ok-50); border-color: #b9dcc8; color: var(--ok); }
.alert-error { background: var(--err-50); border-color: #efc3bf; color: var(--err); }
.alert-info { background: var(--navy-50); border-color: #cbd6e3; color: var(--navy); }
.alert-warn { background: var(--warn-50); border-color: #ecdcb0; color: var(--warn); }

.badge { display: inline-block; font-size: .76rem; font-weight: 600; padding: 1px 8px; border-radius: 10px; background: var(--line-soft); color: var(--text); white-space: nowrap; }
.badge-draft { background: #eceae4; color: #4a4f57; }
.badge-open, .badge-sent { background: var(--navy-100); color: var(--navy); }
.badge-paid, .badge-accepted, .badge-done { background: var(--ok-50); color: var(--ok); }
.badge-partial_paid { background: var(--warn-50); color: var(--warn); }
.badge-cancelled, .badge-rejected { background: var(--err-50); color: var(--err); }
.badge-overdue { background: var(--rust); color: #fff; }
.badge-outline { background: transparent; border: 1px solid var(--line); color: var(--muted); }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: .93rem; }
table.list th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 9px 12px; border-bottom: 1px solid var(--line); background: #faf9f6; white-space: nowrap; }
table.list td { padding: 9px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr:hover td { background: #fbfaf7; }
table.list td a.row-link { font-weight: 600; text-decoration: none; white-space: nowrap; }
table.list tfoot td { font-weight: 650; border-top: 1px solid var(--line); }
.empty { padding: 34px 18px; text-align: center; color: var(--muted); }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: .93rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

/* ---------- Formulare ---------- */
form { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.field { grid-column: span 6; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-8 { grid-column: span 8; } .span-9 { grid-column: span 9; } .span-12 { grid-column: span 12; }
label, .label { font-size: .84rem; font-weight: 600; color: #39424e; }
.help { font-size: .8rem; color: var(--muted); font-weight: 400; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], input[type=tel], input[type=url], select, textarea {
  font: inherit; color: var(--text); width: 100%; padding: 8px 10px; border: 1px solid #cfc9bd; border-radius: 5px; background: #fff; min-height: 38px;
}
textarea { min-height: 76px; resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(30, 55, 86, .25); border-color: var(--navy); }
input[readonly] { background: #f6f5f1; }
.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 400; font-size: .93rem; }
.check input { margin-top: 3px; width: 16px; height: 16px; }
fieldset { border: 0; padding: 0; margin: 0; }
.form-section { padding: 18px; border-top: 1px solid var(--line-soft); }
.form-section:first-child { border-top: 0; }
.form-section h3 { margin-bottom: 12px; }
.form-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line-soft); background: #faf9f6; border-radius: 0 0 var(--radius) var(--radius); flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-size: .92rem; font-weight: 600; padding: 8px 14px; min-height: 38px;
  border-radius: 5px; border: 1px solid #cfc9bd; background: #fff; color: var(--text); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--navy); color: var(--navy); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-800); color: #fff; }
.btn-accent { background: var(--rust); border-color: var(--rust); color: #fff; }
.btn-accent:hover { background: #9a3510; border-color: #9a3510; color: #fff; }
.btn-danger { color: var(--err); border-color: #e3b8b3; }
.btn-danger:hover { background: var(--err-50); color: var(--err); border-color: var(--err); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: 4px 10px; min-height: 30px; font-size: .84rem; }
.btn-icon { padding: 0; width: 34px; min-height: 34px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); }
.toolbar input[type=search] { max-width: 300px; }
.toolbar select { width: auto; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.active { color: var(--navy); border-bottom-color: var(--navy); }
.tabs a:hover { color: var(--text); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills a { padding: 4px 11px; border-radius: 14px; text-decoration: none; font-size: .86rem; color: var(--muted); border: 1px solid var(--line); background: #fff; }
.pills a.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- Beleg-Editor ---------- */
.doc-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; }
.doc-meta .field { grid-column: auto; }
.items { width: 100%; border-collapse: collapse; table-layout: fixed; min-width: 980px; }
.items th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.items td { padding: 6px; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
.items input, .items select, .items textarea { min-height: 34px; padding: 6px 8px; }
.items textarea { min-height: 34px; height: 34px; margin-top: 4px; font-size: .88rem; }
.items .c-pos { width: 34px; color: var(--muted); padding-top: 14px; font-variant-numeric: tabular-nums; }
.items .c-qty { width: 86px; } .items .c-unit { width: 100px; } .items .c-price { width: 110px; } .items .c-disc { width: 72px; }
.items .c-tax { width: 84px; } .items .c-type { width: 118px; } .items .c-sum { width: 110px; padding-top: 14px; font-weight: 600; }
.items .c-act { width: 116px; white-space: nowrap; padding-top: 8px; }
.items tr.text-row td { background: #faf9f6; }
.items .num input { text-align: right; }
.ac-wrap { position: relative; }
.ac-list { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 8px 24px rgba(17,33,53,.14); max-height: 280px; overflow-y: auto; margin-top: 2px; min-width: 320px; }
.ac-list button { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: 8px 10px; font: inherit; font-size: .9rem; cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.ac-list button:hover, .ac-list button.focus { background: var(--navy-50); }
.ac-list .meta { color: var(--muted); font-size: .8rem; }
.totals { margin-left: auto; width: 360px; max-width: 100%; font-variant-numeric: tabular-nums; }
.totals .row { display: flex; justify-content: space-between; padding: 4px 0; gap: 12px; }
.totals .grand { border-top: 2px solid var(--navy); margin-top: 6px; padding-top: 8px; font-weight: 700; font-size: 1.08rem; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; background: rgba(245,243,238,.94); backdrop-filter: blur(3px); border-top: 1px solid var(--line); padding: 12px 0; margin-top: 18px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.grid-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start; }
.layout-preview { position: sticky; top: 16px; }
.layout-preview .preview-frame { height: 82vh; min-height: 560px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; padding: 6px 14px; font: inherit; font-size: .88rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--navy); color: #fff; }
.seg-sm { margin-bottom: 10px; }
.seg-sm button { padding: 4px 11px; font-size: .82rem; }
.sheet { --mm: 2px; --pink: #c81e78; position: relative; width: 100%; aspect-ratio: 210 / 297; background: #fff; border: 1px solid var(--line);
  box-shadow: 0 2px 10px rgba(20, 30, 50, .12); overflow: hidden; user-select: none; -webkit-user-select: none; font-family: "Liberation Sans", Arial, Helvetica, sans-serif; }
.sheet { max-width: calc((100vh - 210px) * 0.707); min-width: 280px; margin: 0 auto; }
.sheet-bg { position: absolute; inset: 0; }
.sheet-infowrap { overflow: hidden; height: 100%; }
.sheet-line.v.tag-left .sheet-tag { left: auto; right: 8px; }
.sheet-bg canvas, .sheet-bg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.sheet-content { position: absolute; pointer-events: none; color: #333; }
.sheet-content .t { font-weight: 700; font-size: calc(var(--mm) * 4.9); line-height: calc(var(--mm) * 7); }
.sheet-content .bar { height: calc(var(--mm) * 6.5); background: #1e3756; opacity: .85; margin: calc(var(--mm) * 2) 0 calc(var(--mm) * 1.5); }
.sheet-content .row { height: calc(var(--mm) * 2); background: #e3e6ea; margin: calc(var(--mm) * 3) 0; }
.sheet-content .row:nth-child(odd) { width: 82%; }
.sheet-el { position: absolute; touch-action: none; outline: none; }
.sheet-box { border: 1.5px dashed var(--pink); background: rgba(200, 30, 120, .05); cursor: move; color: #222; }
.sheet-box:hover, .sheet-el:focus-visible, .sheet-el.dragging { background: rgba(200, 30, 120, .13); border-style: solid; }
.sheet-tag { position: absolute; left: -1px; top: -1px; transform: translateY(-100%); background: var(--pink); color: #fff; font: 600 11px/1.5 system-ui, sans-serif; padding: 0 6px; border-radius: 3px 3px 0 0; white-space: nowrap; pointer-events: none; }
.sheet-box.tag-below .sheet-tag { top: auto; bottom: -1px; transform: translateY(100%); border-radius: 0 0 3px 3px; }
.sheet-line { cursor: ns-resize; }
.sheet-line.h { left: 0; right: 0; height: 12px; margin-top: -6px; }
.sheet-line.v { top: 0; bottom: 0; width: 12px; margin-left: -6px; cursor: ew-resize; }
.sheet-line::after { content: ""; position: absolute; background: var(--pink); opacity: .75; }
.sheet-line.h::after { left: 0; right: 0; top: 5.5px; height: 1px; }
.sheet-line.v::after { top: 0; bottom: 0; left: 5.5px; width: 1px; }
.sheet-line:hover::after, .sheet-line:focus-visible::after, .sheet-line.dragging::after { opacity: 1; }
.sheet-line.h:hover::after, .sheet-line.h.dragging::after, .sheet-line.h:focus-visible::after { height: 2px; top: 5px; }
.sheet-line.v:hover::after, .sheet-line.v.dragging::after, .sheet-line.v:focus-visible::after { width: 2px; left: 5px; }
.sheet-line .sheet-tag { transform: none; top: -9px; left: 4px; border-radius: 3px; }
.sheet-line.v .sheet-tag { top: auto; bottom: 6px; left: 8px; }
.sheet-handle { position: absolute; right: -6px; top: 50%; width: 10px; height: 26px; margin-top: -13px; background: var(--pink); border-radius: 3px; cursor: ew-resize; touch-action: none; }
.sheet-txt { font-size: calc(var(--mm) * 3.5); line-height: calc(var(--mm) * 4.6); white-space: nowrap; overflow: hidden; }
.sheet-sender { font-size: calc(var(--mm) * 2.47); line-height: calc(var(--mm) * 3.5); color: #666; border-bottom: 1px solid #999; white-space: nowrap; overflow: hidden; width: calc(var(--mm) * 80); }
.sheet-info { display: flex; justify-content: space-between; gap: 4px; font-size: calc(var(--mm) * 3); line-height: calc(var(--mm) * 4.6); white-space: nowrap; }
.sheet-info span:first-child { color: #666; }
.sheet-logo { display: flex; align-items: center; justify-content: flex-end; overflow: hidden; }
.sheet-logo img { max-width: 100%; max-height: 100%; }
.sheet-logo .nm { font-weight: 700; color: #1e3756; font-size: calc(var(--mm) * 5.3); white-space: nowrap; }
.sheet-status { position: absolute; left: 8px; bottom: 8px; font-size: 12px; color: var(--muted); background: rgba(255,255,255,.9); padding: 2px 6px; border-radius: 4px; }
.convert-box { border-top: 1px solid var(--line-soft); background: #fff8ec; }
.preset-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.input-unit { display: flex; align-items: center; gap: 6px; }
.input-unit input { flex: 1; min-width: 0; }
.input-unit span { color: var(--muted); font-size: .85rem; }
.preview-frame { width: 100%; height: 760px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.timeline li { padding: 7px 0 7px 16px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--navy); }
.timeline .when { color: var(--muted); font-size: .8rem; }
.lock { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 600; font-size: .86rem; }
.lock svg { width: 15px; height: 15px; }
.hash { font-family: var(--mono); font-size: .76rem; color: var(--muted); word-break: break-all; }
details.more summary { cursor: pointer; color: var(--navy); font-weight: 600; font-size: .9rem; }
details.more[open] summary { margin-bottom: 10px; }

/* ---------- Anmeldung ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side { background: var(--navy-900); color: #d5dee9; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h1 { color: #fff; font-size: 2rem; max-width: 420px; }
.auth-side .tag { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: #8fa3bb; }
.auth-side ul { padding-left: 18px; color: #b8c6d6; line-height: 1.7; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 1.4rem; margin-bottom: 6px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }

/* ---------- Mobil ---------- */
@media (max-width: 1100px) {
  .grid-main, .grid-layout { grid-template-columns: minmax(0, 1fr); }
  .layout-preview { position: static; }
  .sheet { max-width: none; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  html { font-size: 15px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 8px 16px; }
  .content { padding: 18px 16px 40px; }
  .banner { padding: 9px 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .field, [class*="span-"] { grid-column: auto; }
  .doc-meta { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
  .topbar .who { display: none; }
  .items { min-width: 0; table-layout: auto; }
  .items thead { display: none; }
  .items, .items tbody, .items tr, .items td { display: block; width: 100% !important; }
  .items tr { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 10px; padding: 6px; background: #fff; }
  .items td { border: 0; padding: 4px; }
  .items td[data-label]::before { content: attr(data-label); display: block; font-size: .74rem; color: var(--muted); font-weight: 600; }
  .items .c-pos { display: none; }
  .totals { width: 100%; }
  .preview-frame { display: none; }
  .seg [data-view=pdf] { display: none; }
}
@media print {
  .sidebar, .topbar, .sticky-actions, .actions, .banner { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
}
