@font-face {
  font-family: "Mulish";
  src: url("./assets/fonts/Mulish-Variable.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("./assets/fonts/Newsreader-Variable.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f4f4fb;
  --surface: #ffffff;
  --surface-soft: #f7f6ff;
  --line: #e7e7f2;
  --text: #1f2340;
  --muted: #737998;
  --brand: #22104d;
  --brand-2: #4c32a7;
  --accent: #ffb22c;
  --green: #0f9f67;
  --blue: #4b7afe;
  --pink: #ff5ea7;
  --orange: #f08a24;
  --shadow: 0 10px 30px rgba(28, 32, 66, 0.08);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Mulish", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 178, 44, 0.14), transparent 24%),
    linear-gradient(180deg, #f8f8fd 0%, var(--bg) 100%);
  color: var(--text);
}

button,
input,
textarea,
select,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.sidebar {
  padding: 18px 14px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  border-right: 1px solid rgba(231, 231, 242, 0.9);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.logo-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 0;
}

.logo-mark {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--surface-soft), #fff);
}

.logo-copy {
  display: flex;
  flex-direction: column;
}

.logo-copy strong,
.toolbar-title,
.kpi .value,
.score,
.attention-score {
  font-weight: 800;
}

.logo-copy strong {
  font-family: "Newsreader", serif;
  font-size: 1.2rem;
  color: var(--brand);
}

.logo-copy span {
  font-size: 0.76rem;
  color: var(--muted);
}

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

.nav-item {
  border: 0;
  background: transparent;
  color: #616a89;
  text-align: left;
  padding: 14px 16px;
  border-radius: 16px;
  cursor: pointer;
  font-weight: 800;
}

.nav-item.active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  box-shadow: var(--shadow);
}

.side-summary {
  margin-top: auto;
  background: linear-gradient(180deg, var(--brand) 0%, #2c1768 100%);
  color: #fff;
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.summary-label,
.eyebrow,
.kpi .label,
.profile-label,
th,
.micro-copy {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.eyebrow {
  margin-bottom: 6px;
}

.side-summary .summary-label {
  color: rgba(255, 255, 255, 0.72);
}

.side-summary strong {
  display: block;
  margin-bottom: 8px;
  font-family: "Newsreader", serif;
  font-size: 1.15rem;
}

.side-summary span {
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.84);
}

.workspace {
  padding: 22px;
  display: grid;
  gap: 18px;
}

.topbar,
.toolbar,
.subnav,
.card,
.day-strip,
.attendance-row,
.mini-summary-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
}

.topbar h1,
.card h2,
.form-card h2,
.table-card h2,
.attention-card h2 {
  margin: 0;
  font-family: "Newsreader", serif;
}

.topbar h1 {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.topbar p,
.card p,
.subtle,
.push-meta,
.month-chip,
.attendance-note {
  color: var(--muted);
}

.topbar-user img {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--brand);
  border: 3px solid #f2efff;
}

.page {
  display: none;
}

.page.visible,
.content-tab.visible {
  display: block;
}

.toolbar,
.subnav {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.select,
.search-input,
.form-card input,
.form-card textarea,
.form-card select {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
}

.select {
  min-width: 220px;
}

.search-input {
  width: 100%;
  max-width: 420px;
}

.month-chip {
  font-weight: 800;
}

.kpi-grid,
.analytics-kpis,
.students-summary,
.analytics-skill-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 14px 0;
}

.kpi,
.mini-summary-card,
.skill-insight-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
}

.kpi .value,
.mini-summary-card strong,
.skill-insight-card strong {
  display: block;
  font-size: 1.7rem;
}

.kpi .note {
  display: block;
  margin-top: 6px;
  font-size: 0.88rem;
  color: var(--muted);
}

.spotlight-grid,
.dashboard-grid,
.analytics-grid,
.profile-grid {
  display: grid;
  gap: 16px;
}

.spotlight-grid {
  grid-template-columns: 1.05fr 1fr;
  margin-bottom: 16px;
}

.dashboard-grid {
  grid-template-columns: 1fr 360px;
}

.analytics-grid {
  grid-template-columns: 1fr 1fr;
  margin: 14px 0;
}

.profile-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.side-stack {
  display: grid;
  gap: 16px;
}

.card {
  padding: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 14px;
}

.card h2 {
  font-size: 1.3rem;
  margin-bottom: 6px;
}

.chart-card {
  min-height: 430px;
}

.svg-chart {
  width: 100%;
  height: 310px;
}

.legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
  color: #667085;
  font-size: 0.92rem;
}

.legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 7px;
  border-radius: 999px;
  vertical-align: middle;
  background: currentColor;
}

.student-line,
.event-line,
.push-card,
.queue-item,
.attention-row,
.priority-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.student-line:last-child,
.event-line:last-child,
.push-card:last-child,
.queue-item:last-child,
.attention-row:last-child,
.priority-row:last-child {
  border-bottom: 0;
}

.priority-list,
.loop-card + .loop-card {
  margin-top: 8px;
}

.priority-row strong,
.loop-head strong,
.profile-block strong {
  display: block;
  margin-bottom: 4px;
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #8d76d8);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.score {
  color: var(--green);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 15px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 0.74rem;
}

td {
  font-size: 0.95rem;
}

.selected-row {
  background: #fbfaff;
}

.batch-pill,
.status-pill,
.tiny-pill,
.pill,
.issue-chip,
.mini-pill,
.flow-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 700;
}

.batch-pill,
.status-pill,
.mini-pill {
  padding: 7px 11px;
  font-size: 0.78rem;
}

.pill {
  padding: 8px 14px;
  background: #f3f5fa;
  color: #667085;
}

.pill.active,
.tiny-pill.live,
.subnav-item.active,
.action-btn.primary,
.inline-btn.primary-link {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
}

.batch-pill.n5 {
  background: #eef5ff;
  color: #3d62cc;
}

.batch-pill.n4 {
  background: #f6f1ff;
  color: #6d43c6;
}

.status-pill.good {
  background: #e9fbf4;
  color: var(--green);
}

.status-pill.watch,
.mini-pill.warn {
  background: #fff4e5;
  color: var(--orange);
}

.status-pill.risk {
  background: #fff0f3;
  color: #eb5f6d;
}

.mini-pill.info {
  background: #edf2ff;
  color: var(--blue);
}

.mini-pill.brand {
  background: #f1eeff;
  color: var(--brand-2);
}

.issue-chip,
.flow-chip {
  padding: 7px 10px;
  background: #f5f4fb;
  color: #5f6384;
  font-size: 0.78rem;
}

.chip-row,
.push-badges,
.loop-flow,
.table-actions,
.profile-actions,
.queue-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.action-link,
.inline-btn {
  color: var(--brand);
  font-weight: 800;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.day-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 0;
  margin: 14px 0;
  overflow: hidden;
}

.day-box {
  padding: 14px 12px;
  text-align: center;
  background: #fff;
}

.day-box.active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
}

.day-name {
  display: block;
  font-size: 0.8rem;
}

.day-date {
  display: block;
  margin-top: 4px;
  font-size: 1.9rem;
  font-weight: 800;
}

.attendance-list {
  display: grid;
  gap: 12px;
}

.attendance-row {
  padding: 16px;
}

.attendance-actions {
  display: flex;
  gap: 8px;
}

.attendance-btn {
  width: 88px;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: #667085;
  text-align: center;
  font-size: 0.78rem;
}

.attendance-btn.active.present {
  background: var(--green);
  color: #fff;
}

.attendance-btn.active.informed {
  background: var(--blue);
  color: #fff;
}

.attendance-note {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 0.9rem;
}

.subnav {
  justify-content: start;
  gap: 10px;
}

.subnav-item {
  border: 0;
  background: transparent;
  padding: 11px 14px;
  border-radius: 14px;
  font-weight: 800;
  color: #667085;
  cursor: pointer;
}

.content-tab {
  display: none;
  margin-top: 14px;
}

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.push-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-top: 12px;
  align-items: start;
}

.push-main h3 {
  margin: 0;
  font-family: "Newsreader", serif;
  font-size: 1.25rem;
}

.push-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.push-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 0.86rem;
}

.push-actions {
  display: flex;
  gap: 10px;
}

.tiny-pill {
  padding: 6px 10px;
  font-size: 0.74rem;
}

.tiny-pill.draft {
  background: #eef2f8;
  color: #657085;
}

.tiny-pill.scheduled {
  background: #edf2ff;
  color: #4669d8;
}

.tiny-pill.type {
  background: #fff3dc;
  color: #926312;
}

.form-intro {
  margin: 10px 0 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid label {
  display: grid;
  gap: 8px;
  color: #596579;
  font-weight: 700;
  font-size: 0.92rem;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.checks {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 18px 0;
  color: #4c576a;
}

.action-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 16px;
  cursor: pointer;
  font-weight: 800;
  background: #fff;
  color: var(--brand);
}

.metric-row {
  margin-top: 14px;
}

.metric-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #4f5867;
  font-weight: 700;
}

.bar {
  height: 8px;
  background: #edf1f7;
  border-radius: 999px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #5e46c9);
}

.toolbar-actions {
  display: flex;
  gap: 10px;
}

.spotlight-grid .card,
.profile-card {
  min-height: 100%;
}

.loop-card {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.loop-card:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.loop-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.flow-chip.soft {
  background: #f3f5fd;
}

.profile-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  background: linear-gradient(180deg, var(--surface-soft) 0%, #fff 100%);
}

.profile-block p {
  margin-top: 8px;
}

.skill-insight-card p {
  margin-top: 8px;
}

.queue-actions,
.attention-meta {
  align-items: center;
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .spotlight-grid,
  .dashboard-grid,
  .analytics-grid,
  .kpi-grid,
  .analytics-kpis,
  .students-summary,
  .analytics-skill-grid,
  .form-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .workspace {
    padding: 14px;
  }

  .topbar,
  .toolbar,
  .subnav,
  .card,
  .attendance-row,
  .mini-summary-card {
    padding: 16px;
  }

  .topbar,
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .select,
  .search-input {
    max-width: 100%;
    width: 100%;
  }

  .day-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .attendance-actions,
  .push-card,
  .student-line,
  .event-line,
  .attention-row,
  .priority-row,
  .queue-item,
  .loop-head,
  .push-title-row {
    flex-direction: column;
    align-items: start;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    border-bottom: 1px solid var(--line);
    padding: 8px 0;
  }

  td {
    padding: 8px 0;
    border-bottom: 0;
  }
}
