/* ILAM Verwaltung – Farben aus dem ILAM-Farbschema: Orange #FF7520, Hellorange #FF904E, Lavendel #CFD5EB */
:root {
  --brand: #FF7520; --brand-2: #FF904E; --brand-ink: #7C2E00; --brand-soft: #FFF1E8;
  --lav: #CFD5EB; --lav-soft: #EEF0F8;
  --bg: #F6F7FB; --surface: #FFFFFF; --surface-2: #F1F3F9; --line: #E2E5EF; --ink: #1F1F1F; --muted: #5F6378;
  --ok: #2B8A3E; --ok-bg: #E3F4E7; --warn: #B85300; --warn-bg: #FFEBDF; --bad: #C92A2A; --bad-bg: #FCE9E9; --info: #33395A; --info-bg: #E7EAF6; --mute-bg: #ECEDF1;
  --c1: #FF7520; --c2: #6B7BC4; --c3: #2B8A3E; --c4: #FFB27F; --c5: #A9B2D9; --c6: #C92A2A;
  --radius: 14px; --shadow: 0 1px 2px rgba(20, 24, 50, .06), 0 4px 16px rgba(20, 24, 50, .05);
  --side: 248px; --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-ink: #FFB27F; --brand-soft: #3A2414; --lav-soft: #23263A;
    --bg: #12131A; --surface: #1B1D27; --surface-2: #232633; --line: #30344A; --ink: #ECEDF3; --muted: #A2A7BE;
    --ok: #6BCB7F; --ok-bg: #173322; --warn: #FFB27F; --warn-bg: #3A2414; --bad: #FF8A8A; --bad-bg: #3B1C1F; --info: #C9D0F0; --info-bg: #262B45; --mute-bg: #2A2D3A;
    --c2: #8E9BE0; --c3: #6BCB7F; --c5: #5D6797;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand-ink: #FFB27F; --brand-soft: #3A2414; --lav-soft: #23263A;
  --bg: #12131A; --surface: #1B1D27; --surface-2: #232633; --line: #30344A; --ink: #ECEDF3; --muted: #A2A7BE;
  --ok: #6BCB7F; --ok-bg: #173322; --warn: #FFB27F; --warn-bg: #3A2414; --bad: #FF8A8A; --bad-bg: #3B1C1F; --info: #C9D0F0; --info-bg: #262B45; --mute-bg: #2A2D3A;
  --c2: #8E9BE0; --c3: #6BCB7F; --c5: #5D6797; --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 var(--font); color: var(--ink); background: var(--bg); }
body.noscroll { overflow: hidden; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h2 { font-size: 1.05rem; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .pad { padding: 8px 12px; } .grow { flex: 1; } .nowrap { white-space: nowrap; }
.right { text-align: right; } .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hide { display: none !important; }

/* ---------- Layout */
.app { min-height: 100vh; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 30; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; color: var(--ink); font-weight: 700; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand img { height: 46px; width: auto; border-radius: 10px; background: #fff; padding: 4px 6px; border: 1px solid var(--line); }
.brand small { display: block; font-weight: 500; font-size: .75rem; color: var(--muted); }
.side nav { padding: 4px 10px 12px; display: flex; flex-direction: column; gap: 1px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink); font-weight: 500; }
.side nav a:hover { background: var(--surface-2); text-decoration: none; }
.side nav a.active { background: var(--brand-soft); color: var(--brand-ink); }
.side nav a.active .ic { color: var(--brand); }
.nav-g { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 4px; font-weight: 600; }
.side-foot { margin-top: auto; padding: 12px 18px 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.main { margin-left: var(--side); min-width: 0; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 1.25rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-r { display: flex; align-items: center; gap: 8px; }
.view { padding: 20px 24px 40px; max-width: 1400px; }
.tabs { display: none; }
.scrim { display: none; }
.only-m { display: none; }

@media (max-width: 899px) {
  .side { transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); padding-bottom: env(safe-area-inset-bottom); }
  body.side-open .side { transform: none; }
  body.side-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 25; }
  .main { margin-left: 0; }
  .only-m { display: inline-flex; }
  .top { padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
  .top h1 { font-size: 1.1rem; }
  .view { padding: 14px 16px calc(84px + env(safe-area-inset-bottom)); }
  .tabs { display: flex; position: fixed; inset: auto 0 0 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabs a, .tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; font-size: .7rem; color: var(--muted); background: none; border: 0; font-family: inherit; }
  .tabs a.active { color: var(--brand); }
  .tabs a:hover { text-decoration: none; }
  .sync span { display: none; }
}

/* ---------- Bausteine */
.page-h { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.page-h .grow { min-width: 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.card > .body, .card > .dl, .card > p, .card > .chart, .card > .hbars, .card > .alert, .card > .form-grid, .card > .empty { margin: 0; padding: 14px 16px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-h h2 { flex: 1; min-width: 120px; }
.card-a { display: flex; gap: 6px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); color: var(--ink); position: relative; }
a.kpi:hover { text-decoration: none; border-color: var(--brand-2); }
.kpi-l { font-size: .8rem; color: var(--muted); font-weight: 600; }
.kpi-v { font-size: 1.45rem; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi-s { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.kpi.ok { border-left: 4px solid var(--ok); } .kpi.warn { border-left: 4px solid var(--brand); } .kpi.bad { border-left: 4px solid var(--bad); }
.kpi.bad .kpi-v { color: var(--bad); }
.group-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 6px 0 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 .9rem var(--font); cursor: pointer; white-space: nowrap; min-height: 38px; }
.btn:hover { border-color: var(--brand-2); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #F06A15; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger.ghost { background: none; color: var(--bad); border-color: transparent; }
.btn.ghost { background: none; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 4px 10px; min-height: 30px; font-size: .82rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .ic { width: 18px; height: 18px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: none; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: var(--info-bg); color: var(--info); }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.mute { background: var(--mute-bg); color: var(--muted); }
.alert { padding: 10px 12px; border-radius: 10px; background: var(--info-bg); color: var(--info); margin: 8px 0; }
.alert.ok { background: var(--ok-bg); color: var(--ok); } .alert.bad { background: var(--bad-bg); color: var(--bad); } .alert.warn { background: var(--warn-bg); color: var(--warn); }
.empty { padding: 24px 16px; text-align: center; color: var(--muted); }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; cursor: pointer; background: var(--mute-bg); color: var(--muted); }
.sync .ic { width: 16px; height: 16px; }
.sync.ok { background: var(--ok-bg); color: var(--ok); } .sync.warn { background: var(--warn-bg); color: var(--warn); } .sync.bad { background: var(--bad-bg); color: var(--bad); } .sync.info { background: var(--info-bg); color: var(--info); }

/* ---------- Filterleiste */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.filters input, .filters select { min-width: 0; }
.filters .search { flex: 1 1 220px; position: relative; }
.filters .search input { width: 100%; padding-left: 34px; }
.filters .search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button, .seg a { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font: 600 .85rem var(--font); color: var(--muted); cursor: pointer; }
.seg .on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.seg a:hover { text-decoration: none; color: var(--ink); }
.counts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.counts button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 10px; font: 600 .8rem var(--font); color: var(--ink); cursor: pointer; }
.counts button.on { background: var(--brand-soft); border-color: var(--brand-2); color: var(--brand-ink); }

.ftoggle { display: none; }
@media (max-width: 760px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 10px 12px; } .kpi-v { font-size: 1.2rem; }
  .ftoggle { display: inline-flex; }
  .filters.has-toggle:not(.open) > select, .filters.has-toggle:not(.open) > input[type=date]:not(#d), .filters.has-toggle:not(.open) > label:not(.search) { display: none; }
  .filters > select, .filters > input[type=date] { flex: 1 1 45%; }
  .page-h .seg { width: 100%; } .page-h .seg > * { flex: 1; text-align: center; }
}

/* ---------- Formulare */
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-height: 40px; width: 100%; }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.filters select, .filters input, .page-h select, .page-h input { width: auto; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-2); outline-offset: 0; border-color: var(--brand-2); }
input[readonly] { background: var(--surface-2); color: var(--muted); }
textarea { resize: vertical; min-height: 70px; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.field small { color: var(--muted); font-size: .78rem; }
.req { color: var(--brand); }
.suffix { position: relative; } .suffix span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.suffix input { padding-right: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; cursor: pointer; font-size: .88rem; }
.chip:has(input:checked) { background: var(--brand-soft); border-color: var(--brand-2); }
.chip input { width: 14px; height: 14px; }
.form-msg:empty { display: none; }
.checks { display: flex; flex-direction: column; gap: 6px; }
.check-row { display: flex; gap: 8px; align-items: flex-start; }

/* ---------- Tabellen */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: var(--lav-soft); }
.tbl td.first { font-weight: 600; }
.tbl tfoot td { font-weight: 700; background: var(--surface-2); }
@media (max-width: 760px) {
  .tbl-wrap.cards-m { overflow: visible; }
  .cards-m .tbl thead { display: none; }
  .cards-m .tbl, .cards-m .tbl tbody, .cards-m .tbl tr, .cards-m .tbl td { display: block; width: 100%; }
  .cards-m .tbl tr { border-bottom: 1px solid var(--line); padding: 8px 4px; }
  .cards-m .tbl td { border: 0; padding: 2px 12px; display: flex; gap: 10px; justify-content: space-between; text-align: right; }
  .cards-m .tbl td::before { content: attr(data-l); color: var(--muted); font-size: .78rem; font-weight: 600; text-align: left; flex: none; max-width: 45%; }
  .cards-m .tbl td.first { font-size: 1rem; text-align: left; }
  .cards-m .tbl td.first::before { display: none; }
  .cards-m .tbl td:empty { display: none; }
  .cards-m .tbl td.num { white-space: normal; }
  .cards-m .badge { white-space: normal; text-align: left; }
}

/* ---------- Detailansichten */
.dl { display: grid; grid-template-columns: minmax(110px, 200px) 1fr; gap: 6px 14px; margin: 0; }
.dl dt { color: var(--muted); font-size: .85rem; } .dl dd { margin: 0; overflow-wrap: anywhere; }
.head-card { display: flex; gap: 14px; align-items: center; padding: 16px; flex-wrap: wrap; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--lav); color: #33395A; display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; flex: none; }
.head-card h2 { font-size: 1.25rem; }
.steps { display: flex; flex-direction: column; gap: 4px; }
.step { display: flex; gap: 8px; align-items: center; }

/* ---------- Kalender */
.week { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 8px; overflow-x: auto; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-height: 120px; display: flex; flex-direction: column; }
.day.today { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.day-h { padding: 8px 10px; font-weight: 700; font-size: .85rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.day-h a { color: inherit; }
.day-b { padding: 6px; display: flex; flex-direction: column; gap: 5px; }
.ev { border-radius: 8px; padding: 5px 7px; font-size: .78rem; background: var(--lav-soft); border-left: 3px solid var(--c2); cursor: pointer; line-height: 1.3; }
.ev b { display: block; font-size: .8rem; }
.ev.ok { border-left-color: var(--ok); } .ev.bad { border-left-color: var(--bad); background: var(--bad-bg); text-decoration: line-through; } .ev.warn { border-left-color: var(--brand); }
.ev.mute { opacity: .6; text-decoration: line-through; }
.free { font-size: .72rem; color: var(--warn); padding: 0 4px; }
@media (max-width: 899px) { .week { grid-template-columns: 1fr; } .day { min-height: 0; } }

/* ---------- Diagramme */
.chart { padding: 10px 12px; }
.chart-scroll { overflow-x: auto; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: .8rem; color: var(--muted); padding-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(80px, 150px) 1fr auto; gap: 10px; align-items: center; font-size: .88rem; }
.hbar .track { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 99px; }
.hbar .hv { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.funnel { display: flex; flex-direction: column; gap: 6px; }

/* ---------- Dialoge */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 18, 35, .45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--surface); border-radius: 18px; width: min(620px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal.wide { width: min(940px, 100%); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-h h2 { flex: 1; font-size: 1.1rem; }
.modal-b { padding: 16px 18px; overflow-y: auto; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (max-width: 640px) {
  .modal-bg { padding: 0; align-items: stretch; }
  .modal, .modal.wide { border-radius: 0; max-height: none; height: 100%; width: 100%; }
  .modal-h { padding-top: max(14px, env(safe-area-inset-top)); }
  .modal-f { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .modal-f .btn { flex: 1; }
}
.choice { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
#toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: calc(90px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); transition: opacity .4s; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.out { opacity: 0; }

/* ---------- Login */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 20px; background: linear-gradient(160deg, var(--brand-2), var(--brand)); }
.login-card .btn { white-space: normal; }
.login-card { background: var(--surface); padding: 28px; border-radius: 20px; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .2); }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .85rem; color: var(--muted); }
.login-logo { width: 150px; margin: 0 auto; border-radius: 14px; background: #fff; padding: 8px; }
.login-card h1 { text-align: center; font-size: 1.3rem; } .login-card > p { text-align: center; margin: 0; }

/* ---------- Druckansicht (A4) */
.doc-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.paper { background: #fff; color: #1F1F1F; width: 210mm; max-width: 100%; min-height: 297mm; margin: 0 auto; padding: 18mm 18mm 16mm; box-shadow: var(--shadow); font: 10.5pt/1.45 Arial, Helvetica, sans-serif; position: relative; }
.paper h1 { font-size: 17pt; color: #7C2E00; margin: 6mm 0 3mm; }
.paper h3 { font-size: 11pt; margin: 5mm 0 1.5mm; }
.paper p { margin: 0 0 2.5mm; white-space: pre-wrap; }
.paper .ph { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid #FF7520; padding-bottom: 4mm; gap: 10mm; }
.paper .ph img { height: 22mm; }
.paper .firm { text-align: right; font-size: 9pt; color: #5F6378; }
.paper .firm b { color: #1F1F1F; font-size: 11pt; }
.paper .sender { font-size: 7.5pt; color: #5F6378; text-decoration: underline; margin-top: 10mm; }
.paper .addr { white-space: pre-line; margin-top: 2mm; min-height: 25mm; }
.paper .info { display: grid; grid-template-columns: auto auto; gap: 1mm 6mm; font-size: 9.5pt; justify-content: end; margin-top: -25mm; }
.paper .info dt { color: #5F6378; } .paper .info dd { margin: 0; text-align: right; font-weight: 600; }
.paper table { width: 100%; border-collapse: collapse; margin: 4mm 0; font-size: 9.5pt; }
.paper th { background: #FF7520; color: #fff; text-align: left; padding: 2mm 2.5mm; font-weight: 700; }
.paper td { padding: 2mm 2.5mm; border-bottom: 1px solid #E2E5EF; vertical-align: top; white-space: pre-line; }
.paper .tot td { font-weight: 700; border-top: 2px solid #1F1F1F; border-bottom: 0; font-size: 11pt; }
.paper .foot { position: absolute; left: 18mm; right: 18mm; bottom: 10mm; border-top: 1px solid #CFD5EB; padding-top: 2.5mm; font-size: 7.5pt; color: #5F6378; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; }
.paper .stamp { position: absolute; top: 112mm; right: 30mm; transform: rotate(-12deg); border: 3px solid #C92A2A; color: #C92A2A; font-weight: 800; font-size: 20pt; padding: 2mm 5mm; border-radius: 3mm; opacity: .7; }
.paper .sig { white-space: pre-wrap; margin-top: 8mm; }
.paper .muted { color: #5F6378; }
@media (max-width: 899px) { .paper { padding: 8mm; min-height: 0; font-size: 9.5pt; } .paper .foot { position: static; margin-top: 10mm; } .paper .info { margin-top: 0; justify-content: start; } }
@page { size: A4; margin: 0; }
@media print {
  body { background: #fff !important; }
  .side, .top, .tabs, .doc-bar, #toasts, .scrim, .no-print { display: none !important; }
  .main { margin: 0 !important; } .view { padding: 0 !important; max-width: none !important; }
  .paper { box-shadow: none; margin: 0; width: 210mm; min-height: 297mm; padding: 18mm 18mm 16mm; font-size: 10.5pt; }
  .paper .foot { position: absolute; } .paper .info { margin-top: -25mm; justify-content: end; }
  .paper + .paper { page-break-before: always; }
  tr { page-break-inside: avoid; }
}
