@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* WEBSITE-A identity v2: clean professional — corporate blue on white, cool slate greys. Light-first. */
:root {
    --primary: #2563EB;
    --primary-light: #3B82F6;
    --primary-dark: #1D4ED8;
    --primary-darkest: #1E3A8A;
    --secondary: #0EA5E9;
    --success: #15803D;
    --danger: #B91C1C;
    --warning: #B45309;
    --dark: #0F172A;
    --darker: #020617;
    --light: #F8FAFC;
    --sidebar-bg: #0A0F24;
    --accent: #0EA5E9;
    --accent-light: #7DD3FC;
    --glass: rgba(37, 99, 235, 0.06);
    --glass-hover: rgba(37, 99, 235, 0.10);
    --card-bg: #FFFFFF;
    --bg-page: #F6F7FB;
    --border: #E6E9F1;
    --border-blue: rgba(37, 99, 235, 0.18);
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --shadow-sm: 0 1px 2px rgba(15,23,42,0.05), 0 1px 3px rgba(15,23,42,0.04);
    --shadow-md: 0 2px 8px rgba(15,23,42,0.06), 0 1px 3px rgba(15,23,42,0.04);
    --shadow-lg: 0 8px 24px rgba(15,23,42,0.09), 0 2px 8px rgba(15,23,42,0.05);
    --shadow-blue: 0 2px 10px rgba(37, 99, 235, 0.18);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* One family everywhere — Inter with tightly tracked headings. Clean, corporate. */
h1, h2, h3, h4,
.greeting, .logo, .modal-title, .page-title, .dash-hero h1, .dash-hero h2 {
    font-family: 'Inter', -apple-system, sans-serif;
    letter-spacing: -0.02em;
}

html {
    /* Kill the browser's own native pull-to-refresh — the app has its own
       custom pull-to-refresh gesture (setupPullToRefresh in dashboard.js);
       without this, mobile Chrome/PWA overscroll bounce can trigger an
       uncontrolled native reload on top of it. */
    overscroll-behavior-y: contain;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    max-width: 100%;
    overflow-x: hidden;
    padding-bottom: 5rem;
    overscroll-behavior-y: contain;
}

/* ─── App Container ───────────────────────────────────────────── */
.app-container {
    padding: 1.25rem 1rem;
    max-width: 100%;
    margin: 0 auto;
}

/* ─── Greeting Section ────────────────────────────────────────── */
.greeting-section {
    margin-bottom: 1.5rem;
    padding: 1.25rem 0 1rem;
    border-bottom: 1px solid var(--border);
}

.greeting {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    margin-bottom: 0.25rem;
}

.greeting-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ─── Header ──────────────────────────────────────────────────── */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    background: var(--card-bg);
    backdrop-filter: none;
    z-index: 100;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 var(--border);
    min-height: 54px;
}

.logo {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification-bell {
    position: relative;
    background: rgba(148,163,184,0.14);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    border-radius: 9px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-bell:hover {
    background: rgba(59, 130, 246,0.12);
    border-color: rgba(37, 99, 235, 0.25);
    color: var(--primary);
}

.notification-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: var(--danger);
    color: white;
    border-radius: 50%;
    width: 17px;
    height: 17px;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    box-shadow: var(--shadow-blue);
}

.mobile-logout-btn {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    border: 1px solid #FEE2E2;
    background: #FEF2F2;
    color: var(--danger);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.15s;
}

.mobile-logout-btn:hover {
    background: #FECACA;
}

@media (max-width: 767px) {
    .mobile-logout-btn {
        display: inline-flex;
    }
}

/* ─── Notification Dropdown ───────────────────────────────────── */
.notification-wrapper { position: relative; }

.notification-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    max-height: 400px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.notification-dropdown.active {
    display: flex;
}

.notification-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
}

.notification-header h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.mark-all-read {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    cursor: pointer;
    transition: background 0.15s;
}

.notification-item:hover {
    background: var(--card-bg);
}

.notification-item.unread {
    background: rgba(59, 130, 246,0.12);
}

.notification-icon-small {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-icon-small.success {
    background: #DCFCE7;
    color: var(--success);
}

.notification-icon-small.error {
    background: #FEE2E2;
    color: var(--danger);
}

.notification-icon-small.info {
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
}

.notification-content-small { flex: 1; }

.notification-title-small {
    font-weight: 600;
    font-size: 0.84rem;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}

.notification-message-small {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.notification-time {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.notification-footer {
    padding: 0.75rem;
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--card-bg);
}

.view-all-notifications {
    color: var(--primary);
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 600;
}

/* ─── Toast Notification System ───────────────────────────────── */
.notification-container {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4000;
    width: 90%;
    max-width: 400px;
}

.notification {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(-100px);
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.success { border-left: 4px solid var(--success); }
.notification.error   { border-left: 4px solid var(--danger); }
.notification.warning { border-left: 4px solid var(--warning); }
.notification.info    { border-left: 4px solid var(--primary); }

.notification-icon { font-size: 1.2rem; flex-shrink: 0; }
.notification.success .notification-icon { color: var(--success); }
.notification.error   .notification-icon { color: var(--danger); }
.notification.warning .notification-icon { color: var(--warning); }
.notification.info    .notification-icon { color: var(--primary); }

.notification-content { flex: 1; }

.notification-title {
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}

.notification-message {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem;
}

.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--success);
    border-radius: 0 0 0 8px;
    transition: width 0.1s linear;
}

.notification.error   .notification-progress { background: var(--danger); }
.notification.warning .notification-progress { background: var(--warning); }
.notification.info    .notification-progress { background: var(--primary); }

.admin-notice-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background:
        radial-gradient(circle at 50% 20%, rgba( 59, 130, 246, 0.18), transparent 34%),
        rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.admin-notice-overlay.active {
    opacity: 1;
    visibility: visible;
}

.admin-notice-card {
    width: min(92vw, 520px);
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 1.55rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    transform: translateY(20px) scale(0.96);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

body.admin-notice-open {
    overflow: hidden;
}

.admin-notice-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), #2563EB, #3B82F6);
}

.admin-notice-overlay.active .admin-notice-card {
    transform: translateY(0) scale(1);
}

.admin-notice-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.admin-notice-accent {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding-right: 2.5rem;
    margin: 0.2rem 0 1rem;
}

.admin-notice-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba( 59, 130, 246, 0.1);
    color: var(--primary);
    font-size: 1.45rem;
}

.admin-notice-kicker {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.admin-notice-title {
    color: var(--text-primary);
    font-size: 1.65rem;
    line-height: 1.2;
    margin: 0 0 0.75rem;
}

.admin-notice-message {
    color: var(--text-secondary);
    font-size: 0.96rem;
    line-height: 1.65;
    margin: 0 0 1.25rem;
    white-space: pre-wrap;
    max-height: 42vh;
    overflow-y: auto;
}

.admin-notice-action {
    width: 100%;
    justify-content: center;
}

.admin-notice-overlay.success .admin-notice-icon {
    color: var(--success);
    background: rgba(59, 130, 246, 0.12);
}

.admin-notice-overlay.warning .admin-notice-icon {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.14);
}

.admin-notice-overlay.error .admin-notice-icon {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.12);
}

@media (max-width: 480px) {
    .admin-notice-overlay {
        align-items: flex-end;
        padding: 0.85rem;
    }

    .admin-notice-card {
        width: 100%;
        border-radius: 22px;
        padding: 1.35rem;
    }

    .admin-notice-title {
        font-size: 1.38rem;
    }
}

/* ─── Stats Cards ─────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.1rem;
    text-align: left;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, border-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #CBD5E1;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0.15rem 0 0.1rem;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.stat-change {
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 0.2rem;
    color: var(--text-muted);
}

.stat-card-support:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba( 59, 130, 246,0.1);
}

.stat-card-support:active { transform: scale(0.98); }

/* ─── Quick Actions ────────────────────────────────────────────── */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    padding: 1rem 1.25rem 1.25rem;
}

.action-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.9rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
}

.action-btn:hover {
    background: rgba(59, 130, 246,0.12);
    border-color: rgba(37, 99, 235, 0.25);
}

.action-icon {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(37, 99, 235, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--primary);
}

.action-text {
    font-size: 0.71rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
}

/* ─── WhatsApp Group Card ─────────────────────────────────────── */
.whatsapp-card {
    background: rgba(59, 130, 246,0.12);
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: 14px;
    padding: 1.1rem 1.2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.15s;
    box-shadow: var(--shadow-sm);
}

.whatsapp-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(37, 99, 235,0.15);
    border-color: #86EFAC;
}

.whatsapp-card .whatsapp-title {
    color: #15803D;
}

.whatsapp-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #15803D;
}

.whatsapp-desc {
    font-size: 0.85rem;
    color: #166534;
    opacity: 0.85;
}

/* ─── Reseller / Feature Cards ────────────────────────────────── */
.reseller-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.3rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.reseller-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.reseller-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: rgba(59, 130, 246,0.12);
    border: 1px solid rgba(37, 99, 235, 0.25);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.reseller-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.reseller-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.55;
}

.reseller-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    margin-bottom: 1.2rem;
}

.reseller-feature {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.reseller-feature i {
    color: var(--primary);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.reseller-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.reseller-stat {
    text-align: center;
    padding: 0.8rem;
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.reseller-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.reseller-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ─── Network Section ─────────────────────────────────────────── */
.network-section { margin-bottom: 1.5rem; }

.section-title {
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.network-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 1.1rem 1.25rem 0;
}

.network-tab {
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.network-tab:hover {
    border-color: #86efac;
    background: var(--card-bg);
}

.network-tab.active {
    background: rgba(59, 130, 246,0.14);
    border-color: var(--primary);
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba( 37, 99, 235,0.08);
}

.network-tab.active .network-name {
    color: var(--primary);
    font-weight: 700;
}

.network-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: white;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border: 1px solid var(--border);
}

.network-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.network-name {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ─── Sub-network selector (segmented control, e.g. MTN / MTN Express) ─── */
.sub-network-tabs {
    display: inline-flex;
    gap: 4px;
    margin: 0 0 1.1rem;
    padding: 4px;
    background: rgba(148,163,184,0.12);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-width: 100%;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.sub-network-tabs::-webkit-scrollbar { display: none; }

.sub-network-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.5rem 1.15rem;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.18s, background 0.18s, box-shadow 0.18s;
    font-family: inherit;
}

.sub-network-pill::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: background 0.18s;
}

.sub-network-pill:hover { color: var(--primary); }

.sub-network-pill.active {
    background: var(--card-bg);
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(15,23,42,0.12);
}

.sub-network-pill.active::before { background: var(--primary); }

/* ─── Bundle Grid ─────────────────────────────────────────────── */
.bundle-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 0;
    padding: 1rem 1.25rem 1.25rem;
}

.bundle-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.95rem 0.8rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    position: relative;
    overflow: hidden;
}

.bundle-card:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246,0.12);
    box-shadow: 0 0 0 3px rgba( 37, 99, 235,0.08);
}

.bundle-card.popular::after {
    content: 'Popular';
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    background: #FEF3C7;
    border: 1px solid #FDE68A;
    color: #92400E;
    font-size: 0.58rem;
    font-weight: 700;
    padding: 0.12rem 0.38rem;
    border-radius: 4px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.bundle-size {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    letter-spacing: -0.01em;
}

.bundle-price {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.bundle-validity {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.bundle-cta {
    margin-top: 0.5rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ─── Promo Banner ────────────────────────────────────────────── */
.promo-banner {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 16px;
    padding: 1.3rem;
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-blue);
    color: white;
}

.promo-banner::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 180px;
    height: 180px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}

.promo-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.promo-desc {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* ─── Referral Section ────────────────────────────────────────── */
.referral-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.referral-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.referral-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.referral-code {
    background: rgba(59, 130, 246,0.12);
    border-radius: 10px;
    padding: 0.8rem;
    font-family: monospace;
    font-size: 1.05rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    border: 1px dashed rgba(37, 99, 235, 0.25);
    color: var(--primary);
    font-weight: 700;
}

.referral-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.referral-stat {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 0.8rem;
    border: 1px solid var(--border);
}

.referral-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.referral-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ─── Recent Transactions ─────────────────────────────────────── */
.transactions {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
}

.transaction-item:last-child { border-bottom: none; }

.transaction-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.transaction-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246,0.12);
    color: var(--primary);
    font-size: 1rem;
    border: 1px solid rgba(37, 99, 235, 0.25);
    flex-shrink: 0;
}

.transaction-details h4 {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.transaction-details span {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.transaction-amount {
    font-weight: 700;
    font-size: 0.875rem;
}

.transaction-amount.positive { color: var(--success); }
.transaction-amount.negative { color: var(--danger); }

/* ─── Store Sales Card ────────────────────────────────────────── */
.store-sales-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.store-sales-title {
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--text-primary);
}

.store-sales-controls {
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
}

.store-sales-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.store-sales-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-bg);
    padding: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.store-sales-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.store-sales-line1 {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.store-sales-line2 {
    color: var(--text-muted);
    font-size: 0.775rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.store-sales-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.72rem;
    border: 1px solid transparent;
    font-weight: 600;
}

.store-sales-status.completed  { color: #15803D; background: #DCFCE7; border-color: #BBF7D0; }
.store-sales-status.processing { color: #2563EB; background: rgba(37, 99, 235, 0.12); border-color: rgba(37, 99, 235, 0.25); }
.store-sales-status.pending    { color: #92400E; background: #FEF3C7; border-color: #FCD34D; }
.store-sales-status.failed     { color: #DC2626; background: #FEE2E2; border-color: #FECACA; }

.store-sales-right { text-align: right; flex-shrink: 0; }

.store-sales-amount {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 700;
}

.store-sales-profit {
    color: var(--success);
    font-size: 0.78rem;
    margin-top: 0.1rem;
}

/* ─── Store Page ──────────────────────────────────────────────── */
.store-admin-shell { position: relative; }

.store-layout {
    display: flex;
    min-height: 100vh;
}

/* Store Desktop Sidebar */
.store-sidebar {
    width: 230px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(255,255,255,0.05);
    padding: 0 0 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.store-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 0.75rem;
}

.store-sidebar-brand .brand-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
}

.store-sidebar-brand span {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
}

.store-sidebar-section-label {
    font-size: 0.62rem;
    font-weight: 700;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0 1rem 0.4rem;
    margin-top: 0.5rem;
}

.store-nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem 1rem;
    margin: 0.1rem 0.5rem;
    border-radius: 9px;
    border: none;
    background: none;
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    width: calc(100% - 1rem);
    transition: all 0.15s ease;
    position: relative;
}

.store-nav-item i {
    font-size: 1.05rem;
    flex-shrink: 0;
    width: 1.1rem;
    text-align: center;
}

.store-nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.store-nav-item.active {
    background: rgba(255,255,255,0.18);
    color: #fff;
    font-weight: 600;
}

.store-nav-item.active::before {
    content: '';
    position: absolute;
    left: -0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: #fff;
    border-radius: 0 3px 3px 0;
}

.store-nav-exit {
    margin-top: auto !important;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 0.75rem;
    color: #FCA5A5 !important;
}

.store-nav-exit:hover {
    background: rgba(239,68,68,0.18) !important;
    color: #FEE2E2 !important;
}

/* Store Content */
.store-content {
    flex: 1;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    height: 100vh;
    background: var(--bg-page);
}

/* Store Top Bar */
.store-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 5;
}

.store-topbar-title { flex: 1; }

.store-topbar-title .page-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.store-topbar-title .page-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Store Section Panels */
.store-section-panel {
    display: none;
    padding: 1.5rem 1.25rem 2.5rem;
    animation: storeFadeIn 0.18s ease;
}

@keyframes storeFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.store-section-panel.active { display: block; }

/* Store cards now use var(--card-bg), so text follows theme vars and adapts to dark mode. */
.store-section-panel { color: var(--text-secondary); }
.store-card-title, .store-section-heading { color: var(--text-primary); }

.store-section-heading {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.store-section-heading i { color: var(--primary); }

/* Store KPI Cards */
.store-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .store-kpi-grid { grid-template-columns: repeat(4, 1fr); }
}

.store-kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

.store-kpi-card:hover { box-shadow: var(--shadow-md); }

.store-kpi-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 14px 14px 0 0;
}

.store-kpi-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-bottom: 0.6rem;
}

.store-kpi-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.2rem;
}

.store-kpi-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* Store Action Row */
.store-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 520px) {
    .store-action-row { grid-template-columns: 1fr; }
}

.store-action-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    box-shadow: var(--shadow-sm);
}

.store-action-card .ac-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.store-action-card .ac-body { flex: 1; }

.store-action-card .ac-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.store-action-card .ac-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.store-action-card .ac-btn {
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.store-action-card .ac-btn:hover { opacity: 0.85; }

/* Store Cards */
.store-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.store-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.store-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.store-card-title i { color: var(--primary); }

/* Mini sale items */
.store-mini-sale {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
}

.store-mini-sale:last-child { border-bottom: none; }

.store-mini-sale .ms-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.store-mini-sale .ms-body { flex: 1; min-width: 0; }

.store-mini-sale .ms-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.store-mini-sale .ms-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.store-mini-sale .ms-right { text-align: right; flex-shrink: 0; }

.store-mini-sale .ms-amount {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--success);
}

.store-mini-sale .ms-status {
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
}

/* Store Panel */
.store-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.store-sales-item { border-radius: 10px; padding: 0.9rem; }
.store-sales-line1 { font-size: 0.88rem; }
.store-sales-line2 {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.72rem;
}

/* Store Mobile Hamburger */
.store-mobile-menu-btn {
    display: none;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    border-radius: 9px;
    border: 1px solid var(--border);
    background: rgba(59, 130, 246,0.12);
    color: var(--primary);
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
}

/* Store Mobile Nav Overlay */
.store-mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.4);
    z-index: 3000;
    backdrop-filter: blur(3px);
}

.store-mobile-nav-overlay.active { display: block; }

/* Store Mobile Nav Drawer */
.store-mobile-nav {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: min(260px, 82vw);
    height: 100%;
    overflow-y: auto;
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(255,255,255,0.05);
    box-shadow: 8px 0 40px rgba(15,23,42,0.3);
    z-index: 3001;
    flex-direction: column;
}

.store-mobile-nav.active { display: flex; }

.store-mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1rem 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
    background: var(--sidebar-bg);
    z-index: 1;
}

.store-mobile-nav-header h4 {
    margin: 0;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.store-mobile-nav-header h4 i { color: rgba(255,255,255,0.7); }

.store-mobile-nav-header button {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 7px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.store-mobile-nav-items {
    padding: 0.75rem 0.6rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.store-mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.9rem;
    border-radius: 9px;
    border: none;
    background: none;
    color: rgba(255,255,255,0.6);
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: all 0.15s ease;
}

.store-mobile-nav-item i {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 1.1rem;
    text-align: center;
}

.store-mobile-nav-item:hover { background: rgba(255,255,255,0.1); color: #fff; }
.store-mobile-nav-item.active {
    background: rgba(255,255,255,0.18);
    color: #fff;
    font-weight: 600;
}

@media (max-width: 900px) {
    .store-mobile-menu-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }
    .store-sidebar { display: none !important; }
    .store-layout { height: 100vh; }
    .store-content { height: 100vh; }
}

@media (max-width: 600px) {
    .store-section-panel { padding: 1rem 0.85rem 2rem; }
    .store-kpi-value { font-size: 1.1rem; }
}

/* ─── View All ────────────────────────────────────────────────── */
.view-all {
    display: block;
    text-align: center;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 1rem;
    text-decoration: none;
    letter-spacing: 0.02em;
}

/* ─── Bottom Navigation ───────────────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    padding: 0.4rem 0.25rem calc(0.4rem + env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -1px 0 var(--border), 0 -4px 16px rgba(15,23,42,0.06);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.22rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: color 0.15s, background 0.15s;
    padding: 0.4rem 0.5rem;
    border-radius: 10px;
    position: relative;
    flex: 1;
    min-height: 44px;
}

.nav-item.active {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.08);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2.5px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}

.nav-icon {
    font-size: 1.3rem;
    display: block;
    line-height: 1;
}

/* ─── Profile Tabs ────────────────────────────────────────────── */
.profile-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.2rem;
}

.profile-tab {
    padding: 0.8rem 1rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: color 0.15s;
}

.profile-tab.active {
    border-bottom-color: var(--primary);
    color: var(--primary);
    font-weight: 700;
}

.profile-tab-content { display: none; }
.profile-tab-content.active { display: block; }

.security-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.security-item:last-child { border-bottom: none; }

.security-info h4 {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.2rem;
    color: var(--text-primary);
}

.security-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.security-status {
    font-size: 0.78rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 700;
}

.security-status.enabled {
    background: #DCFCE7;
    color: #15803D;
}

.security-status.disabled {
    background: #FEE2E2;
    color: var(--danger);
}

/* ─── Wallet ──────────────────────────────────────────────────── */
.wallet-breakdown { margin-bottom: 1.5rem; }

.wallet-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
}

.wallet-item:last-child { border-bottom: none; }

.wallet-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.wallet-amount {
    font-weight: 700;
    color: var(--text-primary);
}

.wallet-amount.positive { color: var(--success); }

.wallet-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.wallet-action {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.wallet-action:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246,0.12);
    transform: translateY(-1px);
    box-shadow: var(--shadow-blue);
}

.wallet-action-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.wallet-action-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ─── Transaction Filters ─────────────────────────────────────── */
.transaction-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.transaction-filter {
    padding: 0.45rem 1rem;
    border-radius: 20px;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.15s;
}

.transaction-filter.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: var(--shadow-blue);
}

/* ─── Modals ──────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Above full-screen pages (history/store/foreign are z-index 3000) so modals
       opened from those pages are visible. */
    z-index: 4000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s;
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

#topupModal,
#manualDepositModal,
#claimPaymentModal {
    z-index: 3000;
}

.modal {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.5rem;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(24px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
    box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.close-modal {
    background: rgba(148,163,184,0.14);
    border: none;
    color: var(--text-secondary);
    font-size: 1.3rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.close-modal:hover { background: rgba(148,163,184,0.18); }

.form-group { margin-bottom: 1.2rem; }

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba( 59, 130, 246,0.12);
}

.form-input::placeholder { color: var(--text-muted); }

.btn {
    padding: 0.85rem;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    letter-spacing: 0.01em;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-blue);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba( 59, 130, 246,0.35);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ─── Share mode tabs (Single / Bulk / Buy / History) ─────────── */
.share-mode-tabs {
    background: rgba(148,163,184,0.12);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
    gap: 4px !important;
}
.share-mode-tab {
    background: transparent;
    color: var(--text-secondary);
    border: none !important;
    padding: 0.5rem 0.4rem !important;
    font-size: 0.82rem !important;
    font-weight: 600;
    border-radius: 9px;
    box-shadow: none;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.share-mode-tab.active {
    background: var(--card-bg);
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(15,23,42,0.12);
}

/* ─── Share balance card (iShare / Telecel share) ─────────────── */
.share-balance-card {
    border-radius: 16px;
    padding: 1.2rem 1.25rem;
    margin-bottom: 1.1rem;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-darkest, #1E3A8A) 0%, var(--primary-dark) 60%, var(--primary) 100%);
}
.share-balance-card.telecel {
    background: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 55%, #ef4444 100%);
}
.share-balance-label {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
    color: rgba(255,255,255,0.72);
}
.share-balance-value {
    font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; margin-top: 0.2rem;
    font-variant-numeric: tabular-nums;
}

/* ─── Store Access ("Unlock Your Reseller Store") Modal ───────── */
.sa-hero {
    text-align: center;
    padding: 1.5rem 1.25rem;
    margin-bottom: 1.35rem;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary-darkest, #1E3A8A) 0%, var(--primary-dark) 55%, var(--primary) 100%);
    color: #fff;
}
.sa-hero-icon {
    width: 64px; height: 64px;
    margin: 0 auto 0.9rem;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.25);
    font-size: 1.8rem; color: #fff;
}
.sa-hero-title { font-size: 1.35rem; font-weight: 800; color: #fff; margin: 0 0 0.35rem; letter-spacing: -0.02em; }
.sa-hero-sub { font-size: 0.9rem; color: rgba(255,255,255,0.85); margin: 0 0 1rem; line-height: 1.5; }
.sa-fee-pill {
    display: inline-block;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 999px;
    padding: 0.4rem 1.1rem;
    color: #fff; font-weight: 700; font-size: 0.95rem;
}
.sa-section-label {
    font-size: 0.72rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.08em;
    display: flex; align-items: center; gap: 0.4rem;
    margin-bottom: 0.7rem;
}
.sa-section-label i { color: var(--primary); }
.sa-features { display: flex; flex-direction: column; gap: 0.55rem; margin-bottom: 1.35rem; }
.sa-feature {
    display: flex; align-items: center; gap: 0.8rem;
    padding: 0.7rem 0.8rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
}
.sa-feature-icon {
    width: 36px; height: 36px; flex-shrink: 0;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.05rem;
}
.sa-feature-text { min-width: 0; }
.sa-feature-text strong { display: block; color: var(--text-primary); font-size: 0.9rem; margin-bottom: 0.1rem; }
.sa-feature-text span { font-size: 0.78rem; color: var(--text-muted); line-height: 1.4; }
.sa-balance {
    display: flex; align-items: center; gap: 0.85rem;
    padding: 0.9rem 1rem;
    margin-bottom: 1.35rem;
    border-radius: 12px;
    background: rgba(37,99,235,0.06);
    border: 1px solid var(--border-blue, rgba(37,99,235,0.18));
}
.sa-balance-icon {
    width: 42px; height: 42px; flex-shrink: 0;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(37,99,235,0.12); color: var(--primary);
    font-size: 1.25rem;
}
.sa-balance-text { display: flex; flex-direction: column; }
.sa-balance-text span { font-size: 0.8rem; color: var(--text-muted); }
.sa-balance-text strong { font-size: 1.2rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.01em; }
.sa-cta { width: 100%; padding: 0.95rem; font-size: 1rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; }
.sa-trust { text-align: center; font-size: 0.78rem; color: var(--text-muted); margin-top: 0.9rem; }
.sa-trust i { color: var(--success); }

/* ─── Purchase Summary Card ───────────────────────────────────── */
.purchase-summary-card {
    background: linear-gradient(135deg, var(--primary-darkest, #1E3A8A) 0%, var(--primary-dark) 60%, var(--primary) 100%);
    border-radius: 14px;
    padding: 1.1rem 1.2rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.purchase-summary-net {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    margin-bottom: 0.6rem;
}

.purchase-summary-main {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.purchase-summary-size {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.purchase-summary-price {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.purchase-summary-validity {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.72);
}

/* ─── Purchase Method Options ─────────────────────────────────── */
.purchase-methods {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.purchase-method-option {
    display: block;
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    border-radius: 12px;
    padding: 0.75rem 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.purchase-method-option input { display: none; }

.purchase-method-option.active {
    border-color: var(--primary);
    background: rgba(59, 130, 246,0.14);
    box-shadow: 0 0 0 3px rgba( 59, 130, 246,0.08);
}

.purchase-method-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.84rem;
}

.purchase-method-title i { color: var(--primary); font-size: 1rem; }

.purchase-method-desc {
    margin-top: 0.3rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.35;
}

.purchase-fee-note {
    display: block;
    margin-top: 0.45rem;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.purchase-disclaimer-box {
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.22);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.1rem;
}

.purchase-disclaimer-text {
    margin: 0;
    font-size: 0.78rem;
    color: #b91c1c;
    line-height: 1.65;
}

.purchase-disclaimer-text i { margin-right: 0.15rem; }

/* ─── Loading Spinner ─────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 0.5rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    color: var(--text-muted);
}

.loading-spinner::after {
    content: '';
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ─── Amount Options ──────────────────────────────────────────── */
.amount-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.amount-option {
    padding: 0.75rem;
    border: 1.5px solid var(--border);
    border-radius: 9px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--card-bg);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.amount-option.selected {
    border-color: var(--primary);
    background: rgba(59, 130, 246,0.12);
    color: var(--primary);
    box-shadow: 0 0 0 3px rgba( 59, 130, 246,0.08);
}

/* ─── History Page ────────────────────────────────────────────── */
.history-page {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(circle at top left, rgba( 59, 130, 246, 0.08), transparent 30%),
        var(--bg-page);
    z-index: 3000;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.history-page.active { transform: translateX(0); }

.page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 10;
}

.back-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(148,163,184,0.14);
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.3rem;
    transition: all 0.15s;
}

.back-btn:hover {
    background: rgba(59, 130, 246,0.12);
    border-color: var(--primary);
    color: var(--primary);
}

.page-title {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.02em;
}

.history-controls {
    position: sticky;
    top: 71px;
    z-index: 9;
    background: var(--bg-page);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 1rem;
}

.history-filters {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 0 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.history-search {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    padding: 0.7rem 0.85rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.history-search i {
    color: var(--text-secondary);
    font-size: 1rem;
}

.history-search input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-size: 0.9rem;
}

.history-search input::placeholder {
    color: #94a3b8;
}

.history-filters::-webkit-scrollbar { display: none; }

.filter-btn {
    padding: 0.45rem 1rem;
    border-radius: 20px;
    background: rgba(148,163,184,0.14);
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.15s;
}

.filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: var(--shadow-blue);
}

.history-list { padding: 1rem 1rem 1rem; }

.history-results-summary {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin: 0.15rem 0 0.75rem;
}

.history-item {
    position: relative;
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.history-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, #3B82F6, #2563EB);
}

.history-purchase::before { background: #3B82F6; }
.history-topup::before { background: #0EA5E9; }
.history-transfer::before { background: #f97316; }
.history-afa_registration::before,
.history-store_access::before { background: #7c3aed; }

.history-item:hover {
    border-color: rgba( 59, 130, 246, 0.28);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.history-info {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.history-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: var(--primary);
    border: 1px solid rgba(37, 99, 235, 0.25);
    flex: 0 0 auto;
}

.history-topup .history-icon {
    background: #ecfdf5 !important;
    border-color: #bbf7d0 !important;
    color: #047857 !important;
}

.history-transfer .history-icon {
    background: #fff7ed !important;
    border-color: #fed7aa !important;
    color: #c2410c !important;
}

.history-details h4 {
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0;
    color: var(--text-primary);
}

.history-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}

.history-date-row,
.history-meta-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.77rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.history-id-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.75;
    margin-top: 0.2rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.history-type-pill,
.history-status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.history-type-pill {
    color: #2563EB;
    background: rgba(37, 99, 235, 0.12);
    padding: 0.28rem 0.5rem;
}

.history-status-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.55rem;
}

.history-status-pill {
    padding: 0.34rem 0.6rem;
}

.history-status-pill.success {
    color: #047857;
    background: #d1fae5;
}

.history-status-pill.warning {
    color: #b45309;
    background: #fef3c7;
}

.history-status-pill.danger {
    color: #b91c1c;
    background: #fee2e2;
}

.history-status-pill.neutral {
    color: var(--text-secondary);
    background: rgba(148,163,184,0.14);
}

.history-check-btn {
    border: 0;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.34rem 0.6rem;
}

.history-report-btn {
    border: 0;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.34rem 0.6rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.history-report-btn:hover {
    background: #fecaca;
}

.history-report-btn i {
    font-size: 0.78rem;
}

.history-reorder-btn {
    border: 0;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.12);
    color: #2563EB;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.34rem 0.6rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.history-reorder-btn:hover {
    background: rgba(37, 99, 235, 0.25);
}

.history-reorder-btn i {
    font-size: 0.78rem;
}

.history-cancel-btn {
    border: 0;
    border-radius: 999px;
    background: #fef3c7;
    color: #b45309;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.34rem 0.6rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.history-cancel-btn:hover {
    background: #fde68a;
}

.history-cancel-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.history-cancel-btn i {
    font-size: 0.78rem;
}

/* --- Saved beneficiaries (purchase modal) --- */
.bene-wrap {
    margin-top: 0.6rem;
}

.bene-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.bene-empty {
    font-size: 0.75rem;
    color: #94a3b8;
}

.bene-chip {
    display: inline-flex;
    align-items: stretch;
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--card-bg);
}

.bene-chip-fill {
    border: 0;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 0.34rem 0.6rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.bene-chip-fill:hover {
    background: rgba(59, 130, 246,0.12);
}

.bene-chip-del {
    border: 0;
    border-left: 1px solid var(--border);
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    padding: 0 0.5rem;
}

.bene-chip-del:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.bene-save-btn {
    border: 1px dashed #cbd5e1;
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 0.34rem 0.7rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.bene-save-btn:hover {
    background: rgba(148,163,184,0.14);
    color: var(--text-primary);
}

.bene-save-form {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.2rem;
}

.bene-save-form .form-input {
    flex: 1;
    min-width: 0;
}

.bene-confirm-btn {
    border: 0;
    border-radius: 10px;
    background: var(--primary, #3B82F6);
    color: #fff;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.5rem 0.8rem;
    white-space: nowrap;
}

.bene-cancel-btn {
    border: 0;
    border-radius: 10px;
    background: rgba(148,163,184,0.14);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.5rem 0.8rem;
    white-space: nowrap;
}

.history-amount {
    font-weight: 800;
    font-size: 0.9rem;
    white-space: nowrap;
    align-self: center;
    padding: 0.4rem 0.7rem;
    border-radius: 10px;
    letter-spacing: -0.01em;
}

.history-amount.positive { color: var(--success); background: rgba(37, 99, 235,0.10); }
.history-amount.negative { color: var(--danger); background: rgba(220,38,38,0.08); }

/* Clean ledger presentation for transaction history */
.history-list {
    padding-bottom: 2rem;
}

.history-item {
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.history-details {
    min-width: 0;
}

.history-details h4 {
    line-height: 1.3;
}

.history-meta-row span,
.history-date-row span {
    overflow-wrap: anywhere;
}

.history-type-pill {
    background: rgba(148,163,184,0.14);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.history-status-row {
    margin-top: 0.7rem;
}

@media (min-width: 900px) {
    .history-page .page-header,
    .history-controls,
    .history-list {
        width: calc(100% - 48px);
        max-width: none;
        margin-left: auto;
        margin-right: auto;
    }

    .history-page .page-header {
        margin-top: 1rem;
        border-radius: 18px 18px 0 0;
    }

    .history-controls {
        top: 88px;
    }

    .history-item {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 170px;
        align-items: center;
        padding: 1.15rem 1.25rem;
    }

    .history-info {
        align-items: center;
    }

    .history-title-row {
        flex-wrap: nowrap;
    }

    .history-amount {
        min-width: 145px;
        text-align: right;
        font-size: 1rem;
    }
}

@media (max-width: 640px) {
    .history-controls {
        top: 65px;
        padding: 0.75rem;
    }

    .history-item {
        display: block;
        padding: 0.95rem 0.95rem 1rem;
    }

    .history-amount {
        margin-top: 0.85rem;
        padding-top: 0.85rem;
        border-top: 1px solid var(--border);
        text-align: right;
        font-size: 1.05rem;
    }

    .history-icon {
        width: 38px;
        height: 38px;
    }
}

/* ─── Profile ─────────────────────────────────────────────────── */
.profile-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
    text-align: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-blue);
}

.profile-name {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.profile-email {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.profile-stat {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    border: 1px solid var(--border);
}

.profile-stat-value {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.profile-stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ─── Pull to Refresh ─────────────────────────────────────────── */
.pull-indicator {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    display: none;
}

.pull-indicator.active { display: block; }

/* ─── Desktop Sidebar ─────────────────────────────────────────── */
.desktop-sidebar {
    display: none;
    position: fixed;
    left: 0; top: 0;
    height: 100vh;
    width: 240px;
    background: var(--sidebar-bg);
    border-right: 1px solid rgba(255,255,255,0.05);
    padding: 0;
    z-index: 100;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 2px 0 16px rgba(11,22,41,0.35);
}

.sidebar-logo {
    font-size: 1.3rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.025em;
    padding: 1.5rem 1.2rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 0.75rem;
    display: block;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0 0.6rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    position: relative;
    font-size: 0.875rem;
}

.sidebar-item:hover {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.9);
}

.sidebar-item.active {
    background: rgba( 37, 99, 235,0.45);
    color: #fff;
    font-weight: 600;
}

.sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    bottom: 25%;
    width: 3px;
    background: #4ade80;
    border-radius: 0 3px 3px 0;
}

.sidebar-icon {
    font-size: 1rem;
    width: 1rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-text {
    font-size: 0.855rem;
    font-weight: 500;
    letter-spacing: 0.005em;
}

.desktop-main {
    margin-left: 0;
    transition: margin-left 0.3s;
}

/* ─── Sidebar: Brand ──────────────────────────────────────────── */
.sb-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.35rem 1.15rem 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 0.5rem;
}

.sb-brand-name {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

/* ─── Sidebar: User Card ──────────────────────────────────────── */
.sb-user-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0.75rem 0.75rem;
    padding: 0.7rem 0.75rem;
    background: rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid rgba(255,255,255,0.07);
}

.sb-user-card:hover { background: rgba(255,255,255,0.1); }

.sb-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #fff;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.35);
}

.sb-user-info { flex: 1; min-width: 0; }

.sb-user-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sb-user-balance {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.65);
    margin-top: 0.1rem;
}

.sb-user-chevron {
    color: rgba(255,255,255,0.4);
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ─── Sidebar: Nav ────────────────────────────────────────────── */
.sb-nav {
    flex: 1;
    padding: 0 0.6rem;
    overflow-y: auto;
    scrollbar-width: none;
}

.sb-nav::-webkit-scrollbar { display: none; }

.sb-nav-label {
    font-size: 0.58rem;
    font-weight: 700;
    color: rgba(255,255,255,0.28);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.9rem 0.9rem 0.3rem;
    margin-top: 0.15rem;
}

/* ─── Sidebar: Bottom / Logout ────────────────────────────────── */
.sb-bottom {
    padding: 0.5rem 0.6rem 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sb-logout {
    color: #FCA5A5 !important;
}

.sb-logout:hover {
    background: rgba(239,68,68,0.18) !important;
    color: #FEE2E2 !important;
}

/* ─── Header: Left Side ───────────────────────────────────────── */
.header-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.header-divider {
    display: inline-block;
    width: 1px;
    height: 1.1rem;
    background: var(--border);
}

.header-page-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 0.72rem;
    cursor: pointer;
    letter-spacing: 0.03em;
    border: 2px solid rgba( 37, 99, 235,0.25);
    transition: box-shadow 0.15s;
    flex-shrink: 0;
}

.header-avatar:hover { box-shadow: 0 3px 12px rgba( 37, 99, 235,0.3); }

/* ─── Hero Welcome Bar ────────────────────────────────────────── */
.dash-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 55%, var(--secondary) 100%);
    border: none;
    border-radius: var(--radius-md);
    padding: 1.35rem 1.35rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

/* Subtle diagonal sheen across the hero */
.dash-hero-text { flex: 1; min-width: 0; position: relative; z-index: 1; }
.dash-hero-actions { position: relative; z-index: 1; }

.dash-hero::after {
    content: '';
    position: absolute;
    right: -40px;
    top: -45px;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.18), rgba(255,255,255,0) 70%);
    pointer-events: none;
}

.dash-hero::before {
    content: '';
    position: absolute;
    left: -50px;
    bottom: -70px;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    pointer-events: none;
}

.dash-hero-greeting {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    margin-bottom: 0.2rem;
}

.dash-hero-sub {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.65);
}

.dash-hero-actions {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    flex-shrink: 0;
}

.dash-hero-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.58rem 1.05rem;
    background: #fff;
    color: var(--primary-dark);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.dash-hero-btn-primary:hover {
    background: rgba(59, 130, 246,0.12);
}

.dash-hero-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.56rem 0.9rem;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.9);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.dash-hero-btn-outline:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.45);
}

/* hero stacking handled in main mobile block below */

/* ─── Stat Card: Icon Wrap ────────────────────────────────────── */
.stat-card-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-icon-blue  { background: rgba(37, 99, 235, 0.12); color: var(--primary); border: 1px solid rgba(37, 99, 235, 0.25); }
.stat-icon-green { background: #DCFCE7; color: var(--success); border: 1px solid #BBF7D0; }
.stat-icon-orange{ background: #FEF3C7; color: var(--warning); border: 1px solid #FDE68A; }

.stat-card-highlight {
    border-left: 3px solid var(--primary);
}
.stat-card-highlight .stat-value { color: var(--primary); }

/* ─── Dash Grid (two-column layout) ──────────────────────────── */
.dash-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.dash-col-main,
.dash-col-side {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ─── Dash Cards ──────────────────────────────────────────────── */
.dash-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.dash-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--card-bg);
}

.dash-card > .network-tabs,
.dash-card > .bundle-grid,
.dash-card > .quick-actions,
.dash-card > .service-list,
.dash-card > .transaction-list {
    padding: 1rem 1.25rem;
}

.dash-card-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.45rem;
    letter-spacing: -0.005em;
}

.dash-card-title i {
    color: var(--primary);
    font-size: 1rem;
}

.dash-text-btn {
    font-size: 0.775rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    transition: background 0.15s;
    white-space: nowrap;
    font-family: inherit;
}

.dash-text-btn:hover { background: rgba(59, 130, 246,0.12); }

/* ─── Service List ────────────────────────────────────────────── */
.service-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.25rem 0.75rem;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 0;
    cursor: pointer;
    transition: none;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--border);
}

.service-item:last-child { border-bottom: none; }

.service-item:hover .service-item-title { color: var(--primary); }
.service-item:hover .service-item-chevron { color: var(--primary); }

.service-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.service-icon-blue     { background: rgba(37, 99, 235, 0.12); color: var(--primary);  border: 1px solid rgba(37, 99, 235, 0.25); }
.service-icon-green    { background: #DCFCE7; color: var(--success);  border: 1px solid #BBF7D0; }
.service-icon-purple   { background: #EDE9FE; color: #6D28D9;         border: 1px solid rgba(124, 58, 237, 0.25); }
.service-icon-whatsapp { background: rgba(59, 130, 246,0.12); color: #2563EB;         border: 1px solid rgba(37, 99, 235, 0.25); }

.service-item-body { flex: 1; min-width: 0; }

.service-item-title {
    font-size: 0.855rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.12rem;
    transition: color 0.15s;
}

.service-item-desc {
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.service-item-chevron {
    font-size: 1.15rem;
    color: #CBD5E1;
    flex-shrink: 0;
    transition: color 0.15s;
}

/* ─── Dash Empty State ────────────────────────────────────────── */
.dash-empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

@keyframes dash-spin { to { transform: rotate(360deg); } }

.dash-loading-spin {
    display: inline-block;
    animation: dash-spin 0.8s linear infinite;
}

/* ─── Transaction List Wrapper ────────────────────────────────── */
.transaction-list {
    display: flex;
    flex-direction: column;
    padding: 0.25rem 1.25rem 0.75rem;
}

/* ─── Responsive ──────────────────────────────────────────────── */
@media (min-width: 768px) {
    .app-container {
        padding: 1.5rem 2rem;
        max-width: 1200px;
        margin: 0 auto;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .bundle-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .quick-actions { gap: 1rem; margin-bottom: 0; }

    .action-btn { padding: 1.2rem 0.8rem; }

    .bottom-nav { display: none; }

    .notification-container {
        width: auto;
        max-width: 500px;
    }

    .network-tabs {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .desktop-sidebar { display: flex; }
    .desktop-main { margin-left: 240px; }
    .header { padding: 0.85rem 2rem; }

    .dash-grid {
        grid-template-columns: 1fr 320px;
    }

    .dash-hero-greeting { font-size: 1.35rem; }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    body { padding-bottom: 0; }
}

@media (min-width: 1024px) {
    .bundle-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ─── Store Page ──────────────────────────────────────────────── */
.store-page {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--bg-page);
    z-index: 999;
    overflow: hidden;
    padding-bottom: 2rem;
    display: none;
}

.store-page.active { display: block; }

/* Store Sections */
.store-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    margin: 1rem auto;
    max-width: 1200px;
    box-shadow: var(--shadow-sm);
}

.store-section h3 {
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.store-section p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Network Pricing */
.network-pricing-section { margin-bottom: 2rem; }

.network-pricing-title {
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

@media (max-width: 768px) { .pricing-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .purchase-methods { grid-template-columns: 1fr; } }

.pricing-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}

.pricing-item:hover {
    background: rgba(59, 130, 246,0.12);
    border-color: var(--primary-light);
}

.pricing-bundle-info { flex: 1; }

.pricing-bundle-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.pricing-bundle-base,
.pricing-bundle-min {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.pricing-bundle-min { color: var(--warning); font-weight: 600; }

.pricing-input-wrapper {
    position: relative;
    flex-shrink: 0;
    width: 120px;
}

.pricing-currency {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    pointer-events: none;
}

.pricing-input {
    width: 100%;
    padding: 0.55rem 0.55rem 0.55rem 2.2rem;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 700;
    transition: all 0.2s;
}

.pricing-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba( 59, 130, 246,0.1);
}

.pricing-input.invalid {
    border-color: var(--danger);
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Store Link */
#storeLinkContainer {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

#storeLink {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 9px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: monospace;
}

#storeLink:focus {
    outline: none;
    border-color: var(--primary);
}

#copyLink {
    padding: 0.75rem 1.5rem;
    background: rgba(59, 130, 246,0.12);
    border: 1.5px solid rgba(37, 99, 235, 0.25);
    border-radius: 9px;
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

#copyLink:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ─── Empty & Error States ────────────────────────────────────── */
.empty-state,
.error-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.error-state { color: var(--danger); }

/* ─── Status Badges ───────────────────────────────────────────── */
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn.disabled:hover {
    background: inherit;
    transform: none;
}

.status-badge {
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-badge.pending    { background: #FEF3C7; color: #92400E; }
.status-badge.completed  { background: #DCFCE7; color: #15803D; }
.status-badge.not-registered { background: rgba(148,163,184,0.14); color: var(--text-muted); }

/* ─── API Key ─────────────────────────────────────────────────── */
.api-key-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.api-key-wrapper .form-input { padding-right: 3.5rem; }

.api-key-copy-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(59, 130, 246,0.12);
    border: 1px solid rgba(37, 99, 235, 0.25);
    color: var(--primary);
    border-radius: 7px;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.api-key-copy-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

body, html { height: 100%; }

/* ─── Store Pricing Toolbar ───────────────────────────────────── */
.store-pricing-toolbar {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.store-pricing-bulk-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ─── Reseller store: Withdrawal history cards ─────────────────── */
.withdrawal-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.withdrawal-history-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border: 1px dashed var(--border);
    border-radius: 14px;
}
/* Fixed colours (not theme vars) so the card stays readable on the white store cards under any theme. */
.withdrawal-history-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.95rem 1rem;
    background: #ffffff !important;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15,23,42,0.06);
}
.withdrawal-history-title {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-primary) !important;
    margin-bottom: 0.2rem;
}
.withdrawal-history-meta {
    font-size: 0.76rem;
    color: var(--text-secondary) !important;
    line-height: 1.45;
    word-break: break-word;
}
.withdrawal-history-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    flex: 0 0 auto;
    text-align: right;
}
.withdrawal-history-amount {
    font-weight: 800;
    font-size: 0.98rem;
    color: #dc2626;
    white-space: nowrap;
}
.withdrawal-status-badge {
    display: inline-block;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}
.cancel-withdrawal-btn {
    background: rgba(239,68,68,0.1);
    color: #dc2626;
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 8px;
    padding: 0.32rem 0.7rem;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}
.cancel-withdrawal-btn:hover { background: rgba(239,68,68,0.18); }
.cancel-withdrawal-btn:disabled { opacity: 0.55; cursor: not-allowed; }

@media (max-width: 560px) {
    .withdrawal-history-item {
        flex-direction: column;
        gap: 0.6rem;
        padding: 0.85rem;
    }
    .withdrawal-history-right {
        text-align: left;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem 0.75rem;
        width: 100%;
    }
    .withdrawal-history-amount { font-size: 1.05rem; }
}

.store-price-input-wrap {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.bundle-price-input {
    width: 120px;
    text-align: center;
    font-weight: 700;
}

.store-price-step-btn {
    border: 1.5px solid var(--border);
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 0.45rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.store-price-step-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(59, 130, 246,0.12);
}

.store-active-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.store-active-toggle input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--success);
}

.store-active-toggle-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    min-width: 52px;
    text-align: left;
}

.store-pricing-header {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.store-pricing-toggle-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    background: rgba(59, 130, 246,0.12);
    border: 1.5px solid rgba(37, 99, 235, 0.25);
    color: var(--primary);
    border-radius: 10px;
    padding: 0.68rem 0.8rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.store-pricing-toggle-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.store-pricing-content { margin-top: 0.25rem; }
.store-pricing-content.is-collapsed { display: none; }

/* Compact reseller store layout */
.store-page .reseller-card.store-panel {
    padding: 0.95rem;
    margin-bottom: 1.1rem;
}

.store-kpi .stat-value { font-size: 1.45rem; }

@media (max-width: 768px) {
    .store-page .reseller-card.store-panel {
        padding: 0.8rem;
        margin-bottom: 0.9rem;
        border-radius: 12px;
    }

    .store-kpi-grid { gap: 0.65rem; }
    .store-kpi { padding: 0.72rem; }
    .store-kpi .stat-label { font-size: 0.72rem; }
    .store-kpi .stat-value { font-size: 1.2rem; }

    .store-pricing-header { flex-direction: column; align-items: stretch; }
    .store-pricing-header #saveAllPrices { width: 100%; }

    #storePricingSection .store-pricing-content table,
    #storePricingSection .store-pricing-content tbody,
    #storePricingSection .store-pricing-content tr,
    #storePricingSection .store-pricing-content td {
        display: block;
        width: 100%;
    }

    #storePricingSection .store-pricing-content thead { display: none; }
    #storePricingSection .store-pricing-content > div[style*="overflow"] { overflow: visible !important; }

    #storePricingSection .store-pricing-content tr.store-pricing-row {
        border: 1px solid var(--border);
        border-radius: 14px;
        padding: 0.85rem;
        margin-bottom: 0.85rem;
        background: #ffffff;
        box-shadow: 0 1px 3px rgba(15,23,42,0.05);
    }

    #storePricingSection .store-pricing-content td {
        border: none;
        padding: 0.4rem 0.1rem;
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        text-align: right;
    }

    #storePricingSection .store-pricing-content td[data-label]::before {
        content: attr(data-label);
        font-size: 0.74rem;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.02em;
        font-weight: 600;
        flex: 0 0 auto;
    }

    /* The price input + steppers should take the full row width on its own line. */
    #storePricingSection .store-pricing-content td[data-label="Your Price"] {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
    }
    #storePricingSection .store-pricing-content td[data-label="Your Price"]::before { margin-bottom: 0.3rem; }

    .store-pricing-bulk-actions { width: 100%; }

    .store-pricing-bulk-actions .btn,
    .store-pricing-bulk-actions .form-input,
    .store-pricing-toolbar #storePriceNetworkFilter {
        width: 100%;
        max-width: none !important;
    }

    .store-price-input-wrap { width: 100%; }
    .bundle-price-input { width: 100%; }

    #storeLinkContainer { flex-direction: column; }
    #copyLink { width: 100%; }
    .pricing-input-wrapper { width: 100px; }
    .store-section { margin: 1rem 0.5rem; padding: 1rem; }
}

/* ─── Foreign Number Selector ─────────────────────────────────── */
.fs-service-btn, .fs-country-btn {
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 0.85rem 0.5rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-primary);
    font-size: 0.8rem;
    line-height: 1;
    transition: all 0.15s;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.fs-service-btn i, .fs-country-btn i {
    font-size: 1.6rem;
    line-height: 1;
    display: block;
    color: var(--primary);
}

.fs-service-btn span, .fs-country-btn span {
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-secondary);
}

.fs-service-btn:hover, .fs-country-btn:hover {
    border-color: var(--primary-light);
    background: rgba(59, 130, 246,0.12);
    transform: translateY(-2px);
    box-shadow: var(--shadow-blue);
}

.fs-service-btn.selected, .fs-country-btn.selected {
    border-color: var(--primary);
    background: rgba(59, 130, 246,0.12);
    box-shadow: 0 0 0 3px rgba( 59, 130, 246,0.12);
}

/* ─── Desktop @media ──────────────────────────────────────────── */
@media (min-width: 901px) {
    .store-page { padding-left: 0; }
}

/* ─── Stat Card in Store Section ──────────────────────────────── */
.store-section .stat-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    margin-bottom: 1rem;
    color: #fff;
}

.store-section .stat-card .stat-value {
    font-size: 2rem;
    color: #fff;
}

/* ─── Mobile @media (store page) ─────────────────────────────── */
@media (max-width: 768px) {
    .store-page { padding-bottom: 80px; }
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE — comprehensive overrides (max-width: 767px)
═══════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

    /* ── Body & Container ── */
    body {
        padding-bottom: 5.5rem;
        background: var(--card-bg);
    }

    .app-container {
        padding: 1rem 0.85rem;
    }

    /* ── Header ── */
    .header {
        padding: 0.65rem 1rem;
        min-height: 52px;
    }

    .logo {
        font-size: 1rem;
    }

    .header-left { gap: 0.5rem; }

    .header-divider { display: none; }

    .header-page-label { display: none; }

    .header-actions { gap: 0.5rem; }

    /* ── Hero ── */
    .dash-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.1rem 1.1rem;
        border-radius: var(--radius-md);
        gap: 0.9rem;
    }

    .dash-hero-greeting {
        font-size: 1.1rem;
    }

    .dash-hero-sub {
        font-size: 0.77rem;
    }

    .dash-hero-actions {
        width: 100%;
        gap: 0.55rem;
    }

    .dash-hero-btn-primary,
    .dash-hero-btn-outline {
        flex: 1;
        justify-content: center;
        font-size: 0.8rem;
        padding: 0.6rem 0.5rem;
    }

    /* ── Stats Grid — stack vertically on small phones ── */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
        margin-bottom: 1.1rem;
    }

    @media (min-width: 400px) {
        .stats-grid {
            grid-template-columns: repeat(3, 1fr);
        }

        .stat-card {
            flex-direction: column;
            align-items: flex-start;
            padding: 0.85rem 0.8rem;
            gap: 0.5rem;
        }

        .stat-value {
            font-size: 1.1rem;
        }
    }

    .stat-card {
        padding: 0.9rem 1rem;
        border-radius: var(--radius-sm);
    }

    .stat-card-highlight {
        border-left-width: 3px;
    }

    .stat-card-icon-wrap {
        width: 40px;
        height: 40px;
        border-radius: 9px;
        font-size: 1.1rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    /* ── Dash Grid — stack to single column ── */
    .dash-grid {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }

    .dash-col-main,
    .dash-col-side {
        gap: 0.9rem;
    }

    /* ── Dash Cards ── */
    .dash-card {
        border-radius: var(--radius-md);
    }

    .dash-card-header {
        padding: 0.85rem 1rem;
    }

    .dash-card-title {
        font-size: 0.84rem;
    }

    /* ── Network Tabs ── */
    .network-tabs {
        padding: 0.9rem 1rem 0;
        gap: 0.6rem;
        margin-bottom: 0.75rem;
    }

    .network-tab {
        padding: 0.7rem 0.3rem;
        border-radius: 10px;
        gap: 0.35rem;
    }

    .network-logo {
        width: 38px;
        height: 38px;
        border-radius: 8px;
    }

    .network-name {
        font-size: 0.74rem;
    }

    /* ── Bundle Grid ── */
    .bundle-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
        padding: 0.75rem 1rem 1rem;
    }

    .bundle-card {
        padding: 0.85rem 0.6rem;
        border-radius: 10px;
    }

    .bundle-size {
        font-size: 0.9rem;
    }

    .bundle-price {
        font-size: 0.95rem;
    }

    .bundle-validity {
        font-size: 0.64rem;
    }

    /* ── Service List ── */
    .service-list {
        padding: 0.25rem 1rem 0.75rem;
    }

    .service-item {
        padding: 0.8rem 0;
        gap: 0.75rem;
    }

    .service-item-icon {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
        border-radius: 8px;
    }

    .service-item-title {
        font-size: 0.835rem;
    }

    .service-item-desc {
        font-size: 0.71rem;
    }

    /* ── Quick Actions ── */
    .quick-actions {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
        padding: 0.9rem 1rem 1rem;
    }

    .action-btn {
        padding: 0.75rem 0.25rem;
        border-radius: 9px;
        gap: 0.35rem;
    }

    .action-icon {
        width: 2rem;
        height: 2rem;
        border-radius: 7px;
        font-size: 0.95rem;
    }

    .action-text {
        font-size: 0.64rem;
    }

    /* ── Transaction List ── */
    .transaction-list {
        padding: 0.15rem 1rem 0.75rem;
    }

    .transaction-item {
        padding: 0.7rem 0;
    }

    .transaction-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    .transaction-details h4 {
        font-size: 0.82rem;
    }

    .transaction-details span {
        font-size: 0.7rem;
    }

    /* ── Notification Dropdown ── */
    .notification-dropdown {
        width: calc(100vw - 2rem);
        right: -0.5rem;
    }

    /* ── Bottom Nav ── */
    .bottom-nav {
        padding: 0.4rem 0.15rem calc(0.4rem + env(safe-area-inset-bottom));
    }

    .nav-item {
        font-size: 0.7rem;
        padding: 0.35rem 0.2rem;
        gap: 0.18rem;
    }

    .nav-icon {
        font-size: 1.28rem;
    }

    /* ── Modals ── */
    .modal {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
        margin: 0;
        max-height: 90vh;
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .modal-overlay.active .modal {
        transform: translateY(0) scale(1);
    }

    /* ── Form Inputs ── */
    .form-input {
        font-size: 16px; /* prevents iOS zoom */
    }

    /* ── History Page ── */
    .history-list {
        padding: 0.75rem 0.85rem 1rem;
    }

    .history-item {
        padding: 0.85rem;
        border-radius: 10px;
    }

    /* ── Dash Empty State ── */
    .dash-empty-state {
        padding: 1.5rem 1rem;
        font-size: 0.82rem;
    }
}

/* ── Special Offers ── */
.special-offers-card { border: 1px solid rgba(37, 99, 235,0.25); }
.special-offer-item {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    padding: 0.85rem 1rem; border-radius: 12px; margin-bottom: 0.6rem;
    background: linear-gradient(135deg, rgba(37, 99, 235,0.06), rgba(37, 99, 235,0.02));
    border: 1px solid rgba(37, 99, 235,0.15);
}
.special-offer-item:last-child { margin-bottom: 0; }
.special-offer-info { flex: 1; min-width: 0; }
.special-offer-title { font-weight: 700; color: var(--text-primary); font-size: 0.95rem; }
.special-offer-desc { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.2rem; line-height: 1.5; }
.special-offer-price {
    font-weight: 800; color: var(--primary); font-size: 1rem; white-space: nowrap;
    background: rgba(37, 99, 235,0.1); padding: 0.4rem 0.75rem; border-radius: 10px;
}

/* ── MTN AFA Registration card ── */
.afa-card { padding: 0; overflow: hidden; }
.afa-banner {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.25rem 1.25rem;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(255,255,255,0.16), transparent 55%),
        linear-gradient(135deg, var(--primary), var(--primary-dark, #15803d));
    position: relative;
}
.afa-head-icon {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.25);
}
.afa-head-text { min-width: 0; flex: 1; }
.afa-head-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin: 0;
}
.afa-head-sub {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.9);
    margin: 0.2rem 0 0;
    line-height: 1.45;
}
.afa-fee-badge {
    flex: 0 0 auto;
    background: #fff;
    color: var(--primary-dark, #15803d);
    font-weight: 800;
    font-size: 0.82rem;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
    white-space: nowrap;
}
.afa-body { padding: 1.25rem; }
.afa-status {
    border-radius: 12px;
    padding: 0.9rem 1rem;
    margin-bottom: 1.1rem;
}
.afa-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.95rem 1rem;
}
.afa-field { margin-bottom: 0; min-width: 0; }
.afa-field-full { grid-column: 1 / -1; }
.afa-form .form-label {
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
}
.afa-fi { color: var(--primary); font-size: 1rem; }
.afa-hint { color: var(--text-muted, #94a3b8); font-weight: 400; font-size: 0.78rem; }
.afa-form .form-input { width: 100%; }
.afa-form #afaExtraFields .form-group { margin-bottom: 0.9rem; }
.afa-form #afaExtraFields .form-group:last-child { margin-bottom: 0; }
.afa-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    margin-top: 0.3rem;
    padding: 0.95rem 1rem;
    font-size: 1rem;
    font-weight: 700;
}
.afa-foot {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--text-muted, #94a3b8);
    margin: 0.2rem 0 0;
}
.afa-foot i { color: var(--primary); }

/* Single column + tap-friendly inputs on mobile */
@media (max-width: 600px) {
    .afa-form { grid-template-columns: 1fr; gap: 0.85rem; }
    .afa-banner {
        padding: 1.1rem 1rem;
        flex-wrap: wrap;
        row-gap: 0.5rem;
    }
    .afa-body { padding: 1rem; }
    .afa-head-icon { width: 40px; height: 40px; font-size: 1.15rem; border-radius: 11px; }
    .afa-head-text { flex-basis: 0; }
    .afa-head-title { font-size: 0.95rem; }
    .afa-head-sub { font-size: 0.76rem; }
    /* Fee badge drops to its own line under the title instead of squeezing it. */
    .afa-fee-badge {
        font-size: 0.72rem;
        padding: 0.3rem 0.55rem;
        flex-basis: 100%;
        margin-left: calc(40px + 0.85rem);
        width: fit-content;
    }
    .afa-collapse-chevron { font-size: 1.2rem; }
    .afa-form .form-input,
    .afa-form #afaExtraFields .form-input {
        font-size: 16px; /* prevents iOS zoom-on-focus */
        padding: 0.85rem 0.95rem;
    }
    .afa-submit { padding: 0.9rem 1rem; }
}

/* ── Report upload modal ── */
.report-upload { margin-bottom: 0.85rem; }
.report-upload .form-label { margin-bottom: 0.35rem; }
.report-file {
    width: 100%;
    font-size: 0.85rem;
    padding: 0.55rem;
    border: 1.5px dashed var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-secondary);
}
.report-file::file-selector-button {
    border: none;
    background: var(--primary);
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    margin-right: 0.6rem;
    cursor: pointer;
    font-weight: 600;
}

/* Clickable special offers */
.special-offer-item { cursor: pointer; transition: transform 0.12s, box-shadow 0.12s; }
.special-offer-item:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(37, 99, 235,0.14); }
.special-offer-item:active { transform: translateY(0); }

/* ─── Client Themes ───────────────────────────────────────────────
   Each theme overrides the accent + page background CSS variables.
   Applied via the `data-theme` attribute on <html> (see dashboard.html
   head script and the Appearance picker in the profile modal).
   The default (green) palette lives in :root above. */

html[data-theme="ocean"] {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary: #0ea5e9;
    --accent: #2563eb;
    --accent-light: #3b82f6;
    --glass: rgba(37, 99, 235, 0.05);
    --glass-hover: rgba(37, 99, 235, 0.08);
    --border-blue: rgba(37, 99, 235, 0.15);
    --shadow-blue: 0 4px 16px rgba(37, 99, 235, 0.20);
    --bg-page: #f1f6ff;
    --sidebar-bg: #0b1220;
}

html[data-theme="violet"] {
    --primary: #7c3aed;
    --primary-light: #8b5cf6;
    --primary-dark: #6d28d9;
    --secondary: #a855f7;
    --accent: #7c3aed;
    --accent-light: #8b5cf6;
    --glass: rgba(124, 58, 237, 0.05);
    --glass-hover: rgba(124, 58, 237, 0.08);
    --border-blue: rgba(124, 58, 237, 0.15);
    --shadow-blue: 0 4px 16px rgba(124, 58, 237, 0.20);
    --bg-page: #f6f2ff;
    --sidebar-bg: #16112b;
}

html[data-theme="sunset"] {
    --primary: #ea580c;
    --primary-light: #f97316;
    --primary-dark: #c2410c;
    --secondary: #f59e0b;
    --accent: #ea580c;
    --accent-light: #f97316;
    --glass: rgba(234, 88, 12, 0.05);
    --glass-hover: rgba(234, 88, 12, 0.08);
    --border-blue: rgba(234, 88, 12, 0.15);
    --shadow-blue: 0 4px 16px rgba(234, 88, 12, 0.20);
    --bg-page: #fff6f0;
    --sidebar-bg: #241509;
}

html[data-theme="rose"] {
    --primary: #e11d48;
    --primary-light: #f43f5e;
    --primary-dark: #be123c;
    --secondary: #ec4899;
    --accent: #e11d48;
    --accent-light: #f43f5e;
    --glass: rgba(225, 29, 72, 0.05);
    --glass-hover: rgba(225, 29, 72, 0.08);
    --border-blue: rgba(225, 29, 72, 0.15);
    --shadow-blue: 0 4px 16px rgba(225, 29, 72, 0.20);
    --bg-page: #fff1f5;
    --sidebar-bg: #2b0f19;
}

/* Dark theme overrides surfaces + text in addition to the accent. */
html[data-theme="midnight"] {
    --primary: #3B82F6;
    --primary-light: #4ade80;
    --primary-dark: #2563EB;
    --secondary: #10b981;
    --accent: #3B82F6;
    --accent-light: #4ade80;
    --glass: rgba(59, 130, 246, 0.08);
    --glass-hover: rgba(59, 130, 246, 0.14);
    --border-blue: rgba(59, 130, 246, 0.22);
    --shadow-blue: 0 4px 16px rgba(0, 0, 0, 0.45);
    --dark: #e2e8f0;
    --darker: #f8fafc;
    --light: #0f172a;
    --sidebar-bg: #020617;
    --card-bg: #0f1b30;
    --bg-page: #070d1a;
    --border: #1e293b;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #8595ab;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 14px rgba(0,0,0,0.5);
    --shadow-lg: 0 10px 32px rgba(0,0,0,0.6);
}

/* Independent Dark mode — surfaces + text only, so it combines with any accent colour. */
html[data-mode="dark"] {
    --dark: #E8EDF6;
    --darker: #f8fafc;
    --light: #0f172a;
    --sidebar-bg: #0A1120;
    --card-bg: #101828;
    --bg-page: #0B1220;
    --border: #233150;
    --text-primary: #E8EDF6;
    --text-secondary: #98A6C0;
    --text-muted: #8593AD;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.45);
    --shadow-md: 0 4px 14px rgba(0,0,0,0.5);
    --shadow-lg: 0 10px 32px rgba(2,4,20,0.65);
}

/* ── Dark-context text rescue ──────────────────────────────────────
   Elements that hard-code dark text INLINE (style="color:#0f172a" etc.) stay dark
   and become invisible on dark cards. Re-light them in any dark context (Dark mode +
   Midnight theme), matched by the inline colour value. (CSS-rule colours already use vars.) */
html[data-mode="dark"] [style*="color:#0f172a"], html[data-mode="dark"] [style*="color: #0f172a"],
html[data-mode="dark"] [style*="color:#0F172A"], html[data-mode="dark"] [style*="color: #0F172A"],
html[data-mode="dark"] [style*="color:#1e293b"], html[data-mode="dark"] [style*="color: #1e293b"],
html[data-mode="dark"] [style*="color:#0f1b30"], html[data-mode="dark"] [style*="color: #0f1b30"],
html[data-theme="midnight"] [style*="color:#0f172a"], html[data-theme="midnight"] [style*="color: #0f172a"],
html[data-theme="midnight"] [style*="color:#0F172A"], html[data-theme="midnight"] [style*="color: #0F172A"],
html[data-theme="midnight"] [style*="color:#1e293b"], html[data-theme="midnight"] [style*="color: #1e293b"] {
    color: #e2e8f0 !important;
}
html[data-mode="dark"] [style*="color:#334155"], html[data-mode="dark"] [style*="color: #334155"],
html[data-mode="dark"] [style*="color:#475569"], html[data-mode="dark"] [style*="color: #475569"],
html[data-mode="dark"] [style*="color:#64748b"], html[data-mode="dark"] [style*="color: #64748b"],
html[data-theme="midnight"] [style*="color:#334155"], html[data-theme="midnight"] [style*="color: #334155"],
html[data-theme="midnight"] [style*="color:#475569"], html[data-theme="midnight"] [style*="color: #475569"],
html[data-theme="midnight"] [style*="color:#64748b"], html[data-theme="midnight"] [style*="color: #64748b"] {
    color: #aab6c7 !important;
}
/* Class-based dark text that doesn't use theme vars → light in dark contexts. */
html[data-mode="dark"] .modal-title, html[data-mode="dark"] .form-label,
html[data-theme="midnight"] .modal-title, html[data-theme="midnight"] .form-label { color: #e2e8f0; }

/* Dark: darken common light chip/surface backgrounds so text stays readable on them. */
html[data-mode="dark"] [style*="background:#f1f5f9"], html[data-mode="dark"] [style*="background: #f1f5f9"],
html[data-mode="dark"] [style*="background:#e2e8f0"], html[data-mode="dark"] [style*="background: #e2e8f0"],
html[data-mode="dark"] [style*="background:#f8fafc"], html[data-mode="dark"] [style*="background: #f8fafc"],
html[data-theme="midnight"] [style*="background:#f1f5f9"], html[data-theme="midnight"] [style*="background: #f1f5f9"],
html[data-theme="midnight"] [style*="background:#e2e8f0"], html[data-theme="midnight"] [style*="background: #e2e8f0"],
html[data-theme="midnight"] [style*="background:#f8fafc"], html[data-theme="midnight"] [style*="background: #f8fafc"] {
    background: rgba(148,163,184,0.14) !important;
}
html[data-mode="dark"] .history-status-pill.neutral,
html[data-theme="midnight"] .history-status-pill.neutral { background: rgba(148,163,184,0.2) !important; }
/* Inputs explicitly dark in dark contexts (form-input already uses var(--card-bg); reinforce). */
html[data-mode="dark"] input.form-input, html[data-mode="dark"] select.form-input, html[data-mode="dark"] textarea.form-input,
html[data-theme="midnight"] input.form-input, html[data-theme="midnight"] select.form-input, html[data-theme="midnight"] textarea.form-input {
    background: #0D1526 !important;
    color: #E8EDF6 !important;
    border-color: #233150 !important;
}

/* Text size preference (scales rem-based sizing). */
html[data-font="small"] { font-size: 14px; }
html[data-font="large"] { font-size: 18px; }

/* Compact density — tighter padding on the main cards/containers. */
html[data-density="compact"] .dash-card,
html[data-density="compact"] .store-card,
html[data-density="compact"] .reseller-card,
html[data-density="compact"] .stat-card,
html[data-density="compact"] .modal-body { padding: 0.7rem; }
html[data-density="compact"] .dash-card + .dash-card { margin-top: 0.6rem; }
html[data-density="compact"] .store-section-panel { padding: 0.85rem 0.7rem 1.5rem; }

/* Card corners preference. */
html[data-corners="sharp"] .dash-card,
html[data-corners="sharp"] .stat-card,
html[data-corners="sharp"] .card,
html[data-corners="sharp"] .reseller-card,
html[data-corners="sharp"] .store-card,
html[data-corners="sharp"] .store-kpi-card,
html[data-corners="sharp"] .store-action-card,
html[data-corners="sharp"] .modal,
html[data-corners="sharp"] .form-input { border-radius: 6px !important; }

/* Reduced motion — calms animations/transitions. */
html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
}

/* ─── Appearance controls (custom accent, mode, size, density) ─────── */
.appearance-group { margin-top: 1rem; }
.appearance-group-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: block;
}
.appearance-seg {
    display: inline-flex;
    gap: 0.3rem;
    background: var(--glass, rgba(0,0,0,0.04));
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.25rem;
    flex-wrap: wrap;
}
.appearance-seg-btn {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.appearance-seg-btn.active {
    background: var(--primary);
    color: #fff;
}
.appearance-accent-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.appearance-accent-presets { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.appearance-accent-dot {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
}
.appearance-accent-dot.active { border-color: var(--text-primary); box-shadow: 0 0 0 2px #fff inset; }
#appearanceCustomColor {
    width: 42px; height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: none;
    cursor: pointer;
    padding: 2px;
}
.appearance-reset-btn {
    margin-top: 1rem;
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 10px;
    padding: 0.55rem;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
}

/* ─── Theme picker (Appearance section in profile modal) ─────────── */
.theme-section-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 1.25rem 0 0.25rem;
}

.theme-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.theme-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 0.4rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--card-bg);
    cursor: pointer;
    transition: border-color 0.15s, transform 0.12s;
}

.theme-swatch:hover { transform: translateY(-1px); }
.theme-swatch.active { border-color: var(--primary); }

.theme-swatch-preview {
    width: 100%;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.06);
}

.theme-swatch-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.theme-swatch.active .theme-swatch-name { color: var(--primary); }

/* ─── Spin & Win ──────────────────────────────────────────────── */
.spin-banner {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(120deg, #7c3aed 0%, #db2777 55%, #f59e0b 100%);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.28);
    transition: transform 0.14s, box-shadow 0.14s;
}
.spin-banner:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(124, 58, 237, 0.34); }
.spin-banner:active { transform: translateY(0); }
.spin-banner-icon {
    flex: 0 0 auto;
    width: 46px; height: 46px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    font-size: 1.5rem;
}
.spin-banner-text { flex: 1 1 auto; min-width: 0; }
.spin-banner-title { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; }
.spin-banner-sub { font-size: 0.8rem; opacity: 0.92; }
.spin-banner-cta {
    flex: 0 0 auto;
    font-weight: 700; font-size: 0.85rem;
    background: rgba(255,255,255,0.18);
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    white-space: nowrap;
}

.spin-modal { max-width: 420px; }
/* The ring + shadow live on the STATIC wrapper so they never rotate/repaint. */
.spin-wheel-wrap {
    position: relative;
    width: 300px;
    max-width: 84vw;
    margin: 0.5rem auto 1.4rem;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    padding: 9px;
    background: var(--card-bg);
    box-shadow: 0 0 0 6px var(--card-bg), 0 0 0 9px var(--border-blue), var(--shadow-lg);
    isolation: isolate;
}
/* Only the wheel rotates — promoted to its own GPU layer for jank-free spin. */
.spin-wheel {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform: rotate(0deg);
    transform-origin: 50% 50%;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition: transform 4.6s cubic-bezier(0.16, 0.84, 0.20, 1);
}
/* Static centre hub (sits above the spinning wheel). */
.spin-hub {
    position: absolute;
    top: 50%; left: 50%;
    width: 46px; height: 46px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--card-bg);
    box-shadow: var(--shadow-md);
    display: grid; place-items: center;
    color: var(--primary);
    font-size: 1.35rem;
    z-index: 3;
    pointer-events: none;
}
.spin-pointer {
    position: absolute;
    top: -4px; left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 26px solid var(--danger);
    z-index: 4;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3));
    pointer-events: none;
}
.spin-result {
    text-align: center;
    min-height: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}
.spin-result.win { color: var(--success); }
.spin-result.lose { color: var(--text-muted); }
.spin-btn { width: 100%; }
.spin-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.spin-claim {
    background: var(--glass);
    border: 1px solid var(--border-blue);
    border-radius: var(--radius-md);
    padding: 0.9rem;
    margin-bottom: 0.9rem;
}
.spin-claim-prompt {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-align: center;
}
.spin-note {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
}

/* ═══════════════════════════════════════════════════════════════════
   WEBSITE-A SKIN v2 — clean professional (loads last, wins the cascade).
   Corporate blue on white, hairline borders, soft shadows. No gradients
   on controls, no glow, no pills — quiet banking-grade chrome. Light-first.
   ═══════════════════════════════════════════════════════════════════ */

/* Primary actions: solid blue, soft-square corners. */
.btn-primary,
button.btn-primary {
    background: var(--primary) !important;
    border: none !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.10);
    font-weight: 600;
    letter-spacing: 0.01em;
}
.btn-primary:hover { background: var(--primary-dark) !important; filter: none; }
.btn-primary:active { transform: scale(0.99); }

/* Header + bottom nav: crisp hairline chrome in both modes. */
html[data-mode="dark"] .header {
    background: rgba(13, 21, 38, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
html[data-mode="dark"] .bottom-nav {
    background: rgba(13, 21, 38, 0.94) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border) !important;
}
.nav-item.active { color: var(--primary) !important; }
html[data-mode="dark"] .nav-item.active { color: #60A5FA !important; }

/* Active pills/tabs: quiet blue tint, no gradients. */
.network-tab.active,
.sub-network-tab.active,
.share-mode-tab.active {
    background: rgba(37, 99, 235, 0.07) !important;
    border-color: rgba(37, 99, 235, 0.40) !important;
}
html[data-mode="dark"] .network-tab.active,
html[data-mode="dark"] .sub-network-tab.active,
html[data-mode="dark"] .share-mode-tab.active {
    background: rgba(59, 130, 246, 0.14) !important;
    border-color: rgba(96, 165, 250, 0.45) !important;
}

/* Focus visibility. */
.form-input:focus, button:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.55);
    outline-offset: 1px;
}

/* ── Wallet card (home hero): flat corporate navy-blue. ───────────── */
.dash-hero {
    border-radius: 16px !important;
    background: linear-gradient(135deg, var(--primary-darkest) 0%, var(--primary-dark) 60%, var(--primary) 100%) !important;
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.16) !important;
}
.wallet-hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
    padding: 1.2rem 1.25rem 1.3rem;
    color: #fff;
}
.wallet-hero .dash-hero-greeting { color: #fff; font-size: 1.02rem; font-weight: 600; margin: 0; }
.wallet-hero .dash-hero-sub { color: rgba(255,255,255,0.65); font-size: 0.75rem; margin-top: 0.15rem; }
.wallet-hero-top { display: flex; align-items: flex-start; justify-content: space-between; }
.wallet-hero-chip {
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border-radius: 10px;
    background: rgba(255,255,255,0.14);
    font-size: 1.05rem; color: #fff;
}
.wallet-hero-balance { margin-top: 0.1rem; }
.wallet-hero-label {
    display: block;
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255,255,255,0.66);
    margin-bottom: 0.2rem;
    font-weight: 600;
}
.wallet-hero-balance .stat-value {
    color: #fff !important;
    font-size: 2.05rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.wallet-hero-actions { display: flex; gap: 0.6rem; }
.wallet-hero-actions > * {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-width: 0;
}
.wallet-hero .dash-hero-btn-primary {
    background: #fff !important;
    color: var(--primary-dark) !important;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    padding: 0.62rem 1.15rem;
    font-size: 0.86rem;
}
.wallet-hero-btn-ghost {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.30);
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.86rem;
    padding: 0.62rem 1.05rem;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 0.4rem;
    transition: background 0.15s;
}
.wallet-hero-btn-ghost:hover { background: rgba(255,255,255,0.2); }

/* ── In-card stats row (lives inside the wallet hero). ─────────────── */
.hero-stats {
    display: flex;
    border-top: 1px solid rgba(255,255,255,0.18);
    padding-top: 0.85rem;
    margin-top: 0.1rem;
}
.hero-stat { flex: 1 1 50%; width: 50%; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.hero-stat + .hero-stat { border-left: 1px solid rgba(255,255,255,0.18); padding-left: 1rem; }
.hero-stat-label {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.66);
    font-weight: 500;
    display: flex; align-items: center; gap: 0.3rem;
}
.hero-stat-value { font-size: 1.05rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }

/* ── Quick-action tiles: white cards, restrained accents. ──────────── */
.tiles-section { margin-bottom: 1.3rem; }
.tiles-heading {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin: 0 0.15rem 0.65rem;
}
.quick-actions.quick-rail {
    display: flex !important;
    gap: 0.35rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.1rem 0.1rem 0.45rem;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.quick-actions.quick-rail::-webkit-scrollbar { display: none; }
.quick-rail .action-btn {
    flex: 0 0 auto;
    width: 76px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.2rem !important;
    background: transparent !important;
    border: none !important;
    border-radius: 12px !important;
    cursor: pointer;
    scroll-snap-align: start;
    transition: background 0.15s;
}
.quick-rail .action-btn:hover { background: rgba(37, 99, 235, 0.06) !important; }
.quick-rail .action-btn:active { transform: scale(0.96); }
.quick-rail .action-icon {
    width: 52px; height: 52px;
    display: grid; place-items: center;
    border-radius: 16px;
    font-size: 1.35rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.quick-rail .action-text {
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.15;
    color: var(--text-secondary);
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Muted professional accents — light mode. */
.tile-c1 .action-icon { background: rgba(37, 99, 235, 0.09);  color: #2563EB; }
.tile-c2 .action-icon { background: rgba(14, 165, 233, 0.10); color: #0284C7; }
.tile-c3 .action-icon { background: rgba(99, 102, 241, 0.10); color: #4F46E5; }
.tile-c4 .action-icon { background: rgba(217, 119, 6, 0.10);  color: #B45309; }
.tile-c5 .action-icon { background: rgba(124, 58, 237, 0.10); color: #7C3AED; }
.tile-c6 .action-icon { background: rgba(225, 29, 72, 0.08);  color: #BE123C; }
/* Brighter icon accents on dark surfaces. */
html[data-mode="dark"] .tile-c1 .action-icon { background: rgba(96, 165, 250, 0.14);  color: #60A5FA; }
html[data-mode="dark"] .tile-c2 .action-icon { background: rgba(56, 189, 248, 0.14);  color: #38BDF8; }
html[data-mode="dark"] .tile-c3 .action-icon { background: rgba(129, 140, 248, 0.14); color: #818CF8; }
html[data-mode="dark"] .tile-c4 .action-icon { background: rgba(251, 191, 36, 0.14);  color: #FBBF24; }
html[data-mode="dark"] .tile-c5 .action-icon { background: rgba(167, 139, 250, 0.14); color: #A78BFA; }
html[data-mode="dark"] .tile-c6 .action-icon { background: rgba(251, 113, 133, 0.14); color: #FB7185; }

/* ── Section cards: quiet, consistent spacing. ─────────────────────── */
.app-container .dash-grid { gap: 0.9rem; }
.app-container .dash-card-title { font-size: 0.95rem; font-weight: 600; }
.app-container .dash-card-header { padding: 0.9rem 1.1rem; }

/* ── No-overflow guards (WEBSITE-A) ─────────────────────────────────
   Root causes of the horizontal spill: CSS grids using `1fr` (= minmax(auto,1fr),
   which refuses to shrink below content width) and flex children without min-width:0.
   These make everything bulletproof on narrow screens. */
html, body { overflow-x: hidden; max-width: 100%; }
.desktop-main, .app-container, .dash-grid,
.dash-col-main, .dash-col-side { min-width: 0; max-width: 100%; }
.dash-card, .network-section, .dash-services-card { min-width: 0; }
.network-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.bundle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.dash-card * { min-width: 0; }
.dash-card img { max-width: 100%; height: auto; }

@media (max-width: 767px) {
    .app-container { padding-left: 1rem; padding-right: 1rem; }
}

/* ── Collapsible AFA card (tap the banner to expand the form). ─────── */
.afa-collapse { display: block; }
.afa-collapse > summary { list-style: none; cursor: pointer; }
.afa-collapse > summary::-webkit-details-marker { display: none; }
.afa-collapse-chevron {
    margin-left: auto;
    flex: 0 0 auto;
    font-size: 1.35rem;
    color: rgba(255,255,255,0.9);
    transition: transform 0.2s;
}
.afa-collapse[open] .afa-collapse-chevron { transform: rotate(180deg); }

/* Network tab labels never clip (e.g. "AirtelTigo"). */
.network-tab .network-name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
}

/* ═══════════════════════════════════════════════════════════════════
   WEBSITE-A SHELL v3 — clean SaaS app shell.
   White sidebar with blue active pill (desktop), slide-in drawer (mobile),
   horizontal wallet band on wide screens.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Sidebar: white, hairline, quiet. ──────────────────────────────── */
.desktop-sidebar {
    background: var(--card-bg);
    border-right: 1px solid var(--border);
}
.sb-brand { border-bottom: 1px solid var(--border); }
.sb-brand-name { color: var(--primary); }
.sb-user-card {
    background: var(--bg-page);
    border: 1px solid var(--border);
}
.sb-user-card:hover { background: rgba(37, 99, 235, 0.06); }
.sb-user-avatar { background: var(--primary); color: #fff; }
.sb-user-name { color: var(--text-primary); }
.sb-user-balance { color: var(--text-secondary); }
.sb-user-chevron { color: var(--text-muted); }
.sb-nav-label { color: var(--text-muted); }
.sidebar-item { color: var(--text-secondary); font-size: 0.86rem; }
.sidebar-item:hover { background: rgba(37, 99, 235, 0.06); color: var(--text-primary); }
.sidebar-item.active {
    background: rgba(37, 99, 235, 0.10);
    color: var(--primary);
}
.sidebar-item.active::before { background: var(--primary); }
.sb-bottom { border-top: 1px solid var(--border); }
.sb-logout { color: #DC2626 !important; }
.sb-logout:hover { background: rgba(220, 38, 38, 0.08) !important; color: #B91C1C !important; }
html[data-mode="dark"] .sb-logout { color: #FCA5A5 !important; }
html[data-mode="dark"] .sb-logout:hover { background: rgba(239, 68, 68, 0.16) !important; color: #FEE2E2 !important; }

/* ── Header burger (mobile only). ──────────────────────────────────── */
.nav-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 9px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 1.15rem;
    cursor: pointer;
    flex: 0 0 auto;
}
.nav-burger:active { transform: scale(0.95); }

/* ── Mobile: sidebar becomes a slide-in drawer. ────────────────────── */
.sidenav-scrim {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1250;
}
html.sidenav-open .sidenav-scrim { opacity: 1; visibility: visible; }
@media (max-width: 767px) {
    .desktop-sidebar {
        display: flex;
        transform: translateX(-103%);
        transition: transform 0.25s ease;
        z-index: 1300;
        width: 264px;
    }
    html.sidenav-open .desktop-sidebar {
        transform: none;
        box-shadow: 0 10px 40px rgba(15, 23, 42, 0.3);
    }
    html.sidenav-open body { overflow: hidden; }
    /* Header: burger + brand only. */
    .header-page-label, .header-divider { display: none; }
}
@media (min-width: 768px) {
    .nav-burger { display: none; }
    .sidenav-scrim { display: none; }
    /* Sidebar owns the brand on desktop — header shows just the page label. */
    .header .logo, .header .header-divider { display: none; }
    .header { padding-top: 0.95rem; padding-bottom: 0.95rem; }
    .header-page-label { font-size: 1rem; color: var(--text-primary); font-weight: 700; }
}

/* ── Desktop: wallet hero becomes a horizontal account band. ───────── */
@media (min-width: 768px) {
    .wallet-hero {
        display: grid !important;
        grid-template-columns: 1fr auto auto;
        grid-template-areas:
            "top    top   top"
            "balance stats actions";
        align-items: center;
        column-gap: 2.25rem;
        row-gap: 0.9rem;
        padding: 1.4rem 1.75rem 1.5rem;
    }
    .wallet-hero-top { grid-area: top; }
    .wallet-hero-balance { grid-area: balance; margin: 0; }
    .wallet-hero-balance .stat-value { font-size: 2.3rem; }
    .hero-stats {
        grid-area: stats;
        border-top: none;
        padding-top: 0;
        margin: 0;
    }
    .hero-stat { width: auto; flex: 0 0 auto; }
    .hero-stat + .hero-stat { padding-left: 2rem; margin-left: 0; }
    .hero-stat:first-child { padding-right: 2rem; }
    .wallet-hero-actions { grid-area: actions; }
    .wallet-hero-actions > * { flex: 0 0 auto; }

    /* Quick access: all shortcuts visible, wrapped — no scrolling. */
    .quick-actions.quick-rail {
        flex-wrap: wrap;
        overflow-x: visible;
        overflow-y: visible;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   WEBSITE-A CONTENT v4 — full section redesign.
   Borderless floating cards, gradient shortcut tiles, ticket-style
   bundles, chip network picker, card-row services, refined activity.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Cards float on the canvas: no hard borders, layered soft shadow. */
.dash-card {
    border: none !important;
    border-radius: 18px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 32px -14px rgba(15, 23, 42, 0.12) !important;
}
html[data-mode="dark"] .dash-card {
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
}
.dash-card-header { border-bottom: none !important; padding: 1.1rem 1.15rem 0.4rem !important; }
.dash-card-title {
    font-size: 1rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em;
    display: inline-flex; align-items: center; gap: 0.55rem;
}
.dash-card-title i {
    display: inline-grid; place-items: center;
    width: 30px; height: 30px;
    border-radius: 9px;
    background: rgba(37, 99, 235, 0.10);
    color: var(--primary);
    font-size: 0.95rem;
}
html[data-mode="dark"] .dash-card-title i { background: rgba(96, 165, 250, 0.14); color: #60A5FA; }
.dash-text-btn {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary) !important;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    text-decoration: none !important;
}
.dash-text-btn:hover { background: rgba(37, 99, 235, 0.14); }

/* ── Quick Access: vivid gradient squircles, white glyphs. ─────────── */
.quick-rail .action-icon {
    border: none !important;
    border-radius: 17px !important;
    color: #fff !important;
}
.quick-rail .tile-c1 .action-icon,
html[data-mode="dark"] .quick-rail .tile-c1 .action-icon { background: linear-gradient(135deg, #3B82F6, #1D4ED8) !important; color: #fff !important; box-shadow: 0 8px 16px -8px rgba(37, 99, 235, 0.6); }
.quick-rail .tile-c2 .action-icon,
html[data-mode="dark"] .quick-rail .tile-c2 .action-icon { background: linear-gradient(135deg, #38BDF8, #0284C7) !important; color: #fff !important; box-shadow: 0 8px 16px -8px rgba(14, 165, 233, 0.6); }
.quick-rail .tile-c3 .action-icon,
html[data-mode="dark"] .quick-rail .tile-c3 .action-icon { background: linear-gradient(135deg, #818CF8, #4F46E5) !important; color: #fff !important; box-shadow: 0 8px 16px -8px rgba(99, 102, 241, 0.6); }
.quick-rail .tile-c4 .action-icon,
html[data-mode="dark"] .quick-rail .tile-c4 .action-icon { background: linear-gradient(135deg, #FBBF24, #D97706) !important; color: #fff !important; box-shadow: 0 8px 16px -8px rgba(217, 119, 6, 0.6); }
.quick-rail .tile-c5 .action-icon,
html[data-mode="dark"] .quick-rail .tile-c5 .action-icon { background: linear-gradient(135deg, #A78BFA, #7C3AED) !important; color: #fff !important; box-shadow: 0 8px 16px -8px rgba(124, 58, 237, 0.6); }
.quick-rail .tile-c6 .action-icon,
html[data-mode="dark"] .quick-rail .tile-c6 .action-icon { background: linear-gradient(135deg, #FB7185, #E11D48) !important; color: #fff !important; box-shadow: 0 8px 16px -8px rgba(225, 29, 72, 0.6); }
.quick-rail .action-text { color: var(--text-primary); }

/* ── Network picker: quiet chips, active pops blue. ────────────────── */
.network-tab {
    background: var(--bg-page) !important;
    border: 1.5px solid transparent !important;
    border-radius: 15px !important;
}
.network-tab:hover { border-color: var(--border) !important; }
.network-tab.active {
    background: var(--card-bg) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 10px 22px -10px rgba(37, 99, 235, 0.45) !important;
}
.network-tab.active .network-name { color: var(--primary); font-weight: 700; }
html[data-mode="dark"] .network-tab { background: rgba(255, 255, 255, 0.04) !important; }
html[data-mode="dark"] .network-tab.active { background: rgba(59, 130, 246, 0.12) !important; }

/* ── Bundles: left-aligned tickets with price pills. ───────────────── */
.bundle-card {
    background: var(--bg-page) !important;
    border: 1.5px solid transparent !important;
    border-radius: 16px !important;
    padding: 1rem 0.95rem !important;
    text-align: left !important;
}
.bundle-card:hover {
    background: var(--card-bg) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 12px 26px -12px rgba(37, 99, 235, 0.45) !important;
    transform: translateY(-2px);
}
html[data-mode="dark"] .bundle-card { background: rgba(255, 255, 255, 0.04) !important; }
html[data-mode="dark"] .bundle-card:hover { background: rgba(59, 130, 246, 0.10) !important; }
.bundle-size {
    font-size: 1.18rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em;
    color: var(--text-primary) !important;
}
.bundle-price {
    display: inline-block;
    margin-top: 0.35rem;
    background: rgba(37, 99, 235, 0.10) !important;
    color: var(--primary) !important;
    font-weight: 700 !important;
    font-size: 0.78rem !important;
    padding: 0.24rem 0.6rem !important;
    border-radius: 999px !important;
}
html[data-mode="dark"] .bundle-price { background: rgba(96, 165, 250, 0.16) !important; color: #93C5FD !important; }
.bundle-validity { margin-top: 0.45rem; font-size: 0.7rem !important; color: var(--text-muted) !important; }
.bundle-cta { margin-top: 0.4rem; font-size: 0.72rem !important; font-weight: 600; color: var(--primary) !important; }
.bundle-cta::after { content: " →"; }

/* ── Recent activity: tinted icon squircles, tabular amounts. ──────── */
.transaction-item { padding: 0.85rem 0.2rem !important; }
.transaction-icon {
    width: 42px !important; height: 42px !important;
    border-radius: 13px !important;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    font-size: 1.1rem;
    display: grid; place-items: center;
    flex: 0 0 auto;
}
html[data-mode="dark"] .transaction-icon { background: rgba(96, 165, 250, 0.14); color: #60A5FA; }
.transaction-details h4 { font-size: 0.86rem !important; font-weight: 600 !important; }
.transaction-details span { font-size: 0.72rem !important; color: var(--text-muted) !important; }
.transaction-amount { font-weight: 700 !important; font-variant-numeric: tabular-nums; font-size: 0.9rem !important; }

/* ── More Services: floating card rows with circled chevrons. ──────── */
.service-list { display: flex; flex-direction: column; gap: 0.6rem; }
.service-item {
    background: var(--bg-page) !important;
    border: 1px solid transparent !important;
    border-radius: 14px !important;
    padding: 0.8rem 0.85rem !important;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.service-item:hover {
    background: var(--card-bg) !important;
    border-color: rgba(37, 99, 235, 0.35) !important;
    box-shadow: var(--shadow-md);
}
html[data-mode="dark"] .service-item { background: rgba(255, 255, 255, 0.04) !important; }
html[data-mode="dark"] .service-item:hover { background: rgba(59, 130, 246, 0.10) !important; }
.service-item-icon {
    width: 42px !important; height: 42px !important;
    border-radius: 12px !important;
    font-size: 1.15rem !important;
}
.service-item-title { font-size: 0.87rem !important; font-weight: 600 !important; }
.service-item-desc { font-size: 0.73rem !important; color: var(--text-muted) !important; }
.service-item-chevron {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card-bg);
    display: grid; place-items: center;
    font-size: 0.95rem !important;
    color: var(--text-muted) !important;
    flex: 0 0 auto;
}

/* ── History page: floating rows + solid active filter pill. ───────── */
.history-item {
    border: none !important;
    border-radius: 16px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 26px -14px rgba(15, 23, 42, 0.14) !important;
}
html[data-mode="dark"] .history-item {
    border: 1px solid var(--border) !important;
    box-shadow: none !important;
}
.filter-btn {
    background: var(--card-bg);
    border: 1px solid var(--border) !important;
    font-weight: 600;
}
.filter-btn.active {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}

/* ── v5: ONE menu, no duplicates. The quick-access tiles moved into the
   sidebar are hidden entirely — the normal sidebar-item links already cover
   every shortcut (buy/wallet/afa/store/ishare/telecel/history/agent/profile).
   The block stays in the DOM because dashboard.js holds (guarded) refs to
   #quickHistory / #quickAfa. ── */
.desktop-sidebar .tiles-section { display: none; }

/* ═══════════════════════════════════════════════════════════════════
   WEBSITE-A BUY v6 — storefront redesign of the Buy Data Bundles card.
   Segmented pill network switcher + gradient data-size chips.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Network picker: one rounded segmented track, sliding white pill. */
.network-tabs {
    display: flex !important;
    align-items: stretch;
    gap: 0.25rem !important;
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.3rem !important;
}
html[data-mode="dark"] .network-tabs {
    background: rgba(255, 255, 255, 0.04);
}
.network-tab {
    flex: 1 1 0;
    min-width: 0;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center;
    gap: 0.45rem !important;
    padding: 0.5rem 0.55rem !important;
    border: none !important;
    border-radius: 999px !important;
    background: transparent !important;
    box-shadow: none !important;
}
.network-tab:hover { background: rgba(37, 99, 235, 0.06) !important; }
.network-tab .network-logo,
.network-tab .network-logo img {
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    object-fit: cover;
    flex: 0 0 auto;
}
.network-tab .network-name { font-size: 0.8rem; font-weight: 600; }
.network-tab.active {
    background: var(--card-bg) !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12) !important;
    border: none !important;
}
html[data-mode="dark"] .network-tab.active {
    background: rgba(59, 130, 246, 0.18) !important;
    box-shadow: none !important;
}
.network-tab.active .network-name { color: var(--primary); font-weight: 700; }
html[data-mode="dark"] .network-tab.active .network-name { color: #93C5FD; }

/* ── Bundles: centered chips, gradient data size, quiet validity pill. */
.bundle-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--border) !important;
    border-radius: 18px !important;
    padding: 1.05rem 0.5rem 0.95rem !important;
    text-align: center !important;
    box-shadow: none !important;
    transform: none;
}
.bundle-card:hover {
    border-color: var(--primary) !important;
    box-shadow: 0 12px 26px -12px rgba(37, 99, 235, 0.5) !important;
    transform: translateY(-3px);
    background: var(--card-bg) !important;
}
html[data-mode="dark"] .bundle-card { background: rgba(255, 255, 255, 0.03) !important; }
html[data-mode="dark"] .bundle-card:hover { background: rgba(59, 130, 246, 0.10) !important; }
.bundle-size {
    display: block;
    font-size: 1.45rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em;
    line-height: 1.15;
    background: linear-gradient(135deg, #2563EB, #0EA5E9);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #2563EB !important;
}
html[data-mode="dark"] .bundle-size {
    background: linear-gradient(135deg, #60A5FA, #38BDF8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #60A5FA !important;
}
.bundle-price {
    display: block !important;
    background: none !important;
    color: var(--text-primary) !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    padding: 0 !important;
    margin-top: 0.2rem;
    border-radius: 0 !important;
    font-variant-numeric: tabular-nums;
}
.bundle-validity {
    display: inline-block;
    margin-top: 0.55rem;
    font-size: 0.65rem !important;
    font-weight: 600;
    color: var(--text-muted) !important;
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
}
html[data-mode="dark"] .bundle-validity { background: rgba(255, 255, 255, 0.05); }
.bundle-cta { display: none !important; }

/* ── Grid density: 3-up from tablet, 4-up on wide (fixes the earlier
      overflow guard forcing 2 columns everywhere). ── */
@media (min-width: 768px) {
    .bundle-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (min-width: 1200px) {
    .bundle-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}

/* ═══════════════════════════════════════════════════════════════════
   WEBSITE-A BUY v7 — sleek international plan cards.
   Typography-led (no gradient ink), airline/eSIM-marketplace layout:
   data size headline, muted validity, hairline footer with price and
   a circular buy arrow. One blue accent. Overrides v6 chip styling.
   ═══════════════════════════════════════════════════════════════════ */

.bundle-card,
html[data-mode="dark"] .bundle-card {
    display: grid !important;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "size     size"
        "validity validity"
        "price    cta";
    align-items: center;
    column-gap: 0;
    text-align: left !important;
    background: var(--card-bg) !important;
    border: 1px solid var(--border) !important;
    border-radius: 20px !important;
    padding: 1.15rem 1.05rem 1rem !important;
    box-shadow: none !important;
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.bundle-card:hover,
html[data-mode="dark"] .bundle-card:hover {
    background: var(--card-bg) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 14px 30px -14px rgba(37, 99, 235, 0.45) !important;
    transform: translateY(-3px);
}
html[data-mode="dark"] .bundle-card { background: rgba(255, 255, 255, 0.03) !important; }

/* Headline: big, near-black, tight — no gradient. */
.bundle-size,
html[data-mode="dark"] .bundle-size {
    grid-area: size;
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    color: var(--text-primary) !important;
    -webkit-text-fill-color: currentColor !important;
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.035em;
    line-height: 1.1;
}

/* Validity: quiet meta line, no pill. */
.bundle-validity,
html[data-mode="dark"] .bundle-validity {
    grid-area: validity;
    display: block !important;
    margin-top: 0.2rem !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    border-radius: 0 !important;
    font-size: 0.72rem !important;
    font-weight: 500 !important;
    color: var(--text-muted) !important;
    letter-spacing: 0.01em;
}

/* Footer: hairline divider, price left, circular arrow right. */
.bundle-price {
    grid-area: price;
    display: block !important;
    margin-top: 0.85rem !important;
    padding: 0.75rem 0 0 !important;
    border-top: 1px solid var(--border);
    background: none !important;
    border-radius: 0 !important;
    color: var(--text-primary) !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}
.bundle-cta {
    grid-area: cta;
    display: block !important;
    margin-top: 0.85rem !important;
    padding: 0.6rem 0 0 !important;
    border-top: 1px solid var(--border);
    font-size: 0 !important;
    line-height: 0;
    color: transparent !important;
}
.bundle-cta::after {
    content: "→";
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 0.95rem;
    line-height: 1;
    transition: transform 0.18s, background 0.18s;
}
.bundle-card:hover .bundle-cta::after { transform: translateX(2px); background: var(--primary-dark); }

/* Switcher stays, but flatter + quieter for the international look. */
.network-tabs { border-radius: 14px; padding: 0.25rem !important; }
.network-tab { border-radius: 10px !important; }
.network-tab.active { box-shadow: 0 1px 4px rgba(15, 23, 42, 0.14) !important; }

/* v7 fix: kill the v4 dark-mode price pill inside the new plan cards. */
html[data-mode="dark"] .bundle-price {
    background: none !important;
    color: var(--text-primary) !important;
    padding: 0.75rem 0 0 !important;
    border-radius: 0 !important;
    border-top: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════════════
   WEBSITE-A MOBILE v10 — bottom nav restored as the primary mobile nav,
   drawer stays for secondary destinations. Responsive polish pass.
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 767px) {
    .header { padding: 0.6rem 0.9rem; }
    .app-container { padding: 0.9rem 0.9rem 2rem; }
    .dash-grid { gap: 0.8rem; }

    /* Wallet band breathes but stays compact. */
    .wallet-hero { padding: 1.05rem 1.1rem 1.15rem; }
    .wallet-hero-balance .stat-value { font-size: clamp(1.6rem, 8.5vw, 2.05rem); }

    /* Segmented network track: tight, never clips. */
    .network-tab { gap: 0.3rem !important; padding: 0.45rem 0.3rem !important; }
    .network-tab .network-name {
        font-size: 0.72rem;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .network-tab .network-logo,
    .network-tab .network-logo img { width: 20px !important; height: 20px !important; }

    /* Plan cards: slightly denser on phones. */
    .bundle-grid { gap: 0.6rem; }
    .bundle-card { padding: 0.95rem 0.85rem 0.85rem !important; border-radius: 16px !important; }
    .bundle-size { font-size: 1.3rem !important; }
    .bundle-cta::after { width: 28px; height: 28px; }

    .dash-card-header { padding: 0.95rem 1rem 0.35rem !important; }
    .dash-card { border-radius: 16px !important; }
}

/* Ultra-narrow phones: drop the logos, keep the names. */
@media (max-width: 380px) {
    .network-tab .network-logo { display: none !important; }
    .app-container { padding-left: 0.75rem; padding-right: 0.75rem; }
}

/* ── v9: white-label — provider logos removed, neutral colour dots. ── */
.net-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.net-c1 { background: #F59E0B; }
.net-c2 { background: #E11D48; }
.net-c3 { background: #2563EB; }
.net-c4 { background: #7C3AED; }

/* ═══════════════════════════════════════════════════════════════════
   WEBSITE-A MOBILE v11 — remove the bottom tab bar entirely. The
   hamburger drawer is now the only mobile navigation. Reclaim the
   space the bar used to reserve at the bottom of the page.
   ═══════════════════════════════════════════════════════════════════ */
.bottom-nav { display: none !important; }
@media (max-width: 767px) {
    body { padding-bottom: 1.5rem !important; }
    .store-page { padding-bottom: 1.5rem !important; }
}
@supports (padding: max(0px)) {
    @media (max-width: 767px) {
        body { padding-bottom: max(1.5rem, env(safe-area-inset-bottom)) !important; }
    }
}
