:root {
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-soft: #f5f8ff;
  --ink: #0f172a;
  --muted: #667085;
  --line: #e7ebf2;
  --blue: #3b78e7;
  --blue-soft: #e8f0ff;
  --green: #31915a;
  --green-soft: #e5f6ec;
  --orange: #e77922;
  --orange-soft: #fff0df;
  --purple: #8d5bd6;
  --purple-soft: #f1e8ff;
  --amber: #c58b21;
  --amber-soft: #fff6dd;
  --rose: #d94f55;
  --rose-soft: #ffeaec;
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  --soft-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 75% 4%, rgba(59, 120, 231, 0.08), transparent 22rem),
    linear-gradient(180deg, #fbfcff 0%, var(--bg) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: var(--blue);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

h1,
h2,
p,
blockquote {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: 1.72rem;
  line-height: 1.12;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.app-shell {
  display: grid;
  grid-template-columns: 206px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 26px 14px 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: center;
  padding: 0 8px 28px;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: transparent;
  background: linear-gradient(135deg, #fff6d9, #eef7ff);
  font-weight: 900;
  box-shadow: var(--soft-shadow);
}

.brand-mark::before,
.student-avatar::before {
  content: "\1F3C6";
  color: #9a6415;
  font-size: 25px;
  line-height: 1;
}

.brand strong {
  display: block;
  font-size: 1.72rem;
  letter-spacing: 0;
}

.brand span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.25;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-list a {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 8px;
  color: #344054;
  font-size: 0.92rem;
  font-weight: 650;
}

.nav-list a span {
  color: #98a2b3;
  font-size: 0.74rem;
  font-weight: 800;
}

.nav-list a.active,
.nav-list a:hover {
  color: #1f5fd2;
  background: #eef4ff;
}

.nav-list a.active span,
.nav-list a:hover span {
  color: #6692ef;
}

.side-note {
  margin-top: auto;
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.side-note span {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
}

.side-note p {
  margin: 12px 0 0;
  color: #344054;
  line-height: 1.45;
}

.dashboard {
  width: min(1180px, calc(100% - 42px));
  margin: 0 auto;
  padding: 16px 0 24px;
}

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

.title-block p,
.date-cluster span,
.muted-line,
.generated-line {
  color: var(--muted);
  font-size: 0.88rem;
}

.date-cluster {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 14px;
  text-align: right;
}

.date-cluster strong {
  grid-column: 1;
  font-size: 0.92rem;
}

.student-avatar {
  position: relative;
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: transparent;
  background: linear-gradient(135deg, #fff1b8, #e8f4ff);
  font-weight: 900;
  box-shadow: var(--soft-shadow);
}

.student-avatar::before {
  font-size: 24px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card,
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--soft-shadow);
}

.kpi-card {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  min-height: 116px;
  padding: 16px;
}

.kpi-icon,
.section-icon {
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 900;
}

.kpi-icon {
  width: 48px;
  height: 48px;
  font-size: 0.8rem;
}

.kpi-card p,
.kpi-card small {
  margin: 0;
  color: var(--muted);
}

.kpi-card p {
  font-weight: 680;
}

.kpi-card strong {
  display: block;
  margin: 4px 0;
  font-size: 1.18rem;
  line-height: 1.12;
}

.kpi-card small {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.82rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.green .kpi-icon,
.section-icon.green {
  color: var(--green);
  background: var(--green-soft);
}

.amber .kpi-icon,
.orange .kpi-icon,
.section-icon.amber {
  color: var(--orange);
  background: var(--orange-soft);
}

.blue .kpi-icon,
.section-icon.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

.purple .kpi-icon {
  color: var(--purple);
  background: var(--purple-soft);
}

.rose .kpi-icon {
  color: var(--rose);
  background: var(--rose-soft);
}

.content-grid {
  display: grid;
  grid-template-columns: 1.12fr 1fr 0.92fr;
  gap: 14px;
}

.card {
  min-height: 214px;
  padding: 18px;
}

.weekly-card {
  grid-row: span 1;
}

.review-card {
  grid-column: span 3;
  min-height: 160px;
}

.card-title-row,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.section-title {
  justify-content: flex-start;
}

.section-icon {
  width: 28px;
  height: 28px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 0.68rem;
}

.section-icon.dark {
  color: #344054;
  background: #edf0f5;
}

.brief-box {
  padding: 18px;
  border: 1px solid #edf2fb;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fbff, #eef4ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.brief-text {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 16px;
  color: #101828;
  font-size: 0.92rem;
  font-weight: 720;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 7;
}

.priority-block {
  display: grid;
  gap: 6px;
}

.priority-block span {
  color: #101828;
  font-weight: 800;
}

.priority-block strong {
  display: -webkit-box;
  overflow: hidden;
  color: #344054;
  font-size: 0.9rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.generated-line {
  margin: 12px 0 0;
  text-align: center;
}

.event-list,
.activity-list,
.growth-list,
.study-list,
.action-list,
.review-list {
  display: grid;
  gap: 10px;
}

.event-row {
  display: grid;
  grid-template-columns: 12px 46px 1fr auto;
  align-items: center;
  gap: 12px;
}

.event-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.event-dot.amber {
  background: var(--orange);
}

.event-dot.rose {
  background: var(--rose);
}

.event-dot.green {
  background: var(--green);
}

.event-row time {
  display: grid;
  place-items: center;
  min-height: 48px;
  border-right: 1px solid var(--line);
  color: #344054;
}

.event-row time small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.event-row time strong {
  font-size: 1.1rem;
}

.event-row div strong,
.activity-row strong {
  display: block;
  margin-bottom: 4px;
}

.event-row div span,
.activity-row span {
  color: var(--muted);
  font-size: 0.86rem;
}

.event-row em,
.activity-row em,
.count-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.activity-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
}

.activity-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #344054;
  background: #f1f4f9;
  font-size: 0.72rem;
  font-weight: 900;
}

.growth-card {
  position: relative;
}

.growth-ring {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  margin: 12px auto 20px;
  border: 14px solid #dbeafe;
  border-top-color: var(--blue);
  border-right-color: #8bb4ff;
  border-radius: 50%;
  color: var(--blue);
  font-size: 1.7rem;
  font-weight: 900;
}

.metric-row,
.study-row {
  display: grid;
  gap: 7px;
}

.metric-label {
  display: flex;
  justify-content: space-between;
  color: #344054;
  font-size: 0.86rem;
}

.bar,
.study-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f7;
}

.bar i,
.study-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #8ab5ff);
}

.study-row {
  grid-template-columns: 1fr 1.5fr 42px;
  align-items: center;
  min-height: 32px;
  color: #344054;
  font-size: 0.9rem;
}

.study-row strong {
  justify-self: end;
  color: var(--green);
}

.teacher-card blockquote {
  position: relative;
  margin: 8px 0 18px;
  padding-left: 42px;
  color: #101828;
  font-size: 0.96rem;
  line-height: 1.55;
}

.teacher-card blockquote::before {
  content: "\201C";
  position: absolute;
  left: 0;
  top: -8px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--green);
  background: var(--green-soft);
  font-size: 2rem;
  font-weight: 900;
}

.action-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  color: #101828;
  font-size: 0.92rem;
  font-weight: 680;
}

.action-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--blue);
}

.action-row em {
  color: var(--rose);
  font-style: normal;
  font-weight: 760;
}

.mini-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-day {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 4px 2px;
  color: #344054;
}

.calendar-day span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.calendar-day strong {
  font-size: 1.05rem;
}

.calendar-day div,
.calendar-legend {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-legend {
  flex-wrap: wrap;
  margin-top: 22px;
  color: #344054;
  font-size: 0.82rem;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.dot.event {
  background: var(--purple);
}

.dot.activity {
  background: var(--green);
}

.dot.review,
.dot.action {
  background: var(--orange);
}

.dot.important,
.dot.family,
.dot.language {
  background: var(--rose);
}

.note-box {
  padding: 18px;
  border-radius: 8px;
  background: #fff8e6;
}

.note-box p {
  margin: 0 0 8px;
  color: #344054;
  font-size: 0.9rem;
  line-height: 1.45;
}

.note-box p:last-child {
  margin-bottom: 0;
}

.review-card .review-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.review-row {
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.review-row.high {
  border-color: #ffd5d8;
  background: #fff7f8;
}

.review-row strong {
  display: block;
  margin-bottom: 8px;
}

.review-row span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.footer-line {
  padding: 22px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

.load-error {
  width: min(680px, calc(100% - 40px));
  margin: 10vh auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

@media (max-width: 1180px) {
  .kpi-grid,
  .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-card {
    grid-column: span 2;
  }

  .review-card .review-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand {
    padding-bottom: 14px;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-note {
    display: none;
  }

  .dashboard {
    width: min(100% - 24px, 1180px);
  }
}

@media (max-width: 640px) {
  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .date-cluster {
    text-align: left;
  }

  .kpi-grid,
  .content-grid,
  .review-card .review-list {
    grid-template-columns: 1fr;
  }

  .review-card {
    grid-column: auto;
  }

  .kpi-card {
    min-height: 112px;
  }

  .event-row {
    grid-template-columns: 10px 42px 1fr;
  }

  .event-row em {
    grid-column: 3;
  }

  .study-row,
  .activity-row {
    grid-template-columns: 1fr;
  }

  .mini-calendar {
    gap: 4px;
  }
}
