/* ================= Vacati-ON ================= */
@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('/fonts/ibm-plex-mono-latin-600-normal.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}

:root {
  --paper: #F4F4EF;
  --card: #FDFDFB;
  --ink: #21261F;
  --muted: #6C7168;
  --line: #DCDAD0;
  --line-soft: #E9E8E0;
  --brand: #245C4D;
  --brand-deep: #17423A;
  --brand-wash: #E3ECE7;
  --accent: #DFA31F;
  --danger: #B4483A;
  --ok: #2E6E5E;
  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Plex Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  --r: 9px;
  --cell: 23px;
  --namew: 118px;
  --shadow: 0 1px 2px rgba(33,38,31,.06), 0 8px 24px -18px rgba(33,38,31,.35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 15px/1.5 var(--sans);
}
@media (prefers-reduced-motion: no-preference) {
  .view { animation: rise .16s ease-out; }
  @keyframes rise { from { opacity: 0; transform: translateY(3px); } }
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--sans); letter-spacing: -0.015em; margin: 0; }
h1 { font-size: 26px; font-weight: 750; }
h2 { font-size: 17px; font-weight: 700; }
a { color: var(--brand); }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hidden { display: none !important; }

/* ---------- Kopfbereich ---------- */
.topbar {
  background: var(--brand-deep); color: #F1F3EC;
  padding: 0 max(16px, env(safe-area-inset-left));
}
.topbar-inner {
  max-width: 1160px; margin: 0 auto; display: flex; align-items: center;
  gap: 18px; min-height: 56px; flex-wrap: wrap; padding: 8px 0;
}
.wordmark { display: flex; align-items: baseline; gap: 9px; text-decoration: none; color: inherit; }
.wordmark b { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.wordmark span {
  font-family: var(--mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: #B9CDC2;
}
.wordmark .verbadge, .logincard .brandrow .verbadge {
  text-transform: none; letter-spacing: 0; opacity: .65;
}
.userbox { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.userbox .name { color: #DDE6DD; }
.linkbtn {
  background: none; border: 0; color: #B9CDC2; font: inherit; font-size: 13px;
  cursor: pointer; padding: 4px 2px; text-decoration: underline; text-underline-offset: 3px;
}
.linkbtn:hover { color: #fff; }

.nav {
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.nav-inner {
  max-width: 1160px; margin: 0 auto; display: flex; gap: 4px;
  overflow-x: auto; padding: 6px max(16px, env(safe-area-inset-left));
  scrollbar-width: none;
}
.nav-inner::-webkit-scrollbar { display: none; }
.nav a {
  white-space: nowrap; text-decoration: none; color: var(--muted);
  font-weight: 600; font-size: 13.5px; padding: 7px 12px; border-radius: 999px;
}
.nav a.on { background: var(--brand-wash); color: var(--brand-deep); }
.nav a:hover { color: var(--brand-deep); }
.badge {
  display: inline-block; min-width: 18px; text-align: center;
  background: var(--accent); color: #3A2B05; border-radius: 999px;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  padding: 1px 5px; margin-left: 5px; vertical-align: 1px;
}

.wrap { max-width: 1160px; margin: 0 auto; padding: 22px max(16px, env(safe-area-inset-left)) 70px; }

/* ---------- Bausteine ---------- */
.pagehead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead .sub { width: 100%; margin-top: -6px; }
.yearctl { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.yearctl .yr { font-family: var(--mono); font-weight: 600; font-size: 19px; min-width: 62px; text-align: center; }
.stepbtn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); cursor: pointer; font-size: 15px; color: var(--ink); line-height: 1;
}
.stepbtn:disabled { opacity: .35; cursor: default; }
.stepbtn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-deep); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 18px;
}
.card > h2 { margin-bottom: 12px; }

.btn {
  font: 600 14px var(--sans); color: #fff; background: var(--brand);
  border: 1px solid var(--brand-deep); border-radius: 8px; padding: 9px 16px; cursor: pointer;
}
.btn:hover { background: var(--brand-deep); }
.btn.ghost { background: var(--card); color: var(--brand-deep); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--brand); }
.btn.danger { background: var(--danger); border-color: #93382D; }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: default; }

label.f { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], select, textarea {
  font: 400 14.5px var(--sans); color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%;
}
input[type=date], input[type=number] { font-family: var(--mono); font-size: 13.5px; }
textarea { resize: vertical; min-height: 60px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.frow { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.frow > div { flex: 1 1 150px; min-width: 130px; }
.frow > .grow2 { flex: 2 1 240px; }
.checks { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; padding-top: 4px; }
.checks label { display: flex; gap: 6px; align-items: center; font-size: 13.5px; cursor: pointer; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); }

.note {
  background: var(--brand-wash); border: 1px solid #CBDCD2; border-radius: 8px;
  padding: 9px 12px; font-size: 13px; color: var(--brand-deep); margin-bottom: 14px;
}
.note.warn { background: #FBF3DE; border-color: #EAD9A8; color: #6B5310; }
.note.err { background: #F8E9E6; border-color: #E4C4BD; color: #7C2E23; }
.pwbox {
  font-family: var(--mono); font-size: 15px; background: #FBF3DE;
  border: 1px dashed var(--accent); border-radius: 8px; padding: 10px 12px;
  margin-top: 10px; user-select: all;
}

.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600;
  padding: 3px 9px 3px 6px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
}
.chip .dot { width: 9px; height: 9px; border-radius: 3px; }
.status { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px; font-weight: 600; }
.status.pending { background: #FBF3DE; color: #6B5310; }
.status.approved { background: var(--brand-wash); color: var(--brand-deep); }
.status.rejected { background: #F8E9E6; color: #7C2E23; }
.status.cancelled { background: #ECEBE5; color: var(--muted); }

/* ---------- Tabellen ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
  padding: 6px 10px; border-bottom: 1px solid var(--line);
}
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r, .tbl th.r { text-align: right; }
.tbl td.r { font-family: var(--mono); font-size: 13.5px; }
.tbl .me td { background: #F7FAF7; }
.tbl .me td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
.rest { font-weight: 600; font-size: 15px; }
.neg { color: var(--danger); }
.tbl .sep td { border-bottom: 1px solid var(--line); }

@media (max-width: 740px) {
  table.resp, table.resp tbody, table.resp tr, table.resp td { display: block; width: 100%; }
  table.resp thead { display: none; }
  table.resp tr {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
    margin-bottom: 10px; padding: 6px 2px; box-shadow: var(--shadow);
  }
  table.resp td { border: 0; display: flex; justify-content: space-between; gap: 12px; padding: 5px 12px; }
  table.resp td::before { content: attr(data-l); font-weight: 600; color: var(--muted); font-size: 12.5px; font-family: var(--sans); }
  table.resp td:first-child { font-weight: 700; font-size: 15px; }
  table.resp .me td:first-child { box-shadow: none; border-left: 3px solid var(--brand); }
  .card.flat-m { background: none; border: 0; box-shadow: none; padding: 0; }
}

/* ---------- Jahreskalender ---------- */
.legend { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.month { margin-bottom: 16px; }
.month h3 {
  font-size: 13px; font-weight: 700; letter-spacing: .02em; margin-bottom: 6px;
  display: flex; align-items: baseline; gap: 8px;
}
.month h3 small { font-family: var(--mono); font-size: 10.5px; color: var(--muted); font-weight: 400; }
.mscroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.mgrid { display: grid; width: 100%; min-width: max-content; }
.calscope { display: inline-flex; gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.calscope button { border: 0; background: var(--card); color: var(--ink); font: inherit; font-size: 13px; padding: 6px 12px; cursor: pointer; }
.calscope button + button { border-left: 1px solid var(--line); }
.calscope button.on { background: var(--brand); color: #fff; }
.mgrid > div { height: 30px; display: flex; align-items: center; }
.mgrid .hd {
  height: 26px; font-family: var(--mono); font-size: 9.5px; color: var(--muted);
  justify-content: center; flex-direction: column; line-height: 1.15; gap: 0;
  border-bottom: 1px solid var(--line);
}
.mgrid .hd .wd { font-size: 8px; letter-spacing: .02em; }
.mgrid .pname {
  position: sticky; left: 0; z-index: 2; background: var(--card);
  font-size: 12px; font-weight: 600; padding: 0 10px; border-right: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: var(--namew);
}
.mgrid .cell { justify-content: center; border-left: 1px solid var(--line-soft); position: relative; }
.mgrid .row-start { border-top: 1px solid var(--line-soft); }
.cell.we { background: #EDECE4; }
.cell.off { background: #F4F2E9; }
.cell.holi { background: #E7EFE9; }
.cell.holi::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); opacity: .55; }
.cell .fill { position: absolute; inset: 3px 0; }
.cell .fill.half { clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%); }
.cell .fill.pending {
  background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.55) 0 3px, transparent 3px 6px);
}
.cell.today { box-shadow: inset 0 0 0 2px var(--accent); z-index: 1; }
.hd.today .dnum { color: #8A6208; font-weight: 600; }

/* ---------- Login ---------- */
.loginwrap { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.logincard { width: 100%; max-width: 380px; }
.logincard .brandrow { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.logincard .brandrow b { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; color: var(--brand-deep); }
.logincard .brandrow span { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.logincard .card { padding: 22px; }
.errline { color: var(--danger); font-size: 13.5px; min-height: 18px; margin: 8px 0 2px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 90;
  display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast {
  background: var(--ink); color: #F2F3EE; border-radius: 9px; padding: 11px 15px;
  font-size: 13.5px; box-shadow: 0 8px 30px rgba(0,0,0,.25); text-align: center;
}
.toast.err { background: var(--danger); }

/* ---------- Diverses ---------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 13px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid transparent; }
.tabs a.on { background: var(--card); border-color: var(--line); color: var(--brand-deep); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.empty { color: var(--muted); font-size: 14px; padding: 18px 4px; text-align: center; }
.swatch { width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 6px; padding: 0; background: none; }
.kfoot { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
code.k { font-family: var(--mono); font-size: 12.5px; background: #ECEBE5; padding: 1px 5px; border-radius: 5px; }
.otherchips { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 740px) {
  h1 { font-size: 22px; }
  .wrap { padding-top: 16px; }
  :root { --cell: 30px; --namew: 96px; }
  .mgrid > div { height: 34px; }
}

/* ---------- Protokoll und Sicherungen ---------- */
.toolbar{display:flex;gap:.6rem;align-items:center;flex-wrap:wrap;margin-bottom:1rem}
.toolbar input[type=search]{min-width:15rem}
.auditchg{display:flex;align-items:baseline;gap:.45rem;flex-wrap:wrap;line-height:1.6}
.auditchg + .auditchg{margin-top:.15rem}
.auditchg .af{min-width:9rem;font-size:.82rem;opacity:.75}
.auditchg .av{font-family:var(--mono,ui-monospace,monospace);font-size:.78rem;padding:.05rem .4rem;border-radius:.25rem}
.auditchg .av.alt{background:#f0eded;opacity:.7;text-decoration:line-through}
.auditchg .av.neu{background:#e7f1ee;color:#1e574d;font-weight:600}
.auditchg .pf{opacity:.5;font-size:.75rem}
.small{font-size:.8rem}
.center{text-align:center}
.nowrap{white-space:nowrap}
.mono{font-family:var(--mono,ui-monospace,monospace);font-size:.85rem}
.tag{display:inline-block;background:#eef1f0;border-radius:1rem;padding:.1rem .5rem;font-size:.78rem}
.warnbox{background:#fbf0dc;border:1px solid #ead3a6;color:#6f4610;border-radius:.4rem;padding:.6rem .8rem;font-size:.85rem;line-height:1.5}
