/* Eigentum von R. Thrams - alle Rechte vorbehalten. */
/* Urlaubsplaner - Dunkel mit Goldakzenten */

:root {
  --bg: #0a0c0f;
  --bg-2: #101318;
  --panel: #14171c;
  --panel-2: #1a1e25;
  --line: #2a2f37;
  --line-strong: #3c424c;
  --gold: #c9a94a;
  --gold-bright: #e0c164;
  --gold-deep: #9a7d24;
  --ink: #f2ece0;
  --ink-soft: #b9b2a5;
  --ink-faint: #8a8478;
  --radius: 12px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 10px 30px -18px rgba(0,0,0,.8);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: radial-gradient(120% 120% at 80% -10%, #16202b 0%, var(--bg) 45%, #070a0d 100%);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 12, 15, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .7rem 1.4rem; min-height: 64px;
}
.brand { display: inline-flex; align-items: center; gap: .7rem; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--gold), var(--gold-deep));
  color: #0a0c0f; font-weight: 800; font-size: 1.05rem;
  box-shadow: 0 6px 16px -8px rgba(201,169,74,.7);
}
.brand-text { font-weight: 700; font-size: 1.05rem; letter-spacing: .01em; display: flex; flex-direction: column; }
.brand-text small { font-weight: 500; font-size: .68rem; color: var(--gold); letter-spacing: .12em; text-transform: uppercase; }
.header-right { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.year-pick { display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem; color: var(--ink-soft); }
.year-pick select {
  font: inherit; font-size: .85rem; color: var(--ink);
  background: var(--panel-2); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: .4rem .6rem; cursor: pointer;
}

/* ---------- Buttons  Chips ---------- / */
.btn {
  font: inherit; font-size: .86rem; font-weight: 600;
  border-radius: 9px; padding: .5rem 1rem; cursor: pointer;
  border: 1px solid transparent; transition: all .15s ease;
}
.btn-primary { background: linear-gradient(140deg, var(--gold), var(--gold-deep)); color: #0a0c0f; }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line-strong); }
.btn-ghost:hover { color: var(--ink); border-color: var(--gold); }
.user-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .82rem; font-weight: 600; color: var(--ink);
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: .32rem .8rem .32rem .4rem;
}
.user-chip .dot { width: .8rem; height: .8rem; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.08) inset; }
.user-chip .role { font-size: .64rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gold); }

  /* ---------- Main / Legende ---------- */
.app-main { max-width: 1400px; margin: 0 auto; padding: 1.4rem; }
.legend { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.legend .item { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; color: var(--ink-soft); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: .28rem .7rem; }
.legend .swatch { width: .8rem; height: .8rem; border-radius: 4px; }
.loading { color: var(--ink-faint); font-size: .9rem; }

/* ---------- Kalender-Grid: alle 12 Monate ---------- */
.calendar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
@media (max-width: 1200px) { .calendar { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px)  { .calendar { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px)  { .calendar { grid-template-columns: 1fr; } }

.month {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .8rem .8rem 1rem;
  box-shadow: var(--shadow);
  transition: border-color .2s ease;
}
.month:hover { border-color: var(--line-strong); }
.month-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: .7rem; padding-bottom: .5rem;
  border-bottom: 1px solid var(--line);
}
.month-name { font-size: 1.05rem; font-weight: 750; letter-spacing: -.01em; color: var(--ink); }
.month-name .m-year { color: var(--gold); font-weight: 600; font-size: .8rem; margin-left: .35rem; }
.month-count { font-size: .72rem; color: var(--gold); font-weight: 600; }

/* ---------- Wochenzeilen mit KW + Tagen ---------- */
.month-grid { display: flex; flex-direction: column; gap: 3px; }
.weekday-row, .week-row {
  display: grid;
  grid-template-columns: 2.1rem repeat(7, minmax(0, 1fr));
  gap: 3px;
}
.weekday-row { margin-bottom: 2px; }
.weekday-row .wd {
  text-align: center; font-size: .62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint);
}
.weekday-row .kw-label { text-align: center; font-size: .58rem; color: var(--gold); font-weight: 700; }
.kw-cell {
  display: grid; place-items: center;
  font-size: .66rem; font-weight: 700; color: var(--gold);
  background: rgba(201,169,74,.08);
  border: 1px solid rgba(201,169,74,.18);
  border-radius: 5px;
}
.day {
  position: relative;
  min-height: 1.9rem;
  display: grid; place-items: center;
  font-size: .78rem; font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  user-select: none;
  transition: background .12s ease, transform .08s ease, border-color .12s ease;
}
.day:hover { background: #232a33; border-color: var(--line-strong); transform: translateY(-1px); }
.day.other { color: var(--ink-faint); opacity: .4; background: transparent; cursor: default; }
.day.other:hover { background: transparent; border-color: transparent; transform: none; }
.day.today { outline: 2px solid var(--gold-bright); outline-offset: -2px; }

/* ---------- Markierte Urlaubstage (Farbe je Nutzer) ---------- */
.day.marked {
  color: #0a0c0f;
  font-weight: 700;
  border-color: rgba(0,0,0,.25);
}
.day.marked::after {
  content: "";
  position: absolute; inset: auto 3px 2px 3px; height: 2px;
  border-radius: 2px; background: rgba(0,0,0,.35);
}
.day.type-halbtag { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.day.type-halbtag::before {
  content: "½"; position: absolute; top: -2px; right: 2px;
  font-size: .55rem; font-weight: 800; color: rgba(0,0,0,.55);
}
.day.type-sonder { outline: 1px dashed rgba(0,0,0,.45); outline-offset: -3px; }
.day.multi { box-shadow: inset 0 0 0 2px var(--gold-bright); }
.day .who {
  position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%);
  font-size: .48rem; font-weight: 800; letter-spacing: .02em; color: rgba(0,0,0,.6);
}
.day.readonly { cursor: default; }
.day.readonly:hover { transform: none; }

/* ---------- Login-Overlay ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: rgba(5, 7, 9, .72);
  backdrop-filter: blur(4px);
  padding: 1rem;
}
.login-card {
  width: min(380px, 100%);
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 1.6rem;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.9);
}
.login-card h2 { margin: 0 0 .2rem; font-size: 1.3rem; color: var(--ink); }
.login-sub { margin: 0 0 1.2rem; font-size: .84rem; color: var(--ink-soft); }
.field { display: block; margin-bottom: .9rem; }
.field span { display: block; font-size: .74rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .05em; }
.field input {
  width: 100%; font: inherit; font-size: .95rem;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: 9px;
  padding: .6rem .75rem; transition: border-color .15s ease;
}
.field input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,169,74,.15); }
.login-error { margin: .2rem 0 .8rem; font-size: .82rem; color: #e06a5c; background: rgba(224,106,92,.1); border: 1px solid rgba(224,106,92,.3); border-radius: 8px; padding: .5rem .7rem; }
.login-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: .4rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%) translateY(20px);
  background: var(--panel-2); border: 1px solid var(--gold); color: var(--ink);
  border-radius: 10px; padding: .6rem 1rem; font-size: .84rem; font-weight: 600;
  box-shadow: 0 12px 30px -12px rgba(0,0,0,.8);
  opacity: 0; pointer-events: none; transition: all .22s ease; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { border-color: #e06a5c; color: #ffd9d3; }

  /* ---------- Footer ---------- */
.app-footer {
  max-width: 1400px; margin: 0 auto; padding: 1.4rem;
  font-size: .74rem; color: var(--ink-faint); text-align: center;
}

  /* ---------- Fokus / A11y ---------- */
:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

  /* ---------- Druck ---------- */
@media print {
  .app-header, .app-footer, .legend, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .calendar { grid-template-columns: repeat(3, 1fr); }
  .month { break-inside: avoid; border-color: #ccc; box-shadow: none; background: #fff; }
  .day { color: #000; background: #f4f4f4; }
}
