:root {
    --bg-base: #0b0f19;
    --bg-surface: rgba(18, 24, 38, 0.85);
    --bg-glass: rgba(26, 35, 54, 0.65);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(99, 102, 241, 0.3);
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.35);

    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

body {
    background: radial-gradient(circle at 10% 10%, #1e1b4b 0%, #0b0f19 50%, #030712 100%);
    color: var(--text-main);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism utility */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glass);
}

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 270px;
    border-radius: 0;
    border-top: none;
    border-bottom: none;
    border-left: none;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    position: fixed;
    height: 100vh;
    z-index: 50;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 20px;
}

.brand-icon {
    font-size: 28px;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
}

.brand-text h3 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.8), rgba(79, 70, 229, 0.9));
    box-shadow: 0 4px 15px var(--primary-glow);
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border-glass);
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-info span {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.user-info small {
    color: var(--text-dim);
    font-size: 11px;
}

/* Main Area */
.main-content {
    margin-left: 270px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    border-radius: 0;
    border-top: none;
    border-right: none;
    border-left: none;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 40;
}

.page-title h2 {
    font-size: 20px;
    font-weight: 700;
}

.timezone-badge {
    font-size: 12px;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.content-body {
    padding: 28px 32px;
    flex: 1;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.kpi-card {
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-highlight);
}

.kpi-card.highlight {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.15));
    border-color: rgba(99, 102, 241, 0.4);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 500;
}

.kpi-icon {
    font-size: 18px;
}

.kpi-card h3 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 6px;
    color: #fff;
}

.kpi-sub {
    font-size: 12px;
    color: var(--text-dim);
}

/* Charts */
.chart-section {
    padding: 24px;
    margin-bottom: 24px;
}

.section-header {
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
}

/* Cards & Tables */
.card {
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.card-header p {
    font-size: 13px;
    color: var(--text-dim);
}

.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.max-w-700 {
    max-width: 700px;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.data-table th {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-main);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-subtle { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-hover)); color: #fff; box-shadow: 0 4px 12px var(--primary-glow); }
.btn-primary:hover { opacity: 0.95; transform: translateY(-1px); }
.btn-secondary { background: rgba(255, 255, 255, 0.08); color: var(--text-main); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.12); }
.btn-accent { background: linear-gradient(135deg, var(--accent), #0284c7); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.btn-block { width: 100%; }

/* Form Controls */
.form-group {
    margin-bottom: 16px;
}

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

label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

input, select, textarea {
    width: 100%;
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.mono { font-family: var(--font-mono); font-size: 12px; }

.section-divider {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 20px 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-glass);
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-overlay.hidden { display: none; }

.modal-card {
    width: 90%;
    max-width: 580px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 12px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #1e1b4b 0%, #0b0f19 70%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.login-overlay.hidden { display: none; }

.login-card {
    width: 90%;
    max-width: 400px;
    padding: 36px 28px;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.logo-badge {
    font-size: 40px;
    margin-bottom: 12px;
}

.error-msg {
    margin-top: 14px;
    color: var(--danger);
    font-size: 13px;
    text-align: center;
}

/* Simulator Stats */
.sim-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sim-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
}

.sim-stat.highlight {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
}

.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

/* Points and currency badges */
.pts-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(251, 191, 36, 0.15);
    color: #FBBF24;
    border: 1px solid rgba(251, 191, 36, 0.35);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    font-family: var(--font-mono);
}

.inr-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.35);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    font-family: var(--font-mono);
}

.search-bar {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-bar input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 8px 14px;
    font-size: 13px;
    width: 260px;
}

.search-bar input:focus {
    border-color: var(--primary);
    outline: none;
}

.hint {
    display: block;
    color: var(--text-dim);
    font-size: 11px;
    margin-top: 4px;
}

.status-msg {
    margin-top: 12px;
    font-size: 13px;
    font-weight: 500;
}

.user-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.user-info-card, .quick-adjust-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-glass);
    padding: 16px;
    border-radius: var(--radius-sm);
}

.user-info-card p {
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.user-info-card p strong {
    color: var(--text-main);
}

