/* Layout: Kopfzeile mit drei Ansichten, darunter Monatskalender, darunter Terminliste; in der Verwaltung links ein Formular. */
:root {
  --bg: #f4f6f5;
  --surface: #ffffff;
  --ink: #17302e;
  --muted: #5d7270;
  --line: #d9e1df;
  --accent: #d9622b;
  --accent-ink: #ffffff;
  --intern: #2c5f9e;
  --intern-bg: #e6eef8;
  --pub-bg: #fbe9df;
  --today: #fff7c2;
  --font-display: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101b1a; --surface: #182827; --ink: #e6efed; --muted: #93aaa7; --line: #2c4240;
    --accent: #f08a57; --accent-ink: #1a0f08; --intern: #8db8f0; --intern-bg: #1d3350;
    --pub-bg: #4a2c1d; --today: #4a4519; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101b1a; --surface: #182827; --ink: #e6efed; --muted: #93aaa7; --line: #2c4240;
  --accent: #f08a57; --accent-ink: #1a0f08; --intern: #8db8f0; --intern-bg: #1d3350;
  --pub-bg: #4a2c1d; --today: #4a4519; color-scheme: dark;
}
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  padding-block: 20px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
h1, h2 { font-family: var(--font-display); margin: 0; text-wrap: balance; }
h1 { font-size: 26px; }
h2 { font-size: 18px; }
header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
nav { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 4px; }
nav a { padding: 7px 14px; border-radius: 7px; color: var(--muted); text-decoration: none; font-weight: 500; }
nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
nav a:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.layout { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
.layout.with-form { grid-template-columns: 300px minmax(0, 1fr); }
@media (max-width: 800px) { .layout.with-form { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-width: 0; }
form { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; font-size: 13px; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; }
input[type=text], input[type=password], input[type=date], input[type=time], textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; box-sizing: border-box; }
textarea { min-height: 90px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
button { font: inherit; font-weight: 500; border-radius: 8px; padding: 8px 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.danger { color: #b3261e; }
:root[data-theme="dark"] button.danger { color: #ff9a92; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.cal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cal-head .btns { align-items: center; }
.grid-scroll { overflow-x: auto; }
.grid { display: grid; grid-template-columns: repeat(7, minmax(84px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); min-width: 600px; }
.dow, .cell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dow { padding: 6px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.cell { min-height: 88px; padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cell.other { opacity: .45; }
.cell.today { background: var(--today); }
.cell .n { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
a.chip { display: block; text-decoration: none; box-sizing: border-box; font-size: 12px; line-height: 1.3; padding: 2px 6px; border-radius: 5px; background: var(--pub-bg); text-align: left; border: 0; font-weight: 500; overflow-wrap: anywhere; width: 100%; color: var(--ink); }
.chip.intern { background: var(--intern-bg); color: var(--intern); }
.list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.ev { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px 12px; display: grid; gap: 4px; }
.ev.intern { border-left-color: var(--intern); }
.ev .when { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ev .t { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.ev .prog { white-space: pre-wrap; overflow-wrap: anywhere; }
.ev .who { font-size: 13px; color: var(--muted); }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--intern-bg); color: var(--intern); margin-left: 6px; text-transform: uppercase; letter-spacing: .05em; }
.empty { color: var(--muted); padding: 16px 0; }
.note { background: var(--intern-bg); color: var(--ink); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.chip.intern, a.chip.intern { background: var(--intern-bg); color: var(--intern); }
.auth { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.auth form { flex-direction: row; display: inline; }
.auth a { color: var(--muted); }
.flash { background: var(--pub-bg); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.flash.err { background: #fbe3e1; color: #7a1710; }
:root[data-theme="dark"] .flash.err { background: #4a1f1b; color: #ffb4ad; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
td form { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
td input[type=password] { width: 12em; }
.narrow { max-width: 460px; margin: 0 auto; }
@media print { nav, .btns, .auth, .panel form { display: none; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .flash.err { background: #4a1f1b; color: #ffb4ad; } }
a.btn { display: inline-block; font-weight: 500; border-radius: 8px; padding: 8px 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; }
.btns form { display: inline; }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
