@font-face {
  font-family: 'Gazpacho';
  src: url('/fonts/Gazpacho-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
}

:root {
  color-scheme: dark;
  --bg: #050505;
  --bg-soft: #0d0d0f;
  --card: rgba(20, 20, 22, 0.88);
  --card-strong: rgba(30, 12, 16, 0.92);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(200, 16, 46, 0.35);
  --text: #ffffff;
  --muted: #b8b8be;
  --accent: #c8102e;
  --accent-2: #ff415f;
  --accent-soft: rgba(200, 16, 46, 0.12);
  --danger: #ff7b88;
  --success: #37d39a;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(200, 16, 46, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 65, 95, 0.12), transparent 20%),
    linear-gradient(180deg, #151518 0%, #080809 38%, #050505 100%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.03), transparent 30%, transparent 70%, rgba(255,255,255,0.02));
}

.app-shell { max-width: 1320px; margin: 0 auto; padding: 28px 20px 40px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.hidden { display: none !important; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 22px; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap { gap: 10px; }
.wrap-gap { gap: 14px; flex-wrap: wrap; }
.grid { display: grid; gap: 22px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.full-width { grid-column: 1 / -1; }

h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { letter-spacing: -0.02em; }
h1, h2, h3, h4, p, label, th, td { text-align: left; }

input, textarea, select, button {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(10, 10, 12, 0.92);
  color: var(--text);
  padding: 13px 14px;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgba(255, 65, 95, 0.7);
  box-shadow: 0 0 0 4px rgba(200, 16, 46, 0.14);
}

button {
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  border-color: transparent;
  box-shadow: 0 14px 30px rgba(200, 16, 46, 0.25);
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(200, 16, 46, 0.35);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

button.secondary {
  background: rgba(255,255,255,0.02);
  color: var(--text);
  border-color: rgba(255,255,255,0.18);
  box-shadow: none;
}

input::placeholder,
textarea::placeholder {
  color: rgba(255,255,255,0.34);
}

textarea { min-height: 96px; resize: vertical; }
label { display: flex; flex-direction: column; gap: 8px; color: var(--muted); font-size: 0.95rem; }
.field-label {
  color: rgba(255,255,255,0.92);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  align-items: stretch;
}
.field-hint {
  color: rgba(255,255,255,0.42);
  font-size: 0.82rem;
  font-weight: 500;
}
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 20px; }
.empty-state {
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 18px;
  color: var(--muted);
  background: rgba(255,255,255,0.02);
}

#login-card {
  max-width: 540px;
  margin: 8vh auto 0;
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(28, 13, 17, 0.95), rgba(12, 12, 14, 0.96));
}

#login-card h1 {
  margin: 0 0 10px;
  font-family: 'Gazpacho', Georgia, serif;
  font-size: clamp(2.8rem, 7vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: 0.02em;
}

.topbar {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  position: sticky;
  top: 14px;
  z-index: 30;
}

.topbar h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.menu-toggle-btn {
  width: auto;
  min-width: 110px;
  max-width: 110px;
}

.password-change-panel {
  max-width: 620px;
  margin: 0 auto;
  border-color: var(--line-strong);
  background: linear-gradient(180deg, rgba(28, 13, 17, 0.95), rgba(12, 12, 14, 0.96));
}

.menu-tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: rgba(255,255,255,0.03);
  position: fixed;
  top: 86px;
  right: 20px;
  width: min(240px, calc(100vw - 24px));
  z-index: 40;
}

.menu-tab {
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  color: var(--muted);
  font-weight: 600;
  padding: 15px 14px;
  text-align: left;
  width: 100%;
}

.menu-tab.active {
  background: linear-gradient(135deg, rgba(200,16,46,0.24), rgba(255,65,95,0.12));
  border-color: rgba(255, 65, 95, 0.28);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), 0 14px 30px rgba(200, 16, 46, 0.15);
}

.menu-logout-btn {
  margin-top: 4px;
  color: #ffb1bc;
}

.view-section { animation: fadeIn 180ms ease; }

.timer-card {
  background: linear-gradient(145deg, rgba(36, 12, 17, 0.96), rgba(17, 17, 19, 0.94));
  border-color: rgba(255, 65, 95, 0.22);
}

.live-clock {
  display: block;
  font-size: clamp(2.8rem, 8vw, 5rem);
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px rgba(255, 65, 95, 0.18);
}

#clock-note {
  min-height: 88px;
}

.big-stat {
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1;
}

.absence-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

.action-buttons { flex-wrap: wrap; }
.action-buttons button { max-width: 220px; }

.planning-form-card {
  background: linear-gradient(145deg, rgba(34, 15, 19, 0.96), rgba(17, 17, 19, 0.94));
  border-color: rgba(255, 65, 95, 0.18);
}

.planning-list-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.02));
}

.planning-head {
  gap: 6px;
}

.planning-form {
  gap: 18px;
}

.location-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 8px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

.location-option {
  position: relative;
  margin: 0;
  cursor: pointer;
}

.location-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.location-option span {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 58px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(10, 10, 12, 0.82);
  color: var(--muted);
  font-weight: 700;
  padding: 0 18px;
  transition: all 140ms ease;
}

.location-option input:checked + span {
  background: linear-gradient(135deg, rgba(200,16,46,0.28), rgba(255,65,95,0.14));
  border-color: rgba(255, 65, 95, 0.35);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05), 0 10px 22px rgba(200, 16, 46, 0.12);
}

.input-large {
  min-height: 64px;
  height: 64px;
  padding: 18px 18px;
  border-radius: 18px;
  font-size: 1.06rem;
  background: linear-gradient(180deg, rgba(10, 10, 12, 0.98), rgba(17, 17, 20, 0.96));
  border-color: rgba(255,255,255,0.12);
}

textarea.input-large {
  height: auto;
  min-height: 140px;
}

.picker-input {
  appearance: none;
  -webkit-appearance: none;
}

.picker-input::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.8;
  cursor: pointer;
}

.planning-note {
  min-height: 140px;
}

.planning-week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 2px;
}

.planning-week-nav strong {
  text-align: left;
  font-size: 0.98rem;
  flex: 1;
}

.planning-week-nav button {
  max-width: 220px;
}

.planning-table-wrap {
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(8,8,10,0.72), rgba(8,8,10,0.5));
}

#availability-list td {
  padding-top: 16px;
  padding-bottom: 16px;
}

.location-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.08);
}

.location-fildorado {
  background: rgba(55, 211, 154, 0.12);
  color: #9af5d2;
}

.location-achtwerk {
  background: rgba(255, 65, 95, 0.12);
  color: #ffb1bc;
}

.availability-action-cell {
  width: 56px;
  text-align: right;
}

.availability-delete-btn {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  background: rgba(255,255,255,0.03);
  color: #ffb1bc;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: none;
}

.availability-delete-btn:hover {
  background: rgba(200, 16, 46, 0.18);
  border-color: rgba(255, 65, 95, 0.3);
}

.availability-locked {
  color: rgba(255,255,255,0.28);
  font-weight: 700;
}

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stats-grid div {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}
.stats-grid span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.08em; }
.stats-grid strong { font-size: clamp(1.4rem, 3vw, 2.3rem); }
.single-row { align-self: stretch; }
.report-grid div { background: linear-gradient(180deg, rgba(200,16,46,0.12), rgba(255,255,255,0.03)); }

.month-group {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
}

.month-group-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.month-group-header h4 {
  font-size: 1.05rem;
  text-transform: capitalize;
}

.month-group-header span { color: var(--muted); font-size: 0.9rem; }
.month-table-wrap { border-radius: 16px; overflow: hidden; }

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  background: rgba(8,8,10,0.5);
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid rgba(255,255,255,0.06); vertical-align: top; }
th { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; background: rgba(255,255,255,0.02); }
tr:last-child td { border-bottom: none; }

#availability-list td,
#my-vacations td {
  font-size: 0.92rem;
  white-space: nowrap;
}

#availability-list td:nth-child(5) {
  max-width: 140px;
  white-space: normal;
}

#my-vacations td:last-child {
  white-space: normal;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(255,255,255,0.08);
}
.status-open { background: rgba(55, 211, 154, 0.12); color: #92ffd8; }
.status-closed, .status-edited { background: rgba(255, 65, 95, 0.12); color: #ffb1bc; }

.status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 20px;
  font-size: 1rem;
  font-weight: 800;
}

.status-pending { color: #ffd36a; }
.status-approved { color: #92ffd8; }
.status-rejected { color: #ff9cab; }

.month-picker {
  min-width: 170px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .app-shell { padding: 14px 12px 28px; }
  .card { padding: 16px; border-radius: 18px; }
  .menu-tabs { right: 12px; top: 78px; width: calc(100vw - 24px); }
  .month-group-header, .between, .row { flex-wrap: wrap; }
  .live-clock { font-size: 2.4rem; }
  .menu-toggle-btn { max-width: none; min-width: 0; }
  .input-large { min-height: 58px; height: 58px; padding: 16px; font-size: 1rem; }
  .planning-note, textarea.input-large { min-height: 124px; height: auto; }
  .planning-week-nav { flex-direction: column; align-items: stretch; }
  .planning-week-nav button { max-width: none; }
  th, td { padding: 10px 8px; }
  #availability-list td, #my-vacations td { font-size: 0.84rem; }
  .location-pill { padding: 6px 9px; font-size: 0.74rem; }
}
