:root {
  --blue: #213d77;
  --blue-light: #e3ebfa;
  --orange: #fb792b;
  --green: #1e9e5a;
  --red: #d93025;
  --bg: #f3f5f9;
  --text: #222;
  --muted: #9aa3b2;
}

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

body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.top-bar {
  background: var(--blue);
  color: #fff;
  padding: 8px 24px;
  border-bottom: 3px solid var(--orange);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo { font-size: 26px; }
.brand h1 { font-size: 20px; letter-spacing: 1px; }
.brand p { font-size: 12px; opacity: .85; }

.container { max-width: 860px; margin: 14px auto; padding: 0 16px; }

.summary {
  background: #fff;
  border-left: 5px solid var(--orange);
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 14px;
  font-size: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  line-height: 1.6;
}
.summary b { color: var(--blue); }

.layout { display: grid; grid-template-columns: 1fr 240px; gap: 16px; align-items: start; }

.calendar-card, .side-card {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

.cal-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cal-header h2 { flex: 1; text-align: center; font-size: 18px; color: var(--blue); }
.cal-header button {
  border: 1px solid #cfd6e4;
  background: #fff;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--blue);
}
.cal-header button:hover { background: var(--blue-light); }
.cal-header .today-btn { background: var(--orange); border-color: var(--orange); color: #fff; }
.cal-header .today-btn:hover { background: #e96a1f; }

.weekdays, .grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.weekdays div {
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  color: var(--blue);
  padding: 6px 0;
}
.weekdays div:first-child { color: var(--red); }

.day {
  position: relative;
  height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 500;
  border: 2px solid transparent;
  user-select: none;
}
.day.empty { visibility: hidden; }
.day.out { color: var(--muted); background: #f7f8fa; text-decoration: line-through; text-decoration-color: #d5d9e2; }
.day.in-window { background: var(--blue-light); color: var(--blue); font-weight: 600; }
.day.today { background: var(--blue); color: #fff; border-color: var(--orange); }
.day.last { background: var(--green); color: #fff; }

.day.holiday { cursor: help; }
.day.holiday::after {
  content: "";
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red);
}
.day.holiday:not(.today):not(.last) { border-color: var(--red); }
.day.holiday.out { text-decoration: none; background: #fdeceb; color: #b5524c; }

.legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 10px; font-size: 12px; color: #555;
}
.legend span { display: flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 2px solid transparent; }
.sw-today { background: var(--blue); border-color: var(--orange); }
.sw-window { background: var(--blue-light); }
.sw-last { background: var(--green); }
.sw-holiday { background: #fff; border-color: var(--red); }
.sw-out { background: #eceef2; }

.side-card h3 { font-size: 16px; color: var(--blue); margin-bottom: 12px; }
.side-card ul { list-style: none; }
.side-card li {
  padding: 10px 0;
  border-bottom: 1px solid #eef0f5;
  font-size: 14px;
}
.side-card li:last-child { border-bottom: none; }
.side-card li small { display: block; color: #666; margin-top: 2px; }
.side-card li.none { color: var(--muted); }

.tooltip {
  position: fixed;
  background: #222;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s;
  z-index: 10;
  white-space: nowrap;
}
.tooltip.show { opacity: 1; }

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .day { font-size: 13px; }
}
