/* dashboard.css
 * XPSView dashboard styles
 * Version: 15.1.8
 * Date: 2026-07-17
 * Changes:
 * v15.1.8 (2026-07-17) - M1.3 shell error/empty/freshness classes for shared UX contract.
 * v15.1.3 (2026-07-12) - Force light body/surface text on dark theme for readable contrast.
 * v13.7.4 (2026-04-26) - Ensured perfect tab alignment by moving disabled/coming-soon visuals inside tab bodies and adding consistent status badges for each disabled game tab.
 * v13.7.2 (2026-04-26) - Fixed visual unevenness by anchoring all nav tabs to a fixed height and moving the Millionaire "Coming Soon" note below the tab body.
 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    background: white;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    color: #666;
    font-size: 1.1em;
}

.version-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.version-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: white;
}

.last-updated {
    color: #999;
    font-size: 0.9em;
    margin-top: 10px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.metric-card::after {
    content: '📊 View Frequency →';
    position: absolute;
    bottom: 70px;
    right: 25px;
    font-size: 0.9em;
    color: #667eea;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

/* Show hover text when hovering card, but hide when button area is hovered */
.metric-card:hover::after {
    opacity: 1;
}

/* Static cards (TDP / Group hit rate): no link behavior */
.metric-card-static {
    cursor: default;
}
.metric-card-static:hover {
    transform: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.metric-card-static::after {
    content: none !important;
}

/* Hide hover text when hovering over interactive sections */
.metric-card.interactive-hover::after {
    opacity: 0 !important;
}

.metric-card.buttons-hovered::after {
    opacity: 0 !important;
}

.metric-card h2 {
    color: #667eea;
    font-size: 1.5em;
    margin-bottom: 15px;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.metric-item {
    margin-bottom: 15px;
}

.metric-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.metric-value {
    font-size: 1.2em;
    color: #333;
}

.status-badge {
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    margin-top: 5px;
}

.status-current {
    background: #4caf50;
    color: white;
}

.status-in-progress {
    background: #ff9800;
    color: white;
}

.status-needs-training {
    background: #f44336;
    color: white;
}

.status-missing {
    background: #9e9e9e;
    color: white;
}

.status-pending {
    background: #9e9e9e;
    color: white;
}

.in-progress-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff9800;
    margin-right: 5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.charts-section {
    background: white;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.charts-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 30px;
}

.loading {
    text-align: center;
    padding: 50px;
    color: white;
    font-size: 1.2em;
}

.progress-indicator {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.progress-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.progress-bar-container {
    width: 100%;
    height: 25px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85em;
    font-weight: 600;
}

.progress-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.progress-detail-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 5px;
    border-left: 3px solid #667eea;
}

.progress-detail-label {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
}

.progress-detail-value {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
}

.error {
    background: #f44336;
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.refresh-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-top: 10px;
    transition: background 0.3s ease;
}

.refresh-btn:hover {
    background: #5568d3;
}

.refresh-btn:active {
    transform: scale(0.98);
}

.refresh-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.refresh-label {
    font-size: 0.9em;
    color: #555;
}

.system-summary {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.system-summary h2 {
    color: #333;
    font-size: 1.5em;
    margin-bottom: 15px;
}

.system-summary-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.system-summary-item {
    text-align: center;
    padding: 10px;
}

.system-summary-item-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.system-summary-item-value {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

.drill-down-indicator {
    font-size: 0.8em;
    color: #667eea;
    margin-top: 5px;
    transition: transform 0.3s ease;
}

.system-summary-item[onclick]:hover .drill-down-indicator {
    transform: translateY(2px);
}

.model-drill-down {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #667eea;
    grid-column: 1 / -1;
}

.drill-down-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.drill-down-header h3 {
    color: #333;
    margin: 0;
}

.close-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
}

.close-btn:hover {
    background: #c0392b;
}

.drill-down-content {
    margin-top: 15px;
}

.model-category {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.model-category h4 {
    color: #333;
    margin-bottom: 10px;
}

.model-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.drill-down-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    margin-right: 10px;
    margin-top: 5px;
    text-decoration: none;
    display: inline-block;
}

.drill-down-btn:hover {
    background: #5568d3;
    color: white;
}

.model-details {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #667eea;
    grid-column: 1 / -1;
}

.models-list {
    display: grid;
    gap: 15px;
}

.model-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.model-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.model-header h4 {
    color: #333;
    margin: 0;
}

.status-badge.active {
    background: #2ecc71;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.85em;
}

.status-badge.inactive {
    background: #95a5a6;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.85em;
}

.status-badge.partial {
    background: #f39c12;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.85em;
}

.model-info {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

.model-info div {
    margin-bottom: 5px;
}

.error-text {
    color: #e74c3c;
    margin-top: 5px;
}

.features-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.feature-stat {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

/* Training Features Section */
.training-features-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.features-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    transition: background 0.2s, border-color 0.2s;
    margin-bottom: 0;
}

.features-header:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.features-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95em;
}

.features-toggle {
    font-size: 0.9em;
    color: #667eea;
    transition: transform 0.3s;
}

.features-toggle.expanded {
    transform: rotate(180deg);
}

.features-content {
    display: none;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-top: none;
    border-radius: 0 0 5px 5px;
    margin-top: 0;
}

.features-content.expanded {
    display: block;
}

.feature-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.feature-summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

.feature-summary-label {
    font-size: 0.75em;
    opacity: 0.9;
    margin-bottom: 5px;
}

.feature-summary-value {
    font-size: 1.4em;
    font-weight: bold;
}

.feature-category {
    margin-bottom: 15px;
}

.feature-category h4 {
    color: #667eea;
    font-size: 1em;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e9ecef;
}

.feature-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.feature-item {
    background: white;
    padding: 8px 10px;
    border-radius: 3px;
    border-left: 3px solid #667eea;
    font-size: 0.85em;
    color: #555;
}

.feature-item strong {
    color: #2c3e50;
}

/* Navigation Menu */
.nav-menu {
    background: white;
    border-radius: 10px;
    padding: 15px 30px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #333;
    font-size: 1.5em;
    font-weight: bold;
}

.nav-logo img {
    width: 98px;
    height: auto;
    display: block;
    filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.45));
}

.nav-logo:hover {
    color: #667eea;
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #f5f5f5;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.95em;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.nav-link:hover {
    background: #667eea;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.nav-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.nav-link.active:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3d8a 100%);
}

/* Game tabs: one tab per game in main nav */
.nav-game-tabs {
    flex: 1;
    justify-content: flex-start;
    margin-right: 10px;
}

.nav-game-tab {
    font: inherit;
    cursor: pointer;
    border: 2px solid transparent;
    width: 128px;
    height: 44px;
    justify-content: center;
    text-align: center;
}

.nav-dropdown {
    position: relative;
    display: inline-flex;
}

.nav-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    padding: 14px 8px 8px;
    border-radius: 10px;
    border: 1px solid var(--xps-border);
    background: rgba(15, 23, 42, 0.95);
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.45);
    display: none;
    z-index: 25;
}

.nav-dropdown:hover .nav-submenu,
.nav-dropdown:focus-within .nav-submenu {
    display: block;
}

/* Millionaire For Life temporarily disabled in nav with explicit disabled markup */
.nav-game-tab-disabled {
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.82;
    display: inline-flex !important;
    align-items: center;
    line-height: 1;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-color: rgba(148, 163, 184, 0.42);
    background: rgba(51, 65, 85, 0.78);
}

.nav-tab-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.nav-disabled-icon {
    color: #fcd34d;
    font-size: 0.72rem;
}

.nav-status-chip {
    position: absolute;
    top: 3px;
    right: 5px;
    font-size: 0.54rem;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.66);
    border: 1px solid rgba(148, 163, 184, 0.4);
    color: #dbeafe;
    pointer-events: none;
}

.nav-status-chip.soon {
    color: #fcd34d;
    border-color: rgba(252, 211, 77, 0.55);
    background: rgba(120, 53, 15, 0.45);
}

.nav-status-chip.locked {
    color: #bfdbfe;
    font-weight: 700;
}

.nav-disabled-slot {
    padding-bottom: 0;
}

.nav-disabled-slot .nav-submenu {
    display: none !important;
}

.submenu-link {
    display: block;
    text-decoration: none;
    border-radius: 6px;
    color: var(--xps-muted);
    padding: 8px 10px;
    font-size: 0.86rem;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.submenu-link:hover {
    background: rgba(56, 189, 248, 0.18);
    color: #f8fafc;
}

.nav-secondary .nav-link {
    font-size: 0.9em;
    padding: 8px 14px;
}

/* Nav bar: last xps_recompute_metrics run time */
.nav-last-refresh {
    font-size: 0.85em;
    color: #555;
    background: #f0f0f0;
    padding: 8px 14px;
    border-radius: 6px;
    white-space: nowrap;
    cursor: default;
    border: 1px solid #e0e0e0;
}

.nav-last-refresh:hover {
    background: #e8e8e8;
    color: #333;
}

.nav-job-status {
    margin-top: 4px;
    font-size: 0.75em;
    color: #666;
    background: #f7f7f7;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #ececec;
    max-width: 620px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.35;
}

.nav-job-status .job-prefix {
    color: #555;
    font-weight: 600;
    margin-bottom: 2px;
}

.nav-job-status .job-pill {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.72em;
    font-weight: 700;
    margin-right: 4px;
    border: 1px solid transparent;
}

.nav-job-status .job-pill.ok {
    background: #eaf8ef;
    border-color: #b7e8c8;
    color: #1f7a3f;
}

.nav-job-status .job-pill.warn {
    background: #fff7e6;
    border-color: #ffe0a3;
    color: #8a5a00;
}

.nav-job-status .job-pill.fail {
    background: #fdecec;
    border-color: #f7bcbc;
    color: #b42318;
}

.nav-job-status .job-pill.running {
    background: #e9f2ff;
    border-color: #b7d0ff;
    color: #1f4db8;
}

.nav-job-status .job-pill.none {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #4b5563;
}

.nav-job-status .job-stamp {
    color: #666;
    margin-right: 6px;
}

.nav-job-status .job-sep {
    color: #aaa;
    margin: 0 3px;
}

.nav-job-status .job-line {
    display: block;
    margin-top: 2px;
}

.nav-job-status .job-grid-row {
    display: grid;
    grid-template-columns: 24px 1fr 1fr;
    column-gap: 8px;
    align-items: center;
    margin-top: 2px;
}

.nav-job-status .job-col {
    min-width: 0;
    white-space: nowrap;
}

.nav-job-status .job-col-name {
    font-weight: 700;
    color: #555;
}

#headerVersionAndStatus {
    min-width: 360px;
    max-width: 560px;
}

#headerStatusGroup {
    min-width: 360px;
    max-width: 560px;
    width: 100%;
}

#headerStatusGroup .nav-last-refresh,
#headerStatusGroup .nav-job-status {
    margin-top: 0;
}

/* Quick links for selected game (Frequency, Models, etc.) */
.game-quick-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.game-quick-links .quick-link {
    font-size: 0.9em;
    color: #667eea;
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #667eea;
    background: #f8f9ff;
}

.game-quick-links .quick-link:hover {
    background: #667eea;
    color: white;
}

@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-links {
        width: 100%;
        flex-direction: column;
    }
    
    .nav-link {
        width: 100%;
        justify-content: center;
    }
}

/* Theme refresh: align dashboard with login visual system */
:root {
    --xps-bg-start: #0f172a;
    --xps-bg-mid: #1e3a8a;
    --xps-bg-end: #0ea5e9;
    --xps-surface: rgba(51, 65, 85, 0.62);
    --xps-surface-2: rgba(71, 85, 105, 0.56);
    --xps-border: rgba(191, 219, 254, 0.5);
    --xps-text: #ffffff;
    --xps-muted: #e2ecff;
    --xps-accent: #38bdf8;
    --xps-accent-2: #2563eb;
}

body {
    background: linear-gradient(135deg, var(--xps-bg-start) 0%, var(--xps-bg-mid) 45%, var(--xps-bg-end) 100%);
    color: var(--xps-text);
}

.header,
.metric-card,
.charts-section,
.progress-indicator,
.system-summary,
.model-drill-down,
.model-details,
.nav-menu {
    background: var(--xps-surface) !important;
    border: 1px solid var(--xps-border);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.35) !important;
}

.metric-value-large {
    color: var(--xps-text) !important;
    font-weight: 700;
}

.metric-subtext {
    color: var(--xps-muted) !important;
}

.metric-card-static:hover {
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.35) !important;
}

/* Ensure readable light text on dark surfaces site-wide (avoid inherited #333/#666). */
.container,
.header,
.system-summary,
.charts-section,
.metric-card,
.dpe-table-panel,
.dpe-detail-panel,
.dpe-map-section {
    color: var(--xps-text);
}

.header h1,
.charts-section h2,
.system-summary h2,
.progress-title,
.drill-down-header h3,
.model-category h4,
.model-header h4,
.feature-item strong,
.features-title,
.nav-logo,
.model-info,
.metric-value,
.progress-detail-value {
    color: var(--xps-text) !important;
    text-shadow: 0 1px 1px rgba(2, 6, 23, 0.4);
}

.header p,
.last-updated,
.metric-label,
.progress-detail-label,
.refresh-label,
.system-summary-item-label,
.model-info,
.features-toggle,
.nav-last-refresh,
.nav-job-status,
.game-quick-links .quick-link,
.system-summary-item-value {
    color: var(--xps-muted) !important;
}

.metric-card,
.metric-card * {
    color: var(--xps-text);
}

/* Strong overrides for JS-rendered inline colors in primary intelligence view */
#intelligenceContent [style*="color:#333"],
#intelligenceContent [style*="color: #333"],
#intelligenceContent [style*="color:#444"],
#intelligenceContent [style*="color: #444"] {
    color: var(--xps-text) !important;
}

#intelligenceContent [style*="color:#555"],
#intelligenceContent [style*="color: #555"],
#intelligenceContent [style*="color:#666"],
#intelligenceContent [style*="color: #666"],
#intelligenceContent [style*="color:#777"],
#intelligenceContent [style*="color: #777"] {
    color: var(--xps-muted) !important;
}

.metric-card h2,
.feature-category h4,
.drill-down-indicator {
    color: var(--xps-accent) !important;
    border-color: var(--xps-accent) !important;
}

.metric-card::after {
    color: var(--xps-accent) !important;
}

.version-badge,
.progress-bar,
.feature-summary-card,
.nav-link.active {
    background: linear-gradient(135deg, var(--xps-accent-2) 0%, var(--xps-accent) 100%) !important;
    color: #eaf8ff !important;
}

.refresh-btn,
.drill-down-btn {
    background: linear-gradient(135deg, var(--xps-accent-2) 0%, var(--xps-accent) 100%) !important;
    color: #eaf8ff !important;
}

.refresh-btn:hover,
.drill-down-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #0ea5e9 100%) !important;
}

.nav-link {
    background: var(--xps-surface-2) !important;
    color: #e2e8f0 !important;
    border: 1px solid var(--xps-border) !important;
}

.nav-link:hover {
    background: rgba(56, 189, 248, 0.18) !important;
    color: #eaf8ff !important;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.22) !important;
}

.nav-last-refresh,
.nav-job-status,
.progress-detail-item,
.feature-item,
.features-header,
.features-content,
.model-item,
.model-category,
.feature-stat,
.progress-bar-container {
    background: rgba(51, 65, 85, 0.46) !important;
    border-color: var(--xps-border) !important;
}

.game-quick-links .quick-link {
    background: rgba(30, 58, 138, 0.2) !important;
    border-color: rgba(56, 189, 248, 0.45) !important;
}

.game-quick-links .quick-link:hover {
    background: rgba(56, 189, 248, 0.24) !important;
    color: #eaf8ff !important;
}

.error {
    background: rgba(239, 68, 68, 0.2) !important;
    border: 1px solid rgba(248, 113, 113, 0.55);
    color: #fecaca !important;
}

/* Cross-page consistency for specialized dashboard templates */
.exec-panel,
.exec-toggle,
.tab-nav,
.filter-row,
.summary-card,
.chart-container,
#trainingEmptyState,
#accuracyEmptyState,
#mlMetricsSection,
#replayEmptyState,
.run-selection,
#replayContent .section,
#replayContent .metric-card {
    background: rgba(30, 41, 59, 0.62) !important;
    border: 1px solid var(--xps-border) !important;
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.28) !important;
    color: var(--xps-text) !important;
}

.exec-panel h2,
.tab-nav button.active {
    color: var(--xps-accent) !important;
    border-color: var(--xps-accent) !important;
}

.exec-metrics-table th {
    background: rgba(30, 58, 138, 0.3) !important;
    color: #dbeafe !important;
    border-bottom-color: var(--xps-border) !important;
}

.exec-metrics-table td {
    border-bottom-color: rgba(148, 163, 184, 0.18) !important;
}

.exec-badge.good {
    background: rgba(34, 197, 94, 0.2) !important;
    color: #bbf7d0 !important;
}

.exec-badge.warn {
    background: rgba(251, 191, 36, 0.22) !important;
    color: #fde68a !important;
}

.exec-badge.neutral {
    background: rgba(148, 163, 184, 0.22) !important;
    color: #cbd5e1 !important;
}

.tab-nav {
    border-bottom-color: rgba(148, 163, 184, 0.3) !important;
}

.tab-nav button {
    color: var(--xps-muted) !important;
}

.tab-nav button:hover {
    color: var(--xps-text) !important;
}

.summary-card h4,
.chart-container h3,
#content label,
#replayContent label,
#execContent label {
    color: var(--xps-muted) !important;
}

.summary-card .value,
#replayContent [id$="Rate"],
#replayContent [id^="draws"] {
    color: var(--xps-text) !important;
}

#content select,
#replayContent select,
#execContent select {
    background: rgba(30, 41, 59, 0.56) !important;
    color: var(--xps-text) !important;
    border: 1px solid var(--xps-border) !important;
}

#execContent p,
#replayContent p,
#content p,
#execRecommendations,
#runInfo,
#hitDistributionContent {
    color: var(--xps-muted) !important;
}

/* Override inline light surfaces still used in some templates */
#replayContent [style*="background: white"],
#replayContent [style*="background: #f8f9fa"],
#replayContent [style*="background: #f5f5f5"],
#execContent [style*="background: white"],
#execContent [style*="background: #f8f9fa"],
#content [style*="background: #f8f9fa"] {
    background: rgba(30, 41, 59, 0.62) !important;
    border: 1px solid var(--xps-border) !important;
}

#replayContent [style*="color: #666"],
#replayContent [style*="color:#666"],
#execContent [style*="color: #666"],
#execContent [style*="color:#666"],
#content [style*="color: #666"],
#content [style*="color:#666"],
#execContent [style*="color:#333"] {
    color: var(--xps-muted) !important;
}

#replayContent [style*="background: #667eea"],
#replayContent [style*="background:#667eea"] {
    background: linear-gradient(135deg, var(--xps-accent-2) 0%, var(--xps-accent) 100%) !important;
    color: #eaf8ff !important;
}

/* M1.3 shared shell: error / empty states (dashboard_shell.js) */
.xps-shell-error {
    background: #fff5f5;
    border: 1px solid #f5c2c7;
    border-radius: 8px;
    padding: 14px 16px;
    color: #842029;
    margin: 12px 0;
}
.xps-shell-error-title {
    font-weight: 700;
    margin-bottom: 6px;
}
.xps-shell-error-body {
    font-size: 0.95em;
    margin-bottom: 6px;
}
.xps-shell-error-hint {
    font-size: 0.85em;
    opacity: 0.9;
}
.xps-shell-retry {
    margin-top: 10px;
    padding: 8px 14px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    color: #842029;
    background: #fff;
    border: 1px solid #f5c2c7;
    border-radius: 6px;
}
.xps-shell-retry:hover,
.xps-shell-retry:focus {
    background: #fff5f5;
    outline: 2px solid #842029;
    outline-offset: 2px;
}
.xps-shell-empty {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 16px;
    color: #475569;
    margin: 12px 0;
}
.xps-shell-empty-title {
    font-weight: 700;
    margin-bottom: 6px;
    color: #334155;
}
.xps-shell-freshness {
    font-size: 0.9em;
    color: #64748b;
}








