/* RAFFAEL's Zeiterfassung – Farben und Schriften von raffaels.at */
:root {
  --bg: #f4efe5;          /* cream */
  --card: #fffdf8;        /* paper */
  --ink: #261d23;
  --muted: #6f6469;
  --line: rgba(19, 35, 29, .18);
  --field: #f7f3eb;
  --accent: #e6007e;
  --accent-press: #c4006b;
  --accent-ink: #ffffff;
  --ok-bg: #e7f1e8; --ok-ink: #1f5b2a;
  --err-bg: #fde6f1; --err-ink: #9a0054;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Arial, Helvetica, sans-serif;
  --h: 52px;              /* einheitliche Höhe aller Eingabefelder und Buttons */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.45 var(--sans);
  -webkit-tap-highlight-color: transparent;
}
main {
  max-width: 560px; margin: 0 auto;
  padding: calc(8px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
main.wide { max-width: 760px; }

h1 { font: 400 1.65rem/1.15 var(--serif); letter-spacing: -.02em; margin: 0 0 14px; }
h2 { font: 400 1.35rem/1.2 var(--serif); letter-spacing: -.02em; margin: 0 0 10px; }
p { margin: 0 0 12px; }
a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 2px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- Logo, Sprache, Navigation ---------- */
.head { position: relative; display: flex; justify-content: center; align-items: center; }
.brand { display: block; width: max-content; margin: 6px auto 14px; }
.langs { position: absolute; right: 0; top: 4px; display: flex; font-size: .8rem; font-weight: 700; letter-spacing: .06em; }
.langs a, .langs span { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 36px; padding: 0 6px; text-decoration: none; color: var(--muted); }
.langs span[aria-current] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.brand img { display: block; height: 56px; width: auto; }

.top { display: flex; align-items: center; justify-content: flex-end; gap: 6px 18px; flex-wrap: wrap; margin: 0 2px 10px; font-size: .95rem; }
.top a, .top .link { min-height: 44px; display: inline-flex; align-items: center; }
.top a[aria-current] { font-weight: 700; }
.hello { font: 400 1.15rem var(--serif); margin: 0 2px 12px; }

.tabs { display: flex; gap: 4px; margin: 0 0 14px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { flex: 0 0 auto; min-height: 46px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 700; }

.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: #fff; font-size: .75rem; font-weight: 700; text-decoration: none; }

/* ---------- Karten ---------- */
.card { background: var(--card); border: 1px solid var(--line); padding: 20px 18px; margin-bottom: 14px; }
.card.narrow { max-width: 440px; margin: 4vh auto 14px; }
.below { margin: 16px 0 0; text-align: center; font-size: .95rem; }
.foot { text-align: center; font-size: .85rem; color: var(--muted); }
.hint { margin: 14px 0 0; font-size: .9rem; color: var(--muted); }

/* ---------- Formulare (iPhone/Safari-fest) ---------- */
.stack { display: grid; gap: 16px; }
.stack-s { display: grid; gap: 10px; margin-top: 8px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.two > * { min-width: 0; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label, legend { font-weight: 700; font-size: .95rem; }

input[type="text"], input[type="email"], input[type="date"], input[type="time"], textarea {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; min-width: 0; max-width: 100%;
  height: var(--h); min-height: var(--h);
  margin: 0; padding: 0 14px;
  font: 17px/var(--h) var(--sans);          /* ab 16px zoomt Safari beim Antippen nicht */
  color: var(--ink); background: var(--field);
  border: 1px solid var(--line); border-radius: 0; box-shadow: none;
}
textarea { height: auto; min-height: 96px; padding: 12px 14px; line-height: 1.4; resize: vertical; }
input::placeholder, textarea::placeholder { color: #9a8f93; opacity: 1; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); background: #fff; }

/* Datum und Uhrzeit: Safari zentriert den Wert und lässt leere Felder zusammenfallen */
input[type="date"], input[type="time"] { line-height: normal; padding-top: 0; padding-bottom: 0; }
input::-webkit-date-and-time-value { text-align: left; margin: 0; min-height: 1.4em; }
input::-webkit-datetime-edit { padding: 0; }
input::-webkit-datetime-edit-fields-wrapper { padding: 0; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator { opacity: .55; margin-left: 4px; }

/* Checkbox und Radio: eigene, große Tippflächen */
.check, .radio { display: flex; align-items: flex-start; gap: 12px; font-size: .95rem; cursor: pointer; min-height: 44px; padding-top: 2px; }
.check input, .radio input {
  -webkit-appearance: none; appearance: none; flex: 0 0 auto;
  width: 24px; height: 24px; margin: 0; border: 2px solid var(--ink); background: var(--card); border-radius: 0;
  display: grid; place-content: center; cursor: pointer;
}
.radio input { border-radius: 50%; }
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after { content: ""; width: 6px; height: 12px; border: solid #fff; border-width: 0 3px 3px 0; transform: translateY(-1px) rotate(45deg); }
.radio input:checked { border-color: var(--accent); }
.radio input:checked::after { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.check input:focus-visible, .radio input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.check span, .radio span { padding-top: 1px; }
fieldset.choice { border: 0; margin: 0; padding: 0; display: grid; gap: 4px; }
fieldset.choice legend { margin-bottom: 6px; padding: 0; }

/* Auswahlfelder (select): eigene Optik, auf iPhone und Android gleich, Text mittig */
.select { position: relative; min-width: 0; }
.select select {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; min-width: 0; height: var(--h); margin: 0;
  padding: 0 34px 0 14px;
  font: 17px var(--sans); color: var(--ink); background: var(--field);
  border: 1px solid var(--line); border-radius: 0; box-shadow: none; cursor: pointer;
}
.select::after {   /* Pfeil */
  content: ""; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border: solid var(--ink); border-width: 0 2px 2px 0; transform: rotate(45deg); pointer-events: none;
}
.select select:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); background: #fff; }
.select select:invalid { color: #9a8f93; }

/* Uhrzeit: Stunde : Minute */
fieldset.time, fieldset.days { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.time legend, fieldset.days legend { padding: 0; margin-bottom: 6px; }
.hm { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 4px; }
.hm .select select { padding: 0 26px 0 0; text-align: center; text-align-last: center; font-variant-numeric: tabular-nums; }
.hm .select::after { right: 10px; width: 6px; height: 6px; margin-top: -5px; }
.colon { font-weight: 700; font-size: 1.2rem; }

/* Tag: Tipp-Buttons */
.day-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.day { position: relative; display: block; cursor: pointer; }
.day input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.day span {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 56px; padding: 6px 2px; text-align: center; line-height: 1.15;
  background: var(--field); border: 1px solid var(--line); color: var(--ink);
}
.day b { font-size: .92rem; }
.day small { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.day input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.day input:checked + span small { color: #fff; }
.day input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Spamschutz-Feld unsichtbar */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Buttons ---------- */
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 4px 0 0; }
.btn {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--h); padding: 0 22px; margin: 0;
  font: 800 .82rem/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; text-align: center;
  border: 0; border-radius: 0; cursor: pointer; text-decoration: none;
  background: var(--accent); color: var(--accent-ink);
  touch-action: manipulation;
}
.btn:active { background: var(--accent-press); }
.btn[disabled] { opacity: .6; }
.stack > .btn, .card.narrow .btn { width: 100%; }
.actions .btn { flex: 1 1 auto; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn-ghost:active { background: var(--field); }
.link {
  -webkit-appearance: none; appearance: none; background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: var(--ink); cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 2px;
  min-height: 40px; display: inline-flex; align-items: center;
}
.link.danger { color: var(--err-ink); }
form.inline { display: inline-flex; margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Hinweise ---------- */
.msg { padding: 12px 14px; margin: 0 0 14px; border-left: 4px solid currentColor; }
.msg-ok { background: var(--ok-bg); color: var(--ok-ink); }
.msg-err { background: var(--err-bg); color: var(--err-ink); }

/* ---------- Monat, Listen ---------- */
.month { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.month h1, .month h2 { margin: 0; text-align: center; }
.nav { color: var(--accent); display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center; font-size: 1.8rem; text-decoration: none; }
.nav.off { color: var(--line); }
.total { margin: 6px 0 4px; color: var(--muted); text-align: center; }
.total strong { color: var(--ink); }

.entries, .plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: 8px 0; border-top: 1px solid var(--line); font-size: .95rem; }
.entries li { border-top: 1px solid var(--line); padding: 12px 0; }
.entries li.empty { color: var(--muted); }
.row-main { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: baseline; }
.row-main .time { font-variant-numeric: tabular-nums; }
.row-main .dur { font-variant-numeric: tabular-nums; text-align: right; font-weight: 700; }
.note { color: var(--muted); font-size: .9rem; margin-top: 2px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0 18px; align-items: center; margin-top: 2px; font-size: .92rem; }
.people li { display: grid; gap: 4px; }
.tag { display: inline-block; font-size: .72rem; line-height: 1.5; padding: 0 6px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.tag-wait { color: var(--accent); border-color: var(--accent); background: transparent; }

.item { border-top: 1px solid var(--line); padding: 14px 0 6px; }
.item:first-of-type { border-top: 0; padding-top: 4px; }
.item header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.item p { margin-bottom: 6px; }
.reason { font-style: italic; }

table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .95rem; }
th, td { text-align: left; padding: 11px 6px; border-top: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; color: var(--muted); font-weight: 700; border-top: 0; }
tfoot td { font-weight: 700; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.sel td { background: var(--field); }

.prose h2 { margin-top: 22px; font-size: 1.15rem; }
.prose ul { padding-left: 20px; margin: 0 0 12px; }

/* sehr schmale Handys */
@media (max-width: 360px) {
  .two { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .card { padding: 16px 14px; }
}
