/* =====================================================
   MULTIKEY PANEL - Premium Dark Theme
   Best Looking UI 2026
   ===================================================== */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #16161f;
    --bg-card-hover: #1c1c28;
    --bg-input: #1a1a24;
    
    --border: #2a2a3a;
    --border-light: #333344;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;
    
    --accent: #10b981;
    --accent-hover: #059669;
    --accent-glow: rgba(16, 185, 129, 0.25);
    
    --purple: #8b5cf6;
    --blue: #3b82f6;
    --orange: #f59e0b;
    --pink: #ec4899;
    --red: #ef4444;
    --cyan: #06b6d4;
    
    --radius: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
input, textarea, select { font-family: inherit; }

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ========== LAYOUT ========== */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-primary);
    position: relative;
    padding-bottom: 90px;
}

/* Desktop center */
@media (min-width: 768px) {
    body {
        background: #050508;
        display: flex;
        justify-content: center;
    }
    .app-container {
        box-shadow: 0 0 80px rgba(0,0,0,0.8);
        border-left: 1px solid var(--border);
        border-right: 1px solid var(--border);
    }
}

/* ========== HEADER ========== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.header-info h1 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.header-info .badge-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-owner { background: rgba(16,185,129,0.15); color: #10b981; }
.badge-admin { background: rgba(139,92,246,0.15); color: #8b5cf6; }
.badge-reseller { background: rgba(59,130,246,0.15); color: #3b82f6; }
.badge-inactive { background: rgba(239,68,68,0.15); color: #ef4444; }

.username {
    font-size: 12px;
    color: var(--text-muted);
}

.balance-box {
    text-align: right;
}

.balance-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.balance-amount {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.5px;
}

/* ========== PAGE CONTENT ========== */
.page-content {
    padding: 20px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ========== STATS GRID ========== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 16px;
    transition: all 0.2s ease;
}

.stat-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 18px;
}

.stat-icon.green { background: rgba(16,185,129,0.15); color: #10b981; }
.stat-icon.purple { background: rgba(139,92,246,0.15); color: #8b5cf6; }
.stat-icon.blue { background: rgba(59,130,246,0.15); color: #3b82f6; }
.stat-icon.orange { background: rgba(245,158,11,0.15); color: #f59e0b; }

.stat-value {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ========== SECTION ========== */
.section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

/* ========== QUICK ACTIONS ========== */
.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.action-btn:hover, .action-btn:active {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.action-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.action-icon.green { background: rgba(16,185,129,0.15); color: #10b981; }
.action-icon.purple { background: rgba(139,92,246,0.15); color: #8b5cf6; }
.action-icon.blue { background: rgba(59,130,246,0.15); color: #3b82f6; }
.action-icon.cyan { background: rgba(6,182,212,0.15); color: #06b6d4; }
.action-icon.orange { background: rgba(245,158,11,0.15); color: #f59e0b; }

.action-text {
    flex: 1;
    font-size: 15px;
    font-weight: 550;
}

.action-arrow {
    color: var(--text-muted);
    font-size: 18px;
}

/* ========== PLATFORM TABS ========== */
.platform-tabs {
    display: flex;
    background: var(--bg-card);
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.platform-tab {
    flex: 1;
    text-align: center;
    padding: 11px 16px;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.25s ease;
    background: transparent;
}

.platform-tab.active {
    background: #fff;
    color: #0a0a0f;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.platform-tab:not(.active):hover {
    color: var(--text-primary);
}

/* ========== BRAND CARDS ========== */
.brand-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.brand-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s ease;
}

.brand-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.brand-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    flex-shrink: 0;
}

.brand-info {
    flex: 1;
}

.brand-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.brand-stock {
    font-size: 13px;
    color: var(--text-muted);
}

.brand-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
}

/* ========== STOCK PACKAGE CARDS ========== */
.stock-brand {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 14px;
}

.stock-brand-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.stock-packages {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.package-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 14px 10px;
    text-align: center;
    transition: all 0.2s;
}

.package-box:hover {
    border-color: var(--accent);
    background: rgba(16,185,129,0.05);
}

.package-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.package-stock {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 2px;
}

.package-price {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 22px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

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

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.btn-danger {
    background: rgba(239,68,68,0.1);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,0.2);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 9px;
}

.btn-full {
    width: 100%;
}

/* ========== NETWORK LIST ========== */
.network-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.network-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.network-avatar {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}

.network-info {
    flex: 1;
    min-width: 0;
}

.network-name {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.network-balance {
    font-size: 13px;
    color: var(--accent);
    font-weight: 600;
    margin-top: 2px;
}

.network-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ========== BOTTOM NAV ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: rgba(12, 12, 18, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    justify-content: space-around;
    padding: 10px 8px 18px;
    z-index: 200;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s;
    border-radius: 12px;
    min-width: 60px;
}

.nav-item i, .nav-item svg {
    font-size: 22px;
    margin-bottom: 2px;
}

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

.nav-item.active .nav-icon {
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

/* ========== MODAL ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    z-index: 300;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 12px 20px 32px;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-handle {
    width: 40px;
    height: 4px;
    background: #444;
    border-radius: 10px;
    margin: 0 auto 20px;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.4px;
}

/* ========== FORM ========== */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 15px;
    color: var(--text-primary);
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.toggle-group {
    display: flex;
    background: var(--bg-input);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid var(--border);
}

.toggle-btn {
    flex: 1;
    padding: 10px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: var(--accent);
    color: #fff;
}

/* ========== ACTIVITY / TRANSACTION ========== */
.activity-list, .txn-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item, .txn-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.activity-icon, .txn-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.activity-info, .txn-info {
    flex: 1;
}

.activity-title, .txn-title {
    font-size: 14px;
    font-weight: 550;
}

.activity-meta, .txn-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.txn-amount {
    font-size: 15px;
    font-weight: 600;
}

.txn-amount.debit { color: #ef4444; }
.txn-amount.credit { color: #10b981; }

/* ========== KEYS LIST ========== */
.key-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 10px;
}

.key-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.key-brand {
    font-size: 14px;
    font-weight: 600;
}

.key-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.key-code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 13px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    word-break: break-all;
}

.key-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* ========== LOGIN PAGE ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px 24px;
    max-width: 420px;
    margin: 0 auto;
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo .logo-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    margin: 0 auto 16px;
    box-shadow: 0 8px 32px var(--accent-glow);
}

.login-logo h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.8px;
}

.login-logo p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 6px;
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

/* ========== TOAST ========== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 14px 22px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 550;
    z-index: 999;
    box-shadow: var(--shadow-lg);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    max-width: 90%;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success { border-color: rgba(16,185,129,0.4); color: #10b981; }
.toast.error { border-color: rgba(239,68,68,0.4); color: #ef4444; }

/* ========== UTILS ========== */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }

.header-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 18px;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--accent);
}

/* Wallet Source Card */
.source-wallet-card {
    background: linear-gradient(135deg, #0d2818, #0a1f14);
    border: 1px solid rgba(16,185,129,0.25);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.source-wallet-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(16,185,129,0.15), transparent 70%);
}

.source-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 8px;
}

.source-amount {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -1.5px;
}

.source-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* Referral Card */
.referral-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.referral-code {
    font-family: 'SF Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
}
