/* Referidos Retiro — warm, mobile-first and intentionally lightweight. */
:root {
  --ink: #173331;
  --ink-soft: #506562;
  --forest: #173f3a;
  --forest-deep: #102f2c;
  --cream: #f7f1e6;
  --paper: #fffdf9;
  --white: #ffffff;
  --orange: #ee603c;
  --orange-dark: #c84227;
  --yellow: #f4be3d;
  --green: #3f7f68;
  --whatsapp: #128c5b;
  --red: #b6413d;
  --line: #dcded7;
  --line-dark: #c5cbc4;
  --shadow: 0 22px 60px rgba(22, 52, 48, .13);
  --shadow-soft: 0 10px 30px rgba(22, 52, 48, .08);
  --radius: 14px;
  --font-sans: "Avenir Next", Avenir, "Trebuchet MS", Inter, system-ui, -apple-system, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--cream); font-family: var(--font-sans); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, dl, dd { margin-top: 0; }
h1, h2 { letter-spacing: -.035em; }
h1 { font-family: var(--font-display); font-weight: 500; }
h2, h3 { line-height: 1.15; }
em { color: var(--orange); font-weight: 500; }
::selection { background: rgba(244, 190, 61, .45); }

.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; z-index: 1000; top: 8px; left: 8px; padding: 10px 14px; color: var(--white); background: var(--forest-deep); transform: translateY(-140%); transition: transform .18s ease; }
.skip-link:focus { transform: none; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--forest); text-decoration: none; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.05; }
.brand strong { font-family: var(--font-display); font-size: 19px; letter-spacing: -.02em; }
.brand small { margin-top: 4px; color: var(--ink-soft); font-size: 10px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.brand--light { color: var(--white); }
.brand--light small { color: rgba(255,255,255,.78); }
.brand__sun { position: relative; display: grid; width: 35px; height: 35px; flex: 0 0 35px; place-items: center; border: 2px solid currentColor; border-radius: 50%; }
.brand__sun::before, .brand__sun::after { position: absolute; width: 7px; height: 2px; content: ""; background: currentColor; box-shadow: 0 -21px 0 currentColor, 0 21px 0 currentColor; }
.brand__sun::after { transform: rotate(90deg); }
.brand__sun i { width: 9px; height: 9px; background: var(--yellow); border-radius: 50%; }

.eyebrow, .step-label { margin-bottom: 10px; color: var(--orange-dark); font-size: 11px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 11px 20px; border: 1px solid transparent; border-radius: 8px; font-weight: 750; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(1px); }
.button:focus-visible, .text-button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid rgba(238, 96, 60, .28); outline-offset: 2px; }
.button--primary { color: var(--white); background: var(--orange); box-shadow: 0 8px 20px rgba(196, 66, 39, .18); }
.button--primary:hover { background: var(--orange-dark); }
.button--secondary { color: var(--forest); background: var(--paper); border-color: var(--line-dark); }
.button--secondary:hover { background: #f4f3ee; border-color: var(--forest); }
.button--dark { color: var(--white); background: var(--forest); }
.button--dark:hover { background: var(--forest-deep); }
.button--danger { color: var(--white); background: var(--red); }
.button--danger-outline { color: var(--red); background: transparent; border-color: rgba(182,65,61,.4); }
.button--whatsapp { color: var(--white); background: var(--whatsapp); box-shadow: 0 10px 24px rgba(18,140,91,.22); }
.button--whatsapp:hover { background: #0b754b; }
.button--whatsapp svg { width: 24px; fill: currentColor; }
.button--wide { width: 100%; }
.button--small { min-height: 40px; padding: 8px 14px; font-size: 14px; }
.text-button { padding: 4px 0; color: var(--forest); background: none; border: 0; font-weight: 750; text-decoration: underline; text-decoration-color: rgba(23,63,58,.3); text-underline-offset: 3px; cursor: pointer; }
.text-button--danger { color: var(--red); }
.quiet-link { color: var(--forest); font-weight: 700; text-underline-offset: 4px; }

.flash-stack { display: grid; gap: 8px; margin-bottom: 20px; }
.flash { display: flex; align-items: flex-start; gap: 11px; padding: 13px 15px; color: var(--forest-deep); background: #edf5ef; border: 1px solid #bdd7c4; border-radius: 8px; font-size: 14px; }
.flash--error, .flash--danger { color: #792a26; background: #fff0ee; border-color: #e9b8b2; }
.flash__icon { display: grid; width: 22px; height: 22px; flex: 0 0 22px; place-items: center; color: var(--white); background: var(--green); border-radius: 50%; font-size: 12px; font-weight: 800; }
.flash--error .flash__icon, .flash--danger .flash__icon { background: var(--red); }
.form-error { display: grid; gap: 4px; margin-bottom: 18px; padding: 13px 15px; color: #7e2e29; background: #fff0ee; border-left: 4px solid var(--red); border-radius: 4px 8px 8px 4px; font-size: 14px; }

/* Parent acquisition flow */
.parent-page { min-height: 100svh; background: var(--paper); }
.parent-hero { position: relative; min-height: 540px; display: flex; overflow: hidden; color: var(--white); background: var(--forest-deep); isolation: isolate; }
.parent-hero__image { position: absolute; z-index: -2; inset: 0; background: url("/static/img/classroom-hero.webp") 61% center / cover no-repeat; transform: scale(1.01); animation: hero-settle 1.1s cubic-bezier(.2,.75,.25,1) both; }
.parent-hero__shade { position: absolute; z-index: -1; inset: 0; background: rgba(10,36,31,.56); }
.parent-hero__content { width: 100%; display: flex; flex-direction: column; justify-content: space-between; padding: 25px 22px 30px; }
.parent-hero__copy { max-width: 570px; margin-top: auto; padding-top: 120px; animation: rise .7s .12s ease both; }
.parent-hero__copy .eyebrow { color: #ffd86e; }
.parent-hero h1 { max-width: 590px; margin-bottom: 14px; font-size: clamp(42px, 12vw, 70px); line-height: .96; }
.parent-hero h1 em { color: #ffd15b; font-style: italic; }
.parent-hero__copy > p:last-child { max-width: 540px; margin: 0; color: rgba(255,255,255,.9); font-size: 17px; line-height: 1.55; }
.trust-list { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 25px 0 0; padding: 0; list-style: none; color: rgba(255,255,255,.9); font-size: 12px; font-weight: 700; }
.trust-list li { display: flex; align-items: center; gap: 6px; }
.trust-list span { color: #ffd15b; }

.lead-panel { background: var(--paper); }
.lead-panel__inner { max-width: 680px; margin: 0 auto; padding: 42px 22px calc(40px + env(safe-area-inset-bottom)); }
.form-intro { margin-bottom: 34px; }
.form-intro h2 { margin-bottom: 10px; color: var(--forest); font-family: var(--font-display); font-size: 34px; font-weight: 500; }
.form-intro > p:not(.step-label):not(.referred-by) { color: var(--ink-soft); }
.referred-by { display: inline-flex; align-items: center; gap: 7px; margin: 8px 0 0; padding: 7px 10px; color: var(--forest); background: #edf3e6; border-radius: 5px; font-size: 13px; font-weight: 700; }
.referred-by span { color: var(--orange); }
.lead-form { position: relative; }
.form-section { margin: 0 0 34px; padding: 0; border: 0; }
.form-section legend { width: 100%; display: flex; align-items: center; gap: 10px; margin-bottom: 20px; color: var(--forest); font-size: 18px; font-weight: 800; }
.form-section legend::after { height: 1px; flex: 1; content: ""; background: var(--line); }
.form-section legend span { display: grid; width: 28px; height: 28px; place-items: center; color: var(--orange-dark); background: #fff0e8; border-radius: 50%; font-size: 10px; }
.field { min-width: 0; display: flex; flex-direction: column; margin-bottom: 18px; }
.field label, .fee-grid > label { margin-bottom: 7px; color: var(--forest-deep); font-size: 13px; font-weight: 750; }
.field label small { color: var(--ink-soft); font-weight: 500; }
.field input, .field select, .field textarea, .fee-grid input, .search-field input, .filter-bar select { width: 100%; min-height: 49px; padding: 11px 13px; color: var(--ink); background: var(--white); border: 1px solid var(--line-dark); border-radius: 7px; box-shadow: 0 1px 0 rgba(23,51,49,.03); transition: border-color .16s ease, box-shadow .16s ease; }
.field textarea { min-height: 90px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #9ba9a4; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(63,127,104,.12); outline: 0; }
.field--error input, .field--error select, .field--error textarea { border-color: var(--red); }
.field-help, .field-error { margin-top: 6px; font-size: 12px; }
.field-help { color: var(--ink-soft); }
.field-error { color: var(--red); font-weight: 650; }
.field-pair { display: grid; gap: 0; }
.phone-input { display: flex; border: 1px solid var(--line-dark); border-radius: 7px; overflow: hidden; background: var(--white); }
.phone-input:focus-within { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(63,127,104,.12); }
.phone-input > span { display: flex; align-items: center; padding: 0 12px; color: var(--ink-soft); background: #f2f1eb; border-right: 1px solid var(--line); font-weight: 700; }
.phone-input input { border: 0; border-radius: 0; box-shadow: none; }
.phone-input input:focus { box-shadow: none; }
.child-row + .child-row { margin-top: 20px; padding-top: 23px; border-top: 1px dashed var(--line-dark); }
.child-row--new { animation: child-in .28s ease both; }
.child-row__heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.child-row__heading h3 { margin: 0; color: var(--ink-soft); font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.child-row__heading .text-button { font-size: 12px; }
.add-child { min-height: 44px; display: flex; align-items: center; gap: 9px; padding: 8px 0; color: var(--forest); background: none; border: 0; font-weight: 750; cursor: pointer; }
.add-child span { display: grid; width: 26px; height: 26px; place-items: center; border: 1px solid var(--green); border-radius: 50%; font-size: 18px; }
.consents { display: grid; gap: 14px; margin: -2px 0 24px; padding: 20px 0 4px; border-top: 1px solid var(--line); }
.check-row { position: relative; display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: flex-start; color: var(--ink-soft); font-size: 13px; cursor: pointer; }
.check-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.custom-check { display: grid; width: 22px; height: 22px; place-items: center; background: var(--white); border: 1px solid #9ca9a4; border-radius: 5px; }
.check-row input:checked + .custom-check { background: var(--forest); border-color: var(--forest); }
.check-row input:checked + .custom-check::after { content: "✓"; color: var(--white); font-size: 13px; font-weight: 800; }
.check-row input:focus-visible + .custom-check { outline: 3px solid rgba(238,96,60,.25); outline-offset: 2px; }
.check-row a { color: var(--forest); font-weight: 700; }
.check-row--error { color: var(--red); }
.privacy-layer { margin: 2px 0 0 34px; color: var(--ink-soft); font-size: 12px; }
.privacy-layer summary { color: var(--forest); font-weight: 700; cursor: pointer; }
.privacy-layer p { margin: 8px 0 0; padding: 10px 12px; background: #f4f3ee; border-left: 2px solid var(--line-dark); }
.lead-submit { min-height: 57px; font-size: 16px; }
.lead-submit span:last-child { font-size: 21px; }
.submit-note { display: flex; justify-content: center; align-items: center; gap: 7px; margin: 11px 0 0; color: var(--ink-soft); font-size: 11px; text-align: center; }
.submit-note span { color: var(--green); font-size: 7px; }

/* Parent completion and simple public pages */
.completion-page, .simple-public-page { min-height: 100svh; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom)); background: var(--cream); overflow: hidden; }
.completion-page { position: relative; }
.completion-card, .simple-public-card { position: relative; z-index: 1; width: min(100%, 570px); padding: 29px 24px; text-align: center; background: var(--paper); border: 1px solid rgba(23,63,58,.1); box-shadow: var(--shadow); }
.completion-card { animation: rise .5s ease both; }
.completion-card .brand, .simple-public-card .brand { margin-bottom: 35px; }
.success-mark { width: 68px; margin: 0 auto 22px; color: var(--green); }
.success-mark circle { fill: #e6f2e9; stroke: var(--green); stroke-width: 1.5; }
.success-mark path { fill: none; stroke: var(--green); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; animation: draw .55s .25s ease both; }
.completion-card h1, .simple-public-card h1 { margin-bottom: 11px; font-size: clamp(37px, 10vw, 52px); line-height: 1; }
.completion-lead, .simple-public-card > p:not(.eyebrow) { color: var(--ink-soft); }
.next-step { display: grid; grid-template-columns: 33px 1fr; gap: 12px; align-items: start; margin: 25px 0 18px; padding: 15px; text-align: left; background: #f1f4ed; border-left: 3px solid var(--green); }
.next-step__number { display: grid; width: 29px; height: 29px; place-items: center; color: var(--white); background: var(--forest); border-radius: 50%; font-weight: 800; }
.next-step p { margin: 2px 0 0; font-size: 14px; }
.completion-footnote { margin: 15px auto 0; color: var(--ink-soft); font-size: 13px; }
.receipt-code { margin: 14px 0 0; color: var(--ink-soft); font-size: 12px; letter-spacing: .04em; }
.whatsapp-reminder { display: flex; gap: 10px; margin-top: 23px; padding-top: 17px; color: var(--ink-soft); border-top: 1px solid var(--line); text-align: left; font-size: 12px; }
.whatsapp-reminder > span { display: grid; width: 20px; height: 20px; flex: 0 0 20px; place-items: center; border: 1px solid var(--line-dark); border-radius: 50%; font-weight: 800; }
.whatsapp-reminder p { margin: 0; }
.whatsapp-reminder form { margin-top: 10px; }
.completion-art span, .completion-art i { position: absolute; border-radius: 50%; opacity: .85; }
.completion-art span { width: 320px; height: 320px; right: -180px; top: -160px; background: var(--yellow); }
.completion-art i:nth-child(2) { width: 160px; height: 160px; left: -80px; bottom: -55px; background: #83b7a1; }
.completion-art i:nth-child(3) { width: 18px; height: 18px; left: 8%; top: 15%; background: var(--orange); }
.completion-art i:nth-child(4) { width: 11px; height: 11px; right: 9%; bottom: 16%; background: var(--forest); }
.simple-public-card { padding-block: 34px; }
.simple-public-card--wide { width: min(100%, 620px); }
.simple-public-card .button { margin-top: 15px; }
.simple-public-card .quiet-link { display: inline-block; margin-top: 22px; }
.illustration-clock, .error-mark, .pending-mark { width: 74px; height: 74px; display: grid; margin: 0 auto 24px; place-items: center; background: #fae5d9; border-radius: 50%; }
.illustration-clock i { position: relative; width: 34px; height: 34px; border: 2px solid var(--orange); border-radius: 50%; }
.illustration-clock i::before, .illustration-clock i::after { position: absolute; left: 15px; top: 6px; width: 2px; height: 11px; content: ""; background: var(--orange); transform-origin: bottom; }
.illustration-clock i::after { transform: rotate(120deg); }
.error-mark { color: var(--red); background: #fae7e4; font-family: var(--font-display); font-size: 42px; }
.pending-mark { position: relative; background: #e7f0e5; }
.pending-mark span { width: 28px; height: 35px; border: 2px solid var(--green); border-radius: 4px; }
.pending-mark i { position: absolute; right: 19px; bottom: 18px; width: 17px; height: 17px; background: var(--yellow); border: 2px solid var(--paper); border-radius: 50%; }
.pending-steps { display: grid; gap: 0; margin: 28px 0 12px; text-align: left; }
.pending-step { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 12px; min-height: 63px; color: #89938f; }
.pending-step::before { position: absolute; left: 16px; top: 34px; bottom: 0; width: 1px; content: ""; background: var(--line); }
.pending-step:last-child::before { display: none; }
.pending-step > span { z-index: 1; display: grid; width: 33px; height: 33px; place-items: center; background: #eaebe6; border-radius: 50%; font-size: 12px; font-weight: 800; }
.pending-step p { display: flex; flex-direction: column; margin: 2px 0 0; }
.pending-step small { font-size: 11px; }
.pending-step--done, .pending-step--active { color: var(--forest); }
.pending-step--done > span { color: var(--white); background: var(--green); }
.pending-step--active > span { color: var(--forest); background: var(--yellow); }

/* Auth */
.auth-page { min-height: 100svh; display: grid; background: var(--paper); }
.auth-aside { position: relative; min-height: 230px; display: flex; align-items: end; padding: 28px 24px; color: var(--white); background: var(--forest-deep) url("/static/img/classroom-hero.webp") 63% center / cover no-repeat; isolation: isolate; }
.auth-aside::after { position: absolute; z-index: -1; inset: 0; content: ""; background: rgba(12,43,39,.68); }
.auth-aside > div { max-width: 560px; }
.auth-aside p { margin-bottom: 8px; color: #ffd15b; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.auth-aside h2 { margin: 0; font-family: var(--font-display); font-size: clamp(29px, 7vw, 50px); font-weight: 500; }
.auth-panel { display: grid; align-items: center; padding: 35px 22px; }
.auth-card { width: min(100%, 460px); margin: auto; }
.auth-card > .brand { margin-bottom: 50px; }
.auth-heading { margin-bottom: 27px; }
.auth-heading h1 { margin-bottom: 10px; font-size: 42px; line-height: 1; }
.auth-heading > p:last-child { color: var(--ink-soft); }
.auth-form .button { margin-top: 4px; }
.auth-switch { margin: 25px 0 0; color: var(--ink-soft); text-align: center; font-size: 14px; }
.auth-switch a { color: var(--forest); font-weight: 800; }
.security-note { display: flex; justify-content: center; gap: 7px; margin: 30px 0 0; color: #758480; font-size: 11px; text-align: center; }
.mail-mark { width: 66px; height: 51px; display: grid; margin: 0 auto 25px; place-items: center; color: var(--orange); background: #fff0e8; border: 2px solid var(--orange); border-radius: 5px; }
.mail-mark::before, .mail-mark::after { position: absolute; width: 39px; height: 2px; content: ""; background: var(--orange); transform: translate(-9px, -5px) rotate(34deg); transform-origin: left; }
.mail-mark::after { transform: translate(9px, -5px) rotate(-34deg); transform-origin: right; }
.mail-mark span { z-index: 1; display: grid; width: 22px; height: 22px; place-items: center; background: #fff0e8; }
.auth-card--center { text-align: center; }
.auth-card--center .brand { justify-content: center; }
.code-input { width: 100%; min-height: 68px; padding: 10px; color: var(--forest); background: var(--white); border: 1px solid var(--line-dark); border-radius: 8px; font-size: 34px; font-weight: 750; letter-spacing: .34em; text-align: center; }
.resend-form { margin-top: 20px; text-align: center; }

/* Privacy / legal */
.legal-page { min-height: 100vh; background: var(--paper); }
.legal-header { max-width: 850px; display: flex; align-items: center; justify-content: space-between; margin: 0 auto; padding: 24px 22px; border-bottom: 1px solid var(--line); }
.legal-copy { max-width: 730px; margin: 0 auto; padding: 55px 22px 80px; }
.legal-copy h1 { margin-bottom: 18px; font-size: clamp(42px, 9vw, 62px); line-height: 1; }
.legal-intro { margin-bottom: 46px; color: var(--ink-soft); font-size: 19px; }
.legal-copy h2 { margin: 32px 0 9px; color: var(--forest); font-size: 20px; }
.legal-copy p:not(.eyebrow):not(.legal-intro) { color: var(--ink-soft); }
.legal-document { color: var(--ink-soft); white-space: pre-line; line-height: 1.65; }
.legal-version { margin-top: 45px; padding-top: 17px; border-top: 1px solid var(--line); font-size: 12px; }

@keyframes hero-settle { from { opacity: .3; transform: scale(1.06); } to { opacity: 1; transform: scale(1.01); } }
@keyframes rise { from { opacity: 0; transform: translateY(13px); } to { opacity: 1; transform: none; } }
@keyframes child-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes draw { from { stroke-dashoffset: 30; } to { stroke-dashoffset: 0; } }

@media (min-width: 720px) {
  .field-pair { grid-template-columns: 1fr 1.45fr; gap: 14px; }
  .completion-card, .simple-public-card { padding: 40px 46px; }
  .parent-hero__content { padding-inline: 7vw; }
  .lead-panel__inner { padding: 55px 35px 70px; }
}

@media (min-width: 980px) {
  .parent-page { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(480px, .92fr); }
  .parent-hero { position: sticky; top: 0; min-height: 100vh; height: 100vh; }
  .parent-hero__shade { background: rgba(10,36,31,.42); }
  .parent-hero__content { padding: 38px 5vw 47px; }
  .parent-hero__copy { padding-top: 180px; }
  .trust-list { font-size: 13px; }
  .lead-panel { min-height: 100vh; display: flex; }
  .lead-panel__inner { width: 100%; align-self: center; padding: 65px clamp(45px, 6vw, 90px); }
  .auth-page { grid-template-columns: minmax(430px, 1.1fr) minmax(480px, .9fr); }
  .auth-aside { min-height: 100vh; padding: 60px 6vw; }
  .auth-panel { min-height: 100vh; padding: 50px 7vw; }
  .auth-panel--scroll { align-items: start; overflow-y: auto; }
  .auth-panel--scroll .auth-card { padding-block: 20px 50px; }
  .auth-page--single { grid-template-columns: 1fr; }
  .auth-page--single .auth-panel { padding: 45px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Authenticated shell */
.app-body { min-height: 100vh; background: #f3f1eb; }
.app-header { position: sticky; z-index: 50; top: 0; color: var(--forest); background: rgba(255,253,249,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.app-header__inner { max-width: 1240px; min-height: 66px; display: flex; align-items: center; justify-content: space-between; margin: 0 auto; padding: 10px 18px; }
.nav-toggle { width: 44px; height: 44px; display: grid; place-content: center; gap: 5px; background: none; border: 0; cursor: pointer; }
.nav-toggle i { width: 23px; height: 2px; display: block; background: var(--forest); transition: transform .18s ease, opacity .18s ease; }
.nav-toggle[aria-expanded="true"] i:first-of-type { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] i:nth-of-type(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] i:last-of-type { transform: translateY(-7px) rotate(-45deg); }
.app-nav { position: absolute; top: 66px; right: 0; left: 0; display: none; padding: 8px 18px 18px; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-soft); }
.app-nav.is-open { display: grid; }
.app-nav a, .nav-logout button { min-height: 44px; display: flex; align-items: center; gap: 7px; padding: 7px 10px; color: var(--ink-soft); background: none; border: 0; border-radius: 5px; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; }
.app-nav a:hover, .app-nav a[aria-current="page"], .nav-logout button:hover { color: var(--forest); background: #edeee8; }
.nav-count { min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; color: var(--white); background: var(--orange); border-radius: 10px; font-size: 10px; }
.nav-logout { margin: 5px 0 0; padding-top: 5px; border-top: 1px solid var(--line); }
.app-main { width: min(100%, 1240px); min-height: calc(100vh - 122px); margin: 0 auto; padding: 28px 18px 55px; }
.app-footer { max-width: 1240px; display: flex; justify-content: space-between; margin: 0 auto; padding: 22px 18px; color: #74817d; border-top: 1px solid var(--line); font-size: 11px; }
.app-footer a { text-underline-offset: 3px; }
.page-back { margin-bottom: 22px; }
.page-back a { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 13px; font-weight: 750; text-decoration: none; }
.page-back a:hover { color: var(--forest); }
.page-heading { margin-bottom: 30px; }
.page-heading h1 { margin-bottom: 8px; font-size: clamp(39px, 7vw, 59px); line-height: .98; }
.page-heading > p:last-child, .page-heading > div > p:last-child { color: var(--ink-soft); }
.page-heading__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.heading-status { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.heading-total { display: flex; flex-direction: column; margin-top: 8px; color: var(--forest); font-family: var(--font-display); font-size: 38px; font-weight: 500; line-height: 1; }
.heading-total small { margin-top: 7px; color: var(--ink-soft); font-family: var(--font-sans); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.badge { width: max-content; display: inline-flex; align-items: center; min-height: 25px; padding: 4px 8px; color: #53605d; background: #e8e9e4; border-radius: 4px; font-size: 10px; font-weight: 800; letter-spacing: .03em; line-height: 1.15; text-transform: uppercase; }
.badge--positive { color: #285c49; background: #dfeee3; }
.badge--warning { color: #805b11; background: #fbefc8; }
.badge--negative { color: #8e3430; background: #f6e0dc; }
.empty-state { max-width: 520px; margin: 0 auto; padding: 42px 20px; text-align: center; }
.empty-state__mark { width: 44px; height: 44px; display: grid; margin: 0 auto 15px; place-items: center; color: var(--forest); background: #e5ece4; border-radius: 50%; font-size: 35px; }
.empty-state h3 { margin-bottom: 7px; font-size: 19px; }
.empty-state p { margin: 0 auto 18px; color: var(--ink-soft); font-size: 14px; }

/* Teacher dashboard */
.teacher-main { max-width: 1040px; }
.teacher-hero { padding: 9px 0 38px; }
.teacher-hero__welcome h1 { margin-bottom: 25px; font-size: clamp(46px, 11vw, 74px); line-height: .94; }
.promo-ribbon { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-bottom: 25px; padding: 13px 14px; color: var(--forest-deep); background: #f8d979; border: 1px solid #e7bd3f; border-radius: 8px; text-decoration: none; }
.promo-ribbon--muted { grid-template-columns: 1fr; color: var(--ink-soft); background: #e8e9e4; border-color: var(--line-dark); }
.promo-ribbon__pulse { width: 9px; height: 9px; background: var(--orange); border-radius: 50%; box-shadow: 0 0 0 5px rgba(238,96,60,.13); }
.promo-ribbon > span:nth-child(2) { display: flex; min-width: 0; flex-direction: column; }
.promo-ribbon strong { font-size: 13px; }
.promo-ribbon small { color: rgba(16,47,44,.68); font-size: 11px; }
.promo-countdown { font-size: 11px; font-weight: 800; text-align: right; }
.earning-focus { color: var(--white); background: var(--forest); box-shadow: var(--shadow); }
.earning-focus__main { padding: 29px 24px 25px; }
.earning-focus__main p { margin-bottom: 7px; color: rgba(255,255,255,.72); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.earning-focus__main > strong { display: block; font-family: var(--font-display); font-size: clamp(51px, 15vw, 77px); font-weight: 500; letter-spacing: -.05em; line-height: 1; }
.earning-focus__main small { color: rgba(255,255,255,.65); font-size: 11px; }
.earning-focus__breakdown { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(255,255,255,.15); }
.earning-focus__breakdown > div { min-width: 0; padding: 16px 10px; text-align: center; }
.earning-focus__breakdown > div + div { border-left: 1px solid rgba(255,255,255,.15); }
.earning-focus__breakdown span { display: block; margin-bottom: 4px; color: rgba(255,255,255,.67); font-size: 9px; line-height: 1.2; text-transform: uppercase; }
.earning-focus__breakdown strong { font-size: clamp(14px, 4vw, 19px); }
.share-actions { display: grid; grid-template-columns: 1.35fr 1fr; gap: 9px; margin-top: 14px; }
.button-icon--qr { width: 17px; height: 17px; border: 3px dotted currentColor; outline: 1px solid currentColor; outline-offset: -1px; }
.action-callout { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; margin-bottom: 28px; padding: 17px; background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--green); }
.action-callout--urgent { border-left-color: var(--orange); }
.action-callout__icon { width: 32px; height: 32px; display: grid; place-items: center; color: var(--white); background: var(--green); border-radius: 50%; font-weight: 800; }
.action-callout--urgent .action-callout__icon { background: var(--orange); }
.action-callout h2 { margin: 1px 0 5px; font-size: 17px; }
.action-callout p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.action-callout .button, .action-callout form { grid-column: 2; }
.section-block { margin: 0 0 26px; padding: 26px 20px; background: var(--paper); border: 1px solid var(--line); }
.section-heading { margin-bottom: 25px; }
.section-heading h2 { margin-bottom: 0; font-size: 25px; }
.section-heading > p { max-width: 480px; margin: 9px 0 0; color: var(--ink-soft); font-size: 12px; }
.vesting-list { display: grid; }
.vesting-row { display: grid; grid-template-columns: 47px 16px minmax(0,1fr) auto; gap: 8px; align-items: center; min-height: 77px; }
.vesting-row__date { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.vesting-row__date strong { font-family: var(--font-display); font-size: 24px; }
.vesting-row__date span { margin-top: 3px; color: var(--ink-soft); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.vesting-row__line { align-self: stretch; display: flex; justify-content: center; }
.vesting-row__line::before { width: 1px; content: ""; background: var(--line); }
.vesting-row:first-child .vesting-row__line::before { margin-top: 50%; }
.vesting-row:last-child .vesting-row__line::before { margin-bottom: 50%; }
.vesting-row__line i { position: absolute; align-self: center; width: 10px; height: 10px; background: var(--paper); border: 2px solid var(--line-dark); border-radius: 50%; }
.vesting-row__line i.is-done { background: var(--green); border-color: var(--green); }
.vesting-row__body { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.vesting-row__body > div { min-width: 0; display: flex; flex-direction: column; }
.vesting-row__body strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.vesting-row__body span { color: var(--ink-soft); font-size: 11px; }
.vesting-row__amount { font-size: 13px; white-space: nowrap; }
.referral-list { display: grid; }
.referral-item { display: grid; grid-template-columns: 39px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.referral-item:last-child { border-bottom: 0; }
.referral-avatar, .entity-avatar, .family-mark { display: grid; place-items: center; color: var(--forest); background: #dfe9df; border-radius: 50%; font-family: var(--font-display); font-size: 17px; }
.referral-avatar { width: 39px; height: 39px; }
.referral-item__body { min-width: 0; display: flex; flex-direction: column; }
.referral-item__body strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.referral-item__body span { color: var(--ink-soft); font-size: 10px; }
.referral-item__status { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.referral-item__status small { color: var(--ink-soft); font-size: 9px; }
.referral-item__amount { grid-column: 2 / -1; color: var(--forest); font-size: 13px; }
.referral-item__amount small { margin-left: 3px; color: var(--ink-soft); font-size: 9px; font-weight: 500; }
.terms-reminder { display: flex; flex-direction: column; gap: 13px; padding: 19px 20px; color: var(--ink-soft); background: #e8ebe3; font-size: 12px; }
.terms-reminder > div { display: flex; gap: 11px; }
.terms-reminder > div > span { font-family: var(--font-display); font-size: 24px; }
.terms-reminder p { margin: 0; }
.terms-reminder a { color: var(--forest); font-weight: 800; }
.receipt-section { display: grid; gap: 18px; margin-bottom: 26px; padding: 22px 20px; color: var(--white); background: var(--forest); }
.receipt-section .eyebrow { color: #f8d979; }
.receipt-section h2 { margin-bottom: 6px; }
.receipt-section > div:first-child > p:last-child { margin: 0; color: rgba(255,255,255,.7); font-size: 12px; }
.receipt-list { display: grid; gap: 8px; }
.receipt-row { display: grid; gap: 12px; padding: 13px; color: var(--ink); background: var(--paper); }
.receipt-row > span { display: flex; flex-direction: column; }
.receipt-row > span strong { font-family: var(--font-display); font-size: 24px; font-weight: 500; }
.receipt-row > span small { color: var(--ink-soft); font-size: 10px; }

/* Teacher QR */
.qr-main { max-width: 980px; }
.qr-layout { display: grid; gap: 28px; }
.qr-copy h1 { margin-bottom: 17px; font-size: clamp(48px, 12vw, 74px); line-height: .94; }
.qr-copy > p:not(.eyebrow) { max-width: 530px; color: var(--ink-soft); }
.qr-promo { display: grid; width: max-content; max-width: 100%; margin-top: 22px; padding: 11px 14px; background: #f8d979; border-left: 3px solid var(--orange); }
.qr-promo span, .qr-promo small { font-size: 10px; text-transform: uppercase; }
.qr-promo strong { font-size: 14px; }
.qr-stage { display: grid; place-items: center; }
.qr-sheet { width: min(100%, 410px); padding: 25px 25px 28px; color: var(--forest); background: var(--white); box-shadow: var(--shadow); text-align: center; }
.qr-sheet__top { display: flex; align-items: center; justify-content: center; gap: 9px; margin-bottom: 20px; }
.qr-sheet__top .brand__sun { width: 29px; height: 29px; flex-basis: 29px; }
.qr-sheet__top p { display: flex; flex-direction: column; margin: 0; text-align: left; line-height: 1; }
.qr-sheet__top small { margin-top: 3px; color: var(--ink-soft); font-size: 8px; letter-spacing: .14em; text-transform: uppercase; }
.qr-frame { width: 100%; aspect-ratio: 1; display: grid; place-items: center; padding: 15px; background: var(--white); border: 1px solid var(--line); }
.qr-frame img, .qr-frame svg { width: 100%; height: 100%; }
.qr-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--ink-soft); background: #edf0ea; border: 10px solid #f6f6f2; font-size: 44px; font-weight: 900; }
.qr-sheet__name { margin: 20px 0 2px; font-size: 14px; }
.qr-sheet__instruction { margin: 0; color: var(--ink-soft); font-size: 11px; }
.qr-actions { display: grid; gap: 9px; margin-top: 25px; }
.qr-actions .text-button { min-height: 42px; }
.qr-tip { display: flex; gap: 10px; margin-top: 25px; padding: 15px; color: var(--ink-soft); background: #e5ebe2; font-size: 12px; }
.qr-tip span { color: var(--orange); }
.qr-tip p { margin: 0; }
.inline-warning { margin: 12px 0 0; color: var(--red); font-size: 12px; }

/* Promotion terms */
.terms-main { max-width: 930px; }
.terms-document { background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-soft); }
.terms-header { padding: 31px 22px 26px; color: var(--white); background: var(--forest); }
.terms-header .eyebrow { color: #f8d979; }
.terms-header h1 { margin-bottom: 12px; font-size: clamp(42px, 9vw, 64px); line-height: .95; }
.terms-header > p:not(.eyebrow) { max-width: 660px; color: rgba(255,255,255,.75); }
.terms-facts { display: grid; grid-template-columns: 1fr 1fr; margin: 28px 0 0; border-top: 1px solid rgba(255,255,255,.18); border-left: 1px solid rgba(255,255,255,.18); }
.terms-facts > div { padding: 12px; border-right: 1px solid rgba(255,255,255,.18); border-bottom: 1px solid rgba(255,255,255,.18); }
.terms-facts dt { color: rgba(255,255,255,.55); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.terms-facts dd { margin: 3px 0 0; font-size: 12px; font-weight: 750; }
.terms-body { padding: 8px 22px 20px; }
.terms-body > section { display: grid; grid-template-columns: 35px 1fr; gap: 12px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.terms-body > section:last-child { border-bottom: 0; }
.terms-number { color: var(--orange); font-family: var(--font-display); font-size: 18px; }
.terms-body h2 { margin-bottom: 11px; color: var(--forest); font-size: 21px; }
.terms-body p, .terms-body li { color: var(--ink-soft); font-size: 14px; }
.terms-body p:last-child { margin-bottom: 0; }
.terms-body ul { margin: 12px 0 0; padding-left: 19px; }
.terms-body li + li { margin-top: 7px; }
.terms-highlight { position: relative; margin-inline: -22px; padding-inline: 22px !important; background: #fbefc8; border-bottom: 0 !important; }
.terms-highlight + section { border-top: 1px solid var(--line); }
.tranche-example { display: grid; grid-template-columns: repeat(auto-fit,minmax(100px,1fr)); gap: 1px; margin: 18px 0; padding: 1px; background: var(--line); list-style: none; }
.tranche-example li { display: flex; flex-direction: column; padding: 12px 8px; color: var(--forest); background: var(--paper); text-align: center; }
.tranche-example strong { margin: 2px 0; font-family: var(--font-display); font-size: 28px; }
.tranche-example small { color: var(--ink-soft); font-size: 8px; line-height: 1.3; }
.terms-legal { color: var(--white); margin: 0 -22px -20px; padding-inline: 22px !important; background: var(--forest-deep); }
.terms-legal h2, .terms-legal p, .terms-legal .terms-number { color: inherit; }
.terms-legal p { opacity: .75; }
.terms-footer { padding: 22px; background: #eeeee8; border-top: 1px solid var(--line); }
.terms-accept { display: grid; gap: 15px; }
.terms-accept .button { margin-top: 5px; }
.accepted-stamp { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; color: var(--green); }
.accepted-stamp > span { display: grid; width: 38px; height: 38px; place-items: center; color: var(--white); background: var(--green); border-radius: 50%; }
.accepted-stamp p { display: flex; flex-direction: column; margin: 0; }
.accepted-stamp small { color: var(--ink-soft); }
.frozen-terms { padding: 30px 22px; background: #f1f0ea; border-top: 1px solid var(--line); }
.frozen-terms h2 { margin-bottom: 7px; color: var(--forest); }
.frozen-terms > div > p:last-child { color: var(--ink-soft); font-size: 12px; }
.frozen-terms pre { max-height: 520px; margin: 20px 0 0; padding: 18px; overflow: auto; color: var(--ink); background: var(--paper); border: 1px solid var(--line); font: 12px/1.7 var(--font-sans); white-space: pre-wrap; }

@media (min-width: 720px) {
  .app-main { padding: 38px 28px 70px; }
  .teacher-hero { padding-top: 18px; }
  .earning-focus { display: grid; grid-template-columns: 1.15fr 1fr; }
  .earning-focus__breakdown { border-top: 0; border-left: 1px solid rgba(255,255,255,.15); }
  .share-actions { width: max-content; min-width: 420px; }
  .section-block { padding: 31px; }
  .section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
  .section-heading > p { margin: 0; text-align: right; }
  .vesting-row { grid-template-columns: 55px 20px minmax(0,1fr) 100px; gap: 13px; }
  .vesting-row__body { flex-direction: row; align-items: center; justify-content: space-between; gap: 15px; }
  .referral-item { grid-template-columns: 45px minmax(150px,1fr) 190px 110px; }
  .referral-item__amount { grid-column: auto; text-align: right; }
  .terms-reminder { flex-direction: row; align-items: center; justify-content: space-between; }
  .terms-reminder > div { max-width: 700px; }
  .qr-actions { grid-template-columns: 1.2fr 1fr .8fr; }
  .terms-header { padding: 45px 50px 37px; }
  .terms-body { padding: 10px 50px 30px; }
  .terms-body > section { grid-template-columns: 49px 1fr; padding-block: 34px; }
  .terms-highlight { margin-inline: -50px; padding-inline: 50px !important; }
  .terms-legal { margin: 0 -50px -30px; padding-inline: 50px !important; }
  .terms-footer { padding: 30px 50px; }
  .receipt-section { grid-template-columns: .8fr 1.2fr; align-items: start; padding: 27px 30px; }
  .receipt-row { grid-template-columns: 1fr auto; align-items: center; }
  .frozen-terms { padding: 38px 50px; }
}

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .app-nav { position: static; display: flex; align-items: center; padding: 0; background: none; border: 0; box-shadow: none; }
  .app-nav a, .nav-logout button { min-height: 38px; padding-inline: 10px; font-size: 12px; }
  .nav-logout { margin: 0 0 0 5px; padding: 0 0 0 5px; border-top: 0; border-left: 1px solid var(--line); }
  .app-header__inner { padding-inline: 28px; }
  .qr-layout { grid-template-columns: .9fr 1.1fr; gap: 60px; align-items: center; padding: 12px 20px; }
  .qr-actions { max-width: 520px; margin-left: auto; }
  .qr-tip { width: 520px; margin-left: auto; }
}

/* Admin utility surfaces */
.admin-main { max-width: 1200px; }
.summary-chip { width: max-content; display: flex; align-items: center; gap: 10px; padding: 9px 12px; color: var(--forest); background: #e5ece4; border-left: 3px solid var(--green); }
.summary-chip strong { font-family: var(--font-display); font-size: 28px; line-height: 1; }
.summary-chip span { max-width: 90px; font-size: 10px; font-weight: 800; line-height: 1.2; text-transform: uppercase; }
.review-banner { display: grid; grid-template-columns: 43px 1fr auto; gap: 13px; align-items: center; margin-bottom: 22px; padding: 15px; color: var(--forest-deep); background: #fae7b1; border: 1px solid #eac859; text-decoration: none; }
.review-banner__count { display: grid; width: 43px; height: 43px; place-items: center; color: var(--white); background: var(--orange); border-radius: 50%; font-family: var(--font-display); font-size: 22px; }
.review-banner > span:nth-child(2) { display: flex; flex-direction: column; }
.review-banner small { color: rgba(16,47,44,.7); font-size: 11px; }
.review-banner > span:last-child { font-size: 22px; }
.admin-kpis { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 22px; background: var(--line); border: 1px solid var(--line); gap: 1px; }
.admin-kpi { min-width: 0; display: flex; flex-direction: column; padding: 18px 15px; background: var(--paper); }
.admin-kpi--lead { background: var(--forest); color: var(--white); }
.admin-kpi span { color: var(--ink-soft); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.admin-kpi--lead span, .admin-kpi--lead small { color: rgba(255,255,255,.7); }
.admin-kpi strong { margin: 5px 0 2px; overflow: hidden; font-family: var(--font-display); font-size: clamp(25px, 7vw, 38px); font-weight: 500; line-height: 1; text-overflow: ellipsis; }
.admin-kpi small { color: var(--ink-soft); font-size: 9px; }
.admin-grid { display: grid; gap: 20px; margin-bottom: 22px; }
.admin-panel { min-width: 0; padding: 22px 18px; background: var(--paper); border: 1px solid var(--line); }
.admin-panel--flush { padding: 0; margin-bottom: 22px; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 15px; margin-bottom: 22px; }
.panel-heading--padded { padding: 20px 18px 0; }
.panel-heading .eyebrow { margin-bottom: 6px; }
.panel-heading h2 { margin: 0; font-size: 22px; }
.panel-heading > a { color: var(--forest); font-size: 12px; font-weight: 800; }
.panel-period { color: var(--ink-soft); font-size: 10px; }
.funnel-list { display: grid; gap: 14px; }
.funnel-row { display: grid; grid-template-columns: 91px minmax(60px,1fr) 32px; gap: 9px; align-items: center; font-size: 11px; }
.funnel-row > span { color: var(--ink-soft); }
.funnel-row > strong { text-align: right; }
.funnel-track { width: 100%; height: 9px; overflow: hidden; appearance: none; background: #e7e9e3; border: 0; }
.funnel-track::-webkit-progress-bar { background: #e7e9e3; }
.funnel-track::-webkit-progress-value { background: var(--orange); }
.funnel-track::-moz-progress-bar { background: var(--orange); }
.promotion-snapshot > h3 { margin-bottom: 7px; font-family: var(--font-display); font-size: 27px; font-weight: 500; }
.promotion-snapshot > p { color: var(--ink-soft); font-size: 13px; }
.promotion-snapshot dl { display: grid; margin: 18px 0; border-top: 1px solid var(--line); }
.promotion-snapshot dl > div { display: flex; justify-content: space-between; gap: 20px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.promotion-snapshot dt { color: var(--ink-soft); }
.promotion-snapshot dd { font-weight: 800; text-align: right; }
.promotion-snapshot > a { color: var(--forest); font-size: 12px; font-weight: 800; }
.data-table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { padding: 10px 14px; color: var(--ink-soft); background: #eeeee8; font-size: 9px; letter-spacing: .07em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td strong, .data-table td small { display: block; }
.data-table td small { margin-top: 2px; color: var(--ink-soft); font-size: 9px; }
.align-right { text-align: right !important; }
.row-arrow { width: 32px; height: 32px; display: grid; place-items: center; margin-left: auto; color: var(--forest); background: #e9ece6; border-radius: 50%; font-size: 17px; text-decoration: none; }
.filter-bar { display: grid; gap: 9px; margin-bottom: 18px; padding: 13px; background: var(--paper); border: 1px solid var(--line); }
.search-field { position: relative; min-width: 0; }
.search-field input { padding-right: 38px; }
.search-field > span:last-child { position: absolute; right: 13px; top: 50%; color: var(--ink-soft); font-size: 20px; transform: translateY(-50%); }
.filter-bar select { min-height: 45px; }
.entity-list { background: var(--paper); border: 1px solid var(--line); }
.entity-row { position: relative; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 15px; border-bottom: 1px solid var(--line); }
.entity-row:last-child { border-bottom: 0; }
.entity-avatar { width: 42px; height: 42px; }
.entity-avatar--large { width: 62px; height: 62px; font-size: 24px; }
.entity-row__identity, .entity-row__meta, .entity-row__earnings { min-width: 0; display: flex; flex-direction: column; }
.entity-row__identity a { overflow: hidden; font-size: 13px; font-weight: 800; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.entity-row__identity span, .entity-row__meta, .entity-row__earnings span { color: var(--ink-soft); font-size: 10px; }
.entity-row__meta, .entity-row__contract, .entity-row__earnings { display: none; }
.entity-row__state { grid-column: 2; }
.entity-row > .row-arrow { grid-column: 3; grid-row: 1 / span 2; }
.contract-dot { width: 8px; height: 8px; flex: 0 0 8px; background: var(--orange); border-radius: 50%; }
.contract-dot.is-active { background: var(--green); }
.entity-header { display: grid; grid-template-columns: 62px minmax(0,1fr); gap: 15px; align-items: center; margin-bottom: 25px; }
.entity-header__title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.entity-header h1 { margin: 0; font-family: var(--font-display); font-size: clamp(35px, 8vw, 54px); font-weight: 500; line-height: 1; }
.entity-header p, .entity-header small { margin: 5px 0 0; color: var(--ink-soft); font-size: 11px; }
.entity-header__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.inline-metrics { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 22px; background: var(--line); border: 1px solid var(--line); gap: 1px; }
.inline-metrics > div { min-width: 0; display: flex; flex-direction: column; padding: 14px; background: var(--paper); }
.inline-metrics span { color: var(--ink-soft); font-size: 9px; text-transform: uppercase; }
.inline-metrics strong { margin-top: 3px; overflow: hidden; font-size: 18px; text-overflow: ellipsis; }
.timeline-list { display: grid; }
.timeline-item { position: relative; display: grid; grid-template-columns: 12px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); }
.timeline-item:last-child { border: 0; }
.timeline-item__dot { width: 10px; height: 10px; background: var(--line-dark); border-radius: 50%; }
.timeline-item__dot.is-active { background: var(--green); box-shadow: 0 0 0 4px rgba(63,127,104,.12); }
.timeline-item > div { display: flex; flex-direction: column; }
.timeline-item > div:nth-of-type(2) { display: none; }
.timeline-item strong { font-size: 12px; }
.timeline-item span, .timeline-item small { color: var(--ink-soft); font-size: 10px; }
.detail-list { display: grid; margin: 0 0 19px; }
.detail-list > div { display: grid; grid-template-columns: 100px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.detail-list dt { color: var(--ink-soft); }
.detail-list dd { overflow-wrap: anywhere; font-weight: 750; }
.audit-list { display: grid; }
.audit-list > div { display: grid; grid-template-columns: 96px 1fr; gap: 4px 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.audit-list > div:last-child { border: 0; }
.audit-list span { grid-row: 1 / span 2; color: var(--ink-soft); font-size: 10px; }
.audit-list strong { font-size: 12px; }
.audit-list small { color: var(--ink-soft); font-size: 10px; }

.dialog { width: min(calc(100% - 28px), 560px); max-height: calc(100svh - 40px); padding: 0; overflow-y: auto; color: var(--ink); background: var(--paper); border: 1px solid var(--line-dark); box-shadow: 0 28px 90px rgba(8,30,27,.28); }
.dialog--large { width: min(calc(100% - 28px), 760px); }
.dialog::backdrop { background: rgba(10,36,31,.62); }
.dialog > form { padding: 22px; }
.dialog__header { display: flex; align-items: start; justify-content: space-between; margin-bottom: 22px; }
.dialog__header h2 { margin: 0; font-family: var(--font-display); font-size: 29px; font-weight: 500; }
.dialog__header button { width: 40px; height: 40px; color: var(--ink-soft); background: none; border: 0; font-size: 29px; cursor: pointer; }
.dialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; padding-top: 17px; border-top: 1px solid var(--line); }
.advanced-terms { margin-top: 18px; padding: 13px; background: #f0f0ea; border: 1px solid var(--line); }
.advanced-terms summary { color: var(--forest); font-size: 12px; font-weight: 800; cursor: pointer; }
.advanced-terms .field { margin: 15px 0 0; }

/* Promotions */
.active-promotion-banner { display: grid; gap: 20px; margin-bottom: 22px; padding: 23px 20px; color: var(--white); background: var(--forest); }
.live-dot { width: max-content; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; color: #ffd15b; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.live-dot::before { width: 7px; height: 7px; content: ""; background: #ffd15b; border-radius: 50%; }
.active-promotion-banner h2 { margin-bottom: 7px; font-family: var(--font-display); font-size: 30px; font-weight: 500; }
.active-promotion-banner p { margin: 0; color: rgba(255,255,255,.68); font-size: 13px; }
.active-promotion-banner dl { display: grid; grid-template-columns: repeat(3,1fr); margin: 0; border-left: 1px solid rgba(255,255,255,.15); }
.active-promotion-banner dl > div { padding: 8px 12px; border-right: 1px solid rgba(255,255,255,.15); }
.active-promotion-banner dt { color: rgba(255,255,255,.55); font-size: 8px; text-transform: uppercase; }
.active-promotion-banner dd { margin-top: 3px; font-size: 11px; font-weight: 800; }
.immutability-note { display: flex; gap: 14px; margin: 22px 0; padding: 18px; color: var(--ink-soft); background: #e6ebe3; border-left: 3px solid var(--green); font-size: 12px; }
.immutability-note > span { color: var(--green); font-size: 23px; }
.immutability-note strong { display: block; margin-bottom: 3px; color: var(--forest); }
.immutability-note p { margin: 0; }
.promotion-editor { background: var(--paper); border: 1px solid var(--line); }
.promotion-editor > fieldset { margin: 0; padding: 0; border: 0; }
.promotion-editor.is-readonly { color: var(--ink-soft); }
.editor-section { display: grid; gap: 22px; padding: 25px 20px; border-bottom: 1px solid var(--line); }
.editor-section__intro h2 { margin-bottom: 7px; font-size: 22px; }
.editor-section__intro > p:last-child { color: var(--ink-soft); font-size: 12px; }
.editor-section__fields { min-width: 0; }
.input-suffix { display: flex; overflow: hidden; background: var(--white); border: 1px solid var(--line-dark); border-radius: 7px; }
.input-suffix input { min-width: 0; flex: 1; border: 0; border-radius: 0; box-shadow: none; }
.input-suffix span { display: flex; align-items: center; padding: 0 11px; color: var(--ink-soft); background: #eeeee8; border-left: 1px solid var(--line); font-size: 12px; font-weight: 700; }
.field-group-title { margin: 9px 0 13px; font-size: 13px; }
.fee-grid { display: grid; gap: 10px; }
.fee-grid > label { display: flex; flex-direction: column; }
.editor-save { position: sticky; z-index: 5; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 20px; padding: 14px 20px; background: rgba(255,253,249,.96); border-top: 1px solid var(--line); }
.editor-save p { display: none; margin: 0; color: var(--ink-soft); font-size: 11px; }

/* Referral review and detail */
.family-mark { width: 62px; height: 62px; font-size: 25px; }
.decision-block { display: grid; grid-template-columns: 45px 1fr; gap: 13px; padding: 16px; background: #eef2e9; border-left: 3px solid var(--green); }
.decision-block__mark { display: grid; width: 39px; height: 39px; place-items: center; color: var(--white); background: var(--green); border-radius: 50%; font-size: 20px; }
.decision-block strong { font-size: 14px; }
.decision-block p { margin: 4px 0 0; color: var(--ink-soft); font-size: 12px; }
.evidence-list { display: grid; margin-top: 17px; }
.evidence-list > div { display: grid; grid-template-columns: 90px 1fr; gap: 3px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.evidence-list span { grid-row: 1 / span 2; color: var(--ink-soft); font-size: 9px; text-transform: uppercase; }
.evidence-list strong { font-size: 11px; }
.evidence-list small { color: var(--ink-soft); font-size: 9px; }
.child-admin-list { display: grid; }
.child-admin-list > article { padding: 18px; border-top: 1px solid var(--line); }
.child-admin-list > article > div:first-child { display: flex; align-items: center; gap: 10px; }
.child-index { width: 30px; height: 30px; display: grid; place-items: center; color: var(--white); background: var(--forest); border-radius: 50%; font-size: 11px; font-weight: 800; }
.child-admin-list p { display: flex; flex-direction: column; margin: 0; }
.child-admin-list p small { color: var(--ink-soft); }
.child-admin-list dl { display: grid; grid-template-columns: repeat(3,1fr); margin: 16px 0 0; background: var(--line); gap: 1px; }
.child-admin-list dl > div { padding: 10px; background: #f5f4ef; }
.child-admin-list dt { color: var(--ink-soft); font-size: 8px; text-transform: uppercase; }
.child-admin-list dd { margin: 4px 0 0; font-size: 10px; font-weight: 750; }
.mini-tranches { display: flex !important; flex-wrap: wrap; gap: 7px !important; margin-top: 13px; }
.mini-tranches span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; color: var(--ink-soft); background: #eeeeea; font-size: 9px; }
.mini-tranches i { width: 6px; height: 6px; background: var(--line-dark); border-radius: 50%; }
.mini-tranches .is-done i { background: var(--green); }
.manual-decision { display: grid; gap: 20px; margin-top: 22px; padding: 23px 20px; background: #fbefc8; border: 1px solid #e8cb70; }
.manual-decision h2 { margin-bottom: 5px; }
.manual-decision p { color: var(--ink-soft); font-size: 12px; }
.decision-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.review-list { display: grid; gap: 12px; }
.review-item { display: grid; grid-template-columns: 54px minmax(0,1fr); gap: 13px; padding: 17px; background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--orange); }
.review-item__type { display: flex; flex-direction: column; align-items: center; color: var(--ink-soft); }
.review-item__type > span { display: grid; width: 40px; height: 40px; place-items: center; color: var(--white); background: var(--orange); border-radius: 50%; font-family: var(--font-display); font-size: 22px; }
.review-item__type small { margin-top: 5px; font-size: 8px; text-transform: uppercase; }
.review-item__body > div:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.review-item h2 { margin: 0; font-size: 16px; }
.review-item p { margin: 8px 0 12px; color: var(--ink-soft); font-size: 12px; }
.review-item dl { display: flex; flex-wrap: wrap; gap: 12px 22px; margin: 0; }
.review-item dl > div { display: flex; flex-direction: column; }
.review-item dt { color: var(--ink-soft); font-size: 8px; text-transform: uppercase; }
.review-item dd { font-size: 10px; font-weight: 750; }
.review-item > .button { grid-column: 2; width: max-content; }

/* Payouts */
.payout-summary { display: grid; grid-template-columns: 1fr; margin-bottom: 22px; color: var(--white); background: var(--forest); }
.payout-summary > div { display: flex; flex-direction: column; padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.15); }
.payout-summary > div:last-child { border-bottom: 0; }
.payout-summary span { color: rgba(255,255,255,.62); font-size: 9px; text-transform: uppercase; }
.payout-summary strong { margin: 4px 0; font-family: var(--font-display); font-size: 29px; font-weight: 500; }
.payout-summary small { color: rgba(255,255,255,.62); font-size: 9px; }
.payout-lines { display: grid; }
.payout-line { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 15px 18px; border-top: 1px solid var(--line); }
.payout-line:first-child { border-top: 0; }
.payout-line__name { display: flex; flex-direction: column; }
.payout-line__name strong { font-size: 12px; }
.payout-line__name span { color: var(--ink-soft); font-size: 9px; }
.payout-line__amount { text-align: right; }
.payout-line__status { grid-column: 2; }
.payout-line > .button, .payment-proof { grid-column: 3; grid-row: 2; }
.payment-proof { color: var(--ink-soft); font-size: 9px; text-align: right; }
.copy-panel { display: grid; gap: 18px; margin-top: 22px; padding: 22px 20px; background: var(--paper); border: 1px solid var(--line); }
.copy-panel h2 { margin-bottom: 5px; }
.copy-panel p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.copy-panel pre { min-width: 0; margin: 0; padding: 16px; overflow-x: auto; color: var(--forest-deep); background: #efefe9; border-left: 3px solid var(--green); font: 12px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }
.copy-page { max-width: 760px; padding: 22px; background: var(--paper); border: 1px solid var(--line); }
.copy-page pre { margin: 0 0 18px; padding: 20px; overflow-x: auto; color: var(--forest-deep); background: #efefe9; border-left: 3px solid var(--green); font: 13px/1.8 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }
.copy-page > p { display: flex; gap: 9px; margin: 18px 0 0; color: var(--ink-soft); font-size: 11px; }
.copy-page > p span { display: grid; width: 20px; height: 20px; flex: 0 0 20px; place-items: center; border: 1px solid var(--line-dark); border-radius: 50%; }

.toast { position: fixed; z-index: 200; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px); padding: 11px 15px; color: var(--white); background: var(--forest-deep); border-radius: 7px; box-shadow: var(--shadow); font-size: 13px; font-weight: 700; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease; }
.toast.is-visible { opacity: 1; transform: none; }

@media (max-width: 699px) {
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .data-table tr { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 13px 45px 13px 14px; border-bottom: 1px solid var(--line); }
  .data-table tr:last-child { border-bottom: 0; }
  .data-table td { padding: 5px 0; border: 0; }
  .data-table td::before { display: block; margin-bottom: 2px; color: var(--ink-soft); content: attr(data-label); font-size: 8px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
  .data-table td:last-child { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
  .data-table .align-right { text-align: left !important; }
}

@media (min-width: 700px) {
  .page-heading--split { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
  .admin-kpis { grid-template-columns: repeat(4,1fr); }
  .admin-kpi { padding: 22px 20px; }
  .filter-bar { grid-template-columns: minmax(230px,1fr) auto auto auto; align-items: center; }
  .entity-row { grid-template-columns: 42px minmax(130px,1.4fr) minmax(100px,1fr) 125px 80px 85px 32px; }
  .entity-row__meta, .entity-row__contract, .entity-row__earnings { display: flex; }
  .entity-row__contract { align-items: center; gap: 6px; color: var(--ink-soft); font-size: 10px; }
  .entity-row__state, .entity-row > .row-arrow { grid-column: auto; grid-row: auto; }
  .entity-header { grid-template-columns: 62px minmax(0,1fr) auto; }
  .entity-header__actions { grid-column: 3; display: flex; justify-content: flex-end; }
  .inline-metrics { grid-template-columns: repeat(4,1fr); }
  .timeline-item { grid-template-columns: 12px 1fr 1.2fr auto; }
  .timeline-item > div:nth-of-type(2) { display: flex; }
  .active-promotion-banner { grid-template-columns: minmax(240px,1fr) auto auto; align-items: center; padding: 25px 28px; }
  .editor-section { grid-template-columns: minmax(180px,.72fr) minmax(320px,1.28fr); gap: 55px; padding: 35px 30px; }
  .fee-grid { grid-template-columns: repeat(3,1fr); }
  .editor-save { padding-inline: 30px; }
  .editor-save p { display: block; margin-right: auto; }
  .child-admin-list > article { display: grid; grid-template-columns: minmax(140px,.7fr) minmax(280px,1.3fr); gap: 20px; align-items: center; }
  .child-admin-list dl { margin: 0; }
  .mini-tranches { grid-column: 1 / -1; }
  .manual-decision { grid-template-columns: .8fr 1.2fr; padding: 28px; }
  .review-item { grid-template-columns: 62px minmax(0,1fr) auto; align-items: center; padding: 20px; }
  .review-item > .button { grid-column: 3; }
  .payout-summary { grid-template-columns: repeat(3,1fr); }
  .payout-summary > div { border-right: 1px solid rgba(255,255,255,.15); border-bottom: 0; }
  .payout-summary > div:last-child { border-right: 0; }
  .payout-line { grid-template-columns: 42px minmax(160px,1fr) 110px 130px 140px; }
  .payout-line__status, .payout-line > .button, .payment-proof { grid-column: auto; grid-row: auto; }
  .copy-panel { grid-template-columns: .65fr 1fr auto; align-items: center; padding: 28px; }
}

@media (min-width: 980px) {
  .admin-grid { grid-template-columns: minmax(0,1.5fr) minmax(280px,.7fr); }
  .admin-panel { padding: 27px 25px; }
  .admin-panel--flush { padding: 0; }
  .panel-heading--padded { padding: 24px 24px 0; }
}
