/* ================================================
   VELTRIX AI v3.0 - Admin Panel Stylesheet
   Premium Dark Theme with Light Mode Support
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a1f2e;
    --bg-card-hover: #1f2537;
    --bg-input: #151b2b;
    --border-color: #2a3042;
    --border-focus: #6366f1;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --accent-soft: rgba(99, 102, 241, 0.08);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);
    --long-color: #10b981;
    --short-color: #ef4444;
    --wait-color: #f59e0b;
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-mono: 'SF Mono', 'Fira Code', monospace;
}

/* ─── GLOBAL RESET ─── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-hover); }

/* ─── LAYOUT ─── */
.admin-layout { display: flex; min-height: 100vh; }
.main-content { flex: 1; margin-left: var(--sidebar-width); padding: 0; min-height: 100vh; display: flex; flex-direction: column; }
.page-content { padding: 24px 32px; max-width: 1600px; margin: 0 auto; width: 100%; align-self: center; }

/* ─── HEADER ─── */
.admin-header {
    height: var(--header-height);
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}
.header-title { font-size: 1.1rem; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 16px; }
.header-badge {
    background: linear-gradient(135deg, var(--accent), #a855f7);
    color: white;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.header-user:hover { background: var(--bg-card); }
.header-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

/* ─── SIDEBAR ─── */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}
.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    gap: 10px;
}
.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}
.brand-text { font-size: 1.1rem; font-weight: 800; letter-spacing: 0.5px; }
.brand-sub { font-size: 0.65rem; color: var(--text-muted); letter-spacing: 1.5px; text-transform: uppercase; }

.sidebar-nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; }
.nav-section { margin-bottom: 20px; }
.nav-section-title {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
    cursor: pointer;
    position: relative;
}
.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}
.nav-item .icon { font-size: 1.1rem; width: 24px; text-align: center; }
.nav-item .badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ─── PAGE HEADER ─── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}
.page-title { font-size: 1.5rem; font-weight: 700; }
.page-subtitle { color: var(--text-secondary); font-size: 0.875rem; margin-top: 2px; }

/* ─── CARDS ─── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: var(--transition);
}
.card:hover { border-color: rgba(99, 102, 241, 0.15); box-shadow: var(--shadow); }
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.card-title { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }

/* ─── STAT CARDS ─── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0;
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-card:hover::before { opacity: 1; }
.stat-card:nth-child(1)::before { background: linear-gradient(90deg, var(--info), #818CF8); }
.stat-card:nth-child(2)::before { background: linear-gradient(90deg, var(--success), #34D399); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, #a855f7, #C084FC); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, var(--warning), #FBBF24); }
.stat-card:nth-child(5)::before { background: linear-gradient(90deg, var(--success), #10B981); }
.stat-card:nth-child(6)::before { background: linear-gradient(90deg, var(--accent), #818CF8); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.stat-icon.blue { background: var(--info-bg); color: var(--info); }
.stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-icon.yellow { background: var(--warning-bg); color: var(--warning); }
.stat-icon.red { background: var(--danger-bg); color: var(--danger); }
.stat-icon.purple { background: rgba(168, 85, 247, 0.1); color: #a855f7; }
.stat-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px; }
.stat-label { font-size: 0.78rem; color: var(--text-secondary); }
.stat-change { font-size: 0.72rem; margin-top: 2px; font-weight: 600; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ─── TABLES ─── */
.table-container { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--bg-input); }
th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    white-space: nowrap;
}
td {
    padding: 14px 16px;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}
tr:hover td { background: var(--bg-card-hover); }

/* ─── BADGES ─── */
.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.2px;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-long { background: rgba(16, 185, 129, 0.15); color: var(--long-color); }
.badge-short { background: rgba(239, 68, 68, 0.15); color: var(--short-color); }
.badge-wait { background: rgba(245, 158, 11, 0.15); color: var(--wait-color); }

/* ─── BUTTONS ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent), #818CF8);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35); }
.btn-secondary { background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; transform: translateY(-1px); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; transform: translateY(-1px); }
.btn-sm { padding: 6px 14px; font-size: 0.78rem; }
.btn-icon { padding: 8px; border-radius: 8px; }

/* ─── FORMS ─── */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    transition: var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-textarea { min-height: 100px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ─── SEARCH ─── */
.search-bar { display: flex; gap: 12px; margin-bottom: 20px; }
.search-input {
    flex: 1;
    padding: 10px 16px 10px 40px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
}
.search-input:focus { outline: none; border-color: var(--border-focus); }

/* ─── MODALS ─── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 560px;
    padding: 0;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    animation: modalIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(-10px); } }
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close {
    width: 32px; height: 32px;
    border: none;
    background: var(--bg-input);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }
.modal-body { padding: 24px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* ─── PAGINATION ─── */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 24px; }
.page-btn {
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
}
.page-btn:hover, .page-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── CHARTS ─── */
.chart-container {
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 20px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}
.chart-card { padding: 20px 24px; }
.chart-period-selector { display: flex; gap: 4px; }
.period-btn {
    padding: 5px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 600;
    transition: var(--transition);
    font-family: inherit;
}
.period-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.period-btn.active { background: var(--accent); border-color: var(--accent); color: white; }

/* ─── HEALTH BARS ─── */
.health-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-color); }
.health-row:last-child { border: none; }
.health-label { width: 120px; font-size: 0.78rem; color: var(--text-secondary); font-weight: 500; }
.health-bar-track { flex: 1; height: 6px; background: var(--bg-input); border-radius: 3px; overflow: hidden; }
.health-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.health-bar.green { background: linear-gradient(90deg, var(--success), #34D399); }
.health-bar.yellow { background: linear-gradient(90deg, var(--warning), #FBBF24); }
.health-bar.red { background: linear-gradient(90deg, var(--danger), #F87171); }
.health-val { width: 80px; text-align: right; font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); }

/* ─── METRIC BARS ─── */
.metric-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-color);
}
.metric-bar:last-child { border-bottom: none; }
.metric-label { width: 140px; font-size: 0.82rem; color: var(--text-secondary); font-weight: 500; }
.metric-track {
    flex: 1;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.metric-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.metric-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 12px;
    height: 100%;
    background: rgba(255,255,255,0.3);
    border-radius: 0 4px 4px 0;
}
.metric-fill.gradient-blue { background: linear-gradient(90deg, var(--accent), #818CF8); }
.metric-fill.gradient-green { background: linear-gradient(90deg, var(--success), #34D399); }
.metric-fill.gradient-yellow { background: linear-gradient(90deg, var(--warning), #FBBF24); }
.metric-fill.gradient-red { background: linear-gradient(90deg, var(--danger), #F87171); }
.metric-fill.gradient-purple { background: linear-gradient(90deg, #a855f7, #C084FC); }
.metric-value {
    width: 70px;
    text-align: right;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

/* ─── PROGRESS RINGS ─── */
.progress-ring {
    width: 100px;
    height: 100px;
    position: relative;
}
.progress-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}
.progress-ring .ring-bg {
    fill: none;
    stroke: var(--bg-input);
    stroke-width: 8;
}
.progress-ring .ring-fill {
    fill: none;
    stroke: var(--accent);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-ring .ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    font-weight: 800;
}

/* ─── TOAST ─── */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; }
.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    margin-bottom: 8px;
    min-width: 300px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } }
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }

/* ─── LOADING ─── */
.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── SHIMMER (skeleton loading) ─── */
.shimmer {
    background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-card-hover) 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ─── KPI CARD DECORATIONS ─── */
.kpi-card { position: relative; overflow: hidden; }
.kpi-card::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    opacity: 0.05;
    transition: opacity 0.3s;
}
.kpi-card:hover::after { opacity: 0.1; }
.kpi-card:nth-child(1)::after { background: var(--info); }
.kpi-card:nth-child(2)::after { background: var(--success); }
.kpi-card:nth-child(3)::after { background: #a855f7; }
.kpi-card:nth-child(4)::after { background: var(--warning); }
.kpi-card:nth-child(5)::after { background: var(--success); }
.kpi-card:nth-child(6)::after { background: var(--info); }

/* ─── TRADING SPECIFIC ─── */
.pnl-positive { color: var(--success); font-weight: 700; }
.pnl-negative { color: var(--danger); font-weight: 700; }
.pnl-value {
    font-family: var(--font-mono);
    font-weight: 700;
    letter-spacing: -0.3px;
}

/* ─── LOGIN & AUTHENTICATION ─── */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #05070a;
    position: relative;
    overflow: hidden;
}
.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 1;
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}
.orb-1 {
    width: 400px; height: 400px;
    background: rgba(99, 102, 241, 0.2);
    top: -100px; left: -100px;
}
.orb-2 {
    width: 300px; height: 300px;
    background: rgba(168, 85, 247, 0.15);
    bottom: -50px; right: -50px;
    animation-delay: -5s;
}
.orb-3 {
    width: 200px; height: 200px;
    background: rgba(59, 130, 246, 0.15);
    bottom: 20%; left: 20%;
    animation-delay: -10s;
}
@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

.login-card {
    background: rgba(21, 27, 43, 0.65);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 48px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.05);
}
.login-logo-container {
    text-align: center;
    margin-bottom: 36px;
}
.login-logo-img {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    margin-bottom: 16px;
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.4);
    background: #0a0e17;
    object-fit: contain;
}
.login-brand {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}
.login-brand span { color: var(--accent); }
.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}
.login-error {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.error-icon { font-size: 1.1rem; }

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
    transition: var(--transition);
}
.form-input.with-icon {
    padding-left: 44px;
    height: 48px;
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.08);
}
.form-input.with-icon:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--accent);
}
.form-input.with-icon:focus + .input-icon, 
.form-input.with-icon:not(:placeholder-shown) + .input-icon {
    color: var(--accent);
}

.login-btn {
    width: 100%;
    height: 48px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    margin-top: 12px;
    border-radius: 12px;
}
.btn-arrow { transition: transform 0.2s; }
.login-btn:hover .btn-arrow { transform: translateX(4px); }

.login-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.login-copyright {
    text-align: center;
    margin-top: 32px;
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.6;
}

/* ─── EMPTY / PLACEHOLDER ─── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 8px; }

/* ─── MOBILE ─── */
.mobile-sidebar-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.mobile-sidebar-btn:hover { background: var(--bg-card); }
.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    margin-left: auto;
    transition: var(--transition);
}
.sidebar-close:hover { background: var(--bg-card); color: var(--text-primary); }
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 199;
    backdrop-filter: blur(4px);
}
.sidebar-overlay.active { display: block; }

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
::selection { background: var(--accent); color: white; }

/* ─── ANIMATIONS ─── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.animate-delay-1 { animation-delay: 0.05s; }
.animate-delay-2 { animation-delay: 0.1s; }
.animate-delay-3 { animation-delay: 0.15s; }
.animate-delay-4 { animation-delay: 0.2s; }

/* ─── RESPONSIVE ─── */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr) !important; }
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 200;
    }
    .admin-sidebar.open { transform: translateX(0); }
    .sidebar-close { display: block; }
    .mobile-sidebar-btn { display: block; }
    .main-content { margin-left: 0; }
    .page-content { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .form-row { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; gap: 12px; align-items: flex-start; }
    .page-header > div:last-child { width: 100%; }
    .page-header .btn { width: 100%; justify-content: center; }
    .header-user-name { display: none; }
    .table-container { margin: 0 -16px; padding: 0 16px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr !important; }
    .admin-header { padding: 0 16px; }
    .page-content { padding: 12px; }
}

/* ─── METRIC BARS ─── */
.metric-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(42,48,66,0.3);
}
.metric-bar:last-child { border-bottom: none; }
.metric-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 110px;
}
.metric-track {
    flex: 1;
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}
.metric-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.metric-value {
    font-size: 0.82rem;
    font-weight: 700;
    min-width: 50px;
    text-align: right;
    font-family: var(--font-mono);
}

/* Gradient fills */
.gradient-green { background: linear-gradient(90deg, #10b981, #34D399); }
.gradient-red { background: linear-gradient(90deg, #ef4444, #F87171); }
.gradient-blue { background: linear-gradient(90deg, #6366f1, #818CF8); }
.gradient-yellow { background: linear-gradient(90deg, #f59e0b, #FBBF24); }
.gradient-purple { background: linear-gradient(90deg, #8B5CF6, #A78BFA); }

/* ─── BADGES ─── */
.badge {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    display: inline-block;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }

/* ─── P&L VALUES ─── */
.pnl-value {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.85rem;
}
.pnl-positive { color: var(--success); font-weight: 700; }
.pnl-negative { color: var(--danger); font-weight: 700; }

/* ─── EMPTY STATES ─── */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state .icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
    opacity: 0.6;
}
.empty-state h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-secondary);
}
.empty-state p {
    font-size: 0.82rem;
    max-width: 300px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ─── HEALTH BARS ─── */
.health-bar-track {
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
}
.health-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── INFO CARDS ─── */
.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

/* ─── SHIMMER LOADING ─── */
.shimmer {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: var(--radius-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ─── ADDED CLASSES ─── */
.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    transition: var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th, .data-table td {
    padding: 12px 16px;
}

.loading-skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: var(--radius-sm);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}
.btn-outline:hover {
    background: var(--accent-soft);
    color: var(--accent-hover);
}

.card-body {
    padding: 1.5rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}
.page-header-content {
    display: flex;
    flex-direction: column;
}
.page-header-actions {
    display: flex;
    gap: 12px;
}

.tab-nav {
    display: flex;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}
.tab-btn {
    background: none;
    border: none;
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}
.tab-btn:hover {
    color: var(--text-primary);
}
.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.tab-panel {
    display: none;
}
.tab-panel.active {
    display: block;
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
}

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