* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 24px 12px;
}

.app {
  width: 100%;
  max-width: 480px;
}

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

.header h1 {
  font-size: 20px;
  font-weight: 600;
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
}

.month-nav button {
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
}

.month-nav button:hover {
  background: #334155;
}

.month-title {
  font-size: 17px;
  font-weight: 600;
  min-width: 160px;
  text-align: center;
  text-transform: capitalize;
}

.stats {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  flex: 1;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: #4ade80;
}

.stat-label {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.calendar {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 12px;
}

.weekdays,
.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.weekdays {
  margin-bottom: 8px;
}

.weekday {
  text-align: center;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
}

.week {
  margin-bottom: 4px;
}

.day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: #e2e8f0;
}

.day:hover {
  border-color: #475569;
}

.day.empty {
  cursor: default;
}

.day.weekend {
  color: #64748b;
}

.day.holiday-full {
  background: #7c2d12;
  color: #fed7aa;
}

.day.holiday-erev {
  background: #422006;
  color: #fdba74;
}

/* Отработанный день имеет приоритет по цвету над праздничным фоном */
.day.marked {
  background: #166534;
  color: #dcfce7;
  font-weight: 600;
}

.day.today {
  border-color: #38bdf8;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
  font-size: 12px;
  color: #94a3b8;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.dot.marked {
  background: #166534;
}

.dot.holiday-full {
  background: #7c2d12;
}

.dot.holiday-erev {
  background: #422006;
}

.hint {
  margin-top: 12px;
  font-size: 12px;
  color: #64748b;
  text-align: center;
}

.error {
  background: #7f1d1d;
  color: #fecaca;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
  font-size: 13px;
  text-align: center;
}
