:root {
  --cream: #f8f0d6;
  --gold: #c9a44e;
  --gold-soft: #e3c373;
}

.user-menu-wrap { position: relative; }
.net-pill { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; height: 38px; border-radius: 10px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 700; }
.tenant-chip {
  margin-top: 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--sidebar-title);
}

.student-switch { margin-left: 8px; min-width: 220px; }
.student-switch .select { width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.flash {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
}
.flash--ok { background: var(--green-soft); color: #146c48; border: 1px solid #b7e6d2; }
.flash--warn { background: var(--amber-soft); color: #8a5a08; border: 1px solid #f3d9a4; }
.flash--err { background: var(--red-soft); color: #b42318; border: 1px solid #f5c2c0; }

.muted { color: var(--text-3); font-size: 13px; }
.amount-neg { color: var(--red); font-weight: 800; }

.child-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.child-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface);
  transition: .15s;
}
.child-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.child-card.active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(31,122,52,.12); }
.child-card b { display: block; font-size: 15px; }
.child-card small { color: var(--text-3); }

.search-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 18px;
}
.search-tab {
  border: 0;
  background: transparent;
  padding: 11px 8px;
  border-radius: 11px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  cursor: pointer;
}
.search-tab.active {
  background: #fff;
  color: var(--green);
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .search-tab.active { background: var(--surface); color: #6fd79b; }

.candidate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.candidate:last-child { border-bottom: 0; }

.topup-amounts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.topup-amounts button {
  border: 1px solid var(--border-2);
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  transition: .14s;
}
.topup-amounts button:hover { border-color: var(--brand); color: var(--brand); }
.topup-amounts button.is-on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(31, 122, 52, .16);
}

.muted-note {
  background: var(--amber-soft);
  color: #8a5a08;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.pay-stage {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(240px, 280px) 1fr;
  gap: 20px;
  align-items: center;
}
.pay-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  display: grid;
  gap: 12px;
  min-width: 0;
}
.pay-card__row { display: grid; grid-template-columns: 1.4fr 0.8fr; gap: 12px; }
form.is-disabled { opacity: .55; pointer-events: none; }

.ccard {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1.586 / 1;
  perspective: 900px;
}
.ccard__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .55s ease;
}
.ccard.is-flipped .ccard__inner { transform: rotateY(180deg); }
.ccard__face {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 16px 18px;
  color: #f8f0d6;
  backface-visibility: hidden;
  box-shadow: 0 12px 28px rgba(23, 59, 38, .28);
  overflow: hidden;
}
.ccard__face--front {
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(201,164,78,.35), transparent 55%),
    linear-gradient(145deg, #1f7a34 0%, #173b26 58%, #0f2618 100%);
}
.ccard__face--back {
  transform: rotateY(180deg);
  background: linear-gradient(145deg, #173b26, #0f2618);
  padding: 0;
}
.ccard__top { display: flex; align-items: flex-start; justify-content: space-between; }
.ccard__chip {
  width: 34px;
  height: 26px;
  border-radius: 6px;
  background:
    linear-gradient(135deg, #e8d5a3, #c9a44e 45%, #8a6b20);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}
.ccard__brand {
  position: relative;
  min-width: 52px;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.cc-mark { display: none; }
.cc-mark--idle {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  opacity: .7;
}
.ccard[data-brand="kart"] .cc-mark--idle,
.ccard:not([data-brand]) .cc-mark--idle { display: block; }
.ccard[data-brand="visa"] .cc-mark--visa {
  display: block;
  font-size: 16px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: .08em;
  color: #fff;
}
.ccard[data-brand="mc"] .cc-mark--mc {
  display: flex;
  width: 42px;
  height: 26px;
  position: relative;
}
.cc-mark--mc i {
  position: absolute;
  top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
}
.cc-mark--mc i:first-child { left: 0; background: #eb001b; }
.cc-mark--mc i:last-child { right: 0; background: #f79e1b; }
.ccard[data-brand="troy"] .cc-mark--troy {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.85);
  border-radius: 4px;
  padding: 2px 6px;
}
.ccard[data-brand="amex"] .cc-mark--idle { display: none; }
.ccard[data-brand="amex"] .ccard__brand::after {
  content: "AMEX";
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
}
.ccard__number {
  margin-top: 22px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .12em;
  text-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.ccard.is-focus-number .ccard__number { outline: 1px dashed rgba(248,240,214,.45); outline-offset: 4px; border-radius: 6px; }
.ccard__bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 14px;
  gap: 10px;
}
.ccard__holder { flex: 1; min-width: 0; }
.ccard__skt { flex: 0 0 auto; text-align: right; }
.ccard__bottom small {
  display: block;
  font-size: 8px;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: .7;
  margin-bottom: 3px;
}
.ccard__name {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .03em;
  line-height: 1.2;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  word-break: break-word;
}
.ccard__exp {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
}
.ccard.is-focus-name .ccard__name,
.ccard.is-focus-exp .ccard__exp { outline: 1px dashed rgba(248,240,214,.45); outline-offset: 3px; border-radius: 4px; }

.pay-num { position: relative; }
.pay-num .input { padding-right: 64px; }
.pay-num__brand {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--text-3);
  pointer-events: none;
}
.pay-num__brand[data-brand="visa"] { color: #1a1f71; font-style: italic; }
.pay-num__brand[data-brand="mc"] { color: #eb001b; }
.pay-num__brand[data-brand="troy"] { color: #1f7a34; }
.pay-num__brand[data-brand="amex"] { color: #006fcf; }
.ccard__stripe {
  height: 38px;
  margin-top: 22px;
  background: #111;
}
.ccard__cvc-wrap {
  margin: 22px 16px 0 auto;
  width: 88px;
  text-align: right;
}
.ccard__cvc-wrap small {
  display: block;
  font-size: 8px;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .7;
  margin-bottom: 4px;
}
.ccard__cvc {
  background: #fff;
  color: #173b26;
  border-radius: 4px;
  padding: 6px 8px;
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 800;
  letter-spacing: .2em;
}

@media (max-width: 1100px) {
  .pay-stage { grid-template-columns: 1fr; justify-items: center; }
  .pay-card { width: 100%; }
}
@media (max-width: 520px) {
  .pay-card__row { grid-template-columns: 1fr; }
}

.login-page { background: #f4f6f5; height: 100%; max-height: 100%; overflow: hidden; }
html:has(.login-page) { height: 100%; max-height: 100%; overflow: hidden; }
.login-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
.login-brand {
  position: relative;
  overflow: hidden;
  min-height: 0;
  height: 100%;
  background: #173b26;
}
.login-brand__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 18%;
  display: block;
  opacity: 1;
}
.login-brand__veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(23,59,38,.04) 0%, rgba(23,59,38,.08) 55%, rgba(15,38,24,.42) 100%);
  pointer-events: none;
}
.login-brand__inner {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 36px 40px 42px;
  text-align: left;
}
.login-brand__name {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.03em;
  text-shadow: 0 10px 28px rgba(0,0,0,.35);
}
.login-form-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: stretch;
  padding: 20px 32px 10px;
  background: #f4f6f5;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  position: relative;
}
.login-form-box {
  width: 100%;
  max-width: 460px;
  margin: auto 0;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: up .45s ease both;
}
.login-foot {
  width: 100%;
  max-width: 460px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 2px;
}
.login-foot img {
  height: 52px;
  width: auto;
  display: block;
  background: transparent;
}
.login-foot span {
  font-size: 11px;
  color: #8a968e;
  white-space: nowrap;
}
@keyframes up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.login-onda {
  display: block;
  flex: 0 0 auto;
  width: 62%;
  max-width: 440px;
  max-height: none;
  height: auto;
  object-fit: contain;
  background: none;
  mix-blend-mode: multiply;
  margin: 0 auto 18px;
}
.login-form-box h2 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 800;
  color: #173b26;
  letter-spacing: -.03em;
  text-align: center;
}
.login-form-box .sub { margin: 0 0 16px; font-size: 13.5px; color: #6d7a72; text-align: center; }
.login-form-box label { display: block; font-size: 13px; font-weight: 600; color: #173b26; margin: 0 0 6px; }
.login-form-box .field { margin-bottom: 12px; }
.login-form-box .inp {
  width: 100%;
  height: 44px;
  border: 1px solid #d7e3db;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 15px;
  outline: none;
  background: #fff;
  color: #173b26;
}
.login-form-box .inp:focus { border-color: #173b26; box-shadow: 0 0 0 3px rgba(23,59,38,.12); }
.btn-submit {
  width: 100%;
  height: 46px;
  margin-top: 4px;
  border: none;
  border-radius: 13px;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: #1f7a34;
  box-shadow: 0 10px 22px rgba(31,122,52,.22);
}
.btn-submit:hover { filter: brightness(1.06); }
.login-err {
  background: #fde8e8;
  color: #c0392b;
  border: 1px solid #f5c6c6;
  padding: 12px 14px;
  border-radius: 11px;
  font-size: 13.5px;
  margin-bottom: 18px;
}
.login-alt { margin-top: 12px; text-align: center; color: #6d7a72; font-size: 13.5px; }
.login-alt a { color: #173b26; font-weight: 700; }

@media (max-width: 860px) {
  html:has(.login-page), html, body.login-page, .login-page {
    height: auto !important;
    max-height: none !important;
    overflow: auto !important;
  }
  .login-wrap { height: auto; min-height: 100dvh; max-height: none; overflow: visible; grid-template-columns: 1fr; }
  .login-brand { min-height: 28vh; height: 28vh; }
  .login-brand__inner { padding: 22px 22px 24px; }
  .login-brand__name { font-size: 22px; }
  .login-form-side { padding: 20px 20px 12px; height: auto; overflow: visible; }
  .login-foot { max-width: none; }
  .student-switch { display: none; }
}
@media (max-width: 768px) {
  .overlay.show { display: block; }
}
