:root {
    --bg-color: #06080d;
    --bg-elevated: #0d121c;
    --glass-bg: rgba(16, 23, 38, 0.72);
    --glass-hover: rgba(24, 34, 54, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-strong: rgba(0, 210, 255, 0.28);
    --text-main: #f3f6fc;
    --text-secondary: #b0bdd0;
    --text-muted: #6c7a91;
    --accent: #00d2ff;
    --accent-soft: rgba(0, 210, 255, 0.14);
    --accent-glow: rgba(0, 210, 255, 0.32);
    --bullish: #00e676;
    --bullish-soft: rgba(0, 230, 118, 0.14);
    --bearish: #ff2e55;
    --bearish-soft: rgba(255, 46, 85, 0.15);
    --warning: #ffb300;
    --warning-soft: rgba(255, 179, 0, 0.15);
    --gold: #ffd54f;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

.glow-bg {
    position: fixed;
    top: -40%;
    left: -40%;
    width: 180%;
    height: 180%;
    background:
        radial-gradient(circle at 25% 25%, rgba(0, 210, 255, 0.07) 0%, transparent 45%),
        radial-gradient(circle at 75% 70%, rgba(0, 230, 118, 0.05) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, #0d1526 0%, #06080d 65%);
    z-index: -1;
}

.container {
    max-width: 1460px;
    margin: 0 auto;
    padding: 1.5rem 2rem 4rem;
}

/* HEADER & ACTION BAR */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--glass-border);
    flex-wrap: wrap;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bullish);
    box-shadow: 0 0 12px var(--bullish);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.9); }
}

.logo-block h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.15rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(90deg, #ffffff 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-block h1 span {
    font-weight: 400;
}

.version-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--glass-border-strong);
    letter-spacing: 0.5px;
}

.logo-block p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.header-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.6rem;
}

.kite-action-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.connected {
    background: var(--bullish);
    box-shadow: 0 0 8px var(--bullish);
}

.status-dot.disconnected {
    background: var(--bearish);
    box-shadow: 0 0 8px var(--bearish);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.52rem 0.95rem;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #00b4db 0%, #0083b0 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 180, 219, 0.25);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 210, 255, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border-color: var(--glass-border);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-warning {
    background: #ff5722;
    color: #fff;
}

.btn-warning:hover:not(:disabled) {
    background: #f4511e;
    transform: translateY(-1px);
}

.btn-execute {
    background: linear-gradient(135deg, #00e676 0%, #00b248 100%);
    color: #041208;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0, 230, 118, 0.28);
}

.btn-execute:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 230, 118, 0.45);
}

.telemetry-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-link:hover {
    text-decoration: underline;
}

/* LIVE PROGRESS BANNER */
.progress-banner {
    background: linear-gradient(90deg, rgba(0, 210, 255, 0.12), rgba(0, 230, 118, 0.08));
    border: 1px solid var(--glass-border-strong);
    border-radius: 12px;
    padding: 0.9rem 1.25rem;
    margin-bottom: 1.5rem;
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.55rem;
    font-size: 0.88rem;
}

.progress-info span {
    color: var(--text-secondary);
    margin-left: 0.5rem;
    font-size: 0.82rem;
}

.progress-count {
    margin-left: auto !important;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--accent) !important;
}

.progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--bullish));
    border-radius: 99px;
    transition: width 0.4s ease;
}

/* TELEMETRY KPI STRIP */
.telemetry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.18);
}

.kpi-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.kpi-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.kpi-unit {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
}

.kpi-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
}

.breadth-bar {
    width: 100%;
    height: 6px;
    background: var(--bearish);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.breadth-bull {
    height: 100%;
    background: var(--bullish);
    transition: width 0.4s ease;
}

/* NAVIGATION TABS & FILTER TOOLBAR */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.control-bar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nav-tabs {
    display: flex;
    gap: 0.6rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.85rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.6rem 1.1rem;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.tab-btn.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.18);
}

.tab-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.73rem;
    padding: 0.1rem 0.45rem;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.filter-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 240px;
}

.search-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    opacity: 0.6;
}

.search-box input {
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.55rem 0.85rem 0.55rem 2.2rem;
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--accent);
}

.filter-pills {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.filter-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
}

.filter-pill:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
}

.filter-pill.active {
    background: var(--accent);
    color: #030914;
    border-color: var(--accent);
}

.filter-pill.bull.active {
    background: var(--bullish);
    border-color: var(--bullish);
    color: #031208;
}

.filter-pill.bear.active,
.filter-pill.sell.active {
    background: var(--bearish);
    border-color: var(--bearish);
    color: #fff;
}

.sort-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sort-select {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
}

.layout-toggle {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    overflow: hidden;
}

.layout-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.48rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.layout-btn.active {
    background: var(--accent-soft);
    color: var(--accent);
}

/* SECTION HEADERS */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 1.15rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.section-desc {
    font-size: 0.84rem;
    color: var(--text-muted);
}

/* PICK CARDS */
.picks-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.15rem;
}

.pick-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 290px 1fr;
    gap: 1.75rem;
    transition: all 0.25s ease;
    position: relative;
}

.pick-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: var(--glass-hover);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

.pick-card.sell-alert-card {
    border-color: rgba(255, 46, 85, 0.55);
    box-shadow: 0 0 22px rgba(255, 46, 85, 0.14);
}

.pick-header {
    border-right: 1px solid var(--glass-border);
    padding-right: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ticker-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.rank-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    background: rgba(255, 213, 79, 0.15);
    color: var(--gold);
    border: 1px solid rgba(255, 213, 79, 0.35);
}

.ticker {
    font-size: 1.65rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: #fff;
    letter-spacing: -0.3px;
}

.direction-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.direction-badge.bull {
    background: var(--bullish-soft);
    color: var(--bullish);
    border: 1px solid rgba(0, 230, 118, 0.35);
}

.direction-badge.bear {
    background: var(--bearish-soft);
    color: var(--bearish);
    border: 1px solid rgba(255, 46, 85, 0.35);
}

.price-info {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.86rem;
}

.price-label {
    color: var(--text-muted);
}

.price-val {
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.price-val.up { color: var(--bullish); }
.price-val.down { color: var(--bearish); }

/* CONVICTION METERS */
.factor-bars {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.factor-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.factor-val {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

.conviction-bar-track {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    overflow: hidden;
    margin-top: 0.15rem;
}

.conviction-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--bullish));
    border-radius: 99px;
}

/* PICK BODY */
.pick-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: space-between;
}

.rationale-box {
    background: rgba(0, 0, 0, 0.28);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #dbe4f3;
    border-left: 3px solid var(--accent);
}

.holding-alert-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
}

.holding-alert-banner.sell {
    background: var(--bearish-soft);
    border: 1px solid rgba(255, 46, 85, 0.45);
    color: #ff8a9f;
}

.holding-alert-banner.hold {
    background: var(--bullish-soft);
    border: 1px solid rgba(0, 230, 118, 0.4);
    color: #9cffc7;
}

/* OPTIONS LADDER */
.options-ladder {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
    gap: 0.65rem;
}

.option-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.7rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    transition: all 0.18s ease;
}

.option-card:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-2px);
}

.option-card.primary-exec {
    background: rgba(0, 210, 255, 0.08);
    border-color: var(--accent);
    box-shadow: 0 0 14px rgba(0, 210, 255, 0.12);
}

.option-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}

.option-strike-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.option-strike-tag.ce { color: var(--bullish); }
.option-strike-tag.pe { color: var(--bearish); }

.exec-pill {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.12rem 0.42rem;
    border-radius: 4px;
    background: var(--accent);
    color: #020810;
    text-transform: uppercase;
}

.option-rationale-text {
    font-size: 0.76rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

/* QUANT SCREENER TABLE */
.screener-table-wrap {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    overflow-x: auto;
}

.screener-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.screener-table th,
.screener-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
}

.screener-table th {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.35);
    font-weight: 600;
}

.screener-table tr:hover td {
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

/* MODAL */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 6, 12, 0.82);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
}

.modal-card {
    background: #0e1420;
    border: 1px solid var(--glass-border-strong);
    border-radius: 16px;
    max-width: 780px;
    width: 100%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.75);
}

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

.modal-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
}

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

.modal-body {
    padding: 1.4rem 1.5rem;
    overflow-y: auto;
    font-size: 0.9rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.console-box {
    background: #05070b;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.9rem 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: #b8c7e0;
    white-space: pre-wrap;
    max-height: 240px;
    overflow-y: auto;
    margin-top: 1rem;
}

/* TOASTS */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    z-index: 1200;
}

.toast {
    background: #111927;
    border: 1px solid var(--glass-border-strong);
    color: #fff;
    padding: 0.8rem 1.15rem;
    border-radius: 10px;
    font-size: 0.84rem;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
    animation: slide-up 0.25s ease;
}

@keyframes slide-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.loading-state {
    text-align: center;
    padding: 3.5rem 2rem;
    color: var(--text-muted);
}

.spinner, .spinner-sm {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

.spinner-sm {
    width: 18px;
    height: 18px;
    border-width: 2px;
    margin: 0;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

@media (max-width: 900px) {
    .pick-card {
        grid-template-columns: 1fr;
    }
    .pick-header {
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        padding-right: 0;
        padding-bottom: 1rem;
    }
}
