:root {
  --blue: #1d5fa8;
  --blue-dark: #174a85;
  --green: #2e9e5b;
  --red: #c0392b;
  --amber: #b9770e;
  --grey: #697380;
  --bg: #f1f5fa;
  --card: #ffffff;
  --text: #1e242e;
  --line: #dbe2eb;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
a { color: var(--blue); }
h1 { font-size: 1.45rem; margin: 6px 0 14px; line-height: 1.2; }
h2 { font-size: 1.1rem; margin: 26px 0 10px; color: var(--blue-dark); }
.wrap { max-width: 640px; margin: 0 auto; padding: 8px 16px 24px; }
.muted { color: var(--grey); }
.small { font-size: 0.86rem; }
.hidden { display: none; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--blue); color: #fff;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; }
.brand .logo { width: 34px; height: 34px; border-radius: 8px; }
.brand .logo-img { width: 40px; height: 40px; background: #fff; padding: 3px; border-radius: 10px; }
.logout { display: flex; align-items: center; gap: 12px; margin: 0; }
.logout .who { font-size: 0.95rem; opacity: 0.95; }
button.link { background: none; border: 0; color: #fff; text-decoration: underline; font: inherit; font-size: 0.95rem; padding: 6px 0; cursor: pointer; }

.card {
  display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin: 0 0 12px; color: inherit; text-decoration: none; position: relative;
}
a.card:active { background: #f7f9fc; }
.card.empty { color: var(--grey); text-align: center; padding: 22px 16px; }
.card.info { background: #eef5fd; border-color: #cfe0f4; }
.card.inactive { opacity: 0.65; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row h1 { margin: 0; }

.pill { display: inline-block; font-size: 0.8rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill-offen { background: #fdf0d5; color: var(--amber); }
.pill-genehmigt { background: #dff3e7; color: #1f7a45; }
.pill-abgelehnt { background: #fbe0dc; color: var(--red); }
.pill-storniert { background: #e8ebef; color: var(--grey); }
.badge-new { position: absolute; top: -7px; right: 12px; background: var(--red); color: #fff; font-size: 0.72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.comment { margin-top: 6px; padding: 8px 10px; background: #f5f7fa; border-left: 3px solid var(--line); border-radius: 6px; font-size: 0.95rem; }

.flash { padding: 12px 14px; border-radius: 12px; margin: 0 0 12px; font-size: 0.97rem; }
.flash-ok { background: #dff3e7; color: #17603a; }
.flash-error { background: #fbe0dc; color: #8e2a1f; }
.flash-warn { background: #fdf0d5; color: #8a5a07; }
.flash-info { background: #e3eefb; color: #1b4f8a; }

label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 0.95rem; }
.form label:first-child { margin-top: 0; }
input[type=text], input[type=date], input[type=email], input[type=password], input[type=search], select, textarea {
  width: 100%; font: inherit; padding: 12px 12px; border: 1px solid #c3ccd8; border-radius: 10px; background: #fff; color: var(--text);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid #b9d3f1; border-color: var(--blue); }
input.pin { font-size: 1.7rem; letter-spacing: 0.3em; text-align: center; margin-bottom: 14px; }
.hint { font-size: 0.86rem; color: var(--grey); margin: 6px 0 0; }

.btn {
  display: inline-block; font: inherit; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer;
  padding: 13px 18px; border-radius: 12px; border: 1px solid #b7c3d2; background: #fff; color: var(--blue-dark); min-height: 48px;
}
.btn-block { display: block; width: 100%; margin-top: 12px; }
p > .btn-block:only-child { margin-top: 0; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-ok { background: var(--green); border-color: var(--green); color: #fff; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger-outline { border-color: var(--red); color: var(--red); }
.btn-small { padding: 8px 14px; min-height: 40px; font-size: 0.92rem; }
.btnrow { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.btnrow .btn { flex: 1; }
.btnrow form { margin: 0; }

.facts { display: grid; grid-template-columns: 9.5rem 1fr; gap: 8px 10px; margin: 14px 0 0; }
.facts dt { color: var(--grey); font-size: 0.92rem; }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.back { text-decoration: none; font-weight: 600; }

.timeline .tl { padding: 8px 0; border-bottom: 1px solid var(--line); }
.timeline .tl:last-child { border-bottom: 0; }
.tl-time { font-size: 0.85rem; color: var(--grey); }

.filterrow { display: flex; gap: 10px; margin-bottom: 10px; }
.filter .btn-block { margin-top: 10px; }

.login { margin-top: 24px; text-align: center; }
.loginlogo { width: 104px; height: 104px; display: block; margin: 4px auto 6px; }
.login label { text-align: left; }
.install summary { cursor: pointer; font-weight: 600; }

.pinbox { text-align: center; }
.pinname { font-size: 1.25rem; font-weight: 700; margin: 0 0 8px; }
.pinbig { font-size: 2.6rem; font-weight: 800; letter-spacing: 0.12em; margin: 8px 0 14px; font-variant-numeric: tabular-nums; color: var(--blue-dark); }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a {
  flex: 1; text-align: center; padding: 14px 4px; text-decoration: none; color: var(--grey); font-weight: 600; font-size: 0.92rem;
}
.bottomnav a.active { color: var(--blue); box-shadow: inset 0 3px 0 var(--blue); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: 0.78rem; line-height: 20px; }

@media print { .topbar, .bottomnav, .btn, form { display: none !important; } body { background: #fff; padding: 0; } }
