:root {
  --anthrazit: #575756;
  --anthrazit-dunkel: #3f3f3e;
  --gelb: #f9b104;
  --gelb-dunkel: #d99a00;
  --grau: #f7f6f4;
  --rand: #d6d5d2;
  --text: #2b2b2a;
  --warn: #b45309;
  --rot: #b91c1c;
  --gruen: #15803d;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--grau); color: var(--text); font-size: 16px; }
header { background: #fff; border-bottom: 3px solid var(--gelb); padding: 0.4rem 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; margin-right: auto; text-decoration: none; color: var(--anthrazit); font-weight: 700; }
.brand img { height: 44px; width: auto; }
nav { display: flex; align-items: center; gap: 0.2rem; max-width: 100%; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
nav a { color: var(--anthrazit); text-decoration: none; padding: 0.3rem 0.5rem; border-radius: 4px; border-bottom: 3px solid transparent; }
nav a.active { border-bottom-color: var(--gelb); font-weight: 600; }
nav .link { background: none; border: none; color: var(--anthrazit); cursor: pointer; padding: 0.3rem 0.5rem; font-size: 1rem; }
main { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.card { background: #fff; border-radius: 8px; padding: 1rem; margin-bottom: 1rem; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.card.narrow { max-width: 420px; margin: 2rem auto; }
.card.center { text-align: center; }
.login-logo { display: block; width: 220px; max-width: 100%; margin: 0 auto 1rem; }
h2, h3, h4 { margin: 0 0 0.75rem; color: var(--anthrazit); }
label { display: block; margin-bottom: 0.75rem; font-size: 0.9rem; }
label.inline { display: inline-block; margin-right: 1rem; }
input, select { width: 100%; padding: 0.55rem; border: 1px solid var(--rand); border-radius: 6px; font-size: 1rem; margin-top: 0.2rem; }
input:focus, select:focus { outline: 2px solid var(--gelb); outline-offset: 1px; }
label.inline input, input[type=checkbox] { width: auto; margin-right: 0.3rem; }
fieldset { border: 1px solid var(--rand); border-radius: 6px; margin: 0 0 0.75rem; }
.tagesstunden { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.tagesstunden label { width: 4rem; margin: 0; text-align: center; }
button, a.button { display: inline-block; padding: 0.55rem 1rem; border: 1px solid var(--rand); background: #fff; color: var(--text); border-radius: 6px; font-size: 1rem; cursor: pointer; text-decoration: none; line-height: 1.2; }
button.primary { background: var(--gelb); color: var(--anthrazit-dunkel); border-color: var(--gelb); font-weight: 600; }
button.primary:hover { background: var(--gelb-dunkel); border-color: var(--gelb-dunkel); }
button.danger { color: var(--rot); border-color: var(--rot); }
button.big { padding: 1.2rem 1.5rem; font-size: 1.3rem; min-width: 10rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: end; margin-bottom: 0.75rem; }
.row input, .row select { width: auto; min-width: 8rem; }
.row label { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; margin: 1rem 0; }
.status { font-size: 1.6rem; font-weight: 600; margin: 0.5rem 0; color: var(--anthrazit); }
.status.anwesend { color: var(--gruen); }
.status.pause { color: var(--warn); }
dl.grid { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0 0 0.75rem; }
dl.grid dt { font-weight: 600; }
dl.grid dd { margin: 0; }
ul.entries { list-style: none; padding: 0; margin: 0; color: #6b6b69; }
ul.entries li { padding: 0.15rem 0; }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; margin-bottom: 0.75rem; }
th, td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid #e8e7e4; white-space: nowrap; }
th { background: var(--anthrazit); color: #fff; font-weight: 600; }
tfoot th { background: #f1f0ed; color: var(--text); border-top: 2px solid var(--anthrazit); }
tr.frei td { color: #9c9b98; }
tr.warn td { background: #fef3c7; }
table.archiv td { color: #7a7977; }
tr[data-uid] { cursor: pointer; }
tr[data-uid]:hover td { background: #fdf3d6; }
td.klick { cursor: pointer; text-decoration: underline dotted; }
tr.storniert td { color: #9c9b98; text-decoration: line-through; }
tr.storniert td:last-child { text-decoration: none; }
td input { margin: 0; padding: 0.3rem; }
td input.inline { width: 6rem; }
.split { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }
.grow { flex: 1; min-width: 0; }
.row h3 { margin: 0; min-width: max-content; }
.userlist table td { white-space: normal; }
.userlist tr.selected td { background: #fdf3d6; font-weight: 600; }
.userlist tr.inaktiv td { color: #9c9b98; }
.hint { color: #7a7977; font-size: 0.9rem; }
.warn { color: var(--warn); }
.error { color: var(--rot); }
.st-genehmigt, .st-gemeldet { color: var(--gruen); }
.st-abgelehnt { color: var(--rot); }
.st-beantragt, .st-offen { color: var(--warn); }
table.kal th, table.kal td { padding: 0.15rem 0.3rem; text-align: center; font-size: 0.8rem; }
table.kal th { background: #f1f0ed; color: var(--text); }
table.kal th:first-child, table.kal td:first-child { text-align: left; }
table.kal .we { background: #eeedea; }
table.kal .ft { background: #fdf3d6; }
table.kal td.k-U { background: var(--gelb); color: var(--anthrazit-dunkel); font-weight: 600; }
table.kal td.k-u { background: #fde68a; }
table.kal td.k-K, table.kal td.k-A { background: #d1d5db; }
.tokenbox { background: #fff8e6; border: 1px solid var(--gelb); border-radius: 6px; padding: 0.75rem; margin-top: 0.75rem; }
.tokenbox code { display: block; word-break: break-all; margin: 0.5rem 0; font-size: 1.05rem; }
.form { max-width: 520px; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--rand); }
#toast { position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); background: var(--anthrazit-dunkel); color: #fff; padding: 0.7rem 1.2rem; border-radius: 6px; opacity: 0; transition: opacity 0.2s; pointer-events: none; max-width: 90vw; }
#toast.show { opacity: 1; }
#toast.error { background: var(--rot); }

/* Terminal (Kiosk) */
body.terminal { background: var(--anthrazit-dunkel); color: #fff; display: flex; flex-direction: column; min-height: 100vh; }
body.terminal #app { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 1rem; }
body.terminal .card { color: var(--text); text-align: left; }
body.terminal h2 { color: #fff; }
body.terminal .card h2 { color: var(--anthrazit); }
.idle .logo { height: 150px; background: #fff; border-radius: 12px; padding: 10px; margin-bottom: 1rem; }
.idle .clock { font-size: clamp(3rem, 13vw, 6rem); font-weight: 700; line-height: 1; color: var(--gelb); }
.idle .date { font-size: 1.6rem; margin: 0.5rem 0 1.5rem; color: #d6d5d2; }
.idle .hint { font-size: 1.6rem; color: #fff; }
.idle .msg { color: #fca5a5; font-size: 1.2rem; }
.idle .queue { color: var(--gelb); }
.choice h2 { font-size: 2.6rem; margin-bottom: 0.3rem; }
.choice .state { font-size: 1.5rem; color: #d6d5d2; }
.choice .count { color: #b3b2af; font-size: 1.2rem; }
body.terminal button.big { font-size: 1.8rem; padding: 1.5rem 2rem; min-width: 14rem; }
.result h2 { font-size: 2.4rem; }
.result.ok h2 { color: var(--gelb); }
.result.error h2 { color: #fca5a5; }
.zahnrad { position: fixed; top: 0.5rem; right: 0.5rem; background: none; border: none; color: #6b6b69; font-size: 1.4rem; cursor: pointer; }
.auswahl { width: 100%; max-width: 900px; }
.tablet-idle .kopf { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 0.5rem; }
.tablet-idle .signet { height: 70px; background: #fff; border-radius: 8px; padding: 5px; }
.clock.klein { font-size: clamp(2.2rem, 8vw, 3.4rem); }
.tablet-idle .date { font-size: 1.1rem; margin: 0; }
.tablet-idle .hint { font-size: 1.2rem; }
.auswahl h2 { font-size: 2.2rem; margin-bottom: 0.2rem; }
.namen { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.75rem; margin: 1.5rem 0; max-height: 60vh; overflow-y: auto; }
button.name { padding: 1.3rem 0.75rem; font-size: 1.3rem; background: #4a4a49; color: #fff; border-color: #6b6b69; }
button.name:active { background: var(--gelb); color: var(--anthrazit-dunkel); }
.pinanzeige { font-size: 3rem; letter-spacing: 0.6rem; color: var(--gelb); margin: 1rem 0; }
.pinpad { display: grid; grid-template-columns: repeat(3, 6rem); gap: 0.75rem; justify-content: center; }
.pinpad button { padding: 1.3rem 0; font-size: 1.8rem; background: #4a4a49; color: #fff; border-color: #6b6b69; }
.pinpad button:active { background: var(--gelb); color: var(--anthrazit-dunkel); }
