/* =========================================================================
   OMEGA TERMINAL — SHARED DESIGN SYSTEM
   Single source of truth for all styling across login, dashboards, admin.
   ========================================================================= */

:root {
    /* ─── Color Palette ─────────────────────────────────────────────────── */
    --bg-deep:        #040812;
    --bg-panel:       #090d16;
    --bg-card:        #0c1222;
    --bg-elevated:    #111a2e;
    --bg-hover:       rgba(255, 255, 255, 0.03);
    --border:         rgba(255, 255, 255, 0.06);
    --border-hover:   rgba(59, 130, 246, 0.4);
    --border-hi:      rgba(255, 255, 255, 0.1);

    --text-primary:   #f9fafb;
    --text-secondary: #94a3b8;
    --text-muted:     #64748b;
    --text-sub:       #475569;

    --neon-green:     #10b981;
    --neon-green-bright: #34d399;
    --neon-red:       #ef4444;
    --neon-red-bright:   #f87171;
    --neon-gold:      #f59e0b;
    --neon-blue:      #3b82f6;
    --neon-purple:    #a855f7;
    --neon-cyan:      #22d3a0;

    /* ─── Typography ───────────────────────────────────────────────────── */
    --font-mono:      'JetBrains Mono', 'Fira Code', monospace;
    --font-ui:        'Outfit', 'Inter', system-ui, sans-serif;

    /* ─── Layout ─────────────────────────────────────────────────────────── */
    --app-bar-h:      54px;
    --nav-h:          64px;
    --safe-top:       env(safe-area-inset-top, 0px);
    --safe-bottom:    env(safe-area-inset-bottom, 0px);
    --radius-sm:      6px;
    --radius-md:      10px;
    --radius-lg:      14px;
    --gap:            10px;

    /* ─── Effects ───────────────────────────────────────────────────────── */
    --transition-fast:  all 0.15s ease;
    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-panel:    0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-glow-green: 0 0 15px rgba(16, 185, 129, 0.2);
    --shadow-glow-red:  0 0 15px rgba(239, 68, 68, 0.2);
}

/* ════════════════════════════════════════════════════════════════════════
   Reset & Base
   ════════════════════════════════════════════════════════════════════════ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    background-color: var(--bg-deep);
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-deep);
    background-image:
        radial-gradient(circle at 50% -10%, #0d1527 0%, transparent 70%),
        radial-gradient(circle at 100% 100%, rgba(59, 130, 246, 0.03) 0%, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 14px;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, canvas, svg {
    max-width: 100%;
    display: block;
}

a {
    color: var(--neon-blue);
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* ════════════════════════════════════════════════════════════════════════
   Scrollbars
   ════════════════════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ════════════════════════════════════════════════════════════════════════
   Utility: Screen-Reader Only
   ════════════════════════════════════════════════════════════════════════ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ════════════════════════════════════════════════════════════════════════
   Top Bar
   ════════════════════════════════════════════════════════════════════════ */
.topbar, .app-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(4, 8, 18, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    border-radius: 8px;
    padding: calc(var(--safe-top) + 8px) 16px 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 60;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.brand-logo {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.brand-logo span {
    color: var(--neon-green);
}

/* ════════════════════════════════════════════════════════════════════════
   Live Badge & Connection Status
   ════════════════════════════════════════════════════════════════════════ */
.live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(75, 85, 99, 0.08);
    border: 1px solid rgba(75, 85, 99, 0.25);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: var(--transition-fast);
}

.live-badge .pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9ca3af;
}

.live-badge.live {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.25);
    color: var(--neon-green);
    box-shadow: var(--shadow-glow-green);
}

.live-badge.live .pulse-dot {
    background: var(--neon-green);
    animation: pulse 1.5s infinite;
}

.live-badge.connecting {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.25);
    color: var(--neon-blue);
}

.live-badge.connecting .pulse-dot {
    background: var(--neon-blue);
    animation: pulse 1.5s infinite;
}

.live-badge.need-otp {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.25);
    color: var(--neon-gold);
}

.live-badge.need-otp .pulse-dot {
    background: var(--neon-gold);
    animation: pulse 1.5s infinite;
}

.live-badge.stale {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.25);
    color: var(--neon-red);
}

.live-badge.stale .pulse-dot {
    background: var(--neon-red);
    animation: pulse 0.5s infinite;
}

/* ─── Stale Data Warning Banner ─────────────────────────────────────────── */
.stale-banner {
    display: none;
    position: fixed;
    top: calc(var(--safe-top) + var(--app-bar-h) + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.5);
    backdrop-filter: blur(12px);
    color: var(--neon-red-bright);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 8px 16px;
    border-radius: 999px;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.2);
    animation: fadeSlideDown 0.3s ease;
}

.stale-banner.visible {
    display: block;
}

/* ════════════════════════════════════════════════════════════════════════
   Selectors
   ════════════════════════════════════════════════════════════════════════ */
.selectors {
    display: flex;
    gap: 8px;
    align-items: center;
}

.selector-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.selector-label, .field-label {
    font-size: 8.5px;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 700;
    padding-left: 2px;
}

.selector-style,
.expiry-selector,
.strike-selector,
.select-input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    cursor: pointer;
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: 700;
    padding: 6px 12px;
    color: var(--text-primary);
    transition: var(--transition-fast);
    min-width: 0;
}

.selector-style {
    color: var(--neon-gold);
    border: 1px solid #1e2d45;
}

.expiry-selector {
    color: var(--neon-cyan);
    border: 1px solid rgba(34, 211, 160, 0.2);
}

.strike-selector {
    color: #a78bfa;
    border: 1px solid rgba(167, 139, 250, 0.2);
}

.select-input {
    padding: 9px 8px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 22px;
}

.selector-style:hover,
.expiry-selector:hover,
.strike-selector:hover,
.select-input:hover {
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.02);
}

.select-input:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* ════════════════════════════════════════════════════════════════════════
   Metric Cards
   ════════════════════════════════════════════════════════════════════════ */
.metrics {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: var(--gap);
}

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.mcard, .metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.mcard:hover, .metric-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.02);
}

.mcard::before, .metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-blue), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mcard:hover::before, .metric-card:hover::before {
    opacity: 0.4;
}

.mlabel {
    font-size: 9.5px;
    color: var(--text-secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 4px;
    font-weight: 700;
}

.metric-lbl {
    font-size: 9.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 700;
}

.mval, .metric-val {
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-mono);
    line-height: 1.2;
    transition: color 0.15s ease;
}

.metric-val {
    font-size: 19px;
}

.mval.up { color: var(--neon-green); }
.mval.dn { color: var(--neon-red); }
.mval.amb { color: var(--neon-gold); }
.mval.blue { color: #60a5fa; }
.mval.violet { color: #c4b5fd; }
.mval.orange { color: #fb923c; }

.msub, .metric-sub {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Value flash animation */
@keyframes flash-up {
    0% { background: rgba(16, 185, 129, 0.15); }
    100% { background: transparent; }
}

@keyframes flash-down {
    0% { background: rgba(239, 68, 68, 0.15); }
    100% { background: transparent; }
}

.mcard.flash-up, .metric-card.flash-up {
    animation: flash-up 0.8s ease;
}

.mcard.flash-down, .metric-card.flash-down {
    animation: flash-down 0.8s ease;
}

/* Distinct visual separator for analytics row */
.mcard:nth-child(7), .metric-card:nth-child(7) {
    border-top: 2px solid var(--border);
}

/* ════════════════════════════════════════════════════════════════════════
   Panels & Cards
   ════════════════════════════════════════════════════════════════════════ */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-panel);
    transition: border-color 0.3s ease;
}

.panel:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.panel-title {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    padding-bottom: 9px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.panel-title::after {
    content: "";
    flex: 1;
    height: 0.5px;
    background: var(--border);
}

/* ════════════════════════════════════════════════════════════════════════
   Key Levels
   ════════════════════════════════════════════════════════════════════════ */
.levels, .levels-stack {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 12px;
}

.level-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-family: var(--font-mono);
    transition: var(--transition-fast);
}

.level-row.lvl-resist-major {
    background: #1a0808;
    border-color: rgba(248, 113, 113, 0.25);
    color: #fca5a5;
}

.level-row.lvl-resist {
    background: #140d0d;
    border-color: rgba(248, 113, 113, 0.15);
    color: #fca5a5;
}

.level-row.lvl-current {
    background: #0d1a12;
    border-color: rgba(34, 211, 160, 0.3);
    color: var(--neon-green);
}

.level-row.lvl-flip {
    background: #1a1400;
    border-color: rgba(251, 191, 36, 0.3);
    color: var(--neon-gold);
}

.level-row.lvl-support {
    background: #0d1020;
    border-color: rgba(96, 165, 250, 0.2);
    color: #93c5fd;
}

.level-row.lvl-support-major {
    background: #0a0e1e;
    border-color: rgba(96, 165, 250, 0.3);
    color: #93c5fd;
}

.lvl-lbl {
    font-size: 10.5px;
    font-weight: 700;
    font-family: var(--font-ui);
    opacity: 0.95;
}

.lvl-text {
    font-size: 10px;
    font-weight: 600;
}

.lvl-label {
    font-size: 8.5px;
    opacity: 0.7;
}

.lvl-strike {
    font-size: 13px;
    font-weight: 700;
}

.lvl-gex {
    font-size: 9.5px;
    opacity: 0.85;
}

/* ════════════════════════════════════════════════════════════════════════
   PCR Panel
   ════════════════════════════════════════════════════════════════════════ */
.pcr-section {
    border-top: 1px solid var(--border);
    padding-top: 10px;
}

.pcr-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 6px 0;
}

.pcr-num, .pcr-big-num {
    font-size: 26px;
    font-weight: 700;
    font-family: var(--font-mono);
    line-height: 1;
}

.pcr-big {
    text-align: center;
    flex-shrink: 0;
}

.pcr-label-text {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-top: 4px;
}

.pcr-meter { flex: 1; }

.pcr-pcts {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.pcr-bar-outer {
    flex: 1;
    height: 10px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
    display: flex;
}

.pcr-ce-fill {
    background: var(--neon-blue);
    height: 100%;
    border-radius: 5px 0 0 5px;
    transition: width 0.4s ease;
}

.pcr-pe-fill {
    background: var(--neon-red);
    height: 100%;
    border-radius: 0 5px 5px 0;
    transition: width 0.4s ease;
}

.pcr-oi-row {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    margin-top: 3px;
}

/* ════════════════════════════════════════════════════════════════════════
   Footprint Bars
   ════════════════════════════════════════════════════════════════════════ */
.footprint-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px;
    margin-bottom: var(--gap);
}

.fp-container, .fp-container-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.fp-bar-col, .fp-col {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    flex: 1;
    min-width: 210px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.fp-bar-header, .fp-col-header {
    background: var(--bg-elevated);
    padding: 6px;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono);
}

.fp-row-item, .fp-item-row {
    display: grid;
    grid-template-columns: 18% 22% 20% 22% 18%;
    text-align: right;
    padding: 3px 4px;
    font-size: 9.5px;
    font-family: var(--font-mono);
    align-items: center;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    transition: background 0.15s ease;
}

.fp-row-item:hover, .fp-item-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.fp-poc-row, .fp-item-row.poc {
    background: rgba(245, 158, 11, 0.1) !important;
    border-left: 2px solid var(--neon-gold);
    border-right: 2px solid var(--neon-gold);
    border-radius: 2px;
}

.fp-item-row.va {
    background: rgba(255, 255, 255, 0.03);
}

.fp-item-row.stacked {
    border-left: 2px solid var(--neon-red);
    border-right: 2px solid var(--neon-red);
}

.fp-limit-bid {
    text-align: left;
    color: var(--neon-blue);
    opacity: 0.75;
    font-size: 8.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fp-limit-ask {
    text-align: right;
    color: var(--neon-red);
    opacity: 0.75;
    font-size: 8.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fp-cell-bid {
    text-align: center;
    color: #93c5fd;
    font-weight: 600;
}

.fp-cell-bid.imb {
    color: #fff;
    font-weight: 700;
    background: rgba(59, 130, 246, 0.3);
    border-radius: 2px;
    text-shadow: 0 0 5px var(--neon-blue);
}

.fp-cell-price {
    text-align: center;
    color: var(--neon-gold);
    font-weight: 700;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
}

.fp-cell-ask {
    text-align: center;
    color: #fca5a5;
    font-weight: 600;
}

.fp-cell-ask.imb {
    color: #fff;
    font-weight: 700;
    background: rgba(239, 68, 68, 0.3);
    border-radius: 2px;
    text-shadow: 0 0 5px var(--neon-red);
}

.fp-col-footer {
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid var(--border);
    font-size: 9px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.fp-col-footer span {
    display: flex;
    justify-content: space-between;
}

/* ════════════════════════════════════════════════════════════════════════
   Charts
   ════════════════════════════════════════════════════════════════════════ */
.chart-wrap {
    position: relative;
    width: 100%;
    height: 240px;
}

.gex-canvas-wrap {
    position: relative;
    width: 100%;
    height: 400px;
}

.cvd-canvas-wrap {
    position: relative;
    width: 100%;
    height: 180px;
}

#gexCanvas,
#cvdCanvas {
    width: 100%;
    height: 100%;
    transition: opacity 0.3s ease;
}

/* ════════════════════════════════════════════════════════════════════════
   Signal Radar
   ════════════════════════════════════════════════════════════════════════ */
.radar-badge {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    font-weight: 800;
    text-align: center;
    font-size: 13px;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.radar-badge.buy-call {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--neon-green);
    color: var(--neon-green);
    box-shadow: var(--shadow-glow-green);
}

.radar-badge.buy-put {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--neon-red);
    color: var(--neon-red);
    box-shadow: var(--shadow-glow-red);
}

.radar-badge.wait {
    background: var(--bg-card);
    border-color: var(--border);
    color: var(--text-secondary);
}

.radar-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.radar-grid-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
}

.radar-item-lbl {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.radar-item-val {
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.radar-reason-box {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    text-align: center;
}

/* Score bars */
.score-bar-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.score-bar-fill.call {
    background: linear-gradient(90deg, var(--neon-green), var(--neon-green-bright));
}

.score-bar-fill.put {
    background: linear-gradient(90deg, var(--neon-red), var(--neon-red-bright));
}

/* ════════════════════════════════════════════════════════════════════════
   Options Chain Table
   ════════════════════════════════════════════════════════════════════════ */
.chain-table-wrap {
    overflow: auto;
    position: relative;
    border-radius: var(--radius-md);
    -webkit-overflow-scrolling: touch;
    max-height: calc(100dvh - var(--app-bar-h) - var(--nav-h) - 240px);
}

.chain-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 10px;
    text-align: right;
}

.chain-table th {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 9px;
    font-weight: 700;
    padding: 8px 7px;
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}

.chain-table td {
    padding: 7px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    white-space: nowrap;
}

.chain-table tbody tr {
    transition: background 0.15s ease;
}

.chain-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.itm-call {
    background: rgba(96, 165, 250, 0.04);
}

.itm-put {
    background: rgba(248, 113, 113, 0.04);
}

.strike-cell, th.strike-th {
    background: #090c16;
    color: var(--neon-gold);
    font-weight: 700;
    text-align: center;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    position: sticky;
    left: 0;
    z-index: 5;
    font-size: 11px;
}

.ltp-cell {
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.ltp-cell:active {
    background: rgba(255, 255, 255, 0.08) !important;
}

.chain-hint {
    font-size: 9.5px;
    color: var(--text-muted);
    font-weight: 600;
    font-family: var(--font-mono);
}

/* ════════════════════════════════════════════════════════════════════════
   Trade Modal
   ════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-top: 2px solid var(--neon-blue);
    border-radius: 18px 18px 0 0;
    width: 100%;
    max-width: 480px;
    padding: 18px 18px calc(18px + var(--safe-bottom));
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: slideUp 0.28s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: none; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.modal-title {
    font-size: 14px;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.15s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.trade-direction {
    display: flex;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 3px;
}

.dir-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 13px;
    padding: 11px 0;
    border-radius: 7px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.dir-btn.active.buy {
    background: var(--neon-green);
    color: #04130d;
    box-shadow: var(--shadow-glow-green);
}

.dir-btn.active.sell {
    background: var(--neon-red);
    color: #160404;
    box-shadow: var(--shadow-glow-red);
}

.trade-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.trade-field label {
    font-size: 9.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
}

.trade-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 15px;
    padding: 12px;
    outline: none;
    transition: border-color 0.15s ease;
}

.trade-input:focus {
    border-color: var(--neon-blue);
}

.margin-estimate {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    padding: 12px;
}

.margin-val {
    font-weight: 700;
    color: var(--neon-green);
    font-family: var(--font-mono);
    font-size: 14px;
}

.submit-trade-btn {
    background: var(--neon-blue);
    color: #04101f;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-lg);
    padding: 14px 0;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
    transition: var(--transition-fast);
}

.submit-trade-btn:hover {
    filter: brightness(1.2);
}

.submit-trade-btn:active {
    filter: brightness(0.9);
}

/* ════════════════════════════════════════════════════════════════════════
   Bottom Navigation
   ════════════════════════════════════════════════════════════════════════ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 60;
    display: flex;
    background: rgba(17, 24, 39, 0.96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding-bottom: var(--safe-bottom);
    height: calc(var(--nav-h) + var(--safe-bottom));
    transition: all 0.3s ease;
}

.bottom-nav.compact {
    height: calc(var(--nav-h) * 0.66 + var(--safe-bottom));
}

.bottom-nav.collapsed {
    transform: translateY(100%);
}

.nav-item {
    flex: 1;
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
    padding-top: 8px;
    transition: var(--transition-fast);
}

.nav-item:hover {
    color: var(--text-secondary);
}

.nav-item.active {
    color: var(--neon-green);
}

.nav-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--neon-green);
    opacity: 0;
    margin-top: -2px;
}

.nav-item.active .nav-dot {
    opacity: 1;
}

/* ════════════════════════════════════════════════════════════════════════
   Toggle Switch & Settings
   ════════════════════════════════════════════════════════════════════════ */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--text-muted);
    transition: 0.3s;
    border-radius: 999px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--neon-green);
}

input:checked + .slider:before {
    transform: translateX(18px);
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
}

.setting-row .label-title {
    font-size: 12px;
    font-weight: 700;
}

.setting-row .label-sub {
    font-size: 10px;
    color: var(--text-muted);
}

.ip-input {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--neon-blue);
    font-family: var(--font-mono);
    font-size: 13px;
    outline: none;
    padding: 9px 10px;
}

/* ════════════════════════════════════════════════════════════════════════
   DTE Panel & Collapsible
   ════════════════════════════════════════════════════════════════════════ */
.dte-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-top: 10px;
    overflow: hidden;
}

.dte-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.dte-panel-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.dte-panel-body {
    padding: 0 16px 16px;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
}

.dte-panel-body.collapsed {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.dte-toggle-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 9px;
    font-weight: 700;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: var(--transition-fast);
}

.dte-toggle-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.dte-tag {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 1px;
}

.dte-tag-0 {
    background: #2e0505;
    color: var(--neon-red-bright);
    border: 0.5px solid rgba(248, 113, 113, 0.25);
}

.dte-tag-n {
    background: var(--bg-card);
    color: var(--text-muted);
    border: 0.5px solid var(--border);
}

/* ════════════════════════════════════════════════════════════════════════
   Signal Detail Blocks
   ════════════════════════════════════════════════════════════════════════ */
.sig-grid-full {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.sig-metric-full {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    min-width: 0;
}

.sig-lbl-full {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.sig-val-full {
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font-mono);
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ════════════════════════════════════════════════════════════════════════
   Loading Skeleton
   ════════════════════════════════════════════════════════════════════════ */
.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    min-height: 30px;
}

.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% { transform: translateX(100%); }
}

/* Full-screen loading overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-deep);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transition: opacity 0.4s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: var(--neon-green);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 2px;
    font-weight: 600;
    text-transform: uppercase;
}

/* ════════════════════════════════════════════════════════════════════════
   Animations
   ════════════════════════════════════════════════════════════════════════ */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.3; }
}

@keyframes fadeSlideDown {
    from { opacity: 0; transform: translate(-50%, -8px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(16, 185, 129, 0.2); }
    50%      { box-shadow: 0 0 20px rgba(16, 185, 129, 0.4); }
}

/* ════════════════════════════════════════════════════════════════════════
   Responsive
   ════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1200px) {
    .metrics {
        grid-template-columns: repeat(4, 1fr);
    }

    .fp-react-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 900px) {
    .metrics {
        grid-template-columns: repeat(3, 1fr);
    }

    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }

    .gex-row {
        grid-template-columns: 1fr !important;
    }

    .dex-row {
        grid-template-columns: 1fr !important;
    }

    .sig-grid-full {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .selectors {
        flex-wrap: wrap;
    }

    .selector-group {
        flex: 1;
        min-width: 90px;
    }

    .selector-style,
    .expiry-selector,
    .strike-selector,
    .select-input {
        width: 100%;
    }

    .premium {
        font-size: 18px !important;
    }

    .radar-grid {
        grid-template-columns: 1fr;
    }

    .sig-grid-full {
        grid-template-columns: 1fr 1fr;
    }
}