* { box-sizing: border-box; }
:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #667085;
  --border: #d9e0ea;
  --night: #5b5ce2;
  --sunday: #ef8b1f;
  --sunday-night: #c039b3;
  --rest: #28a66a;
  --normal: #64748b;
}
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 28px;
}
h1, h2, p { margin: 0; }
h1 { font-size: 32px; }
.topbar p, .small { color: var(--muted); margin-top: 6px; line-height: 1.45; }
.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 16px;
}
button {
  border: 0;
  background: #eef2ff;
  color: var(--text);
  font-size: 24px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  cursor: pointer;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  padding: 0 28px 28px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
}
.weekdays, .calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.weekdays {
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}
.calendar {
  gap: 10px;
}
.day {
  min-height: 135px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px;
  background: #fbfcff;
}
.day.other { opacity: .35; }
.day-number {
  font-weight: 800;
  margin-bottom: 8px;
}
.shift {
  display: block;
  padding: 7px 8px;
  margin-top: 6px;
  border-radius: 10px;
  color: white;
  font-size: 13px;
  line-height: 1.25;
}
.shift.night { background: var(--night); }
.shift.sunday { background: var(--sunday); }
.shift.sunday-night { background: var(--sunday-night); }
.shift.rest { background: var(--rest); }
.shift.normal { background: var(--normal); }
.side { display: flex; flex-direction: column; gap: 20px; }
.summary {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.metric {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid var(--border);
}
.metric strong { text-align: right; }
.legend {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dot {
  width: 13px;
  height: 13px;
  border-radius: 99px;
  display: inline-block;
}
.dot.night { background: var(--night); }
.dot.sunday { background: var(--sunday); }
.dot.sunday-night { background: var(--sunday-night); }
.dot.rest { background: var(--rest); }
.dot.normal { background: var(--normal); }

@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 680px) {
  .calendar { gap: 6px; }
  .day { min-height: 115px; padding: 7px; }
  .shift { font-size: 11px; padding: 6px; }
}
