/* =====================================================================================
   Umweltbüro – Prototyp · Erweiterung CRUD
   Dialoge, Formulare, Kennzahlen, Tabellenaktionen, Zeiterfassung, Menügruppen. Ergänzt styles.css.
   ===================================================================================== */
.muted { color: var(--text-muted); }
.small { font-size: 11px; }
td.num, th.num, .np-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.nav-area[hidden] { display: none; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack.small-gap { gap: 6px; }
.loading { padding: 24px; color: var(--text-muted); font-size: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 14px 16px; }
.card h3 { margin: 0 0 10px; font-size: 13.5px; font-weight: 700; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.card-head h3 { margin: 0; }
.note { padding: 8px 12px; border-radius: 6px; background: #eef4f3; color: #3a4644; font-size: 11.5px; line-height: 1.45; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 4px; background: #e9edec; color: #3a4644; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.tag.info { background: #e3efee; color: var(--petrol-text); }
.tag.warn { background: #fdf2df; color: #8a5a12; }
.tag.ok { background: var(--lime-soft); color: #3f5a10; }
.tag.bad { background: #fde8e5; color: #9a3326; }
.btn.danger { background: #fff; border-color: #d9a8a2; color: #9a3326; }
.btn.danger:hover { background: #fdf0ee; border-color: #c88a83; }
.ibtn { width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: #5b6866; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.ibtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ibtn:hover { background: var(--hover-soft); color: var(--petrol-text); }
.ibtn.bordered { border: 1px solid #c3cdcb; background: #fff; width: 30px; height: 30px; }
.row-actions { display: flex; justify-content: flex-end; gap: 2px; }
td.check, th.check { width: 40px; }
tbody tr.selected td { font-weight: 700; }
tbody tr.sum-row { background: #f3f6f5; cursor: default; }
tbody tr.sum-row td { font-weight: 700; }
.toolbar-select { height: 30px; width: auto; min-width: 11rem; padding: 0 8px; font-size: 12px; }
.kw-badge { display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border: 1px solid #c3cdcb; border-radius: 6px; background: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; }

/* Kennzahlen, Ansichtswahl */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; border-top: 3px solid var(--petrol); }
.kpi.ok { border-top-color: var(--bar-olive); }
.kpi.warn { border-top-color: #d48a16; }
.kpi-label { font-size: 10.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-size: 20px; font-weight: 700; line-height: 1.2; }
.kpi-sub { font-size: 11px; color: var(--text-muted); }
.seg { display: inline-flex; padding: 3px; border-radius: 7px; background: #dfe5e3; gap: 2px; }
.seg button { height: 24px; padding: 0 12px; border: 0; border-radius: 5px; background: transparent; color: #3a4644; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.seg button.on { background: #fff; color: var(--petrol-text); box-shadow: var(--shadow-sm); }

/* Dialoge */
.dlg-overlay { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20, 40, 38, .42); opacity: 0; transition: opacity .18s; }
.dlg-overlay.show { opacity: 1; }
.dlg { width: 100%; max-width: 40rem; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border-radius: 12px; box-shadow: 0 24px 60px rgba(20, 40, 38, .3); transform: translateY(8px) scale(.98); transition: transform .18s var(--ease); }
.dlg-overlay.show .dlg { transform: none; }
.dlg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 10px; border-bottom: 1px solid var(--line-soft); }
.dlg-head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.dlg-head p { margin: 2px 0 0; font-size: 11.5px; color: var(--text-muted); }
.dlg-close { flex: 0 0 auto; }
.dlg-body { padding: 14px 18px; overflow: auto; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 14px; border-top: 1px solid var(--line-soft); }
.dlg-foot .danger { margin-right: auto; }
.dlg-text { margin: 0; font-size: 13px; }

/* Formulare */
.f-form { display: flex; flex-direction: column; gap: 12px; }
.f-grid { display: grid; gap: 10px 12px; }
.f-grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.f-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.f-grid.g2 .span3 { grid-column: span 2; }
.f-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.f-field > label { font-size: 10.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.f-field small { font-size: 10.5px; color: var(--text-muted); }
.f-field[hidden], .stack[hidden], .f-grid[hidden] { display: none; }
.f-input { width: 100%; min-height: 32px; padding: 6px 10px; border: 1px solid #c3cdcb; border-radius: 6px; background: #fff; color: var(--text); font: inherit; font-size: 12.5px; transition: border-color .15s, box-shadow .15s; }
.f-input:focus { outline: none; border-color: var(--petrol); box-shadow: 0 0 0 3px rgba(46, 107, 99, .15); }
select.f-input { padding-right: 28px; }
textarea.f-input { resize: vertical; min-height: 60px; line-height: 1.4; }
.f-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; cursor: pointer; min-height: 32px; }
.f-checks { display: flex; flex-direction: column; gap: 4px; }
.f-inline { display: flex; gap: 18px; flex-wrap: wrap; }
.f-section { margin: 0; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfb; }
.f-section legend { display: flex; align-items: center; gap: 8px; padding: 0 6px; font-size: 12px; font-weight: 700; }
.f-section.focus { border-color: var(--petrol); box-shadow: 0 0 0 3px rgba(46, 107, 99, .12); }
.f-section .f-field > label { text-transform: none; letter-spacing: 0; font-size: 11px; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; }
.kv-row { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kv-row.span { grid-column: span 2; }
.kv-label { font-size: 10.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.kv-value { font-size: 12.5px; white-space: pre-wrap; }

/* Positionen im Fenster */
.pos-editor { display: flex; flex-direction: column; gap: 6px; }
.pos-table { min-width: 720px; }
.pos-table th { background: #e9edec; font-size: 11px; padding: 6px 8px; }
.pos-table td { padding: 4px 6px; vertical-align: middle; }
.pos-table td .f-input { min-height: 28px; padding: 3px 6px; font-size: 12px; }
.pos-table td:first-child .f-input { min-width: 12rem; }
.pos-table .empty-row td { padding: 14px; }
.pos-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; }

/* Seitenüberschrift einfacher Seiten */
.badge.text { min-width: auto; padding: 0 7px; letter-spacing: .03em; }
.placeholder-area p { margin: 0 0 12px; }

/* Zeiterfassung */
.zeit-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
.zeit-layout > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.zcal { display: grid; grid-template-columns: 44px repeat(7, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; user-select: none; }
.zcal-dh { height: 46px; padding: 6px 6px 4px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 1px; }
.zcal-dh b { font-size: 11.5px; }
.zcal-dh small { font-size: 10.5px; color: var(--text-muted); }
.zcal-dh small.ok { color: #3f7a24; font-weight: 600; }
.zcal-gutter { border-right: 1px solid var(--line-soft); }
.zcal-hours { position: relative; }
.zcal-h { position: absolute; left: 0; right: 4px; transform: translateY(-50%); text-align: right; font-size: 9.5px; color: #8a9694; }
.zcal-day { min-width: 0; border-left: 1px solid var(--line-soft); }
.zcal-day.we .zcal-col { background-color: #f6f8f7; }
.zcal-day.today .zcal-dh { background: var(--lime-soft); }
.zcal-col { position: relative; cursor: crosshair; background-image: linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px); }
.zcal-blk { position: absolute; left: 2px; right: 2px; padding: 2px 5px; border-radius: 4px; background: var(--petrol); color: #fff; font-size: 10.5px; line-height: 1.25; overflow: hidden; cursor: pointer; box-shadow: var(--shadow-sm); transition: filter .12s; }
.zcal-blk:hover { filter: brightness(1.08); }
.zcal-blk b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zcal-blk span { display: block; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zcal-blk.ad { background: var(--bar-olive); color: #1f2a06; }
.zcal-blk.ho { border-left: 4px solid var(--lime); }
.zcal-sel { position: absolute; left: 2px; right: 2px; border: 1.5px dashed var(--petrol); border-radius: 4px; background: rgba(201, 226, 78, .35); font-size: 10.5px; font-weight: 600; padding: 2px 5px; color: var(--petrol-text); pointer-events: none; }
.zcal-legend { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; font-size: 11px; color: var(--text-muted); }
.zcal-legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; background: var(--petrol); }
.zcal-legend i.b { background: var(--bar-olive); }
.zcal-legend i.c { background: var(--petrol); border-left: 4px solid var(--lime); }
.np-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 54px; gap: 8px; align-items: center; font-size: 12px; }
.np-row b { font-size: 12px; }
.np-sum { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-soft); font-size: 12px; }
.zf-times { display: flex; align-items: center; gap: 6px; }
.zf-times input { flex: 1 1 0; min-width: 0; }
.zf-dauer { font-size: 12px; white-space: nowrap; }
.zf-budget { display: flex; flex-direction: column; gap: 4px; }
.zf-budget:empty { display: none; }
.zf-budget .bar { width: 100%; }
.zf-budget small { font-size: 11px; color: var(--text-muted); }
.bar.warn i { background: #d48a16; }
.bar.bad i { background: #b8382c; }
.bar.petrol i { background: var(--bar-petrol); }

/* Geschäftsablauf in Abschnitt F: Zusage → Auftrag, Projekt starten → Projekt */
.note.ablauf { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin: 6px 0 12px; font-size: 12px; }
.note.ablauf > span { flex: 1 1 260px; }
.note.ablauf.done { background: var(--lime-soft); color: var(--petrol-text); }
.note.ablauf > svg { flex: 0 0 auto; width: 16px; height: 16px; fill: none; stroke: var(--green); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.note.ablauf .btn { flex: 0 0 auto; }

/* Auswahlfeld mit Suche (Einträge aus Datenbanktabellen) */
.combo { position: relative; display: block; width: 100%; min-width: 0; }
.combo .combo-input { width: 100%; padding-right: 48px; text-overflow: ellipsis; }
.combo.compact .combo-input { min-height: 28px; padding: 3px 40px 3px 6px; font-size: 12px; }
.combo-caret { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); color: #6b7876; pointer-events: none; }
.combo-caret svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.combo-clear { position: absolute; right: 26px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #6b7876; cursor: pointer; display: none; align-items: center; justify-content: center; }
.combo-clear:hover { background: var(--hover-soft); color: var(--petrol-text); }
.combo.has-value .combo-clear { display: inline-flex; }
.combo-clear svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.combo-list { position: fixed; z-index: 90; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-lg); padding: 4px; }
.combo-item { padding: 6px 8px; border-radius: 5px; font-size: 12.5px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-item.leer { color: var(--text-muted); }
.combo-item:hover, .combo-item.hover { background: var(--hover-soft); }
.combo-item.on { background: var(--lime-soft); font-weight: 600; }
.combo-item b { color: var(--petrol-text); }
.combo-hint { padding: 6px 8px; font-size: 11.5px; color: var(--text-muted); }
.toolbar .combo.toolbar-combo { width: 15rem; flex: 0 0 auto; }
.toolbar .combo.toolbar-combo .combo-input { height: 30px; min-height: 30px; font-size: 12px; }
.konzept-table .combo, .pos-table .combo { min-width: 6.5rem; }

/* Kalkulation (Konzeptvorschlag) und Eingaben in Tabellenzellen */
.f-input.inline { min-height: 28px; padding: 3px 6px; font-size: 12px; width: auto; }
.f-input.inline.num { text-align: right; }
.f-input.readonly { background: #f3f6f5; color: var(--text-muted); display: flex; align-items: center; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--petrol-text); padding: 0 8px; height: 28px; font-size: 12px; }
.btn.ghost:hover { background: var(--hover-soft); border-color: transparent; }
.btn.ghost svg { width: 15px; height: 15px; }
.card.inner { background: #fafbfb; box-shadow: none; }
.card .card-head .f-inline { gap: 6px; }
td.center { text-align: center; }
.konzept-table { min-width: 1180px; font-size: 12px; }
.konzept-table th { background: #e9edec; font-size: 11px; padding: 7px 8px; }
.konzept-table td { padding: 6px 8px; vertical-align: top; border-top: 1px solid var(--line-soft); }
.konzept-table td.num, .konzept-table th.num { white-space: nowrap; }
.konzept-table tbody tr { cursor: default; }
.konzept-table tbody tr:hover { background: #f7f9f8; }
.konzept-table tr.konzept-gruppe td { background: #eef3f2; font-weight: 600; }
.konzept-table tr.konzept-optional td { color: var(--text-muted); }
.konzept-table .pos-text { min-width: 18rem; }
.konzept-table .row-actions { justify-content: flex-start; }
.konzept-table .sum-row td { background: #f3f6f5; font-weight: 700; }
.f-field > label:empty::before { content: '\00a0'; }

/* Menügruppen in der Schublade */
.drawer-group-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; text-align: left; }
.drawer-group-btn:hover { background: var(--hover-soft); }
.drawer-group-btn svg { width: 20px; height: 20px; color: #6b7876; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.drawer-group-btn .chev { margin-left: auto; width: 16px; height: 16px; transition: transform .18s; }
.drawer-group.open .drawer-group-btn .chev { transform: rotate(180deg); }
.drawer-sub { list-style: none; margin: 0; padding: 0 0 4px; display: none; }
.drawer-group.open .drawer-sub { display: block; }
.drawer-sub a { padding: 8px 12px 8px 44px; font-size: 12.5px; }
.drawer-nav a.current svg { color: var(--lime); }

.toolbar .toolbar-select { width: auto; flex: 0 0 auto; }
.toolbar input.toolbar-select[type="date"] { width: 10rem; min-width: 0; }

@media (max-width: 1023px) {
  .zeit-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 599px) {
  .f-grid.g2, .f-grid.g3, .kv { grid-template-columns: minmax(0, 1fr); }
  .span2, .span3, .f-grid.g2 .span3, .kv-row.span { grid-column: span 1; }
  .dlg-overlay { padding: 8px; align-items: flex-end; }
  .dlg { max-height: calc(100vh - 16px); }
  .zcal { grid-template-columns: 36px repeat(7, minmax(0, 1fr)); }
  .zcal-blk { font-size: 9px; padding: 1px 3px; }
  .zcal-dh b { font-size: 10px; }
  .toolbar .toolbar-select, .toolbar input.toolbar-select[type="date"], .toolbar .combo.toolbar-combo { width: 100%; min-width: 0; flex: 1 1 100%; }
}

/* =====================================================================================
   Fenster-Design nach der Design-Regel (docs/DESIGN-REGEL-FENSTER.md, 04.10.2026)
   Kopf · Abschnitts-Chips · Inhalt in Abschnitten · Fuß · Vollbild am Handy · Markenzeichen · Bewegung · Login
   ===================================================================================== */
:root { --brand: #0f6a63; --red: #e0211d; --red-soft: #fde8e5; --gray-mark: #9aa3a1; --dlg-pad: 22px; --dur-fast: .14s; --dur: .2s; --dur-slow: .32s; }
@font-face { font-family: "Dancing Script"; src: url("../fonts/DancingScript.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

/* --- Fenster --- */
.dlg-overlay { padding: 24px 16px; align-items: center; background: rgba(20, 40, 38, .46); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); transition: opacity var(--dur) var(--ease); }
.dlg { max-width: 40rem; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); border-radius: 14px; overflow: hidden; box-shadow: 0 30px 70px rgba(20, 40, 38, .32), 0 2px 6px rgba(20, 40, 38, .12); transform: translateY(10px) scale(.985); transition: transform var(--dur) var(--ease), opacity var(--dur); }
.dlg[data-size="s"] { max-width: 27rem; }
.dlg[data-size="m"] { max-width: 40rem; }
.dlg[data-size="l"] { max-width: 58rem; }
.dlg[data-size="xl"] { max-width: 74rem; }
.dlg-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 16px var(--dlg-pad) 12px; border-bottom: 1px solid var(--line-soft); background: var(--surface); }
.dlg-head.no-icon { grid-template-columns: minmax(0, 1fr) auto; }
.dlg-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--lime-soft); color: var(--petrol-text); display: flex; align-items: center; justify-content: center; }
.dlg-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dlg-icon .mark { width: 22px; height: 22px; stroke: none; }
.dlg-icon.danger { background: var(--red-soft); color: #9a3326; }
.dlg-text { min-width: 0; }
.dlg-eyebrow { display: block; margin-bottom: 2px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--petrol); }
.dlg-head h2 { font-size: 17px; line-height: 1.25; letter-spacing: -.01em; overflow-wrap: anywhere; }
.dlg-head p { margin-top: 2px; font-size: 12px; overflow-wrap: anywhere; }
.dlg-nav { display: flex; gap: 6px; padding: 10px var(--dlg-pad) 12px; overflow-x: auto; scrollbar-width: none; background: var(--surface); border-bottom: 1px solid var(--line-soft); }
.dlg-nav::-webkit-scrollbar { display: none; }
.dlg-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px 0 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--cream); color: var(--petrol-text); font: inherit; font-size: 11.5px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast); }
.dlg-chip .badge { height: 18px; min-width: 22px; font-size: 10px; background: var(--petrol); }
.dlg-chip.voll { background: #fff; }
.dlg-chip.on { background: var(--petrol); border-color: var(--petrol); color: #fff; }
.dlg-chip.on .badge { background: var(--lime); color: var(--petrol-deep); }
.dlg-chip:hover { transform: translateY(-1px); border-color: #a9b6b3; }
.dlg-chip:focus-visible { outline: 2px solid var(--petrol); outline-offset: 2px; }
.dlg-body { padding: 18px var(--dlg-pad) 24px; overscroll-behavior: contain; }
.dlg-foot { align-items: center; gap: 10px; padding: 12px var(--dlg-pad) 14px; background: #fbfcfc; }
.dlg .btn { height: 36px; padding: 0 16px; font-size: 13px; }
.dlg .btn.ghost { height: 30px; }
.dlg-foot .btn.primary { min-width: 9rem; justify-content: center; }
.dlg-foot .btn.danger { margin-right: auto; }
.dlg.headless { position: relative; }
.dlg.headless .dlg-head { position: absolute; top: 8px; right: 8px; z-index: 2; padding: 0; border: 0; background: transparent; grid-template-columns: auto; }
.dlg.headless .dlg-head > :not(.dlg-close) { display: none; }

/* --- Formulare im Fenster --- */
.dlg .f-form { gap: 16px; }
.f-field > label { font-size: 11.5px; font-weight: 600; color: #3f4b49; text-transform: none; letter-spacing: 0; }
.f-section .f-field > label { font-size: 11.5px; }
.f-field small { font-size: 11px; line-height: 1.35; }
.f-input { min-height: 36px; padding: 7px 11px; border-radius: 8px; font-size: 13px; }
.f-input::placeholder { color: #9aa6a3; }
.f-input:disabled, .f-input[readonly] { background: #f3f6f5; color: var(--text-muted); }
.f-input.invalid, .combo.invalid .combo-input { border-color: var(--red); box-shadow: 0 0 0 3px rgba(224, 33, 29, .12); }
.f-field .fehler { font-size: 11px; color: #9a3326; font-weight: 600; }
textarea.f-input { min-height: 72px; resize: vertical; }
.combo .combo-input { min-height: 36px; border-radius: 8px; font-size: 13px; }
.combo.compact .combo-input { min-height: 28px; font-size: 12px; }
.f-check { min-height: 36px; }
.f-check input { width: 16px; height: 16px; accent-color: var(--petrol); }
.f-grid { gap: 12px 14px; }
.f-grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span4 { grid-column: span 4; }

/* --- Abschnitte (Kennzeichen · Titel · Erklärung · Inhalt) --- */
.f-section { padding: 0; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; transition: box-shadow var(--dur), border-color var(--dur); }
.f-section-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #f6f8f8; border-bottom: 1px solid var(--line-soft); }
.f-section-head .badge { height: 20px; min-width: 24px; font-size: 11px; }
.f-section-text { min-width: 0; flex: 1; }
.f-section-text h4 { margin: 0; font-size: 13px; font-weight: 700; }
.f-section-text p { margin: 1px 0 0; font-size: 11px; color: var(--text-muted); }
.f-section-body { padding: 14px; }
.f-section-head.clickable { cursor: pointer; user-select: none; }
.f-section-head.clickable:hover { background: #eef2f1; }
.f-section-head .chev { width: 16px; height: 16px; margin-left: 4px; color: var(--text-muted); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur); }
.f-section-sum { margin-left: auto; max-width: 55%; font-size: 11px; color: var(--text-muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-section.zu .f-section-body { display: none; }
.f-section.zu .f-section-head { border-bottom: 0; }
.f-section.zu .chev { transform: rotate(-90deg); }
.f-section.focus { border-color: var(--petrol); box-shadow: 0 0 0 3px rgba(46, 107, 99, .14); }

/* --- Schaltflächen, Verweise --- */
.btn.loading { pointer-events: none; opacity: .85; }
.btn .mark { width: 16px; height: 16px; }
button.link { padding: 0; border: 0; background: none; color: var(--petrol-text); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
button.link:hover { color: var(--petrol); }

/* --- Hinweis unten (Toast) --- */
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border-radius: 10px; }
.toast .mark { flex: 0 0 auto; width: 20px; height: 20px; }
.toast.ok .mark { --mark-base: var(--lime); }
.toast.error .mark { --mark-base: #ff7b73; }

/* --- Markenzeichen: Basiskreis (Petrol) · Marker (Lime) · Punkt --- */
.mark { display: inline-block; width: 1em; height: 1em; vertical-align: -.15em; overflow: visible; --mark-base: var(--brand); --mark-accent: var(--lime); }
.mark .base { fill: none; stroke: var(--mark-base); stroke-width: 5; transition: stroke var(--dur-slow); }
.mark .marker { fill: none; stroke: var(--mark-accent); stroke-width: 5; transform-origin: 12px 12px; transform-box: view-box; transition: transform var(--dur-slow) var(--ease), opacity var(--dur); }
.mark .dot { fill: var(--mark-base); transition: fill var(--dur-slow); }
.mark .check { fill: none; stroke: var(--mark-base); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 12; stroke-dashoffset: 12; opacity: 0; }
.mark.is-error { --mark-base: var(--red); }
.mark.is-inactive { --mark-base: var(--gray-mark); }
.mark.is-ok { --mark-base: var(--bar-olive); }
.mark.is-ok .marker { opacity: 0; }
.mark.is-ok .check { opacity: 1; animation: mark-draw .45s var(--ease) forwards; }
.mark.is-loading .marker { animation: mark-orbit 1.1s linear infinite; }
.mark.pulse .marker { animation: mark-pulse 1.6s ease-in-out infinite; }
.mark.look-left .marker { transform: rotate(-28deg); }
.mark.look-right .marker { transform: rotate(40deg); }
@keyframes mark-orbit { to { transform: rotate(360deg); } }
@keyframes mark-draw { to { stroke-dashoffset: 0; } }
@keyframes mark-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .5; transform: scale(1.1); } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-4px); } 40%, 60% { transform: translateX(4px); } }
.shake { animation: shake .5s ease-in-out; }
.ub-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ub-list li { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; }
.ub-list li .mark { flex: 0 0 auto; width: 14px; height: 14px; margin-top: 2px; }

/* --- Login --- */
.dlg-login .dlg-body { padding: 36px 32px 28px; }
.login { display: flex; flex-direction: column; gap: 22px; }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 16px; }
.login-logo { flex: 0 0 auto; width: 72px; height: 72px; filter: drop-shadow(0 8px 16px rgba(15, 106, 99, .18)); }
.login-words { display: flex; flex-direction: column; line-height: 1; }
.login-wordmark { font-size: 24px; font-weight: 800; letter-spacing: .04em; color: var(--brand); }
.login-script { margin-top: 3px; font-family: "Dancing Script", "Segoe Script", "Brush Script MT", cursive; font-size: 27px; font-weight: 500; color: #8c9896; transform: rotate(-4deg); transform-origin: left center; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .seg { display: flex; width: 100%; }
.login-form .seg button { flex: 1; height: 30px; }
.pw-wrap { position: relative; }
.pw-wrap .f-input { padding-right: 42px; }
.pw-toggle { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: #6b7876; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pw-toggle:hover { background: var(--hover-soft); color: var(--petrol-text); }
.pw-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.login-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.login-btn { width: 100%; justify-content: center; height: 42px !important; font-size: 14px !important; }
.login-msg { min-height: 18px; font-size: 12.5px; text-align: center; color: var(--text-muted); transition: color var(--dur); }
.login-msg.error { color: #9a3326; font-weight: 600; }
.login-msg.ok { color: var(--petrol-text); font-weight: 600; }
.login-hint { margin: 0; font-size: 11px; color: var(--text-muted); text-align: center; }

/* --- Design-Regel-Seite --- */
.dr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.dr-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: center; }
.dr-tile .mark { width: 44px; height: 44px; }
.dr-tile b { font-size: 12px; }
.dr-tile span { font-size: 11px; color: var(--text-muted); }
.dr-swatch { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.dr-swatch i { width: 34px; height: 24px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, .08); flex: 0 0 auto; }
.dr-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.dr-steps { margin: 0; padding-left: 20px; font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; }

/* --- Handy: Fenster füllen den Bildschirm, Kopf und Fuß bleiben stehen, nur der Inhalt rollt --- */
@media (max-width: 720px) {
  .dlg-overlay { padding: 0; align-items: stretch; justify-content: stretch; }
  .dlg { width: 100%; max-width: none !important; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; transform: translateY(16px); }
  .dlg-overlay.show .dlg { transform: none; }
  .dlg-head { padding: calc(12px + env(safe-area-inset-top)) 16px 10px; }
  .dlg-nav { padding: 8px 16px 10px; }
  .dlg-body { flex: 1; padding: 14px 16px 24px; }
  .dlg-foot { flex-wrap: wrap; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); }
  .dlg-foot .btn { height: 44px; flex: 1 1 auto; justify-content: center; }
  .dlg-foot .btn:not(.primary):not(.danger) { order: 1; }
  .dlg-foot .btn.primary { order: 2; flex: 2 1 auto; }
  .dlg-foot .btn.danger { order: 3; flex: 1 1 100%; margin-right: 0; background: transparent; border-color: transparent; }
  .f-input, .combo .combo-input { min-height: 44px; font-size: 16px; }
  .combo.compact .combo-input { min-height: 36px; font-size: 14px; }
  .f-check { min-height: 44px; }
  .f-grid.g2, .f-grid.g3, .f-grid.g4 { grid-template-columns: minmax(0, 1fr); }
  .f-grid.pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span2, .span3, .span4 { grid-column: span 1; }
  .f-section-sum { display: none; }
  .dlg-login .dlg-body { display: flex; flex-direction: column; justify-content: center; padding: 48px 24px 28px; }
  .login-logo { width: 60px; height: 60px; }
  .login-wordmark { font-size: 20px; }
  .login-script { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .dlg, .dlg-overlay, .dlg-chip, .f-section, .mark .marker, .mark .check, .mark .base, .mark .dot { transition: none !important; }
  .mark.is-loading .marker, .mark.pulse .marker, .shake, .mark.is-ok .check { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
.dlg-nav { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }

/* --- Abschnittsleiste: Desktop senkrecht links (alle Abschnitte sichtbar), schmale Bildschirme waagrecht zum Wischen (04.10.2026, Rückmeldung des Kunden) --- */
.dlg-main { display: flex; flex: 1 1 auto; min-height: 0; }
.dlg-body { flex: 1 1 auto; min-width: 0; }
.dlg-nav { flex: 0 0 13.5rem; display: flex; flex-direction: column; gap: 4px; padding: 14px 12px 14px var(--dlg-pad); overflow-y: auto; overflow-x: hidden; border-right: 1px solid var(--line-soft); border-bottom: 0; background: #f6f8f8; -webkit-mask-image: none; mask-image: none; }
.dlg-nav .dlg-chip { justify-content: flex-start; height: auto; min-height: 34px; padding: 6px 10px 6px 6px; border-radius: 9px; white-space: normal; text-align: left; line-height: 1.2; }
.dlg-nav .dlg-chip .badge { flex: 0 0 auto; }
.dlg-nav .dlg-chip .dlg-chip-text { min-width: 0; }
.dlg-nav .dlg-chip:hover { transform: none; }
.dlg-nav .dlg-chip.on { box-shadow: var(--shadow-sm); }
@media (max-width: 900px) {
  .dlg-main { flex-direction: column; }
  .dlg-nav { flex: 0 0 auto; flex-direction: row; gap: 6px; padding: 10px var(--dlg-pad) 12px; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line-soft); background: var(--surface); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
  .dlg-nav .dlg-chip { height: 28px; min-height: 0; padding: 0 11px 0 5px; border-radius: 999px; white-space: nowrap; }
}
@media (max-width: 720px) {
  .dlg-nav { padding: 8px 16px 10px; }
}

/* =====================================================================================
   Schriftgrößen, Stufe 1 (04.10.2026): Grundschrift 13,5 px, Nebentexte 12 px, nichts unter 11,5 px, am Handy Beschriftungen 13 px.
   Ausnahme: Zeitblöcke im Wochenkalender am Handy (10 px), dort zählt die Fläche.
   ===================================================================================== */
body { font-size: 13.5px; }
table { font-size: 12.5px; }
thead th { font-size: 12px; }
.pos-table th, .konzept-table th { font-size: 11.5px; }
.konzept-table { font-size: 12.5px; }
.hint { font-size: 12px; }
.count { font-size: 12px; }
.menu .menu-title { font-size: 11.5px; }
.menu label, .menu button, .pop-menu button, .pop-link { font-size: 12.5px; }
.bar-cell small { font-size: 11.5px; }
.drawer-foot { font-size: 11.5px; }
.drawer-sub a { font-size: 13px; }
.badge { font-size: 11px; }
.pop-count { font-size: 11px; }
.main-item .lbl { font-size: 11.5px; }
.sub-item .lbl { font-size: 11.5px; }
.display .d-title { font-size: 13.5px; }
.display .d-meta { font-size: 12.5px; }
.notes b { font-size: 13px; }
.notes span:not(.note-dot), .pop-user span:not(.avatar) { font-size: 12px; }
.empty { font-size: 12.5px; }
.toast { font-size: 13px; }
.small, .muted.small { font-size: 11.5px; }
.loading { font-size: 12.5px; }
.note { font-size: 12px; }
.note.ablauf { font-size: 12.5px; }
.tag { font-size: 11px; }
.toolbar-select, .kw-badge, .seg button { font-size: 12.5px; }
.kpi-label { font-size: 11.5px; }
.kpi-sub { font-size: 12px; }
.kv-label { font-size: 11.5px; }
.kv-value { font-size: 13px; }
.pos-foot, .np-row, .np-row b, .np-sum, .zf-dauer { font-size: 12.5px; }
.zf-budget small { font-size: 12px; }
.combo-item, .ub-list li, .dr-steps, .login-msg { font-size: 13px; }
.combo-hint { font-size: 12px; }
.btn.ghost, button.link, .dr-tile b, .dr-swatch { font-size: 12.5px; }
.login-hint, .dr-tile span { font-size: 11.5px; }
.zcal-dh small, .zcal-blk, .zcal-sel, .zcal-legend { font-size: 11.5px; }
.zcal-h { font-size: 11px; }
/* Fenster */
.dlg-eyebrow { font-size: 11.5px; }
.dlg-head p { font-size: 12.5px; }
.dlg-chip { font-size: 12px; }
.dlg-chip .badge { font-size: 10.5px; }
.f-field > label, .f-section .f-field > label { font-size: 12px; }
.f-field small, .f-field .fehler { font-size: 12px; }
.f-input, .combo .combo-input, .f-check { font-size: 13.5px; }
.combo.compact .combo-input, .f-input.inline, .pos-table td .f-input, .toolbar .combo.toolbar-combo .combo-input { font-size: 12.5px; }
.f-section-text h4 { font-size: 13.5px; }
.f-section-text p { font-size: 12px; }
.f-section-sum { font-size: 11.5px; }
.f-section-head .badge { font-size: 11px; }
@media (max-width: 720px) {
  body { font-size: 14px; }
  table { font-size: 13px; }
  .hint { font-size: 12.5px; }
  .kv-value { font-size: 13.5px; }
  .f-field > label, .f-section .f-field > label { font-size: 13px; }
  .f-field small, .f-field .fehler { font-size: 12px; }
  .dlg-chip { font-size: 12.5px; }
  .f-section-text h4 { font-size: 14px; }
  .f-section-text p { font-size: 12.5px; }
  .f-check { font-size: 14px; }
  .zcal-blk { font-size: 10px; }
  .zcal-dh b { font-size: 10.5px; }
}
@media (max-width: 720px) { .f-input, .combo .combo-input { font-size: 16px; } .combo.compact .combo-input { font-size: 14px; } }
/* Feinschliff nach Schrift-Stufe 1: breiteres großes Fenster, schmälere Leiste, Zusammenfassung statt Hinweis */
.dlg[data-size="l"] { max-width: 62rem; }
.dlg-nav { flex-basis: 12.5rem; }
.f-section-text .f-section-sum { display: block; margin: 1px 0 0; max-width: none; font-size: 12px; color: var(--petrol-text); text-align: left; white-space: normal; overflow: visible; }
.f-section-text .f-section-sum[hidden] { display: none; }
@media (max-width: 720px) { .f-section-sum { display: block; } .f-section-text .f-section-sum[hidden] { display: none; } }
@media (max-width: 900px) { .dlg-nav { flex-basis: auto; } }
