/* Zeiterfassung – ruhiges, gut lesbares Layout, zuerst fürs Handy */

/* Optional: Atkinson Hyperlegible (OFL) selbst hosten – Dateien nach assets/fonts/ legen */
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('fonts/AtkinsonHyperlegible-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('fonts/AtkinsonHyperlegible-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --ground: #F2F4F3; --surface: #FFFFFF; --ink: #15201B; --muted: #55615B; --line: #DDE3E0; --line-strong: #C9D1CD;
  --accent: #0B6B52; --accent-dark: #08513E; --accent-soft: #E3F1EC; --accent-line: #B9DACE; --accent-ink: #0B5A45;
  --blue-soft: #E4ECFA; --blue-ink: #1E3F8A; --orange-soft: #FCEFE3; --orange-line: #F0D2B6; --orange-ink: #8A3D04;
  --red: #A12C1F; --red-line: #E3B4AE; --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, -apple-system, sans-serif; font-size: 16px; line-height: 1.4; }
a { color: var(--accent); } a:hover { color: var(--accent-dark); }
h1 { font-size: 26px; margin: 0 0 4px; } h2 { font-size: 18px; margin: 0; } h3 { font-size: 16px; margin: 0; }
p { margin: 0 0 8px; }
code { background: #EEF1EF; padding: 1px 5px; border-radius: 4px; }

/* Kopfzeile und Menü */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 22px; border: 1px solid var(--line-strong); font-weight: 700; }
.menu summary::-webkit-details-marker { display: none; }
.menu nav { position: absolute; right: 0; top: 52px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(21,32,27,.12); min-width: 260px; padding: 6px; display: flex; flex-direction: column; }
.menu nav a { display: block; padding: 12px 14px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.menu nav a:hover { background: var(--ground); }
.menu-user { padding: 10px 14px 4px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 4px; }

.flashes { max-width: 760px; margin: 12px auto 0; padding: 0 16px; display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 12px 14px; border-radius: 12px; font-size: 15px; }
.flash-success { background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-ink); }
.flash-info { background: var(--blue-soft); color: var(--blue-ink); }
.flash-warn { background: var(--orange-soft); border: 1px solid var(--orange-line); color: #6B3A10; }
.flash-error { background: #FBE6E3; border: 1px solid var(--red-line); color: var(--red); }

/* Seitenaufbau */
.page { max-width: 760px; margin: 0 auto; padding: 16px 16px 120px; display: flex; flex-direction: column; gap: 16px; }
.page-wide { max-width: 1180px; }
.page-narrow { max-width: 460px; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pagehead .sub { font-size: 14px; color: var(--muted); }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 700; text-decoration: none; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.hint { font-size: 14px; color: var(--muted); }
.hint.warn { color: var(--orange-ink); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.stat span { font-size: 13px; color: var(--muted); } .stat b { font-size: 19px; }
.stat.neg b { color: var(--orange-ink); }

/* Knöpfe */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { background: #F7F8F7; color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #26332D; color: #fff; }
.btn-danger { color: var(--red); border-color: var(--red-line); }
.btn-danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn-big { min-height: 56px; font-size: 18px; width: 100%; }
.btn-block { width: 100%; }
.iconbtn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.monthnav { display: flex; gap: 8px; }
.linkbtn { background: none; border: none; padding: 0; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; min-height: 44px; }

/* Startseite */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 4px; min-height: 96px; }
.tile:hover { border-color: var(--accent); color: var(--ink); }
.tile-title { font-size: 18px; font-weight: 700; } .tile-sub { color: var(--muted); }
.login { text-align: center; align-items: stretch; margin-top: 40px; }

/* Kalender */
.cal { display: flex; flex-direction: column; gap: 6px; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-head span { text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.cal-day { min-height: 60px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 6px 2px 5px; }
.cal-day:hover { border-color: var(--accent); color: var(--ink); }
.cal-nr { font-size: 15px; font-weight: 700; }
.cal-lbl { font-size: 12px; font-weight: 700; }
.cal-day.is-weekend .cal-nr { color: var(--muted); }
.cal-day.is-holiday .cal-nr { color: #A34A06; }
.cal-day.is-future { background: transparent; border-style: dashed; border-color: var(--line-strong); }
.cal-day.has-work { background: var(--accent-soft); color: var(--accent-ink); }
.cal-day.has-urlaub { background: var(--blue-soft); color: var(--blue-ink); }
.cal-day.has-krank { background: var(--orange-soft); color: var(--orange-ink); }
.cal-day.has-frei { background: #EEE8F5; color: #4F2478; }
.cal-day.is-today { border: 2px solid var(--accent); }
.cal-day.is-selected, .cal-day.is-selected .cal-nr { background: var(--ink); color: #fff; border-color: var(--ink); }
.cal-day.is-inactive { opacity: .45; }
.cal-chips { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; }
.chip { width: 16px; height: 16px; border-radius: 8px; font-size: 9px; font-weight: 700; line-height: 16px; text-align: center; }
.chip.is-absent { background: #fff !important; box-shadow: inset 0 0 0 1.5px currentColor; }
.cal-empty { min-height: 60px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* Tag / Einträge */
.entry { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; text-decoration: none; color: var(--ink); min-height: 44px; }
.entry:hover { border-color: var(--accent); color: var(--ink); }
.entry-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.entry-time { font-size: 17px; font-weight: 700; }
.entry.is-deleted { opacity: .75; }
.entry.is-deleted .entry-time { text-decoration: line-through; }
.entry-info { font-size: 14px; color: var(--muted); }
.entry-act { font-size: 14px; font-weight: 700; color: var(--accent); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.avatar { flex: none; width: 30px; height: 30px; border-radius: 15px; font-size: 13px; font-weight: 700; line-height: 30px; text-align: center; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: #E8ECEA; color: #3D4A44; }
.tag-ok { background: var(--accent-soft); color: var(--accent-ink); }
.tag-warn { background: var(--orange-soft); color: var(--orange-ink); }
.tag-blue { background: var(--blue-soft); color: var(--blue-ink); }
.notice { border-radius: 14px; padding: 12px 14px; font-size: 15px; display: flex; flex-direction: column; gap: 4px; }
.notice-lock { background: var(--surface); border: 1px solid var(--accent-line); }
.notice-lock strong { display: flex; align-items: center; gap: 8px; color: var(--accent-ink); }
.notice-warn { background: var(--orange-soft); border: 1px solid var(--orange-line); color: #6B3A10; }
.notice-info { background: var(--blue-soft); border: 1px solid var(--line); color: var(--blue-ink); }
.notice-ok { background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-ink); }
.notice-danger { background: var(--surface); border: 2px solid var(--red); }

/* Formulare */
form { margin: 0; }
fieldset { border: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
legend { font-size: 16px; font-weight: 700; padding: 0; margin-bottom: 8px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.field input, .field select, .field textarea { min-height: 48px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 0 12px; font: inherit; font-size: 17px; color: var(--ink); background: var(--surface); width: 100%; }
.field textarea { padding: 10px 12px; min-height: 90px; }
.field input[type=time] { min-height: 60px; font-size: 26px; font-weight: 700; }
.field input:disabled, .field select:disabled { background: #F1F3F2; color: var(--muted); }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pills.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 14px; border-radius: 24px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 15px; cursor: pointer; text-align: center; }
.pills.grid2 .pill span { border-radius: 14px; min-height: 52px; font-size: 16px; }
.pill input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; }
.pill.accent input:checked + span { background: var(--accent); border-color: var(--accent); }
.pill input:focus-visible + span { outline: 3px solid #7BB8A6; outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 16px; color: var(--ink); }
.check input { width: 22px; height: 22px; accent-color: var(--accent); margin: 0; flex: none; }
.dauer { font-size: 15px; font-weight: 700; color: var(--accent-ink); }
.person { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }

/* Untere Leiste */
.bottombar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--ground); border-top: 1px solid var(--line); padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); z-index: 10; }
.bottombar-inner { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }
.bottombar .row > * { flex: 1 1 0; }
.bottombar .row > .grow { flex: 2 1 0; }

/* Tabellen (Sachbearbeitung, Auswertung) */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 700; background: #F7F8F7; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tfoot td { font-weight: 700; background: #F7F8F7; }
.settings-table td:first-child { width: 45%; }
table.compact th, table.compact td { padding: 9px 8px; }
.origin { font-size: 12px; color: var(--muted); }

@media (min-width: 700px) {
  .page { padding-top: 24px; }
  .cal-day, .cal-empty { min-height: 72px; }
}

@media print {
  .topbar, .bottombar, .noprint, .flashes { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .page { max-width: none; padding: 0; }
  .card, .tablewrap { border: none; padding: 0; }
  th { background: #fff; }
}
