/* Hofbüro – Oberfläche */
:root {
  --bg: #f4f5f1;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --text: #1d231c;
  --muted: #5d6779;
  --faint: #8a93a3;
  --line: #e1e5ec;
  --line-strong: #c9d0db;
  --nav: #1f2f24;
  --nav-text: #cfdccf;
  --nav-active: #e0b54a;
  --accent: #2f6b3a;
  --accent-ink: #ffffff;
  --accent-soft: #e6f0e4;
  --amber: #e0b54a;
  --ok: #1d7a46;
  --ok-soft: #e3f4ea;
  --warn: #9a6400;
  --warn-soft: #fff4d6;
  --danger: #c0392b;
  --danger-soft: #fdeceb;
  --info-soft: #eef1f6;
  --shadow: 0 1px 2px rgba(20, 33, 61, .06), 0 4px 16px rgba(20, 33, 61, .06);
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111611;
    --surface: #19201a;
    --surface-2: #1f2820;
    --text: #e6eaf2;
    --muted: #a3adbf;
    --faint: #7a8498;
    --line: #2c382d;
    --line-strong: #3d4c3e;
    --nav: #0c120d;
    --accent: #7cc48a;
    --accent-ink: #0c120d;
    --accent-soft: #1d3322;
    --ok: #4cc283;
    --ok-soft: #173326;
    --warn: #f0b94a;
    --warn-soft: #3a2f12;
    --danger: #ff7a6b;
    --danger-soft: #3d1d1b;
    --info-soft: #232d24;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 8px; }
.boot { min-height: 100vh; display: grid; place-content: center; gap: 6px; text-align: center; color: var(--muted); }
.boot b { font-size: 20px; color: var(--text); }
.boot img { margin: 0 auto 4px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: var(--mono); font-size: .92em; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 650; }
.pre { white-space: pre-wrap; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); }
.danger-text { color: var(--danger); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Grundaufbau ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--nav); color: var(--nav-text); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; color: #fff; text-decoration: none; }
.side-brand img { width: 34px; height: 34px; border-radius: 8px; object-fit: contain; background: #fff; }
.side-brand .logo-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--amber); display: grid; place-content: center; color: var(--nav); font-weight: 800; }
.side-brand b { display: block; font-size: 14.5px; line-height: 1.2; }
.side-brand span { font-size: 12px; color: var(--nav-text); }
.nav-group { padding: 6px 10px; }
.nav-group-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8190ad; padding: 10px 10px 4px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--nav-text); text-decoration: none; font-size: 14.5px; }
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-link.active { background: rgba(245, 179, 1, .14); color: #fff; box-shadow: inset 3px 0 0 var(--nav-active); }
.nav-link .ico { width: 18px; text-align: center; opacity: .9; }
.nav-link .count { margin-left: auto; background: var(--amber); color: var(--nav); font-size: 11.5px; font-weight: 700; border-radius: 10px; padding: 0 7px; line-height: 18px; }
.side-foot { margin-top: auto; padding: 12px 16px 16px; font-size: 13px; border-top: 1px solid rgba(255, 255, 255, .08); }
.side-foot a { color: var(--nav-text); }
.shell-body { min-width: 0; }  /* sonst macht eine breite Reiterleiste die ganze Seite breiter */
.main { min-width: 0; padding: 22px 28px 60px; }
.topbar { display: none; }
.page { max-width: 1240px; margin: 0 auto; }
.page.narrow { max-width: 820px; }
.page-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .titles { flex: 1; min-width: 200px; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: 13.5px; margin-bottom: 6px; }
.back:hover { color: var(--accent); }

@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; height: auto; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  .scrim { position: fixed; inset: 0; background: rgba(10, 16, 30, .4); z-index: 55; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 40; align-items: center; gap: 10px; background: var(--nav); color: #fff; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
  .topbar b { font-size: 15.5px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .btn.icon { color: #fff; border-color: rgba(255, 255, 255, .2); background: transparent; }
  .main { padding: 14px 12px 90px; }
  h1 { font-size: 19px; }
}

/* Untere Leiste für Monteure am Handy */
.tabbar { display: none; }
@media (max-width: 900px) {
  .tabbar.on { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; bottom: 0; left: 0; right: 0; z-index: 45; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 4px 8px; font-size: 11.5px; color: var(--muted); text-decoration: none; }
  .tabbar a .ico { font-size: 19px; line-height: 1.1; }
  .tabbar a.active { color: var(--accent); font-weight: 650; }
}

/* ---------- Knöpfe & Formulare ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 14.5px; font-weight: 550; padding: 8px 14px; min-height: 38px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1.2; }
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.amber { background: var(--amber); border-color: var(--amber); color: #1f2f24; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--accent-soft); border-color: transparent; }
.btn.sm { font-size: 13px; padding: 4px 9px; min-height: 30px; }
.btn.icon { padding: 0; width: 36px; min-height: 36px; font-size: 17px; }
.btn.icon.sm { width: 28px; min-height: 28px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.lg { min-height: 48px; font-size: 16px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 6px; }
.gap-lg { gap: 18px; }

label.field, .field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span.lbl { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--faint); }
input, select, textarea { font: inherit; font-size: 15px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; min-height: 38px; width: 100%; min-width: 0; }
textarea { min-height: 80px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--accent); flex: none; }
input.num-in { text-align: right; font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 14.5px; cursor: pointer; }
.check input { margin-top: 2px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.span-all { grid-column: 1 / -1; }
@media (max-width: 700px) {
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .grid4.keep2, .grid3.keep2 { grid-template-columns: 1fr 1fr; }
  .span2, .span3 { grid-column: auto; }
}
.search { position: relative; }
.search input { padding-left: 32px; }
.search::before { content: "⌕"; position: absolute; left: 10px; top: 50%; transform: translateY(-52%); color: var(--faint); font-size: 17px; pointer-events: none; }

/* ---------- Karten, Listen, Tabellen ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2, .card-head h3 { flex: 1; }
.card + .card { margin-top: 14px; }
.section { margin-top: 18px; }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .cols { grid-template-columns: 1fr; } }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--accent-soft); }
.tbl tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--line-strong); }
.tbl .sub { color: var(--muted); font-size: 12.5px; }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 700px) {
  .tbl.cards thead { display: none; }
  .tbl.cards, .tbl.cards tbody, .tbl.cards tr, .tbl.cards td { display: block; width: 100%; }
  .tbl.cards tr { border-bottom: 1px solid var(--line); padding: 8px 4px; }
  .tbl.cards td { border: 0; padding: 2px 8px; }
  .tbl.cards td.num { text-align: left; }
  .tbl.cards td[data-l]::before { content: attr(data-l) ": "; color: var(--faint); font-size: 12px; }
  .hide-sm { display: none !important; }
}
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover, .list-item.click:hover { background: var(--accent-soft); cursor: pointer; }
.list-item .t { font-weight: 600; }
.list-item .s { font-size: 13px; color: var(--muted); }
.empty { padding: 34px 16px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 15.5px; margin-bottom: 4px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tab { padding: 9px 14px; border: 0; background: none; font: inherit; font-size: 14.5px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab .count { font-size: 12px; background: var(--info-soft); border-radius: 9px; padding: 0 6px; margin-left: 4px; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); border-radius: 18px; padding: 5px 12px; font: inherit; font-size: 13.5px; cursor: pointer; }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip .count { opacity: .75; margin-left: 4px; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; border-radius: 12px; padding: 2px 9px; white-space: nowrap; background: var(--info-soft); color: var(--muted); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.dark { background: var(--nav); color: #fff; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); text-decoration: none; color: inherit; display: block; }
a.kpi:hover { border-color: var(--accent); }
.kpi .k { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi .v { font-size: 26px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 13px; color: var(--muted); }
.kpi.alert { border-color: var(--amber); box-shadow: inset 4px 0 0 var(--amber), var(--shadow); }

.notice { border-radius: 8px; padding: 10px 12px; font-size: 14px; background: var(--info-soft); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.danger { background: var(--danger-soft); color: var(--danger); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice ul { margin: 4px 0 0; padding-left: 18px; }

.issue { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; font-size: 14px; }
.issue .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; background: var(--faint); }
.issue.error .dot { background: var(--danger); }
.issue.warn .dot { background: var(--amber); }
.issue.info .dot { background: var(--line-strong); }

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

/* ---------- Dialoge & Meldungen ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10, 16, 30, .45); z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 12px; overflow-y: auto; }
.sheet { background: var(--surface); border-radius: 12px; width: min(560px, 100%); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); display: flex; flex-direction: column; max-height: 90vh; }
.sheet.wide { width: min(860px, 100%); }
.sheet.xwide { width: min(1100px, 100%); }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { flex: 1; }
.sheet-body { padding: 16px; overflow-y: auto; }
.sheet-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (max-width: 700px) {
  .overlay { padding: 0; align-items: stretch; }
  .sheet, .sheet.wide, .sheet.xwide { width: 100%; max-height: none; min-height: 100%; border-radius: 0; }
  .sheet-head { position: sticky; top: 0; background: var(--surface); z-index: 2; padding-top: max(14px, env(safe-area-inset-top)); }
  .sheet-foot { position: sticky; bottom: 0; background: var(--surface); padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}
.toasts { position: fixed; z-index: 100; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100% - 24px)); }
.toast { background: #182033; color: #fff; border-radius: 10px; padding: 11px 14px; font-size: 14.5px; box-shadow: 0 8px 30px rgba(0, 0, 0, .3); }
.toast.error { background: var(--danger); }
.toast.ok { background: #1d7a46; }
@media (max-width: 900px) { .toasts { bottom: 76px; } }

/* ---------- Anmeldung ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #1f2f24 0%, #35583c 100%); }
.auth-card { background: var(--surface); width: min(420px, 100%); border-radius: 14px; padding: 26px 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.auth-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 22px; }
.auth-brand span { font-size: 13px; color: var(--muted); line-height: 1.45; }

/* ---------- Belegeditor ---------- */
.doc-head { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .doc-head { grid-template-columns: 1fr 1fr; } }
.pos-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.pos-table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
.pos-table td { padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pos-table input, .pos-table select, .pos-table textarea { font-size: 14px; padding: 5px 7px; min-height: 32px; }
.pos-table textarea { min-height: 52px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.pos-table tr.title td { background: var(--accent-soft); }
.pos-table tr.title input { font-weight: 650; }
.pos-table tr.subtotal td { background: var(--surface-2); font-weight: 650; }
.pos-table tr.optional td { background: repeating-linear-gradient(-45deg, transparent 0 8px, var(--surface-2) 8px 16px); }
.pos-table tr.drag-over td { border-top: 2px solid var(--accent); }
.pos-table .pos { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 11px; }
.pos-table .acts { white-space: nowrap; text-align: right; }
.pos-table .acts .btn { opacity: .6; }
.pos-table tr:hover .acts .btn { opacity: 1; }
.pos-table .w-qty { width: 84px; }
.pos-table .w-unit { width: 78px; }
.pos-table .w-price { width: 108px; }
.pos-table .w-total { width: 104px; padding-top: 11px; }
.pos-table .w-tax { width: 70px; }
.pos-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--faint); margin-top: 3px; }
.pos-meta .margin.low { color: var(--danger); }
@media (max-width: 900px) {
  .pos-table thead { display: none; }
  .pos-table, .pos-table tbody, .pos-table tr { display: block; }
  .pos-table tr { border-bottom: 1px solid var(--line-strong); padding: 6px 0; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; }
  .pos-table td { display: block; border: 0; padding: 2px 4px; }
  .pos-table td.c-name { grid-column: 1 / -1; order: -1; }
  .pos-table td.pos { display: none; }
  .pos-table .w-qty, .pos-table .w-unit, .pos-table .w-price, .pos-table .w-total, .pos-table .w-tax { width: auto; }
  .pos-table td.acts { grid-column: 1 / -1; text-align: left; }
}
.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 18px; font-size: 14.5px; }
.totals .grand { font-weight: 700; font-size: 17px; border-top: 1px solid var(--line-strong); padding-top: 6px; margin-top: 4px; }
.sticky-actions { position: sticky; bottom: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(6px); padding: 10px 0; margin-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 900px) {
  .sticky-actions { bottom: 0; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  /* Monteure: untere Navigationsleiste nicht überdecken */
  .has-tabbar .sticky-actions { bottom: calc(57px + env(safe-area-inset-bottom)); padding-bottom: 10px; }
  .has-tabbar .main { padding-bottom: 150px; }
}

.result-list { max-height: 55vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.result { display: flex; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: flex-start; }
.result:last-child { border-bottom: 0; }
.result:hover, .result.sel { background: var(--accent-soft); }
.result .t { font-weight: 600; font-size: 14.5px; }
.result .s { font-size: 12.5px; color: var(--muted); }

/* ---------- Baustelle (Handy) ---------- */
.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.big-action { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 18px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; color: var(--text); font-weight: 600; font-size: 15px; text-align: center; cursor: pointer; font-family: inherit; }
.big-action .ico { font-size: 28px; }
.big-action.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.time-row { display: grid; grid-template-columns: minmax(0, 2fr) 1fr 1fr 1fr auto auto; gap: 6px; align-items: end; padding: 8px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 700px) { .time-row { grid-template-columns: 1fr 1fr 1fr; } .time-row .who { grid-column: 1 / -1; } }
.sig-pad { width: 100%; height: 230px; background: #fff; border: 2px dashed var(--line-strong); border-radius: 10px; touch-action: none; display: block; }
.sig-img { max-width: 260px; max-height: 90px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 4px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { position: relative; width: 92px; height: 92px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-content: center; font-size: 12px; color: var(--muted); text-decoration: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .x { position: absolute; top: 3px; right: 3px; background: rgba(0, 0, 0, .55); color: #fff; border: 0; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; font-size: 13px; line-height: 22px; padding: 0; }

.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); transition: width .3s; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.pdf-frame { width: 100%; height: 75vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
kbd { font-family: var(--mono); font-size: 12px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; }
@media print { .sidebar, .topbar, .tabbar, .sticky-actions, .btn { display: none !important; } .main { padding: 0; } }

