/* HDJW Termine – Oberfläche */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e3e7ef;
  --text: #1c2333;
  --muted: #6b7489;
  --primary: #2f5bea;
  --primary-600: #2449c4;
  --primary-50: #eef2ff;
  --ok: #17a168;
  --ok-50: #e7f7ef;
  --warn: #c98107;
  --warn-50: #fff5e0;
  --danger: #d6384a;
  --danger-50: #fdecee;
  --full: #8a93a6;
  --full-50: #eef0f4;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 4px 16px rgba(20, 30, 60, .06);
  --shadow-lg: 0 10px 40px rgba(20, 30, 60, .18);
  /* Zeitraster */
  --grid: #b7c7dc;
  --grid-head: #eef1f5;
  --day-head: #3a6690;
  --na: #d4a3a3;
  --na-empty: #ecd9d9;
  --na-text: #ffffff;
  --bk: #5b84c4;
  --bk-mine: #2f9e6b;
  --bk-open: #d9902a;
  --past: #eceef2;
  --free-hover: #dff3e8;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
/* Dunkles Design: fest gewählt (data-theme="dark") oder automatisch nach Systemeinstellung */
:root[data-theme="dark"] {
    --bg: #0f131c; --surface: #171c27; --surface-2: #1c2230; --border: #2a3142; --text: #e6e9f0;
    --muted: #97a0b5; --primary: #6d8cff; --primary-600: #8aa3ff; --primary-50: #1e2743;
    --ok: #3ccf8e; --ok-50: #13291f; --warn: #f0b44c; --warn-50: #2c2414; --danger: #ff6b7a;
    --danger-50: #321a1e; --full: #7c859a; --full-50: #222836;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.25);
    --grid: #334058; --grid-head: #1f2635; --day-head: #2c4f73; --na: #7d4a4f; --na-empty: #3a2a2e;
    --bk: #3e62a3; --bk-mine: #23794f; --bk-open: #a86a14; --past: #1b202b; --free-hover: #1d3a2c;
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #0f131c; --surface: #171c27; --surface-2: #1c2230; --border: #2a3142; --text: #e6e9f0;
    --muted: #97a0b5; --primary: #6d8cff; --primary-600: #8aa3ff; --primary-50: #1e2743;
    --ok: #3ccf8e; --ok-50: #13291f; --warn: #f0b44c; --warn-50: #2c2414; --danger: #ff6b7a;
    --danger-50: #321a1e; --full: #7c859a; --full-50: #222836;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.25);
    --grid: #334058; --grid-head: #1f2635; --day-head: #2c4f73; --na: #7d4a4f; --na-empty: #3a2a2e;
    --bk: #3e62a3; --bk-mine: #23794f; --bk-open: #a86a14; --past: #1b202b; --free-hover: #1d3a2c;
    color-scheme: dark;
  }
}

/* Hell/Dunkel-Schieberegler */
.theme-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--muted); user-select: none; }
.theme-toggle input { appearance: none; width: 46px; height: 24px; border-radius: 999px; background: #c7cdd9; position: relative;
                      cursor: pointer; margin: 0; transition: .2s; }
.theme-toggle input::after { content: "☀"; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
                             background: #fff; display: grid; place-items: center; font-size: 12px; line-height: 20px; text-align: center;
                             color: #d99a00; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.theme-toggle input:checked { background: #3b4a6b; }
.theme-toggle input:checked::after { content: "☾"; left: 24px; background: #1c2230; color: #c9d6ff; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5;
       -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.55rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
small, .muted { color: var(--muted); }
code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; font-size: .85em; }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--border);
          backdrop-filter: saturate(1.4) blur(8px); }
.topbar-inner { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 10px 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.05rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-cal { display: inline-flex; color: rgba(0, 0, 0, .42); }
.brand-cal svg { stroke-width: 1.6; }
:root[data-theme="dark"] .brand-cal { color: rgba(255, 255, 255, .5); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]):not([data-theme="dark"]) .brand-cal { color: rgba(255, 255, 255, .5); } }
.invite-body { display: flex; gap: 30px; align-items: center; flex-wrap: wrap; }
.invite-qr { width: 240px; height: 240px; background: #fff; padding: 10px; border-radius: 12px; border: 1px solid var(--border); }
.invite-qr svg { width: 100%; height: 100%; display: block; }
.invite-text { flex: 1; min-width: 260px; }
@media print {
  .subnav, .page-head .btn, .no-print, .code-input { font-size: 1.8rem !important; letter-spacing: .6em; text-align: center; font-variant-numeric: tabular-nums; }
.site-footer { display: none !important; }
  .invite-card { border: 0; box-shadow: none; }
}
.site-footer { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; padding: 18px 16px 26px; font-size: .78rem; color: var(--muted); }
.site-footer a { color: var(--muted); text-decoration: underline; }
.login-wrap + .site-footer { margin-top: -70px; position: relative; }
.email-alert { margin-bottom: 16px; border-left: 4px solid var(--warn); }
.email-alert a { font-weight: 650; }
.imprint h2 { margin-top: 20px; }
.imprint .pre { white-space: pre-line; }
.brand-logo { width: 38px; height: 38px; display: block; filter: drop-shadow(0 3px 6px rgba(76, 29, 149, .25)); }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { padding: 7px 13px; border-radius: 999px; color: var(--muted); font-weight: 550; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--primary-50); color: var(--primary); }
.usermenu { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
          background: var(--primary-50); color: var(--primary); font-size: .85rem; }
.userinfo { line-height: 1.15; }
.userinfo b { display: block; font-size: .9rem; }
.userinfo span { font-size: .75rem; color: var(--muted); }

/* ---------- Layout ---------- */
.container { max-width: 1400px; margin: 0 auto; padding: 24px 20px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px;
             border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- Admin-Subnav ---------- */
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; padding: 6px; background: var(--surface);
          border: 1px solid var(--border); border-radius: 999px; width: fit-content; box-shadow: var(--shadow); }
.subnav a { padding: 6px 14px; border-radius: 999px; color: var(--muted); font-weight: 550; font-size: .92rem; }
.subnav a:hover { color: var(--text); text-decoration: none; background: var(--surface-2); }
.subnav a.active { background: var(--primary); color: #fff; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--surface);
       color: var(--text); padding: 8px 14px; border-radius: var(--radius-sm); font: inherit; font-weight: 580;
       font-size: .92rem; cursor: pointer; transition: .15s; white-space: nowrap; }
.btn:hover { border-color: #c9d0de; background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-50); border-color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: 5px 10px; font-size: .84rem; border-radius: 8px; }
.btn-icon { padding: 7px 9px; }
.btn-group { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.btn-group .btn { border: 0; border-radius: 0; }
.btn-group .btn + .btn { border-left: 1px solid var(--border); }
.btn-group .btn.active { background: var(--primary-50); color: var(--primary); }
.inline { display: inline; }

/* ---------- Formulare ---------- */
label { font-weight: 580; font-size: .88rem; display: block; margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=time],
input[type=search], input[type=file], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
input[type=color] { width: 56px; height: 40px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; background: var(--surface); }
textarea { min-height: 80px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; margin: 0; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.checklist { display: flex; flex-wrap: wrap; gap: 8px; }
.checklist .check { border: 1px solid var(--border); padding: 7px 12px; border-radius: 999px; background: var(--surface); }
.checklist .check:has(input:checked) { border-color: var(--primary); background: var(--primary-50); color: var(--primary); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 580; }
.switch input { appearance: none; width: 44px; height: 24px; border-radius: 999px; background: #c7cdd9; position: relative; transition: .2s; cursor: pointer; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { left: 23px; }
.loc-checklist .check.loc-unreachable { opacity: .6; }
.loc-warn { color: var(--danger); }
.gender-switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 580; font-size: .9rem; }
.gender-switch .g-label { color: var(--muted); }
.gender-switch .switch input { background: #3b82f6; }
.gender-switch .switch input:checked { background: #db2777; }
.gender-switch:has(input:not(:checked)) .g-m, .gender-switch:has(input:checked) .g-w { color: var(--text); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { margin: 0; min-width: 150px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px 4px; margin: 0 0 16px; }
legend { font-weight: 650; padding: 0 6px; font-size: .92rem; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: .76rem; text-transform: uppercase;
            letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td:first-child { white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
tr.inactive td { opacity: .55; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .84rem; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .75rem;
         font-weight: 620; background: var(--full-50); color: var(--muted); white-space: nowrap; }
.badge-ok { background: var(--ok-50); color: var(--ok); }
.badge-warn { background: var(--warn-50); color: var(--warn); }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.badge-primary { background: var(--primary-50); color: var(--primary); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- Flash ---------- */
.flashes { position: fixed; top: 70px; right: 20px; z-index: 60; display: flex; flex-direction: column; gap: 10px; max-width: 420px; }
.flash { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--ok); padding: 12px 38px 12px 14px;
         border-radius: 10px; box-shadow: var(--shadow-lg); position: relative; animation: slidein .25s ease-out; font-size: .92rem; }
.flash-error { border-left-color: var(--danger); }
.flash-info { border-left-color: var(--primary); }
.flash button { position: absolute; top: 8px; right: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; }
@keyframes slidein { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); background: var(--warn-50); color: var(--text); border: 1px solid var(--border); font-size: .9rem; }
.alert-info { background: var(--primary-50); }
.alert-danger { background: var(--danger-50); }

/* ---------- Meine Buchungen ---------- */
.my-bookings { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.booking-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 12px;
                box-shadow: var(--shadow); position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; }
.booking-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c, var(--primary)); }
.booking-card.past { opacity: .6; }
.bc-date { display: flex; gap: 12px; align-items: center; }
.bc-cal { width: 48px; flex: none; text-align: center; border-radius: 10px; background: var(--primary-50); color: var(--primary); padding: 4px 0; line-height: 1.1; }
.bc-cal b { display: block; font-size: 1.25rem; }
.bc-cal span { font-size: .7rem; text-transform: uppercase; font-weight: 700; }
.bc-title { font-weight: 650; }
.bc-meta { font-size: .84rem; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.bc-actions { display: flex; gap: 6px; justify-content: flex-end; margin-top: 4px; }
.empty { text-align: center; padding: 26px; color: var(--muted); border: 2px dashed var(--border); border-radius: var(--radius); background: var(--surface); }

/* ---------- Toolbar Termine ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 26px 0 14px; }
.toolbar .range { font-weight: 650; font-size: 1.02rem; padding: 0 6px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: var(--surface);
        border: 1px solid var(--border); color: var(--text); font-size: .86rem; font-weight: 560; }
.chip:hover { text-decoration: none; border-color: #c9d0de; }
.chip.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-bottom: 12px; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

/* ---------- Monatsauswahl ---------- */
.month-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border);
              border-radius: 12px; box-shadow: var(--shadow); flex-wrap: wrap; }
.month-tab { padding: 7px 16px; border-radius: 9px; font-weight: 700; letter-spacing: .06em; color: var(--muted); font-size: .9rem; }
.month-tab small { font-weight: 600; opacity: .7; letter-spacing: 0; }
.month-tab:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.month-tab.active { background: var(--day-head); color: #fff; }
.cal-table td.out-month { background: var(--surface-2); opacity: .55; }
.tl-day { scroll-margin-top: 70px; }

/* ---------- Standort-Gruppen ---------- */
.loc-group { margin-bottom: 20px; overflow: hidden; }
.loc-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border);
            background: linear-gradient(90deg, color-mix(in srgb, var(--c) 10%, transparent), transparent 60%); }
.loc-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--c); flex: none; }
.loc-head h2 { margin: 0; }
.loc-head .sub { font-size: .82rem; color: var(--muted); }
.cal-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.cal-table th { font-size: .74rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
                padding: 9px 8px; background: var(--surface-2); border-bottom: 1px solid var(--border); text-align: center; white-space: nowrap; }
.cal-table th:first-child, .cal-table td:first-child { text-align: left; padding-left: 18px; width: 150px; }
.cal-table td { padding: 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.cal-table tr:last-child td { border-bottom: 0; }
.cal-table tr.is-today td:first-child { box-shadow: inset 4px 0 0 var(--primary); }
.cal-table tr.is-weekend td:first-child .dname { color: var(--danger); }
.day-label { font-weight: 650; font-size: .9rem; white-space: nowrap; }
.day-label small { display: block; font-weight: 500; font-size: .75rem; }
.week-label { font-weight: 650; font-size: .88rem; white-space: nowrap; }
.week-label small { display: block; font-weight: 500; font-size: .75rem; color: var(--muted); }
.cal-week table { table-layout: fixed; }
.cal-week th:first-child, .cal-week td:first-child { width: 120px; }
.cell-date { font-size: .72rem; color: var(--muted); font-weight: 600; margin: 0 0 4px 2px; }
.cell-date.today { color: var(--primary); }

/* Slot-Kacheln */
.slot { display: flex; flex-direction: column; gap: 1px; width: 100%; min-height: 40px; padding: 6px 9px; border-radius: 9px;
        border: 1px solid transparent; font: inherit; font-size: .8rem; text-align: left; line-height: 1.25; color: var(--text);
        background: var(--full-50); position: relative; transition: transform .12s, box-shadow .12s; }
.slot + .slot { margin-top: 5px; }
.slot .t { font-weight: 700; font-size: .78rem; font-variant-numeric: tabular-nums; }
.slot .s { font-weight: 600; }
.slot .p { font-size: .74rem; color: var(--muted); }
.slot-free { background: var(--ok-50); border-color: color-mix(in srgb, var(--ok) 30%, transparent); cursor: pointer; }
.slot-free .s { color: var(--ok); }
.slot-partial { background: var(--warn-50); border-color: color-mix(in srgb, var(--warn) 30%, transparent); cursor: pointer; }
.slot-partial .s { color: var(--warn); }
.slot-full .s { color: var(--full); }
.slot-blocked { background: repeating-linear-gradient(45deg, var(--full-50), var(--full-50) 6px, var(--surface-2) 6px, var(--surface-2) 12px); color: var(--muted); }
.slot-mine { background: var(--primary-50) !important; border-color: var(--primary) !important; }
.slot-mine .s { color: var(--primary) !important; }
.slot-past { opacity: .45; cursor: default; }
button.slot:not([disabled]):hover, a.slot:hover { transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; }
button.slot[disabled] { cursor: default; }
.slot .cap { position: absolute; top: 6px; right: 7px; font-size: .68rem; font-weight: 700; color: var(--muted); }
.cell-empty { color: var(--border); text-align: center; font-size: .8rem; padding-top: 14px; }

/* ---------- Zeitraster (Zeile = Tag) ---------- */
.tl-card { overflow: hidden; }
.tl-wrap { overflow-x: auto; }
table.tl { width: 100%; min-width: calc(200px + var(--cols) * 30px); border-collapse: collapse; table-layout: fixed; font-size: .8rem; }
.tl col.tl-c0 { width: 200px; }
.tl th, .tl td { border: 1px solid var(--grid); height: 32px; padding: 0; }
.tl-head th { background: var(--grid-head); font-weight: 600; font-size: .78rem; text-align: left; padding: 0 6px;
              color: var(--text); font-variant-numeric: tabular-nums; height: 30px; }
.tl-head th.tl-date { background: var(--day-head); color: #fff; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-empty td { color: var(--muted); padding: 8px 12px !important; font-style: italic; height: auto; }
.tl-head th.tl-date { white-space: normal; line-height: 1.15; }
.tl-today { background: #fff; color: var(--day-head); border-radius: 999px; padding: 0 7px; font-size: .68rem; margin-left: 4px; }
.tl-day + .tl-day .tl-head th { border-top: 3px solid var(--day-head); }
.tl-day.is-today .tl-head th.tl-date { background: var(--primary); }
.tl-loc { background: var(--surface-2); text-align: left; font-weight: 550; padding: 4px 8px !important; line-height: 1.2;
          position: sticky; left: 0; z-index: 2; color: var(--primary); }
.tl-loc a { color: inherit; display: inline; }
.tl-loc a:hover { text-decoration: underline; }
.tl-loc.is-filter { box-shadow: inset 4px 0 0 var(--primary); }
.tl-loc .dot { width: 8px; height: 8px; margin-right: 6px; vertical-align: middle; }
.tl-loc small { display: block; font-weight: 400; color: var(--muted); font-size: .7rem; margin-top: 1px; }
.tl-head th.tl-date { position: sticky; left: 0; z-index: 3; }
.tl-free { background: var(--surface); }
.tl-free a { display: block; width: 100%; height: 100%; min-height: 30px; }
.tl-free:hover { background: var(--free-hover); box-shadow: inset 0 0 0 2px var(--ok); cursor: pointer; }
.tl-na { background: var(--na); color: var(--na-text); padding: 0 6px !important; white-space: nowrap; overflow: hidden;
         text-overflow: ellipsis; font-weight: 550; font-size: .76rem; }
.tl-na-empty { background: var(--na-empty); }
.tl-past { background: var(--past); }
.tl-bk { background: var(--bk); color: #fff; padding: 2px 6px !important; white-space: nowrap; overflow: hidden;
         text-overflow: ellipsis; font-size: .74rem; line-height: 1.15; }
.tl-bk span { display: block; overflow: hidden; text-overflow: ellipsis; }
.tl-bk .tl-t { font-weight: 700; font-variant-numeric: tabular-nums; }
.tl-bk.tl-mine { background: var(--bk-mine); }
.tl-bk.tl-open { background: var(--bk-open); }
.tl-join { display: block; color: #fff; text-decoration: none; }
.tl-join:hover { text-decoration: none; }
.tl-bk:has(a.tl-join):hover { filter: brightness(1.1); cursor: pointer; }
.tl-bk.tl-open:hover { filter: brightness(1.08); cursor: pointer; }
.main-person { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--primary); border-radius: var(--radius-sm); background: var(--primary-50); color: var(--text); }
.participants { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; background: var(--surface-2); }
.pp-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pp-item { display: flex; align-items: center; gap: 9px; padding: 6px 8px; background: var(--surface); border: 1px solid var(--border);
           border-radius: 9px; font-size: .9rem; }
.pp-item.pp-main { border-color: var(--primary); }
.pp-name-text { font-weight: 600; flex: 1; }
.pp-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-50); color: var(--primary); display: grid;
             place-items: center; font-size: .72rem; font-weight: 700; flex: none; }
.pp-remove { border: 0; background: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; padding: 0 4px; line-height: 1; }
.pp-remove:hover { color: var(--danger); }
.pp-actions { gap: 10px; }
dialog.pp-dialog { width: min(820px, calc(100vw - 24px)); }
.pp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; align-items: start; }
.pp-letter { grid-column: 1 / -1; font-weight: 750; color: var(--primary); border-bottom: 1px solid var(--border); padding: 6px 2px 2px; font-size: .9rem; }
.pp-pick { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px;
           background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; text-align: left; cursor: pointer; }
.pp-pick small { color: var(--muted); }
.pp-pick:hover { border-color: var(--primary); background: var(--primary-50); }
.pp-pick[hidden], .pp-letter[hidden] { display: none; }
.pp-empty { grid-column: 1 / -1; padding: 12px; text-align: center; }
fieldset.opts { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; }
fieldset.opts .check { font-size: .88rem; align-items: flex-start; }
fieldset.opts .check input { margin-top: 2px; flex: none; }
.time-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- Dialog ---------- */
dialog { border: 0; border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 24px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(15, 20, 35, .45); backdrop-filter: blur(3px); }
.dlg-head { padding: 18px 22px 12px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: flex-start; }
.dlg-head h2 { margin: 0; }
.dlg-body { padding: 18px 22px; max-height: 65vh; overflow: auto; }
.dlg-foot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); border-radius: 0 0 18px 18px; }
.dlg-close { margin-left: auto; border: 0; background: none; font-size: 1.4rem; color: var(--muted); cursor: pointer; line-height: 1; }
.summary { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .9rem; margin-bottom: 16px; background: var(--surface-2); padding: 12px 14px; border-radius: var(--radius-sm); }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 580; }
.person-picker { max-height: 230px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.person-picker label { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-weight: 500; margin: 0; cursor: pointer; }
.person-picker label:last-child { border-bottom: 0; }
.person-picker label:hover { background: var(--surface-2); }
.person-picker input { width: 17px; height: 17px; accent-color: var(--primary); }
.person-picker .search { padding: 8px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px;
              background: radial-gradient(1000px 500px at 10% -10%, color-mix(in srgb, var(--primary) 22%, transparent), transparent),
                          radial-gradient(800px 500px at 110% 110%, color-mix(in srgb, #7b5cff 20%, transparent), transparent), var(--bg); }
.login-card { width: min(410px, 100%); padding: 32px; }
.login-card .brand { flex-direction: column; justify-content: center; margin-bottom: 6px; font-size: 1.3rem; gap: 6px; }
.login-card .brand-logo { width: 72px; height: 72px; }
.login-card p.lead { text-align: center; color: var(--muted); margin: 0 0 22px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- Kennzahlen ---------- */
.stat { padding: 16px 18px; }
.stat .v { font-size: 1.7rem; font-weight: 750; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: .84rem; }
.log { font-size: .84rem; }
pre.output { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; font-size: .78rem; white-space: pre-wrap; max-height: 260px; overflow: auto; margin: 0; }

@media (max-width: 800px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .nav { order: 3; flex: 1 1 100%; overflow-x: auto; }
  .usermenu { margin-left: auto; }
  .userinfo { display: none; }
  .container { padding: 16px 12px 50px; }
  .cal-table th:first-child, .cal-table td:first-child { width: 92px; padding-left: 10px; }
  .cal-week { display: block; overflow-x: auto; }
  .cal-week table { min-width: 820px; }
  .flashes { left: 12px; right: 12px; max-width: none; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .chip { white-space: nowrap; }
  .tl col.tl-c0 { width: 130px; }
  table.tl { min-width: calc(130px + var(--cols) * 28px); }
  .tl-loc small { display: none; }
}
@media print {
  .topbar, .toolbar, .bc-actions, .subnav, .flashes, .btn { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}

/* ---------- IT-Security ---------- */
.badge-plain { background: var(--surface-2); color: var(--muted); }
.badge-sm { font-size: .68rem; padding: 1px 7px; }
.stat-alert { border-color: var(--danger); }
.stat-alert .v { color: var(--danger); }
.sec-tiles { margin-bottom: 16px; }
.sec-chart-card { margin-bottom: 16px; }
.sec-chart { width: 100%; height: auto; display: block; font-family: inherit; }
.sec-chart .gl { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; }
.sec-chart .axis { stroke: var(--muted); stroke-width: 1; opacity: .6; }
.sec-chart .ylab { fill: var(--muted); font-size: 11px; text-anchor: end; }
.sec-chart .xlab { fill: var(--muted); font-size: 11px; text-anchor: middle; }
.sec-chart .vlab { fill: var(--text); font-size: 12px; font-weight: 700; text-anchor: middle; }
.sec-chart .hit { fill: transparent; }
.sec-chart .fill { fill: var(--primary); opacity: .82; transition: opacity .12s; }
.sec-chart .bar-today .fill { opacity: 1; }
.sec-chart .bar:hover .hit { fill: var(--primary-50); }
.sec-chart .bar:hover .fill { opacity: 1; }
.sec-chart .blk { fill: var(--danger); stroke: var(--surface); stroke-width: 2; }
.sec-legend { gap: 18px; font-size: .82rem; color: var(--muted); margin-top: 6px; }
.sec-legend i { display: inline-block; vertical-align: middle; margin-right: 5px; }
.lg-bar { width: 12px; height: 12px; border-radius: 3px 3px 0 0; background: var(--primary); }
.lg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.sec-table summary { cursor: pointer; color: var(--primary); font-size: .86rem; margin-top: 10px; }
.sec-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.sec-cat { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border);
           border-radius: 999px; text-decoration: none; color: var(--text); font-size: .85rem; }
.sec-cat:hover, .sec-cat.active { border-color: var(--primary); background: var(--primary-50); }
.sec-log-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.sec-log-head > div:first-child { flex: 1; min-width: 220px; }
.sec-log td { vertical-align: top; font-size: .86rem; }
.sec-log .nowrap { white-space: nowrap; }
.sec-log .sec-ua { max-width: 240px; word-break: break-word; }
.sec-log tr.sec-blocked td { background: var(--danger-50); }
.sec-log .flag { display: inline-block; font-size: .7rem; font-weight: 700; padding: 0 5px; border-radius: 4px;
                 background: var(--surface-2); border: 1px solid var(--border); }
.sec-switches { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
#einstellungen { margin-top: 16px; }
#log { margin-top: 16px; }
