:root {
  --navy: #0b2c70;
  --navy-dark: #061d51;
  --red: #ef2430;
  --blue: #1f6ee5;
  --orange: #f2a000;
  --teal: #12a3a5;
  --purple: #7955df;
  --ink: #14213d;
  --line: #dce5f3;
  --soft: #f4f7fc;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #fff;
  font-family: Montserrat, Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.sitebar {
  min-height: 94px;
  padding: 12px max(4vw, 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: var(--navy-dark);
  border-bottom: 6px solid var(--red);
}
.brand { display: flex; align-items: center; gap: 16px; font-size: 18px; font-weight: 800; line-height: 1.05; }
.brand img { width: 72px; height: 64px; object-fit: contain; }
.home-link { padding: 12px 18px; border: 1px solid #ffffff55; border-radius: 999px; font-weight: 600; }

main { width: min(1440px, 94vw); margin: 0 auto; padding-bottom: 64px; }
.intro {
  margin-top: 28px;
  padding: 46px clamp(24px, 5vw, 72px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  color: #fff;
  background: linear-gradient(120deg, var(--navy-dark), var(--navy));
  border-radius: 28px;
  overflow: hidden;
  position: relative;
}
.intro::after {
  content: "A";
  position: absolute;
  right: 3%;
  top: -48%;
  font-size: 430px;
  font-weight: 800;
  color: #ffffff08;
  pointer-events: none;
}
.eyebrow { margin: 0 0 12px; color: #fff; font-size: 13px; font-weight: 800; letter-spacing: .13em; }
.eyebrow.dark { color: var(--blue); }
h1 { max-width: 780px; margin: 0; font-size: clamp(42px, 6vw, 82px); line-height: .95; }
.lead { max-width: 750px; margin: 22px 0 0; color: #dce7ff; font-size: 17px; line-height: 1.65; }
.intro-actions { position: relative; z-index: 1; display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.button { min-width: 150px; padding: 15px 20px; border-radius: 14px; border: 1px solid transparent; cursor: pointer; text-align: center; font-weight: 700; }
.button-light { color: var(--navy); background: #fff; }
.button-outline { color: #fff; background: transparent; border-color: #ffffff66; }

.toolbar {
  margin: 26px 0 18px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.month-control { display: flex; align-items: flex-end; gap: 10px; }
.month-control label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; color: #6b7891; }
.month-control select { min-width: 220px; padding: 11px 38px 11px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--navy); background: #fff; font-weight: 700; }
.circle-button { width: 44px; height: 44px; border: 0; border-radius: 50%; color: #fff; background: var(--navy); cursor: pointer; font-size: 21px; }
.circle-button:disabled { opacity: .35; cursor: default; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.filter { padding: 10px 13px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; color: #4e5b73; background: #fff; cursor: pointer; font-size: 13px; font-weight: 700; }
.filter i { width: 10px; height: 10px; border-radius: 3px; background: currentColor; }
.filter[data-category="academic"] { color: var(--blue); }
.filter[data-category="exam"] { color: var(--orange); }
.filter[data-category="parent"] { color: var(--teal); }
.filter[data-category="activity"] { color: var(--purple); }
.filter[data-category="special"] { color: var(--red); }
.filter:not(.active) { opacity: .35; background: transparent; }

.calendar-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .85fr); gap: 24px; }
.calendar-card, .events-card, .event-table-section { border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: 0 16px 42px #0b2c700c; }
.calendar-card { padding: 28px; }
.section-heading { min-height: 80px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.section-heading span { color: var(--blue); font-size: 20px; font-weight: 800; }
.section-heading h2 { margin: 2px 0 0; color: var(--navy); font-size: clamp(34px, 5vw, 58px); line-height: 1; }
.section-heading p { margin: 10px 0 0; color: #77839a; font-size: 12px; }
.table-scroll { overflow-x: auto; }
.calendar { width: 100%; min-width: 650px; border-collapse: collapse; table-layout: fixed; }
.calendar th { padding: 12px 4px; color: var(--navy); background: #eaf0fa; border: 1px solid var(--line); font-size: 12px; }
.calendar th:last-child { color: var(--red); }
.calendar td { height: 94px; padding: 9px; vertical-align: top; border: 1px solid var(--line); background: #fff; }
.calendar td.empty { background: #f8fafe; }
.calendar td.sunday .day-number { color: var(--red); }
.day-number { display: inline-grid; min-width: 28px; height: 28px; place-items: center; border-radius: 9px; font-size: 14px; font-weight: 800; }
.calendar td.has-event .day-number { color: #fff; background: var(--blue); }
.calendar td.has-event.exam .day-number { background: var(--orange); }
.calendar td.has-event.parent .day-number { background: var(--teal); }
.calendar td.has-event.activity .day-number { background: var(--purple); }
.calendar td.has-event.special .day-number { background: var(--red); }
.day-dots { margin-top: 10px; display: flex; gap: 4px; flex-wrap: wrap; }
.day-dot { width: 7px; height: 7px; border-radius: 50%; }
.day-note { margin-top: 7px; color: #657189; font-size: 10px; line-height: 1.3; }

.events-card { overflow: hidden; }
.events-title { padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; color: #fff; background: var(--navy); }
.events-title span { font-weight: 800; }
.events-title strong { font-size: 12px; opacity: .8; }
.events-list { max-height: 600px; overflow-y: auto; padding: 10px 18px 20px; }
.event-item { --category: var(--blue); margin-top: 10px; padding: 13px 10px 13px 16px; display: grid; grid-template-columns: 98px 1fr; gap: 12px; border-left: 5px solid var(--category); border-bottom: 1px solid #edf1f7; }
.event-date { color: var(--category); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.event-item p { margin: 0; font-size: 13px; line-height: 1.45; }
.empty-state { padding: 38px 10px; color: #6f7c92; text-align: center; line-height: 1.6; }

.event-table-section { margin-top: 24px; padding: 26px; }
.event-table-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.event-table-heading h2 { margin: 0; color: var(--navy); font-size: 28px; }
.search input { width: min(340px, 72vw); padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; outline: 0; }
.search input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #1f6ee518; }
.event-table { width: 100%; min-width: 660px; border-collapse: collapse; }
.event-table th { padding: 13px 14px; color: #fff; background: var(--navy); text-align: left; font-size: 13px; }
.event-table td { padding: 14px; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.type-badge { --category: var(--blue); display: inline-block; padding: 6px 9px; border-radius: 999px; color: var(--category); background: color-mix(in srgb, var(--category) 10%, white); font-size: 11px; font-weight: 800; }

footer { padding: 38px max(4vw, 24px); display: flex; align-items: center; gap: 24px; color: #d9e3f9; background: var(--navy-dark); }
footer img { width: 92px; height: 70px; object-fit: contain; }
footer p { margin: 0; font-weight: 600; }
footer small { margin-left: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 980px) {
  .intro { align-items: flex-start; flex-direction: column; }
  .intro-actions { justify-content: flex-start; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .filters { justify-content: flex-start; }
  .calendar-layout { grid-template-columns: 1fr; }
  .events-list { max-height: none; }
}

@media (max-width: 620px) {
  .sitebar { min-height: 78px; padding: 8px 16px; }
  .brand img { width: 58px; height: 52px; }
  .brand span { display: none; }
  .home-link { padding: 10px 12px; font-size: 12px; }
  main { width: min(100% - 24px, 1440px); }
  .intro { margin-top: 12px; padding: 32px 22px; border-radius: 20px; }
  .lead { font-size: 15px; }
  .button { width: 100%; }
  .intro-actions { width: 100%; }
  .toolbar { padding: 14px; }
  .month-control { width: 100%; align-items: flex-end; }
  .month-control label { flex: 1; }
  .month-control select { width: 100%; min-width: 0; }
  .filter { padding: 8px 10px; font-size: 11px; }
  .calendar-card { padding: 18px 14px; }
  .section-heading { display: block; }
  .section-heading p { margin: 8px 0 14px; }
  .event-item { grid-template-columns: 88px 1fr; }
  .event-table-section { padding: 20px 14px; }
  .event-table-heading { align-items: stretch; flex-direction: column; }
  .search input { width: 100%; }
  footer { align-items: flex-start; flex-direction: column; }
  footer small { margin-left: 0; }
}

@media print {
  .sitebar, .intro-actions, .toolbar, .event-table-section, footer { display: none !important; }
  main { width: 100%; }
  .intro { margin: 0 0 14px; padding: 22px; border-radius: 0; color: var(--navy); background: #fff; border-bottom: 3px solid var(--red); }
  .intro .lead, .intro .eyebrow { color: var(--navy); }
  .calendar-layout { grid-template-columns: 1.5fr 1fr; }
  .calendar-card, .events-card { box-shadow: none; break-inside: avoid; }
  .calendar td { height: 70px; }
}
