/* ═══════════════════════════════════════════════════════
   DEBT MANAGER — Mobile App UI
   Clean · Modern · Finance-grade
   ═══════════════════════════════════════════════════════ */

:root {
    /* Brand */
    --brand:          #5C4EFA;
    --brand-dark:     #3D2FD9;
    --brand-deeper:   #1A0F8F;
    --brand-light:    #8B7FFB;
    --brand-pale:     #EEF0FF;
    --brand-glow:     rgba(92, 78, 250, 0.18);

    /* Semantic */
    --green:          #12C08A;
    --green-light:    #E4FAF4;
    --red:            #F04F77;
    --red-light:      #FEF0F4;
    --amber:          #F5A623;
    --amber-light:    #FEF8EC;

    /* Neutrals */
    --bg:             #F4F5FB;
    --surface:        #FFFFFF;
    --surface-2:      #F9FAFF;
    --border:         #EBEBF5;
    --border-dark:    #D8D8EC;
    --text-1:         #141228;
    --text-2:         #4A4870;
    --text-3:         #9896B8;
    --text-inv:       #FFFFFF;

    /* Shadows */
    --shadow-xs:  0 1px 4px rgba(20,18,40,0.06);
    --shadow-sm:  0 2px 10px rgba(20,18,40,0.08);
    --shadow-md:  0 6px 24px rgba(20,18,40,0.10);
    --shadow-lg:  0 16px 48px rgba(20,18,40,0.14);
    --shadow-btn: 0 4px 16px rgba(92,78,250,0.35);

    /* Radii */
    --r-xs:  8px;
    --r-sm:  12px;
    --r-md:  18px;
    --r-lg:  24px;
    --r-xl:  32px;
    --r-full:50px;

    /* Layout */
    --topbar-h:    58px;
    --bottomnav-h: 68px;
    --app-w:       480px;
}

/* ════════════════════════════════════
   BASE RESET
════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    overflow: hidden; /* purple bezel NEVER scrolls */
}

body {
    background: #0E0B2B;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--text-1);
    font-size: 15px;
    line-height: 1.5;
}

/* ════════════════════════════════════
   APP SHELL
════════════════════════════════════ */
.app-frame {
    max-width: var(--app-w);
    height: 100svh;          /* exactly viewport tall — no more, no less */
    margin: 0 auto;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;        /* ALL scrolling happens here, inside the frame */
    box-shadow: 0 0 120px rgba(0,0,0,0.7);
    /* smooth momentum scroll on iOS */
    -webkit-overflow-scrolling: touch;
}

.app-content {
    flex: 1;
    padding: 10px 12px calc(var(--bottomnav-h) + 14px);
}

/* ════════════════════════════════════
   TOP BAR
════════════════════════════════════ */
.app-topbar {
    height: var(--topbar-h);
    background: var(--brand);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    position: sticky;
    top: 0;
    z-index: 300;
    flex-shrink: 0;
    box-shadow: 0 2px 16px rgba(92,78,250,0.30);
}

.app-topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-logo {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.20);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.25);
}

.topbar-logo i {
    font-size: 1.1rem;
    color: #fff;
}

.topbar-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.2px;
}

.app-topbar-right { display: flex; align-items: center; }

.topbar-user {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.20);
    border-radius: var(--r-full);
    padding: 5px 12px 5px 8px;
}

.topbar-user i {
    font-size: 1rem;
    color: rgba(255,255,255,0.85);
}

.topbar-user span {
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ════════════════════════════════════
   BOTTOM NAV (fixed)
════════════════════════════════════ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(100%, var(--app-w));
    height: var(--bottomnav-h);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-around;
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 24px rgba(20,18,40,0.10);
    z-index: 300;
    padding: 0 8px 4px;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    text-decoration: none;
    padding: 8px 4px 4px;
    border-radius: var(--r-sm);
    transition: color 0.2s;
    color: var(--text-3);
    position: relative;
}

.bottom-nav-item i {
    font-size: 1.25rem;
    transition: transform 0.2s ease;
}

.bottom-nav-item span {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1;
}

.bottom-nav-item.active {
    color: var(--brand);
}

.bottom-nav-item.active i {
    transform: scale(1.10);
}

/* Active dot indicator */
.bottom-nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 3px;
    background: var(--brand);
    border-radius: 0 0 4px 4px;
}

/* FAB — center Add button */
.bottom-nav-fab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    text-decoration: none;
    color: var(--brand);
    padding: 0 4px 4px;
}

.fab-btn {
    width: 50px;
    height: 50px;
    background: var(--brand);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-btn);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: -12px;
    animation: fab-pulse 3s ease-in-out infinite;
}

.fab-btn i {
    font-size: 1.4rem;
    color: #fff;
}

.bottom-nav-fab span {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--brand);
    line-height: 1;
}

.bottom-nav-fab:hover .fab-btn,
.bottom-nav-fab.fab-active .fab-btn {
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 8px 28px rgba(92,78,250,0.50);
}

@keyframes fab-pulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(92,78,250,0.35); }
    50%       { box-shadow: 0 6px 28px rgba(92,78,250,0.55); }
}

/* ════════════════════════════════════
   SECTION HEADING
════════════════════════════════════ */
.section-title {
    font-size: 0.70rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-3);
    margin-bottom: 10px;
}

/* ════════════════════════════════════
   HERO / BALANCE BANNER
════════════════════════════════════ */
.balance-banner {
    background: var(--brand);
    border-radius: var(--r-lg);
    padding: 20px 18px;
    color: #fff;
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
}

.balance-banner::before {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 150px; height: 150px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

.balance-banner::after {
    content: '';
    position: absolute;
    bottom: -40px; left: 20px;
    width: 100px; height: 100px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.balance-banner .label {
    font-size: 0.72rem;
    font-weight: 600;
    opacity: 0.75;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    margin-bottom: 2px;
}

.balance-banner .amount {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.1;
}

.balance-banner .sub {
    font-size: 0.78rem;
    opacity: 0.70;
    margin-top: 4px;
}

/* ════════════════════════════════════
   SUMMARY TILES
════════════════════════════════════ */
.summary-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.summary-tile {
    background: var(--surface);
    border-radius: var(--r-md);
    padding: 12px 10px;
    text-align: center;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border);
}

.summary-tile .tile-label {
    font-size: 0.60rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-3);
    margin-bottom: 4px;
}

.summary-tile .tile-amount {
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    line-height: 1.1;
}

.summary-tile.green  .tile-amount { color: var(--green); }
.summary-tile.red    .tile-amount { color: var(--red); }
.summary-tile.brand  .tile-amount { color: var(--brand); }

.summary-tile .tile-icon {
    width: 28px; height: 28px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 6px;
    font-size: 0.85rem;
}

.summary-tile.green .tile-icon { background: var(--green-light); color: var(--green); }
.summary-tile.red   .tile-icon { background: var(--red-light);   color: var(--red); }
.summary-tile.brand .tile-icon { background: var(--brand-pale);  color: var(--brand); }

/* ════════════════════════════════════
   DEBT CARDS
════════════════════════════════════ */
.debt-card {
    background: var(--surface);
    border-radius: var(--r-md);
    padding: 14px 14px 12px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border);
    transition: box-shadow 0.2s, transform 0.2s;
}

.debt-card:active {
    transform: scale(0.99);
    box-shadow: var(--shadow-sm);
}

.debt-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 10px;
}

.debt-card-person {
    display: flex;
    align-items: center;
    gap: 10px;
}

.person-avatar {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    flex-shrink: 0;
    color: #fff;
}

.person-avatar.green  { background: var(--green); }
.person-avatar.red    { background: var(--red); }
.person-avatar.brand  { background: var(--brand); }

.person-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-1);
    line-height: 1.2;
}

.person-desc {
    font-size: 0.75rem;
    color: var(--text-3);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.debt-card-amount {
    text-align: right;
}

.debt-card-amount .amount-main {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.debt-card-amount .amount-main.green { color: var(--green); }
.debt-card-amount .amount-main.red   { color: var(--red); }

.debt-card-amount .amount-orig {
    font-size: 0.68rem;
    color: var(--text-3);
    text-decoration: line-through;
    margin-top: 1px;
}

/* Progress bar */
.debt-progress {
    height: 5px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 10px;
}

.debt-progress-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.4s ease;
}

.debt-progress-fill.green { background: var(--green); }
.debt-progress-fill.red   { background: var(--red); }
.debt-progress-fill.brand { background: var(--brand); }

/* Card meta row */
.debt-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.73rem;
    color: var(--text-3);
    margin-bottom: 10px;
}

.debt-card-meta .due-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.debt-card-meta .due-date i { font-size: 0.7rem; }

.due-overdue { color: var(--red) !important; font-weight: 600; }
.due-soon    { color: var(--amber) !important; font-weight: 600; }

/* Card action buttons */
.debt-card-actions {
    display: flex;
    gap: 6px;
}

.debt-card-actions .btn {
    flex: 1;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 7px 4px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-pay {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 3px 10px rgba(92,78,250,0.30);
}

.btn-pay:hover { background: var(--brand-dark); color: #fff; transform: translateY(-1px); }

.btn-edit {
    background: var(--brand-pale);
    color: var(--brand);
}

.btn-edit:hover { background: #DDE0FF; color: var(--brand-dark); }

.btn-del {
    background: var(--red-light);
    color: var(--red);
}

.btn-del:hover { background: #FDD; color: var(--red); }

/* Paid badge overlay */
.debt-card.is-paid {
    opacity: 0.65;
    border-style: dashed;
}

/* ════════════════════════════════════
   FILTER CHIP ROW
════════════════════════════════════ */
.filter-chips {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-chips::-webkit-scrollbar { display: none; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    border-radius: var(--r-full);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid var(--border-dark);
    background: var(--surface);
    color: var(--text-2);
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-pale); }

.chip.active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
    box-shadow: 0 2px 8px rgba(92,78,250,0.28);
}

/* ════════════════════════════════════
   EMPTY STATE
════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state-icon {
    width: 72px;
    height: 72px;
    background: var(--brand-pale);
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.empty-state-icon i {
    font-size: 1.8rem;
    color: var(--brand);
}

.empty-state h6 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 6px;
}

.empty-state p {
    font-size: 0.83rem;
    color: var(--text-3);
    line-height: 1.5;
}

/* ════════════════════════════════════
   AUTH SCREENS
════════════════════════════════════ */
.auth-screen {
    height: 100svh;
    max-width: var(--app-w);
    margin: 0 auto;
    background: linear-gradient(160deg, #1A0F8F 0%, #3D2FD9 40%, #5C4EFA 75%, #8B7FFB 100%);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 0 120px rgba(0,0,0,0.7);
}

/* Decorative circles */
.auth-screen::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 240px; height: 240px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    pointer-events: none;
}

.auth-screen::after {
    content: '';
    position: absolute;
    bottom: -80px; left: -40px;
    width: 200px; height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    pointer-events: none;
}

.auth-content {
    position: relative;
    z-index: 1;
    padding: 24px 16px 32px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.auth-card {
    background: var(--surface);
    border-radius: var(--r-xl);
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    overflow: hidden;
    border: none;
}

.auth-card .card-body {
    padding: 1.8rem 1.5rem;
}

.fintech-logo {
    width: 64px;
    height: 64px;
    background: var(--brand);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    box-shadow: 0 8px 28px rgba(92,78,250,0.4);
}

.fintech-logo i {
    font-size: 1.7rem;
    color: #fff;
}

.free-badge {
    display: inline-block;
    background: linear-gradient(135deg, #0EB68A, #12C08A);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: var(--r-full);
    letter-spacing: 0.4px;
    box-shadow: 0 3px 12px rgba(18,192,138,0.35);
}

/* Why section on auth */
.why-section {
    background: rgba(255,255,255,0.09);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: var(--r-md);
    backdrop-filter: blur(8px);
    padding: 16px;
    margin-top: 16px;
}

.why-section h6 { color: #E8E4FF !important; font-size: 0.85rem; }
.why-section li { color: rgba(255,255,255,0.82); font-size: 0.82rem; line-height: 1.6; }
.why-section li strong { color: #fff; }
.why-section .bi-check-circle { color: #12C08A !important; }

/* ════════════════════════════════════
   STEP INDICATOR
════════════════════════════════════ */
.step-indicator {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 14px;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-dark);
    transition: all 0.3s ease;
}

.step-dot.active {
    background: var(--brand);
    width: 24px;
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(92,78,250,0.4);
}

.step-dot.done { background: var(--green); }

/* ════════════════════════════════════
   FORMS
════════════════════════════════════ */
.form-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-2);
    margin-bottom: 6px;
}

.form-control,
.form-select {
    border-radius: var(--r-sm);
    border: 1.5px solid var(--border-dark);
    padding: 10px 13px;
    font-size: 0.9rem;
    color: var(--text-1);
    background: var(--surface);
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(92,78,250,0.12);
    outline: none;
}

.form-control::placeholder { color: var(--text-3); }
.form-control-lg { padding: 12px 14px; font-size: 0.95rem; }

.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}

/* OTP Input */
input[name="otp"] {
    background: var(--brand-pale);
    border: 2px solid var(--border-dark);
    color: var(--brand-dark);
    letter-spacing: 0.55em;
    font-size: 1.8rem;
    text-align: center;
    font-weight: 800;
    border-radius: var(--r-md);
    padding: 14px;
}

input[name="otp"]:focus {
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(92,78,250,0.14);
}

/* ════════════════════════════════════
   BUTTONS — global overrides
════════════════════════════════════ */
.btn {
    font-weight: 600;
    border-radius: var(--r-sm);
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--brand) !important;
    border-color: var(--brand) !important;
    box-shadow: var(--shadow-btn);
    color: #fff !important;
}

.btn-primary:hover, .btn-primary:focus {
    background: var(--brand-dark) !important;
    border-color: var(--brand-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(92,78,250,0.45);
}

.btn-primary:active { transform: translateY(0); }

.btn-success {
    background: var(--green) !important;
    border-color: var(--green) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(18,192,138,0.30);
}

.btn-success:hover {
    background: #0CA87A !important;
    border-color: #0CA87A !important;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--red) !important;
    border-color: var(--red) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(240,79,119,0.28);
}

.btn-danger:hover {
    background: #D43C65 !important;
    border-color: #D43C65 !important;
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--brand) !important;
    border-color: var(--brand) !important;
}

.btn-outline-primary:hover {
    background: var(--brand) !important;
    color: #fff !important;
}

.btn-outline-secondary {
    color: var(--text-2) !important;
    border-color: var(--border-dark) !important;
}

.btn-outline-secondary:hover {
    background: var(--bg) !important;
    color: var(--text-1) !important;
    border-color: var(--text-3) !important;
}

.btn-outline-success {
    color: var(--green) !important;
    border-color: var(--green) !important;
}
.btn-outline-success:hover { background: var(--green) !important; color: #fff !important; }

.btn-outline-danger {
    color: var(--red) !important;
    border-color: var(--red) !important;
}
.btn-outline-danger:hover { background: var(--red) !important; color: #fff !important; }

/* Pill-shaped small buttons */
.btn-sm { font-size: 0.78rem; padding: 5px 12px; border-radius: var(--r-full) !important; }
.btn-lg { padding: 12px 24px; font-size: 0.95rem; }

/* ════════════════════════════════════
   CARDS (generic)
════════════════════════════════════ */
.card {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-xs);
    background: var(--surface);
    overflow: hidden;
}

.card-header {
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    padding: 12px 16px;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-2);
}

.card-header.bg-primary {
    background: var(--brand) !important;
    color: #fff;
    border: none;
}

.card-header.bg-dark {
    background: var(--brand-deeper) !important;
    color: #fff;
    border: none;
}

.card-body { padding: 14px 16px; }

/* ════════════════════════════════════
   BADGES
════════════════════════════════════ */
.badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: var(--r-full);
    letter-spacing: 0.2px;
}

.badge.bg-success  { background: var(--green) !important; }
.badge.bg-danger   { background: var(--red)   !important; }
.badge.bg-warning  { background: var(--amber) !important; color: #fff !important; }
.badge.bg-primary  { background: var(--brand) !important; }

/* Custom type badges */
.badge-owed-me  { background: var(--green-light); color: var(--green); }
.badge-i-owe    { background: var(--red-light);   color: var(--red); }
.badge-paid     { background: var(--border);       color: var(--text-3); }

/* ════════════════════════════════════
   ALERTS
════════════════════════════════════ */
.alert {
    font-size: 0.84rem;
    padding: 10px 14px;
    border-radius: var(--r-sm);
    border: none;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.alert-success {
    background: var(--green-light);
    color: #097A5A;
    border-left: 3px solid var(--green);
}

.alert-danger {
    background: var(--red-light);
    color: #B5334F;
    border-left: 3px solid var(--red);
}

.alert-warning {
    background: var(--amber-light);
    color: #9A6200;
    border-left: 3px solid var(--amber);
}

.alert-info {
    background: var(--brand-pale);
    color: var(--brand-dark);
    border-left: 3px solid var(--brand);
}

/* ════════════════════════════════════
   TABLES
════════════════════════════════════ */
.table-responsive { border-radius: var(--r-sm); overflow: hidden; }

.table {
    margin-bottom: 0;
    font-size: 0.83rem;
    color: var(--text-1);
}

.table thead th {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-3);
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    padding: 9px 12px;
    white-space: nowrap;
}

.table tbody td {
    vertical-align: middle;
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-1);
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }

/* ════════════════════════════════════
   NAV PILLS (tabs)
════════════════════════════════════ */
.nav-pills .nav-link {
    border-radius: var(--r-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-2);
    transition: all 0.2s;
}

.nav-pills .nav-link.active {
    background: var(--brand) !important;
    color: #fff !important;
    box-shadow: 0 3px 12px rgba(92,78,250,0.30);
}

.nav-pills .nav-link:not(.active):hover {
    background: var(--brand-pale);
    color: var(--brand);
}

/* ════════════════════════════════════
   MODAL
════════════════════════════════════ */
.modal-content {
    border-radius: var(--r-xl);
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
}

.modal-body { padding: 20px; }
.modal-footer { border-top: 1px solid var(--border); padding: 14px 20px; }

/* ════════════════════════════════════
   PROGRESS BAR (Bootstrap override)
════════════════════════════════════ */
.progress {
    height: 6px;
    border-radius: 99px;
    background: var(--border);
    overflow: hidden;
}

.progress-bar {
    border-radius: 99px;
    background: var(--brand);
}

.progress-bar.bg-success { background: var(--green) !important; }
.progress-bar.bg-danger  { background: var(--red)   !important; }
.progress-bar.bg-warning { background: var(--amber) !important; }

/* ════════════════════════════════════
   ADSENSE
════════════════════════════════════ */
.ad-container { background: transparent; padding: 3px 0; }
.ad-container:empty { display: none; }
ins.adsbygoogle { min-height: 30px; }

/* ════════════════════════════════════
   LINKS
════════════════════════════════════ */
a { color: var(--brand); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--brand-dark); }

/* ════════════════════════════════════
   TEXT UTILITIES
════════════════════════════════════ */
.text-success { color: var(--green) !important; }
.text-danger  { color: var(--red)   !important; }
.text-primary { color: var(--brand) !important; }
.text-muted   { color: var(--text-3) !important; }

/* ════════════════════════════════════
   SCROLLBAR
════════════════════════════════════ */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-light); }

/* ════════════════════════════════════
   IMPORTANCE / COLLAPSIBLE CARD
════════════════════════════════════ */
.importance-card {
    background: var(--brand-pale);
    border: 1.5px solid rgba(92,78,250,0.18);
    border-radius: var(--r-md);
    overflow: hidden;
}

.importance-card .toggle-btn {
    width: 100%;
    background: none;
    border: none;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    color: var(--brand-dark);
    font-weight: 700;
    font-size: 0.88rem;
    text-align: left;
}

.importance-card .body { padding: 2px 14px 14px; }
.importance-card .body li { font-size: 0.82rem; color: var(--text-2); line-height: 1.7; }

#whyChevron { transition: transform 0.3s ease; font-size: 0.75rem; }

/* ════════════════════════════════════
   DONATION / ABOUT
════════════════════════════════════ */
.donation-info {
    border: 2px dashed rgba(92,78,250,0.25);
    border-radius: var(--r-md);
    background: var(--brand-pale);
}

/* ════════════════════════════════════
   WELCOME BANNER (old compat)
════════════════════════════════════ */
.welcome-banner {
    background: var(--brand);
    color: #fff;
    border-radius: var(--r-md);
    padding: 14px 16px;
    margin-bottom: 14px;
}

.welcome-banner h5 { font-size: 1rem; margin-bottom: 2px; font-weight: 700; }
.welcome-banner p  { font-size: 0.78rem; opacity: 0.8; margin-bottom: 0; }

/* ════════════════════════════════════
   SUMMARY LABEL (old compat)
════════════════════════════════════ */
.summary-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 700;
    color: var(--text-3);
    margin-bottom: 2px;
}

/* ════════════════════════════════════
   PAGE TRANSITION — content only
   Header & bottom nav never animate
════════════════════════════════════ */

/* app-content must be a positioning context */
.app-content {
    position: relative;
}

/* Entrance: content slides up from below */
.app-content.page-enter {
    opacity: 0;
    transform: translateY(18px);
}

.app-content.page-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 280ms ease, transform 280ms ease;
}

/* Exit: content fades + slides up slightly */
.app-content.page-exit {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 200ms ease, transform 200ms ease;
    pointer-events: none;
}

/* ── Top progress bar (inside topbar) ── */
#navProgressBar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: rgba(255, 255, 255, 0.75);
    border-radius: 0 3px 3px 0;
    pointer-events: none;
    transition: none;
}

#navProgressBar.running {
    animation: nav-progress 2.4s cubic-bezier(0.1, 0.6, 0.4, 1) forwards;
}

@keyframes nav-progress {
    0%   { width: 0%; opacity: 1; }
    50%  { width: 65%; }
    80%  { width: 82%; }
    100% { width: 90%; }
}

/* ── Loading spinner overlay (slow internet) ── */
#pageLoader {
    position: absolute;
    inset: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    z-index: 50;
    opacity: 0;
    animation: loader-fade-in 180ms ease 220ms forwards; /* appears only after exit */
}

@keyframes loader-fade-in {
    to { opacity: 1; }
}

.loader-ring {
    width: 42px;
    height: 42px;
    border: 3.5px solid var(--border-dark);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-3);
    letter-spacing: 0.2px;
}

/* ════════════════════════════════════
   RESPONSIVE — tiny screens
════════════════════════════════════ */
@media (max-width: 380px) {
    .app-content { padding-left: 10px; padding-right: 10px; }
    .balance-banner .amount { font-size: 1.7rem; }
    .person-desc { max-width: 120px; }
}
