:root {
  /* LiftTec Corporate Design: Logofarbe dunkel #283C81, hell #5A68D3, Akzent #3333CC / #6666FF, Arial */
  --brand-dark: #283C81;
  --brand-light: #5A68D3;
  --brand-tint: #eef0fb;
  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --text: #1b2033;
  --muted: #5f6680;
  --border: #dde0ec;
  --primary: #283C81;
  --primary-2: #3333CC;
  --accent: #5A68D3;
  --ok: #1f8a4c;
  --ok-bg: #e5f5ec;
  --warn: #9a6400;
  --warn-bg: #fff3dc;
  --err: #b42318;
  --err-bg: #fdeceb;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --font: Arial, "Helvetica Neue", Helvetica, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1120; --surface: #161b2e; --surface-2: #1c2238; --text: #e6e8f2; --muted: #9aa0ba;
    --border: #2b3150; --primary: #8f9be6; --primary-2: #9999ff; --accent: #6f7ce0; --brand-tint: #232a4a;
    --ok-bg: #12301f; --warn-bg: #33270d;
    --err-bg: #3a1714; --ok: #5bd18d; --warn: #f0b955; --err: #ff8a80;
    --shadow: 0 1px 3px rgba(0,0,0,.4);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--font); background: var(--bg); color: var(--text); }
a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 16px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--err); }
.pos { color: var(--ok); }

/* Layout */
.app { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px; position: sticky; top: 0;
  height: 100vh; display: flex; flex-direction: column; overflow-y: auto; }
.brand-logo { display: block; padding: 6px 10px 16px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.brand-logo:hover { text-decoration: none; }
.brand-logo img { width: 100%; max-width: 200px; height: auto; display: block; }
.brand-logo span { display: block; margin-top: 8px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav svg { width: 18px; height: 18px; flex: none; }
.nav-top, .nav-group > summary { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: var(--text); font-weight: 700; cursor: pointer; list-style: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-section { margin: 14px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); }
.nav-top:hover, .nav-group > summary:hover { background: var(--surface-2); text-decoration: none; }
.nav-top svg, .nav-group > summary svg { color: var(--brand-light); }
.nav-top.active { background: var(--brand-tint); color: var(--brand-dark); box-shadow: inset 3px 0 0 var(--brand-light); }
.nav-group.is-active > summary { color: var(--brand-dark); }
.nav-group > summary .chev { margin-left: auto; width: 14px; height: 14px; color: var(--muted); transition: transform .15s; }
.nav-group[open] > summary .chev { transform: rotate(90deg); }
.nav-group > summary .nav-badge + .chev { margin-left: 6px; }
.nav-sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 8px 19px; padding-left: 10px;
  border-left: 1px solid var(--border); }
.nav-sub a { display: flex; align-items: center; padding: 6px 10px; border-radius: 6px; color: var(--muted); font-size: 13.5px; }
.nav-sub a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-sub a.active { background: var(--brand-tint); color: var(--brand-dark); font-weight: 700;
  box-shadow: inset 3px 0 0 var(--brand-light); }
.sidebar .foot { margin-top: auto; font-size: 12px; color: var(--muted); padding: 14px 10px 4px; border-top: 1px solid var(--border);
  line-height: 1.7; }
.sidebar .foot a { color: var(--primary-2); }
@media (prefers-color-scheme: dark) {
  .brand-logo img { background: #fff; border-radius: 10px; padding: 10px 14px; box-sizing: border-box; }
  .nav-top.active, .nav-sub a.active, .nav-group.is-active > summary { color: #fff; }
}
.main { padding: 24px 32px 48px; min-width: 0; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px;
  flex-wrap: wrap; }

/* Cards & grid */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2 { padding: 16px 20px 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); }
.kpi .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--muted); font-size: 12px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th, table.t td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
table.t th { background: var(--surface-2); font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase;
  letter-spacing: .03em; white-space: nowrap; position: sticky; top: 0; }
table.t tbody tr:hover { background: var(--surface-2); }
table.t tfoot td { font-weight: 700; background: var(--surface-2); }
table.t td.actions { white-space: nowrap; text-align: right; }
tr.weekend td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }

/* Forms */
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary-2) 40%, transparent);
  border-color: var(--primary-2); }
input[type=checkbox] { width: auto; }
textarea { min-height: 80px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-4 { grid-column: 1 / -1; }
.inline-form { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.inline-form > div { min-width: 90px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); font-size: 14px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 16px; margin: 0 0 16px; }
legend { font-weight: 700; padding: 0 6px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, var(--border)); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
button.link { background: none; border: none; color: var(--err); cursor: pointer; font: inherit; padding: 0; }

/* Badges & alerts */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.err { background: var(--err-bg); color: var(--err); border-color: transparent; }
.badge.info { background: color-mix(in srgb, var(--primary-2) 14%, transparent); color: var(--primary-2); border-color: transparent; }
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid transparent; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.error { background: var(--err-bg); color: var(--err); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert.info { background: var(--brand-tint); color: var(--brand-dark); border-color: color-mix(in srgb, var(--brand-light) 30%, transparent); }
@media (prefers-color-scheme: dark) { .alert.info { background: color-mix(in srgb, var(--brand-light) 15%, transparent); color: var(--text); } }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 600; }
.tabs a.active { color: var(--primary-2); border-bottom-color: var(--primary-2); }
.tabs a:hover { text-decoration: none; color: var(--text); }

/* Month picker */
.monthpick { display: flex; gap: 6px; align-items: center; }
.monthpick select { width: auto; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { border-left: 3px solid var(--border); padding: 4px 0 14px 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 9px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--primary-2); }
.timeline .meta { font-size: 12px; color: var(--muted); }
.timeline .text { white-space: pre-wrap; }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #283C81, #5A68D3); padding: 16px; }
.auth .card { width: 100%; max-width: 400px; }
.auth .brand { color: var(--text); padding: 0 0 18px; }

details.edit summary { cursor: pointer; color: var(--primary-2); list-style: none; }
details.edit summary::-webkit-details-marker { display: none; }
details.edit[open] { background: var(--surface-2); }
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 26px; text-align: center; background: var(--surface-2); }
.dropzone.drag { border-color: var(--primary-2); background: color-mix(in srgb, var(--primary-2) 8%, var(--surface)); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; overflow-x: auto; }

.nav-toggle { display: none; align-items: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 600;
  color: var(--brand-dark); background: var(--brand-tint); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; cursor: pointer; }
.nav-toggle svg { width: 18px; height: 18px; }
@media (prefers-color-scheme: dark) { .nav-toggle { color: var(--text); background: var(--surface-2, transparent); } }
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 10px; }
  .brand-logo { border-bottom: 0; padding-bottom: 6px; }
  .brand-logo img { max-width: 150px; }
  .nav-sub { margin-left: 12px; }
  .sidebar .foot { display: none; }
  .sidebar { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .sidebar .nav { grid-column: 1 / -1; display: none; padding-top: 8px; }
  .sidebar.menu-open .nav { display: flex; }
  .nav-toggle { display: inline-flex; }
  .main { padding: 16px; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
}
@media print {
  .sidebar, .btn, form, .tabs { display: none !important; }
  .app { display: block; }
  .card { box-shadow: none; }
}

/* Navigation-Zähler (offene Genehmigungen) */
.nav-badge { margin-left: auto; background: var(--brand-light); color: #fff; border-radius: 999px; font-size: 11px;
  font-weight: 800; padding: 1px 7px; }
@media (max-width: 800px) { .nav-badge { margin-left: -6px; } }

/* Gesperrte Einträge & Änderungsvergleich */
.lock { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.lock svg { width: 13px; height: 13px; }
table.diff td.old { color: var(--err); text-decoration: line-through; }
table.diff td.new { color: var(--ok); font-weight: 600; }
.request { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px;
  background: var(--surface); }
.request .head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.integrity { display: flex; gap: 10px; align-items: center; }
.changes { margin: 4px 0 0; padding: 0; list-style: none; font-size: 12px; }
.changes li { color: var(--muted); }
.changes .old { color: var(--err); }
.changes .new { color: var(--ok); }
[data-au-only][hidden] { display: none !important; }

/* ---------------------------------------------------------- Mitarbeiter-Dashboard */
:root {
  --viz-1: #2a78d6;        /* Ist-Stunden, Urlaub, Mehrstunden (blau) */
  --viz-1-soft: #86b6ef;   /* geplant / laufend */
  --viz-2: #eb6834;        /* Krank (orange) */
  --viz-2-alt: #b8461a;    /* Schraffur Kind krank */
  --viz-3: #1baf7a;        /* sonstige Freistellung (aqua) */
  --viz-neg: #e34948;      /* Minusstunden (rot) */
  --viz-neutral: #d6d4ce;  /* Feiertag */
  --viz-grid: #e7e5e0;
  --viz-axis: #a8a6a0;
  --viz-ink: #52514e;
  --viz-track: #ecebe7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --viz-1: #3987e5; --viz-1-soft: #184f95; --viz-2: #d95926; --viz-2-alt: #9c3a12; --viz-3: #199e70; --viz-neg: #e66767;
    --viz-neutral: #4a4945; --viz-grid: #2a3644; --viz-axis: #5b6878; --viz-ink: #c3c2b7; --viz-track: #2a3644;
  }
}
.dash-kpis { margin-bottom: 18px; }
.kpi .unit { font-size: 14px; font-weight: 600; color: var(--muted); }
.meter { display: flex; gap: 2px; height: 8px; margin: 10px 0 8px; border-radius: 4px; overflow: hidden; background: var(--surface); }
.meter .seg { min-width: 3px; }
.meter .taken { background: var(--viz-1); }
.meter .planned { background: var(--viz-1-soft); }
.meter .rest { background: var(--viz-track); }
.key { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: 0; }
.key.taken { background: var(--viz-1); }
.key.planned { background: var(--viz-1-soft); }

.viz-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.viz-head h2 { margin: 0; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.sw.line-soll { height: 2px; width: 14px; background: var(--viz-ink); border-radius: 1px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--viz-grid); stroke-width: 1; }
.chart .axis-line { stroke: var(--viz-axis); stroke-width: 1; }
.chart .tick { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.chart .muted-tick { opacity: .45; }
.bar-ist, .sw.bar-ist { fill: var(--viz-1); background: var(--viz-1); }
.bar-run, .sw.bar-run { fill: var(--viz-1-soft); background: var(--viz-1-soft); }
.bar-plus, .sw.bar-plus { fill: var(--viz-1); background: var(--viz-1); }
.bar-minus, .sw.bar-minus { fill: var(--viz-neg); background: var(--viz-neg); }
.chart .line-soll { stroke: var(--viz-ink); stroke-width: 2; stroke-linecap: round; }
.chart .hit { fill: transparent; cursor: default; outline: none; }
.chart .hit.is-hover, .chart .hit:focus-visible { fill: var(--viz-grid); fill-opacity: .45; }
.viz-tip { position: fixed; z-index: 50; display: none; pointer-events: none; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.16); padding: 8px 10px; font-size: 12px; line-height: 1.5; }
.viz-tip strong { display: block; margin-bottom: 2px; }

.dash-cal-grid { grid-template-columns: minmax(0, 3fr) minmax(260px, 1fr); }
.year-cal { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 18px; }
.cal-name { font-weight: 700; font-size: 12px; margin-bottom: 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { font-size: 9px; text-align: center; color: var(--muted); }
.cal-day { font-size: 10px; text-align: center; line-height: 18px; border-radius: 3px; color: var(--text); font-variant-numeric: tabular-nums; }
.cal-wochenende, .cal-aus { color: var(--muted); opacity: .55; }
.cal-urlaub, .sw.cal-urlaub { background: var(--viz-1); color: #fff; }
.cal-urlaub.planned, .sw.cal-urlaub.planned { background: var(--viz-1-soft); color: var(--text); }
.cal-krank, .sw.cal-krank { background: var(--viz-2); color: #fff; }
.cal-frei, .sw.cal-frei { background: var(--viz-3); color: #fff; }
/* Kind krank: Krank-Farbe mit Schraffur – unterscheidbar auch ohne Farbsehen */
.cal-kindkrank, .sw.cal-kindkrank { background: repeating-linear-gradient(135deg, var(--viz-2) 0 3px, var(--viz-2-alt) 3px 5px); color: #fff; }
.cal-feiertag, .sw.cal-feiertag { background: var(--viz-neutral); color: var(--text); }
.cal-day.today { outline: 2px solid var(--text); outline-offset: -1px; font-weight: 800; }
.cal-day.is-hover { filter: brightness(1.1); }
@media (max-width: 1100px) { .year-cal { grid-template-columns: repeat(3, minmax(0, 1fr)); } .dash-cal-grid { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .year-cal { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media print { .viz-tip { display: none !important; } }

/* ---------------------------------------------------------- Urlaub: Teamkalender */
.team-cal { border-collapse: separate; border-spacing: 2px; font-size: 11px; min-width: 100%; }
.team-cal th { font-weight: 600; color: var(--muted); text-align: center; min-width: 20px; line-height: 1.2; padding: 2px 0; }
.team-cal th div { font-size: 9px; font-weight: 400; }
.team-cal th.we { opacity: .55; }
.team-cal th.today { color: var(--text); box-shadow: inset 0 -2px 0 var(--text); }
.team-cal .name { text-align: left; white-space: nowrap; padding-right: 10px; min-width: 140px; font-size: 13px; }
.team-cal td.cell { height: 22px; border-radius: 3px; background: var(--surface-2); }
.team-cal td.cal-wochenende { background: transparent; }
.team-cal td.cal-aus { background: transparent; opacity: .3; }
.team-cal tr.sum td { padding-top: 4px; color: var(--muted); }
.cal-antrag, .sw.cal-antrag { background: repeating-linear-gradient(135deg, var(--viz-1-soft) 0 3px, transparent 3px 6px);
  box-shadow: inset 0 0 0 1px var(--viz-1-soft); }
.team-cal td.is-hover { outline: 2px solid var(--text); outline-offset: -1px; }
.team-cal td.cal-urlaub { background: var(--viz-1); }
.team-cal td.cal-krank { background: var(--viz-2); }
.team-cal td.cal-frei { background: var(--viz-3); }
.team-cal td.cal-kindkrank { background: repeating-linear-gradient(135deg, var(--viz-2) 0 3px, var(--viz-2-alt) 3px 5px); }
.team-cal td.cal-feiertag { background: var(--viz-neutral); }
.team-cal td.cal-antrag { background: repeating-linear-gradient(135deg, var(--viz-1-soft) 0 3px, transparent 3px 6px);
  box-shadow: inset 0 0 0 1px var(--viz-1-soft); }

/* ---------------------------------------------------------- Mitarbeiterzugang (Portal) */
body.portal { background: var(--bg); }
.portal-top { background: #283C81; color: #fff; position: sticky; top: 0; z-index: 20; }
.portal-bar { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; gap: 12px; }
.portal-bar .brand { padding: 0; font-size: 18px; }
.portal-user { font-size: 13px; color: #d9e6f0; text-align: right; }
.portal-user a { color: #fff; text-decoration: underline; }
.portal-nav { max-width: 1100px; margin: 0 auto; display: flex; gap: 2px; padding: 0 10px; overflow-x: auto; }
.portal-nav a { color: #d9e6f0; padding: 10px 14px; border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 600; }
.portal-nav a:hover { text-decoration: none; color: #fff; }
.portal-nav a.active { color: #fff; border-bottom-color: var(--accent); }
.portal-main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 48px; }
.portal-kpis { margin-bottom: 18px; }
.link-kpi { color: inherit; display: block; }
.link-kpi:hover { text-decoration: none; border-color: var(--primary-2); }
.portal-popover { position: absolute; right: 16px; z-index: 5; width: min(420px, calc(100vw - 32px)); padding: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); text-align: left; white-space: normal; }
@media (max-width: 800px) {
  .portal-main .grid-2, .portal-main .grid-4 { grid-template-columns: 1fr; }
  .portal-main .portal-kpis { grid-template-columns: 1fr 1fr; }
  .portal-main .kpi .value { font-size: 20px; }
  .portal-user { font-size: 12px; }
}

/* ---------------------------------------------------------- Entgelt: Monatswerte */
.result-row { display: grid; grid-template-columns: repeat(6, minmax(90px, 1fr)) minmax(120px, 1.5fr) auto; gap: 6px; align-items: center; }
.result-row input { padding: 5px 7px; text-align: right; font-variant-numeric: tabular-nums; }
.result-row input.note { text-align: left; }
.result-row.sum span { padding: 0 8px; }
.result-row.head span { white-space: normal; line-height: 1.2; }
.result-row.head span:last-child { width: 78px; }

/* ---------------------------------------------------------- Statistik */
.bar-net, .sw.bar-net { fill: var(--viz-2); background: var(--viz-2); }
.chart .bar-est { fill: var(--viz-1-soft); fill-opacity: .55; stroke: var(--viz-1); stroke-dasharray: 3 2; stroke-width: 1; }
.calc-line { padding: 3px 2px 0; }
.net-card .t tfoot td { font-size: 15px; }
.chart .bar-net-est, .sw.bar-net-est { fill: var(--viz-2); fill-opacity: .35; stroke: var(--viz-2); stroke-dasharray: 3 2; stroke-width: 1;
  background: repeating-linear-gradient(135deg, var(--viz-2) 0 3px, transparent 3px 6px); }

/* ---------------------------------------------------------- Stempeluhr-Terminal (Kiosk) */
body.terminal { background: linear-gradient(160deg, #283C81, #5A68D3); color: #fff; min-height: 100vh; user-select: none; }
.term-top { display: flex; justify-content: space-between; align-items: center; padding: 18px 28px; }
.term-top .brand { color: #fff; padding: 0; font-size: 22px; }
.term-top .brand small { color: #cfe0ec; }
.term-clock { text-align: right; font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.term-clock small { display: block; font-size: 15px; font-weight: 500; color: #cfe0ec; margin-top: 4px; }
.term-main { display: grid; place-items: center; padding: 10px 16px 40px; }
.term-card { width: min(560px, 100%); background: var(--surface); color: var(--text); border-radius: 18px; padding: 26px 28px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25); text-align: center; }
.term-card h1 { font-size: 26px; margin-bottom: 8px; }
.term-alert { text-align: left; font-size: 16px; }
.term-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; text-align: left; }
.term-fields label { font-size: 13px; }
.term-fields input { font-size: 26px; padding: 12px 14px; letter-spacing: .08em; text-align: center; margin-top: 4px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 16px; }
.keypad-key { font: inherit; font-size: 28px; font-weight: 700; padding: 16px 0; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); cursor: pointer; touch-action: manipulation; }
.keypad-key:active { transform: scale(.97); background: var(--border); }
.term-go { width: 100%; justify-content: center; font-size: 22px; padding: 16px; border-radius: 12px; }
.term-state { font-size: 19px; margin: 10px 0 20px; line-height: 1.5; }
.term-actions { display: grid; gap: 12px; }
.term-btn { font: inherit; font-size: 26px; font-weight: 800; padding: 24px; border-radius: 14px; border: 0; color: #fff; cursor: pointer;
  touch-action: manipulation; }
.term-btn:active { transform: scale(.98); }
.term-kommen { background: #1f8a4c; }
.term-gehen { background: #b42318; }
.term-pause_start, .term-pause_ende { background: #9a6400; }
.term-cancel { margin-top: 14px; }
.term-result .term-icon { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center;
  font-size: 48px; font-weight: 800; color: #fff; }
.term-result.is-ok .term-icon { background: #1f8a4c; }
.term-result.is-error .term-icon { background: #b42318; }
@media (max-width: 600px) { .term-clock { font-size: 30px; } .term-fields { grid-template-columns: 1fr; } }
@media print { .portal-top, .term-top { display: none; } }
.term-logout { position: fixed; bottom: 10px; right: 14px; }
.term-logout button { background: none; border: 0; color: rgba(255,255,255,.45); font: inherit; font-size: 12px; cursor: pointer; }
.term-logout button:hover { color: #fff; text-decoration: underline; }


/* ---------------------------------------------------------- LiftTec CD: Arbeitsschritte & Bereiche */
h1 { color: var(--brand-dark); }
@media (prefers-color-scheme: dark) { h1 { color: var(--text); } }
.card > h2, .card .topbar h2 { color: var(--brand-dark); }
@media (prefers-color-scheme: dark) { .card > h2, .card .topbar h2 { color: var(--text); } }
table.t th { background: var(--brand-tint); color: var(--brand-dark); }
@media (prefers-color-scheme: dark) { table.t th { color: var(--muted); } }
.btn.primary { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.primary:hover { background: var(--primary-2); border-color: var(--primary-2); filter: none; }
.tabs a.active { color: var(--brand-dark); border-bottom-color: var(--brand-light); }
@media (prefers-color-scheme: dark) { .tabs a.active { color: var(--primary); } }

.steps { display: flex; gap: 0; margin: 0 0 18px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.steps a, .steps > span { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: var(--muted);
  border-right: 1px solid var(--border); min-width: 0; }
.steps a:last-child, .steps > span:last-child { border-right: 0; }
.steps a:hover { background: var(--surface-2); text-decoration: none; }
.steps .no { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
  font-size: 13px; border: 2px solid var(--border); color: var(--muted); }
.steps .txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.steps .txt strong { color: var(--text); font-size: 14px; }
.steps .txt small { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps a.active, .steps > span.active { background: var(--brand-tint); box-shadow: inset 0 -3px 0 var(--brand-light); }
.steps a.active .no, .steps > span.active .no { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.steps a.done .no, .steps > span.done .no { background: var(--ok); border-color: var(--ok); color: #fff; }

.section-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.section-nav { position: sticky; top: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.section-nav a { padding: 8px 10px; border-radius: 6px; color: var(--text); font-size: 13.5px; }
.section-nav a:hover { background: var(--surface-2); text-decoration: none; }
.section-nav a.active { background: var(--brand-tint); color: var(--brand-dark); font-weight: 700; box-shadow: inset 3px 0 0 var(--brand-light); }
.section-nav .hint { font-size: 11px; color: var(--muted); padding: 6px 10px 2px; text-transform: uppercase; letter-spacing: .05em; }
.page-intro { color: var(--muted); margin: -12px 0 18px; max-width: 900px; }
@media (max-width: 1000px) { .section-layout { grid-template-columns: 1fr; } .section-nav { position: static; flex-direction: row; flex-wrap: wrap; } }
@media (max-width: 800px) { .steps { flex-direction: column; } .steps a, .steps > span { border-right: 0; border-bottom: 1px solid var(--border); } }

/* Logo auf Login, Mitarbeiterzugang und Terminal */
.auth-brand { text-align: center; padding: 4px 0 18px; }
.auth-brand img { width: 230px; max-width: 100%; height: auto; }
.auth-brand span { display: block; margin-top: 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); }
@media (prefers-color-scheme: dark) { .auth-brand img { background: #fff; border-radius: 10px; padding: 12px 16px; box-sizing: border-box; } }
.logo-plate { display: inline-flex; align-items: center; gap: 14px; background: #fff; border-radius: 10px; padding: 9px 16px; }
.logo-plate:hover { text-decoration: none; }
.logo-plate img { height: 30px; width: auto; display: block; }
.logo-plate span { color: var(--brand-dark); font-weight: 700; font-size: 13px; border-left: 1px solid #dde0ec; padding-left: 12px; }
.term-top .logo-plate img { height: 38px; }
@media (max-width: 600px) { .logo-plate span { display: none; } .logo-plate img { height: 24px; } }

/* Bewerber: Ablauf-Leiste, Pipeline (Kanban), Sterne */
.steps-wide > span { padding: 10px 12px; }
.steps-wide .txt strong { font-size: 13px; }
.board { display: grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.board-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 140px; }
.board-col > header { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 13px;
  color: var(--brand-dark); margin-bottom: 8px; }
.board-card { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--brand-light);
  border-radius: 8px; padding: 10px; margin-bottom: 8px; box-shadow: var(--shadow); display: grid; gap: 3px; }
.board-name { font-weight: 700; }
.board-card .badge { white-space: normal; }
.board-move select { font-size: 12px; padding: 4px 6px; margin-top: 4px; }
.board-empty { text-align: center; margin: 18px 0; }
.stars { color: #c99a06; letter-spacing: 1px; }
table.kv th { width: 34%; text-transform: none; letter-spacing: 0; font-size: 13px; }
ol.next-steps { margin: 0 0 4px; padding-left: 20px; }
ol.next-steps li { margin: 4px 0; }
.timeline li.tl-open::before { background: var(--brand-light); border-color: var(--brand-light); }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::before { content: "▸ "; color: var(--muted); }
details.card[open] > summary::before { content: "▾ "; }

/* Briefe: Editor mit Platzhalter-Leiste und Vorschau */
.letter-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.letter-paper textarea.letter-body { min-height: 320px; font-size: 14.5px; line-height: 1.55; }
.letter-paper textarea.letter-address { min-height: 96px; font-family: inherit; }
.ph-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-list button { font: inherit; font-size: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--brand-dark);
  border-radius: 999px; padding: 3px 9px; cursor: pointer; }
.ph-list button:hover { border-color: var(--brand-light); background: var(--brand-tint); }
.pdf-frame { width: 100%; height: 78vh; min-height: 520px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.pick-list { max-height: 360px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.pick-list label { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--border); cursor: pointer; margin: 0; font-weight: 400; }
.pick-list label:last-child { border-bottom: 0; }
.pick-list label:hover { background: var(--surface-2); }
.pick-list input { width: auto; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.choice { display: block; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); color: var(--text); }
.choice:hover { border-color: var(--brand-light); text-decoration: none; background: var(--brand-tint); }
.choice.active { border-color: var(--brand-dark); box-shadow: inset 0 0 0 1px var(--brand-dark); background: var(--brand-tint); }
.choice strong { display: block; color: var(--brand-dark); }
@media (prefers-color-scheme: dark) { .choice strong, .board-col > header { color: var(--text); } .ph-list button { color: var(--text); } }
@media (max-width: 1000px) { .letter-layout { grid-template-columns: 1fr; } .choice-grid { grid-template-columns: 1fr; } }

/* Qualifikationsmatrix: senkrechte Spaltenköpfe */
table.matrix th.rot { height: 215px; vertical-align: bottom; padding: 6px 4px; white-space: nowrap; }
table.matrix th.rot span { writing-mode: vertical-rl; transform: rotate(180deg); display: inline-block; max-height: 205px;
  overflow: hidden; text-overflow: ellipsis; text-transform: none; letter-spacing: 0; font-size: 12px; }
table.matrix td.c { text-align: center; padding: 6px 4px; }
table.matrix td.c .badge { font-size: 11px; padding: 2px 6px; }

/* Ein-/Austritt: Fortschritt und Checklistenpunkte */
.progress { height: 8px; border-radius: 4px; background: var(--viz-track, var(--border)); overflow: hidden; min-width: 120px; }
.progress > span { display: block; height: 100%; background: var(--brand-light); border-radius: 4px; }
.progress.done > span { background: var(--ok); }
.cl-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: start;
  padding: 12px 16px; border-bottom: 1px solid var(--border); }
.cl-item:last-child { border-bottom: 0; }
.cl-item.erledigt .cl-title { text-decoration: line-through; color: var(--muted); }
.cl-item.entfaellt { opacity: .55; }
.cl-check button { width: 26px; height: 26px; border-radius: 6px; border: 2px solid var(--border); background: var(--surface);
  cursor: pointer; font-weight: 800; color: #fff; line-height: 1; padding: 0; }
.cl-check button.on { background: var(--ok); border-color: var(--ok); }
.cl-check button:hover { border-color: var(--brand-light); }
.cl-title { font-weight: 600; }
.cl-meta { font-size: 12px; color: var(--muted); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cl-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cl-phase { padding: 10px 16px; background: var(--surface-2); font-weight: 700; color: var(--brand-dark); font-size: 13px;
  border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .04em; }
@media (prefers-color-scheme: dark) { .cl-phase { color: var(--text); } }
@media (max-width: 700px) { .cl-item { grid-template-columns: 34px minmax(0, 1fr); } .cl-actions { grid-column: 2; justify-content: flex-start; } }

/* Arbeitszeugnis: Notenauswahl je Kriterium */
.grade-row { display: grid; grid-template-columns: 200px auto minmax(0, 1fr); gap: 6px 14px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border); }
.grade-row:last-child { border-bottom: 0; }
.grade-row .grade-name { font-weight: 600; }
.grade-pick { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.grade-pick label { margin: 0; padding: 6px 10px; cursor: pointer; font-weight: 600; font-size: 13px; border-right: 1px solid var(--border);
  background: var(--surface); }
.grade-pick label:last-child { border-right: 0; }
.grade-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.grade-pick label:has(input:checked) { background: var(--brand-dark); color: #fff; }
.grade-pick label:has(input:focus-visible) { outline: 2px solid var(--brand-light); outline-offset: -2px; }
.grade-sample { font-size: 12.5px; color: var(--muted); font-style: italic; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip-row button { font: inherit; font-size: 12px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 999px;
  padding: 3px 10px; cursor: pointer; color: var(--text); }
.chip-row button:hover { border-color: var(--brand-light); background: var(--brand-tint); }
.zeugnis-text { min-height: 520px; font-size: 14.5px; line-height: 1.6; }
@media (max-width: 800px) { .grade-row { grid-template-columns: 1fr; } }

/* Stichtag-Abrechnung: fiktive und in den Folgemonat verschobene Tage */
tr.row-fictive td { background: color-mix(in srgb, var(--warn, #b7791f) 8%, transparent); font-style: italic; }
tr.row-deferred td { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
tr.row-deferred td:first-child, tr.row-deferred td:nth-child(3) { text-decoration: none; }

/* hidden-Attribut hat immer Vorrang (z. B. vor display: grid) */
[hidden] { display: none !important; }

/* Logo nie verzerren – unabhängig von width/height-Attributen im HTML */
:where(img[src*="logo-lifttec"], img[src*="logo-lt"]) { height: auto; max-width: 100%; }
.logo-plate img[src*="logo-lifttec"] { height: 30px; width: auto; }
.term-top .logo-plate img[src*="logo-lifttec"] { height: 38px; }
@media (max-width: 600px) { .logo-plate img[src*="logo-lifttec"] { height: 24px; } }

.alert code { word-break: break-all; }

/* Benutzerverwaltung & Rechte-Matrix */
.role-select { min-width: 210px; }
table.t td.user-actions { white-space: normal; }
.user-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: flex-start; }
.user-actions form { display: inline; }
.user-actions details.pw-set { position: relative; }
.user-actions details.pw-set[open] > form { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; width: 280px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); text-align: left; }
.rights-matrix { table-layout: fixed; min-width: 640px; }
table.t.rights-matrix th { white-space: normal; text-transform: none; letter-spacing: 0; font-size: 12px; line-height: 1.25; padding: 8px 6px; hyphens: auto; overflow-wrap: anywhere; }
table.t.rights-matrix th:first-child { width: 26%; padding-left: 12px; }
table.t.rights-matrix td { vertical-align: top; padding: 8px 6px; }
table.t.rights-matrix td:first-child { padding-left: 12px; }
.rights-matrix td:first-child .small { font-size: 11px; line-height: 1.3; }
.rights-matrix select { width: 100%; min-width: 0; font-size: 12px; padding: 5px 2px; }

/* Schnittstelle: Rechte der API-Schlüssel */
label.scope-check { align-items: flex-start; margin: 4px 0; }
label.scope-check > span { min-width: 0; flex: 1; }
label.scope-check > span > span { display: block; line-height: 1.35; overflow-wrap: anywhere; }
.err-text { color: var(--err); }

/* Stempeluhr: Personenauswahl und PIN-Bestätigung */
.term-wide { width: min(1100px, 100%); display: grid; gap: 16px; }
.term-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: #fff; }
.term-head h1 { font-size: 28px; margin: 0; color: #fff; }
.term-search { font-size: 20px; padding: 12px 14px; border-radius: 12px; width: min(320px, 100%); }
.term-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.term-person { display: grid; justify-items: center; gap: 6px; padding: 18px 12px; border-radius: 16px; background: var(--surface);
  color: var(--text); text-decoration: none; text-align: center; border: 3px solid transparent; min-height: 150px; align-content: center; }
.term-person:active { transform: scale(.98); }
.term-person:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.term-person[hidden] { display: none; }
.term-avatar { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 800;
  background: var(--brand-tint, #e6e9f7); color: var(--brand-dark, #283C81); flex: none; }
.term-person-name { font-size: 19px; font-weight: 800; line-height: 1.2; }
.term-person-state { font-size: 13px; color: var(--muted); }
.term-person.is-anwesend { border-color: #1f8a4c; }
.term-person.is-anwesend .term-avatar { background: #1f8a4c; color: #fff; }
.term-person.is-pause { border-color: #9a6400; }
.term-person.is-pause .term-avatar { background: #9a6400; color: #fff; }
.term-ident { background: var(--surface); color: var(--text); border-radius: 16px; padding: 14px 18px; display: grid; gap: 10px; }
.term-ident label { font-size: 14px; }
.term-ident input { font-size: 22px; padding: 10px 12px; margin-top: 4px; letter-spacing: .06em; }
.keypad-small .keypad-key { font-size: 22px; padding: 10px 0; }
.term-who { display: flex; gap: 14px; align-items: center; text-align: left; margin-bottom: 6px; }
.term-who h1 { margin: 0; }
.term-who .term-state { margin: 2px 0 0; font-size: 17px; }
.term-pin-label { display: block; text-align: left; font-size: 14px; margin-top: 10px; }
.term-pin { font-size: 32px; padding: 12px 14px; letter-spacing: .4em; text-align: center; margin-top: 4px; }
.term-btn small { display: block; font-size: 14px; font-weight: 600; opacity: .85; margin-top: 2px; }
.term-btn:disabled { opacity: .45; cursor: not-allowed; }
.term-assign { display: block; margin-top: 4px; }
.term-assign-form { display: grid; gap: 6px; min-width: 300px; }
.term-assign-list { max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; display: grid; gap: 2px; }

/* Workflows & Aufgaben */
.wf-step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary, #283C81);
  color: #fff; font-size: 14px; margin-right: 6px; vertical-align: middle; }
.wf-action { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px 14px; margin: 0 0 12px; }
.wf-action[hidden], .wf-form [hidden] { display: none !important; }
.wf-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; }
tr.row-overdue td { background: color-mix(in srgb, var(--err-bg) 45%, transparent); }
.wf-form .btn-row select { width: auto; max-width: 280px; }

/* Fuhrpark */
.plate { display: inline-block; font-family: "DIN 1451", "Arial Narrow", Arial, sans-serif; font-weight: 700; letter-spacing: .04em;
  border: 2px solid #1b1b1b; border-left: 9px solid #2a4fb3; border-radius: 4px; padding: 0 7px; background: #fff; color: #111;
  font-size: 13px; line-height: 20px; white-space: nowrap; vertical-align: middle; }
.plate.sm { font-size: 11px; line-height: 16px; border-left-width: 7px; }
.card-alert { border-left: 4px solid var(--err); }

/* Briefe: Vorlagengruppen und Textbausteine */
.pick-group { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  margin: 12px 0 2px; grid-column: 1 / -1; }
.pick-group:first-child { margin-top: 0; }
.snippet-list { display: grid; gap: 6px; }
.snippet-list button { text-align: left; font: inherit; font-size: 13px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }
.snippet-list button:hover { border-color: var(--primary-2); }

/* ---------------------------------------------------------------- HR-LT App (PWA, Handy) */
body.mob { background: var(--bg); padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
.mob-top { position: sticky; top: 0; z-index: 30; background: #283C81; color: #fff;
  padding: calc(10px + env(safe-area-inset-top)) 16px 12px; display: flex; align-items: center; gap: 12px; }
.mob-top h1 { font-size: 18px; margin: 0; color: #fff; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.mob-top a { color: #fff; }
.mob-top .back { font-size: 22px; line-height: 1; padding: 4px 6px 4px 0; text-decoration: none; }
.mob-top img { height: 26px; width: auto; background: #fff; border-radius: 6px; padding: 3px 6px; }
.mob-main { max-width: 640px; margin: 0 auto; padding: 14px 14px 24px; }
.mob-main .card { padding: 14px 16px; margin-bottom: 12px; border-radius: 14px; }
.mob-main h2 { font-size: 15px; margin-bottom: 10px; }
.mob-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; background: var(--surface);
  border-top: 1px solid var(--border); padding: 4px 4px env(safe-area-inset-bottom); }
.mob-tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 6px;
  color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none; position: relative; border-radius: 10px; }
.mob-tabs a.active { color: var(--brand-dark); background: var(--brand-tint); }
@media (prefers-color-scheme: dark) { .mob-tabs a.active { color: #fff; } }
.mob-tabs svg { width: 22px; height: 22px; }
.mob-tabs .dot { position: absolute; top: 2px; left: calc(50% + 6px); background: var(--err); color: #fff; font-size: 10px;
  border-radius: 999px; min-width: 17px; height: 17px; line-height: 17px; text-align: center; padding: 0 4px; }
.mob-big { display: block; width: 100%; padding: 16px; font-size: 17px; border-radius: 14px; text-align: center; }
.mob-row { display: flex; gap: 10px; }
.mob-row > * { flex: 1; }
.mob-stat { display: flex; justify-content: space-between; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.mob-stat:last-child { border-bottom: 0; }
.mob-stat b { font-variant-numeric: tabular-nums; text-align: right; }
.mob-list { list-style: none; margin: 0; padding: 0; }
.mob-list li { border-bottom: 1px solid var(--border); }
.mob-list li:last-child { border-bottom: 0; }
.mob-list a.item, .mob-list .item { display: flex; align-items: center; gap: 10px; padding: 12px 2px; color: var(--text);
  text-decoration: none; }
.mob-list .item .grow { flex: 1; min-width: 0; }
.mob-list .chev { color: var(--muted); }
.mob-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.mob-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; color: var(--text);
  text-decoration: none; display: block; }
.mob-tile:hover { text-decoration: none; border-color: var(--brand-light); }
.mob-tile .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mob-tile .l { font-size: 12px; color: var(--muted); }
.mob-main input, .mob-main select, .mob-main textarea { font-size: 16px; }   /* kein Zoom beim Antippen (iOS) */
.mob-main .field { margin-bottom: 12px; }
.mob-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mob-chips label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 12px; font-size: 14px; color: var(--text); font-weight: 600; margin: 0; }
.mob-chips input { width: auto; margin: 0; }
.mob-status { font-size: 13px; color: var(--muted); }
.mob-status strong { color: var(--text); font-size: 20px; display: block; }
.sig-pad { width: 100%; height: 160px; border: 1px dashed var(--border); border-radius: 12px; background: #fff; touch-action: none; }
.mob-photo { max-width: 100%; border-radius: 10px; border: 1px solid var(--border); margin: 6px 0; }
