/* BÜROWERK – Aussehen im Flycam-Design (Farben und Schriften wie die Flycam-Verwaltung, Skill flycam-webdesign):
   Nacht/Dämmerung/Fläche, Flycam-Blau, Eisblau, Nebel; Saira Condensed für Überschriften, Montserrat für Text. */

@font-face { font-family: "Montserrat"; font-weight: 400; font-display: swap; src: url("fonts/montserrat-400.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url("fonts/montserrat-600.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700 800; font-display: swap; src: url("fonts/montserrat-800.woff2") format("woff2"); }
@font-face { font-family: "Saira Condensed"; font-weight: 500; font-display: swap; src: url("fonts/saira-condensed-500.woff2") format("woff2"); }
@font-face { font-family: "Saira Condensed"; font-weight: 600 700; font-display: swap; src: url("fonts/saira-condensed-700.woff2") format("woff2"); }
@font-face { font-family: "Saira Condensed"; font-weight: 800 900; font-display: swap; src: url("fonts/saira-condensed-800.woff2") format("woff2"); }

:root {
  --nacht: #0b1220;
  --daemmerung: #111b2e;
  --flaeche: #16223a;
  --blau: #009ee3;
  --eis: #8fd8ff;
  --nebel: #a9b8c9;
  --display: "Saira Condensed", "Arial Narrow", Arial, sans-serif;
  --text-font: "Montserrat", "Segoe UI", Arial, Helvetica, sans-serif;

  --bg: #eef2f7;
  --surface: #ffffff;
  --sunken: #f5f8fb;
  --text: #0e1a2b;
  --muted: #4f5f75;
  --faint: #6a7a90;
  --border: #d9e1ea;
  --border-soft: #e8edf3;
  --shadow: 0 1px 2px rgba(11, 18, 32, .06), 0 4px 16px rgba(11, 18, 32, .05);
  --accent: #0072b0;
  --accent-hover: #005f93;
  --accent-soft: #e1f2fb;
  --on-accent: #ffffff;
  --ok: #166534; --ok-bg: #dcfce7;
  --warn: #8a4100; --warn-bg: #fdf0d5;
  --bad: #a11d1d; --bad-bg: #fde4e4;
  --violet: #5b3fb0; --violet-bg: #ece6fb;
  --gray-bg: #e9edf2;
  --intern-bg: #fff8e1; --intern-border: #f2c94c;
  --side-w: 236px;
  --radius: 10px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: var(--nacht);
  --surface: var(--daemmerung);
  --sunken: #0e1728;
  --text: #e8eef6;
  --muted: var(--nebel);
  --faint: #8596ab;
  --border: #253350;
  --border-soft: #1c2942;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --accent: #27b2ef;
  --accent-hover: #4cc3f6;
  --accent-soft: #0f2d44;
  --on-accent: #04131c;
  --ok: #7ee2a0; --ok-bg: #12301f;
  --warn: #ffc56b; --warn-bg: #3a2a0d;
  --bad: #ff9a9a; --bad-bg: #3d1515;
  --violet: #c4b2ff; --violet-bg: #2a2150;
  --gray-bg: #1f2b43;
  --intern-bg: #2c2610; --intern-border: #8a6d16;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--text-font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, h3 { font-family: var(--display); letter-spacing: .01em; margin: 0; line-height: 1.15; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 12.5px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Grundaufbau ---------- */
.layout { min-height: 100vh; }
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 30;
  background: var(--nacht); color: #fff; display: flex; flex-direction: column;
  border-right: 1px solid rgba(143, 216, 255, .1);
}
.brand { display: flex; flex-direction: column; gap: 6px; padding: 20px 20px 18px; text-decoration: none; color: #fff; }
.brand img { width: 104px; height: auto; display: block; }
.brand b { font-family: var(--display); font-weight: 800; font-size: 25px; letter-spacing: .06em; line-height: 1; }
.brand b span { color: var(--blau); }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 10px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px;
  color: var(--nebel); text-decoration: none; font-weight: 600; font-size: 14px;
}
.nav a svg { width: 19px; height: 19px; flex: none; opacity: .9; }
.nav a:hover { color: #fff; background: rgba(143, 216, 255, .07); }
.nav a[aria-current="page"] { color: #fff; background: var(--flaeche); box-shadow: inset 3px 0 0 var(--blau); }
.nav .badge-count { margin-left: auto; background: var(--blau); color: #04131c; border-radius: 999px; font-size: 11px; padding: 0 7px; font-weight: 700; }
.side-foot { padding: 14px 16px 18px; border-top: 1px solid rgba(143, 216, 255, .1); display: grid; gap: 8px; font-size: 13px; color: var(--nebel); }
.side-foot .who { color: #fff; font-weight: 600; }
.side-foot .row { display: flex; gap: 8px; flex-wrap: wrap; }
.side-foot button { background: transparent; border: 1px solid rgba(143, 216, 255, .25); color: var(--nebel); border-radius: 7px; padding: 4px 10px; cursor: pointer; font-size: 12.5px; }
.side-foot button:hover { color: #fff; border-color: var(--eis); }

.main { margin-left: var(--side-w); min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-soft);
}
.topbar .menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 520px; }
.search input { width: 100%; padding: 9px 12px 9px 36px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.search svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--faint); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); max-height: 70vh; overflow: auto; padding: 6px; z-index: 40;
}
.search-results a { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--text); }
.search-results a:hover, .search-results a.active { background: var(--accent-soft); }
.search-results .type { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); width: 70px; flex: none; }
.quick { position: relative; margin-left: auto; }
.quick-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 190px; z-index: 40; }
.quick-menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; border-radius: 8px; cursor: pointer; }
.quick-menu button:hover { background: var(--accent-soft); }

.page { padding: 24px 28px 48px; max-width: 1500px; }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 600; margin-bottom: 8px; font-size: 13px; }
.back:hover { color: var(--accent); }

/* ---------- Bausteine ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; text-decoration: none; color: var(--text);
  white-space: nowrap; min-height: 38px;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.small { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.icon-btn { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 4px; border-radius: 6px; line-height: 0; }
.icon-btn:hover { color: var(--accent); background: var(--accent-soft); }
.icon-btn svg { width: 18px; height: 18px; }

.card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card > h2, .card > .card-head { margin-bottom: 12px; }
.card-head { display: flex; align-items: center; gap: 8px; }
.card-head h2 { margin: 0; }
.card-head .right { margin-left: auto; display: flex; gap: 6px; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.detail { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
.stack { display: grid; gap: 18px; align-content: start; }
.empty { color: var(--faint); padding: 8px 0; font-size: 13.5px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--nacht); border-color: var(--nacht); color: #fff; }
:root[data-theme="dark"] .chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip .n { opacity: .7; margin-left: 4px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--gray-bg); color: var(--muted); }
.st-anfrage { background: var(--warn-bg); color: var(--warn); }
.st-angebot { background: var(--violet-bg); color: var(--violet); }
.st-bestaetigt { background: var(--accent-soft); color: var(--accent); }
.st-erledigt { background: var(--ok-bg); color: var(--ok); }
.st-abgerechnet { background: var(--gray-bg); color: var(--muted); }
.st-abgesagt { background: var(--bad-bg); color: var(--bad); text-decoration: line-through; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type="search"] { flex: 1; min-width: 180px; max-width: 360px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }

/* Tabellen; auf dem Handy werden Zeilen zu Karten */
.table-wrap { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--sunken); }
table.list td { padding: 11px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr.click { cursor: pointer; }
table.list tbody tr.click:hover td { background: var(--accent-soft); }
table.list .title-cell { font-weight: 600; }
table.list .sub { color: var(--faint); font-size: 12.5px; font-weight: 400; }

/* Listen in Karten */
.rows { display: grid; }
.rows > .r { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.rows > .r:last-child { border-bottom: 0; }
.rows > .r.click { cursor: pointer; }
.rows > .r.click:hover .r-title { color: var(--accent); }
.r-main { flex: 1; min-width: 0; }
.r-title { font-weight: 600; overflow-wrap: anywhere; }
.r-sub { color: var(--faint); font-size: 12.5px; }
.r-side { text-align: right; flex: none; font-size: 13px; color: var(--muted); }
.when { flex: none; width: 58px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); font-size: 13px; padding-top: 1px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 6px; }

.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 6px 14px; margin: 0; }
.kv dt { color: var(--faint); font-size: 13px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv select { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); max-width: 100%; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.intern { background: var(--intern-bg); border: 1px solid var(--intern-border); }
.intern-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--warn); }

/* Kennzahlen im Dashboard */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; text-decoration: none; color: var(--text); display: block; }
.kpi:hover { border-color: var(--accent); }
.kpi .v { font-family: var(--display); font-size: 34px; font-weight: 800; line-height: 1.1; }
.kpi .l { color: var(--muted); font-size: 13px; font-weight: 600; }
.kpi.hot .v { color: var(--blau); }
.hello { background: linear-gradient(120deg, var(--nacht), var(--flaeche)); color: #fff; border-radius: 14px; padding: 22px 24px; margin-bottom: 18px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.hello h1 { color: #fff; }
.hello .sub { color: var(--nebel); margin-top: 4px; }
.hello .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.hello .btn { background: rgba(255, 255, 255, .08); border-color: rgba(143, 216, 255, .3); color: #fff; }
.hello .btn:hover { border-color: var(--eis); color: #fff; background: rgba(255, 255, 255, .14); }
.day-label { font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--muted); margin: 10px 0 2px; text-transform: none; }
.day-label.today { color: var(--blau); }

/* Checkliste und Aufgaben */
.check { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--border-soft); }
.check:last-child { border-bottom: 0; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; cursor: pointer; }
.check.done .r-title { text-decoration: line-through; color: var(--faint); font-weight: 400; }
.check .icon-btn { margin-left: auto; }
.overdue { color: var(--bad); font-weight: 700; }
.add-line { display: flex; gap: 8px; margin-top: 10px; }
.add-line input, .add-line textarea { flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); min-width: 0; }

/* Dateien */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.file { border: 1px solid var(--border-soft); border-radius: 8px; overflow: hidden; text-decoration: none; color: var(--text); background: var(--sunken); display: flex; flex-direction: column; position: relative; }
.file .thumb { height: 86px; display: grid; place-items: center; background: var(--gray-bg); color: var(--faint); font-family: var(--display); font-weight: 800; font-size: 18px; }
.file .thumb img { width: 100%; height: 100%; object-fit: cover; }
.file .name { padding: 6px 8px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file.hidden-file { opacity: .45; }
.file .icon-btn { position: absolute; top: 4px; right: 4px; background: var(--surface); }

/* Verlauf */
.note { padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.note:last-child { border-bottom: 0; }
.note .meta { font-size: 12px; color: var(--faint); display: flex; gap: 8px; align-items: center; }
.note.system .pre { color: var(--muted); font-style: italic; }
.note.hidden-note { opacity: .45; }

/* ---------- Kalender ---------- */
.cal-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.cal-bar h2 { font-size: 24px; min-width: 200px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 7px 12px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--nacht); color: #fff; }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--border-soft); gap: 1px; border: 1px solid var(--border-soft); border-radius: var(--radius); overflow: hidden; }
.month .wd { background: var(--sunken); padding: 6px 8px; font-size: 12px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.month .cell { background: var(--surface); min-height: 112px; padding: 4px 4px 6px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.month .cell.other { background: var(--sunken); }
.month .cell.other .dn { color: var(--faint); }
.month .cell:hover { background: var(--accent-soft); }
.month .cell.selected { box-shadow: inset 0 0 0 2px var(--accent); }
.dn { font-weight: 700; font-size: 13px; padding: 2px 4px; align-self: flex-start; border-radius: 999px; min-width: 24px; text-align: center; }
.cell.today .dn { background: var(--blau); color: #04131c; }
.ev { font-size: 12px; line-height: 1.3; padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; border-left: 3px solid var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 14%, var(--surface)); color: var(--text); }
.ev:hover { filter: brightness(.95); }
.ev .t { font-weight: 700; margin-right: 4px; font-variant-numeric: tabular-nums; }
.ev.job { --c: var(--blau); background: color-mix(in srgb, var(--blau) 22%, var(--surface)); font-weight: 600; }
.ev.cancelled { text-decoration: line-through; opacity: .6; }
.more { font-size: 11.5px; color: var(--faint); padding: 0 6px; }
.week { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); border: 1px solid var(--border-soft); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.week .wh { padding: 6px; text-align: center; font-weight: 700; font-size: 13px; border-bottom: 1px solid var(--border); background: var(--sunken); border-left: 1px solid var(--border-soft); }
.week .wh.today { color: var(--blau); }
.week .allday { border-left: 1px solid var(--border-soft); border-bottom: 1px solid var(--border); padding: 3px; display: flex; flex-direction: column; gap: 2px; min-height: 28px; background: var(--sunken); }
.week .hours { position: relative; }
.week .hl { height: 44px; font-size: 11px; color: var(--faint); text-align: right; padding: 0 6px; border-top: 1px solid var(--border-soft); }
.week .col { position: relative; border-left: 1px solid var(--border-soft); background-image: repeating-linear-gradient(to bottom, var(--border-soft) 0 1px, transparent 1px 44px); cursor: pointer; }
.week .col.today { background-color: color-mix(in srgb, var(--blau) 5%, transparent); }
.week .tev { position: absolute; left: 3px; right: 3px; border-radius: 6px; padding: 3px 6px; font-size: 12px; overflow: hidden; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 18%, var(--surface)); cursor: pointer; line-height: 1.25; }
.week .tev b { display: block; font-variant-numeric: tabular-nums; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 2; pointer-events: none; }
.agenda .day-label:first-child { margin-top: 0; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.cal-legend span { display: inline-flex; gap: 6px; align-items: center; }
.cal-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); display: inline-block; }

/* ---------- Dialoge und Formulare ---------- */
dialog.dlg { border: 0; border-radius: 14px; padding: 0; width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
dialog.dlg.wide { width: min(860px, calc(100vw - 24px)); }
dialog.dlg::backdrop { background: rgba(11, 18, 32, .55); }
.dlg form { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border-soft); }
.dlg-head h2 { flex: 1; }
.dlg-body { padding: 16px 20px; overflow-y: auto; }
.dlg-foot { display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border-soft); flex-wrap: wrap; }
.dlg-foot .spacer { flex: 1; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.field > span .req { color: var(--bad); }
.field input:not([type="checkbox"]), .field select, .field textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); min-height: 40px;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .add-line input:focus, .search input:focus, .toolbar input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 0; border-color: var(--accent); }
.field .hint { font-size: 12px; color: var(--faint); }
.field.check-field { flex-direction: row; align-items: center; gap: 8px; padding-top: 18px; }
.field.check-field input { width: 18px; height: 18px; accent-color: var(--accent); }
.field.check-field > span { font-size: 14px; color: var(--text); font-weight: 600; }
.dt { display: flex; gap: 6px; }
.dt input[type="date"] { flex: 1.4; }
.dt input[type="time"] { flex: 1; }
.section-title { grid-column: 1 / -1; font-family: var(--display); font-weight: 700; font-size: 15px; color: var(--faint); border-top: 1px solid var(--border-soft); padding-top: 10px; margin-top: 4px; }
.form-error { color: var(--bad); background: var(--bad-bg); padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; }

#toast { position: fixed; left: 50%; bottom: 24px; translate: -50% 0; z-index: 100; display: grid; gap: 8px; pointer-events: none; }
#toast div { background: var(--nacht); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); font-weight: 600; pointer-events: auto; max-width: calc(100vw - 32px); }
#toast div.err { background: #a11d1d; }

/* ---------- Anmeldung ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 20% 0%, var(--flaeche), var(--nacht)); }
.login { width: min(400px, 100%); background: var(--daemmerung); color: #fff; border: 1px solid rgba(143, 216, 255, .15); border-radius: 16px; padding: 28px; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.login .brand { padding: 0 0 18px; }
.login label { display: grid; gap: 4px; margin-bottom: 12px; color: var(--nebel); font-size: 13px; font-weight: 600; }
.login input[type="email"], .login input[type="password"] { padding: 11px 12px; border-radius: 8px; border: 1px solid rgba(143, 216, 255, .25); background: var(--nacht); color: #fff; }
.login .remember { display: flex; gap: 8px; align-items: center; }
.login button { width: 100%; margin-top: 6px; background: var(--blau); border: 0; color: #04131c; padding: 12px; border-radius: 8px; font-weight: 800; cursor: pointer; }
.login .err { color: #ffb4b4; min-height: 20px; font-size: 13px; }

/* ---------- Einstellungen ---------- */
.settings-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.qr { background: #fff; padding: 10px; border-radius: 10px; display: inline-block; line-height: 0; }
.qr svg { width: 168px; height: 168px; }
.copy-line { display: flex; gap: 8px; }
.copy-line input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--sunken); font-size: 12.5px; }
.steps { margin: 6px 0 0; padding-left: 20px; }
.steps li { margin: 3px 0; }

/* ---------- Handy ---------- */
.tabbar { display: none; }
@media (max-width: 1100px) {
  .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .side { translate: -100% 0; transition: translate .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  body.menu-open .side { translate: 0 0; }
  body.menu-open::after { content: ""; position: fixed; inset: 0; background: rgba(11, 18, 32, .5); z-index: 25; }
  .main { margin-left: 0; padding-bottom: 72px; }
  .topbar { padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); }
  .topbar .menu-btn { display: inline-flex; }
  .quick .label { display: none; }
  .page { padding: 16px 14px 32px; }
  h1 { font-size: 24px; }
  .grid.two, .grid.three, .grid.detail { grid-template-columns: minmax(0, 1fr); }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: 118px minmax(0, 1fr); }
  .hello { padding: 18px; }
  .hello .actions { margin-left: 0; }
  table.list thead { display: none; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; }
  table.list tr { padding: 10px 14px; border-bottom: 1px solid var(--border-soft); }
  table.list td { padding: 1px 0; border: 0; }
  table.list td.hide-m { display: none; }
  table.list td[data-l]::before { content: attr(data-l) ": "; color: var(--faint); font-size: 12px; }
  table.list .num { text-align: left; }
  .month .cell { min-height: 58px; }
  .month .ev { font-size: 0; padding: 0; height: 6px; border-left-width: 0; border-radius: 3px; background: var(--c, var(--accent)); }
  .month .ev.job { background: var(--blau); }
  .month .more { display: none; }
  .month .wd { padding: 4px 2px; text-align: center; font-size: 11px; }
  .cal-bar h2 { min-width: 0; font-size: 20px; flex-basis: 100%; order: -1; }
  dialog.dlg, dialog.dlg.wide { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
  .dlg form { max-height: 100dvh; height: 100%; }
  .dlg-body { flex: 1; }
  .tabbar {
    display: flex; position: fixed; inset: auto 0 0 0; z-index: 22; background: var(--nacht);
    border-top: 1px solid rgba(143, 216, 255, .12); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; color: var(--nebel); text-decoration: none; font-size: 11px; font-weight: 600; background: none; border: 0; cursor: pointer; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--blau); }
}

@media print {
  .side, .topbar, .tabbar, .actions, .btn, .icon-btn { display: none !important; }
  .main { margin: 0; }
  body { background: #fff; color: #000; }
  .card, .table-wrap { box-shadow: none; border-color: #ccc; }
}
.loading { padding: 40px; }
