/* CLAVIS – Design-System
   Dunkles Graphit, helle Flächen, ein elektrischer Akzent (Markenfarbe Cyan #00F4FA aus dem Logo). Alle Werte als Tokens. */

@font-face { font-family: "Inter"; src: url("../fonts/Inter-Variable.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/JetBrainsMono-Variable.ttf") format("truetype"); font-weight: 100 800; font-display: swap; }

:root {
  color-scheme: light dark;
  /* Farben – hell */
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef1f6;
  --line: #e2e7ef;
  --line-strong: #cbd3df;
  --text: #0c1220;
  --text-2: #3d4a5f;
  --muted: #64728a;
  --brand: #00f4fa;
  --accent: #00747d;
  --accent-strong: #005b62;
  --accent-ink: #ffffff;
  --accent-soft: rgba(0, 116, 125, .10);
  --focus: #00b4c0;
  --danger: #c4283b;
  --danger-soft: rgba(196, 40, 59, .10);
  --warn: #a35d00;
  --warn-soft: rgba(214, 140, 0, .14);
  --ok: #0f7a4e;
  --ok-soft: rgba(15, 122, 78, .12);
  --side-bg: #0c1018;
  --side-text: #c9d2e0;
  --side-muted: #7d889c;
  --side-active: #182131;
  /* Status (immer mit Text) */
  --st-draft: #7a869a;
  --st-requested: #c98600;
  --st-confirmed: #00747d;
  --st-rejected: #c4283b;
  --st-cancelled: #8d5c9c;
  --st-completed: #0f7a4e;
  --st-expired: #8a7a63;
  --st-block: #3d4a5f;
  --st-busy: #5c6880;
  /* Typografie */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --fs-xs: .75rem; --fs-sm: .8125rem; --fs-md: .9375rem; --fs-lg: 1.125rem; --fs-xl: 1.5rem; --fs-2xl: 2rem;
  /* Abstände */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  /* Radien & Schatten */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  --shadow: 0 1px 2px rgba(12, 18, 32, .05), 0 4px 16px rgba(12, 18, 32, .05);
  --shadow-pop: 0 12px 40px rgba(12, 18, 32, .18);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: 160ms;
  --touch: 44px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0d13;
    --surface: #121722;
    --surface-2: #161c29;
    --surface-3: #1c2433;
    --line: #232c3c;
    --line-strong: #344055;
    --text: #e8edf5;
    --text-2: #b5c0d2;
    --muted: #8592a8;
    --accent: #00f4fa;
    --accent-strong: #7af9ff;
    --accent-ink: #051019;
    --accent-soft: rgba(0, 244, 250, .12);
    --focus: #00f4fa;
    --danger: #ff6b7d;
    --danger-soft: rgba(255, 107, 125, .12);
    --warn: #f0b443;
    --warn-soft: rgba(240, 180, 67, .12);
    --ok: #3ad69a;
    --ok-soft: rgba(58, 214, 154, .12);
    --side-bg: #07090e;
    --side-active: #141b28;
    --st-draft: #8a96aa;
    --st-requested: #f0b443;
    --st-confirmed: #00f4fa;
    --st-rejected: #ff6b7d;
    --st-cancelled: #c79ad6;
    --st-completed: #3ad69a;
    --st-expired: #b9a787;
    --st-block: #9aa6ba;
    --st-busy: #7d899d;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: var(--fs-md); line-height: 1.5; color: var(--text); background: var(--bg); font-feature-settings: "cv11", "ss01"; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; margin: 0 0 var(--s3); }
h1 { font-size: var(--fs-xl); font-weight: 650; }
h2 { font-size: var(--fs-lg); font-weight: 620; }
h3 { font-size: var(--fs-md); font-weight: 620; }
p { margin: 0 0 var(--s3); }
small, .small { font-size: var(--fs-sm); }
.muted { color: var(--muted); }
.mono, code { font-family: var(--mono); font-size: .92em; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: var(--r-sm); z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; padding: var(--s4) var(--s3); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: var(--s2) var(--s2) var(--s5); }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; width: 168px; max-width: 100%; height: auto; }
.brand-name { color: var(--side-muted); font-size: var(--fs-xs); font-weight: 500; letter-spacing: .04em; padding-left: 2px; }
.ctx-switch { padding: 0 var(--s2) var(--s4); }
.ctx-label { display: block; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); margin-bottom: var(--s1); }
.ctx-switch select { width: 100%; background: #111723; color: #e8edf5; border: 1px solid #263044; border-radius: var(--r-sm); padding: 8px; min-height: 40px; font: inherit; font-size: var(--fs-sm); }
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: var(--s3); color: var(--side-text); padding: 9px var(--s3); border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 500; min-height: 40px; transition: background var(--t) var(--ease), color var(--t); }
.nav a:hover { background: var(--side-active); color: #fff; text-decoration: none; }
.nav a.active { background: var(--side-active); color: #fff; box-shadow: inset 2px 0 0 var(--brand); }
.nav-sep { height: 1px; background: #1c2433; margin: var(--s2) var(--s2); }
.sidebar-foot { margin-top: auto; padding: var(--s3) var(--s2) 0; font-size: var(--fs-xs); color: var(--side-muted); }
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s5); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.search { flex: 1; max-width: 520px; position: relative; }
.search input { width: 100%; padding: 9px 12px 9px 36px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-sm); min-height: 40px; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s3); }
.content { padding: var(--s5); max-width: 1440px; width: 100%; }
.content:focus { outline: none; }
.nav-toggle { display: none; }

/* ---------- Menü ---------- */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--text); font-weight: 650; border: 1px solid var(--line); }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-pop); min-width: 240px; padding: var(--s2); z-index: 30; }
.menu-pop a, .menu-pop .linklike { display: block; width: 100%; text-align: left; padding: 10px var(--s3); border-radius: var(--r-sm); color: var(--text); font-size: var(--fs-sm); }
.menu-pop a:hover, .menu-pop .linklike:hover { background: var(--surface-3); text-decoration: none; }
.menu-head { padding: var(--s2) var(--s3) var(--s3); border-bottom: 1px solid var(--line); margin-bottom: var(--s2); display: flex; flex-direction: column; }
.linklike { background: none; border: 0; font: inherit; cursor: pointer; color: var(--accent); padding: 0; }

/* ---------- Seitenkopf ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--s1); }
.actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.breadcrumb { font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--s2); }

/* ---------- Karten / Raster ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow); }
.card + .card { margin-top: var(--s4); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: var(--s4); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.stack > * + * { margin-top: var(--s4); }
.kpi { padding: var(--s4) var(--s5); }
.kpi .label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.kpi .value { font-size: var(--fs-2xl); font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: var(--s1); }
.kpi .hint { font-size: var(--fs-sm); color: var(--muted); }
.kpi.attention .value { color: var(--warn); }
.kpi.alert .value { color: var(--danger); }
dl.props { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: var(--s2) var(--s4); margin: 0; }
dl.props dt { color: var(--muted); font-size: var(--fs-sm); }
dl.props dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; padding: 10px var(--s3); border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
table.t td { padding: 11px var(--s3); border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td { background: var(--surface-2); }
table.t tfoot td { font-weight: 650; background: var(--surface-2); }
.empty { text-align: center; padding: var(--s7) var(--s5); color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: var(--fs-lg); margin-bottom: var(--s2); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; border: 1px solid currentColor; white-space: nowrap; line-height: 1.6; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-draft { color: var(--st-draft); } .st-requested { color: var(--st-requested); } .st-confirmed { color: var(--st-confirmed); }
.st-rejected { color: var(--st-rejected); } .st-cancelled { color: var(--st-cancelled); } .st-completed { color: var(--st-completed); }
.st-expired { color: var(--st-expired); } .st-block { color: var(--st-block); } .st-busy { color: var(--st-busy); }
.tag { display: inline-block; padding: 1px 8px; border-radius: var(--r-sm); background: var(--surface-3); color: var(--text-2); font-size: var(--fs-xs); font-weight: 600; }
.tag-warn { background: var(--warn-soft); color: var(--warn); } .tag-ok { background: var(--ok-soft); color: var(--ok); } .tag-danger { background: var(--danger-soft); color: var(--danger); } .tag-accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--touch); padding: 0 var(--s4); border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; transition: background var(--t) var(--ease), border-color var(--t), transform var(--t); text-decoration: none !important; white-space: nowrap; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); background: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { min-height: 36px; padding: 0 var(--s3); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-icon { width: var(--touch); height: var(--touch); display: inline-grid; place-items: center; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.inline-form { display: inline; }

/* ---------- Formulare ---------- */
.form { max-width: 860px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.form-grid .full { grid-column: 1 / -1; }
.field label, .field .label { display: block; font-size: var(--fs-sm); font-weight: 600; margin-bottom: 6px; color: var(--text); }
.field .req { color: var(--danger); margin-left: 2px; }
.field .help { font-size: var(--fs-sm); color: var(--muted); margin-top: 4px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=tel], input[type=url], input[type=search], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; min-height: var(--touch); border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-md);
  transition: border-color var(--t), box-shadow var(--t);
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
[aria-invalid="true"] { border-color: var(--danger) !important; box-shadow: 0 0 0 3px var(--danger-soft); }
.field-error { color: var(--danger); font-size: var(--fs-sm); margin: 4px 0 0; font-weight: 500; }
.check { display: flex; gap: var(--s2); align-items: flex-start; min-height: var(--touch); padding-top: 10px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
fieldset { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s4); margin: 0 0 var(--s4); }
legend { font-weight: 650; padding: 0 var(--s2); }
.form-actions { display: flex; gap: var(--s2); justify-content: flex-end; margin-top: var(--s5); flex-wrap: wrap; }
.code-input { font-family: var(--mono); font-size: var(--fs-xl); letter-spacing: .35em; text-align: center; max-width: 240px; }

/* ---------- Hinweise ---------- */
.alert { padding: var(--s3) var(--s4); border-radius: var(--r-md); margin-bottom: var(--s4); border: 1px solid; font-size: var(--fs-sm); font-weight: 500; }
.alert-success { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: var(--ok); }
.alert-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); }
.alert-info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent-strong); }
.alert-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--warn); }
.callout { border-left: 3px solid var(--accent); background: var(--surface-2); padding: var(--s3) var(--s4); border-radius: 0 var(--r-md) var(--r-md) 0; font-size: var(--fs-sm); }
.callout.warn { border-left-color: var(--warn); }
.callout.danger { border-left-color: var(--danger); }
.consequences { margin: var(--s3) 0; padding-left: var(--s5); }
.consequences li { margin-bottom: var(--s1); }

/* ---------- Schritte (Assistent/Installer) ---------- */
.steps { display: flex; gap: var(--s2); list-style: none; padding: 0; margin: 0 0 var(--s5); flex-wrap: wrap; counter-reset: step; }
.steps li { counter-increment: step; display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); color: var(--muted); padding: 6px var(--s3) 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.steps li::before { content: counter(step); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); font-weight: 650; font-size: var(--fs-xs); }
.steps li.current { color: var(--text); border-color: var(--accent); }
.steps li.current::before { background: var(--accent); color: var(--accent-ink); }
.steps li.done::before { content: "✓"; background: var(--ok-soft); color: var(--ok); }

/* ---------- Plain-Layout ---------- */
body.plain { min-height: 100vh; background: radial-gradient(1200px 600px at 80% -10%, rgba(0,244,250,.10), transparent 60%), var(--bg); }
.plain-main { max-width: 760px; margin: 0 auto; padding: var(--s7) var(--s4); }
.plain-main.narrow, .auth-card { max-width: 440px; margin-left: auto; margin-right: auto; }
.plain-brand { display: flex; flex-direction: column; align-items: center; gap: var(--s2); margin-bottom: var(--s6); }
.plain-brand .brand-logo { width: 240px; }
.plain-brand .brand-name { color: var(--muted); font-size: var(--fs-sm); padding: 0; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: grid; grid-template-columns: 28px 1fr; gap: var(--s2); padding: var(--s2) 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.checklist .s-ok::before { content: "✓"; color: var(--ok); font-weight: 700; }
.checklist .s-warn::before { content: "!"; color: var(--warn); font-weight: 700; }
.checklist .s-error::before { content: "✕"; color: var(--danger); font-weight: 700; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2); font-family: var(--mono); font-size: var(--fs-md); background: var(--surface-2); padding: var(--s4); border-radius: var(--r-md); border: 1px dashed var(--line-strong); }
.qr { background: #fff; padding: var(--s3); border-radius: var(--r-md); display: inline-block; }
.qr img { display: block; width: 220px; height: 220px; }

/* ---------- Kalender ---------- */
.cal-toolbar { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-bottom: var(--s4); }
.cal-toolbar .seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-md); overflow: hidden; }
.cal-toolbar .seg button { border: 0; background: var(--surface); color: var(--text); padding: 0 var(--s3); min-height: 40px; font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.cal-toolbar .seg button + button { border-left: 1px solid var(--line); }
.cal-toolbar .seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.cal-title { font-size: var(--fs-lg); font-weight: 650; margin: 0 var(--s3); min-width: 200px; }
.cal-filters { display: flex; gap: var(--s2); flex-wrap: wrap; margin-left: auto; }
.cal-filters select { width: auto; min-width: 150px; min-height: 40px; padding: 6px 10px; font-size: var(--fs-sm); }
.legend { display: flex; flex-wrap: wrap; gap: var(--s3); margin: 0 0 var(--s3); padding: 0; list-style: none; font-size: var(--fs-xs); }
.cal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-month .dow { padding: 8px; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal-day { min-height: 118px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.other { background: var(--surface-2); }
.cal-day.other .dnum { color: var(--muted); }
.cal-day.today .dnum { background: var(--accent); color: var(--accent-ink); }
.dnum { font-size: var(--fs-xs); font-weight: 650; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.ev { display: block; font-size: var(--fs-xs); line-height: 1.3; padding: 3px 6px; border-radius: 5px; border-left: 3px solid currentColor; background: color-mix(in srgb, currentColor 12%, var(--surface)); text-align: left; width: 100%; border-top: 0; border-right: 0; border-bottom: 0; cursor: pointer; font-family: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev .evt { color: var(--text); font-weight: 600; }
.ev .evs { color: var(--muted); }
.ev.neutral { background: repeating-linear-gradient(135deg, color-mix(in srgb, currentColor 10%, var(--surface)) 0 6px, var(--surface) 6px 12px); cursor: default; }
.ev[draggable="true"] { cursor: grab; }
.more { font-size: var(--fs-xs); color: var(--muted); }
.cal-week { display: grid; grid-template-columns: 56px repeat(7, minmax(0, 1fr)); position: relative; }
.cal-week.day { grid-template-columns: 56px 1fr; }
.cw-head { padding: 8px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: var(--fs-xs); font-weight: 600; text-align: center; }
.cw-hours { border-right: 1px solid var(--line); }
.cw-hour { height: 44px; font-size: 10px; color: var(--muted); text-align: right; padding-right: 6px; transform: translateY(-6px); font-variant-numeric: tabular-nums; }
.cw-col { position: relative; border-right: 1px solid var(--line); background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 44px; min-height: calc(44px * 24); }
.cw-col:last-child { border-right: 0; }
.cw-col .ev { position: absolute; left: 3px; right: 3px; white-space: normal; overflow: hidden; }
.cw-col .ev.buffer { opacity: .5; }
.cw-allday { grid-column: 1 / -1; display: grid; grid-template-columns: inherit; border-bottom: 1px solid var(--line); }
.cal-list { list-style: none; margin: 0; padding: 0; }
.cal-list .lday { padding: 10px var(--s4); background: var(--surface-2); font-size: var(--fs-sm); font-weight: 650; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.cal-list .litem { display: grid; grid-template-columns: 130px 1fr auto; gap: var(--s3); padding: 12px var(--s4); border-bottom: 1px solid var(--line); align-items: center; }
.cal-list .litem:hover { background: var(--surface-2); }
.cal-empty { padding: var(--s7); text-align: center; color: var(--muted); }
.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; }

/* ---------- Dialog ---------- */
dialog { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); max-width: min(560px, calc(100vw - 32px)); width: 100%; }
dialog::backdrop { background: rgba(5, 8, 14, .55); backdrop-filter: blur(2px); }
.dlg-body { padding: var(--s5); }
.dlg-foot { padding: var(--s4) var(--s5); border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: var(--s2); background: var(--surface-2); }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 var(--s4) var(--s4); font-size: var(--fs-sm); }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline .when { color: var(--muted); font-size: var(--fs-xs); }

/* ---------- Preisrechner ---------- */
.price-table td.desc { width: 50%; }
.price-sum { display: grid; grid-template-columns: 1fr auto; gap: var(--s1) var(--s4); max-width: 360px; margin-left: auto; margin-top: var(--s3); font-variant-numeric: tabular-nums; }
.price-sum .total { font-weight: 700; font-size: var(--fs-lg); border-top: 1px solid var(--line); padding-top: var(--s2); }

/* ---------- Icons (CSS-Masken, lokal) ---------- */
.ico { width: 18px; height: 18px; display: inline-block; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; flex: none; }
.ico-grid { --i: url("../img/i-grid.svg"); } .ico-calendar { --i: url("../img/i-calendar.svg"); } .ico-list { --i: url("../img/i-list.svg"); }
.ico-door { --i: url("../img/i-door.svg"); } .ico-users { --i: url("../img/i-users.svg"); } .ico-doc { --i: url("../img/i-doc.svg"); }
.ico-tag { --i: url("../img/i-tag.svg"); } .ico-chart { --i: url("../img/i-chart.svg"); } .ico-cog { --i: url("../img/i-cog.svg"); }
.ico-shield { --i: url("../img/i-shield.svg"); } .ico-search { --i: url("../img/i-search.svg"); } .ico-plus { --i: url("../img/i-plus.svg"); }
.ico-menu { --i: url("../img/i-menu.svg"); }

/* ---------- Korrekturen Spezifität ---------- */
.search input[type=search] { padding-left: 36px; }
.grid > .card + .card { margin-top: 0; }
.btn-icon.nav-toggle { display: none; }
.topbar-mark { display: none; flex: none; }
.topbar-mark img { display: block; width: 30px; height: 30px; }
a.ev:hover { text-decoration: none; filter: brightness(.97); }

/* ---------- Responsiv ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 50; transform: translateX(-100%); transition: transform var(--t) var(--ease); }
  .sidebar.open { transform: none; box-shadow: var(--shadow-pop); }
  .btn-icon.nav-toggle { display: inline-grid; }
  .topbar-mark { display: block; }
  .topbar { padding: var(--s2) var(--s3); }
  .content { padding: var(--s4) var(--s3); }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  dl.props { grid-template-columns: 1fr; gap: 2px var(--s4); }
  dl.props dd { margin-bottom: var(--s2); }
  .cal-day { min-height: 84px; }
  .cal-list .litem { grid-template-columns: 1fr; gap: var(--s1); }
  .topbar-actions .btn .lbl { display: none; }
  .topbar-actions .btn { padding: 0 var(--s3); }
  .search input { font-size: 16px; }
  input, select, textarea { font-size: 16px !important; }
  .card { padding: var(--s4); }
  .cal-filters { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; scroll-behavior: auto !important; }
}
@media print {
  .sidebar, .topbar, .actions, .form-actions { display: none !important; }
  .shell { display: block; }
}
.narrow-card { max-width: 640px; }
.break { word-break: break-all; }
.cal-list .litem .badge { justify-self: start; }
