/* Kalendarz miesięcy (makieta wersja A, plansza Main, wariant "tint"): jasne tło poziomu obłożenia z paskiem u dołu,
   liczby zielone/czerwone wobec budżetu. Komputer: dwa miesiące obok siebie, węziej jeden. */
:root {
  --up: #166534;
  --down: #B91C1C;
  --muted: #475569;
  --line: #E2E8F0;
  --level-0: #EEF4FB; --strip-0: #9DC3EA;
  --level-1: #E1ECF9; --strip-1: #4A8FD6;
  --level-2: #E4F2E7; --strip-2: #3E8E4F;
  --level-3: #FBE6EE; --strip-3: #D9467A;
  --level-4: #F8DDDA; --strip-4: #A8231A;
}

.up { color: var(--up); }
.down { color: var(--down); }

.calendar-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.calendar-head h1 { margin: 0; font-size: 24px; letter-spacing: -0.01em; }
.calendar-subtitle { margin: 4px 0 0; font-size: 14px; color: var(--muted); }

.calendar-range {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.calendar-range select,
.calendar-button {
  height: 44px;
  padding: 0 12px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  background: #FFFFFF;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}

.calendar-button { cursor: pointer; }
.calendar-link { color: var(--accent); font-size: 14px; font-weight: 600; padding: 0 10px; }

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13px;
  color: #334155;
}

.legend-title { font-weight: 600; color: var(--ink); }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-item .up, .legend-item .down { font-weight: 700; }

.legend-swatch {
  width: 18px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.legend-today { width: 14px; height: 14px; border-radius: 4px; outline: 2px solid var(--accent); outline-offset: 1px; }

.months { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }

@media (min-width: 1024px) {
  .months { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.month {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: clamp(10px, 2.5vw, 16px);
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.month h2 { margin: 0; font-size: 18px; }

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.kpi {
  color: inherit;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  background: #F8FAFC;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.kpi-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.kpi-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 20px; font-weight: 700; }
.kpi-delta { font-size: 12px; }
.kpi-bar { display: block; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.kpi-bar span { display: block; height: 4px; }
.kpi-bar .up { background: #16A34A; }
.kpi-bar .down { background: #DC2626; }
.kpi-budget { font-size: 12px; color: #64748B; }

.grid { display: flex; flex-direction: column; gap: 4px; }

.grid-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr)) 6px repeat(2, minmax(0, 0.95fr));
  gap: 4px;
}

.grid-header {
  font-size: 11px;
  font-weight: 600;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.grid-header span { padding: 4px 4px; text-align: center; }
.grid-header .weekend { background: #F1F5F9; border-radius: 6px; }

.day,
.week {
  container-type: inline-size;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  border-radius: 8px;
}

.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  position: relative;
  padding: 2px 2px 6px;
  background: #F8FAFC;
}

.day-empty { background: transparent; }

.day-number {
  position: absolute;
  top: clamp(2px, 0.6vw, 6px);
  left: clamp(3px, 0.7vw, 7px);
  font-size: max(11px, 17cqw);
  line-height: 1.2;
  font-weight: 600;
  color: var(--muted);
}

.day-rooms,
.day-adr,
.week span {
  font-size: max(12px, 24cqw);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.day-rooms { margin-top: 1.1em; }

.day.today { outline: 2px solid var(--accent); outline-offset: 2px; }
.day.today .day-number { color: #FFFFFF; background: var(--accent); border-radius: 999px; padding: 0 0.45em; }

.week {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F8FAFC;
  border: 1px solid var(--line);
}

.week span:not(.up):not(.down) { color: #64748B; }
.week a { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; text-decoration: none; border-radius: 8px; }
.week a:hover span, .kpi:hover .kpi-value { text-decoration: underline; }
.kpi:focus-visible, .week a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.level-0 { background: var(--level-0); box-shadow: inset 0 -4px 0 var(--strip-0); }
.level-1 { background: var(--level-1); box-shadow: inset 0 -4px 0 var(--strip-1); }
.level-2 { background: var(--level-2); box-shadow: inset 0 -4px 0 var(--strip-2); }
.level-3 { background: var(--level-3); box-shadow: inset 0 -4px 0 var(--strip-3); }
.level-4 { background: var(--level-4); box-shadow: inset 0 -4px 0 var(--strip-4); }

/* Telefon: bez podpowiedzi, mniejsze odstępy kafelków. */
@media (max-width: 640px) {
  .calendar-hint { display: none; }
  .grid, .grid-row { gap: 2px; }
  .kpi { padding: 8px; }
  .kpi-value { font-size: 16px; }
}

/* Liczby kafelka prowadzą do okna dnia i okna ADR (7c1). */
.day a { text-decoration: none; border-radius: 4px; }
.day a:not(.up):not(.down) { color: var(--ink); }
.day a:hover { text-decoration: underline; }
.day a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Zmiana koloru do potwierdzenia (7d, makieta: różowa pulsująca kropka) i przycisk "Potwierdź wszystkie zmiany". */
.change-dot {
  display: inline-block;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #DB2777;
  animation: change-pulse 1.6s ease-in-out infinite;
}

.day .change-dot { position: absolute; top: clamp(4px, 0.8vw, 8px); right: clamp(4px, 0.8vw, 8px); }

@keyframes change-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(219, 39, 119, 0.55); }
  50% { box-shadow: 0 0 0 5px rgba(219, 39, 119, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .change-dot { animation: none; }
}

.calendar-head .button_to { margin: 0; }
.acknowledge-all { display: flex; align-items: center; gap: 8px; }
.pending-count { padding: 1px 8px; border-radius: 999px; background: #DB2777; color: #FFFFFF; font-size: 12px; }
