/* Belegungsplan IFZO – keine externen Ressourcen (DSGVO), Systemschriften */
:root {
  --bg: #f1f5f4;
  --surface: #ffffff;
  --ink: #18302c;
  --muted: #586c68;
  --line: #d4dfdc;
  --grid: #e6eeec;
  --brand: #3c9c90;
  --brand-strong: #23695f;
  --brand-soft: #dcefeb;
  --pending: #8a6a12;
  --danger: #a63d2a;
  --warn-bg: #fdf5df;
  --hour: 2.6rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1c1a; --surface: #162825; --ink: #e3eeeb; --muted: #9fb3ae;
    --line: #2c4440; --grid: #20352f; --brand: #4fb3a6; --brand-strong: #7fd0c4;
    --brand-soft: #1f3f3a; --pending: #e0c172; --danger: #f08b77; --warn-bg: #3a3218;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 1rem/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
a { color: var(--brand-strong); text-underline-offset: .15em; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }
h1, h2 { line-height: 1.2; margin: 0 0 .75rem; }
h2 { font-size: 1.2rem; }
.muted, .hint, .opt { color: var(--muted); }
.hint { font-size: .9rem; margin: .25rem 0 1rem; }
.opt { font-weight: 400; font-size: .85em; }

/* Kopf und Fuß */
header.site { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .8rem; color: inherit; text-decoration: none; }
.brand strong { display: block; font-size: 1.05rem; }
.brand small { color: var(--muted); }
.brand-mark { width: .6rem; height: 2.4rem; border-radius: 1px; background: linear-gradient(var(--brand) 0 62%, var(--brand-soft) 62% 100%); }
.who { margin: 0; color: var(--muted); font-size: .9rem; }
footer.site { margin-top: 4rem; padding: 1.5rem 0 2.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
footer.site p { margin: .25rem 0; }
main.wrap { padding-top: 2rem; }

/* Wochenkopf */
.plan-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.plan-head h1 { font-size: clamp(1.3rem, 2.4vw, 1.75rem); font-weight: 600; margin: 0; }
.kw { display: block; font-size: clamp(2.6rem, 6vw, 4rem); line-height: 1; font-weight: 750; letter-spacing: -.02em; color: var(--brand-strong); }
.weeknav { display: flex; gap: .5rem; flex-wrap: wrap; }
.weeknav a, .button, button {
  display: inline-block; font: inherit; font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer;
  padding: .5rem .9rem; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
}
.weeknav a:hover, .button:hover, button.secondary:hover { border-color: var(--brand); }
button.primary { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
@media (prefers-color-scheme: dark) { button.primary { color: #0f1c1a; } }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--danger); border-color: transparent; background: transparent; }
button.danger:hover { border-color: var(--danger); }

/* Wochenraster */
.week-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.week {
  display: grid; min-width: 40rem;
  grid-template-columns: 3.5rem repeat(var(--days), minmax(6.5rem, 1fr));
  grid-template-rows: auto calc(var(--hours) * var(--hour));
}
.corner { border-bottom: 1px solid var(--line); }
.corner, .hours { position: sticky; left: 0; z-index: 4; background: var(--surface); }
.dayhead { padding: .6rem .7rem; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .5rem; }
.dayhead .wd { font-weight: 650; }
.dayhead .dn { color: var(--muted); }
.dayhead .dayask { margin-left: auto; font-size: .8rem; }
.dayhead.is-today { box-shadow: inset 0 -3px 0 var(--brand); }
.hours { display: grid; grid-template-rows: repeat(var(--hours), var(--hour)); }
.hours span { font-size: .75rem; color: var(--muted); text-align: right; padding-right: .5rem; transform: translateY(-.55em); }
.hours span:first-child { transform: none; }
.daycol {
  position: relative; border-left: 1px solid var(--line);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px);
  background-size: 100% var(--hour), 100% calc(var(--hour) / 2);
}
.daycol.is-today { background-color: color-mix(in srgb, var(--brand-soft) 45%, transparent); }
.nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--brand); z-index: 3; }
.nowline::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.slot {
  position: absolute; z-index: 2; overflow: hidden; padding: .25rem .45rem; margin: 1px 0 0 2px;
  border-left: 4px solid var(--brand-strong); border-radius: 2px;
  background: var(--brand-soft); color: var(--ink); text-decoration: none;
  font-size: .8rem; line-height: 1.25; display: flex; flex-direction: column;
}
.slot .slot-time { font-weight: 650; }
.slot.is-pending {
  border-left-style: dashed; border-left-color: var(--pending);
  background: repeating-linear-gradient(135deg, var(--surface) 0 6px, var(--warn-bg) 6px 12px);
}
a.slot:hover { outline: 2px solid var(--brand); }
.legend { display: flex; align-items: center; gap: .4rem 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin: .6rem 0 0; }
.key { display: inline-block; width: 1rem; height: .8rem; vertical-align: middle; border-left: 3px solid var(--brand-strong); background: var(--brand-soft); }
.key-pending { border-left: 3px dashed var(--pending); background: repeating-linear-gradient(135deg, var(--surface) 0 3px, var(--warn-bg) 3px 6px); }

/* Formular und Seitenspalte */
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 2.5rem; margin-top: 3rem; }
@media (max-width: 52rem) { .split { grid-template-columns: 1fr; gap: 2rem; } }
fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; min-width: 0; }
legend { font-weight: 650; padding: 0; margin-bottom: .6rem; }
fieldset fieldset legend { font-weight: 600; font-size: .95rem; margin-bottom: .3rem; }
label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .9rem; }
input, select, textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .55rem .65rem; font: inherit; font-weight: 400;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 2px solid var(--brand-soft); }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.row3 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 0 1rem; }
.split.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 1.5rem; }
@media (max-width: 52rem) { .split.even { grid-template-columns: 1fr; } }
@media (max-width: 34rem) { .row2, .row3 { grid-template-columns: 1fr; } }
label.check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; margin-bottom: .45rem; }
label.check input { width: auto; margin-top: .3rem; flex: none; }
.privacy { font-size: .9rem; margin: 1rem 0 1.5rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.errors, .warn, .flash { border-radius: 4px; padding: .75rem 1rem; margin: 0 0 1.25rem; }
.errors { border: 1px solid var(--danger); color: var(--danger); background: var(--surface); }
.errors p { margin: 0 0 .3rem; font-weight: 650; }
.errors ul, .warn ul { margin: 0; padding-left: 1.2rem; }
.warn { background: var(--warn-bg); }
.warn p { margin: 0 0 .3rem; font-weight: 650; }
.flash-ok { background: var(--brand-soft); }
.flash-error { background: var(--warn-bg); color: var(--danger); }

.side h2 + * { margin-top: 0; }
.side h2:not(:first-child) { margin-top: 2.25rem; }
.steps { padding-left: 1.3rem; margin: 0; }
.steps li { margin-bottom: .7rem; }
.upcoming { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.upcoming li { display: grid; grid-template-columns: 8.4rem 6.5rem 1fr; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.u-time { color: var(--muted); }
@media (max-width: 26rem) { .upcoming li { grid-template-columns: 1fr 1fr; } .u-label { grid-column: 1 / -1; } }

.notice { max-width: 38rem; padding: 2rem 0; }

/* Verwaltung */
.admin-title { font-size: 1.6rem; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
body.is-admin section { margin-bottom: 2.5rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 1.25rem 1.4rem; }
.count { display: inline-block; min-width: 1.6rem; padding: 0 .4rem; text-align: center; border-radius: 99px; background: var(--brand-strong); color: var(--surface); font-size: .85rem; }
table.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); font-size: .93rem; }
table.list th { text-align: left; font-size: .85rem; color: var(--muted); font-weight: 600; padding: .55rem .75rem; border-bottom: 1px solid var(--line); }
table.list td { padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list td:last-child { text-align: right; }
tr.is-past { color: var(--muted); }
@media (max-width: 44rem) {
  table.list thead { display: none; }
  table.list tr { display: block; border-bottom: 1px solid var(--line); padding: .4rem 0; }
  table.list td { display: block; border: 0; padding: .2rem .75rem; }
  table.list td:last-child { text-align: left; }
}
.tag { font-size: .75rem; padding: .05rem .4rem; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); }
.status { font-size: .85rem; font-weight: 600; padding: .15rem .55rem; border-radius: 3px; background: var(--brand-soft); }
.status-angefragt { background: var(--warn-bg); color: var(--pending); }
.status-abgelehnt, .status-storniert { background: transparent; border: 1px solid var(--line); color: var(--muted); }
dl.facts { display: grid; grid-template-columns: 8rem 1fr; gap: .35rem 1rem; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
