:root {
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --primary: #10b981;
    --primary-hover: #059669;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --danger: #f43f5e;
    --accent-blue: #38bdf8;
}

html {
    font-size: 16.5px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.2s, box-shadow 0.2s;
}

.glass-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Screens */
.screen {
    display: none;
    min-height: 100vh;
    width: 100vw;
    position: absolute;
    top: 0;
    left: 0;
}

#disclaimer-screen.active, #welcome-screen.active {
    display: flex;
}
#dashboard-screen.active {
    display: flex;
    flex-direction: row;
}

/* Disclaimer Screen */
#disclaimer-screen {
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #101826 0%, #05080f 100%);
}

.login-box {
    width: 100%;
    max-width: 850px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    animation: slideUp 0.8s ease-out;
}

.brand-logo {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    object-fit: contain;
    box-shadow: 0 0 25px rgba(255,215,0,0.15);
}

.subtitle {
    color: #ffffff;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.input-group {
    width: 100%;
    text-align: left;
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

select, input[type="password"], input[type="text"], input[type="number"] {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

/* Native dropdown popups ignore translucent backgrounds; force a solid dark list */
select {
    color-scheme: dark;
}

select option,
select optgroup {
    background-color: #0f172a;
    color: #f1f5f9;
}

select option:checked {
    background-color: #1e3a34;
    color: #ffffff;
}

select:focus, input:focus {
    border-color: var(--primary);
}

.disclaimer-box {
    width: 100%;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 6px;
    padding: 1.5rem;
    text-align: left;
    margin-bottom: 1.5rem;
    max-height: 350px;
    overflow-y: auto;
}

.disclaimer-box h3 {
    color: var(--danger);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.disclaimer-box h4 {
    color: var(--danger);
    font-size: 0.9rem;
    margin-top: 1rem;
    margin-bottom: 0.25rem;
}

.disclaimer-box p, .disclaimer-box ul {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.disclaimer-box ul {
    padding-left: 1rem;
}

/* Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.85rem;
}

.checkbox-container input {
    margin-right: 0.75rem;
    width: 14px;
    height: 14px;
    accent-color: var(--primary);
}

.primary-btn {
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    filter: brightness(1.1);
}

.primary-btn:disabled {
    background: #1e293b;
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
}

.neon-glow {
    box-shadow: var(--glow-primary);
}

/* Welcome Screen */
#welcome-screen {
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.fade-in-text {
    font-size: 2.5rem;
    animation: fadeInOut 3s ease-in-out;
}

.welcome-logo {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 12px;
    margin-bottom: 2rem;
    object-fit: contain;
    box-shadow: 0 0 40px rgba(46, 204, 113, 0.15);
    animation: fadeInOut 3s ease-in-out;
}

.spinner {
    margin-top: 2rem;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(16, 185, 129, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Sidebar */
.sidebar {
    width: 320px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
}

.sidebar-brand {
    padding: 2rem;
    display: flex;
    justify-content: center;
}

.sidebar-logo {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 20px rgba(255,215,0,0.1);
}

.sidebar-section {
    padding: 0 1.5rem;
    margin-bottom: 2rem;
}

.sidebar-section h3 {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.nav-item {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 0.35rem;
    cursor: pointer;
    color: #94a3b8;
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    transform: translateX(4px);
}

.nav-item.active {
    border-left: 4px solid var(--primary);
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0) 100%);
    color: var(--text-main);
}

.nav-icon {
    margin-right: 14px;
    font-size: 1.4rem;
}

.system-health {
    margin-top: auto;
}

.health-ring {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.ring {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #1e293b;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 0.65rem;
    color: var(--text-muted);
}
.ring.cpu { border-top-color: var(--primary); }
.ring.mem { border-top-color: var(--danger); }
.ring span {
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: bold;
}

.user-chip {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.nav-username {
    font-weight: bold;
    font-size: 1.1rem;
}
.badge {
    font-size: 0.8rem;
    background: rgba(16, 185, 129, 0.2);
    color: var(--primary);
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 10px;
}

/* Content Area */
.content-area {
    flex-grow: 1;
    padding: 2.5rem 3.5rem;
    height: 100vh;
    overflow-y: auto;
    background: radial-gradient(circle at top right, rgba(30, 41, 59, 1) 0%, var(--bg-darker) 100%);
}

.panel {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.panel.active {
    display: block;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

header h2 {
    font-size: 1.6rem;
    font-weight: 700;
}

.text-glow {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.badge-running {
    font-size: 0.7rem;
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    padding: 4px 8px;
    border-radius: 12px;
    vertical-align: middle;
    margin-left: 10px;
}

.status-indicator {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: var(--primary);
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    margin-right: 8px;
}
.blinking { animation: blink 2s infinite; }

.section-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 2.5rem 0 1rem 0;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.metric-card {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-blue), transparent);
}

.metric-card .label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.metric-card .value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.positive { 
    color: var(--primary) !important; 
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.4) !important;
}

/* Data Tables */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    padding: 1.25rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 1.05rem;
}

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(15, 23, 42, 0.9);
    position: sticky;
    top: 0;
}

.data-table tbody tr {
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: rgba(56, 189, 248, 0.05);
}

/* Preferences Table Inputs */
.qty-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    background: #1e293b;
    border: none;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qty-btn:hover { background: #334155; }

.qty-val {
    width: 30px;
    text-align: center;
    font-weight: bold;
}

.readonly-select {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    appearance: none;
}

/* Tabs */
.tabs-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    border-bottom: 2px solid transparent;
}

.tab.active {
    color: var(--accent-blue);
    border-bottom: 2px solid var(--accent-blue);
}

.analytics-chart-container {
    padding: 1.5rem;
    height: 300px;
}

/* Console */
.console-box {
    border-radius: 8px;
    overflow: hidden;
}
.console-header {
    background: #1e293b;
    padding: 1rem;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
}
.console-body {
    background: #000;
    padding: 1.5rem;
    font-family: monospace;
    font-size: 1rem;
    color: #4ade80;
    height: 180px;
    overflow-y: auto;
}

/* Market Status Banner */
.market-status-banner {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    margin-bottom: 2rem;
}
.market-col {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    border-right: 1px solid var(--border-color);
}
.market-col:last-child {
    border-right: none;
}
.m-icon {
    font-size: 2.2rem;
    margin-right: 1.5rem;
}
.m-info {
    display: flex;
    flex-direction: column;
}
.m-info strong {
    font-size: 0.95rem;
    color: var(--text-main);
    letter-spacing: 0.5px;
    margin-bottom: 0.3rem;
}
.m-info small {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 0.2rem;
}
.m-state {
    margin-top: 0.5rem;
    font-weight: 800;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
}
.m-state.open { color: var(--primary); }
.m-state.closed { color: var(--danger); }

.glow-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}
.glow-dot.green {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}
.glow-dot.red {
    background: var(--danger);
    box-shadow: 0 0 10px var(--danger);
}

.flex-between {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.heavy-input {
    background: rgba(0,0,0,0.5) !important;
    border-color: #334155 !important;
}

/* Animations */
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInOut { 0% { opacity: 0; transform: scale(0.95); } 20% { opacity: 1; transform: scale(1); } 80% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.05); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.pulse { animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.4); } 70% { box-shadow: 0 0 0 15px rgba(255, 215, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); } }

/* Calendar Tab Styles */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.cal-day-header {
    text-align: center;
    color: var(--text-muted);
    font-weight: bold;
    font-size: 0.95rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.cal-cell {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cal-cell.empty {
    background: transparent;
    border: none;
    color: var(--text-muted);
    justify-content: flex-start;
}

.cal-cell .date {
    display: inline-flex;
    align-items: center;
    font-weight: bold;
    color: var(--text-main);
}
.cal-cell.loss .date::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--danger);
    border-radius: 50%;
    margin-right: 8px;
}
.cal-cell.profit .date::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    margin-right: 8px;
}

.cal-cell .pnl {
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--danger); /* Default for loss */
}
.cal-cell.profit .pnl {
    color: var(--primary);
}

.cal-cell .trades {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
}

.q-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}
.q-table th, .q-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.q-table th {
    color: var(--text-muted);
    font-weight: normal;
    font-size: 0.95rem;
}
.q-table td {
    font-weight: bold;
    font-size: 1rem;
}

/* Sector Outlook */
.sector-outlook {
    padding: 1.5rem;
}
.sector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.s-left h4 {
    margin: 0;
}
.s-middle {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.trend {
    font-weight: bold;
    font-size: 0.95rem;
}
.trend.up { color: var(--primary); }
.trend.down { color: var(--danger); }
.trend-bar {
    width: 200px;
    height: 10px;
    background: #1e293b;
    border-radius: 6px;
    display: flex;
    overflow: hidden;
    gap: 3px;
}
.bar-green { background: var(--primary); border-radius: 4px; }
.bar-red { background: var(--danger); border-radius: 4px; }
.bearish-badge {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}
.sector-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.75rem;
}
.sec-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.85rem 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
}
.sec-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.03);
}
.s-name {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.s-val {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Participant Data Panel */
.pulse-left h3 {
    margin: 0;
}
.pill-badge {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}
.pill-badge.red {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.pill-badge.green {
    background: rgba(16, 185, 129, 0.2);
    color: var(--primary);
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.p-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}
.p-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.p-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.r-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}
.r-val {
    font-size: 0.85rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.r-val.red { color: var(--danger); }
.r-val.green { color: var(--primary); }
.chart-spark {
    font-size: 0.8rem;
    opacity: 0.8;
}
.s-val.up { color: var(--primary); }
.s-val.down { color: var(--danger); }

/* IOC Dashboard */
.ioc-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}
.ioc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}
.ioc-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}
.ioc-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
.mood-left {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.matrix-right {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.mood-title, .matrix-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* Half Circle Gauge */
.mood-gauge {
    position: relative;
    width: 140px;
    height: 70px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.gauge-bg, .gauge-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 15px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
}
.gauge-fill {
    border-bottom-color: transparent !important;
    border-right-color: transparent !important;
    transform: rotate(45deg); /* Base rotation */
}
.gauge-fill.consolidated {
    border-top-color: #64748b;
    border-left-color: #64748b;
}
.gauge-fill.bearish {
    border-top-color: var(--danger);
    border-left-color: var(--danger);
}
.gauge-needle {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 2px;
    height: 55px;
    background: transparent;
    transform-origin: bottom center;
    transition: transform 1s ease-out;
}
.needle-pointer {
    position: absolute;
    bottom: 0;
    left: -1.5px;
    width: 5px;
    height: 55px;
    background: #fff;
    border-radius: 5px;
}
.needle-base {
    position: absolute;
    bottom: -6px;
    left: -5px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    z-index: 2;
}

.mood-status {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}
.mood-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.m-row {
    display: flex;
    justify-content: space-between;
    padding: 0.7rem 0;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.m-row:last-child {
    border-bottom: none;
}
.m-row span:first-child {
    color: var(--text-muted);
}
.m-row span:last-child {
    font-weight: bold;
}

/* Typography Utilities */
.text-blue { color: #3b82f6; }
.text-red { color: var(--danger); }
.text-green { color: var(--primary); }
.text-orange { color: #f59e0b; }
/* TRADING CONFIGURATION UI */
.tc-top-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
.tc-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.75rem;
    letter-spacing: 0.5px;
}
.tc-select {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
}
.tc-number-input {
    display: flex;
    background: var(--bg-dark);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}
.tc-number-input input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
}
.tc-num-controls {
    display: flex;
}
.tc-num-controls button {
    background: transparent;
    border: none;
    border-left: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 0 1rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}
.tc-num-controls button:hover {
    background: rgba(255,255,255,0.05);
}
.tc-radio-group {
    display: flex;
    gap: 1.5rem;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
}
.tc-radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}
.tc-radio-group input[type="radio"] {
    accent-color: var(--danger);
    width: 14px;
    height: 14px;
}

/* Multi-select Pills */
.tc-multi-select {
    border: 1px solid var(--danger);
    border-radius: 6px;
    padding: 0.5rem;
    background: transparent;
    display: flex;
    flex-direction: column;
}
.tc-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
}
.tc-pill {
    background: var(--danger);
    color: #fff;
    padding: 0.2rem 0.5rem 0.2rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.close-x {
    cursor: pointer;
    opacity: 0.8;
}
.close-x:hover { opacity: 1; }

.tc-dropdown-list {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 0.5rem;
    margin-top: 0.2rem;
    display: flex;
    flex-direction: column;
}
.tc-opt {
    padding: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #cbd5e1;
    cursor: pointer;
    border-radius: 4px;
}
.tc-opt:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

/* Data Table */
.tc-table-title {
    font-size: 1.15rem;
    color: #fff;
    margin: 0 0 1.5rem 1rem;
}
.tc-table {
    width: 100%;
    border-collapse: collapse;
}
.tc-table th {
    text-align: left;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.tc-table td {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    vertical-align: middle;
}
.tc-table tbody tr:hover td {
    background: rgba(255,255,255,0.02);
}
.tc-inst {
    color: #fff;
    font-weight: 700;
}
.tc-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-dark);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    width: 80px;
    height: 32px;
}
.tc-stepper span {
    padding-left: 0.75rem;
}
.st-btns {
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255,255,255,0.1);
    height: 100%;
}
.st-btns button {
    background: transparent;
    border: none;
    color: #fff;
    height: 16px;
    width: 24px;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.st-btns button:first-child { border-bottom: 1px solid rgba(255,255,255,0.1); }
.st-btns button:hover { background: rgba(255,255,255,0.05); }

.tc-inline-select {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    outline: none;
    width: 100%;
}
.tc-stop-btn {
    background: rgba(225, 29, 72, 0.15);
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}
.tc-stop-btn:hover {
    background: rgba(225, 29, 72, 0.25);
}
.tc-stop-btn.btn-resume {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid #10b981;
}
.tc-stop-btn.btn-resume:hover {
    background: rgba(16, 185, 129, 0.25);
}
.pulse-dot {
    width: 6px;
    height: 6px;
    background: var(--danger);
    border-radius: 50%;
}

.tc-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    margin-top: 1rem;
    position: relative;
}
.tc-live-text {
    position: absolute;
    left: 2rem;
    font-weight: 800;
    letter-spacing: 1px;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.4s ease;
}
/* Status variants */
.tc-status-live {
    color: #10b981;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.7);
    animation: pulse-live 1.6s infinite;
}
.tc-status-partial {
    color: #f59e0b;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}
.tc-status-no-trade {
    color: #64748b;
    text-shadow: none;
    font-size: 0.78rem;
}
/* Instrument status pills inside the row */
.tc-inst-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.55rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-left: 0.4rem;
}
.tc-inst-badge.live {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.tc-inst-badge.live::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
    animation: pulse-live 1.6s infinite;
}
.tc-inst-badge.exited {
    background: rgba(100, 116, 139, 0.12);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.25);
}
.tc-inst-badge.exited::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #64748b;
}
@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}
.tc-big-stop {
    background: var(--danger);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 1rem 4rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(225, 29, 72, 0.4);
    transition: transform 0.2s;
}
.tc-big-stop:hover { transform: translateY(-2px); }
.pulse-dot.big {
    width: 8px;
    height: 8px;
    background: transparent;
    border: 2px solid #fff;
}

.tc-logs-section {
    margin-top: 3rem;
}
.tc-logs-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}
.tc-logs-container {
    background: #000;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}
.tc-logs-header {
    background: #1e293b;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}
.tc-logs-header label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}
.tc-logs-body {
    padding: 1rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    color: var(--primary);
    min-height: 120px;
    line-height: 1.5;
}

/* AUTHENTICATION UI OVERHAUL */
.nav-login-btn {
    background: rgba(147, 197, 253, 0.9);
    color: #fff;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}
.nav-login-btn:hover { background: #3b82f6; transform: translateY(-1px); }

.nav-user-profile { position: relative; }
.profile-dropdown-trigger {
    background: #2a2a2a;
    padding: 0.25rem 0.75rem 0.25rem 0.25rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.2s;
}
.profile-dropdown-trigger:hover { background: #333; }
.profile-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #2e7d32;
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 1rem;
}
.profile-info { display: flex; flex-direction: column; }
.profile-name { font-size: 0.8rem; font-weight: 600; color: #fff; }
.profile-email { font-size: 0.7rem; color: #9ca3af; }
.dropdown-arrow { color: #9ca3af; font-size: 0.7rem; }

.profile-dropdown-menu {
    position: absolute; top: 120%; right: 0;
    background: #1e1e1e;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    width: 250px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 100;
    display: none;
    animation: slideUp 0.2s ease-out;
}
.menu-header {
    padding: 1rem; border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex; gap: 1rem; align-items: center;
}
.profile-avatar.large { width: 48px; height: 48px; font-size: 1.5rem; }
.menu-items { padding: 0.5rem 0; }
.menu-item {
    padding: 0.75rem 1.25rem; display: flex; align-items: center; gap: 1rem;
    color: #fff; cursor: pointer; font-size: 0.9rem; transition: background 0.2s;
}
.menu-item:hover { background: rgba(255,255,255,0.05); }
.menu-item.logout { color: #f87171; border-top: 1px solid rgba(255,255,255,0.05); margin-top: 0.5rem; }

/* MODALS */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(5px);
    display: none; align-items: center; justify-content: center; z-index: 1000;
}
.auth-modal {
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    width: 100%; max-width: 400px;
    padding: 2.5rem; position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease-out;
}
.close-modal {
    position: absolute; top: 1rem; right: 1rem;
    background: transparent; border: none; color: #9ca3af;
    font-size: 1.5rem; cursor: pointer; transition: color 0.2s;
}
.close-modal:hover { color: #fff; }

.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header h2 { font-size: 1.2rem; font-weight: 400; margin: 0; color: #fff; }
.auth-title { font-size: 1.8rem; font-weight: 700; color: #93c5fd; margin: 0.25rem 0 1rem; }
.auth-header p { font-size: 0.9rem; color: #9ca3af; margin: 0; }

.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.input-wrapper {
    position: relative;
    display: flex; align-items: center;
}
.input-icon {
    position: absolute; left: 1rem; color: #9ca3af; font-size: 1rem;
}
.input-wrapper input {
    width: 100%; padding: 0.85rem 1rem 0.85rem 2.8rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px; color: #fff; font-size: 0.95rem;
    transition: border-color 0.2s, background 0.2s;
}
.input-wrapper input:focus {
    border-color: #3b82f6; outline: none; background: rgba(255,255,255,0.08);
}
.auth-options {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.85rem; color: #9ca3af; margin-top: 0.5rem;
}
.remember-me { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.auth-submit-btn {
    background: #1d4ed8; color: #fff; border: none;
    padding: 0.85rem; border-radius: 8px; font-weight: 600;
    font-size: 1rem; cursor: pointer; margin-top: 1rem;
    transition: background 0.2s;
}
.auth-submit-btn:hover { background: #2563eb; }

.auth-footer {
    display: flex; justify-content: space-between; margin-top: 1.5rem;
}
.text-btn { background: transparent; border: none; color: #60a5fa; cursor: pointer; font-size: 0.85rem; }
.text-btn:hover { text-decoration: underline; }
.secondary-btn {
    background: rgba(255,255,255,0.05); color: #fff; border: 1px solid rgba(255,255,255,0.1);
    padding: 0.5rem 1.5rem; border-radius: 6px; cursor: pointer; transition: background 0.2s;
}
.secondary-btn:hover { background: rgba(255,255,255,0.1); }

.auth-terms {
    text-align: center; font-size: 0.75rem; color: #6b7280; margin-top: 2rem;
}
.auth-terms a { color: #9ca3af; text-decoration: underline; }

/* ASPC Banner */
.aspc-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.aspc-banner-text h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #f8fafc;
    margin: 0 0 0.5rem 0;
    letter-spacing: 0.5px;
}
.aspc-banner-text p {
    font-size: 0.9rem;
    color: #94a3b8;
    margin: 0;
}

/* Custom Multi-Select */
.custom-multi-select {
    position: relative;
    user-select: none;
    width: 140px;
}
.multi-select-header {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.multi-select-header::after {
    content: "▼";
    font-size: 0.6rem;
}
.multi-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    z-index: 100;
    display: none;
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.5rem;
    margin-top: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
.multi-select-dropdown label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    cursor: pointer;
    color: #e2e8f0;
}
.multi-select-dropdown input[type="checkbox"] {
    cursor: pointer;
}
.custom-multi-select.open .multi-select-dropdown {
    display: flex;
}
.custom-multi-select.disabled .multi-select-header {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Custom dropdown (replaces native select popup; see enhanceSelect in app.js) */
.cs-wrap { position: relative; width: 100%; }
.cs-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(0,0,0,0.5);
    border: 1px solid #334155;
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease;
}
.cs-trigger:hover, .cs-trigger:focus, .cs-wrap.open .cs-trigger { border-color: var(--primary); outline: none; }
.cs-arrow { color: var(--text-muted); transition: transform 0.2s ease; }
.cs-wrap.open .cs-arrow { transform: rotate(180deg); }
.cs-list {
    display: none;
    position: absolute;
    left: 0; right: 0; top: calc(100% + 4px);
    z-index: 1000;
    max-height: 280px;
    overflow-y: auto;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.6);
    padding: 4px;
}
.cs-wrap.open .cs-list { display: block; }
.cs-item {
    padding: 0.65rem 0.85rem;
    border-radius: 6px;
    color: #f1f5f9;
    font-size: 0.95rem;
    cursor: pointer;
}
.cs-item:hover { background: rgba(16, 185, 129, 0.15); }
.cs-item.selected { background: rgba(16, 185, 129, 0.25); color: #fff; font-weight: 600; }

/* ───────── Phase 3: live dashboard widgets ───────── */
.ring {
    position: relative;
    border: none;
    background: conic-gradient(var(--ring-color, var(--primary)) calc(var(--pct, 0) * 1%), #1e293b 0);
    transition: background 0.4s;
}
.ring::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--bg-dark); }
.ring > * { position: relative; z-index: 1; }
.ring .ring-val { display: block; line-height: 1.1; }
.ring small { font-size: 0.6rem; color: var(--text-muted); }
.ring.cpu { --ring-color: var(--primary); }
.ring.mem { --ring-color: var(--accent-blue); }
.ring.warn { --ring-color: #f59e0b; }
.ring.crit { --ring-color: var(--danger); }
.sys-status-line { margin-top: 0.75rem; font-size: 0.7rem; color: var(--text-muted); text-align: center; line-height: 1.4; }
.sys-status-line.ok { color: var(--primary); }
.sys-status-line.bad { color: var(--danger); }

.glow-dot.idle { background: #475569; box-shadow: none; }
.m-state.open { color: var(--primary); }
.m-state.closed { color: var(--danger); }
.m-state.unknown { color: var(--text-muted); }

.social-link { color: #94a3b8; transition: color 0.2s, transform 0.2s; display: inline-flex; }
.social-link:hover { color: #fff; transform: translateY(-2px); }

.card-sub { display: block; font-size: 0.6rem; font-weight: 500; letter-spacing: 0.5px; text-transform: none; color: var(--text-muted); margin-top: 2px; }
.card-header .value.positive, .value.positive { color: var(--primary); }
.card-header .value.negative, .value.negative { color: var(--danger); }
.empty-state { color: var(--text-muted); font-size: 0.85rem; text-align: center; padding: 1.25rem 0; }
.feed-line { white-space: pre-wrap; word-break: break-word; }
.feed-line .t { color: #64748b; margin-right: 6px; }
.pos-pnl.positive { color: var(--primary); }
.pos-pnl.negative { color: var(--danger); }
.pos-meta { font-size: 0.7rem; color: var(--text-muted); }
.pos-type.long { background: rgba(16,185,129,0.15); color: #10b981; }
.pos-type.short { background: rgba(239,68,68,0.15); color: #ef4444; }

.cal-header { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.cal-nav { display: flex; align-items: center; gap: 1.25rem; font-weight: 700; }
.cal-month-label { min-width: 11rem; text-align: center; font-size: 1.1rem; }
.cal-nav-btn { background: rgba(255,255,255,0.05); border: 1px solid var(--border-color); color: var(--text-main); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; line-height: 1; transition: background 0.2s; }
.cal-nav-btn:hover:not(:disabled) { background: rgba(16,185,129,0.2); }
.cal-nav-btn:disabled { opacity: 0.35; cursor: default; }
.cal-month-summary { font-size: 0.85rem; color: var(--text-muted); }
.cal-cell.today { outline: 1px solid var(--accent-blue); }
.cal-cell.no-trades { opacity: 0.55; }
.cal-cell.no-trades .date::before { display: none; }
.q-label { margin: 1.5rem 0 0.75rem; font-size: 1.1rem; }
.broker-health-btn { background: rgba(56,189,248,0.1); border: 1px solid rgba(56,189,248,0.3); color: var(--accent-blue); padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; font-size: 0.85rem; }
.broker-health-btn:disabled { opacity: 0.6; cursor: wait; }

/* ═════════════ Phase 4: readability pass ═════════════ */
:root { --warning: #f59e0b; --text-light: #e2e8f0; --text-muted: #a9b7cb; }

/* Panel headers */
.panel-title { display: flex; align-items: center; gap: 0.6rem; font-size: 1.7rem; }
.panel-sub { display: block; margin-top: 0.35rem; font-size: 0.92rem; color: var(--text-muted); line-height: 1.4; }
.date-selector { font-size: 1rem; }
.date-selector #participant-date { font-weight: 700; color: var(--text-light); }

/* Section headings with a one-line explanation */
.section-head { margin: 2.25rem 0 1rem; }
.section-head .section-title { margin: 0 0 0.35rem; font-size: 1.05rem; color: var(--text-light); letter-spacing: 1.2px; }
.section-sub { font-size: 0.92rem; color: var(--text-muted); line-height: 1.5; max-width: 80ch; }

/* Sector outlook */
.sector-outlook { padding: 1.5rem 1.75rem; }
.s-left h4 { font-size: 1.25rem; margin-bottom: 0.2rem; }
#sector-freshness { font-size: 0.88rem !important; }
.trend { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.trend-bar { width: 260px; height: 12px; }
.bearish-badge { font-size: 0.95rem; padding: 8px 20px; letter-spacing: 0.5px; }
.sector-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.85rem; }
.sec-card { padding: 1rem 1.1rem; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.08); }
.s-name { font-size: 0.82rem; letter-spacing: 0.7px; font-weight: 600; margin-bottom: 0.4rem; }
.s-val { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Market pulse */
#pulse-status { font-size: 2.1rem !important; }
#pulse-desc { font-size: 1rem !important; line-height: 1.5; max-width: 60ch; }
.pulse-scale { display: flex; justify-content: space-between; font-size: 0.82rem; font-weight: 700; letter-spacing: 1px; color: var(--text-muted); }
.pill-badge { padding: 5px 14px; font-size: 0.85rem; font-weight: 700; border-radius: 999px; white-space: nowrap; }
.pill-badge.amber { background: rgba(245, 158, 11, 0.16); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.35); }

/* Participant cards */
.participant-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
@media (max-width: 1100px) { .participant-grid { grid-template-columns: 1fr; } }
.p-card { padding: 1.6rem 1.7rem; }
.p-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.1rem; }
.p-header h4 { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.5rem; font-size: 1.3rem; }
.p-ico { font-size: 1.25rem; }
.p-sub { font-size: 0.82rem; font-weight: 500; color: var(--text-muted); }
.p-bar { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; background: rgba(255, 255, 255, 0.06); }
.p-bar-bull { background: var(--primary); }
.p-bar-bear { background: var(--danger); }
.p-counts { display: flex; justify-content: space-between; font-size: 0.88rem; font-weight: 600; margin: 0.55rem 0 1rem; }
.p-counts .bull { color: var(--primary); }
.p-counts .bear { color: var(--danger); }
.p-rows { display: flex; flex-direction: column; }
.p-row { display: block; padding: 1rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.p-row:last-child { border-bottom: none; padding-bottom: 0.25rem; }
.p-row-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.r-label { display: flex; flex-direction: column; gap: 3px; }
.r-name { font-size: 1.02rem; font-weight: 700; color: var(--text-main); }
.r-hint { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); }
.r-val { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text-main); }
.r-dir { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.r-dir.bull { color: var(--primary); background: rgba(16, 185, 129, 0.15); }
.r-dir.bear { color: var(--danger); background: rgba(244, 63, 94, 0.15); }
.r-dir.flat { color: var(--text-muted); background: rgba(255, 255, 255, 0.08); }
.p-meter { position: relative; height: 6px; margin-top: 0.75rem; background: rgba(255, 255, 255, 0.06); border-radius: 3px; }
.p-meter::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: rgba(255, 255, 255, 0.3); }
.p-meter-fill { position: absolute; top: 0; bottom: 0; width: 0; left: 50%; border-radius: 3px; background: var(--text-muted); transition: width 0.5s ease, left 0.5s ease; }
.p-meter-fill.bull { background: var(--primary); }
.p-meter-fill.bear { background: var(--danger); }

/* DII reference block */
.dii-panel { margin-top: 2rem; padding: 1.6rem 1.7rem; }
.dii-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 900px) { .dii-grid { grid-template-columns: 1fr; } }
.dii-cell { background: rgba(0, 0, 0, 0.22); border: 1px solid rgba(255, 255, 255, 0.07) !important; border-radius: 10px; padding: 1rem 1.2rem !important; }
.dii-cell:last-child { padding-bottom: 1rem !important; }

/* Home dashboard */
.chart-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.35rem; text-align: center; color: var(--text-muted); font-size: 1rem; pointer-events: none; }
.chart-empty small { font-size: 0.85rem; opacity: 0.85; }
.chart-empty.hidden { display: none; }
.card-header h3 { font-size: 0.95rem !important; }
.card-sub { font-size: 0.8rem !important; }
.card-header .value { font-size: 1.9rem !important; font-variant-numeric: tabular-nums; }
.pos-symbol { font-size: 1.08rem !important; }
.pos-type { font-size: 0.75rem !important; }
.pos-pnl { font-size: 1.15rem !important; font-variant-numeric: tabular-nums; }
.pos-meta, .pos-trail { font-size: 0.84rem !important; }
#engine-feed { font-size: 0.86rem !important; height: 150px !important; line-height: 1.55 !important; }
#engine-feed-state { font-size: 0.8rem !important; font-weight: 700; }
.dash-card .flex-between { font-size: 0.9rem !important; }
#mdl-text { font-size: 0.95rem; }
#market-banner small { font-size: 0.84rem; }
#market-banner .m-state { font-size: 0.95rem; font-weight: 700; }
.sys-status-line { font-size: 0.78rem; line-height: 1.35; }

/* Phase 4b: tighter cards on laptop widths, pill-sized position tag */
.pos-type { display: inline-block; width: auto; align-self: flex-start; }
.p-header { align-items: flex-start; min-height: 2.6rem; }
@media (max-width: 1600px) {
  .p-card { padding: 1.25rem 1.2rem; }
  .p-header h4 { flex-direction: column; align-items: flex-start; gap: 0.1rem; font-size: 1.2rem; }
  .p-sub { font-size: 0.76rem; white-space: nowrap; }
  .r-name { font-size: 0.98rem; }
  .r-hint { font-size: 0.76rem; line-height: 1.3; }
  .r-val { font-size: 1.2rem; white-space: nowrap; flex-shrink: 0; }
  .p-counts { font-size: 0.82rem; }
  .p-row-top { align-items: flex-start; gap: 0.6rem; }
}
.nav-item, .nav-links li { white-space: nowrap; }

/* Phase 4c: Home grid on laptop widths, console spacing */
@media (max-width: 1500px) {
  div.dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  div.dashboard-grid > .chart-card { grid-column: span 2; }
}
.pos-item { gap: 1rem; align-items: flex-start; }
.pos-info .pos-type { align-self: flex-start; }
.pos-stats { text-align: right; min-width: 0; }
.tc-table-title { padding: 1.1rem 1.25rem 0.5rem; font-size: 1.15rem; }
.tc-logs-section { margin-bottom: 2.25rem; }
#panel-console header, #panel-trading header { margin-top: 0.5rem; }

/* ========================================================= */
/* GLOBAL HIGH-LEGIBILITY & FONT SCALING ENHANCEMENT (8503)  */
/* ========================================================= */

/* Lock indicator for unauthenticated navigation */
.lock-indicator {
    font-size: 0.95rem;
    margin-left: auto;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
}
.nav-item.locked-item:hover .lock-indicator {
    opacity: 1;
    transform: scale(1.15);
}
.nav-item.locked-item {
    opacity: 0.85;
}
label, .input-group label, .tc-label {
    font-size: 1.02rem !important;
    font-weight: 700 !important;
    color: #e2e8f0 !important;
    letter-spacing: 0.3px !important;
}

select, input[type="text"], input[type="password"], input[type="number"], .tc-select, .tc-number-input input {
    font-size: 1.05rem !important;
    padding: 0.75rem 1rem !important;
    color: #f8fafc !important;
}

/* Trading Console & Data Tables */
.tc-table th, .data-table th, .q-table th {
    font-size: 1.02rem !important;
    font-weight: 700 !important;
    color: #94a3b8 !important;
    letter-spacing: 0.5px !important;
    padding: 1rem 1.25rem !important;
}

.tc-table td, .data-table td, .q-table td {
    font-size: 1.08rem !important;
    font-weight: 600 !important;
    color: #f1f5f9 !important;
    padding: 1rem 1.25rem !important;
}

.tc-inst {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    color: #ffffff !important;
}

.tc-stepper {
    width: 95px !important;
    height: 38px !important;
}

.tc-stepper span {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
}

.st-btns button {
    height: 19px !important;
    width: 28px !important;
    font-size: 0.85rem !important;
}

.tc-inline-select {
    font-size: 0.95rem !important;
    padding: 0.55rem 0.75rem !important;
    font-weight: 600 !important;
}

.tc-stop-btn {
    font-size: 0.9rem !important;
    padding: 0.45rem 0.9rem !important;
    font-weight: 700 !important;
}

.tc-inst-badge {
    font-size: 0.85rem !important;
    padding: 0.25rem 0.65rem !important;
    font-weight: 700 !important;
}

.tc-live-text {
    font-size: 0.95rem !important;
    font-weight: 800 !important;
}

/* Radio buttons & Mode selection */
.tc-radio-group {
    font-size: 1.05rem !important;
    gap: 2rem !important;
}

.tc-radio-group input[type="radio"] {
    width: 17px !important;
    height: 17px !important;
}

/* Tabs */
.tabs-header .tab {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    padding: 1rem 1.5rem !important;
}

/* Navigation items in Sidebar */
.nav-item {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    padding: 0.85rem 1.25rem !important;
}

.nav-icon {
    font-size: 1.35rem !important;
}

.sidebar-section h3 {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    letter-spacing: 1.2px !important;
    color: #94a3b8 !important;
}

.user-details span#nav-username {
    font-size: 1.08rem !important;
    font-weight: 700 !important;
}

.user-details span#nav-plan {
    font-size: 0.82rem !important;
    font-weight: 800 !important;
}

/* Metrics & Analytics Cards */
.metric-card .label {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.8px !important;
}

.metric-card .value {
    font-size: 2.6rem !important;
    font-weight: 800 !important;
}

/* System Logs / Console terminal */
#console-logs, .terminal-box, .sys-status-line {
    font-size: 0.95rem !important;
    line-height: 1.65 !important;
}

/* Market Mood, Matrix & Confluence Analytics */
.ioc-badge {
    font-size: 0.85rem !important;
    padding: 0.3rem 0.75rem !important;
}

.mood-left h4, .matrix-right h4 {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
}

#matrix-table td, #matrix-table th, .m-row {
    font-size: 1.02rem !important;
    padding: 0.6rem 0.5rem !important;
}

.confluence-box {
    font-size: 1rem !important;
}

.confluence-badge {
    font-size: 1rem !important;
    padding: 0.45rem 1rem !important;
    font-weight: 800 !important;
}

/* Position cards */
.pos-symbol { font-size: 1.18rem !important; font-weight: 700 !important; }
.pos-type { font-size: 0.88rem !important; font-weight: 700 !important; }
.pos-pnl { font-size: 1.28rem !important; font-weight: 800 !important; }
.pos-meta, .pos-trail { font-size: 0.92rem !important; }

/* Subscription Plans cards */
.sub-plan-title h3 { font-size: 1.5rem !important; font-weight: 800 !important; }
.sub-price-rate h2 { font-size: 2.5rem !important; font-weight: 800 !important; }
.sub-features li { font-size: 0.98rem !important; line-height: 1.5 !important; }
.sub-btn { font-size: 1.05rem !important; font-weight: 700 !important; }

/* Market Intelligence Bar & Confluence Badges */
.confluence-bar {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}
.badge-bias {
    font-size: 0.78rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 16px;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
}
.badge-bias.bullish {
    background: rgba(16, 185, 129, 0.18);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
}
.badge-bias.bearish {
    background: rgba(248, 113, 113, 0.18);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.4);
}
.badge-bias.neutral {
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}
.badge-confluence {
    font-size: 0.78rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 16px;
    background: rgba(139, 92, 246, 0.18);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.35);
    letter-spacing: 0.05em;
}

/* Position square off buttons */
.pos-actions {
    display: flex;
    align-items: center;
    margin-left: 0.5rem;
}
.btn-pos-exit {
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-pos-exit:hover {
    background: rgba(239, 68, 68, 0.35);
    color: #fff;
    border-color: #ef4444;
}
.btn-danger-sm:hover {
    background: rgba(239, 68, 68, 0.45) !important;
    color: #fff !important;
}
.header-broker-pill:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}
