
/* Layout: app shell like a Handwerker-ERP — left nav, top bar, work area; copper accent from the Kupfernotierung world. */
:root {
  --bg: #eef0ee; --panel: #ffffff; --panel2: #f7f8f6; --ink: #1d2328; --muted: #5d676f; --line: #d9ddd8;
  --nav: #22292e; --nav-ink: #c9d0d4; --nav-active: #b45f2b;
  --copper: #b45f2b; --copper-soft: #f6e6db;
  --ok: #2f7a4a; --ok-soft: #e1f0e6; --warn: #9a6a00; --warn-soft: #fbefcf; --bad: #b3261e; --bad-soft: #f9e0de;
  --paper: #ffffff; --paper-ink: #1d2328; --blau: #2457c5; --auf-kupfer: #ffffff;
  --f-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-body: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  --f-mono: "JetBrains Mono", Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111518; --panel: #1b2125; --panel2: #20272c; --ink: #e8ebe9; --muted: #9aa4ab; --line: #2f383e;
    --nav: #0b0e10; --nav-ink: #aab3b9; --nav-active: #e08a52; --copper: #e08a52; --copper-soft: #3a2619;
    --ok: #6cc28c; --ok-soft: #173023; --warn: #e2b44a; --warn-soft: #352a10; --bad: #f08b84; --bad-soft: #3b1a18;
    --paper: #f4f4f2; --paper-ink: #1d2328; --blau: #8fb2ff; --auf-kupfer: #1a1008; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111518; --panel: #1b2125; --panel2: #20272c; --ink: #e8ebe9; --muted: #9aa4ab; --line: #2f383e;
  --nav: #0b0e10; --nav-ink: #aab3b9; --nav-active: #e08a52; --copper: #e08a52; --copper-soft: #3a2619;
  --ok: #6cc28c; --ok-soft: #173023; --warn: #e2b44a; --warn-soft: #352a10; --bad: #f08b84; --bad-soft: #3b1a18;
  --paper: #f4f4f2; --paper-ink: #1d2328; --blau: #8fb2ff; --auf-kupfer: #1a1008; color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--f-body); }
button, input, select, textarea { font: inherit; color: inherit; }
.app { display: grid; grid-template-columns: 220px 1fr; min-height: 100%; }
nav.side { background: var(--nav); color: var(--nav-ink); padding: 16px 0 24px; padding-left: env(safe-area-inset-left, 0px); display: flex; flex-direction: column; gap: 2px; }
.brand { font: 800 18px/1.1 var(--f-display); color: #fff; padding: 4px 18px 16px; }
.brand small { display: block; font: 500 10px/1.4 var(--f-mono); color: var(--nav-active); letter-spacing: .08em; text-transform: uppercase; margin-top: 4px; }
.navgrp { font: 500 10px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: #7d878e; padding: 14px 18px 6px; }
nav.side button { background: none; border: 0; text-align: left; padding: 8px 18px; color: var(--nav-ink); cursor: pointer; border-left: 3px solid transparent; display: flex; justify-content: space-between; gap: 8px; }
nav.side button:hover { background: rgba(255,255,255,.05); color: #fff; }
nav.side button.active { border-left-color: var(--nav-active); color: #fff; background: rgba(255,255,255,.07); font-weight: 600; }
nav.side .cnt { font: 500 11px/1.6 var(--f-mono); background: rgba(255,255,255,.1); border-radius: 9px; padding: 0 7px; }
main { min-width: 0; display: flex; flex-direction: column; }
.top { background: var(--panel); border-bottom: 1px solid var(--line); padding-block: 10px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; }
.top input[type=search] { flex: 1 1 220px; min-width: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); }
.who { font-size: 13px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.who b { color: var(--ink); }
.demo { font: 500 11px/1 var(--f-mono); background: var(--warn-soft); color: var(--warn); padding: 6px 9px; border-radius: 4px; letter-spacing: .04em; }
.view { padding-block: 22px 60px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); display: grid; gap: 18px; align-content: start; }
h1 { font: 800 24px/1.15 var(--f-display); margin: 0; text-wrap: balance; }
h2 { font: 600 16px/1.2 var(--f-display); margin: 0 0 10px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.head p { margin: 4px 0 0; color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; min-width: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.tile .lbl { font: 500 11px/1.3 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tile .val { font: 800 24px/1.2 var(--f-display); font-variant-numeric: tabular-nums; margin-top: 6px; }
.tile .hint { color: var(--muted); font-size: 13px; }
.tile.alert { border-left: 4px solid var(--bad); }
.tile.money { border-left: 4px solid var(--copper); }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.tbl { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 500 11px/1.2 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; background: var(--panel2); }
/* Tabelle mit eigener Bildlaufleiste: Spaltenköpfe bleiben stehen */
.kopf-fest thead th { position: sticky; top: 0; z-index: 1; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--panel2); }
.mono { font-family: var(--f-mono); font-size: 13px; }
.pill { display: inline-block; font: 500 11px/1 var(--f-mono); padding: 5px 8px; border-radius: 999px; white-space: nowrap; }
.p-ok { background: var(--ok-soft); color: var(--ok); }
.p-warn { background: var(--warn-soft); color: var(--warn); }
.p-bad { background: var(--bad-soft); color: var(--bad); }
.p-cu { background: var(--copper-soft); color: var(--copper); }
.muted { color: var(--muted); }
.p-grey { background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }
.btn { border: 1px solid var(--line); background: var(--panel); padding: 8px 14px; border-radius: 6px; cursor: pointer; font-weight: 600; }
.btn:hover { border-color: var(--copper); }
.btn.primary { background: var(--copper); border-color: var(--copper); color: var(--auf-kupfer); }
.btn.primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
label.f { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
label.f input, label.f select, td input, td textarea { padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); font-size: 14px; color: var(--ink); width: 100%; min-width: 0; }
td input.n { text-align: right; font-variant-numeric: tabular-nums; }
td textarea { resize: vertical; min-height: 36px; }
input:disabled, select:disabled, textarea:disabled { background: var(--panel2); color: var(--muted); }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.sum { position: sticky; top: 70px; display: grid; gap: 8px; }
.sum .row { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
.sum .row.big { font: 800 20px/1.2 var(--f-display); border-top: 2px solid var(--ink); padding-top: 8px; margin-top: 4px; }
.sum .row.sub { color: var(--muted); font-size: 13px; }
.sum .row.neg span:last-child { color: var(--bad); }
/* Summenzeile in Tabellen: nicht das Raster der Beleg-Summenbox übernehmen */
tr.sum { display: table-row; position: static; font-weight: 700; }
tr.sum td { border-top: 2px solid var(--ink); }
.note { font-size: 13px; color: var(--muted); }
.lock { background: var(--ok-soft); color: var(--ok); border-radius: 6px; padding: 10px 14px; font-weight: 600; }
.timeline { display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: center; }
.tl:last-child { border-bottom: 0; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.overlay { position: fixed; inset: 0; background: rgba(10,14,16,.55); z-index: 20; display: grid; place-items: start center; overflow-y: auto; padding: max(24px, env(safe-area-inset-top, 0px)) 12px 40px; }
.dialog { background: var(--panel); border-radius: 8px; padding: 20px; width: min(520px, 100%); display: grid; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.typegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.typegrid button { text-align: left; border: 1px solid var(--line); background: var(--panel2); border-radius: 6px; padding: 10px; cursor: pointer; }
.typegrid button:hover { border-color: var(--copper); }
.typegrid b { display: block; font-family: var(--f-display); }
.typegrid span { font-size: 12px; color: var(--muted); }
.paper { background: var(--paper); color: var(--paper-ink); width: min(794px, 100%); padding: clamp(18px, 5vw, 56px); border-radius: 2px; box-shadow: 0 20px 60px rgba(0,0,0,.35); font-size: 13px; display: grid; gap: 14px; }
.paper .ph { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.paper .logo { font: 800 22px/1 var(--f-display); color: #b45f2b; }
.paper h3 { font: 800 18px/1.2 var(--f-display); margin: 6px 0 0; }
.paper table th { background: #f1f2f0; color: #4b555c; }
.paper table td, .paper table th { border-color: #dcdfdb; }
.paper .foot { border-top: 1px solid #dcdfdb; padding-top: 10px; font-size: 11px; color: #5d676f; text-align: center; }
.paper .tot { margin-left: auto; width: min(320px, 100%); display: grid; gap: 4px; }
.paper .tot div { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.paper .tot .b { font-weight: 700; border-top: 1px solid #1d2328; padding-top: 4px; }
.toast { position: fixed; bottom: max(20px, env(safe-area-inset-bottom, 0px)); right: max(20px, env(safe-area-inset-right, 0px)); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 6px; z-index: 30; font-weight: 600; }
.menu-btn { display: none; }
tr.r-T1 td { background: var(--copper-soft); font-weight: 700; }
tr.r-T2 td { background: var(--panel2); font-weight: 600; }
tr.r-X td { color: var(--muted); }
tr.sel td { box-shadow: inset 0 0 0 9999px rgba(180,95,43,.10); }
tr.drop-before td { border-top: 3px solid var(--copper); }
.drag { cursor: grab; color: var(--muted); user-select: none; font-size: 16px; line-height: 1; padding: 6px 2px; }
.artk { font: 500 10px/1 var(--f-mono); padding: 4px 6px; border-radius: 4px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
/* Positionen-Tabelle: feste Spaltenbreiten, Beschreibung nimmt den Rest */
table.b-pos { table-layout: fixed; }
table.b-pos th, table.b-pos td { padding: 6px 6px; }
table.b-pos th { position: relative; overflow: hidden; text-overflow: ellipsis; }
table.b-pos td { overflow-wrap: anywhere; }
table.b-pos td input { padding: 7px 6px; }
table.b-pos td textarea { resize: none; overflow: hidden; min-height: 36px; line-height: 1.4; }
table.b-pos .artk { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: top; }
table.b-pos select.b-nb { width: 100%; max-width: 100%; font-size: 12px; }
.col-griff { position: absolute; top: 0; right: 0; bottom: 0; width: 9px; cursor: col-resize; touch-action: none; }
.col-griff::after { content: ''; position: absolute; top: 25%; bottom: 25%; right: 3px; width: 2px; border-radius: 1px; background: var(--line); }
.col-griff:hover::after, body.spalte-ziehen .col-griff::after { background: var(--copper); }
body.spalte-ziehen { cursor: col-resize; user-select: none; }
.b-spalten { margin: 6px 0 0; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--copper); cursor: pointer; text-decoration: underline; font-size: inherit; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.toolbar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.toolbar select { padding: 4px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); font-size: 13px; }
.ver { display: grid; grid-template-columns: 70px 1fr auto; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ver:last-child { border-bottom: 0; }
.paper tr.r-T1 td { background: #f1f2f0; font-weight: 700; }
.paper tr.r-T2 td { font-weight: 600; }
.paper tr.r-sum td { font-weight: 600; border-top: 1px solid #1d2328; }
.dialog.wide { width: min(860px, 100%); }
.phone { width: min(380px, 100%); border: 10px solid #1d2328; border-radius: 30px; background: var(--panel); padding: 16px 14px; display: grid; gap: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.phone label.f textarea { padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel); font-size: 14px; width: 100%; }
#sig { width: 100%; height: 140px; border: 1px dashed var(--line); border-radius: 6px; background: #fff; touch-action: none; display: block; margin: 4px 0 6px; }
pre.xml { max-height: 50vh; overflow: auto; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 10px; font: 11.5px/1.45 var(--f-mono); white-space: pre; margin: 0; }
pre.rechtstext { max-height: 55vh; overflow: auto; background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 12px; font: 13px/1.5 var(--f-body); white-space: pre-wrap; margin: 8px 0; }
nav.side button.locked { opacity: .4; }
.chk { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.split { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: start; }
.top select { padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel2); font-weight: 600; }
.paper .ph > div:last-child:not(:first-child) { margin-left: auto; }
.paper h4 { font: 700 13px/1.2 var(--f-display); margin: 4px 0 0; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .app { grid-template-columns: 1fr; }
  nav.side { position: fixed; inset: 0 auto 0 0; width: 240px; z-index: 15; transform: translateX(-100%); transition: transform .2s; overflow-y: auto; padding-top: max(16px, env(safe-area-inset-top, 0px)); }
  nav.side.open { transform: none; }
  .menu-btn { display: inline-block; }
  .editor { grid-template-columns: 1fr; }
  .sum { position: static; }
  .tl { grid-template-columns: 1fr auto; }
  .tl .d { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Ergänzungen für die echte Anwendung ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(420px, 100%); }
.login h1 { margin-bottom: 4px; }
.login form { display: grid; gap: 12px; margin-top: 14px; }
.err { background: var(--bad-soft); color: var(--bad); padding: 8px 10px; border-radius: 6px; margin: 8px 0; }
.ok-box { background: var(--ok-soft); color: var(--ok); padding: 8px 10px; border-radius: 6px; margin: 8px 0; }
.who button { background: none; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; cursor: pointer; }
select.sprache { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; font: inherit; font-size: 13px; }
.saved { font: 12px var(--f-mono); color: var(--muted); }
.saved.dirty { color: var(--warn); }
.loading { padding: 40px; text-align: center; color: var(--muted); }
.pick td { cursor: pointer; }
.pick tr:hover td { background: var(--panel2); }
.st-list { font-size: 12px; color: var(--muted); margin-top: 4px; }
label.f textarea { min-height: 70px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.drop { border: 2px dashed var(--line); border-radius: 8px; padding: 18px; text-align: center; }
.sig-wrap canvas { width: 100%; height: 160px; background: #fff; border: 1px solid var(--line); border-radius: 6px; touch-action: none; }
.mat-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.mat-row input { padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.monteur-only .app { grid-template-columns: 1fr; }
.monteur-only nav.side, .monteur-only .menu-btn { display: none; }
@media print { nav.side, .top { display: none; } }
.g23 { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
@media (max-width: 860px) { .g23 { grid-template-columns: minmax(0, 1fr); } .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: 6px; } }
a.btn { text-decoration: none; color: inherit; display: inline-flex; align-items: center; }
#b-sum { align-self: start; }

/* Menügruppen zum Auf- und Zuklappen */
.navsec { display: flex; flex-direction: column; gap: 2px; }
.navitems { display: flex; flex-direction: column; gap: 2px; }
.navsec.zu .navitems { display: none; }
nav.side button.navgrp { color: #7d878e; border-left: 0; padding: 14px 18px 6px; justify-content: space-between; }
nav.side button.navgrp::after { content: '▾'; font-size: 11px; transition: transform .15s; }
.navsec.zu button.navgrp::after { transform: rotate(-90deg); }
nav.side button.navgrp:hover { background: none; color: var(--nav-ink); }

/* Aufklappmenüs oben (Betrieb, Einstellungen), wie eine Menüleiste */
.topmenu { position: relative; }
.topmenu .tm-btn { background: none; border: 1px solid transparent; border-radius: 6px; padding: 6px 10px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.topmenu .tm-btn:hover, .topmenu.offen .tm-btn { background: var(--panel2); border-color: var(--line); }
.topmenu.aktiv .tm-btn { color: var(--copper); }
.topmenu .tm-drop { display: none; position: absolute; top: calc(100% + 4px); left: 0; min-width: 230px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 4px; z-index: 20; flex-direction: column; }
.topmenu.offen .tm-drop { display: flex; }
.topmenu .tm-drop button { background: none; border: 0; text-align: left; padding: 8px 12px; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.topmenu .tm-drop button:hover { background: var(--panel2); }
.topmenu .tm-drop button.active { color: var(--copper); font-weight: 600; }
.topmenu[data-g="Einstellungen"] .tm-drop { left: auto; right: 0; }
.topmenu .tm-drop { max-width: calc(100vw - 32px); }
/* Monteur-App am Handy: Kopf kompakt, Name steht schon im Menü */
@media (max-width: 600px) { .monteur-only .top { gap: 8px; padding-block: 8px; } .monteur-only .who { gap: 8px; } .monteur-only .who > span { display: none; } }
@media (max-width: 600px) { .topmenu { position: static; } .topmenu .tm-drop, .topmenu[data-g="Einstellungen"] .tm-drop { left: 16px; right: 16px; top: auto; min-width: 0; } .top { position: sticky; } }

/* Installierte Version: Testzeit oder keine Lizenz */
.lizenz-hinweis { background: var(--warn-soft); color: var(--warn); padding: 8px 12px; border-radius: 6px; margin: 8px 0; font-size: 14px; }
main > .lizenz-hinweis { margin: 0; border-radius: 0; }
.lizenz-hinweis.aus { background: var(--bad-soft); color: var(--bad); }
.lizenz-hinweis a { color: inherit; font-weight: 600; }
.test-balken { background: #b3261e; color: #fff; padding: 8px 20px; display: flex; gap: 6px 14px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.schulung-balken { background: #e07a10; color: #fff; padding: 8px 20px; display: flex; gap: 6px 14px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.schulung-balken a { color: #fff; font-weight: 600; }
.schulung-balken .btn { background: #fff; color: #9a4a00; border-color: #fff; }

/* Monteur-App (Zusatzmodul): eine Spalte, große Knöpfe für Finger und Handschuhe */
.m-app { display: grid; gap: 12px; max-width: 640px; }
.m-kopf { display: flex; align-items: center; gap: 10px; }
.m-kopf > div { flex: 1; text-align: center; }
.m-kopf .btn { min-width: 44px; min-height: 44px; }
.m-netz:empty { display: none; }
.m-hinweis { background: var(--warn-soft); color: var(--warn); border-radius: 6px; padding: 10px 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.m-hinweis.m-fehler { background: var(--bad-soft); color: var(--bad); }
.m-zeit { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.m-gross { min-height: 52px; font-size: 17px; padding: 12px 20px; }
.m-h { margin: 6px 0 0; }
.m-einsatz { display: grid; gap: 6px; }
.m-zeile { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 17px; }
.m-kunde { font-size: 17px; font-weight: 700; }
.m-auftrag { margin: 2px 0; white-space: pre-wrap; background: var(--panel2); border-radius: 6px; padding: 8px 10px; }
.m-links { display: flex; flex-wrap: wrap; gap: 6px; }
.m-links .btn { text-decoration: none; color: var(--ink); white-space: normal; text-align: left; }
.m-knoepfe { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.m-knoepfe .btn { min-height: 48px; font-size: 16px; }
.m-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; margin: 6px 0; }
.m-fotos div { position: relative; }
.m-fotos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; }
.m-fotos button { position: absolute; top: 4px; right: 4px; }

/* Einsatzplanung: Woche mit Monteuren in Zeilen */
table.plan td, table.plan th { min-width: 130px; }
table.plan th.heute, table.plan td.heute { background: var(--copper-soft); }
.plan-e { display: block; width: 100%; text-align: left; border: 1px solid var(--line); border-left: 3px solid var(--copper); background: var(--panel); color: var(--ink); border-radius: 5px; padding: 5px 7px; margin-bottom: 5px; cursor: pointer; font: inherit; font-size: 13px; }
.plan-neu { opacity: .6; }
.plan-neu:hover, .plan-neu:focus { opacity: 1; }

/* KI-Assistent */
.ki-verlauf { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; min-height: 200px; overflow: auto; padding: 10px 2px; margin: 8px 0; }
.ki-msg { max-width: 85%; padding: 10px 14px; border-radius: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.ki-msg .btn { margin-top: 8px; }
.ki-ich { align-self: flex-end; background: var(--ok-soft); }
.ki-ki { align-self: flex-start; background: var(--panel2); border: 1px solid var(--line); }
.ki-eingabe { display: flex; gap: 8px; align-items: flex-end; }
.ki-eingabe textarea { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel2); color: inherit; font: inherit; }
@media (max-width: 600px) { .ki-msg { max-width: 100%; } .ki-eingabe { flex-direction: column; align-items: stretch; } }

/* Bücher und Auswertungen */
tr.z-bezahlt td { color: var(--blau); }
tr.z-ueberfaellig td { color: var(--bad); }
tr.z-storniert td { color: var(--muted); text-decoration: line-through; }
tr.filter th { padding-top: 0; }
tr.filter input { padding: 3px 6px; font-size: 12px; }
td.err { color: var(--bad); font-weight: 600; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.balken { display: flex; gap: 6px; align-items: stretch; height: 260px; padding-top: 8px; }
.b-monat { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.b-wert { font-size: 10px; color: var(--muted); text-align: center; height: 14px; overflow: hidden; white-space: nowrap; }
.b-saeule { flex: 1; position: relative; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--line); }
.b-stapel { width: 70%; display: flex; flex-direction: column; border-radius: 3px 3px 0 0; overflow: hidden; position: relative; }
.b-vj { position: absolute; bottom: 0; left: 8%; width: 84%; border: 1.5px dashed var(--muted); border-bottom: 0; border-radius: 3px 3px 0 0; }
.b-name { font-size: 12px; text-align: center; padding-top: 4px; }
.balken-legende { display: flex; gap: 16px; font-size: 13px; margin-bottom: 4px; }
.balken-legende i { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.balken-legende i.vj { border: 1.5px dashed var(--muted); }

/* Zwei-Faktor-Anmeldung */
.schritte { display: grid; gap: 14px; padding-left: 20px; margin: 12px 0; }
.qr { background: #fff; padding: 8px; border-radius: 6px; width: 200px; max-width: 100%; margin: 8px 0; }
.qr svg { display: block; width: 100%; height: auto; }
.zf-zeile { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.zf-zeile input { flex: 1 1 140px; min-width: 0; font: 500 18px var(--f-mono); letter-spacing: .1em; }
.notfall { font: 500 15px/1.7 var(--f-mono); background: var(--panel2); border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; columns: 2; }
.ok-box { background: var(--ok-soft); color: var(--ok); border-radius: 6px; padding: 10px 14px; margin-bottom: 10px; }
/* Empfangene E-Rechnung */
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 5px; border-radius: 4px; background: var(--copper); color: var(--auf-kupfer); margin-right: 4px; }
.er-kopf { display: grid; grid-template-columns: 1fr auto; gap: 16px; margin-bottom: 12px; line-height: 1.45; }
.er-kopf > div:last-child { text-align: right; }
@media (max-width: 640px) { .er-kopf { grid-template-columns: 1fr; } .er-kopf > div:last-child { text-align: left; } }
/* Kontoauszug */
.ka-zweck { max-width: 360px; font-size: 13px; }
.ka-vor { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
td.neg { color: var(--bad); }

/* ---------- Aussehen je Benutzer: Akzentfarbe, Schriftgröße, Aufbau (Menü links / Menü oben / App-Kacheln) ---------- */
:root[data-akzent="blau"] { --copper: #2457c5; --copper-soft: #e1e9fa; --nav-active: #2457c5; }
:root[data-akzent="gruen"] { --copper: #2f7a4a; --copper-soft: #e1f0e6; --nav-active: #3b9a5d; }
:root[data-akzent="violett"] { --copper: #6b4fbb; --copper-soft: #ece6f8; --nav-active: #8a6fd6; }
:root[data-akzent="anthrazit"] { --copper: #3d4850; --copper-soft: #e4e7e9; --nav-active: #8c98a1; }
@media (prefers-color-scheme: dark) {
  :root[data-akzent="blau"]:not([data-theme="light"]) { --copper: #7fa6ff; --copper-soft: #1a2640; --nav-active: #7fa6ff; }
  :root[data-akzent="gruen"]:not([data-theme="light"]) { --copper: #6cc28c; --copper-soft: #173023; --nav-active: #6cc28c; }
  :root[data-akzent="violett"]:not([data-theme="light"]) { --copper: #b39cf0; --copper-soft: #2a2240; --nav-active: #b39cf0; }
  :root[data-akzent="anthrazit"]:not([data-theme="light"]) { --copper: #c3ccd2; --copper-soft: #2a3237; --nav-active: #c3ccd2; }
}
:root[data-akzent="blau"][data-theme="dark"] { --copper: #7fa6ff; --copper-soft: #1a2640; --nav-active: #7fa6ff; }
:root[data-akzent="gruen"][data-theme="dark"] { --copper: #6cc28c; --copper-soft: #173023; --nav-active: #6cc28c; }
:root[data-akzent="violett"][data-theme="dark"] { --copper: #b39cf0; --copper-soft: #2a2240; --nav-active: #b39cf0; }
:root[data-akzent="anthrazit"][data-theme="dark"] { --copper: #c3ccd2; --copper-soft: #2a3237; --nav-active: #c3ccd2; }
:root[data-schrift="gross"] body { zoom: 1.1; }
:root[data-schrift="sehrgross"] body { zoom: 1.22; }
@media print { :root[data-schrift] body { zoom: 1; } }

.brand-mini { font: 800 16px/1.1 var(--f-display); white-space: nowrap; }
.brand-mini small { display: block; font: 500 10px/1.4 var(--f-mono); color: var(--copper); letter-spacing: .08em; text-transform: uppercase; margin-top: 2px; }
:root[data-layout="links"] .brand-mini { display: none; }
.app-oben, .app-kacheln { grid-template-columns: 1fr; }

/* Menü oben: dunkle Leiste über die ganze Breite unter Firmenname, Suche und Benutzer */
.app-oben .top { padding-bottom: 0; row-gap: 10px; }
.menuleiste { flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: 2px; background: var(--nav); margin-left: calc(-1 * max(20px, env(safe-area-inset-left, 0px))); margin-right: calc(-1 * max(20px, env(safe-area-inset-right, 0px)));
  padding: 4px max(14px, env(safe-area-inset-right, 0px)) 4px max(14px, env(safe-area-inset-left, 0px)); }
.menuleiste > button, .menuleiste .tm-btn { background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: var(--nav-ink); padding: 9px 12px 7px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.menuleiste > button:hover, .menuleiste .tm-btn:hover, .menuleiste .topmenu.offen .tm-btn { background: rgba(255,255,255,.07); color: #fff; border-color: transparent; }
.menuleiste > button.active, .menuleiste .topmenu.aktiv .tm-btn { color: #fff; border-bottom-color: var(--nav-active); }
.menuleiste .topmenu.aktiv .tm-btn { color: #fff; }
.menuleiste .topmenu:nth-last-child(-n+2) .tm-drop { left: auto; right: 0; }
.menuleiste .tm-drop { max-height: calc(100vh - 140px); overflow-y: auto; }
.konto-btn { display: none; }
.konto-btn .sym { width: 20px; height: 20px; display: block; }
@media (max-width: 860px) {
  .app-oben .who > span, .app-kacheln .who > span { display: none; }
  /* am Handy: Suche und Konto-Knopf in einer Zeile, Nachtmodus/Sprache/Passwort/Abmelden erst nach Tippen */
  .app-oben .konto-btn, .app-kacheln .konto-btn { display: inline-flex; padding: 7px 9px; }
  .app-oben .top > .who, .app-kacheln .top > .who { display: none; flex: 1 0 100%; }
  .app-oben .top.konto-offen > .who, .app-kacheln .top.konto-offen > .who { display: flex; }
  .app-oben .top input[type=search], .app-kacheln .top input[type=search] { flex: 1 1 0; }
  .app-oben .brand-mini { flex: 1 0 100%; }
}

/* App-Kacheln: Startbildschirm wie am Smartphone */
.apps-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; }
.apps-btn .sym { width: 18px; height: 18px; }
.apps-btn.active { background: var(--copper); border-color: var(--copper); color: var(--auf-kupfer); }
.kgruppe h2 { font: 500 11px/1.2 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 18px 12px; }
.kachel { background: none; border: 0; padding: 6px 2px; cursor: pointer; display: grid; justify-items: center; gap: 8px; border-radius: 14px; color: var(--ink); }
.kachel:hover { background: var(--panel); }
.kachel:hover .kicon { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.18); }
.kicon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; color: #fff; background: linear-gradient(160deg, color-mix(in srgb, var(--kc) 82%, #fff), var(--kc)); box-shadow: 0 3px 8px rgba(0,0,0,.14); transition: transform .12s, box-shadow .12s; }
.kicon .sym { width: 30px; height: 30px; }
.klbl { font-size: 13px; font-weight: 600; text-align: center; line-height: 1.25; max-width: 124px; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
.g-start { --kc: var(--copper); } .g-auftrag { --kc: #d0672c; } .g-zeit { --kc: #20889a; } .g-lohn { --kc: #7b5cc4; } .g-finanz { --kc: #2f8a52; }
.g-lager { --kc: #b8861b; } .g-stamm { --kc: #2f66d0; } .g-betrieb { --kc: #6a7780; } .g-einst { --kc: #4b555c; }
:root[data-theme="dark"] .kicon { color: #fff; }
.dock { display: none; }
@media (max-width: 860px) {
  .app-kacheln .top > .topmenu, .app-kacheln .brand-mini { display: none; }
  .app-kacheln .who > span { display: none; }
  .app-kacheln .apps-btn { display: none; }
  .app-kacheln .view { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
  .dock { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 12; background: var(--panel); border-top: 1px solid var(--line);
    padding: 6px max(6px, env(safe-area-inset-right, 0px)) max(6px, env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)); box-shadow: 0 -4px 16px rgba(0,0,0,.08); }
  .dock button { background: none; border: 0; display: grid; justify-items: center; gap: 2px; padding: 4px 2px; color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer; border-radius: 8px; }
  .dock button .sym { width: 24px; height: 24px; }
  .dock button.active { color: var(--copper); }
  .kacheln { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 6px; }
  .kicon { width: 58px; height: 58px; border-radius: 16px; }
  .klbl { font-size: 11.5px; }
}
@media (max-width: 380px) { .kacheln { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media print { .dock, .menuleiste { display: none; } }

/* Einstellungen → Aussehen */
.aw-wahl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.aw-opt { text-align: left; border: 2px solid var(--line); background: var(--panel2); border-radius: 8px; padding: 10px 12px; cursor: pointer; display: grid; gap: 6px; align-content: start; color: var(--ink); }
.aw-opt:hover { border-color: var(--copper); }
.aw-opt.an { border-color: var(--copper); background: var(--copper-soft); box-shadow: inset 0 0 0 1px var(--copper); }
.aw-opt b { font-family: var(--f-display); }
.aw-farbe { width: 28px; height: 28px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }
.aw-aa { font: 700 18px/1 var(--f-display); }
.aw-s-gross { font-size: 22px; } .aw-s-sehrgross { font-size: 27px; }
/* kleine Vorschaubilder der drei Aufbauten */
.aw-bild { position: relative; display: block; height: 92px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; }
.aw-bild i { position: absolute; display: block; border-radius: 2px; }
.aw-links i:nth-child(1) { left: 0; top: 0; bottom: 0; width: 26%; background: var(--nav); }
.aw-links i:nth-child(2), .aw-links i:nth-child(3), .aw-links i:nth-child(4) { left: 5%; width: 16%; height: 5px; background: var(--nav-ink); opacity: .6; }
.aw-links i:nth-child(2) { top: 14px; background: var(--nav-active); opacity: 1; } .aw-links i:nth-child(3) { top: 26px; } .aw-links i:nth-child(4) { top: 38px; }
.aw-links i:nth-child(5) { left: 30%; right: 4%; top: 6px; height: 10px; background: var(--panel); }
.aw-links i:nth-child(6), .aw-links i:nth-child(7), .aw-links i:nth-child(8) { left: 30%; height: 18px; width: 20%; top: 28px; background: var(--panel); }
.aw-links i:nth-child(7) { left: 53%; } .aw-links i:nth-child(8) { left: 76%; }
.aw-oben i:nth-child(1) { left: 0; right: 0; top: 0; height: 14px; background: var(--panel); }
.aw-oben i:nth-child(2) { left: 0; right: 0; top: 14px; height: 12px; background: var(--nav); }
.aw-oben i:nth-child(3), .aw-oben i:nth-child(4) { top: 18px; height: 4px; width: 12%; background: var(--nav-ink); opacity: .7; }
.aw-oben i:nth-child(3) { left: 6%; background: var(--nav-active); opacity: 1; } .aw-oben i:nth-child(4) { left: 22%; }
.aw-oben i:nth-child(5) { left: 38%; top: 18px; height: 4px; width: 12%; background: var(--nav-ink); opacity: .7; }
.aw-oben i:nth-child(6), .aw-oben i:nth-child(7), .aw-oben i:nth-child(8) { top: 36px; height: 22px; width: 28%; background: var(--panel); }
.aw-oben i:nth-child(6) { left: 4%; } .aw-oben i:nth-child(7) { left: 36%; } .aw-oben i:nth-child(8) { left: 68%; }
.aw-kacheln i { width: 16%; height: 22px; border-radius: 6px; }
.aw-kacheln i:nth-child(1) { left: 8%; top: 12px; background: #d0672c; } .aw-kacheln i:nth-child(2) { left: 30%; top: 12px; background: #2f8a52; }
.aw-kacheln i:nth-child(3) { left: 52%; top: 12px; background: #2f66d0; } .aw-kacheln i:nth-child(4) { left: 74%; top: 12px; background: #7b5cc4; }
.aw-kacheln i:nth-child(5) { left: 8%; top: 44px; background: #20889a; } .aw-kacheln i:nth-child(6) { left: 30%; top: 44px; background: #b8861b; }
.aw-kacheln i:nth-child(7) { left: 52%; top: 44px; background: #6a7780; }
.aw-kacheln i:nth-child(8) { left: 0; right: 0; bottom: 0; top: auto; width: auto; height: 12px; border-radius: 0; background: var(--panel); border-top: 1px solid var(--line); }

/* Stil: Menüsymbole gibt es nur im Stil „Ilasoft Neu“ (skin-ilasoft.css) */
.sym-n { display: none; }
:root { --akzent-std: #b45f2b; }
.aw-skin-klassisch i:nth-child(1) { left: 0; top: 0; bottom: 0; width: 24%; background: #22292e; border-radius: 0; }
.aw-skin-klassisch i:nth-child(2) { left: 4%; top: 12px; width: 15%; height: 5px; background: #b45f2b; }
.aw-skin-klassisch i:nth-child(3), .aw-skin-klassisch i:nth-child(4) { left: 4%; width: 15%; height: 5px; background: #c9d0d4; opacity: .6; }
.aw-skin-klassisch i:nth-child(3) { top: 24px; } .aw-skin-klassisch i:nth-child(4) { top: 36px; }
.aw-skin-klassisch i:nth-child(5) { left: 28%; right: 4%; top: 8px; height: 12px; background: #fff; border: 1px solid #d9ddd8; }
.aw-skin-klassisch i:nth-child(6), .aw-skin-klassisch i:nth-child(7), .aw-skin-klassisch i:nth-child(8) { top: 30px; height: 26px; width: 20%; background: #fff; border: 1px solid #d9ddd8; border-left: 3px solid #b45f2b; }
.aw-skin-klassisch i:nth-child(6) { left: 28%; } .aw-skin-klassisch i:nth-child(7) { left: 51%; } .aw-skin-klassisch i:nth-child(8) { left: 74%; }
.aw-skin-klassisch { background: #eef0ee; }
.aw-skin-ilasoft { background: #f3f5f8; }
.aw-skin-ilasoft i:nth-child(1) { left: 0; top: 0; bottom: 0; width: 24%; background: linear-gradient(180deg, #0b1b2b, #143049); border-radius: 0; }
.aw-skin-ilasoft i:nth-child(2) { left: 3%; top: 10px; width: 18%; height: 9px; background: rgba(77,141,255,.35); border-radius: 4px; }
.aw-skin-ilasoft i:nth-child(3), .aw-skin-ilasoft i:nth-child(4) { left: 5%; width: 13%; height: 4px; background: #b4c3d0; opacity: .6; }
.aw-skin-ilasoft i:nth-child(3) { top: 26px; } .aw-skin-ilasoft i:nth-child(4) { top: 36px; }
.aw-skin-ilasoft i:nth-child(5) { left: 28%; right: 4%; top: 8px; height: 12px; background: #fff; border-radius: 999px; box-shadow: 0 1px 3px rgba(15,28,42,.12); }
.aw-skin-ilasoft i:nth-child(6), .aw-skin-ilasoft i:nth-child(7), .aw-skin-ilasoft i:nth-child(8) { top: 30px; height: 26px; width: 20%; background: #fff; border-radius: 7px; box-shadow: 0 2px 6px rgba(15,28,42,.10); border-top: 3px solid #2563d9; }
.aw-skin-ilasoft i:nth-child(6) { left: 28%; } .aw-skin-ilasoft i:nth-child(7) { left: 51%; } .aw-skin-ilasoft i:nth-child(8) { left: 74%; }
/* Autohaus: Frage-Assistent */
.awz-opt { display: grid; gap: 6px; }
.aw-radio { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.aw-radio:hover { background: var(--panel2); }
.aw-balken { height: 6px; background: var(--panel2); border-radius: 3px; overflow: hidden; }
.aw-balken div { height: 100%; background: var(--copper); }

/* Fotostrecke in der Fahrzeugakte (Ilasoft Auto) */
.fz-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.fz-foto { position: relative; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--panel2); }
.fz-foto img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.fz-foto .titel { position: absolute; top: 5px; left: 5px; }
.fz-foto .akt { display: flex; gap: 2px; justify-content: center; flex-wrap: wrap; padding: 3px; }
.fz-foto .akt .btn.sm { padding: 2px 6px; font-size: 12px; min-width: 0; }
