/* Farbwelt: Signal-Orange (Arbeitsweste) auf Graphit, im Hellen warmes Papier.
   Ziffern überall gleich breit (tnum), damit nichts springt, wenn Zeiten laufen. */

@font-face {
  font-family: 'Inter';
  src: url('../fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root, [data-theme='dark'] {
  color-scheme: dark;
  --bg: #0D1015;
  --bg2: #11151B;
  --surface: #171C24;
  --surface2: #1F2530;
  --surface3: #272E3B;
  --line: #2A3240;
  --line2: #353E4E;
  --text: #EEF1F6;
  --muted: #8E97A8;
  --faint: #5C6577;
  --accent: #FF7A1A;
  --accent2: #FFC23D;
  --accent-ink: #1B0E02;
  --accent-soft: rgba(255, 122, 26, .14);
  --blue: #4DA3FF;
  --ok: #3DDC84;
  --danger: #FF5A5A;
  --danger-soft: rgba(255, 90, 90, .13);
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --glow: .30;
}

[data-theme='light'] {
  color-scheme: light;
  --bg: #F4F1EB;
  --bg2: #ECE7DE;
  --surface: #FFFFFF;
  --surface2: #F4F0E9;
  --surface3: #EAE4D9;
  --line: #E3DCD0;
  --line2: #D4CBBC;
  --text: #1A1D23;
  --muted: #676C77;
  --faint: #9A9EA6;
  --accent: #E8640C;
  --accent2: #D99A00;
  --accent-ink: #FFFFFF;
  --accent-soft: rgba(232, 100, 12, .11);
  --blue: #1F7AE0;
  --ok: #17924F;
  --danger: #D93636;
  --danger-soft: rgba(217, 54, 54, .09);
  --shadow: 0 10px 30px rgba(60, 45, 20, .14);
  --glow: .16;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'tnum' 1, 'cv11' 1;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior-y: none;
}
body.sheet-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.ic { flex: none; display: block; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.hidden, [hidden] { display: none !important; }

/* ---------- Grundgerüst ---------- */

.app { min-height: 100dvh; }
.side { display: none; }
.main {
  padding: calc(env(safe-area-inset-top) + 8px) 14px calc(env(safe-area-inset-bottom) + 92px);
  max-width: 1180px;
  margin: 0 auto;
}

/* Kopfzeile mit Nutzwerten statt App-Name */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 12px;
  min-width: 0;
}
.stat-label { font-size: 11.5px; color: var(--muted); font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }
.stat-val { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.stat-val small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.stat.accent .stat-val { color: var(--accent); }

.page-head {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0 12px;
  min-height: 42px;
}
.page-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 0; flex: 1; }

/* Untere Leiste (Handy) */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(env(safe-area-inset-bottom) + 6px);
  background: color-mix(in srgb, var(--bg2) 88%, transparent);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 0 5px; border: 0; background: none; border-radius: 12px;
  color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.tab .ic { width: 23px; height: 23px; }
.tab.on { color: var(--accent); background: var(--accent-soft); }
.tab .dot { position: relative; }
.tab .run-dot {
  position: absolute; top: -2px; right: -5px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 2px var(--bg2);
}

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 250px 1fr; }
  .tabs { display: none; }
  .side {
    display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 0; height: 100dvh;
    padding: 22px 14px; background: var(--bg2); border-right: 1px solid var(--line);
  }
  .side-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
  .side-brand img { width: 38px; height: 38px; border-radius: 10px; }
  .side-run { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
  .side-run b { color: var(--text); display: block; font-size: 14px; }
  .side-run .clock { color: var(--ok); font-weight: 700; }
  .side .tab {
    flex-direction: row; justify-content: flex-start; gap: 12px;
    font-size: 14.5px; padding: 11px 12px;
  }
  .main { padding: 26px 32px 48px; width: 100%; }
  .stats { grid-template-columns: repeat(3, minmax(0, 220px)); }
}

/* ---------- Knöpfe ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px;
  border-radius: 12px; border: 1.5px solid var(--line2);
  background: var(--surface); color: var(--text);
  font-weight: 650; font-size: 14.5px; cursor: pointer; white-space: nowrap;
  transition: transform .12s, background .15s, border-color .15s;
}
.btn:active { transform: scale(.97); }
.btn:hover { border-color: var(--faint); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { border-color: var(--accent); filter: brightness(1.06); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { border-color: var(--danger); filter: brightness(1.06); }
.btn-ghost { background: transparent; }
.btn-lg { min-height: 54px; font-size: 16.5px; border-radius: 15px; padding: 0 22px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border-radius: 12px; border: 1.5px solid var(--line2); background: var(--surface); color: var(--text); cursor: pointer;
}
.icon-btn:active { transform: scale(.95); }

/* Umschalter */
.seg {
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--surface); border: 1.5px solid var(--line2); border-radius: 13px; padding: 3px; gap: 3px;
}
.seg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; background: transparent; color: var(--muted); font-weight: 650; font-size: 13.5px;
  padding: 7px 12px; border-radius: 10px; cursor: pointer; white-space: nowrap;
}
.seg-btn.on { background: var(--accent); color: var(--accent-ink); }

/* Zeitraum ‹ November 2026 › */
.period {
  display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 8px;
}
.period-label { text-align: center; font-weight: 750; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Karten, Listen ---------- */

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px;
}
.section-title {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  margin: 18px 4px 8px;
}
.section-title .grow { flex: 1; }
.section-title .num { text-transform: none; letter-spacing: 0; }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.item {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  padding: 11px 14px; width: 100%; text-align: left;
  background: none; border: 0; border-top: 1px solid var(--line); cursor: pointer; color: inherit;
}
.item:first-child { border-top: 0; }
.item:hover { background: var(--surface2); }
.item-main { min-width: 0; }
.item-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.item-sub .ic { width: 13px; height: 13px; }
.item-end { text-align: right; }
.item-dur { font-weight: 700; font-size: 15.5px; min-width: 3.2em; display: inline-block; text-align: right; }
.item-amount { font-size: 12.5px; color: var(--muted); }
.bar-stripe { width: 4px; align-self: stretch; border-radius: 4px; background: var(--c); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: var(--surface3); color: var(--muted); white-space: nowrap;
}
.badge.run { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.badge.warn { background: var(--accent-soft); color: var(--accent); }

.avatar {
  display: inline-grid; place-items: center; flex: none;
  border-radius: 30%;
  background: color-mix(in srgb, var(--c) 20%, var(--surface));
  color: var(--c); font-weight: 800; letter-spacing: -.02em;
  border: 1.5px solid color-mix(in srgb, var(--c) 45%, transparent);
}

.empty {
  text-align: center; padding: 34px 18px; color: var(--muted);
  border: 1.5px dashed var(--line2); border-radius: 18px;
}
.empty > .ic { margin: 0 auto 10px; width: 34px; height: 34px; color: var(--faint); }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1.5px solid var(--line2); border-radius: 13px; padding: 0 12px;
  height: 44px;
}
.search input { flex: 1; border: 0; outline: 0; background: none; font-size: 16px; min-width: 0; }
.search .ic { color: var(--muted); }

/* ---------- Stempeln ---------- */

.hero {
  position: relative; overflow: hidden;
  border-radius: 22px; padding: 18px;
  background: var(--surface); border: 1px solid var(--line);
}
.hero.running {
  border-color: color-mix(in srgb, var(--c) 55%, var(--line));
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--c) calc(var(--glow) * 100%), transparent) 0%, transparent 60%),
    var(--surface);
}
.hero-top { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.hero-who { min-width: 0; flex: 1; }
.hero-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: 6px; }
.hero-name { font-size: 19px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 var(--ok); animation: pulse 1.8s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); }
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.clock-big {
  font-size: 52px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05;
  margin: 12px 0 4px; font-variant-numeric: tabular-nums;
}
.clock-big.idle { color: var(--faint); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: 13.5px; min-height: 20px; align-items: center; }
.hero-meta span { display: inline-flex; align-items: center; gap: 5px; }
.hero-meta .ic { width: 15px; height: 15px; }
.hero-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 16px; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 600px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 13px; min-height: 112px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; color: inherit;
  transition: transform .12s, border-color .15s;
}
.tile:hover { border-color: var(--line2); }
.tile:active { transform: scale(.975); }
.tile.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 9%, var(--surface)); }
.tile-name { font-weight: 700; font-size: 15px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; width: 100%; }
.tile-sub { font-size: 12.5px; color: var(--muted); margin-top: auto; display: flex; gap: 6px; align-items: center; width: 100%; }
.tile .badge { position: absolute; top: 12px; right: 12px; }

.layout-stamp { display: grid; gap: 14px; }
@media (min-width: 1100px) {
  .layout-stamp { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .layout-stamp .col-side { position: sticky; top: 26px; }
}

/* ---------- Einträge ---------- */

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar .period { flex: 1 1 260px; }
.select {
  height: 42px; border-radius: 12px; border: 1.5px solid var(--line2); background: var(--surface);
  padding: 0 34px 0 12px; font-weight: 600; font-size: 14.5px; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; background-size: 5px 5px; background-repeat: no-repeat;
  max-width: 100%;
}
.day-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 16px 4px 6px; font-weight: 700; font-size: 13.5px; color: var(--muted);
}
.day-head .num { color: var(--text); }

/* ---------- Auswertung ---------- */

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 650; display: flex; align-items: center; gap: 6px; }
.kpi-label .ic { width: 15px; height: 15px; }
.kpi-val { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.kpi.k1 .kpi-label { color: var(--accent); }
.kpi.k2 .kpi-label { color: var(--accent2); }
.kpi.k3 .kpi-label { color: var(--blue); }
.kpi.k4 .kpi-label { color: #E64BA0; }

.chart-card { padding: 14px 10px 8px; position: relative; }
.chart { width: 100%; height: 190px; display: block; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .grid text, .chart .xl { fill: var(--muted); font-size: 10.5px; font-weight: 600; }
.chart .bar { cursor: pointer; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .sel-bg { fill: var(--surface3); }
.chart .today { fill: var(--accent); font-weight: 800; }
.tip {
  position: absolute; z-index: 5; pointer-events: none;
  background: var(--surface2); border: 1px solid var(--line2); border-radius: 12px; padding: 8px 10px;
  box-shadow: var(--shadow); font-size: 12.5px; min-width: 150px;
  transform: translate(-50%, -100%);
}
.tip-title { font-weight: 750; margin-bottom: 4px; }
.tip-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 7px; align-items: center; }
.tip-row i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }

.share { height: 6px; border-radius: 6px; background: var(--surface3); overflow: hidden; margin-top: 6px; }
.share i { display: block; height: 100%; border-radius: 6px; background: var(--c); }

.report-grid { display: grid; gap: 14px; }
@media (min-width: 1100px) { .report-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } }

/* ---------- Formulare ---------- */

.form { display: grid; gap: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: grid; gap: 5px; }
.field-label { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.field-hint { font-size: 12px; color: var(--muted); }
.field-err { font-size: 12.5px; color: var(--danger); font-weight: 600; min-height: 0; }
.field.has-err .input { border-color: var(--danger); }
.input {
  width: 100%; min-height: 46px; padding: 10px 12px;
  border-radius: 12px; border: 1.5px solid var(--line2); background: var(--surface2);
  font-size: 16px; outline: none;
}
.input:focus { border-color: var(--accent); }
textarea.input { min-height: 74px; resize: vertical; }
input[type='date'].input, input[type='time'].input { -webkit-appearance: none; appearance: none; min-width: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.swatch {
  width: 32px; height: 32px; border-radius: 10px; border: 2px solid transparent; cursor: pointer;
  background: var(--c); box-shadow: inset 0 0 0 2px var(--surface);
}
.swatch.on { border-color: var(--text); }
.next-day { font-size: 12px; font-weight: 700; color: var(--accent); }
.inline-geo { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Blätter ---------- */

.scrim {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(5, 7, 10, 0);
  display: flex; align-items: flex-end; justify-content: center;
  transition: background .25s;
}
.scrim.in { background: rgba(5, 7, 10, .55); }
.sheet {
  width: 100%; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--bg2); border-radius: 24px 24px 0 0;
  border: 1px solid var(--line); border-bottom: 0;
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(100%); transition: transform .26s cubic-bezier(.2, .9, .25, 1);
  box-shadow: var(--shadow);
}
.scrim.in .sheet { transform: translateY(0); }
.sheet-grip { width: 40px; height: 5px; border-radius: 5px; background: var(--line2); margin: 8px auto 2px; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 8px 16px 12px; flex: none; touch-action: none; }
.sheet-titles { flex: 1; min-width: 0; }
.sheet-title { font-size: 18px; font-weight: 800; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-x { width: 34px; height: 34px; border-radius: 50%; }
.sheet-body { overflow-y: auto; padding: 0 16px 18px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet-text { color: var(--muted); margin: 0 0 16px; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.sheet-actions.three { grid-template-columns: auto 1fr 1fr; }
@media (min-width: 900px) {
  .scrim { align-items: center; }
  .sheet { width: 520px; border-radius: 22px; border-bottom: 1px solid var(--line); transform: translateY(14px) scale(.98); opacity: 0; transition: transform .2s, opacity .2s; }
  .sheet-wide { width: 760px; }
  .scrim.in .sheet { transform: none; opacity: 1; }
  .sheet-grip { visibility: hidden; height: 2px; }
}

.group { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-bottom: 12px; }
.row-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px;
  background: none; border: 0; border-top: 1px solid var(--line); text-align: left; cursor: pointer; color: var(--text);
  font-size: 15.5px; font-weight: 600;
}
.row-btn:first-child { border-top: 0; }
.row-btn:hover { background: var(--surface2); }
.row-btn:disabled { color: var(--faint); cursor: default; }
.row-btn.danger { color: var(--danger); }
.row-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--surface3); flex: none; }
.row-btn.danger .row-ic { background: var(--danger-soft); }
.row-text { display: grid; min-width: 0; }
.row-sub { font-size: 12.5px; color: var(--muted); font-weight: 500; }

/* ---------- Protokoll ---------- */

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--line2); background: var(--surface);
  font-weight: 650; font-size: 13px; cursor: pointer; color: var(--text);
}
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.log-item { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line); }
.log-item:first-child { border-top: 0; }
.log-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); }
.log-ic .ic { width: 18px; height: 18px; }
.log-time { font-size: 12px; color: var(--muted); font-weight: 650; }
.log-text { font-weight: 600; font-size: 14px; }
.log-changes { margin-top: 4px; display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
.log-changes b { color: var(--text); font-weight: 650; }
.log-changes s { color: var(--faint); }
.log-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.log-actions .btn { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }

/* ---------- Mehr ---------- */

.settings { display: grid; gap: 4px; max-width: 760px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-top: 1px solid var(--line); }
.set-row:first-child { border-top: 0; }
.set-row .grow { flex: 1; min-width: 0; }
.set-title { font-weight: 650; }
.set-sub { font-size: 13px; color: var(--muted); }
.set-row.warn .set-sub { color: var(--accent); font-weight: 600; }

/* ---------- Fehlerzeile ---------- */

.errorbar {
  position: fixed; z-index: 100; left: 50%; top: calc(env(safe-area-inset-top) + 8px);
  transform: translate(-50%, -150%); transition: transform .25s, opacity .25s; opacity: 0;
  display: flex; align-items: center; gap: 8px; max-width: min(560px, calc(100vw - 24px));
  background: var(--danger); color: #fff; font-weight: 650; font-size: 14px;
  padding: 10px 14px; border-radius: 14px; box-shadow: var(--shadow);
}
.errorbar.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Drucken (Leistungsnachweis) ---------- */

#print { display: none; }
@media print {
  @page { size: A4; margin: 16mm 14mm; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .app, .tabs, .scrim, .errorbar { display: none !important; }
  #print { display: block; }
  .p-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #E8640C; padding-bottom: 8px; margin-bottom: 14px; }
  .p-title { font-size: 18pt; font-weight: 800; margin: 0; }
  .p-sub { color: #555; margin-top: 2px; }
  .p-cust { text-align: right; }
  .p-cust b { font-size: 12.5pt; }
  .p-section { break-inside: avoid; margin-bottom: 18px; }
  .p-section + .p-section { break-before: page; }
  table.p { width: 100%; border-collapse: collapse; }
  table.p th { text-align: left; font-size: 9pt; color: #555; border-bottom: 1px solid #999; padding: 5px 6px; }
  table.p td { border-bottom: 1px solid #ddd; padding: 5px 6px; vertical-align: top; }
  table.p td.r, table.p th.r { text-align: right; white-space: nowrap; }
  table.p tfoot td { border-bottom: 0; border-top: 2px solid #111; font-weight: 800; }
  .p-foot { margin-top: 18px; color: #777; font-size: 8.5pt; }
}

/* ---------- Tätigkeiten ---------- */

.task-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip.task { padding: 8px 12px; font-size: 13.5px; }
.chip.task .ic { margin-left: -2px; }
.chip.task-new { border-style: dashed; color: var(--muted); }
.chip-input {
  height: 36px; border-radius: 999px; border: 1.5px solid var(--accent); background: var(--surface);
  padding: 0 14px; font-size: 16px; width: 170px; outline: none;
}
.hero-tasks { margin-top: 14px; }
.hero-tasks-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 7px; }
.task-tags { display: inline-flex; flex-wrap: nowrap; gap: 4px; overflow: hidden; min-width: 0; }
.tag { font-size: 11.5px; font-weight: 650; padding: 1px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.inline-input { min-height: 38px; padding: 6px 10px; background: transparent; border-color: transparent; font-weight: 650; }
.inline-input:hover { border-color: var(--line2); }
.set-row.dim { opacity: .55; }
.stat-sub { font-size: 11px; color: var(--muted); }
.seg.seg-sm { text-transform: none; letter-spacing: 0; }
.seg.seg-full { display: grid; width: 100%; }
.seg.seg-full .seg-btn { padding: 9px 6px; }
.seg.seg-sm .seg-btn { padding: 5px 10px; font-size: 12.5px; }
@media print {
  table.p tfoot tr + tr td { border-top: 0; }
  table.p td.nw { white-space: nowrap; }
  table.p tfoot tr.p-sub-row td { font-weight: 500; color: #555; }
}

/* ---------- Kalender ---------- */

.cal {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(0, .8fr);
  gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 8px;
}
.cal-head { text-align: center; font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 2px 0 4px; }
.cal-head:last-of-type { color: var(--faint); }
.cal-day {
  position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 3px;
  min-height: 72px; padding: 5px 4px 6px; border-radius: 10px; border: 1px solid transparent;
  background: var(--surface2); color: var(--text); cursor: pointer; text-align: left; min-width: 0;
}
.cal-day:hover { border-color: var(--line2); }
.cal-day.out { opacity: .35; }
.cal-day.today { border-color: var(--accent); }
.cal-day.today .cal-num { background: var(--accent); color: var(--accent-ink); }
.cal-num { align-self: flex-start; font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 0 5px; border-radius: 6px; line-height: 18px; }
.cal-day.has .cal-num { color: var(--text); }
.cal-min { font-size: 13.5px; font-weight: 800; letter-spacing: -.01em; padding-left: 3px; }
.cal-bar { display: flex; height: 5px; border-radius: 3px; overflow: hidden; gap: 1px; margin-top: auto; }
.cal-bar i { display: block; min-width: 3px; }
.cal-tasks { font-size: 9.5px; color: var(--muted); line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; padding-left: 2px; }
.cal-week { display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--accent); }
@media (max-width: 520px) {
  .cal { padding: 5px; gap: 3px; border-radius: 14px; }
  .cal-day { min-height: 58px; padding: 3px 2px 4px; border-radius: 8px; }
  .cal-min { font-size: 11.5px; padding-left: 1px; }
  .cal-tasks { display: none; }
  .cal-week { font-size: 10.5px; }
}
@media (min-width: 900px) { .cal-day { min-height: 92px; } .cal-min { font-size: 15px; } }

[data-theme='light'] .avatar { color: color-mix(in srgb, var(--c) 62%, #000); }

/* ---------- Freischalten ---------- */

.lock { min-height: 100dvh; display: grid; place-items: center; padding: 24px 18px calc(env(safe-area-inset-bottom) + 24px); }
.lock-card {
  width: min(440px, 100%); display: grid; gap: 12px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px 22px 22px;
  box-shadow: var(--shadow);
}
.lock-icon { width: 84px; height: 84px; border-radius: 22px; margin: 0 auto 4px; }
.lock-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.lock-text { color: var(--muted); margin: 0 0 6px; }
.code-input { text-align: center; font-size: 19px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.code-input::placeholder { letter-spacing: .04em; font-weight: 600; }
.lock .field-err { min-height: 18px; }

.lock-hint {
  display: flex; gap: 8px; align-items: flex-start; text-align: left; margin: 0 0 4px;
  background: var(--accent-soft); color: var(--text); border-radius: 12px; padding: 10px 12px; font-size: 13.5px;
}
.lock-hint .ic { color: var(--accent); margin-top: 2px; }
