:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #edf6f3;
  --ink: #20252b;
  --muted: #65717d;
  --line: #d8dee5;
  --accent: #0f766e;
  --accent-dark: #0d5f59;
  --warning: #a35b00;
  --danger: #b42318;
  --success: #087443;
  --shadow: 0 18px 45px rgba(32, 37, 43, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(237, 246, 243, 0.94), rgba(246, 247, 249, 0) 360px),
    var(--bg);
  color: var(--ink);
}

a {
  color: var(--accent);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(217, 226, 234, 0.88);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  max-width: 1180px;
  min-height: 86px;
  margin: 0 auto;
  padding: 12px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  color: var(--ink);
  text-decoration: none;
}

.brand-logo {
  width: min(300px, 40vw);
  max-height: 58px;
  object-fit: contain;
}

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.main-nav {
  margin-left: auto;
}

.nav a {
  min-height: 38px;
  padding: 9px 11px;
  border-radius: 8px;
  color: #34414f;
  font-size: 0.9rem;
  font-weight: 850;
  text-decoration: none;
}

.nav a.active,
.nav a:hover {
  background: #e7f5f1;
  color: var(--accent-dark);
}

.main-nav .portal-link {
  background: var(--ink);
  color: #fff;
}

.main-nav .portal-link:hover,
.main-nav .portal-link.active {
  background: var(--ink);
  color: #fff;
}

.portal-subheader {
  border-bottom: 1px solid rgba(217, 226, 234, 0.78);
  background: rgba(247, 250, 250, 0.82);
}

.portal-subnav-shell {
  display: flex;
  justify-content: flex-end;
  max-width: 1180px;
  margin: 0 auto;
  padding: 7px 22px;
}

.portal-subnav a {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 0.82rem;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 24px 24px;
}

.hero,
.auth-layout,
.form-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: 28px;
  align-items: start;
}

.hero {
  min-height: 68vh;
  align-items: center;
}

.signup-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 430px);
  gap: 28px;
  align-items: stretch;
  min-height: calc(100vh - 126px);
}

.signup-visual {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 24px;
  overflow: hidden;
  min-height: 620px;
  padding: clamp(24px, 5vw, 46px);
  border: 1px solid #cbdedc;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.1), rgba(180, 83, 9, 0.09)),
    #fbfcfd;
  box-shadow: var(--shadow);
}

.signup-visual::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 8px;
  pointer-events: none;
}

.signup-visual-copy,
.signup-art,
.preview-board,
.signup-highlights {
  position: relative;
  z-index: 1;
}

.signup-visual h1 {
  max-width: 720px;
  font-size: clamp(2.1rem, 4vw, 3.7rem);
}

.signup-art {
  min-height: 260px;
  margin-top: 14px;
}

.art-card,
.art-line {
  position: absolute;
  display: block;
  border-radius: 8px;
}

.art-card-main {
  right: 4%;
  bottom: 6%;
  width: min(420px, 78%);
  aspect-ratio: 1.55;
  border: 1px solid rgba(15, 118, 110, 0.2);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.16), rgba(255, 255, 255, 0.82)),
    #fff;
  box-shadow: 0 22px 55px rgba(32, 37, 43, 0.12);
}

.art-card-top {
  right: 12%;
  bottom: 48%;
  width: 168px;
  height: 72px;
  background: #fff4e5;
  box-shadow: 0 14px 34px rgba(164, 91, 0, 0.12);
}

.art-card-bottom {
  right: 39%;
  bottom: 8%;
  width: 136px;
  height: 88px;
  background: #e7f5f1;
  box-shadow: 0 14px 34px rgba(15, 118, 110, 0.12);
}

.art-line {
  height: 10px;
  background: rgba(15, 118, 110, 0.18);
}

.art-line-one {
  right: 11%;
  bottom: 34%;
  width: 220px;
}

.art-line-two {
  right: 20%;
  bottom: 27%;
  width: 170px;
}

.art-line-three {
  right: 17%;
  bottom: 20%;
  width: 245px;
  background: rgba(180, 83, 9, 0.16);
}

.preview-board {
  width: min(560px, 100%);
  margin-top: 4px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 22px 55px rgba(32, 37, 43, 0.12);
  backdrop-filter: blur(10px);
}

.preview-topline {
  display: flex;
  gap: 7px;
  padding: 15px 16px;
  border-bottom: 1px solid #e2e8ee;
}

.preview-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d85d4a;
}

.preview-dot.amber {
  background: #d6a33b;
}

.preview-dot.green {
  background: #0f766e;
}

.receipt-preview {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 18px;
  padding: 20px;
  border-bottom: 1px solid #e2e8ee;
}

.qr-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 112px;
  height: 112px;
  padding: 10px;
  border-radius: 8px;
  background: #10202a;
}

.qr-preview span {
  min-width: 0;
  border-radius: 3px;
  background: #fff;
  opacity: 0.95;
}

.qr-preview span:nth-child(2),
.qr-preview span:nth-child(5),
.qr-preview span:nth-child(7),
.qr-preview span:nth-child(10),
.qr-preview span:nth-child(12),
.qr-preview span:nth-child(15) {
  opacity: 0.32;
}

.receipt-lines {
  display: grid;
  align-content: center;
  gap: 9px;
}

.receipt-lines strong {
  font-size: 1.05rem;
}

.receipt-lines span {
  color: var(--muted);
  font-size: 0.92rem;
}

.proof-chip {
  justify-self: start;
  min-height: 27px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #ecfdf3;
  color: var(--success) !important;
  font-weight: 850;
}

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

.status-preview > div {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 2px 12px;
}

.status-icon {
  grid-row: span 2;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, #0f766e 0 50%, #f1b849 50%),
    #0f766e;
}

.status-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.mini-amount {
  color: var(--accent-dark);
  font-size: 1.25rem;
  font-weight: 900;
  white-space: nowrap;
}

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

.signup-highlights div {
  min-height: 112px;
  padding: 15px;
  border: 1px solid rgba(15, 118, 110, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.signup-highlights strong {
  display: block;
  margin-bottom: 7px;
  color: #2b343c;
}

.signup-highlights span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.signup-card {
  align-self: center;
  padding: 24px;
  border-color: #cfd8e2;
  box-shadow: 0 20px 52px rgba(32, 37, 43, 0.12);
}

.signup-card-head {
  padding-bottom: 4px;
}

.signup-card-head h2 {
  margin: 10px 0 8px;
  font-size: 1.55rem;
  line-height: 1.15;
}

.signup-card-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.form-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff4e5;
  color: #8a4505;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.centered-note {
  margin: 2px 0 0;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 14px;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.03;
  letter-spacing: 0;
}

h2 {
  font-size: 1.2rem;
}

.lead {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.6;
}

.hero-actions,
.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: #e9edf1;
  color: #27313a;
  cursor: pointer;
  font-weight: 850;
  text-decoration: none;
}

.button.primary {
  background: var(--accent);
  color: #fff;
}

.button:hover {
  transform: translateY(-1px);
}

.panel,
.hero-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  gap: 0;
  overflow: hidden;
}

.workflow-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 4px 14px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.workflow-item:last-child {
  border-bottom: 0;
}

.workflow-item span {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--accent-dark);
  font-weight: 900;
}

.workflow-item strong {
  align-self: end;
}

.workflow-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.form-stack,
.form-grid {
  padding: 20px;
}

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

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

label {
  display: grid;
  gap: 7px;
  color: #3d4650;
  font-size: 0.86rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  outline: none;
  padding: 0 12px;
}

textarea {
  min-height: 110px;
  padding-top: 11px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.field-note,
.form-note {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.notice {
  margin-bottom: 16px;
  padding: 13px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: #2f3a44;
}

.notice p {
  margin: 0 0 6px;
}

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

.notice-success {
  border-color: #b8e3cc;
  background: #ecfdf3;
  color: var(--success);
}

.notice-error {
  border-color: #ffd0cc;
  background: #fff1f0;
  color: var(--danger);
}

.notice-warning {
  border-color: #f7d9a7;
  background: #fff8eb;
  color: var(--warning);
}

.dashboard-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-head h1 {
  font-size: clamp(1.9rem, 3vw, 3rem);
}

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

.metric {
  min-height: 110px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(32, 37, 43, 0.06);
}

.metric span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.metric strong {
  font-size: 2rem;
  line-height: 1.1;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 0;
}

.section-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-auth h1,
.admin-head h1 {
  font-size: clamp(1.9rem, 3vw, 3.2rem);
}

.admin-filter-panel {
  margin-bottom: 18px;
  padding: 16px;
}

.admin-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(150px, 0.7fr) minmax(170px, 0.8fr) auto;
  gap: 12px;
  align-items: end;
}

.admin-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.parent-filters {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  padding: 12px 18px 18px;
}

table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

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

th {
  color: #4d5964;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  color: #2e3741;
  font-size: 0.92rem;
  line-height: 1.35;
}

.amount {
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.table-subtext {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
  word-break: break-word;
}

.admin-table {
  min-width: 1120px;
}

.status,
.link-button {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 850;
  text-decoration: none;
}

.status-pending {
  background: #fff8eb;
  color: var(--warning);
}

.status-good {
  background: #ecfdf3;
  color: var(--success);
}

.status-bad {
  background: #fff1f0;
  color: var(--danger);
}

.link-button {
  background: #e7f5f1;
  color: var(--accent-dark);
}

.attendance-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.7fr);
  gap: 14px;
  margin-bottom: 18px;
  padding: 16px;
}

.attendance-classroom-picker,
.attendance-classroom-form {
  display: grid;
  gap: 12px;
  align-items: end;
}

.attendance-classroom-form {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
}

.attendance-grid-tools {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 0.7fr);
  gap: 14px;
  margin-bottom: 18px;
}

.import-panel {
  margin-bottom: 18px;
}

.import-panel form {
  display: grid;
  gap: 14px;
  padding: 0 18px 18px;
}

.import-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  max-height: 260px;
  overflow: auto;
  padding: 4px;
}

.import-student {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.import-student input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.import-student small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.attendance-table {
  min-width: 1080px;
}

.attendance-table .date-col {
  min-width: 136px;
}

.attendance-select {
  min-width: 118px;
  min-height: 36px;
  padding-inline: 9px;
  font-size: 0.84rem;
}

.attendance-select.status-present {
  border-color: #b8e3cc;
  background: #ecfdf3;
  color: var(--success);
}

.attendance-select.status-absent {
  border-color: #ffd0cc;
  background: #fff1f0;
  color: var(--danger);
}

.attendance-select.status-late {
  border-color: #f7d9a7;
  background: #fff8eb;
  color: var(--warning);
}

.attendance-select.status-excused {
  border-color: #cdd8ea;
  background: #f1f5fb;
  color: #285c8f;
}

.attendance-percent strong {
  color: var(--accent-dark);
}

.attendance-actions {
  padding: 0 18px 18px;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 48px 18px 56px;
  color: var(--muted);
  text-align: center;
}

.empty-state h3 {
  margin-bottom: 0;
  color: var(--ink);
}

.setup-checklist {
  padding: 14px;
  border-radius: 8px;
  background: #f6f7f9;
  color: #3f4a55;
}

.setup-checklist p {
  margin-bottom: 7px;
}

@media (max-width: 860px) {
  .dashboard-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .hero,
  .auth-layout,
  .signup-shell,
  .form-page,
  .form-grid,
  .attendance-toolbar,
  .attendance-classroom-form,
  .attendance-grid-tools,
  .admin-filters,
  .metrics {
    grid-template-columns: 1fr;
  }

  .admin-filter-actions {
    align-items: stretch;
  }

  .admin-filter-actions .button {
    flex: 1;
  }

  .signup-shell {
    min-height: 0;
  }

  .signup-visual {
    min-height: 0;
  }

  .signup-art {
    min-height: 210px;
  }

  .signup-card {
    align-self: stretch;
  }

  h1 {
    font-size: 2.2rem;
  }
}

@media (max-width: 720px) {
  .nav-shell {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-subnav-shell {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .receipt-preview,
  .status-preview,
  .signup-highlights {
    grid-template-columns: 1fr;
  }

  .receipt-preview,
  .status-preview {
    display: grid;
  }

  .signup-visual,
  .signup-card {
    padding: 18px;
  }

  .signup-art {
    min-height: 150px;
  }

  .art-card-main {
    right: 0;
    width: 88%;
  }

  .art-card-top {
    right: 8%;
    width: 126px;
    height: 58px;
  }

  .art-card-bottom {
    right: 48%;
    width: 96px;
    height: 68px;
  }

  .art-line-one,
  .art-line-three {
    width: 150px;
  }

  .art-line-two {
    width: 118px;
  }

  .qr-preview {
    width: 96px;
    height: 96px;
  }
}
