/* Mitarbeiter-PWA – mobil zuerst */
html, body { height: 100%; }
body { background: var(--cream); overscroll-behavior-y: none; }

/* ---------- Login ---------- */
.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at top, rgba(191, 144, 71, .22), transparent 65%),
    var(--black);
  padding: calc(env(safe-area-inset-top) + 40px) 20px calc(env(safe-area-inset-bottom) + 24px);
}
.login-top { text-align: center; margin: 20px 0 32px; }
.login-logo { display: block; height: 120px; width: auto; margin: 0 auto 16px; }
.login-top .eyebrow { font-size: 13px; letter-spacing: .22em; margin-right: -.22em; }
.login-form {
  background: var(--paper);
  border-radius: 16px;
  padding: 24px 20px 14px;
  border-top: 4px solid var(--gold);
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}
.login-form input { font-size: 18px; min-height: 50px; }
.btn-block { width: 100%; min-height: 52px; font-size: 17px; }

/* ---------- Kopf ---------- */
.app-head {
  background: var(--black);
  color: #fff;
  padding: calc(env(safe-area-inset-top) + 12px) 18px 16px;
  border-bottom: 3px solid var(--gold);
}
.app-brand { display: flex; align-items: center; gap: 8px; }
.app-logo { display: block; height: 40px; width: auto; }
.greeting { font-family: var(--font-head); font-size: 24px; margin-top: 10px; letter-spacing: .02em; }
.greeting small { display: block; font-family: var(--font-body); font-size: 13px; color: var(--stone); letter-spacing: 0; }

.app-main {
  padding: 16px 16px calc(env(safe-area-inset-bottom) + 92px);
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Tableiste ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 20;
}
.tabbar button {
  border: 0;
  background: transparent;
  padding: 8px 0 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button.active { color: var(--gold-dark); }

/* ---------- Hinweise ---------- */
.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 14px;
}
.notice.missing { background: var(--danger-soft); border-color: transparent; color: #6e231b; }
.notice.push { background: var(--gold-soft); border-color: transparent; }
.notice b { display: block; font-size: 15px; }
.notice .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.notice .btn { margin-top: 8px; }

/* ---------- Tagesnavigation ---------- */
.day-nav {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.nav-arrow {
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--stone-2);
  background: var(--paper);
  font-size: 28px;
  line-height: 1;
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}
.nav-arrow:active { background: var(--cream); }
.nav-arrow:disabled { opacity: .3; cursor: default; }
.day-label { text-align: center; }
.day-title { font-family: var(--font-head); font-size: 28px; line-height: 1.15; letter-spacing: .02em; }
.day-date { font-size: 13px; color: var(--muted); }

/* ---------- Erfassungskarte ---------- */
.entry-card { padding: 20px 18px; }
.entry-card h2 { font-size: 20px; margin-bottom: 16px; }
.entry-card .date-sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; }

.entry-card .field input { font-size: 16px; }
.entry-actions { display: grid; gap: 10px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 6px 0 2px; text-transform: uppercase; letter-spacing: .08em; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.done-card { text-align: center; padding: 28px 18px; }
.done-card .state {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center;
  background: var(--ok-soft); color: var(--ok);
}
.done-card .state svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.done-card.absent .state { background: var(--rose-soft); color: var(--rose); }
.done-card.other .state { background: var(--cream); color: var(--muted); }
.done-card .big { font-family: var(--font-head); font-size: 44px; line-height: 1.1; }
.done-card .note { color: var(--ink-2); margin-top: 8px; font-style: italic; }
.done-card .lock { color: var(--muted); font-size: 13px; margin-top: 16px; }


/* ---------- Verlauf ---------- */
.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.month-nav h2 { margin: 0; font-size: 22px; }
.month-nav .btn { width: 44px; padding: 0; font-size: 20px; }
.month-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.month-sum .card { padding: 10px 12px; text-align: center; box-shadow: none; }
.month-sum .v { font-family: var(--font-head); font-size: 24px; }
.month-sum .l { font-size: 12px; color: var(--muted); }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.hist li:first-child { border-radius: 12px 12px 0 0; }
.hist li:last-child { border-radius: 0 0 12px 12px; border-bottom: 0; }
.hist li:only-child { border-radius: 12px; }
.hist .d { width: 64px; flex: 0 0 auto; }
.hist .d b { display: block; font-family: var(--font-head); font-weight: 500; font-size: 17px; }
.hist .d span { font-size: 12px; color: var(--muted); }
.hist .t { flex: 1; min-width: 0; }
.hist .t .n { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist .h { font-family: var(--font-head); font-size: 20px; font-variant-numeric: tabular-nums; }
.hist li.missing { background: var(--danger-soft); }
.hist li.missing .t { color: var(--danger); font-weight: 600; }

/* ---------- Profil ---------- */
.profile-card { padding: 18px; margin-bottom: 14px; }
.profile-card h3 { font-size: 18px; }
.profile-card p { color: var(--ink-2); font-size: 14px; margin: 0 0 12px; }
.status-line { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 600; }
.steps { margin: 0; padding-left: 20px; font-size: 14px; color: var(--ink-2); }
.steps li { margin-bottom: 4px; }
.version { text-align: center; color: var(--muted); font-size: 12px; margin-top: 20px; }

/* Bestätigungsdialog als Bottom-Sheet */
dialog.modal#confirm { margin: auto auto 0; width: 100%; max-width: 560px; border-radius: 18px 18px 0 0; }
dialog.modal#confirm .modal-foot { border-radius: 0; padding-bottom: calc(env(safe-area-inset-bottom) + 16px); }
dialog.modal#confirm .modal-foot .btn { flex: 1; min-height: 50px; }
.confirm-big { font-family: var(--font-head); font-size: 40px; text-align: center; margin: 4px 0; }
.confirm-sub { text-align: center; color: var(--muted); margin: 0 0 8px; }
.confirm-lock { background: var(--cream); border-radius: 8px; padding: 10px 12px; font-size: 14px; color: var(--ink-2); }

/* Toast oberhalb der Tableiste */
.toast { bottom: calc(env(safe-area-inset-bottom) + 84px); }

/* ---------- Sprachumschalter ---------- */
.lang-switch { display: flex; gap: 4px; justify-content: flex-end; }
.lang-switch button {
  border: 1px solid rgba(255, 255, 255, .25);
  background: transparent;
  color: var(--stone-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.lang-switch button.active { background: var(--gold); border-color: var(--gold); color: #fff; }
.app-brand .lang-switch { margin-left: auto; }
.login .lang-switch { max-width: 420px; width: 100%; margin: 0 auto; }

.lang-list { display: flex; flex-direction: column; gap: 10px; }
.lang-list label { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.lang-list input { width: 20px; height: 20px; accent-color: var(--gold); }

/* ---------- Arbeitsbeginn / -ende ---------- */
.time-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 8px; }
.time-field select { width: 100%; min-width: 0; }
.time-field { margin-bottom: 0; }
.time-field select {
  min-height: 56px;
  font-size: 20px;
  font-family: var(--font-head);
  letter-spacing: .02em;
  text-align: center;
  text-align-last: center;
  appearance: none;
  -webkit-appearance: none;
  background: var(--paper);
  cursor: pointer;
}
.time-field select:invalid, .time-field select option[value=""] { color: var(--muted); }
.time-sep { font-family: var(--font-head); font-size: 24px; color: var(--muted); padding-bottom: 12px; }
.duration { text-align: center; color: var(--ink-2); font-weight: 600; margin: 12px 0 16px; min-height: 1.5em; }

.done-card .big.range, .confirm-big.range { font-size: 32px; }
.empty-msg { text-align: center; color: var(--muted); padding: 24px 0; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-name { margin: 4px 0 0; }
.muted-line { margin: 0 !important; color: var(--muted) !important; }

/* Mittagspause */
.pause-field { margin: 14px 0 0; }
.pause-field select {
  width: 100%; min-height: 52px; font-size: 20px; font-family: var(--font-head); text-align: center; text-align-last: center;
  appearance: none; -webkit-appearance: none; background: var(--paper); cursor: pointer;
}
.duration.invalid { color: var(--danger); }
