:root {
    --bg-deep: #05070a;
    --card-bg: rgba(13, 17, 23, 0.75);
    --card-border: rgba(255, 255, 255, 0.05);
    --text-primary: #f0f4f8;
    --text-dim: #94a3b8;
    --buy-color: #10b981;
    /* Emerald 500 */
    --sell-color: #ef4444;
    /* Red 500 */
    --accent-blue: #3b82f6;
    /* Blue 500 */
    --neon-glow: 0 4px 20px rgba(59, 130, 246, 0.2);
    --header-h: 64px;
    --footer-h: 40px;
    --glass-blur: blur(24px);
    --font-main: 'Inter', 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
}

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

body {
    background-color: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-main);
    letter-spacing: -0.01em;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Modern Custom Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 12, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-deep);
    border: 1px solid var(--card-border);
    width: 90%;
    max-width: 450px;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 210, 255, 0.1);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-header {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 15px;
}

.modal-header h3 {
    color: var(--accent-blue);
    font-size: 18px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.modal-body {
    margin-bottom: 30px;
    color: var(--text-dim);
    font-size: 14px;
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.modal-footer button {
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 12px;
}

.modal-btn-confirm {
    background: var(--sell-color);
    border: none;
    color: white;
}

.modal-btn-confirm:hover {
    background: #ff1a53;
    box-shadow: 0 0 15px rgba(255, 51, 102, 0.3);
}

.modal-btn-cancel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-dim);
}

.modal-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Trading Background Effect - Simple & Premium */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: #020406;
    overflow: hidden;
}

.background-overlay::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150vw;
    height: 150vh;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.07) 0%, transparent 60%);
    transform: translate(-50%, -50%);
    animation: move-glow 15s ease-in-out infinite alternate;
}

@keyframes move-glow {
    0% {
        transform: translate(-45%, -45%) scale(1);
        opacity: 0.3;
    }

    100% {
        transform: translate(-55%, -55%) scale(1.2);
        opacity: 0.6;
    }
}

/* Light Theme Overrides */
body.light-theme {
    background-color: #f8fafc;
    color: #1e293b;
}

body.light-theme .background-overlay {
    background: #ffffff;
}

body.light-theme .background-overlay::after {
    background: radial-gradient(circle, rgba(0, 145, 234, 0.05) 0%, transparent 70%);
}

body.light-theme .auth-card {
    background: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme h1,
body.light-theme h2 {
    color: #0f172a !important;
}

body.light-theme .auth-card input {
    background: rgba(0, 0, 0, 0.03) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    color: #1e293b !important;
}

/* Floating Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(10, 14, 18, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-blue);
}

body.light-theme .theme-toggle {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.1);
    color: #1e293b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Top Bar */
.top-bar {
    height: var(--header-h);
    background: rgba(5, 7, 10, 0.8);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    justify-content: space-between;
    position: relative;
    z-index: 100;
}

.nav-group,
.account-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    color: var(--text-dim);
    padding: 8px 18px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-btn.active {
    background: var(--accent-blue);
    color: #fff;
    border-color: var(--accent-blue);
    box-shadow: var(--neon-glow);
}

.mission-control-wrapper {
    padding: 4px 12px;
    border-radius: 50px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.4);
}

.mission-control-wrapper.running {
    background: rgba(0, 255, 204, 0.15);
    border-color: rgba(0, 255, 204, 0.4);
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.15), inset 0 0 10px rgba(0, 0, 0, 0.4);
}

.mission-control-wrapper.stopped {
    background: rgba(255, 51, 102, 0.1);
    border-color: rgba(255, 51, 102, 0.3);
}

.stats-group {
    display: flex;
    gap: 12px;
}

.stat-box {
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 20px;
    border-radius: 40px;
    font-size: 13px;
    color: var(--text-dim);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-weight: 700;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-box span {
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.account-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

.account-info-header {
    display: flex;
    align-items: center;
}

.account-dropdown-container {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background: rgba(10, 14, 18, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    min-width: 160px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    z-index: 1000;
    margin-top: 8px;
    overflow: hidden;
}

.dropdown-content.show {
    display: block;
}

.dropdown-content a {
    color: var(--text-primary);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

.dropdown-content a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-blue);
}

.stat-box.loss {
    background: var(--sell-color);
    color: #fff;
    border-color: var(--sell-color);
}

.stat-box.loss span {
    color: #fff;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.icon-btn svg {
    width: 32px;
    height: 32px;
    fill: var(--text-dim);
}

/* Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    grid-template-rows: 1fr;
    gap: 16px;
    padding: 16px 16px 60px 16px;
    /* Added 60px bottom padding */
    height: calc(100vh - var(--header-h));
    width: 100%;
    margin: 0;
    overflow: hidden;
}

.document-page {
    display: block !important;
    height: auto !important;
    min-height: calc(100vh - var(--header-h) - var(--footer-h)) !important;
    overflow-y: auto !important;
    padding-bottom: 100px !important;
}

/* General Card */
.card {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(13, 17, 23, 0.9) 100%);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 12px 48px 0 rgba(0, 0, 0, 0.5);
}

/* Left Section */
.main-workspace {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
    min-height: 0;
}

.main-workspace::-webkit-scrollbar {
    width: 4px;
}

.main-workspace::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 4px;
}

.main-workspace>.card {
    border-radius: 0;
    margin-bottom: -1px;
}

.main-workspace>.card:first-child {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.main-workspace>.card:last-child {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    margin-bottom: 0;
}

.header-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 6px 15px;
}

.symbol-summary-centered {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    justify-content: center;
}

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

.symbol-row .pair {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.symbol-row .price {
    font-size: 18px;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.signals-panel-combined {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    background: linear-gradient(180deg, rgba(13, 17, 23, 0.8) 0%, rgba(13, 17, 23, 0.4) 100%);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.horizontal-overlay {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 32px !important;
    padding: 10px 32px !important;
    z-index: 100;
    background: rgba(8, 10, 14, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: var(--border-radius-lg) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    min-width: 440px;
    justify-content: center;
    transition: all 0.3s ease;
}

.chart-price-overlay {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 101;
    background: rgba(13, 17, 23, 0.6);
    backdrop-filter: blur(8px);
    padding: 8px 16px;
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.chart-price-overlay .label {
    font-size: 10px;
    font-weight: 900;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.chart-price-overlay .price-val {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 800;
    color: var(--buy-color);
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.3);
}

.chart-latency-overlay {
    position: absolute;
    bottom: 5px;
    right: 5px;
    z-index: 100;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    color: var(--accent-blue);
    opacity: 0.6;
    text-transform: uppercase;
    pointer-events: none;
    text-align: right;
}

.horizontal-overlay .signal-segment {
    border: none !important;
    padding: 0 !important;
}

.signal-segment {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.signal-segment:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 6px;
}

.signal-segment .label {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}

.tf-picker {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 800;
    font-family: var(--font-mono);
    cursor: pointer;
    outline: none;
}

.floating-candle-limit {
    position: absolute;
    top: 15px;
    right: 90px;
    z-index: 100;
    background: rgba(10, 14, 18, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    padding: 6px 14px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.floating-candle-limit span {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-dim);
    text-transform: uppercase;
}

.floating-candle-limit input {
    width: 50px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 800;
    outline: none;
    text-align: center;
}

.signal-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.signal-row .label,
.label-select {
    width: 60px;
}

.label-select select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-dim);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.label-select select:hover {
    background: rgba(255, 255, 255, 0.1);
}

.label-select select option {
    background: var(--bg-deep);
    color: var(--text-primary);
}

.candle-control {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    padding: 4px 8px;
    border-radius: 4px;
}

.candle-control input {
    width: 45px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    outline: none;
}

.candle-control span {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-dim);
}

.bar-container {
    width: 200px;
    height: 18px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 2px;
    display: flex;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.bar {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    overflow: hidden;
    white-space: nowrap;
    min-width: 0;
    transition: width 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.bar.buy {
    background: var(--buy-color);
    color: #fff;
    font-weight: 800;
}

.bar.sell {
    background: var(--sell-color);
    color: #fff;
    font-weight: 800;
}

.bar.neutral {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    font-weight: 600;
}

.workspace-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#mainChart {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

.heartbeat-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(0, 210, 255, 0.03) 45%,
            rgba(0, 210, 255, 0.08) 50%,
            rgba(0, 210, 255, 0.03) 55%,
            transparent 100%);
    z-index: 0;
    pointer-events: none;
    animation: heartbeat 8s linear infinite;
}

@keyframes heartbeat {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(0%);
    }
}

.mini-icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-icon-btn:hover {
    background: rgba(0, 210, 255, 0.1);
    border-color: var(--accent-blue);
    color: white;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
}

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

.indicator-toggles {
    position: relative;
    z-index: 10;
}

.sidebar-toggles {
    position: absolute;
    left: 10px;
    top: 5px;
    z-index: 100;
    background: transparent;
    padding: 0;
    border: none;
}

.ind-val {
    margin-left: 8px;
    font-weight: 800;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent-blue);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    background: rgba(10, 14, 18, 0.3);
    padding: 1px 4px;
    border-radius: 3px;
}

.toggle-item {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 0px;
    /* Reduced for tight fit */
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 1);
    cursor: pointer;
    font-weight: 600;
    font-size: 10px;
    color: var(--text-dim);
}

.toggle-item:hover {
    color: var(--text-primary);
}

.toggle-item input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--accent-blue);
}

.tf-picker {
    background: transparent;
    border: none;
    color: var(--accent-blue);
    font-size: 10px;
    font-weight: 900;
    font-family: var(--font-mono);
    cursor: pointer;
    outline: none;
    padding: 0;
    margin: 0;
    text-align: center;
}

.vertical-stack {
    flex-direction: column !important;
    gap: 2px !important;
}

.toggle-group {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    pointer-events: all;
}

.toggle-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-dim);
    font-family: var(--font-mono);
    white-space: nowrap;
}

.toggle-item input {
    appearance: none;
    width: 14px;
    height: 14px;
    border: 1px solid var(--card-border);
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.toggle-item input:checked {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.3);
}

.toggle-item .indicator-line {
    width: 24px;
    height: 0;
    border-top: 2px dashed #999;
}

.indicator-line.macd {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.indicator-line.ma {
    color: #facc15;
    border-color: #facc15;
}

.indicator-line.rsi {
    color: #c084fc;
    border-color: #c084fc;
}

.indicator-line.boll-mb {
    color: #38bdf8;
    border-color: #38bdf8;
}

.indicator-line.boll-up {
    border-bottom: 2px dashed #38bdf8;
    color: #38bdf8;
    border-color: #38bdf8;
}

.indicator-line.boll-down {
    border-bottom: 2px dashed #38bdf8;
    color: #38bdf8;
    border-color: #38bdf8;
}

/* Indicator Status Table */
.indicator-table-card {
    flex: none;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.table-wrapper {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
}

#indicatorTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
    font-family: var(--font-main);
    font-size: 11px;
    color: var(--text-primary);
}

#indicatorTable th {
    text-align: center;
    padding: 12px 8px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 800;
}

#indicatorTable td {
    padding: 0;
    height: 48px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    text-align: center;
    transition: background 0.2s ease;
}

#indicatorTable tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

#indicatorTable td:first-child {
    border-left: 1px solid rgba(255, 255, 255, 0.03);
    border-top-left-radius: var(--border-radius-sm);
    border-bottom-left-radius: var(--border-radius-sm);
    font-weight: 800;
    font-size: 12px;
}

#indicatorTable td:last-child {
    border-right: 1px solid rgba(255, 255, 255, 0.03);
    border-top-right-radius: var(--border-radius-sm);
    border-bottom-right-radius: var(--border-radius-sm);
}

.tf-meta {
    display: block;
    font-size: 9px;
    opacity: 0.6;
    margin-top: 2px;
    font-weight: normal;
}

.footer-row td {
    border-top: 1px solid var(--card-border);
    font-weight: 800;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

#total-avg {
    font-size: 13px;
    background: rgba(0, 210, 255, 0.1);
}

#indicatorTable tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.val-up {
    color: var(--buy-color);
}

.val-down {
    color: var(--sell-color);
}

.val-neutral {
    color: var(--accent-blue);
}

.update-pulse {
    animation: flash 0.8s ease-out;
}

@keyframes flash {
    0% {
        background: rgba(255, 255, 255, 0.1);
    }

    100% {
        background: transparent;
    }
}

#indicatorTable td {
    transition: all 0.3s ease;
}

#indicatorTable tbody tr:empty::before {
    content: "Loading market data...";
    display: block;
    padding: 20px;
    color: var(--text-dim);
    font-style: italic;
}

.settings-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px !important;
}

.save-btn-green {
    background: var(--buy-color) !important;
    color: #000 !important;
    border-color: var(--buy-color) !important;
    padding: 6px 16px !important;
    font-size: 12px !important;
    box-shadow: 0 0 10px rgba(0, 255, 204, 0.3) !important;
}

.save-btn-green:hover {
    box-shadow: 0 0 20px rgba(0, 255, 204, 0.5) !important;
    transform: translateY(-1px);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    opacity: 0.3;
}

.dot.macd {
    background: var(--accent-blue);
}

.dot.ma {
    background: #facc15;
}

.dot.rsi {
    background: #c084fc;
}

.dot.boll-mb {
    background: #38bdf8;
}

.dot.boll-up {
    background: #38bdf8;
}

.dot.boll-down {
    background: #38bdf8;
}

.chart-area {
    flex: 1;
    min-height: 400px;
    position: relative;
}

.mini-chart {
    width: 100%;
    height: 200px;
}


.indicator-header,
.price-header {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    position: relative;
    gap: 20px;
}

.indicator-toggles {
    flex: 0 0 auto;
}

.indicator-header-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}

.indicator-header .indicator-header-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.9;
}

.header-title-wrap {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.header-right-wrap {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 0 0 auto;
    z-index: 20;
}


.tf-picker {
    background: none;
    border: none;
    color: var(--text-primary);
    font-weight: 800;
    font-size: 12px;
    outline: none;
    cursor: pointer;
    font-family: var(--font-main);
}

.tf-picker option {
    background: var(--bg-deep);
    color: var(--text-primary);
}

.mini-bar {
    width: 140px;
    height: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mini-bar .bar {
    font-size: 7px;
}


.indicator-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-dim);
    margin-right: 5px;
    text-transform: uppercase;
}

#indicatorTable {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    color: var(--text-primary);
}

#indicatorTable th {
    padding: 12px 8px;
    font-weight: 700;
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    border-bottom: 1px solid var(--card-border);
}

#indicatorTable td {
    padding: 12px 8px;
    text-align: center;
    font-size: 13px;
    font-family: var(--font-mono);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.val-up {
    color: var(--buy-color);
    font-weight: 800;
}

.val-down {
    color: var(--sell-color);
    font-weight: 800;
}

.candle-control input {
    width: 50px;
    border: none;
    background: none;
    font-weight: 800;
    outline: none;
    text-align: center;
}

.indicator-picker {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    padding: 10px 30px;
    border-radius: 30px;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator-picker:hover {
    background: rgba(0, 210, 255, 0.1);
    border-color: var(--accent-blue);
}

.pill-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    padding: 4px 16px;
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
    margin: 12px;
}

.signal-logs {
    height: 200px;
    display: flex;
    flex-direction: column;
}

.log-controls {
    padding: 10px 20px;
    display: flex;
    gap: 20px;
    background: rgba(255, 255, 255, 0.02);
}

.log-content {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
}

/* Right Panels */
.sidebar-panels {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
    min-height: 0;
}

.sidebar-panels>.card {
    border-radius: 0;
    margin-bottom: -1px;
    /* Collapse borders */
}

.sidebar-panels>.card:first-child {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.sidebar-panels>.card:last-child {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    margin-bottom: 0;
}

.panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.panel-header {
    padding: 12px 20px;
    font-weight: 800;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--card-border);
    text-align: center;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.panel-list {
    flex: 1;
    padding: 0;
    /* Remove padding to let table fill space */
    overflow-y: auto;
    background: transparent;
}

#systemLogs {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 380px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    background: rgba(10, 14, 18, 0.2);
    border-radius: 4px;
    scroll-behavior: smooth;
}

.log-entry {
    color: var(--text-dim);
    line-height: 1.4;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    padding-bottom: 4px;
    display: block;
}

.log-time {
    color: var(--accent-blue);
    opacity: 0.6;
    margin-right: 8px;
    font-weight: 400;
}

.log-tag {
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 9px;
    margin-right: 4px;
    text-transform: uppercase;
}

.log-tag.system {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
}

.log-tag.strategy {
    color: #facc15;
    background: rgba(250, 204, 21, 0.1);
}

.log-tag.sim {
    color: #c084fc;
    background: rgba(192, 132, 252, 0.1);
}

.log-tag.error {
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
}

/* Custom Scrollbar */
.panel-list::-webkit-scrollbar {
    width: 6px;
}

.panel-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.panel-list::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 10px;
}

.panel-list::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
}

/* Matrix V2 Styles */
.matrix-header-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 0;
    transition: all 0.3s ease;
}

.matrix-header-cell .m-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-dim);
    margin-bottom: 2px;
}

.matrix-header-cell .m-values {
    font-family: var(--font-mono);
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.matrix-header-cell .m-sep {
    opacity: 0.1;
    font-weight: 300;
}

.matrix-cell-v2 {
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.matrix-cell-v2 .m-main-val {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
}

.matrix-cell-v2 .m-limit {
    font-size: 9px;
    color: var(--text-dim);
    opacity: 0.4;
}

.matrix-cell-v2 .m-curr {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-primary);
}

.matrix-cell-v2 .m-sub-signals {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 9px;
}

.signal-bar-mini {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.signal-bar-mini .fill,
.signal-bar-mini .inner {
    height: 100%;
    transition: width 0.5s ease;
}

.matrix-cell-v2.state-buy .m-curr {
    color: var(--buy-color);
    text-shadow: 0 0 8px rgba(0, 255, 204, 0.3);
}

.matrix-cell-v2.state-sell .m-curr {
    color: var(--sell-color);
    text-shadow: 0 0 8px rgba(255, 51, 102, 0.3);
}

.matrix-cell-empty {
    opacity: 0.1;
    text-align: center;
    padding: 10px;
}

/* Table Enhancements */
#indicatorTable {
    border-spacing: 0 4px;
}

#indicatorTable td {
    padding: 0;
    border: none;
}

#indicatorTable th {
    background: rgba(0, 0, 0, 0.8);
    border: none;
}

#indicatorTable td:first-child .matrix-cell-v2 {
    background: rgba(0, 0, 0, 0.8);
}

.history-table th {
    background: #fff;
    border: 1px solid #ccc;
    padding: 8px 4px;
    font-weight: 800;
    position: sticky;
    top: 0;
    z-index: 1;
}

.history-table td {
    border: 1px solid var(--card-border);
    padding: 10px 8px;
    text-align: center;
    color: var(--text-primary);
}

.history-table th {
    background: rgba(2, 4, 6, 0.95);
    color: var(--accent-blue);
    border: 1px solid var(--card-border);
}

.empty-state {
    text-align: center;
    color: var(--text-dim);
    font-size: 13px;
    margin-top: 20px;
}

.log-entry {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
    transition: all 0.2s ease;
    word-break: break-all;
}

.log-entry:hover {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 1000px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }
}

.price-source-tag {
    font-size: 0.65rem;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    border: 1px solid var(--card-border);
    white-space: nowrap;
    margin-left: 10px;
    /* Tab space equivalent */
}

/* Settings View */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 16px;
    padding: 16px;
    height: calc(100vh - var(--header-h));
    width: 100%;
    max-width: none;
    margin: 0;
    overflow: hidden;
}

.settings-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.settings-header-card {
    padding: 0;
}

.settings-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.perf-table td {
    padding: 8px 6px !important;
    font-family: var(--font-mono);
}

.perf-table th {
    font-size: 10px;
}

.settings-scroll-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    min-height: 0;
    /* Important for flex children to scroll */
}

.settings-scroll-area::-webkit-scrollbar {
    width: 4px;
}

.settings-scroll-area::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 4px;
}

.tf-config-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    margin-bottom: 16px;
    padding: 16px;
}

.tf-config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
    padding: 10px 16px;
    margin: -16px -16px 12px -16px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.tf-config-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.tf-config-card.collapsed .tf-config-header {
    border-bottom: none;
    margin-bottom: 0;
}

.chevron {
    display: flex;
    align-items: center;
    color: var(--text-dim);
    transition: transform 0.3s ease;
}

.tf-config-card.collapsed .chevron {
    transform: rotate(-90deg);
}

.tf-config-body {
    transition: all 0.3s ease;
}

.tf-config-card.collapsed .tf-config-body {
    display: none;
}

.tf-config-header .tf-name {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent-blue);
}

.tf-config-header .tf-candles {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-dim);
}

.tf-config-header .tf-candles input {
    width: 60px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 2px 6px;
    border-radius: 4px;
    outline: none;
    text-align: center;
}

.tf-config-body {
    display: grid;
    grid-template-columns: 1fr 1fr 280px;
    gap: 24px;
    align-items: start;
}

.tf-config-body .strat-local-history {
    grid-column: 1 / -1;
    width: 100%;
}

.tf-indicators-side {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tf-strategy-side {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-left: 20px;
    border-left: 1px solid var(--card-border);
}

.tf-comment-side {
    display: flex;
    flex-direction: column;
    padding-left: 20px;
    border-left: 1px solid var(--card-border);
    height: 100%;
}

.tf-comment-box {
    width: 100%;
    flex: 1;
    min-height: 120px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    color: var(--text-dim);
    font-size: 11px;
    padding: 8px;
    resize: none;
    font-family: inherit;
    transition: all 0.2s ease;
}

.tf-comment-box:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
}

.indicator-config-row {
    margin-bottom: 16px;
}

.indicator-config-row .ind-name {
    font-size: 14px;
    font-weight: 800;
    color: #4ade80;
    /* Buy color accent */
    margin-bottom: 8px;
    display: block;
}

.config-lines {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 12px;
}

.config-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-dim);
}

.config-line label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.config-line b {
    width: 40px;
    color: var(--text-primary);
    display: inline-block;
}

.config-line input {
    width: 80px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 2px 6px;
    border-radius: 4px;
    outline: none;
    text-align: center;
    font-family: var(--font-mono);
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    width: 100%;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.config-item label {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-dim);
    text-transform: uppercase;
}

.config-item input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 4px;
    outline: none;
    font-family: var(--font-mono);
    width: 100%;
}

.strategy-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.status-badge.enabled {
    background: rgba(0, 200, 83, 0.1);
    color: #00c853;
    border: 1px solid rgba(0, 200, 83, 0.3);
}

.status-badge.disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    border: 1px solid var(--card-border);
}

.btn-ghost {
    background: none;
    border: 1px solid var(--card-border);
    color: var(--text-dim);
    padding: 2px 10px;
    font-size: 10px;
    font-weight: 800;
    border-radius: 4px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-toggle-strat.active {
    background: var(--buy-color);
    color: #000;
    border-color: var(--buy-color);
}

.tf-config-card.disabled-state {
    opacity: 0.6;
    border-style: dashed;
}

.config-line span.unit {
    width: 20px;
    font-size: 11px;
}

.matrix-config-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.config-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-label {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
}

.multi-select-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    padding: 10px;
    border-radius: 4px;
    border: 1px solid var(--card-border);
}

.multi-select-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-dim);
}

.multi-select-group input[type="checkbox"] {
    appearance: none;
    width: 14px;
    height: 14px;
    border: 1px solid var(--card-border);
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.multi-select-group input[type="checkbox"]:checked {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.avg-desc {
    font-size: 12px;
    color: var(--text-dim);
    font-style: italic;
}

/* Detailed Matrix Cell Styles */
.matrix-cell-detailed {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    padding: 4px;
    min-height: unset;
    height: auto;
    width: 100%;
    transition: background 0.3s ease;
}

.m-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 4px;
}

.m-row span {
    font-size: 10px;
    flex: 1;
    text-align: center;
    white-space: nowrap;
}

.m-list-item {
    font-size: 10px;
    line-height: 1.4;
    white-space: nowrap;
    width: 100%;
    text-align: center;
}

.m-current {
    font-weight: 800;
    font-size: 11px !important;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    padding: 1px 2px;
}

.buy-leg {
    color: var(--buy-color);
    font-weight: 700;
}

.sell-leg {
    color: var(--sell-color);
    font-weight: 700;
}

/* Account Form Focus Styles */
#account-view input:focus {
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.2);
    background: rgba(0, 0, 0, 0.6) !important;
}

#account-view .nav-btn:active {
    transform: scale(0.98);
}

/* User Tag & Identity Tiers */
.user-tag {
    font-size: 9px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.user-tag.admin {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.user-tag.premium {
    background: linear-gradient(135deg, #00ffcc, #00d2ff);
    color: #000;
}

.user-tag.normal {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
}

/* Mini Setting Controls */
.setting-controls-mini {
    display: flex;
    gap: 3px;
    margin-left: 5px;
    align-items: center;
}

.mini-ctrl-btn {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: none;
    font-size: 9px;
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0.6;
    color: #000;
}

.mini-ctrl-btn:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.mini-ctrl-btn.btn-save {
    background: var(--buy-color);
}

.mini-ctrl-btn.btn-reset {
    background: var(--text-dim);
}

.mini-ctrl-btn.btn-default {
    background: #ffaa00;
}

.matrix-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

@keyframes alert-pulse {
    0% {
        background: transparent;
    }

    50% {
        background: rgba(255, 51, 102, 0.2);
    }

    100% {
        background: transparent;
    }
}

.alert-pulse {
    animation: alert-pulse 1s infinite alternate;
    border-radius: 4px;
}

@keyframes success-feedback-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    }

    50% {
        transform: scale(1.4);
        box-shadow: 0 0 20px 5px rgba(74, 222, 128, 0.4);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}

.spinner-small {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin-sim 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin-sim {
    to {
        transform: rotate(360deg);
    }
}

.btn-success-feedback {
    animation: success-feedback-pulse 1s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1 !important;
    z-index: 100 !important;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border-radius: 32px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--buy-color);
}

input:checked+.slider:before {
    transform: translateX(14px);
}

/* Communication Protocol View */
.comm-protocol-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.comm-category {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.comm-category h4 {
    color: var(--accent-blue);
    font-size: 13px;
    text-transform: uppercase;
    margin-bottom: 16px;
    border-bottom: 2px solid rgba(0, 210, 255, 0.2);
    padding-bottom: 8px;
    font-weight: 800;
}

.comm-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.comm-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.comm-header-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.comm-method {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    margin-right: 10px;
    text-transform: uppercase;
    min-width: 50px;
    text-align: center;
}

.comm-method.get {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.comm-method.post {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.comm-method.socket {
    background: rgba(255, 150, 0, 0.15);
    color: #ff9600;
    border: 1px solid rgba(255, 150, 0, 0.3);
}

.comm-path {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 600;
}

.comm-desc {
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 10px;
    line-height: 1.4;
}

.comm-code-wrap {
    position: relative;
}

.comm-code {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    overflow-x: auto;
    white-space: pre-wrap;
    color: #e2e8f0;
    line-height: 1.5;
}

.comm-code span.key {
    color: #f472b6;
}

.comm-code span.string {
    color: #4ade80;
}

.comm-code span.number {
    color: #fbbf24;
}

.comm-view-container {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 10px;
}

.comm-view-container::-webkit-scrollbar {
    width: 6px;
}

.comm-view-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}



.settings-modal {
    background: #0a0e12;
    border: 1px solid var(--card-border);
    width: 95%;
    max-width: 900px;
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 210, 255, 0.1);
    display: flex;
    flex-direction: column;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: var(--accent-blue);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #ff3366;
}

.modal-body {
    padding: 24px;
    max-height: 75vh;
    overflow-y: auto;
}

.settings-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.settings-table th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-dim);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 12px;
    text-align: left;
    border-radius: 4px;
}

.settings-table td {
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.settings-table td:first-child {
    border-radius: 4px 0 0 4px;
    font-weight: 900;
    color: var(--accent-blue);
    width: 60px;
}

.settings-table td:last-child {
    border-radius: 0 4px 4px 0;
}

.settings-group-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-row-input {
    display: flex;
    align-items: center;
    gap: 5px;
}

.settings-row-input label {
    font-size: 11px;
    color: var(--text-dim);
    width: 35px;
    font-weight: 600;
}

.settings-row-input input {
    width: 80px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 6px 8px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 13px;
    text-align: center;
    outline: none;
}

.settings-row-input input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 8px rgba(0, 210, 255, 0.2);
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: flex-end;
}

.action-btn.primary {
    background: var(--accent-blue);
    color: #000;
    border: none;
    padding: 10px 30px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.action-btn.primary:hover {
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.4);
    transform: scale(1.05);
}

/* GLOBAL LAYOUT SAFETY BUFFER */
main {
    padding-bottom: 60px !important;
}

.main-workspace,
.settings-main,
.comm-view-container,
#admin-membership-list,
.table-wrapper,
#unit-test-logs,
#catalog-groups,
#help-container {
    padding-bottom: 40px !important;
}

/* Bottom Bar / Footer */
.bottom-bar {
    height: var(--footer-h);
    background: rgba(2, 4, 6, 0.9);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    justify-content: space-between;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 40px;
    justify-content: flex-end;
    flex: 1;
}

.footer-links {
    display: flex;
    gap: 25px;
    align-items: center;
    order: 2;
}

.system-tag {
    order: 1;
}

.footer-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

.footer-link:hover {
    color: var(--accent-blue);
    text-shadow: 0 0 8px rgba(0, 210, 255, 0.4);
}

.footer-copy,
.system-tag {
    font-size: 10px;
    color: var(--text-dim);
    opacity: 0.5;
}

.system-tag {
    font-family: var(--font-mono);
}

/* Admin Tabs Styles */
.admin-container {
    padding: 20px;
    width: 100%;
    max-width: 100%;
    overflow-y: auto;
    height: calc(100vh - var(--header-h) - var(--footer-h));
}

.admin-tabs-card {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.admin-tabs-header {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--card-border);
    background: rgba(255, 255, 255, 0.02);
    padding: 0;
}

.admin-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 18px 24px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-bottom: 3px solid transparent;
    font-family: var(--font-main);
    position: relative;
}

.admin-tab-btn .tab-icon {
    font-size: 18px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.admin-tab-btn:hover {
    background: rgba(0, 210, 255, 0.05);
    color: var(--accent-blue);
}

.admin-tab-btn:hover .tab-icon {
    opacity: 1;
    transform: scale(1.1);
}

.admin-tab-btn.active {
    color: var(--accent-blue);
    background: rgba(0, 210, 255, 0.08);
    border-bottom-color: var(--accent-blue);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.2);
}

.admin-tab-btn.active .tab-icon {
    opacity: 1;
}

.admin-tabs-content {
    position: relative;
    min-height: 500px;
}

.admin-tab-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.admin-tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-pane-header {
    padding: 24px 28px;
    border-bottom: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tab-pane-header h3 {
    color: var(--accent-blue);
    font-size: 16px;
    letter-spacing: 1.5px;
    font-weight: 800;
    margin: 0;
}

.tab-pane-subtitle {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tab-pane-body {
    padding: 28px;
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - var(--header-h) - var(--footer-h) - 200px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .admin-tab-btn {
        padding: 14px 16px;
        font-size: 11px;
        flex-direction: column;
        gap: 6px;
    }

    .admin-tab-btn .tab-icon {
        font-size: 20px;
    }

    .admin-tab-btn .tab-label {
        font-size: 9px;
    }

    .tab-pane-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}