/* ============================================================ Design-Tokens (Apple-Stil, ohne Glas) */
:root {
  --bg: #f5f5f7;
  --sidebar: #ececf0;
  --surface: #ffffff;
  --surface-2: #f9f9fb;
  --surface-3: #f2f2f7;
  --hover: rgba(0, 0, 0, .045);
  --border: rgba(0, 0, 0, .08);
  --border-strong: rgba(0, 0, 0, .14);
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #8e8e93;
  --accent: #009eec;            /* Firmenblau (Logo Babacan Anlagentechnik) */
  --accent-strong: #0086cc;
  --accent-soft: rgba(0, 158, 236, .11);
  --accent-text: #0079b8;
  --green: #28a745; --green-soft: rgba(52, 199, 89, .14); --green-text: #1e7e34;
  --red: #ff3b30; --red-soft: rgba(255, 59, 48, .11); --red-text: #d70015;
  --orange: #ff9500; --orange-soft: rgba(255, 149, 0, .14); --orange-text: #b25000;
  --purple: #af52de; --purple-soft: rgba(175, 82, 222, .13); --purple-text: #8944ab;
  --teal: #30b0c7; --teal-soft: rgba(48, 176, 199, .14); --teal-text: #0f7a8c;
  --gray-soft: rgba(142, 142, 147, .12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 20px rgba(0, 0, 0, .05);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, .18), 0 2px 8px rgba(0, 0, 0, .06);
  --r-sm: 8px; --r: 12px; --r-lg: 18px; --r-xl: 24px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --sidebar: #161618; --surface: #1c1c1e; --surface-2: #232325; --surface-3: #2c2c2e;
    --hover: rgba(255, 255, 255, .06); --border: rgba(255, 255, 255, .09); --border-strong: rgba(255, 255, 255, .16);
    --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #7c7c80;
    --accent: #009eec; --accent-strong: #1aa9f0; --accent-soft: rgba(0, 158, 236, .2); --accent-text: #3dbaf5;
    --green: #30d158; --green-text: #4ade80; --red: #ff453a; --red-text: #ff6961; --orange: #ff9f0a; --orange-text: #ffb340;
    --purple: #bf5af2; --purple-text: #d08cf5; --teal: #40c8e0; --teal-text: #6fd8eb;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .25);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --sidebar: #161618; --surface: #1c1c1e; --surface-2: #232325; --surface-3: #2c2c2e;
  --hover: rgba(255, 255, 255, .06); --border: rgba(255, 255, 255, .09); --border-strong: rgba(255, 255, 255, .16);
  --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #7c7c80;
  --accent: #009eec; --accent-strong: #1aa9f0; --accent-soft: rgba(0, 158, 236, .2); --accent-text: #3dbaf5;
  --green: #30d158; --green-text: #4ade80; --red: #ff453a; --red-text: #ff6961; --orange: #ff9f0a; --orange-text: #ffb340;
  --purple: #bf5af2; --purple-text: #d08cf5; --teal: #40c8e0; --teal-text: #6fd8eb;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .25);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
a { color: var(--accent-text); text-decoration: none; }
::selection { background: var(--accent-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

#app { display: flex; height: 100vh; }

/* ============================================================ Sidebar */
#sidebar {
  width: 236px; flex-shrink: 0; background: var(--sidebar); display: flex; flex-direction: column;
  padding: 18px 12px 12px; border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 16px; }
.brand-logo { padding: 4px 6px 14px; }
.brand-logo img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.brand-logo .logo-dark { display: none; }
.brand-logo .app-line { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-2); font-weight: 600; letter-spacing: .01em; }
.brand-logo .app-line svg { width: 14px; height: 14px; color: var(--accent); stroke-width: 2.2; }
.brand-logo .app-line .ver { margin-left: auto; font-weight: 500; color: var(--text-3); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo .logo-light { display: none; }
  :root:not([data-theme="light"]) .brand-logo .logo-dark { display: block; }
}
:root[data-theme="dark"] .brand-logo .logo-light { display: none; }
:root[data-theme="dark"] .brand-logo .logo-dark { display: block; }
.brand-icon { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(160deg, #33b4f2, #0086cc); display: grid; place-items: center; color: #fff; box-shadow: 0 2px 6px rgba(0, 134, 204, .35); }
.brand-icon svg { width: 20px; height: 20px; stroke-width: 2.2; }
.brand-name { font-family: var(--font-display); font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.brand-sub { font-size: 11.5px; color: var(--text-3); }
.search-trigger {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; margin-bottom: 14px;
  border: 1px solid var(--border); background: var(--surface); border-radius: 10px; color: var(--text-3); cursor: pointer; box-shadow: var(--shadow-sm);
}
.search-trigger svg { width: 15px; height: 15px; }
.search-trigger span { flex: 1; text-align: left; }
kbd { font-family: var(--font); font-size: 10.5px; border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; color: var(--text-3); background: var(--surface-2); }
#nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: auto; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; color: var(--text); cursor: pointer;
  border: 0; background: none; text-align: left; font-weight: 500; transition: background .12s;
}
.nav-item svg { color: var(--text-2); width: 19px; height: 19px; }
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--surface); box-shadow: var(--shadow-sm); }
.nav-item.active svg { color: var(--accent); }
.nav-item .badge { margin-left: auto; }
.nav-sep { height: 1px; background: var(--border); margin: 8px 10px; }
.sidebar-foot { font-size: 11.5px; color: var(--text-3); padding: 10px 8px 0; display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; flex-shrink: 0; }
.dot.off { background: var(--red); }

/* ============================================================ Main */
#main { flex: 1; overflow: auto; position: relative; }
.page { max-width: 1240px; margin: 0 auto; padding: 28px 36px 60px; animation: fadein .18s ease; }
.page.wide { max-width: 1500px; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -.025em; margin: 0; line-height: 1.1; }
.page-head .sub { color: var(--text-2); margin-top: 4px; font-size: 14px; }
.page-head .spacer { flex: 1; }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
h2 { font-family: var(--font-display); font-size: 19px; font-weight: 650; letter-spacing: -.015em; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.loading-screen { height: 100%; display: grid; place-items: center; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================ Karten & Raster */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); border: 1px solid var(--border); padding: 20px; }
.card.flat { box-shadow: none; }
.card.pad-0 { padding: 0; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.span2 { grid-column: span 2; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 10px; }
.stack > * + * { margin-top: 16px; }
.spacer { flex: 1; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.stat { padding: 16px 18px; }
.stat .label { font-size: 12.5px; color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat .label svg { width: 15px; height: 15px; }
.stat .value { font-family: var(--font-display); font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: 15px; color: var(--text-3); font-weight: 500; }
.stat .hint { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.pos { color: var(--green-text); }
.neg { color: var(--red-text); }

/* ============================================================ Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; font-weight: 500; white-space: nowrap; box-shadow: var(--shadow-sm); transition: background .12s, transform .06s, box-shadow .12s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn.primary:hover { background: var(--accent-strong); }
.btn.danger { color: var(--red-text); }
.btn.danger.solid { background: var(--red); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; gap: 5px; }
.btn.sm svg { width: 14px; height: 14px; }
.btn.icon { width: 34px; padding: 0; justify-content: center; }
.btn.icon.sm { width: 28px; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.tint-green { color: var(--green-text); } .btn.tint-red { color: var(--red-text); }
.btn.tint-orange { color: var(--orange-text); } .btn.tint-teal { color: var(--teal-text); } .btn.tint-purple { color: var(--purple-text); }

.segmented { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 2px; gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; padding: 5px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.segmented button:hover:not(.active) { color: var(--text); }

/* Mitarbeiter-Pillen */
.people { display: flex; gap: 6px; flex-wrap: wrap; }
.person-pill { display: flex; align-items: center; gap: 7px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 500; box-shadow: var(--shadow-sm); }
.person-pill.active { border-color: transparent; box-shadow: 0 0 0 2px var(--accent); }
.person-pill:hover:not(.active) { background: var(--surface-2); }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; vertical-align: middle; place-items: center; color: #fff; font-size: 11px; font-weight: 650; flex-shrink: 0; letter-spacing: .02em; }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }
.avatar.xl { width: 64px; height: 64px; font-size: 22px; }

/* ============================================================ Formulare */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .label-sm { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.input, select.input, textarea.input {
  height: 36px; padding: 0 11px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface);
  outline: none; transition: border-color .12s, box-shadow .12s; width: 100%; min-width: 0;
}
textarea.input { height: auto; padding: 8px 11px; resize: vertical; min-height: 70px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.sm { height: 30px; font-size: 13px; padding: 0 9px; border-radius: 8px; }
.input.num { text-align: right; font-variant-numeric: tabular-nums; }
.input[type="color"] { padding: 3px; width: 48px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.toggle { position: relative; width: 42px; height: 25px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: var(--surface-3); border-radius: 999px; transition: .18s; cursor: pointer; border: 1px solid var(--border); }
.toggle span::after { content: ""; position: absolute; width: 21px; height: 21px; left: 1px; top: 1px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: .18s; }
.toggle input:checked + span { background: var(--green); }
.toggle input:checked + span::after { transform: translateX(17px); }

/* ============================================================ Chips / Badges */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 550; background: var(--gray-soft); color: var(--text-2); white-space: nowrap; }
.chip svg { width: 13px; height: 13px; }
.chip.arbeit { background: var(--accent-soft); color: var(--accent-text); }
.chip.urlaub { background: var(--green-soft); color: var(--green-text); }
.chip.krank { background: var(--red-soft); color: var(--red-text); }
.chip.feiertag { background: var(--purple-soft); color: var(--purple-text); }
.chip.schaetzung { background: var(--orange-soft); color: var(--orange-text); }
.chip.ausgleich { background: var(--teal-soft); color: var(--teal-text); }
.chip.fehlt { background: var(--red-soft); color: var(--red-text); }
.chip.ok { background: var(--green-soft); color: var(--green-text); }
.chip .x { cursor: pointer; opacity: .6; margin-right: -3px; }
.chip .x:hover { opacity: 1; }
.badge { min-width: 19px; height: 19px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 650; display: inline-grid; place-items: center; }
.badge.orange { background: var(--orange); }

/* ============================================================ Tabellen */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
.table th:first-child { border-top-left-radius: var(--r); } .table th:last-child { border-top-right-radius: var(--r); }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--hover); }
.table .r { text-align: right; font-variant-numeric: tabular-nums; }
.table tfoot td { font-weight: 650; border-top: 1px solid var(--border-strong); background: var(--surface-2); }
.table-wrap { overflow: auto; border-radius: var(--r-lg); }

/* Balken */
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row .bar-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; gap: 8px; }
.bar { height: 7px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar > div { height: 100%; border-radius: 99px; background: var(--accent); }
.month-bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.month-bars .mb { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 5px; min-width: 0; }
.month-bars .mb .col-bar { width: 100%; max-width: 38px; background: var(--accent); border-radius: 6px 6px 3px 3px; min-height: 3px; position: relative; }
.month-bars .mb .v { font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.month-bars .mb .l { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }

/* ============================================================ Erfassung (Woche) */
.week-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.week-nav { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px; box-shadow: var(--shadow-sm); }
.week-nav .label { padding: 0 10px; font-weight: 600; min-width: 190px; text-align: center; font-variant-numeric: tabular-nums; cursor: pointer; }
.week-nav .label small { color: var(--text-3); font-weight: 500; margin-left: 6px; }
.days { display: flex; flex-direction: column; gap: 12px; }
.day {
  display: grid; grid-template-columns: 112px 1fr 220px; background: var(--surface); border-radius: var(--r-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow); overflow: visible; position: relative; transition: box-shadow .15s;
}
.day.today { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.day.weekend { background: var(--surface-2); }
.day-date { padding: 16px 14px 16px 18px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; }
.day-date .wd { font-size: 12.5px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.day-date .dn { font-family: var(--font-display); font-size: 30px; font-weight: 650; letter-spacing: -.03em; line-height: 1; }
.day-date .mn { font-size: 12.5px; color: var(--text-3); }
.day-date .chip { margin-top: 6px; align-self: flex-start; }
.day-body { padding: 10px 14px 10px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.day-side { padding: 14px 16px; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.day-total { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.day-total .big { font-family: var(--font-display); font-size: 24px; font-weight: 650; letter-spacing: -.02em; }
.day-total .of { color: var(--text-3); font-size: 13px; }
.day-total .delta { margin-left: auto; font-size: 13px; font-weight: 600; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.quick .btn { justify-content: center; width: 100%; }
.entry-row { display: grid; grid-template-columns: 1fr 86px minmax(120px, .8fr) 30px; gap: 8px; align-items: center; }
.entry-row .kind-label { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 10px; font-weight: 550; }
.entry-row .kind-label.urlaub { background: var(--green-soft); color: var(--green-text); }
.entry-row .kind-label.krank { background: var(--red-soft); color: var(--red-text); }
.entry-row .kind-label.ausgleich { background: var(--teal-soft); color: var(--teal-text); }
.entry-row .kind-label svg { width: 16px; height: 16px; }
.entry-row .del { opacity: 0; transition: opacity .12s; }
.entry-row:hover .del, .entry-row:focus-within .del { opacity: 1; }
.add-row { align-self: flex-start; color: var(--accent-text); }
.banner { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; font-size: 13px; font-weight: 500; }
.banner svg { width: 17px; height: 17px; }
.banner.feiertag { background: var(--purple-soft); color: var(--purple-text); }
.banner.schaetzung { background: var(--orange-soft); color: var(--orange-text); }
.banner.info { background: var(--accent-soft); color: var(--accent-text); }
.banner.warn { background: var(--red-soft); color: var(--red-text); }
.banner .spacer { flex: 1; }
.saved-tick { font-size: 11.5px; color: var(--green-text); opacity: 0; transition: opacity .3s; display: flex; align-items: center; gap: 4px; }
.saved-tick.show { opacity: 1; }
.saved-tick svg { width: 13px; height: 13px; }
.empty-day { color: var(--text-3); font-size: 13px; padding: 8px 2px; }
.soll-btn { background: none; border: 0; padding: 0; color: var(--text-3); cursor: pointer; font-size: 13px; text-decoration: underline dotted; text-underline-offset: 3px; }
.soll-btn:hover { color: var(--accent-text); }
.soll-btn.override { color: var(--orange-text); }

/* Combobox */
.combo { position: relative; min-width: 0; }
.combo-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 290px; overflow: auto; padding: 5px; min-width: 260px;
}
.combo-opt { padding: 7px 10px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.combo-opt .sub { color: var(--text-3); font-size: 12px; margin-left: auto; white-space: nowrap; }
.combo-opt.active { background: var(--accent); color: #fff; }
.combo-opt.active .sub { color: rgba(255, 255, 255, .8); }
.combo-opt.new { color: var(--accent-text); font-weight: 550; }
.combo-opt.new.active { color: #fff; }
.combo-sort { position: sticky; top: -5px; margin: -5px -5px 4px; padding: 7px 10px; display: flex; align-items: center; gap: 4px;
  background: var(--surface); border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-3); z-index: 1; }
.combo-sort span { margin-right: 4px; }
.combo-sort button { border: 0; background: var(--surface-3); color: var(--text-2); padding: 3px 10px; border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 550; }
.combo-sort button.on { background: var(--accent); color: #fff; }
.combo-head { font-size: 11px; color: var(--text-3); font-weight: 600; padding: 6px 10px 3px; text-transform: uppercase; letter-spacing: .05em; }

/* ============================================================ Kalender */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-wd { font-size: 12px; font-weight: 600; color: var(--text-3); text-align: center; padding-bottom: 2px; text-transform: uppercase; letter-spacing: .05em; }
.cal-cell {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; min-height: 104px; padding: 9px 10px; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; transition: transform .08s, box-shadow .12s; position: relative; overflow: hidden;
}
.cal-cell:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.cal-cell.other { opacity: .38; }
.cal-cell.today { box-shadow: 0 0 0 2px var(--accent); }
.cal-cell.weekend { background: var(--surface-2); }
.cal-cell .top { display: flex; align-items: center; justify-content: space-between; }
.cal-cell .dn { font-weight: 650; font-size: 15px; }
.cal-cell .hrs { font-weight: 650; font-variant-numeric: tabular-nums; font-size: 13px; }
.cal-cell .sites { font-size: 11.5px; color: var(--text-2); line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cal-cell::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.cal-cell.s-arbeit::before { background: var(--accent); }
.cal-cell.s-urlaub::before { background: var(--green); }
.cal-cell.s-krank::before { background: var(--red); }
.cal-cell.s-feiertag::before { background: var(--purple); }
.cal-cell.s-schaetzung::before { background: var(--orange); }
.cal-cell.s-ausgleich::before { background: var(--teal); }
.cal-cell.s-fehlt { border-style: dashed; border-color: var(--red); }
.team-wrap { overflow: auto; }
.team { border-collapse: separate; border-spacing: 3px; }
.team th { font-size: 11px; color: var(--text-3); font-weight: 600; min-width: 34px; text-align: center; padding: 2px 0; }
.team th.name { text-align: left; min-width: 140px; position: sticky; left: 0; background: var(--surface); z-index: 2; }
.team td.name { position: sticky; left: 0; background: var(--surface); z-index: 2; padding-right: 10px; white-space: nowrap; font-weight: 550; }
.team th.we, .team th.hol { color: var(--purple-text); }
.team th.today { color: var(--accent-text); }
.tc { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; background: var(--surface-3); color: var(--text-2); transition: transform .08s; }
.tc:hover { transform: scale(1.1); }
.tc.arbeit { background: var(--accent-soft); color: var(--accent-text); }
.tc.urlaub { background: var(--green); color: #fff; }
.tc.krank { background: var(--red); color: #fff; }
.tc.feiertag { background: var(--purple-soft); color: var(--purple-text); }
.tc.schaetzung { background: var(--orange-soft); color: var(--orange-text); }
.tc.ausgleich { background: var(--teal); color: #fff; }
.tc.fehlt { background: transparent; border: 1.5px dashed var(--red); color: var(--red-text); }
.tc.frei { background: transparent; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 4px; display: inline-block; }

/* ============================================================ Listen (Baustellen etc.) */
.split { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { background: var(--hover); }
.list-item.active { background: var(--accent-soft); }
.list-item .t { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .s { font-size: 12px; color: var(--text-3); }
.list-item .r { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.list-scroll { max-height: calc(100vh - 250px); overflow: auto; }
.sticky-top { position: sticky; top: 16px; }
.empty { text-align: center; padding: 48px 20px; color: var(--text-3); }
.empty svg { width: 40px; height: 40px; stroke-width: 1.4; margin-bottom: 8px; }
.empty .t { font-weight: 600; color: var(--text-2); font-size: 15px; margin-bottom: 4px; }

/* Mitarbeiter-Karten */
.emp-card { cursor: pointer; transition: transform .1s, box-shadow .15s; }
.emp-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.emp-card .head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.emp-card .name { font-weight: 650; font-size: 16px; }
.kv { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--text-2); }
.kv .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.week-dots { display: flex; gap: 4px; }
.week-dots i { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); }
.week-dots i.arbeit { background: var(--accent); } .week-dots i.urlaub { background: var(--green); } .week-dots i.krank { background: var(--red); }
.week-dots i.feiertag { background: var(--purple); } .week-dots i.schaetzung { background: var(--orange); } .week-dots i.ausgleich { background: var(--teal); }
.week-dots i.fehlt { background: var(--red-soft); }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs button { border: 0; background: none; padding: 9px 14px; cursor: pointer; font-weight: 550; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }

/* Hinweise */
.alert-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.alert-item:last-child { border-bottom: 0; }
.alert-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.alert-icon.red { background: var(--red-soft); color: var(--red-text); }
.alert-icon.orange { background: var(--orange-soft); color: var(--orange-text); }
.alert-icon.blue { background: var(--accent-soft); color: var(--accent-text); }
.alert-icon.green { background: var(--green-soft); color: var(--green-text); }
.alert-icon.purple { background: var(--purple-soft); color: var(--purple-text); }
.hero { background: linear-gradient(135deg, #12a8f0 0%, #0079b8 100%); color: #fff; border: 0; }
.hero .muted, .hero .faint { color: rgba(255, 255, 255, .8); }
.hero .btn { background: rgba(255, 255, 255, .18); color: #fff; border-color: transparent; box-shadow: none; }
.hero .btn:hover { background: rgba(255, 255, 255, .28); }
.hero.done { background: linear-gradient(135deg, #2fb350 0%, #1e8a3c 100%); }
.hero.urgent { background: linear-gradient(135deg, #ff8a00 0%, #e8590c 100%); }

/* ============================================================ Overlays */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .28); display: flex; align-items: flex-start; justify-content: center; z-index: 100; padding: 8vh 20px 20px; animation: ov .15s ease; overflow: auto; }
@keyframes ov { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); width: 100%; max-width: 540px; animation: pop .18s cubic-bezier(.2, .9, .3, 1.2); border: 1px solid var(--border); }
.modal.lg { max-width: 820px; }
.modal.xl { max-width: 1040px; }
@keyframes pop { from { transform: scale(.96) translateY(6px); opacity: 0; } }
.modal-head { padding: 20px 22px 6px; display: flex; align-items: center; gap: 10px; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 12px 22px 18px; }
.modal-foot { padding: 14px 22px; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-xl) var(--r-xl); }
.palette { max-width: 620px; }
.palette input { border: 0; outline: none; background: none; font-size: 18px; padding: 18px 20px; width: 100%; border-bottom: 1px solid var(--border); }
.palette .results { max-height: 420px; overflow: auto; padding: 6px; }
.palette .res { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.palette .res.active { background: var(--accent); color: #fff; }
.palette .res.active .faint { color: rgba(255, 255, 255, .8); }
.palette .res .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.palette .res.active .ic { background: rgba(255, 255, 255, .2); color: #fff; }
.menu { position: fixed; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 5px; z-index: 120; min-width: 210px; animation: pop .12s ease; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--accent); color: #fff; }
.menu button:hover svg { color: #fff; }
.menu button svg { width: 16px; height: 16px; color: var(--text-2); }
.menu .sep { height: 1px; background: var(--border); margin: 4px 6px; }

#toast-root { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: rgba(30, 30, 32, .94); color: #fff; padding: 10px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-weight: 500; display: flex; align-items: center; gap: 9px; animation: toast .22s cubic-bezier(.2, .9, .3, 1.2); pointer-events: auto; max-width: 560px; }
.toast.err { background: #d70015; }
.toast svg { width: 17px; height: 17px; }
@keyframes toast { from { transform: translateY(14px); opacity: 0; } }

/* Einrichtung */
.setup { max-width: 620px; margin: 9vh auto; }
.setup .brand-icon { width: 64px; height: 64px; border-radius: 18px; margin-bottom: 18px; }
.setup .brand-icon svg { width: 34px; height: 34px; }

.hidden { display: none !important; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; }
.code { font-family: Consolas, "SF Mono", monospace; font-size: 12.5px; background: var(--surface-3); padding: 2px 6px; border-radius: 6px; word-break: break-all; }

/* Erfassung: Balken links/rechts neben den Tagen zum Wochenwechsel (so hoch wie die Tage) */
.days-wrap { display: grid; grid-template-columns: 46px minmax(0, 1fr) 46px; gap: 12px; margin: 0 -58px; }
@media (max-width: 1420px) { .days-wrap { margin: 0; } }
.week-edge {
  border: 1px solid var(--border); border-radius: 18px; background: var(--surface); color: var(--text-3); cursor: pointer;
  padding: 0; opacity: .55; display: flex; align-items: center; justify-content: center;
  transition: opacity .15s, background .15s, color .15s, transform .1s;
}
.week-edge i { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 0; font-style: normal; }
.week-edge svg { width: 24px; height: 24px; stroke-width: 2.2; }
.week-edge span { font-size: 11px; font-weight: 600; writing-mode: vertical-rl; transform: rotate(180deg); opacity: 0; transition: opacity .15s; }
.week-edge:hover { opacity: 1; background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.week-edge:hover span { opacity: 1; }
.week-edge:active { transform: scale(.99); }

/* „+ Baustelle“ mit Tastatur fokussiert: pulsierender Rahmen */
.add-row:focus { outline: none; }
.add-row:focus-visible { background: var(--accent-soft); animation: focuspulse 1.3s ease-in-out infinite; }
@keyframes focuspulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--accent), 0 0 0 5px rgba(0, 158, 236, 0); }
  50% { box-shadow: 0 0 0 2px var(--accent), 0 0 0 7px rgba(0, 158, 236, .3); }
}

/* v2.0: Benutzer unten in der Seitenleiste, Anmeldebildschirm */
.sidebar-foot { padding: 8px 0 0; }
.user-chip { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: left; color: var(--text); }
.user-chip:hover { background: var(--hover); }
.user-chip .who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.user-chip .who b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .who small { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip svg { color: var(--text-3); width: 16px; height: 16px; }
.setup-logo { display: block; width: 260px; max-width: 70%; margin: 4px 0 22px; }
.setup-logo.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .setup-logo.logo-light { display: none; }
  :root:not([data-theme="light"]) .setup-logo.logo-dark { display: block; }
}
:root[data-theme="dark"] .setup-logo.logo-light { display: none; }
:root[data-theme="dark"] .setup-logo.logo-dark { display: block; }
.setup-title { font-family: var(--font-display); font-size: 28px; margin: 0 0 8px; letter-spacing: -.02em; }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
.emp-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.emp-checks label { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 500; }
.emp-checks label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.emp-checks input { display: none; }
.month-chips { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.month-chips button { border: 1px solid var(--border); background: var(--surface); border-radius: 9px; padding: 7px 0; cursor: pointer; font-weight: 550; color: var(--text-2); }
.month-chips button.on { background: var(--accent); border-color: transparent; color: #fff; }
.audit-row { display: grid; grid-template-columns: 112px 150px 1fr auto; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--border); align-items: start; font-size: 13.5px; }
.audit-row:last-child { border-bottom: 0; }
.audit-row .t { color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.audit-row .u { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-row .u small { display: block; font-weight: 400; color: var(--text-3); font-size: 11.5px; }
.audit-row details summary { cursor: pointer; color: var(--accent-text); font-size: 12px; list-style: none; }
.audit-row pre { white-space: pre-wrap; font-size: 11.5px; background: var(--surface-3); padding: 8px; border-radius: 8px; margin: 6px 0 0; max-width: 520px; }
.readonly-row input { pointer-events: none; }

/* v2.0.1: Listen-Umschalter in der Erfassung (nur sichtbar, wenn man mehrere Listen hat) */
.combo.has-list { display: flex; gap: 6px; align-items: center; container-type: inline-size; }
@container (max-width: 230px) { .list-btn span, .list-btn svg:last-child { display: none; } .list-btn { padding: 0 9px; } }
.combo.has-list .input { flex: 1; min-width: 0; }
.list-btn { flex: none; height: 34px; max-width: 130px; display: inline-flex; align-items: center; gap: 4px; padding: 0 8px 0 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); border-radius: 10px; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-text); }
.list-btn:disabled { cursor: default; opacity: .7; }
.list-btn svg { width: 12px; height: 12px; flex: none; }
.emp-checks svg { width: 14px; height: 14px; margin-left: 6px; }
.emp-checks label:has(input:disabled) { cursor: default; opacity: .75; }
.range-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.range-row .input { width: 160px; }

/* ============================================================ Handy (v2.1) */
#topbar, #nav-backdrop { display: none; }
@media (hover: none) { .entry-row .del { opacity: 1; } }
@media (max-width: 760px) {
  #app { flex-direction: column; height: 100vh; height: 100dvh; }
  #topbar { display: flex; align-items: center; gap: 6px; flex-shrink: 0; background: var(--sidebar); border-bottom: 1px solid var(--border);
    padding: 6px 8px; padding-top: calc(6px + env(safe-area-inset-top)); }
  body.no-nav #topbar { display: none; }
  #topbar svg { width: 22px; height: 22px; }
  .tb-title { flex: 1; text-align: center; font-weight: 650; font-size: 16px; }
  #sidebar { position: fixed; z-index: 90; top: 0; bottom: 0; left: 0; width: min(290px, 84vw); transform: translateX(-105%);
    transition: transform .2s ease; box-shadow: var(--shadow-lg); padding-top: calc(18px + env(safe-area-inset-top));
    padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  body.nav-open #sidebar { transform: none; }
  body.nav-open #nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 89; }
  .search-trigger kbd { display: none; }
  .nav-item { padding: 11px 10px; }
  #main { flex: 1; min-height: 0; }
  .page { padding: 14px 12px calc(70px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 14px; gap: 10px; }
  .page-head h1 { font-size: 24px; }
  .page-head .actions { width: 100%; }
  .g2, .g3, .form-grid, .split, .perm-grid { grid-template-columns: minmax(0, 1fr); }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .input, select, textarea { font-size: 16px; } /* iPhone zoomt sonst beim Antippen */
  .table { display: block; overflow-x: auto; }
  .overlay { padding: 10px; padding-top: calc(10px + env(safe-area-inset-top)); }
  .modal-head { padding: 16px 16px 4px; } .modal-body { padding: 10px 16px 14px; } .modal-foot { padding: 12px 16px; flex-wrap: wrap; }
  .palette .results { max-height: 60vh; }
  #toast-root { width: calc(100% - 24px); bottom: calc(16px + env(safe-area-inset-bottom)); }
  .combo-list { min-width: min(320px, calc(100vw - 40px)); }
  .audit-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .month-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cal-grid { gap: 3px; }
  /* Erfassung: Tage untereinander, Datum als Kopfzeile */
  .days-wrap { grid-template-columns: minmax(0, 1fr); margin: 0; }
  .week-edge { display: none; }
  .week-head { gap: 8px; }
  .week-nav .label { min-width: 0; }
  .day { grid-template-columns: minmax(0, 1fr); }
  .day-date { flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 8px; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--border); }
  .day-date .dn { font-size: 22px; }
  .day-date .chip { margin: 0 0 0 auto; align-self: center; }
  .day-side { border-left: 0; border-top: 1px solid var(--border); }
  .entry-row { grid-template-columns: minmax(0, 1fr) 72px 34px; }
  .entry-row .note { grid-column: 1 / -1; grid-row: 2; }
  .entry-row .del { opacity: 1; }
  .card-head, .row { flex-wrap: wrap; }
  .page-head h1 { display: none; } /* steht schon oben in der Leiste */
}

/* Stille Aktualisierung (Änderung von einem anderen Gerät): Standbild + keine Einblend-Animation */
.render-shot { position: fixed; z-index: 50; overflow: hidden; background: var(--bg); pointer-events: none; }
.render-shot > * { position: absolute; inset: 0; overflow: hidden; }
.render-shot .page, #main.quiet .page { animation: none; }
