:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #dbe1e8;
  --accent: #0f766e;
  --accent-dark: #115e59;

  --ok: #166534;
  --ok-bg: #dcfce7;
  --bad: #991b1b;
  --bad-bg: #fee2e2;

  --free: #57b33e;
  --free-border: #3f8f27;

  --booked: #d84c4c;
  --booked-border: #a93232;

  --past: #9ea4ac;
  --past-border: #7d838b;

  --no-arrival: #f0a500;
  --no-departure: #2f80ed;

  --shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #eff6ff 0%, var(--bg) 120px);
}

.wrap {
  width: min(1100px, calc(100% - 24px));
  margin: 24px auto 40px;
}

.wrap.narrow {
  width: min(900px, calc(100% - 24px));
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12px;
}

h1,
h2,
h3 {
  margin-top: 0;
}

.grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 18px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label {
  display: block;
  margin-bottom: 14px;
}

label span {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--muted);
}

input,
select,
button {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  font-size: 16px;
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--accent-dark);
}

button[disabled] {
  background: #9ca3af;
  cursor: not-allowed;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.actions.split {
  justify-content: space-between;
  align-items: center;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

.checkbox-row input {
  width: auto;
  min-height: auto;
}

.checkbox-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 14px;
  background: #fafafa;
}

.notice,
.message {
  font-size: 14px;
  color: var(--muted);
}

.notice.small {
  font-size: 12px;
  margin-top: 4px;
}

.summary {
  margin: 16px 0 0;
}

.summary.hidden,
.hidden {
  display: none !important;
}

.summary div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.summary .total {
  font-size: 20px;
  font-weight: 700;
}

.badge {
  display: inline-block;
  margin-top: 18px;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
}

.badge.ok {
  color: var(--ok);
  background: var(--ok-bg);
}

.badge.bad {
  color: var(--bad);
  background: var(--bad-bg);
}

.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: 12px 16px;
  text-decoration: none;
  background: #111827;
  color: #fff;
  border-radius: 12px;
}

.booking-list {
  display: grid;
  gap: 12px;
}

.booking-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.booking-item h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.booking-item p {
  margin: 6px 0;
}

/* =========================
   KALENDER
   ========================= */

.calendar-card {
  margin-top: 18px;
}

.calendar-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.calendar-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 16px;
}

.calendar-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.calendar-jump a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f3ead8;
  border: 1px solid #e2d2b7;
  color: #826437;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.calendar-jump a:hover {
  background: #ead8b5;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #d7dde5;
  line-height: 1;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  display: inline-block;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.legend-item.free .legend-swatch {
  background: var(--free);
}

.legend-item.booked .legend-swatch {
  background: var(--booked);
}

.legend-item.past .legend-swatch {
  background: var(--past);
}

.legend-item.blocked-arrival .legend-swatch {
  background: var(--no-arrival);
}

.legend-item.blocked-departure .legend-swatch {
  background: var(--no-departure);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.month-card {
  background: #ffffff;
  border: 1px solid #cfd6de;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.month-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.month-card-head h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #243041;
  text-align: left;
}

.month-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.month-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.month-weekdays span {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 0;
}

.month-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.day {
  position: relative;
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid #d3d8de;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #222;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.day > span {
  position: relative;
  z-index: 1;
}

.day.empty {
  background: transparent;
  border: none;
}

.day.free {
  background: var(--free);
  color: #ffffff;
  border: 1px solid var(--free-border);
}

.day.booked {
  background: var(--booked);
  color: #ffffff;
  border: 1px solid var(--booked-border);
}

.day.past {
  background: var(--past);
  color: #ffffff;
  border: 1px solid var(--past-border);
}

.day.today {
  box-shadow: inset 0 0 0 2px #1f2937;
}

.day.limited-arrival::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--no-arrival);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.day.limited-departure::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--no-departure);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.apartment-highlight,
.apartment-selected {
  border: 2px solid var(--accent);
  background: #ecfdf5;
  border-radius: 14px;
  padding: 12px;
}

/* Mobile */
@media (max-width: 820px) {
  .grid,
  .grid-2,
  .hero,
  .actions,
  .calendar-topbar {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .day {
    min-height: 40px;
    font-size: 13px;
  }

  .month-card-head h3 {
    font-size: 18px;
  }

  .legend {
    font-size: 13px;
    gap: 10px;
  }

  .legend-item {
    padding: 6px 10px;
  }
}
/* =========================
   PLANER 2-SPALTIG
   ========================= */

.planner-card {
  margin-top: 18px;
}

.planner-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.planner-layout {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 18px;
  align-items: start;
}

.planner-left,
.planner-right {
  min-width: 0;
}

.month-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.month-tab {
  width: auto;
  min-height: auto;
  border: 1px solid #d7dde5;
  background: #fff;
  color: #1f2937;
  border-radius: 14px;
  padding: 12px 18px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
}

.month-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.single-month-card {
  border: 1px solid #cfd6de;
  border-radius: 18px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.single-month-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.single-month-head h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #243041;
}

.single-month-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.selection-note {
  margin-top: 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #dbe1e8;
  padding: 14px 16px;
  font-size: 15px;
  color: #334155;
}

.day {
  cursor: pointer;
}

.day.disabled,
.day.empty,
.day.past {
  cursor: default;
}

.day.range-selected {
  box-shadow: inset 0 0 0 2px #1f2937;
}

.day.range-middle {
  box-shadow: inset 0 0 0 2px rgba(15, 118, 110, 0.35);
}

.day.range-start,
.day.range-end {
  transform: scale(1.02);
}

.match-panel {
  border: 1px solid #dbe1e8;
  border-radius: 18px;
  background: #f8fafc;
  padding: 18px;
}

.match-period {
  margin: 0 0 16px;
  font-size: 16px;
  color: #1f2937;
}

.match-list {
  display: grid;
  gap: 14px;
}

.match-card {
  border: 1px solid #d8dee6;
  border-radius: 16px;
  background: #fff;
  padding: 16px;
}

.match-card.selected {
  border: 2px solid var(--accent);
  background: #eefbf8;
}

.match-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.match-card-head h4 {
  margin: 0;
}

.match-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.match-ok {
  display: inline-block;
  padding: 7px 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 12px;
  font-weight: 700;
}

.select-apartment-btn {
  background: var(--accent);
  color: #fff;
  border: none;
}

.match-empty {
  border-radius: 14px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  padding: 16px;
  color: #881337;
}

@media (max-width: 980px) {
  .planner-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .planner-head {
    flex-direction: column;
  }

  .month-tab {
    padding: 10px 14px;
    font-size: 14px;
  }

  .single-month-head h3 {
    font-size: 20px;
  }
}
