/* ============================================================
   Design tokens — escola de desenho (roxo + amarelo)
   ============================================================ */
:root {
  --purple-900: #1A0A2E;
  --purple-800: #2B1248;
  --purple-700: #3D1070;
  --purple-600: #5C1E8C;
  --purple-500: #6B2D9E;
  --purple-400: #8B4FBE;
  --purple-100: #F3EEFF;
  --purple-50: #FAF7FF;

  --yellow-600: #EFBE00;
  --yellow-500: #F5C400;
  --yellow-400: #FFD52B;
  --yellow-100: #FFF4BF;

  --green-500: #2FB57B;
  --red-500: #E45A6B;
  --gray-500: #8A86A0;

  --white: #FFFFFF;
  --paper: #FAF7FF;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 32px;
  --r-pill: 999px;

  --shadow-sm: 0 2px 0 rgba(26, 10, 46, 0.08);
  --shadow-md: 0 6px 0 rgba(26, 10, 46, 0.12), 0 12px 24px -8px rgba(26, 10, 46, 0.18);
  --shadow-lg: 0 10px 0 rgba(26, 10, 46, 0.15), 0 24px 40px -10px rgba(26, 10, 46, 0.25);

  --font-display: "Fredoka", "Nunito", system-ui, sans-serif;
  --font-script: "Caveat", "Pacifico", cursive;
  --font-body: "Nunito", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--purple-900);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

/* dotted texture used across surfaces */
.dot-pattern {
  background-image: radial-gradient(rgba(245, 196, 0, 0.25) 1.4px, transparent 1.6px);
  background-size: 18px 18px;
}

.dot-pattern--dark {
  background-image: radial-gradient(rgba(255, 255, 255, 0.10) 1.4px, transparent 1.6px);
  background-size: 18px 18px;
}

.dot-pattern--purple {
  background-image: radial-gradient(rgba(92, 30, 140, 0.18) 1.4px, transparent 1.6px);
  background-size: 16px 16px;
}

/* ============================================================
   Layout shell
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  height: 100%;
  background: var(--paper);
}

.sidebar {
  background: var(--purple-900);
  color: white;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: relative;
  overflow: hidden;
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(245, 196, 0, 0.08) 1.4px, transparent 1.6px);
  background-size: 22px 22px;
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.brand__mark {
  width: 44px;
  height: 44px;
  background: var(--yellow-500);
  border-radius: 14px;
  display: grid;
  place-items: center;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.08);
  transform: rotate(-6deg);
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.2px;
  line-height: 1;
}

.brand__tag {
  font-family: var(--font-script);
  font-weight: 500;
  font-size: 16px;
  color: var(--yellow-400);
  margin-top: 2px;
  line-height: 1;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  z-index: 1;
}

.nav__section {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.45);
  padding: 12px 12px 6px;
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  transition: background .15s, color .15s, transform .12s;
  border: none;
  background: transparent;
  text-align: left;
  width: 100%;
  font-family: inherit;
  white-space: nowrap;
}

.nav__item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: white;
}

.nav__item--active {
  background: var(--yellow-500);
  color: var(--purple-700);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
}

.nav__item--active:hover {
  background: var(--yellow-400);
  color: var(--purple-700);
}

.nav__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.sidebar__footer {
  margin-top: auto;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--r-md);
}

.sidebar__footer .avatar {
  width: 36px;
  height: 36px;
}

.sidebar__footer>div:not(.avatar):not(.sidebar__logout) {
  min-width: 0;
  flex: 1;
}

.sidebar__footer-name {
  font-size: 14px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__footer-role {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
}

.sidebar__logout {
  margin-left: auto;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
}

.sidebar__logout:hover {
  color: var(--yellow-400);
  background: rgba(255, 255, 255, 0.06);
}

.main {
  display: flex;
  flex-direction: column;
  overflow: auto;
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 32px;
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 2px dashed rgba(92, 30, 140, 0.12);
}

.topbar__head {
  display: flex;
  flex-direction: column;
  line-height: 1;
  flex-shrink: 0;
}

.topbar__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: 0.2px;
  color: var(--purple-700);
  white-space: nowrap;
  line-height: 1;
}

.topbar__subtitle {
  font-family: var(--font-script);
  color: var(--purple-500);
  font-size: 20px;
  transform: rotate(-1.5deg);
  display: inline-block;
  align-self: flex-start;
  margin-top: 4px;
  white-space: nowrap;
}

.topbar__spacer {
  flex: 1;
}

.topbar__date {
  background: var(--purple-100);
  color: var(--purple-700);
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
}

.content {
  padding: 28px 32px 48px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ============================================================
   Avatar (initials over color)
   ============================================================ */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--purple-900);
  background: var(--yellow-500);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  font-size: 15px;
  user-select: none;
}

.avatar--lg {
  width: 64px;
  height: 64px;
  font-size: 22px;
}

.avatar--xl {
  width: 96px;
  height: 96px;
  font-size: 32px;
}

.avatar--purple {
  background: var(--purple-500);
  color: white;
}

.avatar--mint {
  background: #B7E7C6;
  color: var(--purple-900);
}

.avatar--pink {
  background: #F5C2D1;
  color: var(--purple-900);
}

.avatar--sky {
  background: #BFD8FF;
  color: var(--purple-900);
}

.avatar--orange {
  background: #FFC79A;
  color: var(--purple-900);
}

/* ============================================================
   Card primitives
   ============================================================ */
.card {
  background: white;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  border: 2px solid rgba(92, 30, 140, 0.08);
}

.card__pad {
  padding: 22px;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 0;
}

.card__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--purple-700);
}

.card__sub {
  font-size: 13px;
  color: var(--gray-500);
  font-weight: 600;
  margin-top: 2px;
}

/* Stat card */
.stat {
  position: relative;
  padding: 22px;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  color: var(--purple-900);
}

.stat--purple {
  background: var(--purple-600);
  color: white;
}

.stat--yellow {
  background: var(--yellow-500);
}

.stat--white {
  background: white;
  border: 2px solid rgba(92, 30, 140, 0.08);
}

.stat--dark {
  background: var(--purple-900);
  color: white;
}

.stat__label {
  text-transform: uppercase;
  letter-spacing: 1.6px;
  font-size: 11px;
  opacity: 0.75;
  font-weight: 700;
}

.stat__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 44px;
  line-height: 1;
  margin-top: 10px;
  letter-spacing: -0.5px;
}

.stat__unit {
  font-size: 22px;
  opacity: .7;
  margin-left: 2px;
}

.stat__delta {
  margin-top: 12px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 10px;
  border-radius: var(--r-pill);
}

.stat--white .stat__delta {
  background: var(--purple-100);
  color: var(--purple-700);
}

.stat--yellow .stat__delta {
  background: rgba(92, 30, 140, 0.12);
  color: var(--purple-700);
}

.stat__blob {
  position: absolute;
  right: -30px;
  bottom: -36px;
  width: 130px;
  height: 130px;
  border-radius: 50% 50% 42% 58% / 60% 50% 50% 40%;
  opacity: 0.15;
  background: white;
}

.stat--yellow .stat__blob {
  background: var(--purple-700);
  opacity: 0.10;
}

.stat--white .stat__blob {
  background: var(--yellow-500);
  opacity: 0.35;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.2px;
  border: none;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .15s;
  white-space: nowrap;
}

.btn:active {
  transform: translateY(2px);
}

.btn--primary {
  background: var(--yellow-500);
  color: var(--purple-700);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
}

.btn--primary:hover {
  background: var(--yellow-400);
}

.btn--secondary {
  background: var(--purple-600);
  color: white;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.22);
}

.btn--secondary:hover {
  background: var(--purple-500);
}

.btn--ghost {
  background: transparent;
  color: var(--purple-700);
  box-shadow: inset 0 0 0 2px rgba(92, 30, 140, 0.2);
}

.btn--ghost:hover {
  background: var(--purple-100);
}

.btn--sm {
  padding: 7px 13px;
  font-size: 13px;
}

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-body);
  letter-spacing: 0.2px;
}

.badge--paid {
  background: #D8F3E4;
  color: #1B7A4B;
}

.badge--pending {
  background: var(--yellow-100);
  color: #8C6A00;
}

.badge--late {
  background: #FAD8DD;
  color: #A8253A;
}

.badge--present {
  background: #D8F3E4;
  color: #1B7A4B;
}

.badge--absent {
  background: #FAD8DD;
  color: #A8253A;
}

.badge--justified {
  background: var(--purple-100);
  color: var(--purple-700);
}

.badge--purple {
  background: var(--purple-600);
  color: white;
}

.badge--yellow {
  background: var(--yellow-500);
  color: var(--purple-700);
}

/* dot indicator */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* ============================================================
   Wavy divider
   ============================================================ */
.wavy {
  height: 16px;
  background: var(--yellow-500);
  -webkit-mask: radial-gradient(circle 8px at 8px 0, transparent 99%, black 100%) 0 0/16px 16px;
  mask: radial-gradient(circle 8px at 8px 0, transparent 99%, black 100%) 0 0/16px 16px;
}

/* ============================================================
   Login screen
   ============================================================ */
.login {
  min-height: 100%;
  background: var(--purple-900);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  position: relative;
  overflow: hidden;
}

.login__art {
  position: relative;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: white;
  overflow: hidden;
}

.login__art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(245, 196, 0, 0.12) 1.6px, transparent 1.8px);
  background-size: 22px 22px;
}

.login__brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
}

.login__brand-mark {
  width: 56px;
  height: 56px;
  background: var(--yellow-500);
  border-radius: 18px;
  display: grid;
  place-items: center;
  transform: rotate(-6deg);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.08);
}

.login__brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  line-height: 1;
}

.login__brand-tag {
  font-family: var(--font-script);
  color: var(--yellow-400);
  font-size: 20px;
  margin-top: 4px;
}

.login__quote {
  position: relative;
  z-index: 2;
  max-width: 480px;
}

.login__quote h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 56px;
  line-height: 1.02;
  letter-spacing: -1px;
  margin: 0 0 14px;
}

.login__quote h1 em {
  font-style: normal;
  color: var(--yellow-400);
  position: relative;
  display: inline-block;
}

.login__quote h1 em::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: 6px;
  height: 12px;
  background: var(--purple-700);
  z-index: -1;
  border-radius: 4px;
}

.login__quote p {
  font-family: var(--font-script);
  font-size: 28px;
  color: var(--yellow-400);
  margin: 0;
  transform: rotate(-2deg);
  display: inline-block;
}

.login__meta {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 22px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
}

.login__meta strong {
  color: white;
  font-family: var(--font-display);
  display: block;
  font-size: 22px;
}

/* decorative shapes on login */
.login__blob {
  position: absolute;
  border-radius: 50% 50% 42% 58% / 60% 50% 50% 40%;
  filter: blur(0);
}

.login__blob--1 {
  width: 220px;
  height: 220px;
  background: var(--purple-600);
  top: -60px;
  right: -40px;
  opacity: 0.6;
}

.login__blob--2 {
  width: 140px;
  height: 140px;
  background: var(--yellow-500);
  bottom: 80px;
  right: 60px;
  opacity: 0.85;
  transform: rotate(20deg);
  border-radius: 60% 40% 50% 50% / 40% 60% 40% 60%;
}

.login__star {
  position: absolute;
  color: var(--yellow-500);
  pointer-events: none;
}

.login__form {
  background: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px;
  position: relative;
  overflow: hidden;
}

.login__form::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(92, 30, 140, 0.10) 1.4px, transparent 1.6px);
  background-size: 18px 18px;
  opacity: .35;
}

.login__form-inner {
  position: relative;
  z-index: 1;
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
}

.login__form h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 34px;
  color: var(--purple-700);
  margin: 0 0 4px;
}

.login__form .hello {
  font-family: var(--font-script);
  font-size: 26px;
  color: var(--purple-500);
  margin: 0 0 28px;
  display: inline-block;
  transform: rotate(-2deg);
}

.teachers {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.teacher {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: white;
  border-radius: var(--r-md);
  border: 2px solid rgba(92, 30, 140, 0.10);
  cursor: pointer;
  transition: border-color .15s, transform .12s, box-shadow .12s;
}

.teacher:hover {
  border-color: var(--purple-400);
}

.teacher--active {
  border-color: var(--purple-600);
  box-shadow: 0 4px 0 rgba(92, 30, 140, 0.18);
}

.teacher {
  min-width: 0;
}

.teacher>div:not(.avatar):not(.teacher__check) {
  min-width: 0;
  flex: 1;
}

.teacher__name {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--purple-700);
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teacher__role {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 700;
  letter-spacing: 0.3px;
}

.teacher__check {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(92, 30, 140, 0.18);
  display: grid;
  place-items: center;
  color: white;
  background: transparent;
}

.teacher--active .teacher__check {
  background: var(--yellow-500);
  border-color: var(--yellow-500);
  color: var(--purple-700);
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  color: var(--purple-500);
  margin-bottom: 6px;
  font-weight: 800;
}

.field input {
  width: 100%;
  padding: 13px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--r-md);
  border: 2px solid rgba(92, 30, 140, 0.18);
  background: white;
  color: var(--purple-900);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.field input:focus {
  border-color: var(--purple-600);
  box-shadow: 0 0 0 4px rgba(92, 30, 140, 0.12);
}

.login__submit {
  width: 100%;
  padding: 14px 18px;
  font-size: 16px;
  margin-top: 6px;
}

.login__hint {
  text-align: center;
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 14px;
}

/* ============================================================
   Attendance screen
   ============================================================ */
.att-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 22px;
}

.calendar {
  background: white;
  border-radius: var(--r-lg);
  border: 2px solid rgba(92, 30, 140, 0.08);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

.cal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal__title {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--purple-700);
  font-size: 18px;
}

.cal__nav {
  background: var(--purple-100);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--purple-700);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.cal__nav:hover {
  background: var(--purple-600);
  color: white;
}

.cal__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  color: var(--gray-500);
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 0;
}

.cal__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal__day {
  aspect-ratio: 1;
  border-radius: 12px;
  border: none;
  background: transparent;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--purple-900);
  cursor: pointer;
  position: relative;
  transition: background .15s, color .15s, transform .12s;
  display: grid;
  place-items: center;
  padding: 0;
}

.cal__day:hover {
  background: var(--purple-100);
}

.cal__day--muted {
  color: rgba(92, 30, 140, 0.25);
}

.cal__day--has::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 5px;
  height: 5px;
  background: var(--yellow-500);
  border-radius: 50%;
  transform: translateX(-50%);
}

.cal__day--today {
  background: var(--purple-100);
  color: var(--purple-700);
}

.cal__day--selected {
  background: var(--yellow-500);
  color: var(--purple-700);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12);
}

.cal__day--selected::after {
  background: var(--purple-700);
}

.classes-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.class-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--purple-50);
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 14px;
  color: var(--purple-700);
  font-weight: 700;
  font-family: var(--font-body);
}

.class-pill:hover {
  border-color: rgba(92, 30, 140, 0.18);
}

.class-pill--active {
  background: var(--purple-900);
  color: white;
  border-color: var(--purple-900);
}

.class-pill__time {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.7;
}

/* Student attendance list */
.day-header {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.day-header__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 28px;
  color: var(--purple-700);
  line-height: 1;
  display: block;
}

.day-header__cursive {
  font-family: var(--font-script);
  font-size: 22px;
  color: var(--purple-500);
  transform: rotate(-2deg);
  display: inline-block;
  margin-top: 6px;
}

.day-header__pills {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--r-lg);
  background: white;
  border: 2px solid rgba(92, 30, 140, 0.08);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  background: var(--purple-50);
  padding: 9px 14px;
  border-radius: var(--r-pill);
  color: var(--purple-500);
}

.search input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--purple-900);
  font-size: 14px;
}

.toolbar__count {
  background: var(--purple-100);
  color: var(--purple-700);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: 13px;
}

.students {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.student-card {
  position: relative;
  background: white;
  border-radius: var(--r-lg);
  border: 2px solid rgba(92, 30, 140, 0.08);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}

.student-card--present {
  border-color: #2FB57B;
  box-shadow: 0 4px 0 #1B7A4B33;
}

.student-card--absent {
  border-color: #E45A6B;
  box-shadow: 0 4px 0 #A8253A33;
}

.student-card--justified {
  border-color: var(--purple-500);
  box-shadow: 0 4px 0 rgba(92, 30, 140, 0.2);
}

.student-card__top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.student-card__info {
  line-height: 1.1;
  min-width: 0;
}

.student-card__name {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--purple-700);
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-card__meta {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 700;
  margin-top: 3px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.student-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.att-btn {
  border: 2px solid rgba(92, 30, 140, 0.10);
  background: white;
  padding: 10px 6px;
  border-radius: var(--r-md);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.3px;
  cursor: pointer;
  color: var(--purple-700);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .15s, color .15s, border-color .15s;
}

.att-btn:hover {
  background: var(--purple-50);
}

.att-btn[data-active="present"] {
  background: #2FB57B;
  color: white;
  border-color: #2FB57B;
}

.att-btn[data-active="absent"] {
  background: #E45A6B;
  color: white;
  border-color: #E45A6B;
}

.att-btn[data-active="justified"] {
  background: var(--purple-600);
  color: white;
  border-color: var(--purple-600);
}

.notes-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--purple-50);
  padding: 8px 12px;
  border-radius: var(--r-md);
  font-size: 12px;
  color: var(--purple-700);
  font-weight: 700;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.summary-pill {
  padding: 14px 16px;
  border-radius: var(--r-lg);
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border: 2px solid rgba(92, 30, 140, 0.08);
}

.summary-pill__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gray-500);
  font-weight: 700;
}

.summary-pill__value {
  font-size: 26px;
  font-weight: 700;
  color: var(--purple-700);
}

.summary-pill--green {
  background: #2FB57B;
  color: white;
  border-color: #2FB57B;
}

.summary-pill--green .summary-pill__label,
.summary-pill--green .summary-pill__value {
  color: white;
}

.summary-pill--red {
  background: #E45A6B;
  color: white;
  border-color: #E45A6B;
}

.summary-pill--red .summary-pill__label,
.summary-pill--red .summary-pill__value {
  color: white;
}

.summary-pill--purple {
  background: var(--purple-600);
  color: white;
  border-color: var(--purple-600);
}

.summary-pill--purple .summary-pill__label,
.summary-pill--purple .summary-pill__value {
  color: white;
}

.summary-pill--yellow {
  background: var(--yellow-500);
  border-color: var(--yellow-500);
}

.summary-pill--yellow .summary-pill__label {
  color: var(--purple-700);
}

/* ============================================================
   Dashboard
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.bars {
  display: flex;
  align-items: stretch;
  gap: 18px;
  height: 200px;
  padding: 8px 8px 0;
}

.bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 700;
}

.bar__stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  flex: 1;
  position: relative;
}

.bar__inner {
  width: 100%;
  background: var(--yellow-500);
  border-radius: 10px 10px 4px 4px;
  position: relative;
  transition: height .3s;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.06);
}

.bar__inner span {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--purple-700);
  font-weight: 700;
}

.bar--dim .bar__inner {
  background: var(--purple-100);
}

.bar--dim .bar__inner span {
  color: var(--purple-500);
}

.legend {
  display: flex;
  gap: 14px;
  padding: 0 22px 18px;
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 700;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.row-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 22px;
}

.row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 22px;
}

.list {
  display: flex;
  flex-direction: column;
}

.list__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border-top: 1px dashed rgba(92, 30, 140, 0.10);
}

.list__row:first-of-type {
  border-top: 0;
}

.list__row-name {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--purple-700);
}

.list__row-meta {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 700;
}

.list__row-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.list__row-value {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--purple-700);
}

/* Donut */
.donut {
  --p: 78;
  --size: 160px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: conic-gradient(var(--yellow-500) calc(var(--p) * 1%), var(--purple-100) 0);
  display: grid;
  place-items: center;
  position: relative;
  margin: 0 auto;
}

.donut::before {
  content: "";
  width: 70%;
  height: 70%;
  background: white;
  border-radius: 50%;
  position: absolute;
}

.donut__label {
  position: relative;
  font-family: var(--font-display);
  text-align: center;
  color: var(--purple-700);
}

.donut__big {
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}

.donut__small {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  color: var(--gray-500);
}

.chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 22px 18px;
}

.chip {
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--purple-50);
  color: var(--purple-700);
  font-size: 12px;
  font-weight: 700;
}

/* ============================================================
   Payments
   ============================================================ */
.pay-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 22px;
}

.table {
  background: white;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 2px solid rgba(92, 30, 140, 0.08);
}

.table__head {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1.1fr 0.6fr;
  padding: 14px 18px;
  background: var(--purple-900);
  color: white;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  font-weight: 600;
}

.table__row {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1.1fr 0.6fr;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px dashed rgba(92, 30, 140, 0.10);
  font-size: 14px;
}

.table__row:last-child {
  border-bottom: none;
}

.table__row:hover {
  background: var(--purple-50);
}

.table__name {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--purple-700);
  font-family: var(--font-display);
  font-weight: 600;
}

.table__small {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 700;
}

.table__value {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--purple-700);
}

.table__action {
  display: grid;
  place-items: center;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--purple-100);
  border: none;
  color: var(--purple-700);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.icon-btn:hover {
  background: var(--purple-600);
  color: white;
}

.icon-btn--paid {
  background: var(--green-500);
  color: white;
}

.tabs {
  display: flex;
  gap: 6px;
  background: var(--purple-50);
  padding: 6px;
  border-radius: var(--r-pill);
}

.tabs__tab {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--purple-500);
  cursor: pointer;
  font-size: 13px;
}

.tabs__tab--active {
  background: var(--purple-900);
  color: white;
}

.receipt-card {
  background: var(--purple-900);
  color: white;
  border-radius: var(--r-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.receipt-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(245, 196, 0, 0.10) 1.4px, transparent 1.6px);
  background-size: 18px 18px;
}

.receipt-card>* {
  position: relative;
}

.receipt-card h4 {
  font-family: var(--font-script);
  color: var(--yellow-400);
  font-weight: 500;
  font-size: 22px;
  margin: 0;
  transform: rotate(-2deg);
  display: inline-block;
}

.receipt-card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  margin: 2px 0 18px;
}

.receipt-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.receipt-card li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
}

.receipt-card li strong {
  color: white;
  font-family: var(--font-display);
  font-weight: 700;
}

.receipt-card hr {
  border: none;
  border-top: 2px dashed rgba(255, 255, 255, 0.18);
  margin: 14px 0;
}

.receipt-card .total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-display);
}

.receipt-card .total span {
  color: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.receipt-card .total strong {
  font-size: 32px;
  color: var(--yellow-400);
}

/* mini donut */
.mini-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: white;
  border: 2px solid rgba(92, 30, 140, 0.08);
  border-radius: var(--r-lg);
}

.mini-stat__donut {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: conic-gradient(var(--green-500) calc(var(--p) * 1%), rgba(92, 30, 140, 0.10) 0);
  display: grid;
  place-items: center;
  position: relative;
}

.mini-stat__donut::before {
  content: "";
  width: 70%;
  height: 70%;
  background: white;
  border-radius: 50%;
  position: absolute;
}

.mini-stat__donut span {
  position: relative;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--purple-700);
  font-size: 14px;
}

.mini-stat__label {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.mini-stat__value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--purple-700);
}

/* responsive-ish */
@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .row-2,
  .pay-grid {
    grid-template-columns: 1fr;
  }

  .att-grid {
    grid-template-columns: 1fr;
  }
}