:root {
  --navy: #12304a;
  --teal: #0f9d94;
  --gold: #f2b84b;
  --mist: #f4f7fb;
  --line: #d8e3ec;
  --ink: #1f2937;
  --muted: #6b7280;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(15, 157, 148, 0.15), transparent 20%),
    linear-gradient(180deg, #f8fbff 0%, #eef4f8 100%);
  color: var(--ink);
}

.public-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.shell {
  min-height: 100vh;
}

.brand-block {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.sidebar-logo {
  width: 62px;
  height: 62px;
  object-fit: contain;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  padding: 6px;
}

.brand {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.2;
}

.brand-stack {
  display: grid;
  gap: 3px;
}

.main {
  padding: 28px;
}

.app-footer {
  margin-top: 24px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}

.app-footer a {
  color: var(--navy);
  font-weight: 700;
}

.public-footer {
  margin: 0 32px 32px;
}

.topbar {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 16px 35px rgba(18, 48, 74, 0.08);
  padding: 22px 24px 20px;
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}

.topbar-main {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto;
  gap: 16px;
  align-items: start;
}

.topbar-heading {
  display: grid;
  gap: 10px;
}

.topbar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: nowrap;
}

.topbar-brand {
  margin-bottom: 0;
  align-items: center;
}

.topbar-side {
  display: grid;
  gap: 12px;
  justify-items: end;
  align-content: start;
}

.topbar-nav-row {
  padding-top: 10px;
  border-top: 1px solid rgba(216, 227, 236, 0.95);
}

.topbar-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.student-switcher {
  display: flex;
  justify-content: flex-end;
  flex: 0 1 320px;
  min-width: 260px;
}

.student-switcher-form {
  display: grid;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.student-switcher-form label {
  margin: 0;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}

.topbar-nav a {
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(18, 48, 74, 0.08);
  color: var(--navy);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.25;
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.topbar-nav a.active {
  background: linear-gradient(135deg, var(--navy), #164363);
  color: var(--white);
  box-shadow: 0 12px 24px rgba(18, 48, 74, 0.18);
}

.brand-subtitle {
  margin: 0;
}

.topbar h1,
.auth-card h2,
.panel h3,
.hero-panel h2 {
  margin: 0;
}

.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--teal);
}

.user-chip {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px 16px;
  display: grid;
  gap: 4px;
  min-width: min(100%, 280px);
}

.user-chip span {
  color: var(--muted);
  font-size: 13px;
}

.user-chip strong {
  font-size: 15px;
}

.hero-panel,
.panel,
.metric,
.auth-card,
.auth-hero {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 16px 35px rgba(18, 48, 74, 0.08);
}

.hero-panel {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  margin-bottom: 20px;
  background:
    linear-gradient(135deg, rgba(15, 157, 148, 0.08), rgba(242, 184, 75, 0.12)),
    var(--white);
}

.hero-copy {
  flex: 1;
}

.hero-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(18, 48, 74, 0.08);
  color: var(--navy);
  font-weight: 800;
  font-size: 13px;
}

.hero-side-panel {
  min-width: 220px;
  display: grid;
  gap: 12px;
}

.hero-side-metric {
  border-radius: 22px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(18, 48, 74, 0.94), rgba(22, 67, 99, 0.96));
  color: var(--white);
}

.hero-side-metric span {
  color: rgba(255, 255, 255, 0.72);
  display: block;
  margin-bottom: 8px;
}

.hero-side-metric strong {
  font-size: 24px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.metric {
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.metric span {
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
}

.metric strong {
  font-size: 28px;
  color: var(--navy);
}

.metric p {
  color: var(--muted);
  line-height: 1.5;
  margin: 10px 0 0;
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 5px;
  border-radius: 24px 24px 0 0;
}

.metric-1::before {
  background: var(--teal);
}

.metric-2::before {
  background: var(--gold);
}

.metric-3::before {
  background: #ff8c78;
}

.metric-4::before {
  background: var(--navy);
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

.panel {
  padding: 24px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.panel > * {
  margin-top: 0;
  margin-bottom: 0;
}

.panel p {
  line-height: 1.6;
}

.roles-section {
  margin-top: 18px;
}

.student-hero-card,
.student-list-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.student-list-row {
  padding: 12px 0;
  border-bottom: 1px solid #edf2f7;
}

.student-list-row:last-child {
  border-bottom: 0;
}

.student-avatar {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 20px;
  background: #eef4f9;
  border: 1px solid var(--line);
}

.student-avatar.small {
  width: 54px;
  height: 54px;
  border-radius: 16px;
}

.student-roster-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.student-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  background: #fbfdff;
  display: grid;
  gap: 8px;
  justify-items: start;
  align-content: start;
}

.student-card.compact {
  justify-items: center;
  text-align: center;
}

.student-card span {
  color: var(--muted);
  font-size: 14px;
}

.two-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.compact-form {
  margin-top: 12px;
}

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

.gallery-photo-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 14px;
  background: #fbfdff;
  display: grid;
  gap: 10px;
  align-content: start;
}

.gallery-photo-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 0;
}

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid #edf2f7;
}

.list-row.compact {
  padding: 10px 0;
}

.list-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.list-row span,
.message-card span,
.helper {
  color: var(--muted);
}

.alert.success {
  padding: 12px 14px;
  border-radius: 14px;
  background: #edf9f2;
  border: 1px solid #bfe5cb;
  color: #21724a;
}

.fee-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid #edf2f7;
}

.fee-setting-row:last-child {
  border-bottom: 0;
}

.fee-setting-copy {
  display: grid;
  gap: 4px;
}

.fee-setting-copy span {
  color: var(--muted);
  font-size: 14px;
}

.fee-setting-fields {
  display: grid;
  grid-template-columns: 140px 100px;
  gap: 10px;
}

.fee-due-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 10px 0 14px;
}

.fee-due-date {
  margin-top: 6px;
  font-weight: 800;
  color: var(--navy);
}

.due-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
}

.due-chip-clear {
  background: #edf9f2;
  color: #21724a;
}

.due-chip-overdue {
  background: #fff0ef;
  color: #c24136;
}

.fine-text-clear {
  color: #21724a;
  font-weight: 700;
}

.fine-text-overdue {
  color: #c24136;
  font-weight: 700;
}

.settings-form {
  align-items: start;
}

.settings-submit {
  grid-column: 1 / -1;
}

.account-grid {
  display: grid;
  gap: 14px;
}

.account-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  background: #fbfdff;
  display: grid;
  gap: 12px;
  align-content: start;
}

.account-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.account-card-top span {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

.account-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.account-reset-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.secondary-button {
  background: #eef4f9;
  color: var(--navy);
}

.narrow-panel {
  max-width: 560px;
}

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ebf8f6;
  color: var(--teal);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
}

.message-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #fbfdff;
  display: grid;
  gap: 8px;
}

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

.message-card + .message-card,
.leave-request-card + .leave-request-card {
  margin-top: 14px;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  padding: 32px;
  gap: 24px;
}

.auth-hero,
.auth-card {
  padding: 34px;
}

.auth-logo {
  width: 86px;
  height: 86px;
  object-fit: contain;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  padding: 8px;
  margin-bottom: 0;
}

.auth-hero {
  display: grid;
  gap: 10px;
  align-content: start;
  background:
    radial-gradient(circle at top left, rgba(242, 184, 75, 0.25), transparent 30%),
    linear-gradient(180deg, #12304a 0%, #164363 100%);
  color: var(--white);
}

.auth-hero > * {
  margin: 0;
}

.auth-hero h1 {
  font-size: 32px;
  line-height: 1.15;
}

.auth-hero p:not(.eyebrow) {
  font-size: 15px;
}

.auth-hero .eyebrow {
  color: #9bded8;
}

.auth-card {
  display: grid;
  gap: 10px;
  align-content: center;
}

label {
  font-weight: 700;
  margin-top: 8px;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  background: #fcfdff;
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  background: #fcfdff;
  font: inherit;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  background: var(--teal);
  color: var(--white);
  font-weight: 800;
  cursor: pointer;
}

.pay-button {
  margin-top: 16px;
}

.amount {
  font-size: 36px;
  font-weight: 800;
  color: var(--navy);
  margin: 12px 0;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.demo-grid div {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  display: grid;
  gap: 6px;
}

.inline-form {
  display: grid;
  gap: 14px;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-form input {
  min-width: 260px;
}

.search-meta {
  color: var(--muted);
  font-size: 14px;
}

.leave-request-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: #fbfdff;
  display: grid;
  gap: 10px;
}

.leave-request-top,
.leave-request-student {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.leave-request-student {
  justify-content: flex-start;
}

.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.album-cover {
  height: 140px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(15, 157, 148, 0.2), rgba(18, 48, 74, 0.25)),
    linear-gradient(45deg, rgba(242, 184, 75, 0.3), transparent);
  margin-bottom: 14px;
}

.alert.error {
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff2f1;
  border: 1px solid #f3c2bc;
  color: #b24739;
}

@media (max-width: 1024px) {
  .shell,
  .auth-page,
  .grid.two,
  .grid.three,
  .metrics,
  .demo-grid,
  .student-roster-grid,
  .gallery-photo-grid {
    grid-template-columns: 1fr;
  }

  .two-field-row {
    grid-template-columns: 1fr;
  }

  .brand-block {
    align-items: center;
  }

  .topbar {
    padding: 20px;
  }

  .topbar-main,
  .topbar,
  .topbar-heading,
  .topbar-side {
    gap: 18px;
  }

  .topbar-main {
    grid-template-columns: 1fr;
  }

  .topbar-brand-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .student-switcher {
    justify-content: stretch;
    width: 100%;
    min-width: 0;
  }

  .student-switcher-form {
    min-width: 100%;
  }

  .topbar-side {
    justify-items: stretch;
  }

  .main {
    padding: 20px;
  }

  .app-footer,
  .hero-panel,
  .list-row,
  .fee-setting-row,
  .leave-request-top {
    flex-direction: column;
  }

  .fee-due-row {
    align-items: flex-start;
  }

  .user-chip,
  .hero-side-panel {
    width: 100%;
  }

  .search-form,
  .panel-toolbar {
    width: 100%;
  }

  .search-form input {
    min-width: 100%;
  }
}

@media (max-width: 640px) {
  .main,
  .auth-page {
    padding: 16px;
  }

  .public-footer {
    margin: 0 16px 16px;
  }

  .topbar {
    padding: 18px;
  }

  .sidebar-logo,
  .auth-logo {
    width: 72px;
    height: 72px;
  }

  .topbar-nav a {
    width: 100%;
    text-align: center;
  }

  .fee-setting-fields {
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .panel,
  .hero-panel,
  .auth-card,
  .auth-hero,
  .metric {
    border-radius: 18px;
  }

  .panel,
  .hero-panel,
  .auth-card,
  .auth-hero {
    padding: 18px;
  }

  .topbar h1,
  .hero-panel h2,
  .auth-card h2 {
    font-size: 26px;
  }

  .brand {
    font-size: 19px;
  }

  .topbar-nav a {
    font-size: 13px;
  }

  .auth-hero h1 {
    font-size: 28px;
  }

  .metric strong,
  .amount {
    font-size: 26px;
  }

  .list-row {
    gap: 10px;
  }

  .badge {
    align-self: flex-start;
  }

  .account-card-top,
  .account-reset-form {
    grid-template-columns: 1fr;
    display: grid;
  }

  button {
    width: 100%;
  }
}
