*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    /* ThinkScript Colors */
    --ts-green: #00FF00;
    --ts-red: #FF0000;
    --ts-orange: #FFA500;
    --ts-blue: #00E5FF;
    --ts-cyan: #00FFFF;

    /* Theme Colors */
    --bg-dark: #0a0e17;
    /* Very deep blue/black */
    --bg-panel: #111823;
    --bg-panel-hover: #1a2332;
    --text-primary: #e0e6ed;
    --text-secondary: #ffffff;
    --border-custom: #333344;
    --border-color: #1f2937;

    /* Layout */
    --max-width: 3840px;
}

/* Global Overrides to Eradicate Grey Text */
.text-secondary,
.text-muted,
.text-white-50 {
    color: #ffffff !important;
}

.border-secondary {
    border-color: var(--border-custom) !important;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Consolas', 'Courier New', monospace;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
}

.dashboard-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    margin-top: 0;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.text-ts-cyan {
    color: var(--ts-cyan);
}

.text-ts-green {
    color: var(--ts-green);
}

.text-ts-red {
    color: var(--ts-red);
}

.text-ts-orange {
    color: var(--ts-orange);
}

/* Panels */
.panel {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.glass-panel {
    background: rgba(17, 24, 35, 0.95) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8) !important;
}

/* Tables (High-density terminal style) */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

th,
td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    color: var(--text-secondary);
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--border-color);
}

tbody tr:hover {
    background-color: var(--bg-panel-hover);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 2px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    background-color: var(--bg-panel);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn:hover {
    background-color: var(--bg-panel-hover);
    border-color: var(--ts-cyan);
}

.btn-primary {
    background-color: transparent;
    color: var(--ts-blue);
    border-color: var(--ts-blue);
}

.btn-primary:hover {
    background-color: rgba(0, 229, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
    border-color: var(--ts-blue);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-outline-cyan {
    background-color: transparent !important;
    color: var(--ts-cyan) !important;
    border: 1px solid var(--ts-cyan) !important;
}

.btn-outline-cyan:hover {
    background-color: rgba(0, 255, 255, 0.1) !important;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3) !important;
}

/* Utilities */
.flex-row {
    display: flex;
    flex-direction: row;
}

.flex-col {
    display: flex;
    flex-direction: column;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

.mt-2 {
    margin-top: 10px;
}

.mt-4 {
    margin-top: 20px;
}

.mb-2 {
    margin-bottom: 10px;
}

.mb-4 {
    margin-bottom: 20px;
}

.gap-2 {
    gap: 10px;
}

.gap-4 {
    gap: 20px;
}

.w-full {
    width: 100%;
}

/* Blazor Error UI */
#blazor-error-ui {
    background: var(--ts-red);
    color: white;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ── Accordion ─────────────────────────────────── */
.accordion-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color, #2a2a3a);
    color: var(--text-primary, #eee);
    cursor: pointer;
    transition: background 0.15s;
    text-align: left;
    gap: 12px;
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.accordion-header.open {
    background: rgba(255, 255, 255, 0.03);
}

.accordion-body {
    padding: 0 20px 16px 20px;
    animation: accordionFadeIn 0.18s ease;
}

@keyframes accordionFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.accordion-chevron {
    transition: transform 0.15s;
    font-size: 0.9rem;
}

/* ── Admin toggle switch ────────────────────────── */
.excluded-row td {
    opacity: 0.45;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
    margin: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--ts-red, #e55);
    border-radius: 24px;
    transition: background 0.25s;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.25s;
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--ts-green, #2eb86b);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(20px);
}

/* ── Utilities ─────────────────────────────────── */
.hide-scrollbar {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.bg-ts-cyan {
    background-color: var(--ts-cyan) !important;
}

/* ── Premium Draggable Slider ────────────────────── */
.ts-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: #333;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
    margin: 10px 0;
}

.ts-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #0078d4;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 120, 212, 0.5);
    transition: all 0.2s ease-in-out;
}

.ts-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(0, 120, 212, 0.8);
    background: #0089f2;
}

.ts-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #0078d4;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 120, 212, 0.5);
    transition: all 0.2s ease-in-out;
}

.ts-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(0, 120, 212, 0.8);
    background: #0089f2;
}

/* Grid Row Highlighting (Gamma Dashboard & Option Chain) */
.atm-row {
    background: rgba(0, 255, 255, 0.10);
    z-index: 5;
}

.callwall-row {
    background: rgba(0, 255, 0, 0.10);
    border-top: 1px solid var(--ts-green);
    border-bottom: 1px solid var(--ts-green);
    z-index: 4;
}

.putwall-row {
    background: rgba(255, 0, 0, 0.10);
    border-top: 1px solid var(--ts-red);
    border-bottom: 1px solid var(--ts-red);
    z-index: 4;
}

.gex1-row {
    background: rgba(0, 255, 255, 0.05);
    border-left: 2px solid var(--ts-cyan) !important;
    z-index: 3;
}

.gex2-row {
    background: rgba(255, 165, 0, 0.05);
    border-left: 2px solid var(--ts-orange) !important;
    z-index: 3;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ── Option Chain Page Toolbar ──────────────────────── */
.oc-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.oc-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

/* ── GammaDashboard ChartControls in header ───────── */
.chart-controls-bar {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
}

/* ── Mobile: shrink GEX button text ────────────────── */
@media (max-width: 479px) {
    .gex-btn-text {
        display: none;
    }
}