/* ==========================================================================
   CyberGate - Captive Portal & Subscriber Self-Service Portal Stylesheet
   Modern Glassmorphic Design System with Native RTL Arabic Support
   Optimized for ultra-fast mobile rendering and zero runtime overhead
   ========================================================================== */

:root {
    /* Color Palette - Dark Theme Default */
    --bg-base: #0b0f19;
    --bg-surface: #111827;
    --bg-surface-elevated: #1f2937;
    --bg-glass: rgba(17, 24, 39, 0.75);
    --bg-glass-card: rgba(31, 41, 55, 0.65);
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(99, 102, 241, 0.5);
    --border-glow: rgba(99, 102, 241, 0.2);

    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --brand-primary: #6366f1;
    --brand-primary-hover: #4f46e5;
    --brand-glow: rgba(99, 102, 241, 0.4);

    --emerald-500: #10b981;
    --emerald-glow: rgba(16, 185, 129, 0.3);
    --amber-500: #f59e0b;
    --rose-500: #ef4444;

    --font-family: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-pill: 9999px;

    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 25px var(--brand-glow);
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
    --bg-base: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.95);
    --bg-glass-card: #ffffff;
    
    --border-subtle: #e2e8f0;
    --border-focus: #4f46e5;
    --border-glow: rgba(79, 70, 229, 0.18);

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --brand-primary: #4f46e5;
    --brand-primary-hover: #4338ca;
    --brand-glow: rgba(79, 70, 229, 0.22);

    --emerald-500: #059669;
    --emerald-glow: rgba(5, 150, 105, 0.2);

    --shadow-soft: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
}

/* Universal Custom Slim Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.25) transparent;
}
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--brand-primary);
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.18);
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: var(--brand-primary);
}

/* Reset and Global Box Model */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
}

/* Ambient Background Radial Glows */
.ambient-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}
.glow-top {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
    top: -150px;
    left: -100px;
}
.glow-bottom {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.2) 0%, transparent 70%);
    bottom: -150px;
    right: -100px;
}

/* Container */
.container {
    width: 100%;
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
    position: relative;
}

/* Glassmorphism Panel Primitive */
.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

/* Navigation Header */
.gate-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px 0;
}
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}
.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--brand-primary), #4338ca);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 12px var(--brand-glow);
}
.brand-title {
    font-size: 1.15rem;
    font-weight: 800;
    display: block;
    line-height: 1.2;
}
.brand-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Icon Buttons & Theme Toggle */
.btn-icon {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.btn-icon:hover {
    color: var(--text-primary);
    border-color: var(--border-focus);
}
[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* Network Switcher Dropdown */
.dropdown-network {
    position: relative;
}
.btn-network-switch {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition);
}
.btn-network-switch:hover {
    border-color: var(--brand-primary);
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    min-width: 200px;
    padding: 8px;
    z-index: 100;
}
.dropdown-menu.show { display: block; }
.dropdown-header {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 4px 8px;
    font-weight: 700;
}
.dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.88rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.dropdown-item:hover {
    background: var(--bg-surface-elevated);
}
.dropdown-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--brand-primary);
    font-weight: 700;
}

/* Logout Button */
.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
}
.btn-logout:hover {
    background: rgba(239, 68, 68, 0.22);
    border-color: #ef4444;
}

/* Main Content Wrapper */
.gate-main {
    flex: 1;
    padding-top: 24px;
    padding-bottom: 40px;
}

/* Login Screen Styles */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 180px);
    padding: 24px 16px;
}
.login-card {
    width: 100%;
    max-width: 440px;
    padding: 38px 32px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.4), 0 0 30px rgba(99, 102, 241, 0.08);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--brand-primary), #a855f7, transparent);
    opacity: 0.9;
}
.login-header {
    text-align: center;
    margin-bottom: 24px;
    position: relative;
}
.network-brand-avatar {
    width: 60px;
    height: 60px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
    box-shadow: 0 0 22px rgba(99, 102, 241, 0.25);
    transition: var(--transition);
}
.network-brand-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 28px rgba(99, 102, 241, 0.4);
}
.network-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--brand-primary);
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    margin-bottom: 12px;
    font-weight: 700;
}
.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--emerald-500);
    box-shadow: 0 0 8px var(--emerald-glow);
    animation: pulse-dot 2s infinite ease-in-out;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.85); }
}
.login-title {
    font-size: 1.55rem;
    font-weight: 900;
    margin-bottom: 6px;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}
.login-subtitle {
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* Form Controls with Zero-Overlap Layout */
.form-group {
    margin-bottom: 20px;
}
.form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.label-hint {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 400;
}
.label-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.btn-pill-action {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.22);
    color: var(--brand-primary);
    font-size: 0.78rem;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    border-radius: var(--radius-pill);
    padding: 3px 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}
.btn-pill-action:hover {
    background: rgba(99, 102, 241, 0.18);
    border-color: var(--brand-primary);
    transform: translateY(-1px);
}
.btn-text-action {
    background: none;
    border: none;
    color: var(--brand-primary);
    font-size: 0.8rem;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
}

/* Zero-Overlap Input Icon Wrapper */
.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    border-radius: var(--radius-md);
    transition: var(--transition);
}
.form-control {
    width: 100%;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 13px 16px;
    color: var(--text-primary);
    font-size: 0.98rem;
    font-family: inherit;
    transition: var(--transition);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}
.form-control:focus {
    outline: none;
    border-color: var(--brand-primary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px var(--border-glow), inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Explicit paddings eliminating any overlap between typed characters and icons */
.input-icon-wrapper.has-lead-icon .form-control {
    padding-right: 48px !important;
}
.input-icon-wrapper.has-action-btn .form-control {
    padding-left: 48px !important;
}
.input-icon-wrapper.has-lead-icon.has-action-btn .form-control {
    padding-right: 48px !important;
    padding-left: 48px !important;
}

/* Leading Icon - Fixed on the RIGHT (RTL leading edge) */
.input-lead-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 2;
}
.input-icon-wrapper:focus-within .input-lead-icon {
    color: var(--brand-primary);
    transform: translateY(-50%) scale(1.08);
}

/* Legacy input-icon fallback */
.input-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
}

/* Action Eye Toggle Button - Fixed on the LEFT */
.btn-toggle-pass {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    z-index: 3;
}
.btn-toggle-pass:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}
.btn-toggle-pass:focus-visible {
    outline: 2px solid var(--brand-primary);
}

/* Login Submit Button Loading State */
.login-form .btn-primary-glow.loading {
    pointer-events: none;
    opacity: 0.85;
}

/* Login Footer & Support Card */
.login-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
}
.support-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    transition: var(--transition);
}
.support-box:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(99, 102, 241, 0.3);
}
.support-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.support-title {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
}
.support-contact {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}
.btn-whatsapp-chat {
    background: #25d366;
    color: #ffffff !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 800;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    transition: var(--transition);
    white-space: nowrap;
}
.btn-whatsapp-chat:hover {
    background: #20bd5a;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.45);
}
.network-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 12px;
    line-height: 1.5;
}

/* Modal Header Refinements */
.modal-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.modal-header-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex-grow: 1;
}
.modal-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn-primary-glow {
    background: linear-gradient(135deg, var(--brand-primary), #4f46e5);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px var(--brand-glow);
    transition: var(--transition);
    text-decoration: none;
}
.btn-primary-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--brand-glow);
}
.btn-block {
    width: 100%;
}
.btn-secondary {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
.btn-secondary:hover {
    color: var(--text-primary);
    background: var(--bg-surface);
}
.btn-primary-action {
    background: var(--brand-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}
.btn-primary-action:hover {
    background: var(--brand-primary-hover);
}
.btn-buy-card {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--emerald-500);
    border-radius: var(--radius-pill);
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}
.btn-buy-card:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: var(--emerald-500);
}
.btn-subtle {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: var(--radius-pill);
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}
.btn-subtle:hover {
    color: var(--text-primary);
    border-color: var(--border-focus);
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}
.alert-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

/* Login Footer */
.login-footer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border-subtle);
    text-align: center;
}
.support-box {
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.support-contact {
    color: var(--text-primary);
    font-weight: 700;
    direction: ltr;
    display: inline-block;
}
.network-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Dashboard Profile Hero */
.profile-hero {
    padding: 24px 28px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.hero-details {
    display: flex;
    align-items: center;
    gap: 18px;
}
.avatar-ring {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--brand-primary), var(--emerald-500));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.subscriber-tag {
    font-size: 0.75rem;
    color: var(--brand-primary);
    font-weight: 700;
    text-transform: uppercase;
}
.subscriber-name {
    font-size: 1.4rem;
    font-weight: 900;
    margin: 2px 0;
}
.subscriber-meta {
    display: flex;
    gap: 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

/* KPI Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.kpi-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.kpi-card:hover {
    border-color: var(--border-focus);
    transform: translateY(-2px);
}
.balance-card::after {
    content: '';
    position: absolute;
    top: -40px;
    left: -40px;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.14) 0%, transparent 70%);
    pointer-events: none;
    border-radius: 50%;
}
.subscription-card::after {
    content: '';
    position: absolute;
    top: -40px;
    left: -40px;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.14) 0%, transparent 70%);
    pointer-events: none;
    border-radius: 50%;
}
.kpi-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.bg-emerald {
    background: rgba(16, 185, 129, 0.15);
    color: var(--emerald-500);
}
.bg-indigo {
    background: rgba(99, 102, 241, 0.15);
    color: var(--brand-primary);
}
.bg-amber {
    background: rgba(245, 158, 11, 0.16);
    color: #f59e0b;
}
.kpi-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.kpi-label {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 700;
}
.btn-refresh-balance {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    transition: var(--transition);
}
.btn-refresh-balance:hover {
    color: var(--text-primary);
    transform: rotate(180deg);
}
.kpi-value-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 8px 0 16px;
}
.balance-number {
    font-size: 2.3rem;
    font-weight: 900;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}
.balance-currency {
    font-size: 1rem;
    color: var(--emerald-500);
    font-weight: 800;
}
/* Multi-Currency Wallets Grid */
.wallets-multi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 10px 0 14px;
}
@media (max-width: 480px) {
    .wallets-multi-grid {
        grid-template-columns: 1fr;
    }
}
.wallet-chip {
    background: var(--bg-surface-elevated, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    transition: all 0.2s ease;
}
.wallet-chip.primary {
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.06);
}
.wallet-chip-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
}
.wallet-chip-amount {
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.wallet-chip-num {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--text-primary);
}
.wallet-chip-sym {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--emerald-500);
}
/* Modal Multi-Wallets Strip */
.modal-wallets-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.wallet-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}
.kpi-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Subscription Active Stat Rows */
.active-sub-details {
    margin-top: 10px;
}
.sub-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.88rem;
}
.sub-stat-row:last-child {
    border-bottom: none;
}
.stat-name {
    color: var(--text-secondary);
}
.stat-val {
    font-weight: 700;
}
.stat-val.highlight {
    color: var(--brand-primary);
}
.empty-sub-notice {
    padding: 12px 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* Portal Sections */
.portal-section {
    margin-bottom: 36px;
}
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}
.section-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--text-primary);
}
.badge-count {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 700;
}

/* Cards Grid & Ticket Styling */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}
.card-ticket {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, var(--bg-glass) 0%, var(--bg-glass-card) 100%);
}
.card-ticket::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-primary), var(--emerald-500));
    opacity: 0;
    transition: var(--transition);
}
.card-ticket:hover {
    transform: translateY(-3px);
    border-color: var(--border-focus);
    box-shadow: var(--shadow-glow);
}
.card-ticket:hover::before,
.card-ticket.border-active::before {
    opacity: 1;
}
.card-ticket.border-active {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.18);
}
.ticket-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.package-badge {
    background: rgba(99, 102, 241, 0.15);
    color: var(--brand-primary);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.82rem;
    font-weight: 800;
}
.status-badge {
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
}
.status-new {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}
.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}
.status-expired {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}
.btn-subtle {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}
.btn-subtle:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--border-focus);
}

/* Ticket Credentials */
.ticket-credentials {
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 14px;
}
.credential-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}
.credential-item:first-child {
    border-bottom: 1px dashed var(--border-subtle);
}
.cred-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.cred-val-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}
.cred-val {
    font-family: monospace;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    direction: ltr;
}
.cred-val.masked {
    letter-spacing: 2px;
}
.btn-copy, .btn-reveal {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 3px;
    display: flex;
    align-items: center;
    transition: var(--transition);
}
.btn-copy:hover, .btn-reveal:hover {
    color: var(--brand-primary);
}
.ticket-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
}
.btn-action-outline {
    background: var(--bg-surface, rgba(255, 255, 255, 0.72));
    border: 1px solid rgba(100, 116, 139, 0.32);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    font-size: 0.84rem;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
}
.btn-action-outline:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

/* Hotspot Auto-Connect Button and Card Action Grid */
.btn-connect-hotspot {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 9px 14px;
    font-size: 0.86rem;
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    transition: var(--transition);
}
.btn-connect-hotspot:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}
.btn-renew-card {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 9px 14px;
    font-size: 0.86rem;
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
    transition: var(--transition);
}
.btn-renew-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}
.btn-renew-card:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}
.ticket-actions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
}
.ticket-telemetry {
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.78rem;
}
.ticket-telemetry-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.ticket-telemetry-label {
    color: var(--text-muted);
}
.ticket-progress-track {
    width: 100%;
    height: 5px;
    background: rgba(148, 163, 184, 0.22);
    border-radius: 99px;
    overflow: hidden;
}
.ticket-progress-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.3s ease;
}

/* Data Table (Deposits) */
.deposits-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: right;
}
.data-table th {
    padding: 14px 18px;
    color: var(--text-secondary);
    font-weight: 700;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface-elevated);
}
.data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
}
.data-table tr:last-child td {
    border-bottom: none;
}
.data-table tr:hover td {
    background: rgba(99, 102, 241, 0.04);
}
.text-emerald { color: var(--emerald-500); font-weight: 800; }

/* Modals System - Fixed Header/Footer with Slim Scrolling Body */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-backdrop.show {
    display: flex;
}
.modal-dialog {
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-dialog.modal-lg {
    max-width: 820px;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    background: var(--bg-surface);
}
.modal-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}
.btn-close-modal {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    line-height: 1;
    transition: var(--transition);
}
.btn-close-modal:hover {
    color: var(--rose-500);
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
    transform: rotate(90deg);
}
.modal-body {
    padding: 22px 24px;
    overflow-y: auto;
    flex: 1 1 auto;
}
.modal-desc {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-bottom: 18px;
    line-height: 1.6;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
    background: var(--bg-surface);
}

/* Modal Balance Strip */
.modal-balance-strip {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(16, 185, 129, 0.08));
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.92rem;
    font-weight: 700;
}

/* Profile System Pills & Group Header in Buy Modal */
.profile-system-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 12px;
}
.system-filter-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.system-filter-btn:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}
.system-filter-btn.active {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
    box-shadow: 0 4px 12px var(--brand-glow);
}
.profile-system-section {
    margin-bottom: 18px;
}
.profile-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    margin: 14px 0 12px 0;
    background: var(--bg-surface-elevated, rgba(255, 255, 255, 0.04));
    border-radius: var(--radius-sm);
    border-right: 4px solid var(--brand-primary);
}
.profile-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* Profile Selection Cards Grid in Buy Modal */
.profiles-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.profile-plan-card {
    background: var(--bg-surface);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.profile-plan-card:hover:not(.disabled) {
    border-color: var(--brand-primary);
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -6px var(--brand-glow);
}
.profile-plan-card.disabled {
    opacity: 0.65;
    background: var(--bg-base);
    border-style: dashed;
    cursor: not-allowed;
}
.plan-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}
/* Row inside plan-header to hold name + type badge side by side */
.plan-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.plan-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
}
/* Profile system type badge: small pill indicating hotspot / ppp / userman / radius */
.plan-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.badge-hotspot  { background: #dcfce7; color: #15803d; }
.badge-ppp      { background: #dbeafe; color: #1d4ed8; }
.badge-userman  { background: #fef9c3; color: #854d0e; }
.badge-radius   { background: #f3e8ff; color: #7e22ce; }
.plan-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
    color: var(--emerald-500);
}
.price-num {
    font-size: 1.5rem;
    font-weight: 900;
}
.price-curr {
    font-size: 0.85rem;
    font-weight: 700;
}
.plan-specs {
    font-size: 0.82rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-subtle);
    padding-top: 10px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.spec-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}
.spec-row strong {
    color: var(--text-primary);
}
.btn-plan-select {
    width: 100%;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-hover));
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px;
    font-size: 0.88rem;
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--brand-glow);
    transition: var(--transition);
}
.btn-plan-select:hover:not(.btn-disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--brand-glow);
}
.btn-plan-select.btn-disabled {
    background: var(--bg-surface-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    box-shadow: none;
    cursor: not-allowed;
}

/* Empty States & Notice Banners */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 48px 24px;
    margin: 12px 0 24px;
    border-radius: var(--radius-lg);
    border: 1.5px dashed var(--border-subtle);
}
.empty-state-icon {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(16, 185, 129, 0.1));
    border: 1px solid var(--border-subtle);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    box-shadow: 0 8px 20px -6px var(--brand-glow);
}
.empty-state h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.empty-state p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 460px;
    margin: 0 auto 22px;
    line-height: 1.6;
}
.empty-notice-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.6;
    margin-top: 10px;
    border: 1px solid var(--border-subtle);
}
.notice-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.notice-text strong {
    display: block;
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 2px;
}
.notice-text p {
    margin: 0;
    color: var(--text-secondary);
}

/* Revealed Purchased Ticket Modal */
.success-icon-badge {
    width: 60px;
    height: 60px;
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid var(--emerald-500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--emerald-500);
    margin-bottom: 8px;
}
.revealed-ticket {
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-md);
    padding: 16px;
    margin: 16px 0;
    text-align: right;
}
.revealed-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-subtle);
}
.revealed-row:last-child { border-bottom: none; }
.code-text {
    font-family: monospace;
    font-size: 1.25rem;
    color: var(--brand-primary);
    letter-spacing: 1px;
    direction: ltr;
}
.revealed-code-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast-msg {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    font-size: 0.88rem;
    font-weight: 700;
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    direction: rtl;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Footer */
.gate-footer {
    border-top: 1px solid var(--border-subtle);
    padding: 18px 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.gate-footer a {
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 700;
}

/* ==========================================================================
   Comprehensive Mobile & Responsive Breakpoints Architecture
   Tailored for all viewports: Desktop, Tablet, Large Mobile & Small Handhelds
   ========================================================================== */

/* Touch Device Interaction Enhancements */
button, .btn-primary-glow, .btn-primary-action, .btn-buy-card, .btn-subtle, .btn-action-outline {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}
button:active, .btn-primary-glow:active, .btn-primary-action:active, .btn-buy-card:active {
    transform: scale(0.97);
}

/* Tablet & Medium Screens (<= 1024px) */
@media (max-width: 1024px) {
    .container {
        max-width: 960px;
        padding-left: 18px;
        padding-right: 18px;
    }
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .profiles-selection-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

/* Phablets & Small Tablets (<= 768px) */
@media (max-width: 768px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    .gate-header {
        padding: 10px 0;
    }
    .gate-main {
        padding-top: 18px;
        padding-bottom: 30px;
    }
    .profile-hero {
        padding: 20px;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }
    .hero-details {
        gap: 14px;
    }
    .hero-actions {
        width: 100%;
    }
    .hero-actions .btn-subtle {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
    }
    .kpi-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 24px;
    }
    .kpi-card {
        padding: 20px;
    }
    .kpi-card-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        width: 100%;
    }
    .kpi-card-actions .btn-primary-action,
    .kpi-card-actions .btn-buy-card {
        justify-content: center;
        width: 100%;
        padding: 10px 12px;
    }
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 14px;
    }
    .modal-dialog {
        padding: 20px 18px;
    }
    .modal-dialog.modal-lg {
        max-width: 95vw;
    }
    .deposits-table-wrapper {
        border-radius: var(--radius-md);
        -webkit-overflow-scrolling: touch;
        border: 1px solid var(--border-subtle);
    }
    .data-table th,
    .data-table td {
        padding: 12px 14px;
        font-size: 0.84rem;
        white-space: nowrap;
    }
}

/* Standard Mobile Devices (<= 640px) */
@media (max-width: 640px) {
    .container {
        padding-left: 14px;
        padding-right: 14px;
    }
    .header-container {
        gap: 8px;
    }
    .brand-link {
        gap: 10px;
        min-width: 0;
    }
    .brand-icon {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }
    .brand-icon svg {
        width: 20px;
        height: 20px;
    }
    .brand-title {
        font-size: 0.98rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 135px;
    }
    .brand-subtitle {
        font-size: 0.65rem;
    }
    .header-actions {
        gap: 6px;
        flex-shrink: 0;
    }
    .btn-network-switch {
        padding: 6px 10px;
        font-size: 0.78rem;
    }
    .btn-logout {
        padding: 6px 10px;
        font-size: 0.78rem;
    }
    .logout-label {
        display: none;
    }
    .dropdown-menu {
        right: 0;
        left: auto;
        min-width: 180px;
        max-width: calc(100vw - 28px);
    }
    .login-wrapper {
        min-height: calc(100vh - 140px);
        padding: 12px 0;
    }
    .login-card {
        padding: 24px 18px;
        border-radius: var(--radius-md);
    }
    .login-title {
        font-size: 1.35rem;
    }
    .login-subtitle {
        font-size: 0.82rem;
    }
    .avatar-ring {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
        flex-shrink: 0;
    }
    .subscriber-name {
        font-size: 1.2rem;
    }
    .subscriber-meta {
        font-size: 0.78rem;
        gap: 8px;
    }
    .balance-number {
        font-size: 1.95rem;
    }
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .card-ticket {
        padding: 16px;
    }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .section-header .btn-primary-action,
    .section-header .btn-subtle {
        width: 100%;
        justify-content: center;
        padding: 9px 14px;
    }
    .modal-backdrop {
        padding: 0;
        align-items: flex-end;
    }
    .modal-dialog {
        max-width: 100%;
        max-height: 88vh;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        padding: 20px 16px;
    }
    .profiles-selection-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .profile-plan-card {
        padding: 12px;
    }
    .plan-name {
        font-size: 0.92rem;
    }
    .price-num {
        font-size: 1.25rem;
    }
    .toast-container {
        left: 12px;
        right: 12px;
        bottom: 16px;
    }
    .toast-msg {
        width: 100%;
        text-align: center;
        font-size: 0.84rem;
        padding: 10px 14px;
    }
}

/* Small Handhelds & Extra-Compact Phones (<= 480px) */
@media (max-width: 480px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    .brand-title {
        max-width: 105px;
    }
    .brand-subtitle {
        display: none;
    }
    .hero-details {
        align-items: flex-start;
    }
    .kpi-card-actions {
        grid-template-columns: 1fr;
    }
    .profiles-selection-grid {
        grid-template-columns: 1fr;
    }
    .revealed-ticket {
        padding: 12px;
    }
    .revealed-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .revealed-code-wrap {
        width: 100%;
        justify-content: space-between;
    }
    .form-control {
        font-size: 16px; /* Prevents auto-zoom on iOS mobile browsers */
        padding: 11px 14px;
    }
}

/* Micro Devices (<= 360px) */
@media (max-width: 360px) {
    .brand-icon {
        width: 32px;
        height: 32px;
    }
    .brand-title {
        font-size: 0.88rem;
        max-width: 85px;
    }
    .btn-icon {
        width: 34px;
        height: 34px;
    }
    .balance-number {
        font-size: 1.7rem;
    }
    .login-card {
        padding: 20px 14px;
    }
}

/* ==========================================================================
   Scalable Pagination & Live Search Bar Components
   Crafted with high-performance CSS transitions and glassmorphism.
   ========================================================================== */

/* Search Toolbar */
.section-toolbar {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    max-width: 420px;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    pointer-events: none;
    transition: var(--transition);
}

.section-search-input {
    padding-right: 40px !important;
    padding-left: 36px !important;
    height: 42px;
    font-size: 0.92rem;
    border-radius: var(--radius-pill);
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
}

.section-search-input:focus ~ .search-icon {
    color: var(--brand-primary);
}

.btn-clear-search {
    position: absolute;
    left: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 50%;
    transition: var(--transition);
}

.btn-clear-search:hover {
    color: var(--rose-500);
}

/* Pagination Bar Styles */
.pagination-wrapper {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-soft);
    flex-wrap: wrap;
}

.pagination-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

[data-theme="light"] .pagination-nav-btn {
    background: #ffffff;
    border-color: #e2e8f0;
}

.pagination-nav-btn:hover:not(:disabled) {
    background: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
    box-shadow: 0 0 12px var(--brand-glow);
}

.pagination-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-pages-list {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-num-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

[data-theme="light"] .pagination-num-btn {
    background: #ffffff;
    border-color: #e2e8f0;
}

.pagination-num-btn:hover:not(.active) {
    background: rgba(99, 102, 241, 0.15);
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.pagination-num-btn.active {
    background: var(--brand-primary);
    color: #ffffff;
    border-color: var(--brand-primary);
    box-shadow: 0 0 14px var(--brand-glow);
}

.pagination-ellipsis {
    padding: 0 4px;
    color: var(--text-muted);
    font-weight: 700;
}

.pagination-summary {
    margin-right: 12px;
    padding-right: 12px;
    border-right: 1px solid var(--border-subtle);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.pagination-summary strong {
    color: var(--text-primary);
}

/* Subtle fade during async pagination requests */
.loading-fade {
    opacity: 0.45;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .pagination-bar {
        gap: 6px;
        padding: 8px 12px;
        width: 100%;
        justify-content: space-between;
    }
    .pagination-summary {
        width: 100%;
        text-align: center;
        margin-right: 0;
        padding-right: 0;
        border-right: none;
        padding-top: 6px;
        border-top: 1px solid var(--border-subtle);
    }
    .search-input-wrapper {
        max-width: 100%;
    }
}

/* ==========================================================================
   Subscriber Notification Center & Bell Styles
   ========================================================================== */
.notif-bell-btn {
    position: relative;
    padding: 8px 14px;
}
.notif-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    min-width: 19px;
    height: 19px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-surface, #1e293b);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.7);
    line-height: 1;
}
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md, 12px);
    background: var(--bg-surface-elevated, #1e293b);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    margin-bottom: 10px;
    transition: var(--transition, all 0.2s ease);
    cursor: pointer;
    position: relative;
}
.notif-item:hover {
    border-color: var(--border-focus, #6366f1);
    transform: translateY(-1px);
}
.notif-item.unread {
    background: rgba(99, 102, 241, 0.07);
    border-color: rgba(99, 102, 241, 0.35);
}
.notif-item.unread::after {
    content: '';
    position: absolute;
    top: 14px;
    left: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6366f1;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.9);
}
.notif-icon-bubble {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.notif-content {
    flex: 1;
    min-width: 0;
}
.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 3px;
}
.notif-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
}
.notif-time {
    font-size: 0.75rem;
    color: var(--text-muted, #94a3b8);
    white-space: nowrap;
}
.notif-body {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-secondary, #cbd5e1);
    line-height: 1.5;
}

/* Web Push Notification Banner & Controls */
.push-notif-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md, 12px);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(16, 185, 129, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.25);
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.push-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 200px;
}
.push-icon-bubble {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.2);
    color: var(--brand-primary, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.push-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.push-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary, #ffffff);
}
.push-desc {
    margin: 0;
    font-size: 0.76rem;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.35;
}
.push-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.btn-push-action {
    background: var(--brand-primary, #6366f1);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm, 8px);
    padding: 6px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition, all 0.2s ease);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-push-action:hover {
    background: var(--brand-primary-hover, #4f46e5);
    transform: translateY(-1px);
}
.btn-push-action.active {
    background: rgba(16, 185, 129, 0.16);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

/* Auto-Renewal Toggle Switch Box */
.auto-renew-box {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all 0.2s ease;
}
.auto-renew-box.active {
    border-color: rgba(99, 102, 241, 0.45);
    background: rgba(99, 102, 241, 0.08);
}
.auto-renew-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.auto-renew-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}
.auto-renew-desc {
    font-size: 0.74rem;
    color: var(--text-secondary);
    line-height: 1.35;
}
.auto-renew-box.active .auto-renew-desc {
    color: var(--brand-primary);
}

/* Accessible Pill Toggle Switch */
.gate-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}
.gate-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.gate-switch-slider {
    position: absolute;
    inset: 0;
    background-color: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    transition: 0.25s ease;
}
.gate-switch-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    border-radius: 50%;
    transition: 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.gate-switch input:checked + .gate-switch-slider {
    background-color: var(--brand-primary, #6366f1);
}
.gate-switch input:checked + .gate-switch-slider::before {
    transform: translateX(20px);
}
.gate-switch input:disabled + .gate-switch-slider {
    opacity: 0.6;
    cursor: wait;
}

/* =============================================================================
   Telegram-Style Country Selector & Split Dial-Code Phone Input
   ============================================================================= */
.tg-phone-widget {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tg-country-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 8px;
    margin: 4px 2px 4px 0;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    flex-shrink: 0;
    font-family: inherit;
    transition: background 0.16s ease;
}

.tg-country-trigger:hover,
.tg-country-trigger:focus-visible {
    outline: none;
    background: rgba(99, 102, 241, 0.12);
}

.tg-country-flag {
    font-size: 1.35rem;
    line-height: 1;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tg-flag-svg {
    width: 24px;
    height: 17px;
    border-radius: 3px;
    display: block;
    box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.35);
}

.tg-country-chevron {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.tg-phone-box {
    display: flex;
    align-items: center;
    width: 100%;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0 10px 0 8px;
    transition: var(--transition);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tg-phone-box:focus-within {
    border-color: var(--brand-primary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px var(--border-glow), inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tg-plus-sign {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--brand-primary);
    user-select: none;
    padding-left: 2px;
}

.tg-dial-input {
    width: 44px;
    min-width: 38px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    text-align: center;
    padding: 13px 2px;
    outline: none;
}

.tg-phone-divider {
    width: 1px;
    height: 22px;
    background: var(--border-subtle);
    margin: 0 8px 0 4px;
    flex-shrink: 0;
}

.tg-local-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.98rem;
    font-weight: 600;
    font-family: inherit;
    padding: 13px 4px;
    outline: none;
}

.tg-local-input::placeholder {
    color: var(--text-muted);
    opacity: 0.72;
}

.tg-phone-icon {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    padding-left: 6px;
    flex-shrink: 0;
    pointer-events: none;
}

.tg-phone-box:focus-within .tg-phone-icon {
    color: var(--brand-primary);
}

/* Searchable Country Picker Modal */
.tg-country-picker-backdrop {
    z-index: 1200;
}

.tg-country-picker-dialog {
    max-width: 440px;
}

.tg-country-picker-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 62vh;
}

.tg-country-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.tg-country-search-icon {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

.tg-country-search-input {
    padding-right: 42px !important;
}

.tg-country-list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 44vh;
    padding-left: 2px;
}

.tg-country-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    cursor: pointer;
    text-align: right;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.tg-country-option:hover {
    background: rgba(99, 102, 241, 0.10);
}

.tg-country-option.active {
    background: rgba(99, 102, 241, 0.16);
    border-color: rgba(99, 102, 241, 0.35);
}

.tg-country-option-names {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.tg-country-option-ar {
    font-size: 0.92rem;
    font-weight: 700;
}

.tg-country-option-en {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.tg-country-option-code {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--brand-primary);
    flex-shrink: 0;
}

.tg-country-empty {
    text-align: center;
    padding: 24px 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =============================================================================
   WhatsApp Activation & Password Reset Code Action Box
   ============================================================================= */
.wa-action-box {
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(37, 211, 102, 0.35);
    background: rgba(37, 211, 102, 0.08);
}

.wa-action-box.wa-action-reset {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.09);
}

.wa-cmd-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
}

.wa-cmd-dest {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.wa-cmd-value {
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text-primary);
}

.wa-copy-btn {
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
}

.wa-intent-grid {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.wa-intent-btn {
    flex: 1;
    min-width: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    border-radius: 10px;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    transition: opacity 0.16s ease;
}

.wa-intent-btn:hover {
    opacity: 0.92;
}

.wa-btn-regular {
    background: #25d366;
}

.wa-btn-business {
    background: #128c7e;
}

.wa-action-note {
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.45;
}




