:root {
  --bg: #0f1311;
  --surface: #171c19;
  --raised: #1f2622;
  --line: #2b332e;
  --text: #eef2ef;
  --muted: #98a39c;
  --faint: #6b766f;
  --green: #34c27a;
  --green-deep: #1f7a4c;
  --green-soft: rgba(52, 194, 122, 0.12);
  --amber: #e4a845;
  --amber-soft: rgba(228, 168, 69, 0.13);
  --red: #e5664f;
  --red-soft: rgba(229, 102, 79, 0.13);
  --radius-lg: 18px;
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --sidebar: 252px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--green); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 600; }
h1 { font-size: 26px; letter-spacing: -0.01em; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex; flex-direction: column;
  padding: 22px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--green); color: #07130c;
  display: grid; place-items: center;
}
.brand-mark svg { width: 20px; height: 20px; }
.school-chip { margin: 18px 0 22px; padding: 12px; border-radius: var(--radius); background: var(--raised); }
.school-chip strong { display: block; font-size: 14px; }
.school-chip span { font-size: 12.5px; color: var(--muted); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap;
  border: 0; background: none; text-align: left; width: 100%;
}
.nav-item svg { width: 19px; height: 19px; flex: none; }
.nav-item:hover { background: var(--raised); color: var(--text); }
.nav-item.active { background: var(--green-soft); color: var(--green); }
.nav-badge {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 11px; background: var(--amber); color: #1b1203;
  font-size: 12px; font-weight: 700; display: grid; place-items: center;
}
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 16px; }
.user-row { display: flex; align-items: center; gap: 10px; }
.user-row .who { min-width: 0; }
.user-row .who strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-row .who span { font-size: 12.5px; color: var(--muted); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--raised); border: 1px solid var(--line);
  display: grid; place-items: center; font-weight: 600; font-size: 13px; color: var(--green);
}
.link-btn { background: none; border: 0; color: var(--muted); padding: 8px 0 0; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.link-btn:hover { color: var(--text); }
.link-btn svg { width: 15px; height: 15px; }

.main { min-width: 0; }
.page { max-width: 1120px; margin: 0 auto; padding: 32px 36px 56px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 6px; }

.topbar, .tabbar { display: none; }

/* ---------- Building blocks ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.page > .card + .card { margin-top: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-main { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--raised); color: var(--text); font-weight: 600; font-size: 14.5px;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: #3b463f; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--green); border-color: var(--green); color: #06140c; }
.btn-primary:hover { background: #3fd087; border-color: #3fd087; }
.btn-danger { background: var(--red-soft); border-color: transparent; color: var(--red); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-gray { background: var(--raised); color: var(--muted); }

.chip {
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; font-size: 13px; font-weight: 500; color: var(--muted);
}
.chip:hover { color: var(--text); }
.chip.on { background: var(--green-soft); border-color: transparent; color: var(--green); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 13px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--line); outline: none;
}
.input:focus { border-color: var(--green); }
.input-money { position: relative; }
.input-money span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-money .input { padding-left: 28px; }
.hint { font-size: 12.5px; color: var(--faint); }
.error-text { font-size: 13px; color: var(--red); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; }
.stat .label { font-size: 13px; color: var(--muted); }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 6px; letter-spacing: -0.01em; }
.stat .sub { font-size: 12.5px; color: var(--faint); margin-top: 2px; }
.stat.accent { background: linear-gradient(160deg, #18342a 0%, var(--surface) 70%); border-color: #24503a; }
.stat.accent .value { color: var(--green); }

/* The fee bar: paid (green), awaiting confirmation (amber), installment markers */
.feebar { position: relative; height: 12px; border-radius: 6px; background: var(--raised); display: flex; overflow: hidden; }
.feebar.lg { height: 16px; border-radius: 8px; }
.fb-paid { background: var(--green); height: 100%; transition: width .5s ease; }
.fb-pend { height: 100%; background: repeating-linear-gradient(-45deg, var(--amber) 0 5px, #b9842f 5px 10px); }
.fb-mark { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--bg); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }

/* Child cards (parent) */
.hero-sum { padding: 24px; background: linear-gradient(150deg, #173126 0%, var(--surface) 65%); border-color: #24503a; }
.hero-sum .big { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; }
.child-card .who { display: flex; gap: 12px; align-items: center; }
.child-card .avatar { width: 44px; height: 44px; font-size: 15px; }
.child-money { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 12px; }
.child-money div span { display: block; font-size: 12.5px; color: var(--muted); }
.child-money div strong { font-size: 16px; }
.next-due { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--raised); display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Lists */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.list-item.clickable { cursor: pointer; }
.list-item.clickable:hover .li-title { color: var(--green); }
.li-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--raised); color: var(--muted); }
.li-icon svg { width: 18px; height: 18px; }
.li-icon.green { background: var(--green-soft); color: var(--green); }
.li-icon.amber { background: var(--amber-soft); color: var(--amber); }
.li-icon.red { background: var(--red-soft); color: var(--red); }
.li-body { flex: 1; min-width: 0; }
.li-title { font-weight: 600; font-size: 14.5px; }
.li-sub { font-size: 13px; color: var(--muted); }
.li-end { text-align: right; flex: none; }
.li-end strong { display: block; }
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty svg { width: 32px; height: 32px; color: var(--faint); margin-bottom: 8px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 13px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--raised); }
.table .r { text-align: right; }
.table .name { font-weight: 600; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search { position: relative; flex: 1; min-width: 200px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--faint); }
.search .input { padding-left: 38px; }

/* Pay flow */
.steps { display: flex; gap: 8px; margin-bottom: 20px; }
.step { flex: 1; height: 4px; border-radius: 2px; background: var(--raised); }
.step.done { background: var(--green); }
.select-row { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--bg); }
.select-row + .select-row { margin-top: 10px; }
.select-row.on { border-color: var(--green-deep); background: #122019; }
.select-top { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.check {
  width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--faint);
  display: grid; place-items: center; flex: none;
}
.check svg { width: 14px; height: 14px; opacity: 0; }
.select-row.on .check { background: var(--green); border-color: var(--green); color: #06140c; }
.select-row.on .check svg { opacity: 1; }
.select-body { margin-top: 14px; padding-left: 34px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.total-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.total-bar .amt { font-size: 22px; font-weight: 700; }

.bank-card { border-radius: var(--radius-lg); padding: 22px; background: linear-gradient(145deg, #1c3a2c 0%, #121815 80%); border: 1px solid #24503a; }
.bank-amount { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.bank-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid rgba(255,255,255,0.08); }
.bank-line span { color: var(--muted); font-size: 13px; display: block; }
.bank-line strong { font-size: 17px; }
.bank-line.acct strong { font-size: 24px; letter-spacing: 0.06em; }
.copy-btn { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 9px; padding: 7px 11px; font-size: 13px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.copy-btn svg { width: 15px; height: 15px; }
.copy-btn:hover { border-color: var(--green); color: var(--green); }
.note { padding: 12px 14px; border-radius: var(--radius); background: var(--raised); font-size: 13.5px; color: var(--muted); display: flex; gap: 10px; }
.note svg { width: 18px; height: 18px; flex: none; color: var(--green); margin-top: 1px; }
.note.amber svg { color: var(--amber); }
.upload {
  border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--muted);
  display: block; cursor: pointer;
}
.upload:hover { border-color: var(--green); }
.upload input { display: none; }
.success { text-align: center; padding: 28px 10px; }
.success-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--amber-soft); color: var(--amber); display: grid; place-items: center; margin: 0 auto 16px; }
.success-icon svg { width: 30px; height: 30px; }

/* Pending cards (school) */
.pend-card { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.pend-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.pend-meta span { display: block; font-size: 12.5px; color: var(--muted); }
.pend-meta strong { font-size: 14px; font-weight: 600; word-break: break-word; }
.pend-actions { display: flex; flex-direction: column; gap: 8px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 500; }

/* Modal */
.backdrop { position: fixed; inset: 0; background: rgba(4, 7, 5, 0.72); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .15s ease; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; animation: rise .2s ease; }
.modal.wide { max-width: 680px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--raised); display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 17px; height: 17px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }

/* Receipt */
.receipt { background: #f7faf8; color: #101512; border-radius: 14px; padding: 24px; }
.receipt .r-head { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1.5px dashed #c9d3cd; }
.receipt .r-school { font-weight: 700; font-size: 16px; }
.receipt .r-sub { color: #5d6a62; font-size: 12.5px; }
.receipt .r-amount { font-size: 30px; font-weight: 700; margin: 16px 0 4px; color: #146b40; }
.receipt dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13.5px; margin: 14px 0 0; }
.receipt dt { color: #5d6a62; }
.receipt dd { margin: 0; text-align: right; font-weight: 600; }
.receipt .r-foot { margin-top: 16px; padding-top: 12px; border-top: 1.5px dashed #c9d3cd; font-size: 12px; color: #5d6a62; display: flex; justify-content: space-between; gap: 8px; }
.stamp.void { border-color: #b23b2a; color: #b23b2a; }
.stamp { display: inline-block; padding: 3px 10px; border: 2px solid #1f8a54; color: #1f8a54; border-radius: 6px; font-weight: 700; font-size: 12px; transform: rotate(-4deg); }

/* Toast */
#toast-root { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #e9f7ef; color: #0c2016; padding: 11px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.35); animation: rise .2s ease; display: flex; gap: 8px; align-items: center; }
.toast svg { width: 17px; height: 17px; color: var(--green-deep); }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-side { padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(160deg, #163024 0%, #0f1311 70%); border-right: 1px solid var(--line); }
.login-side h1 { font-size: 44px; line-height: 1.08; letter-spacing: -0.025em; max-width: 13ch; margin-top: 56px; }
.login-side p.lead { color: var(--muted); font-size: 17px; max-width: 42ch; margin-top: 18px; }
.preview-bars { margin-top: 36px; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.preview-bars .spread { font-size: 13.5px; color: var(--muted); margin-bottom: 6px; }
.login-main { padding: 48px 56px; display: flex; flex-direction: column; justify-content: center; max-width: 560px; }
.login-main h2 { font-size: 22px; }
.login-group { margin-top: 26px; }
.login-group > p { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.acct-btn { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-align: left; }
.acct-btn + .acct-btn { margin-top: 10px; }
.acct-btn:hover { border-color: var(--green-deep); background: #142019; }
.acct-btn .who { flex: 1; }
.acct-btn .who strong { display: block; }
.acct-btn .who span { font-size: 13px; color: var(--muted); }
.acct-btn > svg { width: 18px; height: 18px; color: var(--faint); }

/* ---------- Mobile ---------- */
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: sticky; top: 0; z-index: 20;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
    background: rgba(15, 19, 17, 0.92); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .topbar .brand { font-size: 16px; }
  .topbar .brand-mark { width: 30px; height: 30px; }
  .topbar .school { font-size: 12px; color: var(--muted); font-weight: 400; display: block; }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: rgba(23, 28, 25, 0.96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; color: var(--faint); text-decoration: none; font-size: 11px; font-weight: 500; }
  .tab svg { width: 22px; height: 22px; }
  .tab.active { color: var(--green); }
  .tab .nav-badge { position: absolute; top: 0; left: 55%; margin: 0; min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }
  .page { padding: 20px 16px calc(96px + env(safe-area-inset-bottom, 0px)); }
  h1 { font-size: 22px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat .value { font-size: 19px; }
  .grid-2, .grid-main { grid-template-columns: 1fr; }
  .card { padding: 16px; border-radius: 16px; }
  .hero-sum .big { font-size: 30px; }
  .pend-card { grid-template-columns: 1fr; }
  .hide-mobile { display: none; }
  .pend-meta { grid-template-columns: 1fr 1fr; }
  .pend-actions { flex-direction: row; }
  .pend-actions .btn { flex: 1; }
  .backdrop { place-items: end center; padding: 0; }
  .modal { max-width: none; border-radius: 20px 20px 0 0; max-height: 92vh; padding: 20px 18px calc(20px + env(safe-area-inset-bottom, 0px)); }
  .bank-line.acct strong { font-size: 21px; }
  #toast-root { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); width: calc(100% - 32px); }

  /* Tables turn into stacked rows */
  table.table.stackable thead { display: none; }
  table.table.stackable, .table.stackable tbody, .table.stackable tr, .table.stackable td { display: block; width: 100%; }
  .table.stackable tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .table.stackable tr:last-child { border-bottom: 0; }
  .table.stackable td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table.stackable td::before { content: attr(data-label); color: var(--muted); font-size: 13px; text-align: left; }
  .table.stackable td.lead { font-size: 15px; }
  .table.stackable td.lead::before { content: none; }
  .table.stackable tbody tr.clickable:hover td { background: none; }

  .login { grid-template-columns: 1fr; }
  .login-side { padding: calc(28px + env(safe-area-inset-top, 0px)) 22px 28px; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-side h1 { font-size: 32px; margin-top: 28px; }
  .login-side p.lead { font-size: 15px; }
  .preview-bars { display: none; }
  .login-main { padding: 26px 22px 40px; }
}

/* Settings: classes, logo, permissions */
.level-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.level-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 9px; background: var(--raised); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; }
.lv-x { border: 0; background: none; color: var(--faint); padding: 0; display: grid; place-items: center; }
.lv-x svg { width: 14px; height: 14px; }
.lv-x:hover { color: var(--red); }
.lv-arrow svg { width: 14px; height: 14px; color: var(--faint); display: block; }
.logo-prev { width: 56px; height: 56px; border-radius: 12px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.logo-prev.empty { display: grid; place-items: center; background: var(--raised); color: var(--faint); }
.logo-prev.empty svg { width: 24px; height: 24px; }
.perm-row { padding: 8px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.school-logo { width: 34px; height: 34px; border-radius: 8px; object-fit: contain; background: #fff; flex: none; }
.r-logo { width: 44px; height: 44px; object-fit: contain; margin-right: 10px; }

/* Import */
.import-step { display: flex; gap: 14px; align-items: flex-start; }
.import-step .li-icon { font-weight: 700; }
.import-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.import-sum div { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.import-sum strong { display: block; font-size: 22px; }
.import-sum span { font-size: 12.5px; color: var(--muted); }
.row-bad td { background: rgba(229, 102, 79, 0.05); }
textarea.input { resize: vertical; font-family: inherit; }
@media (max-width: 880px) { .import-sum { grid-template-columns: 1fr 1fr; } }

/* People and terms */
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text); cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green); flex: none; }
.fee-table .fee-in { padding: 8px 10px; min-width: 110px; }
@media (max-width: 880px) { .fee-table .fee-in { max-width: 150px; text-align: right; } }

/* Finance */
.pro-tag { display: inline-grid; place-items: center; padding: 2px 8px; border-radius: 6px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 700; vertical-align: middle; margin-left: 6px; }
.pro-tag.sm { margin-left: auto; font-size: 11px; padding: 1px 6px; }
.pro-tag.sm svg { width: 12px; height: 12px; }
.fin-stats { grid-template-columns: repeat(3, 1fr); }
.io-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.io-grid span { display: block; }
.io-grid strong { font-size: 20px; }
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 28px; }
.cat-bar { height: 8px; border-radius: 4px; background: var(--raised); margin-top: 6px; overflow: hidden; }
.cat-bar i { display: block; height: 100%; background: var(--red); opacity: .8; border-radius: 4px; }
.locked { text-align: left; }
.lock-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin-bottom: 14px; }
.lock-icon svg { width: 24px; height: 24px; }
.statement { max-width: 640px; margin: 0 auto; }
.st-head { padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.st-school { font-weight: 700; font-size: 17px; }
.st-title { font-size: 15px; margin-top: 2px; }
.st-sub { font-size: 13px; color: var(--muted); }
.st-section { margin-top: 18px; font-size: 13px; font-weight: 600; color: var(--green); }
.st-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; font-size: 14.5px; }
.st-row.total { border-top: 1px solid var(--line); font-weight: 600; }
.st-row.grand { border-top: 2px solid var(--text); border-bottom: 2px solid var(--text); font-weight: 700; margin-top: 10px; padding: 10px 0; font-size: 15.5px; }
.st-row.grand.pos .num { color: var(--green); }
.st-row.grand.neg .num { color: var(--red); }
.st-note { margin-top: 16px; font-size: 12.5px; color: var(--faint); }
@media (max-width: 880px) {
  .fin-stats { grid-template-columns: 1fr; }
  .fin-stats .stat { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; }
  .fin-stats .stat .value { margin: 0; }
  .fin-stats .stat .sub { display: none; }
  .cat-grid { grid-template-columns: 1fr; }
  .io-grid strong { font-size: 16px; }
  .tab span { font-size: 10.5px; }
}

/* Alerts */
.nav-badge.red { background: var(--red); color: #fff; }
.alert-btn { margin-bottom: 8px; border: 1px solid var(--line) !important; }
.icon-btn.bell { position: relative; color: var(--text); }
.icon-btn.bell .nav-badge { position: absolute; top: -6px; right: -6px; margin: 0; min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }
.alert-card { border-color: #5a2a22; background: #1f1513; }
.alert-item { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.alert-item.unread { border-color: #6b2f25; }
.alert-item .btn-sm { padding: 5px 9px; font-size: 12px; }
.alert-item .btn-sm svg { width: 14px; height: 14px; }
details summary { cursor: pointer; }

/* Credit score */
.score { display: inline-grid; place-items: center; min-width: 38px; height: 26px; padding: 0 8px; border-radius: 8px; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.score.good { background: var(--green-soft); color: var(--green); }
.score.fair { background: var(--amber-soft); color: var(--amber); }
.score.poor { background: var(--red-soft); color: var(--red); }
.score.big { min-width: 56px; height: 48px; font-size: 22px; border-radius: 12px; }
.score-panel { padding: 16px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); }
.score-panel .list-item { gap: 10px; }

/* Switch */
.switch { width: 50px; height: 28px; border-radius: 14px; border: 0; background: var(--raised); position: relative; flex: none; padding: 0; }
.switch span { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--muted); transition: transform .2s ease; }
.switch.on { background: var(--green); }
.switch.on span { transform: translateX(22px); background: #06140c; }

.preview { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font-size: 13.5px; white-space: pre-line; color: var(--text); }
a.icon-btn { color: var(--text); }
a.icon-btn:hover { border-color: var(--green); color: var(--green); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  body { background: #fff; }
  body * { visibility: hidden; }
  .receipt, .receipt *, .statement, .statement * { visibility: visible; }
  .receipt, .statement { position: absolute; left: 0; top: 0; width: 100%; max-width: none; color: #000; }
  .statement .st-sub, .statement .st-note { color: #444; }
  .statement .st-section, .statement .num { color: #000 !important; }
  .statement .st-row.grand { border-color: #000; }
}
