/* =============================================
   ZMIENNE I RESET
   ============================================= */
:root {
  --dusty-olive:    #797d62;
  --olive-light:    #9a9e7e;
  --olive-pale:     #e8ead8;
  --olive-mid:      #d0d3b8;
  --lavender:       #dfd9e2;
  --lavender-pale:  #f0edf2;
  --sunflower:      #ffc759;
  --sunflower-pale: #fff3d6;
  --jet:            #292f36;
  --jet-mid:        #3d454e;
  --strawberry:     #f44174;
  --strawberry-pale:#fde8ee;

  --bg:             #f5f5f0;
  --surface:        #ffffff;
  --text-main:      #292f36;
  --text-muted:     #5a6270;
  --text-light:     #8a9099;
  --border:         #e0e0d8;

  --radius:         6px;
  --radius-lg:      8px;
  --font:           'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono:           'Consolas', 'Courier New', monospace;

  --sidebar-w:      210px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
}

a { text-decoration: none; color: inherit; }

/* =============================================
   NAGŁÓWEK
   ============================================= */
.site-header {
  background: var(--jet);
  color: #fff;
  padding: 14px 24px 12px;
  border-bottom: 3px solid var(--dusty-olive);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1700px;
  margin: 0 auto;
}

/* Tytuł */
.header-title {
  flex-shrink: 0;
}

.header-title h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  line-height: 1.2;
  white-space: nowrap;
}

.header-title h1 .accent {
  color: var(--sunflower);
}

.header-sub {
  font-size: 0.75rem;
  color: var(--olive-light);
  margin-top: 2px;
  white-space: nowrap;
}

/* Sentencja — zajmuje wolne miejsce */
.header-quote {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border-left: 3px solid var(--dusty-olive);
  padding: 7px 14px;
  border-radius: 0 var(--radius) var(--radius) 0;
  min-width: 0;
}

.quote-label {
  display: block;
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--olive-light);
  margin-bottom: 3px;
}

#quote-text {
  font-size: 0.85rem;
  font-style: italic;
  color: #e0e0d8;
  line-height: 1.4;
}

/* Meta: licznik + kafelek */
.header-meta {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--radius-lg);
  padding: 7px 16px;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.meta-label {
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--olive-light);
}

.meta-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--sunflower);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.meta-tile {
  color: var(--olive-light);
}

.meta-unit {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 500;
}

.meta-divider {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,0.12);
}

.meta-sub {
  width: 100%;
  font-size: 0.63rem;
  color: var(--text-light);
  text-align: center;
  margin-top: -4px;
}

/* =============================================
   UKŁAD GŁÓWNY: kafelki + sidebar
   ============================================= */
.main-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: 0;
  max-width: 1700px;
  margin: 0 auto;
  align-items: start;
  padding: 0;
}

/* =============================================
   SEKCJA KAFELKÓW
   ============================================= */
.tiles-section {
  padding: 16px 16px 28px 24px;
  min-width: 0;
}

.group-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: var(--radius);
  margin: 14px 0 8px;
  display: inline-block;
}

.group-1-label {
  background: var(--olive-pale);
  color: var(--dusty-olive);
  border-left: 3px solid var(--dusty-olive);
}
.group-2-label {
  background: var(--lavender-pale);
  color: #6b5f72;
  border-left: 3px solid #b0a0bb;
}
.group-3-label {
  background: var(--sunflower-pale);
  color: #7a5800;
  border-left: 3px solid var(--sunflower);
}
.group-4-label {
  background: var(--strawberry-pale);
  color: #a01040;
  border-left: 3px solid var(--strawberry);
}

.tiles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* =============================================
   KAFELKI
   ============================================= */
.tile {
  display: block;
  padding: 11px 13px 10px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  position: relative;
  transition: box-shadow 0.16s ease, transform 0.14s ease, border-color 0.16s ease;
  overflow: hidden;
}

.tile::before {
  content: '';
  display: block;
  height: 3px;
  position: absolute;
  top: 0; left: 0; right: 0;
  border-radius: 2px 2px 0 0;
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

/* Grupa 1 — oliwkowa */
.group-1 .tile           { background: #f4f5ee; border-color: var(--olive-mid); }
.group-1 .tile:hover     { border-color: var(--dusty-olive); }
.group-1 .tile::before   { background: var(--dusty-olive); }

/* Grupa 2 — lawendowa */
.group-2 .tile           { background: #f4f5ee; border-color: #ccc7d4; }
.group-2 .tile:hover     { border-color: #b0a0bb; }
.group-2 .tile::before   { background: #b0a0bb; }

/* Grupa 3 — złota */
.group-3 .tile           { background: #f4f5ee; border-color: #f0d89a; }
.group-3 .tile:hover     { border-color: var(--sunflower); }
.group-3 .tile::before   { background: var(--sunflower); }

/* Grupa 4 — truskawkowa */
.group-4 .tile           { background: #f4f5ee; border-color: #f0afc2; }
.group-4 .tile:hover     { border-color: var(--strawberry); }
.group-4 .tile::before   { background: var(--strawberry); }

.tile-title {
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
  line-height: 1.25;
  padding-right: 24px;
}

.tile-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.42;
}

.tile-number-badge {
  position: absolute;
  top: 9px;
  right: 10px;
  font-size: 0.62rem;
  font-weight: 700;
  font-family: var(--mono);
  color: var(--text-light);
  opacity: 0.55;
}

/* =============================================
   SIDEBAR — KALENDARZ
   ============================================= */
.calendar-sidebar {
  padding: 16px 16px 28px 8px;
  position: sticky;
  top: 0;
  align-self: start;
  border-left: 1px solid var(--border);
  background: var(--bg);
}

.sidebar-label {
  display: none; /* etykieta miesiąca generuje JS */
}

.calendars-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mini-calendar {
  width: 100%;
}

.cal-month-name {
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--dusty-olive);
  font-weight: 700;
  margin-bottom: 5px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--border);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}

.cal-day-name {
  font-size: 0.58rem;
  text-align: center;
  color: var(--text-light);
  padding-bottom: 3px;
  font-weight: 600;
}

.cal-day {
  font-size: 0.65rem;
  text-align: center;
  padding: 2px 1px;
  border-radius: 3px;
  color: var(--text-muted);
  line-height: 1.4;
  cursor: default;
}

.cal-day.empty   { background: transparent; }
.cal-day.weekend { color: var(--text-light); }

.cal-day.today {
  background: var(--dusty-olive);
  color: #fff;
  font-weight: 700;
}

.cal-day.exam-day {
  background: var(--strawberry);
  color: #fff;
  font-weight: 700;
}

/* =============================================
   STOPKA
   ============================================= */
.site-footer {
  text-align: center;
  padding: 10px 24px;
  font-size: 0.7rem;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* =============================================
   RESPONSYWNOŚĆ
   ============================================= */
@media (max-width: 1100px) {
  .tiles-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .calendar-sidebar {
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 14px 24px;
    position: static;
  }
  .calendars-col {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
  }
  .mini-calendar { width: 190px; }
}

@media (max-width: 600px) {
  .tiles-grid { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; }
  .header-meta { width: 100%; }
  .site-header,
  .tiles-section { padding-left: 12px; padding-right: 12px; }
}