/* Farbschema: myLab-Branding (www.my-lab.at) — kräftiges Rot, weiße Flächen,
   graue Typografie, runde Pill-Buttons. Alle Markenfarben zentral hier. */
:root {
  --bg: #f8f7f7;
  --card: #ffffff;
  --text: #3f3f41;           /* myLab-Grau der Überschriften/Texte */
  --heading: #57575a;
  --muted: #7c7c80;
  --primary: #e2001a;        /* myLab-Rot */
  --primary-dark: #b80015;
  --primary-darker: #8e0010;
  --accent: #e2001a;
  --accent-soft: #fde7e9;
  --green: #1a8a4f;
  --green-bg: #dcf5e7;
  --yellow: #9a6b00;
  --yellow-bg: #fdf3cf;
  --yellow-mark: #f5c518;
  --red: #a8323c;            /* Krankheit: dunkleres Bordeaux, unterscheidbar vom Marken-Rot */
  --red-bg: #f7e3e5;
  --blue: #2f6fd0;
  --purple: #7d5bc7;
  --absent: #8b8f98;         /* neutral "abwesend" für Kollegen */
  --holiday-bg: #ffe9b8;
  --sperre-bg: #ffd9dd;
  --gray-bg: #eeecec;
  --border: #dfdddd;
  --shadow: 0 1px 3px rgba(60, 60, 64, 0.08), 0 4px 14px rgba(60, 60, 64, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
}

nav {
  background: linear-gradient(90deg, var(--primary-dark), var(--primary) 60%, #ef1830);
  color: #fff;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.55rem 1.1rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 50;
}
nav .brand { font-weight: 700; margin-right: 1rem; letter-spacing: 0.01em; }
nav a {
  color: #ffe3e6;
  text-decoration: none;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}
nav a:hover, nav a.active { background: rgba(255, 255, 255, 0.14); color: #fff; }
nav .spacer { flex: 1; }
nav a.userinfo { font-size: 0.85rem; opacity: 0.95; }
nav .rest-chip {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  font-size: 0.85rem;
  padding: 0.25rem 0.75rem;
  white-space: nowrap;
}
.nav-logout {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #ffe3e6;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.nav-logout:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.badge {
  background: #ff9f43;
  color: #fff;
  border-radius: 999px;
  padding: 0 0.45rem;
  font-size: 0.8rem;
  font-weight: 700;
}

main { max-width: 1100px; margin: 1.5rem auto; padding: 0 1rem; }

/* Überschriften wie auf my-lab.at: grau, leicht gesperrt, Großbuchstaben */
h1 {
  font-size: 1.5rem;
  margin: 0 0 1rem;
  color: var(--heading);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
h2 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; color: var(--heading); letter-spacing: 0.02em; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.cards { display: flex; gap: 1rem; flex-wrap: wrap; }
.cards .card { flex: 1 1 180px; margin-bottom: 0; text-align: center; }
.card .big { font-size: 2rem; font-weight: 700; color: var(--primary); }
.card .label { color: var(--muted); font-size: 0.85rem; }

table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { padding: 0.55rem 0.6rem; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
tr:hover td { background: #faf7f7; }
.table-wrap {
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.table-wrap table { border: none; }

.status {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
.status-offen { background: var(--yellow-bg); color: var(--yellow); }
.status-genehmigt { background: var(--green-bg); color: var(--green); }
.status-abgelehnt { background: var(--red-bg); color: var(--red); }
.status-storniert { background: var(--gray-bg); color: var(--muted); }

.type-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}
.type-urlaub { background: var(--green); }
.type-krankheit { background: var(--red); }
.type-fortbildung { background: var(--blue); }
.type-ueberstunden { background: var(--purple); }

.checkbox-label { font-weight: 400; font-size: 0.95rem; }
.checkbox-label input { width: auto; margin-right: 0.35rem; }

form.inline { display: inline; }

label { display: block; font-weight: 600; margin: 0.75rem 0 0.25rem; }
input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="number"], select, textarea {
  width: 100%;
  max-width: 420px;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { min-height: 90px; }

/* Pill-Buttons wie auf my-lab.at (roter Primär-Button, weiße Sekundär-Buttons mit rotem Text) */
button, .btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
button:hover, .btn:hover { background: var(--primary-dark); box-shadow: 0 2px 8px rgba(226, 0, 26, 0.25); }
button:active, .btn:active { transform: translateY(1px); }
.btn-green { background: var(--green); }
.btn-green:hover { background: #14683c; box-shadow: 0 2px 8px rgba(26, 138, 79, 0.25); }
.btn-red { background: var(--primary); }
.btn-red:hover { background: var(--primary-dark); }
.btn-secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid #f0c4ca;
}
.btn-secondary:hover { background: var(--accent-soft); box-shadow: none; }
.btn-small { padding: 0.3rem 0.8rem; font-size: 0.82rem; }

.flash { padding: 0.7rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 500; }
.flash-success { background: var(--green-bg); color: var(--green); }
.flash-error { background: var(--red-bg); color: var(--red); }

.muted { color: var(--muted); font-size: 0.9rem; }

/* ---------- Kalender ---------- */
.cal-wrap { padding: 0.25rem; }
.cal { border-collapse: separate; border-spacing: 2px; font-size: 0.78rem; }
.cal th, .cal td {
  border: none;
  padding: 0.22rem;
  text-align: center;
  min-width: 1.8rem;
  border-radius: 5px;
  background: #fdfcfc;
}
/* Zeilen-Hover: :where() hält die Spezifität niedrig, damit weder die
   Abteilungs-Bänder (.dep-row) noch farbige Zellen (Urlaub, Feiertag …)
   beim Drüberfahren übermalt werden — nur leere Zellen werden hervorgehoben. */
.cal tr:where(:not(.dep-row):hover) td { background: #f6eff0; }
.cal tr:where(:not(.dep-row):hover) td.name { background: var(--accent-soft); }
.cal th { background: #f5f3f3; color: var(--muted); }
.cal th.name, .cal td.name {
  text-align: left;
  min-width: 10rem;
  padding: 0.3rem 0.6rem;
  white-space: nowrap;
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--card);
  box-shadow: 2px 0 4px rgba(1, 58, 68, 0.06);
}
.cal .wend { background: #f0eff1; color: #cfccd0; }
.cal .holiday { background: var(--holiday-bg); color: #9a6b00; }
.cal th.sperre { background: var(--sperre-bg); color: var(--red); }
.cal .off-urlaub { background: var(--green); }
.cal .off-krankheit { background: var(--red); }
.cal .off-fortbildung { background: var(--blue); }
.cal .off-ueberstunden { background: var(--purple); }
.cal .off-abwesend { background: var(--absent); }
.cal .off-offen {
  background: repeating-linear-gradient(45deg, var(--yellow-mark), var(--yellow-mark) 4px, #ffe480 4px, #ffe480 8px);
}
.cal .today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal td.dep-name {
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  border-radius: 7px;
}
.cal .me-row td.name { font-weight: 700; color: var(--primary); }

.cal-nav { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.legend { display: flex; gap: 1.1rem; margin-top: 0.85rem; font-size: 0.85rem; color: var(--muted); flex-wrap: wrap; }
.legend .swatch { display: inline-block; width: 0.9rem; height: 0.9rem; border-radius: 4px; vertical-align: -2px; margin-right: 0.3rem; }
.sw-urlaub { background: var(--green); }
.sw-krankheit { background: var(--red); }
.sw-fortbildung { background: var(--blue); }
.sw-ueberstunden { background: var(--purple); }
.sw-abwesend { background: var(--absent); }
.sw-offen { background: var(--yellow-mark); }
.sw-feiertag { background: var(--holiday-bg); border: 1px solid var(--border); }
.sw-sperre { background: var(--sperre-bg); border: 1px solid var(--border); }
.sw-wochenende { background: #f0eff1; border: 1px solid var(--border); }

/* Jahresansicht */
.year-cal th a { color: inherit; text-decoration: none; }
.year-cal th a:hover { text-decoration: underline; color: var(--primary); }
.year-cal .year-cell { min-width: 3.2rem; padding: 0.3rem 0.25rem; }
.year-cal .today-month { outline: 2px solid var(--accent); outline-offset: -2px; }
.year-cal .sum { font-weight: 600; white-space: nowrap; }
.mini {
  display: inline-block;
  min-width: 1.35rem;
  padding: 0.08rem 0.28rem;
  margin: 1px;
  border-radius: 5px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}
.mini-urlaub { background: var(--green); }
.mini-krankheit { background: var(--red); }
.mini-fortbildung { background: var(--blue); }
.mini-ueberstunden { background: var(--purple); }
.mini-abwesend { background: var(--absent); }
.mini-offen { background: var(--yellow-mark); color: #6b4d00; }

/* Login */
.login-box { max-width: 380px; margin: 8vh auto 0; }
.login-box input { max-width: 100%; }
.login-box button { width: 100%; margin-top: 1rem; }

.request-card { border-left: 4px solid var(--yellow-mark); }
.overlap-warning {
  background: var(--yellow-bg);
  color: var(--yellow);
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}
.decision-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 0.75rem; }
.decision-form input[type="text"] { flex: 1 1 220px; max-width: none; }
.decision-form input[type="date"] { max-width: 180px; }

@media (max-width: 640px) {
  nav { padding: 0.4rem 0.5rem; }
  nav a.userinfo { display: none; }
  main { margin-top: 1rem; }
  .cards { flex-direction: column; }
  .cal th.name, .cal td.name { min-width: 7.5rem; }
}
