:root {
  --imyj-green: #003d0b;
  --imyj-green-2: #07561a;
  --imyj-green-3: #0f6a26;
  --imyj-gold: #ffcc12;
  --imyj-gold-2: #f2b705;
  --imyj-ink: #122016;
  --imyj-muted: #66736b;
  --imyj-line: #dbe3dc;
  --imyj-bg: #f4f7f1;
  --imyj-white: #ffffff;
  --danger: #b42318;
  --shadow: 0 14px 36px rgba(13, 38, 18, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--imyj-ink);
  background:
    linear-gradient(180deg, rgba(255, 204, 18, 0.08), transparent 280px),
    var(--imyj-bg);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

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

.app-shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  height: 100vh;
  padding: 22px 18px;
  color: var(--imyj-white);
  background:
    linear-gradient(180deg, rgba(255, 204, 18, 0.14), transparent 220px),
    var(--imyj-green);
}

.brand-block {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 48px;
  height: 48px;
  object-fit: contain;
  background: var(--imyj-white);
  border-radius: 8px;
  padding: 4px;
}

.brand-block strong,
.school-title strong,
.topbar-copy strong {
  display: block;
  line-height: 1.1;
}

.brand-block span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.88rem;
}

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

.admin-side-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 204, 18, 0.24);
  border-radius: 8px;
}

.admin-side-panel > span,
.admin-side-stats span,
.admin-side-stats small,
.admin-side-stats em {
  color: rgba(255, 255, 255, 0.72);
}

.admin-side-panel > strong {
  color: var(--imyj-gold);
}

.admin-side-stats {
  display: grid;
  gap: 8px;
}

.admin-side-stats div,
.admin-side-stats button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 0;
  color: var(--imyj-white);
  text-align: left;
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.admin-side-stats button:hover,
.admin-side-stats button:focus-visible {
  color: var(--imyj-gold);
  outline: 0;
}

.nav-action {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.82);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
}

.nav-action:hover,
.nav-action:focus-visible,
.nav-action.active {
  color: var(--imyj-white);
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 204, 18, 0.34);
  outline: 0;
}

.nav-action svg,
.btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.main-panel {
  min-width: 0;
  padding: 24px clamp(18px, 3vw, 42px) 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.school-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.top-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.school-title span,
.topbar-copy span {
  display: block;
  color: var(--imyj-muted);
  font-size: 0.88rem;
}

.topbar-copy {
  text-align: right;
}

.topbar-copy strong {
  color: var(--imyj-green-2);
}

.app-view {
  display: none;
}

.app-view.active {
  display: block;
}

.stepper {
  display: grid;
  grid-template-columns: minmax(150px, auto) 1fr minmax(170px, auto) 1fr minmax(120px, auto);
  align-items: center;
  max-width: 920px;
  margin: 0 auto 18px;
}

.stepper-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--imyj-muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.stepper-item span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--imyj-muted);
  font-weight: 700;
  background: #d8dfd8;
  border-radius: 50%;
}

.stepper-item.active,
.stepper-item.done {
  color: var(--imyj-green);
}

.stepper-item.active span,
.stepper-item.done span {
  color: var(--imyj-green);
  background: var(--imyj-gold);
}

.stepper-line {
  height: 2px;
  margin: 0 16px;
  background: var(--imyj-line);
}

.form-card,
.success-panel {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 30px);
  background: var(--imyj-white);
  border: 1px solid rgba(0, 61, 11, 0.08);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--imyj-line);
}

.section-heading span {
  color: var(--imyj-green);
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
}

.section-heading small {
  color: var(--imyj-muted);
}

.form-step {
  display: none;
}

.form-step.active {
  display: block;
}

.form-label {
  color: #263b2c;
  font-size: 0.9rem;
  font-weight: 700;
}

.form-control,
.form-select {
  min-height: 42px;
  color: var(--imyj-ink);
  border-color: #cfd8d0;
  border-radius: 6px;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--imyj-green-3);
  box-shadow: 0 0 0 0.22rem rgba(15, 106, 38, 0.16);
}

.form-text {
  color: var(--imyj-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 6px;
  font-weight: 700;
}

.btn-primary {
  color: var(--imyj-white);
  background: var(--imyj-green-2);
  border-color: var(--imyj-green-2);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  color: var(--imyj-green);
  background: var(--imyj-gold);
  border-color: var(--imyj-gold);
}

.btn-outline-secondary {
  color: var(--imyj-green);
  border-color: #b8c6ba;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus-visible {
  color: var(--imyj-white);
  background: var(--imyj-green);
  border-color: var(--imyj-green);
}

.btn-outline-danger {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.36);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus-visible {
  color: var(--imyj-white);
  background: var(--danger);
  border-color: var(--danger);
}

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

.choice-tile,
.payment-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 12px;
  border: 1px solid #cfd8d0;
  border-radius: 8px;
  cursor: pointer;
}

.choice-tile input,
.payment-card input {
  accent-color: var(--imyj-green);
}

.choice-tile:has(input:checked),
.payment-card:has(input:checked) {
  background: rgba(255, 204, 18, 0.14);
  border-color: var(--imyj-gold-2);
}

.choice-tile span,
.payment-card strong {
  font-weight: 700;
}

.payment-card small {
  display: block;
  margin-top: 2px;
  color: var(--imyj-muted);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid #cfd8d0;
  border-radius: 8px;
  overflow: hidden;
}

.segmented label {
  margin: 0;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 8px;
  color: var(--imyj-green);
  font-weight: 700;
  border-right: 1px solid #cfd8d0;
  cursor: pointer;
}

.segmented label:last-child span {
  border-right: 0;
}

.segmented input:checked + span {
  color: var(--imyj-green);
  background: var(--imyj-gold);
}

.doc-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.doc-checks label,
.terms-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: var(--imyj-ink);
}

.form-check-input {
  accent-color: var(--imyj-green);
}

.payment-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
}

.payment-options {
  display: grid;
  gap: 10px;
}

.proof-box {
  margin-top: 16px;
  padding: 14px;
  background: #f7faf6;
  border: 1px dashed #b8c6ba;
  border-radius: 8px;
}

.proof-box > .form-label {
  margin-top: 14px;
}

.terms-line {
  margin-top: 18px;
}

.bank-panel {
  padding: 18px;
  background: var(--imyj-green);
  color: var(--imyj-white);
  border-radius: 8px;
}

.bank-panel h3 {
  margin: 0 0 14px;
  font-size: 1rem;
}

.bank-item {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.bank-item span,
.bank-owner {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
}

.bank-owner {
  margin-top: 12px;
  color: var(--imyj-gold);
  font-weight: 700;
}

.summary-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.summary-item {
  padding: 12px;
  background: #f7faf6;
  border: 1px solid var(--imyj-line);
  border-radius: 8px;
}

.summary-item span {
  display: block;
  color: var(--imyj-muted);
  font-size: 0.78rem;
}

.summary-item strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--imyj-line);
}

.field-error {
  display: none;
  width: 100%;
  margin-top: 0.25rem;
  color: var(--danger);
  font-size: 0.875em;
}

.field-error.show {
  display: block;
}

.success-panel {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.success-panel[hidden] {
  display: none;
}

.success-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  color: var(--imyj-green);
  background: var(--imyj-gold);
  border-radius: 50%;
}

.success-icon svg {
  width: 30px;
  height: 30px;
}

.success-panel h2 {
  margin: 0 0 6px;
  color: var(--imyj-green);
  font-size: 1.35rem;
}

.success-panel p {
  margin: 0;
  color: var(--imyj-muted);
}

.success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.receipt-document {
  margin-top: 18px;
  padding: 18px;
  background: #fbfdf9;
  border: 1px solid var(--imyj-line);
  border-radius: 8px;
}

.receipt-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--imyj-green);
}

.receipt-head img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.receipt-head strong,
.receipt-number strong {
  display: block;
  color: var(--imyj-green);
  font-size: 1.1rem;
}

.receipt-head span,
.receipt-number span,
.receipt-grid span {
  display: block;
  color: var(--imyj-muted);
  font-size: 0.82rem;
}

.receipt-number {
  margin: 16px 0;
  padding: 12px;
  background: rgba(255, 204, 18, 0.16);
  border: 1px solid rgba(242, 183, 5, 0.44);
  border-radius: 8px;
}

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

.receipt-grid div {
  padding: 10px;
  background: var(--imyj-white);
  border: 1px solid var(--imyj-line);
  border-radius: 6px;
}

.receipt-grid strong {
  display: block;
  margin-top: 3px;
  color: var(--imyj-ink);
  overflow-wrap: anywhere;
}

.receipt-note {
  margin: 14px 0 0;
  color: var(--imyj-muted);
  font-size: 0.9rem;
}

.lookup-card,
.admin-login-card {
  margin-top: 34px;
}

.lookup-result {
  margin-top: 20px;
}

.status-box {
  display: grid;
  gap: 8px;
  padding: 16px;
  background: #f7faf6;
  border: 1px solid var(--imyj-line);
  border-radius: 8px;
}

.status-box strong {
  color: var(--imyj-green);
}

.security-message {
  min-height: 24px;
  margin-top: 12px;
  color: var(--danger);
  font-weight: 700;
}

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

.dash-kicker {
  color: var(--imyj-green-2);
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-head h1 {
  margin: 4px 0 0;
  color: var(--imyj-green);
  font-size: 1.8rem;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

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

.metric-card,
.table-panel,
.course-panel {
  background: var(--imyj-white);
  border: 1px solid rgba(0, 61, 11, 0.08);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(13, 38, 18, 0.08);
}

.metric-card {
  padding: 16px;
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--imyj-muted);
}

.metric-card strong {
  display: block;
  margin: 4px 0;
  color: var(--imyj-green);
  font-size: 2rem;
  line-height: 1;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
}

.table-panel {
  overflow: hidden;
}

.table-tools {
  padding: 14px;
  border-bottom: 1px solid var(--imyj-line);
}

.admin-filters {
  display: grid;
  grid-template-columns: minmax(190px, 1.4fr) repeat(4, minmax(145px, 1fr));
  gap: 10px;
  align-items: end;
}

.table {
  margin-bottom: 0;
}

.table thead th {
  color: var(--imyj-green);
  background: #f7faf6;
  border-bottom: 1px solid var(--imyj-line);
  font-size: 0.88rem;
}

.table tbody td {
  color: var(--imyj-ink);
  border-color: var(--imyj-line);
  font-size: 0.9rem;
}

.badge-payment {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  color: var(--imyj-green);
  background: rgba(255, 204, 18, 0.24);
  border: 1px solid rgba(242, 183, 5, 0.44);
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--imyj-green);
  background: rgba(255, 204, 18, 0.18);
  border: 1px solid rgba(242, 183, 5, 0.46);
  border-radius: 6px;
}

.icon-button:hover,
.icon-button:focus-visible {
  color: var(--imyj-white);
  background: var(--imyj-green);
  border-color: var(--imyj-green);
  outline: 0;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.record-modal[hidden] {
  display: none;
}

.record-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}

.record-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 26, 12, 0.62);
}

.record-modal-card {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  max-height: min(88vh, 920px);
  overflow: auto;
  background: var(--imyj-white);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.record-modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  background: var(--imyj-white);
  border-bottom: 1px solid var(--imyj-line);
}

.record-modal-head h2 {
  margin: 4px 0 0;
  color: var(--imyj-green);
  font-size: 1.35rem;
}

.record-modal-body {
  display: grid;
  gap: 16px;
  padding: 18px;
}

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

.detail-grid div {
  padding: 10px;
  background: #f7faf6;
  border: 1px solid var(--imyj-line);
  border-radius: 6px;
}

.detail-grid span {
  display: block;
  color: var(--imyj-muted);
  font-size: 0.78rem;
}

.detail-grid strong {
  display: block;
  margin-top: 3px;
  color: var(--imyj-ink);
  overflow-wrap: anywhere;
}

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

.file-preview-grid section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--imyj-line);
  border-radius: 8px;
}

.file-preview-grid h3 {
  margin: 0;
  color: var(--imyj-green);
  font-size: 1rem;
}

.file-preview-grid iframe {
  width: 100%;
  min-height: 360px;
  border: 1px solid var(--imyj-line);
  border-radius: 6px;
}

.course-panel {
  padding: 16px;
}

.course-panel h2 {
  margin: 0 0 12px;
  color: var(--imyj-green);
  font-size: 1.1rem;
}

.course-list {
  display: grid;
  gap: 10px;
}

.course-row {
  display: grid;
  gap: 6px;
}

.course-row div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
}

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

.course-bar span {
  display: block;
  height: 100%;
  width: var(--value);
  background: var(--imyj-gold);
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
}

.app-toast {
  padding: 12px 14px;
  color: var(--imyj-white);
  background: var(--imyj-green);
  border-left: 5px solid var(--imyj-gold);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.app-toast-danger {
  background: var(--danger);
  border-left-color: #ffcc12;
}

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

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

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

  .nav-action {
    justify-content: center;
    text-align: center;
  }

  .topbar {
    align-items: flex-start;
  }

  .choice-grid,
  .metrics-grid,
  .summary-panel,
  .receipt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .payment-layout,
  .dashboard-grid,
  .admin-filters,
  .file-preview-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .main-panel {
    padding: 18px 12px 30px;
  }

  .brand-block {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .side-nav {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar-copy {
    text-align: left;
  }

  .stepper {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .stepper-line {
    display: none;
  }

  .stepper-item {
    padding: 8px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--imyj-line);
    border-radius: 8px;
  }

  .section-heading,
  .dashboard-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .choice-grid,
  .metrics-grid,
  .summary-panel,
  .receipt-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .form-actions,
  .dashboard-actions {
    flex-direction: column;
  }

  .form-actions .btn,
  .dashboard-actions .btn,
  .success-actions .btn {
    width: 100%;
  }
}

@media print {
  @page {
    size: A4;
    margin: 8mm;
  }

  .sidebar,
  .topbar,
  .stepper,
  .form-card,
  .nav-action,
  .form-actions,
  .success-icon,
  .success-actions,
  .success-panel h2,
  .success-panel > div > p,
  .toast-region {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .main-panel {
    padding: 0;
  }

  body {
    min-height: auto;
    background: #fff;
    font-size: 10px;
  }

  .success-panel {
    display: block !important;
    margin: 0;
    box-shadow: none;
    border: 0;
    padding: 0;
  }

  .receipt-document {
    margin: 0;
    padding: 8px;
    border: 1px solid #222;
    box-shadow: none;
  }

  .receipt-head {
    gap: 8px;
    padding-bottom: 6px;
    border-bottom-width: 1px;
  }

  .receipt-head img {
    width: 42px;
    height: 42px;
  }

  .receipt-head strong,
  .receipt-number strong {
    font-size: 0.9rem;
  }

  .receipt-head span,
  .receipt-number span,
  .receipt-grid span {
    font-size: 0.62rem;
  }

  .receipt-number {
    margin: 6px 0;
    padding: 6px;
  }

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

  .receipt-grid div {
    padding: 4px 6px;
    border-radius: 0;
    break-inside: avoid;
  }

  .receipt-grid strong {
    margin-top: 1px;
    font-size: 0.72rem;
    line-height: 1.1;
  }

  .receipt-note {
    margin-top: 6px;
    font-size: 0.68rem;
    line-height: 1.2;
  }
}
