:root {
    --bg-main: #0b0e14;
    --bg-card: rgba(18, 24, 38, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    --primary: #38bdf8;
    --primary-glow: rgba(56, 189, 248, 0.25);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    padding-bottom: 40px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-icon {
    font-size: 28px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(16, 185, 129, 0.2));
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.brand-info h1 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-info h1 .highlight {
    color: var(--primary);
}

.brand-info p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.badge-10x {
    background: #0369a1;
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

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

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: rgba(30, 41, 59, 0.6);
}

.session-badge {
    border-color: rgba(56, 189, 248, 0.4);
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
}

.status-badge.paper {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.status-badge.strategy-dual {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    box-shadow: 0 0 8px currentColor;
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: #0284c7;
    color: #fff;
}
.btn-primary:hover {
    background: #0369a1;
}

.btn-secondary {
    background: rgba(30, 41, 59, 0.8);
    color: var(--text-main);
    border-color: var(--border-color);
}
.btn-secondary:hover {
    background: rgba(51, 65, 85, 0.8);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 24px auto;
    padding: 0 20px;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.metric-title {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 6px;
}

.metric-value {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.metric-value.highlight {
    color: var(--primary);
}

.metric-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Main Layout */
.main-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
}

.left-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.right-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.chart-controls {
    display: flex;
    gap: 6px;
}

.btn-chip {
    background: rgba(30, 41, 59, 0.7);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
}
.btn-chip.active {
    background: var(--primary);
    color: #0b0e14;
    font-weight: 700;
}

.chart-container {
    width: 100%;
    height: 380px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

th {
    text-align: left;
    padding: 10px 12px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.empty-state {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-style: italic;
}

.badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-buy {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-sell {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.pnl-positive {
    color: var(--success);
    font-weight: 700;
}

.pnl-negative {
    color: var(--danger);
    font-weight: 700;
}

.btn-sm-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
}
.btn-sm-danger:hover {
    background: rgba(239, 68, 68, 0.4);
}

/* Tickers List */
.tickers-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ticker-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
}

.ticker-item:hover, .ticker-item.active {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.3);
}

.ticker-symbol {
    font-weight: 700;
    font-size: 0.9rem;
}

.ticker-spread {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.ticker-price {
    font-weight: 800;
    font-size: 0.92rem;
    text-align: right;
}

/* Info card */
.info-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

.cmd-list {
    list-style: none;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cmd-list code {
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

/* ==========================================================================
   Jev AI Decision Stream & Feed
   ========================================================================== */
.jev-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.jev-feed {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 4px;
}

.jev-item {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}

.jev-item:hover {
    border-color: rgba(56, 189, 248, 0.3);
    background: rgba(15, 23, 42, 0.85);
}

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

.jev-item-symbol {
    font-weight: 800;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.jev-item-time {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
}

.status-tag {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-tag.jev-approved {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-tag.jev-rejected {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.status-tag.jev-wait {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.confidence-bar-container {
    margin: 4px 0;
}

.confidence-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.confidence-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #10b981);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.jev-prompt-snippet {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 11.5px;
    color: #cbd5e1;
    font-family: monospace;
    border-left: 3px solid var(--primary);
    line-height: 1.4;
}

/* ==========================================================================
   Admin Login & Security Modal Overlay
   ========================================================================== */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(8, 10, 15, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.login-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: #18202f;
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.08);
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: loginSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginSlideUp {
    from {
        transform: translateY(24px) scale(0.96);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.login-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.login-logo-box {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(16, 185, 129, 0.08));
    border: 1px solid rgba(56, 189, 248, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.login-logo-icon {
    font-size: 26px;
}

.login-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}

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

.login-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fcd34d;
}

.alert-icon {
    font-size: 22px;
}

.attempts-count {
    font-size: 11px;
    font-weight: 600;
    margin-top: 3px;
    color: #fbbf24;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    font-size: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

.form-input {
    width: 100%;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-main);
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s ease;
}

.input-icon-wrapper .form-input {
    padding-left: 38px;
}

.form-input:focus {
    border-color: var(--primary);
}

.captcha-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.captcha-img-container {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #121620;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    flex-shrink: 0;
}

.captcha-img-container img {
    height: 38px;
    width: 120px;
    display: block;
    border-radius: 4px;
    user-select: none;
}

.btn-captcha-refresh {
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    color: var(--text-muted);
    transition: transform 0.2s ease, color 0.2s ease;
}

.btn-captcha-refresh:hover {
    transform: rotate(90deg);
    color: var(--primary);
}

.btn-block {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
}

/* ==========================================================================
   Modals & Panic Button Styles
   ========================================================================== */
.btn-danger {
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(8, 10, 15, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal-backdrop.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    width: 100%;
    max-width: 780px;
    max-height: 90vh;
    overflow-y: auto;
    background: #18202f;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
    padding: 28px 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.chart-modal-content {
    max-width: 900px;
}

@keyframes modalPop {
    from {
        transform: scale(0.96) translateY(16px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

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

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 26px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close-btn:hover {
    color: #fff;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

