/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --blue:        #7b82f6;
    --blue-dark:   #5660dc;
    --blue-deeper: #252b7a;
    --blue-light:  #f0f1ff;
    --green:       #059669;
    --green-dark:  #047857;
    --red:         #dc2626;
    --surface:     #ffffff;
    --bg:          #f7f7fc;
    --text:        #252540;
    --text-2:      #6b7280;
    --text-3:      #9ca3af;
    --border:      #e7e6f7;
    --shadow-sm:   0 1px 3px rgba(123,130,246,.06);
    --shadow-md:   0 4px 16px rgba(123,130,246,.09), 0 1px 4px rgba(0,0,0,.03);
    --shadow-lg:   0 8px 28px rgba(123,130,246,.13), 0 2px 8px rgba(0,0,0,.04);
    --r:  12px;
    --r2: 8px;
    --r3: 16px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
}

/* ===== TOP BANNER ===== */
.top-banner {
    background: var(--blue-dark);
    color: rgba(255,255,255,.88);
    text-align: center;
    padding: 7px 16px;
    font-size: 11.5px;
    letter-spacing: .25px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.secure-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #d4d8fc;
    font-weight: 600;
}

.sep { opacity: .35; }

/* ===== PAGE WRAP ===== */
.page-wrap {
    max-width: 980px;
    margin: 0 auto;
    padding: 22px 16px 0;
}

/* ===== HEADER ===== */
.header {
    background: var(--surface);
    border-radius: var(--r3);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--blue) 0%, #b4b9fc 50%, #38bdf8 100%);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 22px 30px;
}

.logo-box img {
    width: 174px;
    height: 74px;
    object-fit: contain;
    border-radius: 10px;
    flex-shrink: 0;
}

.school-info {
    flex: 1;
    text-align: center;
}

.school-info h1 {
    color: var(--blue-dark);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: .4px;
    line-height: 1.2;
    margin-bottom: 5px;
}

.address {
    color: var(--text-2);
    font-size: 12.5px;
    margin-bottom: 10px;
}

.portal-badge {
    display: inline-block;
    background: linear-gradient(135deg, #0d9488, #06b6d4);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .9px;
    text-transform: uppercase;
    padding: 5px 18px;
    border-radius: 100px;
}

/* ===== MAIN GRID — single column stack ===== */
.main-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

/* ===== PAYMENT CARD ===== */
.payment-card {
    background: var(--surface);
    border-radius: var(--r3);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, var(--blue), #9fa6fb);
    color: #fff;
    padding: 16px 24px;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: .2px;
}

.card-icon {
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,.18);
    border-radius: var(--r2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#paymentForm {
    padding: 26px;
}

/* Form groups */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.form-group label svg {
    color: var(--blue);
    flex-shrink: 0;
}

.label-hint {
    font-weight: 400;
    color: var(--text-2);
    font-size: 11.5px;
}

.form-group input,
.form-group select {
    width: 100%;
    height: 46px;
    border: 1.5px solid var(--border);
    border-radius: var(--r2);
    padding: 0 14px;
    font-size: 14px;
    color: var(--text);
    background: var(--surface);
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}

.form-group input::placeholder { color: var(--text-3); }

.form-group input:hover,
.form-group select:hover {
    border-color: #b4b9fc;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3.5px rgba(123,130,246,.12);
}

/* Select with custom arrow */
.select-wrap { position: relative; }

.select-wrap select { padding-right: 40px; cursor: pointer; }

.chevron {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-2);
    pointer-events: none;
}

/* Submit button */
.btn-pay {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: var(--r2);
    background: linear-gradient(135deg, var(--blue), #9fa6fb);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all .22s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    letter-spacing: .3px;
    box-shadow: 0 4px 16px rgba(123,130,246,.28);
    margin-top: 8px;
    font-family: inherit;
}

.btn-pay:hover {
    background: linear-gradient(135deg, var(--blue-dark), var(--blue));
    box-shadow: 0 7px 22px rgba(123,130,246,.35);
    transform: translateY(-1px);
}

.btn-pay:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(123,130,246,.20);
}

.secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 13px;
    font-size: 11.5px;
    color: var(--text-2);
}

.secure-note svg { color: var(--green); }

/* ===== INSTRUCTION BOX ===== */
.instruction-box {
    background: var(--surface);
    border-radius: var(--r3);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.instruction-header {
    background: linear-gradient(135deg, #ff2626, #fb9696);
    color: #fff;
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 11px;
    letter-spacing: .2px;
}

.instruction-icon {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,.18);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.instruction-list {
    padding: 18px 20px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.instruction-list li {
    display: flex;
    gap: 11px;
    font-size: 13px;
    color: #374151;
    line-height: 1.55;
    padding: 10px 12px;
    background: #f8f7ff;
    border-radius: var(--r2);
    border-left: 3px solid #d4d8fc;
    align-items: flex-start;
}

.instr-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-width: 30px;
    background: var(--blue-light);
    border-radius: 7px;
    color: var(--blue);
    flex-shrink: 0;
    margin-top: 1px;
}

/* ===== FOOTER ===== */
.footer {
    margin-top: 24px;
    background: linear-gradient(160deg, var(--blue-deeper) 0%, #363cb8 100%);
    border-radius: var(--r3) var(--r3) 0 0;
    overflow: hidden;
}

.footer-inner {
    padding: 28px 28px 24px;
    text-align: center;
}

.gateway-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,.7);
    font-size: 12.5px;
    background: rgba(255,255,255,.07);
    padding: 9px 20px;
    border-radius: 100px;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,.1);
}

.gateway-row strong { color: #fff; }

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    margin-bottom: 20px;
}

.footer-links a {
    color: rgba(219,234,255,.78);
    text-decoration: none;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 100px;
    transition: all .18s;
}

.footer-links a:hover {
    color: #fff;
    background: rgba(255,255,255,.1);
}

.copyright {
    color: rgba(255,255,255,.38);
    font-size: 11.5px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,.1);
    letter-spacing: .2px;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 820px) {
    .header-inner {
        padding: 20px 22px;
    }

    .school-info h1 {
        font-size: 21px;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .page-wrap {
        padding: 12px 12px 0;
    }

    .top-banner {
        font-size: 10.5px;
        padding: 6px 12px;
        gap: 7px;
    }

    .header-inner {
        flex-direction: column;
        text-align: center;
        padding: 18px 16px;
        gap: 12px;
    }

    .logo-box img {
        width: 174px;
        height: 60px;
    }

    .school-info h1 {
        font-size: 17px;
        letter-spacing: .2px;
    }

    .address {
        font-size: 11.5px;
    }

    .portal-badge {
        font-size: 10px;
        letter-spacing: .6px;
    }

    .card-header {
        padding: 14px 18px;
        font-size: 14px;
    }

    #paymentForm {
        padding: 18px;
    }

    /* font-size 16px on mobile prevents iOS auto-zoom */
    .form-group input,
    .form-group select {
        height: 48px;
        font-size: 16px;
    }

    .btn-pay {
        height: 52px;
        font-size: 15px;
    }

    .instruction-header {
        padding: 10px 16px;
    }

    .instruction-list {
        padding: 14px 14px;
        gap: 8px;
    }

    .instruction-list li {
        font-size: 12.5px;
        padding: 9px 10px;
        gap: 9px;
    }

    .instr-icon {
        width: 26px;
        height: 26px;
        min-width: 26px;
    }

    .footer-inner {
        padding: 22px 14px 20px;
    }

    .gateway-row {
        font-size: 11.5px;
        padding: 8px 14px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .footer-links a {
        font-size: 11px;
        padding: 4px 8px;
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .school-info h1 {
        font-size: 15px;
    }

    .portal-badge {
        font-size: 9px;
    }

    #paymentForm {
        padding: 14px;
    }
}

/* Honeypot — invisible to real users, bots fill it */
.hp-wrap {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none;
}

/* ===== CARD HEADER VARIANTS ===== */

.card-header-green {
    background: linear-gradient(135deg, var(--green), #10b981);
}

.card-header-red {
    background: linear-gradient(135deg, var(--red), #ef4444);
}

.sc-back-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1.5px solid rgba(255,255,255,.5);
    background: rgba(255,255,255,.15);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: background .18s;
    flex-shrink: 0;
}
.sc-back-btn:hover {
    background: rgba(255,255,255,.28);
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,.2);
    border-radius: 100px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
}

/* ===== STUDENT DETAIL CARD ===== */

.student-body {
    padding: 22px 26px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 4px;
}

.info-item.info-full {
    grid-column: 1 / -1;
}

.info-item {
    background: var(--blue-light);
    border-radius: var(--r2);
    padding: 11px 14px;
    border: 1px solid #e7e6f7;
}

.info-label {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--blue);
    margin-bottom: 4px;
}

.info-value {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.form-divider {
    height: 1px;
    background: var(--border);
    margin: 18px 0;
}

/* ===== RESULT / ERROR / NOT-FOUND STATES ===== */

.result-body {
    padding: 28px 26px;
    text-align: center;
}

.not-found-body {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.not-found-icon {
    width: 80px;
    height: 80px;
    background: #fff5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    color: #f87171;
    border: 2px solid #fecaca;
}

.result-msg {
    font-size: 13.5px;
    color: var(--text-2);
    line-height: 1.65;
    margin-bottom: 22px;
    max-width: 320px;
}

/* ===== BACK BUTTON ===== */

.btn-back {
    width: 100%;
    height: 44px;
    border: 1.5px solid var(--border);
    border-radius: var(--r2);
    background: var(--surface);
    color: var(--text-2);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 12px;
    font-family: inherit;
}

.btn-back:hover {
    border-color: var(--blue);
    color: var(--blue);
    background: var(--blue-light);
}

/* ===== BUTTON LOADING STATE ===== */

.btn-pay.loading {
    opacity: .7;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-pay.loading::after {
    content: '…';
    margin-left: 3px;
}

/* ===== RESPONSIVE: student card ===== */

@media (max-width: 600px) {
    .student-body {
        padding: 16px;
    }

    .info-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .info-value {
        font-size: 14px;
    }

    .result-body {
        padding: 20px 16px;
    }
}

/* ===== LOADER / SPINNER ===== */

#fee-container {
    margin-top: 20px;
    scroll-margin-top: 20px;
}

.fee-loader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    color: var(--text-2);
    font-size: 13px;
    gap: 14px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== FEE INFO CARD ===== */

.fee-info-card {
    background: var(--surface);
    border-radius: var(--r3);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

.fee-info-header {
    background: linear-gradient(135deg, var(--blue), #9fa6fb);
    color: #fff;
    padding: 16px 24px;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: .2px;
}

.fee-info-icon {
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,.18);
    border-radius: var(--r2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fee-period-badge {
    margin-left: auto;
    background: rgba(255,255,255,.2);
    border-radius: 100px;
    padding: 3px 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .3px;
}

.fee-info-body {
    padding: 22px 24px;
}

/* Student banner */
.fee-student-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    background: var(--blue-light);
    border: 1px solid #e7e6f7;
    border-radius: var(--r2);
    padding: 12px 16px;
    margin-bottom: 20px;
}

.fee-stu-name {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    font-size: 15px;
    color: var(--blue-dark);
}

.fee-adm-no {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-2);
    font-weight: 500;
}

/* Heads grid — 3 per row */
.fee-heads-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}

.fee-head-item {
    background: #f9fafb;
    border: 1px solid var(--border);
    border-radius: var(--r2);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: border-color .2s;
}

.fee-head-item:not(.fee-head-paid) {
    border-left: 3px solid #f97316;
}

.fee-head-item.fee-head-paid {
    border-left: 3px solid var(--green);
    opacity: .75;
}

.fee-head-name {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: .4px;
    line-height: 1.3;
}

.fee-head-amount {
    font-size: 16px;
    font-weight: 700;
    color: #ea580c;
}

.fee-paid-tag {
    font-size: 13px;
    font-weight: 600;
    color: var(--green);
}

/* Total row */
.fee-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--blue-deeper), #363cb8b8);
    color: #fff;
    border-radius: var(--r2);
    padding: 14px 20px;
    margin-bottom: 18px;
}

.fee-total-label {
    font-size: 14px;
    font-weight: 600;
    opacity: .85;
}

.fee-total-amount {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .5px;
}

/* All paid state */
/* Student card — all dues cleared */
.sc-all-clear {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px 8px;
    text-align: center;
    gap: 6px;
}
.sc-clear-icon {
    width: 56px; height: 56px;
    background: #dcfce7;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 4px;
}
.sc-clear-title {
    font-size: .975rem;
    font-weight: 700;
    color: #15803d;
}
.sc-clear-sub {
    font-size: .78rem;
    color: var(--text-2);
}

/* All dues clear card */
.fee-all-clear {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px 20px;
    text-align: center;
    gap: 6px;
}
.fac-icon {
    width: 64px; height: 64px;
    background: #dcfce7;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 6px;
}
.fac-title {
    font-size: 1rem;
    font-weight: 700;
    color: #15803d;
}
.fac-sub {
    font-size: .78rem;
    color: var(--text-2);
    margin-bottom: 12px;
}
.fac-details {
    width: 100%;
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-radius: 10px;
    padding: 12px 14px;
    text-align: left;
}
.fac-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #d1fae5;
    font-size: .8rem;
}
.fac-row:last-child { border-bottom: none; }
.fac-label { color: var(--text-2); font-weight: 500; }
.fac-val   { color: var(--text); font-weight: 600; }

.fee-all-paid {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 20px;
    gap: 14px;
    color: var(--green);
    text-align: center;
}

.fee-all-paid p {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
}

/* Deposit button */
.btn-deposit {
    width: 100%;
    height: 56px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #ea580c 0%, #f97316 50%, #fb923c 100%);
    color: #fff;
    font-size: 15.5px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: .5px;
    text-transform: uppercase;
    box-shadow: 0 4px 0 #c2410c,
                0 6px 20px rgba(234,88,12,.45),
                inset 0 1px 0 rgba(255,255,255,.25);
    transition: all .18s ease;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn-deposit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.18) 0%, transparent 60%);
    pointer-events: none;
}

.btn-deposit:hover {
    background: linear-gradient(135deg, #c2410c 0%, #ea580c 50%, #f97316 100%);
    box-shadow: 0 2px 0 #9a3412,
                0 8px 28px rgba(234,88,12,.55),
                inset 0 1px 0 rgba(255,255,255,.2);
    transform: translateY(2px);
}

.btn-deposit:active {
    transform: translateY(4px);
    box-shadow: 0 0px 0 #9a3412,
                0 4px 12px rgba(234,88,12,.4),
                inset 0 1px 0 rgba(255,255,255,.15);
}

/* Error box */
.fee-error-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid var(--red);
    border-radius: var(--r2);
    padding: 14px 18px;
    color: var(--red);
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 16px;
}

/* fee-heads-grid: always 3 per row at all screen sizes */
@media (max-width: 820px) {
    .fee-heads-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ═══════════════════════════════════════════════════════
   COMPACT DESIGN — reduce sizes so header + student card
   + fee card all fit in the first viewport
   ═══════════════════════════════════════════════════════ */

/* Top banner */
.top-banner { padding: 5px 14px; font-size: 10px; gap: 6px; }

/* Page & grid spacing */
.page-wrap { padding: 10px 14px 0; }
.main-grid { gap: 10px; margin-top: 10px; }
#fee-container { margin-top: 0; scroll-margin-top: 10px; }

/* ── Header ── */
.header-inner   { padding: 10px 16px; gap: 14px; }
.logo-box img   { width: 174px; height: 46px; }
.school-info h1 { font-size: 17px; margin-bottom: 3px; }
.address        { font-size: 10.5px; margin-bottom: 6px; }
.portal-badge   { font-size: 9.5px; padding: 3px 12px; letter-spacing: .6px; }

/* ── Verification / student card header ── */
.card-header { padding: 9px 16px; font-size: 13px; }
.card-icon   { width: 28px; height: 28px; }

/* ── Verification form ── */
#paymentForm      { padding: 12px 16px; }
.form-group       { margin-bottom: 9px; }
.form-group label { font-size: 11.5px; margin-bottom: 3px; }
.form-group input,
.form-group select { height: 36px; }
.btn-pay           { height: 38px; font-size: 13px; margin-top: 4px; }
.secure-note       { margin-top: 7px; font-size: 10.5px; }

/* ── Student detail body ── */
.student-body   { padding: 12px 16px; }
.info-grid      { gap: 7px; }
.info-item      { padding: 7px 10px; }
.info-label     { font-size: 9.5px; margin-bottom: 2px; }
.info-value     { font-size: 13px; }
.form-divider   { margin: 9px 0; }
.verified-badge { font-size: 10px; padding: 2px 8px; }

/* ── Fee info card ── */
.fee-info-header    { padding: 9px 16px; font-size: 13px; }
.fee-info-icon      { width: 28px; height: 28px; }
.fee-period-badge   { font-size: 10px; padding: 2px 9px; }
.fee-info-body      { padding: 10px 14px; }
.fee-student-banner { padding: 7px 12px; margin-bottom: 10px; }
.fee-stu-name       { font-size: 12.5px; }
.fee-adm-no         { font-size: 11px; }
.fee-heads-grid     { gap: 6px; margin-bottom: 10px; }
.fee-head-item      { padding: 7px 9px; gap: 3px; }
.fee-head-name      { font-size: 9.5px; }
.fee-head-amount    { font-size: 13px; }
.fee-paid-tag       { font-size: 11.5px; }
.fee-total-row      { padding: 9px 14px; margin-bottom: 10px; }
.fee-total-label    { font-size: 12px; }
.fee-total-amount   { font-size: 17px; }
.btn-deposit        { height: 40px; font-size: 13px; }
.fee-all-paid       { padding: 22px 16px; gap: 10px; }
.fee-all-paid p     { font-size: 13px; }

/* ── Footer compact ── */
.footer-inner { padding: 18px 20px 16px; }
.gateway-row  { font-size: 11.5px; padding: 7px 14px; margin-bottom: 14px; }
.copyright    { font-size: 11px; padding-top: 12px; }

/* ═══════════════════════════════════════════════════════
   MOBILE COMPACT  (≤ 600px)
   ═══════════════════════════════════════════════════════ */
@media (max-width: 600px) {

    .top-banner  { font-size: 9.5px; padding: 4px 10px; }
    .page-wrap   { padding: 8px 10px 0; }
    .main-grid   { gap: 8px; margin-top: 8px; }

    /* Header — stack vertically but tight */
    .header-inner   { flex-direction: column; text-align: center; padding: 10px 12px; gap: 6px; }
    .logo-box img   { width: 174px; height: 40px; }
    .school-info h1 { font-size: 15px; }
    .address        { font-size: 10px; margin-bottom: 5px; }
    .portal-badge   { font-size: 9px; padding: 2px 10px; }

    /* Cards */
    .card-header    { padding: 8px 12px; font-size: 12.5px; }
    #paymentForm    { padding: 10px 12px; }
    .form-group     { margin-bottom: 7px; }
    .form-group label { font-size: 11px; }

    /* Keep 16px on mobile inputs to prevent iOS zoom */
    .form-group input,
    .form-group select { height: 40px; font-size: 16px; }

    .btn-pay        { height: 38px; font-size: 13px; }
    .student-body   { padding: 10px 12px; }
    .info-grid      { gap: 6px; }
    .info-item      { padding: 6px 8px; }
    .info-label     { font-size: 9px; }
    .info-value     { font-size: 12.5px; }
    .form-divider   { margin: 7px 0; }

    /* Fee card — tight on mobile */
    .fee-info-header    { padding: 8px 12px; font-size: 12.5px; }
    .fee-info-body      { padding: 8px 10px; }
    .fee-student-banner { flex-direction: row; flex-wrap: wrap; padding: 6px 10px; gap: 4px; }
    .fee-stu-name       { font-size: 12px; }
    .fee-adm-no         { font-size: 10.5px; }
    .fee-period-badge   { display: none; }

    /* Fee heads — 3 per row always, small and tight */
    .fee-heads-grid  { grid-template-columns: repeat(3, 1fr); gap: 5px; margin-bottom: 8px; }
    .fee-head-item   { padding: 5px 6px; gap: 2px; }
    .fee-head-name   { font-size: 8.5px; letter-spacing: 0; }
    .fee-head-amount { font-size: 12px; }
    .fee-paid-tag    { font-size: 10.5px; }

    .fee-total-row   { padding: 8px 12px; margin-bottom: 8px; }
    .fee-total-label { font-size: 11.5px; }
    .fee-total-amount { font-size: 15px; }
    .btn-deposit     { height: 38px; font-size: 13px; }
}

/* ===== GATEWAY SELECTION UI ===== */
#gateway-select {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--r);
    padding: 18px 16px 16px;
    margin-top: 4px;
}

.gw-select-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
    letter-spacing: .1px;
}

.gw-select-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.gateway-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 14px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--r2);
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
    text-align: center;
}

.gateway-option:hover:not(:disabled) {
    border-color: var(--blue);
    background: var(--blue-light);
    box-shadow: 0 2px 8px rgba(123,130,246,.12);
}

.gateway-option:disabled,
.gateway-option.loading {
    opacity: .6;
    cursor: not-allowed;
}

.gw-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
}

.gw-sub {
    font-size: 10.5px;
    color: var(--text-2);
    letter-spacing: .1px;
}

/* ===== HISTORY BUTTON (student card header) ===== */
.sc-history-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 6px;
    /* border: 1.5px solid rgba(255,255,255,.5); */
        border: 2px solid #000;
    background: rgba(255,255,255,.15);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background .18s;
    flex-shrink: 0;
}
.sc-history-btn:hover { background: rgba(255,255,255,.28); }

/* Mobile: sirf icon dikhao, text hide karo */
@media (max-width: 520px) {
    .sc-back-btn,
    .sc-history-btn {
        padding: 5px 7px;
        gap: 0;
    }
    /* .sc-back-btn .btn-txt,
    .sc-history-btn .btn-txt,
    .verified-badge .btn-txt {
        display: none;
    } */
    .verified-badge {
        padding: 3px 6px;
    }
}

/* ===== PAYMENT HISTORY CARDS ===== */

.ph-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ph-section-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--text-2);
    padding: 2px 0;
}
.ph-section-count {
    background: var(--border);
    border-radius: 100px;
    padding: 1px 7px;
    font-size: 9.5px;
    color: var(--text-2);
}

/* Card shell */
.ph-card {
    background: var(--surface);
    border-radius: var(--r2);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

/* Card header */
.ph-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .15px;
}
.ph-card-success  .ph-card-header { background: linear-gradient(135deg, var(--green), #10b981); }
.ph-card-initiate .ph-card-header { background: linear-gradient(135deg, #d97706, #f59e0b); }
.ph-card-failed   .ph-card-header { background: linear-gradient(135deg, var(--red), #ef4444); }

.ph-recheck-btn {
    display:         inline-flex;
    align-items:     center;
    gap:             4px;
    margin-top:      8px;
    padding:         4px 10px;
    font-size:       11px;
    font-weight:     500;
    color:           var(--red);
    background:      #fff0f0;
    border:          1px solid #fca5a5;
    border-radius:   var(--r2);
    cursor:          pointer;
    transition:      background .15s, border-color .15s;
}
.ph-recheck-btn:hover {
    background:      #fee2e2;
    border-color:    var(--red);
}

.ph-card-icon {
    width: 22px; height: 22px;
    background: rgba(255,255,255,.2);
    border-radius: 5px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.ph-status-badge {
    margin-left: auto;
    background: rgba(255,255,255,.22);
    border-radius: 100px;
    padding: 2px 8px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .3px;
    white-space: nowrap;
}

/* Checking animation */
.ph-card-checking .ph-status-badge {
    animation: ph-pulse 1.2s ease-in-out infinite;
}
@keyframes ph-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: .45; }
}

/* Card body */
.ph-card-body { padding: 8px 12px 10px; }

/* Student name line (success only) */
.ph-stu-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}
.ph-stu-line strong { font-size: 12.5px; font-weight: 700; color: var(--text); }
.ph-stu-line span   { font-size: 10.5px; color: var(--text-2); font-weight: 500; }

/* Chip row */
.ph-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-bottom: 5px;
}

.ph-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 10.5px;
    font-weight: 600;
    background: #f3f4f6;
    color: var(--text);
    border: 1px solid var(--border);
    white-space: nowrap;
}
.ph-chip-months { background: #f0f1ff; color: var(--blue-dark); border-color: #e7e6f7; }
.ph-chip-amt    { background: #f0fdf4; color: var(--green-dark); border-color: #bbf7d0; font-weight: 700; }

/* Date · gateway line */
.ph-detail-row {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-2);
    margin-bottom: 3px;
    flex-wrap: wrap;
}
.ph-dot { color: var(--text-3); }

/* Txn ID */
.ph-txn-row {
    font-size: 9.5px;
    font-family: monospace;
    color: var(--text-3);
    word-break: break-all;
    line-height: 1.4;
}

/* Empty state */
.ph-empty-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 20px;
    gap: 8px;
    text-align: center;
    background: var(--surface);
    border-radius: var(--r2);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.ph-empty-icon {
    width: 48px; height: 48px;
    background: #f8f7ff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #7c3aed;
}
.ph-empty-title { font-size: 13px; font-weight: 700; color: var(--text); }
.ph-empty-sub   { font-size: 11.5px; color: var(--text-2); }

/* Mobile */
@media (max-width: 600px) {
    .ph-card-header { padding: 6px 10px; font-size: 11.5px; }
    .ph-card-body   { padding: 7px 10px 9px; }
    .ph-chip        { font-size: 10px; padding: 1px 7px; }
    .ph-detail-row  { font-size: 10.5px; }
    .ph-txn-row     { font-size: 9px; }
}
.p-his{
    color: #000;
    font-weight: 900;
}