/* Fink Zeit – eigenes, schlankes Stylesheet (keine externen Quellen). Mobile first. */
:root {
  --green: #3f8f2a;
  --green-dark: #2f6d1f;
  --green-soft: #e8f3e3;
  --bg: #f4f6f3;
  --surface: #ffffff;
  --text: #1c2419;
  --muted: #5f6b5b;
  --border: #dde3da;
  --red: #c0392b;
  --red-soft: #fdecea;
  --amber: #b7791f;
  --amber-soft: #fff6e0;
  --blue: #2563eb;
  --blue-soft: #e8f0ff;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  --nav-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121611; --surface: #1b2119; --text: #e6ebe3; --muted: #9aa695; --border: #2e372b;
    --green-soft: #1f3319; --red-soft: #3a1d1a; --amber-soft: #3a2f16; --blue-soft: #1a2540;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
a { color: var(--green-dark); }
@media (prefers-color-scheme: dark) { a { color: #8fd174; } .topnav a.active, .topnav a:hover { color: #a5e08b; } .bottomnav a.active { color: #8fd174; } }
h1 { font-size: 1.45rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.4rem 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
small, .muted { color: var(--muted); }
.mono { font-variant-numeric: tabular-nums; }

/* Kopfzeile */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand img { height: 26px; width: auto; }
.topnav { display: none; gap: .25rem; margin-left: 1rem; flex-wrap: wrap; }
.topnav a { padding: .4rem .6rem; white-space: nowrap; border-radius: 8px; text-decoration: none; color: var(--text); font-weight: 500; }
.topnav a.active, .topnav a:hover { background: var(--green-soft); color: var(--green-dark); }
.topbar .spacer { flex: 1; }
.userbox { display: flex; align-items: center; gap: .5rem; font-size: .9rem; white-space: nowrap; }
@media (max-width: 520px) { .userbox a.muted { display: none; } }
.userbox form { margin: 0; }

/* Untere Navigation (Handy) */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; justify-content: space-around;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--border);
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 600;
}
.bottomnav a.active { color: var(--green); }
.bottomnav svg { width: 24px; height: 24px; }

main { max-width: 1200px; margin: 0 auto; padding: 1rem; }

@media (min-width: 1100px) {
  body { padding-bottom: 0; }
  .bottomnav { display: none; }
  .topnav { display: flex; }
  main { padding: 1.5rem 2rem; }
  h1 { font-size: 1.7rem; }
}

/* Karten & Raster */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .grid.four { grid-template-columns: repeat(4, 1fr); } .grid.sidebar { grid-template-columns: 2fr 1fr; } }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; }
.stat .label { font-size: .8rem; color: var(--muted); }
.stat .value { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pos { color: var(--green-dark); } .neg { color: var(--red); }
@media (prefers-color-scheme: dark) { .pos { color: #8fd174; } }

/* Stempeln */
.clock { text-align: center; padding: 1.2rem 1rem; }
.clock .time { font-size: 3rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .02em; line-height: 1.1; }
.clock .state { margin-top: .3rem; font-weight: 600; }
.state-in { color: var(--green-dark); } .state-break { color: var(--amber); } .state-out { color: var(--muted); }
.punch-buttons { display: grid; gap: .75rem; grid-template-columns: 1fr 1fr; margin-top: 1rem; }
.punch-buttons form { margin: 0; }
.punch-buttons .btn { width: 100%; min-height: 72px; font-size: 1.15rem; }
.punch-buttons .wide { grid-column: 1 / -1; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .55rem 1rem;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; touch-action: manipulation;
}
.btn:hover { filter: brightness(.97); }
.btn:focus-visible, .input:focus-visible, a:focus-visible { outline: 3px solid #86c76b; outline-offset: 2px; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-warn { background: var(--amber); border-color: var(--amber); color: #fff; }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 34px; padding: .3rem .65rem; font-size: .88rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* Formulare */
form.stack { display: grid; gap: .8rem; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .25rem; }
.field .help { font-size: .82rem; color: var(--muted); margin-top: .2rem; }
.field .errors { color: var(--red); font-size: .88rem; margin: .2rem 0 0; padding-left: 1rem; }
.input, select, textarea {
  width: 100%; min-height: 44px; padding: .55rem .7rem; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
}
textarea.input { min-height: 80px; }
.check { width: 22px; height: 22px; vertical-align: middle; margin-right: .4rem; accent-color: var(--green); }
.field-check label { display: flex; align-items: center; font-weight: 500; }
.form-grid { display: grid; gap: .8rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
ul.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; max-height: 240px; overflow: auto; }

/* Tabellen */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .5rem .6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--bg); position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.weekend td { background: rgba(127,127,127,.06); }
tr.today td { box-shadow: inset 3px 0 0 var(--green); }
tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 700; background: var(--bg); }

/* Monat auf dem Handy als Liste */
.daylist { display: grid; gap: .5rem; }
.day { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .6rem .8rem; }
.day.weekend { opacity: .8; }
.day.today { border-color: var(--green); }
.day-head { display: flex; justify-content: space-between; gap: .5rem; font-weight: 600; }
.day-body { font-size: .9rem; color: var(--muted); margin-top: .2rem; }
.only-desktop { display: none; }
@media (min-width: 900px) { .only-desktop { display: block; } .only-mobile { display: none; } }

/* Hinweise */
.alert { padding: .75rem 1rem; border-radius: 10px; margin-bottom: .8rem; border: 1px solid transparent; }
.alert-success { background: var(--green-soft); border-color: #b8dca9; }
.alert-error { background: var(--red-soft); border-color: #f2b8b1; }
.alert-warning, .alert-info { background: var(--amber-soft); border-color: #f0d9a0; }
@media (prefers-color-scheme: dark) { .alert { border-color: var(--border); } }
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--bg); border: 1px solid var(--border); white-space: nowrap; }
.badge-ok { background: var(--green-soft); color: var(--green-dark); border-color: #b8dca9; }
.badge-error { background: var(--red-soft); color: var(--red); border-color: #f2b8b1; }
.badge-warn { background: var(--amber-soft); color: var(--amber); border-color: #f0d9a0; }
.badge-info { background: var(--blue-soft); color: var(--blue); border-color: #c4d5fb; }
.v-error { color: var(--red); } .v-warn { color: var(--amber); } .v-info { color: var(--blue); }
.dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; vertical-align: middle; margin-right: .3rem; }

/* Kalender */
.cal { font-size: .78rem; }
.cal th, .cal td { padding: .25rem; text-align: center; min-width: 28px; }
.cal td.name, .cal th.name { text-align: left; min-width: 150px; position: sticky; left: 0; background: var(--surface); z-index: 1; white-space: nowrap; }
.cal td.we { background: rgba(127,127,127,.12); }
.cal td.hol { background: rgba(37,99,235,.12); }
.cal .abs { display: block; border-radius: 4px; color: #fff; font-weight: 700; padding: .1rem 0; }
.cal .abs.pending { opacity: .5; outline: 1px dashed currentColor; }
.cal .abs.half { background-image: linear-gradient(135deg, transparent 50%, rgba(255,255,255,.55) 50%); }

/* Seitenkopf */
.pagehead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .8rem; }
.pagehead h1 { margin: 0; }
.monthnav { display: flex; align-items: center; gap: .4rem; }
.monthnav strong { min-width: 9rem; text-align: center; }

/* Login */
.auth { max-width: 440px; margin: 2rem auto; }
.auth .logo { text-align: center; margin-bottom: 1rem; }
.auth .logo img { height: 48px; }
.divider { text-align: center; color: var(--muted); margin: .8rem 0; font-size: .9rem; }

/* Kiosk */
body.kiosk { padding-bottom: 0; }
.kiosk-wrap { max-width: 720px; margin: 0 auto; padding: 1.5rem; }
.kiosk-wrap .input { font-size: 1.4rem; min-height: 60px; text-align: center; letter-spacing: .1em; }
.kiosk-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.kiosk-buttons .btn { min-height: 90px; font-size: 1.3rem; }
.kiosk-result { text-align: center; font-size: 1.5rem; padding: 2rem 1rem; }

/* Druck */
@media print {
  .topbar, .bottomnav, .no-print, .messages { display: none !important; }
  body { background: #fff; color: #000; padding: 0; font-size: 11px; }
  main { max-width: none; padding: 0; }
  .card, .table-wrap { border: 0; box-shadow: none; }
  th { position: static; }
}
.pagefoot { margin-top: 2rem; font-size: .85rem; }
.abs-masked { background: #94a3b8; }
.mt { margin-top: 1rem; } .mb0 { margin-bottom: 0; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.big { font-size: 1.2rem; } .center { text-align: center; }
.linkbox { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.qr { width: 220px; height: 220px; background: #fff; padding: 8px; border-radius: 8px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
details summary { cursor: pointer; font-weight: 600; }
form.stack input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not(.input),
form.stack select:not(.input) {
  width: 100%; min-height: 44px; padding: .55rem .7rem; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
}
form.stack input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--green); }
.w100 { width: 100%; }

.mb { margin-bottom: 1rem; }
