/* =============================================
   PSS EVALUATION DASHBOARD — style.css
   Global styles + Language Toggle + Tooltip
   ============================================= */

:root {
    --blue-primary: #1a56db;
    --blue-dark: #1e3a8a;
    --blue-light: #dbeafe;
    --blue-mid: #3b82f6;
    --teal: #0891b2;
    --indigo: #4f46e5;
    --sky: #0284c7;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-400: #94a3b8;
    --gray-600: #475569;
    --gray-800: #1e293b;
    --sidebar-width: 240px;
    --topbar-height: 70px;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 20px rgba(26,86,219,0.12);
}

* { margin:0; padding:0; box-sizing:border-box; }

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    display: flex;
    min-height: 100vh;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--blue-dark);
    height: 100vh;
    position: fixed;
    left:0; top:0;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    z-index: 100;
    overflow: hidden;
}
.sidebar.collapsed { width: 68px; }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .footer-badge span,
.sidebar.collapsed .lang-toggle-sidebar { display: none; }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-icon {
    width:40px; height:40px;
    background: var(--blue-primary);
    border-radius: 10px;
    display:flex; align-items:center; justify-content:center;
    color: white; font-size:16px; flex-shrink:0;
}
.brand-title { display:block; color:white; font-weight:600; font-size:15px; line-height:1.2; }
.brand-sub { display:block; color:rgba(255,255,255,0.45); font-size:11px; }

/* ── Language Toggle in Sidebar ── */
.lang-toggle-sidebar {
    margin: 12px 16px;
    display: flex;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 4px;
    gap: 3px;
}
.lang-btn-sidebar {
    flex: 1;
    padding: 7px 0;
    border: none;
    background: transparent;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    color: rgba(255,255,255,0.45);
    font-family: 'DM Sans', sans-serif;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}
.lang-btn-sidebar:hover { color: rgba(255,255,255,0.75); }
.lang-btn-sidebar.lang-active {
    background: white;
    color: var(--blue-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.sidebar-nav {
    flex:1;
    padding: 8px 10px;
    overflow-y: auto;
}
.nav-label {
    color: rgba(255,255,255,0.3);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.2px;
    padding: 8px 8px 4px;
    white-space: nowrap;
}
.nav-item {
    display:flex; align-items:center; gap:12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 2px;
    transition: all 0.2s;
    white-space: nowrap;
}
.nav-item i { width:18px; text-align:center; flex-shrink:0; }
.nav-item:hover { background:rgba(255,255,255,0.08); color:white; }
.nav-item.active { background:var(--blue-primary); color:white; font-weight:500; }

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.footer-badge {
    display:flex; align-items:center; gap:8px;
    color: rgba(255,255,255,0.4); font-size:11px;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    margin-left: var(--sidebar-width);
    flex:1; min-height:100vh;
    transition: margin-left 0.3s ease;
}
.main-content.expanded { margin-left: 68px; }

/* ========== TOPBAR ========== */
.topbar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display:flex; align-items:center; justify-content:space-between;
    padding: 0 32px;
    position: sticky; top:0; z-index:50;
}
.topbar-left { display:flex; align-items:center; gap:16px; }
.toggle-btn {
    width:36px; height:36px;
    border:none; background:var(--gray-100);
    border-radius:8px; cursor:pointer;
    color:var(--gray-600); font-size:14px;
    transition: background 0.2s;
}
.toggle-btn:hover { background:var(--gray-200); }
.page-title h1 {
    font-family: 'DM Serif Display', serif;
    font-size:20px; color:var(--gray-800); line-height:1.2;
}
.page-title span { font-size:12px; color:var(--gray-400); }
.date-badge {
    display:flex; align-items:center; gap:8px;
    background:var(--blue-light); color:var(--blue-primary);
    padding: 8px 14px; border-radius:20px;
    font-size:13px; font-weight:500;
}

/* ========== HERO SECTION ========== */
.hero-section {
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-primary) 100%);
    margin: 24px 32px;
    border-radius: 16px;
    padding: 40px 48px;
    display:flex; align-items:center; justify-content:space-between; gap:32px;
    overflow:hidden; position:relative;
}
.hero-section::before {
    content:''; position:absolute; top:-40px; right:-40px;
    width:200px; height:200px;
    background:rgba(255,255,255,0.04); border-radius:50%;
}
.hero-tag {
    display:inline-block;
    background:rgba(255,255,255,0.15); color:rgba(255,255,255,0.85);
    padding:4px 12px; border-radius:20px;
    font-size:11px; font-weight:500; letter-spacing:0.5px; margin-bottom:16px;
}
.hero-text h2 {
    font-family:'DM Serif Display',serif;
    font-size:30px; color:white; line-height:1.3; margin-bottom:12px;
}
.hero-text h2 span { color:#93c5fd; }
.hero-text p {
    color:rgba(255,255,255,0.7); font-size:14px; line-height:1.6;
    max-width:380px; margin-bottom:24px;
}
.btn-primary {
    display:inline-flex; align-items:center; gap:8px;
    background:white; color:var(--blue-primary);
    padding:11px 24px; border-radius:8px;
    font-size:14px; font-weight:600; text-decoration:none;
    transition:all 0.2s; box-shadow:0 4px 12px rgba(0,0,0,0.15);
}
.btn-primary:hover { transform:translateY(-1px); box-shadow:0 6px 20px rgba(0,0,0,0.2); }

/* ========== CYCLE DIAGRAM ========== */
.hero-visual { flex-shrink:0; }
.cycle-diagram {
    width:200px; height:200px; position:relative;
    display:flex; align-items:center; justify-content:center;
}
.cycle-center {
    width:72px; height:72px;
    background:rgba(255,255,255,0.15); border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    text-align:center; color:white; font-size:11px; font-weight:600; line-height:1.3;
    border:2px solid rgba(255,255,255,0.25);
}
.cycle-item { position:absolute; display:flex; flex-direction:column; align-items:center; gap:4px; }
.cycle-item span { color:rgba(255,255,255,0.8); font-size:10px; font-weight:500; white-space:nowrap; }
.cycle-item.top { top:0; left:50%; transform:translateX(-50%); }
.cycle-item.right { right:0; top:50%; transform:translateY(-50%); }
.cycle-item.bottom { bottom:0; left:50%; transform:translateX(-50%); }
.cycle-item.left { left:0; top:50%; transform:translateY(-50%); }
.cycle-dot { width:28px; height:28px; border-radius:50%; border:3px solid rgba(255,255,255,0.3); animation:pulse 2s infinite; }
.cycle-dot.planning { background:#60a5fa; animation-delay:0s; }
.cycle-dot.development { background:#34d399; animation-delay:0.5s; }
.cycle-dot.implementation { background:#f59e0b; animation-delay:1s; }
.cycle-dot.operation { background:#f87171; animation-delay:1.5s; }
@keyframes pulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.15);opacity:0.8} }

/* ========== STATS GRID ========== */
.stats-grid {
    display:grid; grid-template-columns:repeat(4,1fr);
    gap:16px; padding:0 32px; margin-bottom:32px;
}
.stat-card {
    background:white; border-radius:var(--radius);
    padding:20px; display:flex; align-items:center; gap:16px;
    box-shadow:var(--shadow); transition:transform 0.2s;
}
.stat-card:hover { transform:translateY(-2px); }
.stat-icon {
    width:48px; height:48px; border-radius:10px;
    display:flex; align-items:center; justify-content:center;
    font-size:18px; flex-shrink:0;
}
.stat-icon.blue { background:#dbeafe; color:var(--blue-primary); }
.stat-icon.teal { background:#cffafe; color:var(--teal); }
.stat-icon.indigo { background:#e0e7ff; color:var(--indigo); }
.stat-icon.sky { background:#e0f2fe; color:var(--sky); }
.stat-info h3 { font-family:'DM Serif Display',serif; font-size:26px; color:var(--gray-800); line-height:1; }
.stat-info p { font-size:12px; color:var(--gray-400); margin-top:2px; }

/* ========== SECTION TITLE ========== */
.section-title { padding:0 32px; margin-bottom:16px; }
.section-title h3 { font-family:'DM Serif Display',serif; font-size:20px; color:var(--gray-800); }
.section-title p { font-size:13px; color:var(--gray-400); margin-top:2px; }

/* ========== PHASES GRID ========== */
.phases-grid {
    display:grid; grid-template-columns:repeat(4,1fr);
    gap:16px; padding:0 32px 32px;
}
.phase-card {
    background:white; border-radius:var(--radius);
    padding:24px 20px; box-shadow:var(--shadow);
    cursor:pointer; transition:all 0.2s;
    border:2px solid transparent;
}
.phase-card:hover { border-color:var(--blue-primary); transform:translateY(-3px); box-shadow:var(--shadow-md); }
.phase-number { font-size:36px; font-family:'DM Serif Display',serif; color:var(--gray-200); line-height:1; margin-bottom:8px; }
.phase-icon {
    width:40px; height:40px; border-radius:8px;
    display:flex; align-items:center; justify-content:center;
    font-size:16px; margin-bottom:12px;
}
.planning-icon { background:#dbeafe; color:#2563eb; }
.development-icon { background:#d1fae5; color:#059669; }
.implementation-icon { background:#fef3c7; color:#d97706; }
.operation-icon { background:#fee2e2; color:#dc2626; }
.phase-card h4 { font-size:15px; font-weight:600; color:var(--gray-800); margin-bottom:6px; }
.phase-card p { font-size:12px; color:var(--gray-400); line-height:1.5; margin-bottom:12px; }
.phase-tag {
    display:inline-block; background:var(--blue-light); color:var(--blue-primary);
    padding:3px 10px; border-radius:20px; font-size:11px; font-weight:500;
}

/* ========== TOOLTIP SYSTEM ========== */
.tooltip-wrapper { position:relative; display:inline-flex; align-items:center; }

.tooltip-icon {
    width:18px; height:18px;
    background: rgba(26,86,219,0.12);
    color: var(--blue-primary);
    border-radius:50%;
    display:inline-flex; align-items:center; justify-content:center;
    font-size:10px; font-weight:700;
    cursor:pointer; margin-left:6px; flex-shrink:0;
    border: 1.5px solid rgba(26,86,219,0.2);
    transition: all 0.2s;
    user-select:none;
}
.tooltip-icon:hover { background:var(--blue-primary); color:white; border-color:var(--blue-primary); }

.tooltip-box {
    visibility:hidden; opacity:0;
    position:absolute;
    bottom: calc(100% + 10px);
    left:50%; transform:translateX(-50%);
    width:300px;
    background: var(--gray-800);
    color:white;
    border-radius:12px;
    padding:14px 16px;
    font-size:12px; line-height:1.6;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    z-index:999;
    pointer-events:none;
    transition: opacity 0.2s, visibility 0.2s;
    text-align:left;
}
.tooltip-box::after {
    content:'';
    position:absolute;
    top:100%; left:50%; transform:translateX(-50%);
    border:6px solid transparent;
    border-top-color: var(--gray-800);
}

/* Split tooltip content by || */
.tooltip-section { margin-bottom:8px; }
.tooltip-section:last-child { margin-bottom:0; }
.tooltip-term { font-weight:700; color:#93c5fd; font-size:11px; display:block; margin-bottom:2px; }
.tooltip-desc { color:rgba(255,255,255,0.85); font-size:11px; }

/* Show on hover (desktop) */
.tooltip-wrapper:hover .tooltip-box { visibility:visible; opacity:1; }
/* Show on click (mobile) */
.tooltip-box.active { visibility:visible !important; opacity:1 !important; }

/* Smart positioning — flip to bottom when near top of screen */
.tooltip-box.flip-bottom {
    bottom:auto; top:calc(100% + 10px);
}
.tooltip-box.flip-bottom::after {
    top:auto; bottom:100%;
    border-top-color:transparent; border-bottom-color:var(--gray-800);
}

/* ========== RESPONSIVE ========== */
@media (max-width:1024px) {
    .stats-grid { grid-template-columns:repeat(2,1fr); }
    .phases-grid { grid-template-columns:repeat(2,1fr); }
    .hero-visual { display:none; }
}
@media (max-width:768px) {
    .sidebar { width:68px; }
    .main-content { margin-left:68px; }
    .stats-grid { grid-template-columns:repeat(2,1fr); padding:0 16px; }
    .phases-grid { grid-template-columns:1fr; padding:0 16px 16px; }
    .hero-section { margin:16px; padding:24px; }
    .tooltip-box { width:260px; left:auto; right:0; transform:none; }
    .tooltip-box::after { left:auto; right:16px; transform:none; }
}

/* =============================================
   DARK MODE + TOOLTIP FIX
   Append this to the BOTTOM of style.css
   ============================================= */

/* ── Dark Mode Variable Overrides ── */
[data-theme="dark"] {
    --white: #1e293b;
    --gray-50: #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-400: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-800: #f1f5f9;
}

[data-theme="dark"] body { background: var(--gray-50); color: var(--gray-800); }
[data-theme="dark"] .topbar { background: #1e293b; border-bottom-color: #334155; }
[data-theme="dark"] .page-title h1 { color: #f1f5f9; }
[data-theme="dark"] .page-title span { color: #94a3b8; }
[data-theme="dark"] .toggle-btn { background: #334155; color: #cbd5e1; }
[data-theme="dark"] .toggle-btn:hover { background: #475569; }
[data-theme="dark"] .date-badge { background: rgba(26,86,219,0.2); color: #93c5fd; }

[data-theme="dark"] .stat-card,
[data-theme="dark"] .phase-card,
[data-theme="dark"] .form-group,
[data-theme="dark"] .step-header,
[data-theme="dark"] .step-progress,
[data-theme="dark"] .indicator-preview,
[data-theme="dark"] .chart-card,
[data-theme="dark"] .sw-card,
[data-theme="dark"] .detail-group,
[data-theme="dark"] .history-table-wrap,
[data-theme="dark"] .hstat-card,
[data-theme="dark"] .um-section,
[data-theme="dark"] .um-step,
[data-theme="dark"] .um-faq,
[data-theme="dark"] .about-section,
[data-theme="dark"] .ind-overview-card,
[data-theme="dark"] .aspect-card,
[data-theme="dark"] .score-card,
[data-theme="dark"] .manual-step-card,
[data-theme="dark"] .modal-box {
    background: #1e293b !important;
    border-color: #334155 !important;
}

[data-theme="dark"] .phase-card h4,
[data-theme="dark"] .stat-info h3,
[data-theme="dark"] .step-header h2,
[data-theme="dark"] .section-title h3,
[data-theme="dark"] .chart-card-title,
[data-theme="dark"] .detail-group-name,
[data-theme="dark"] .sw-title,
[data-theme="dark"] .history-table-title,
[data-theme="dark"] td, [data-theme="dark"] th,
[data-theme="dark"] .ind-name,
[data-theme="dark"] .customize-info-text .ind-name,
[data-theme="dark"] .um-step-title, [data-theme="dark"] .um-faq-q,
[data-theme="dark"] h3, [data-theme="dark"] h4 {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .phase-card p,
[data-theme="dark"] .stat-info p,
[data-theme="dark"] .step-header p,
[data-theme="dark"] .section-title p,
[data-theme="dark"] .chart-card-desc,
[data-theme="dark"] .detail-group-meta {
    color: #94a3b8 !important;
}

[data-theme="dark"] .form-input {
    background: #0f172a; border-color: #334155; color: #f1f5f9;
}
[data-theme="dark"] .indicator-group .ind-preview-row,
[data-theme="dark"] .customize-row,
[data-theme="dark"] .sw-item,
[data-theme="dark"] .um-page-card,
[data-theme="dark"] .manual-page-card {
    background: #0f172a !important; border-color: #334155 !important;
}
[data-theme="dark"] .scoring-table tbody tr:hover,
[data-theme="dark"] .detail-table tbody tr:hover,
[data-theme="dark"] .history-table tbody tr:hover {
    background: #0f172a !important;
}
[data-theme="dark"] .sidebar { background: #0f172a; }
[data-theme="dark"] .main-content { background: #0a0e1a; }

/* ── Theme Toggle Button (Topbar) ── */
.theme-toggle-btn {
    width: 36px; height: 36px;
    border: none; background: var(--gray-100);
    border-radius: 8px; cursor: pointer;
    color: var(--gray-600); font-size: 14px;
    transition: background 0.2s; margin-right: 10px;
}
.theme-toggle-btn:hover { background: var(--gray-200); }

/* ── Tooltip Overflow Fix ── */
.tooltip-box {
    width: 280px;
    max-width: min(280px, 80vw);
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.tooltip-wrapper { position: relative; }
.indicator-group, .customize-group, .scoring-table-wrap {
    overflow: visible !important;
}
.indicator-preview, .scoring-table-wrap, .customize-list {
    overflow-x: visible;
}


/* =============================================
   MASTER FIX — Append this entire block to the
   BOTTOM of assets/css/style.css
   ============================================= */

/* ── Logo in Sidebar Brand ── */
.brand-icon {
    width: 40px; height: 40px;
    background: white;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    padding: 4px;
}
.brand-logo-img {
    width: 100%; height: 100%;
    object-fit: contain;
}

/* ── Dark Mode Toggle Button in Sidebar Footer ── */
.sidebar-footer {
    padding: 14px 16px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.theme-toggle-sidebar-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    background: rgba(255,255,255,0.08);
    border: none;
    border-radius: 8px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.2s;
}
.theme-toggle-sidebar-btn:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}
.theme-toggle-sidebar-btn.dark-active {
    background: rgba(251,191,36,0.15);
    color: #fbbf24;
}
.theme-toggle-sidebar-btn i { width: 16px; text-align: center; }
.sidebar.collapsed .theme-toggle-sidebar-btn span { display: none; }

/* ===============================================
   TOOLTIP OVERFLOW FIX — robust version
   =============================================== */
.tooltip-wrapper {
    position: relative;
    display: inline-flex;
    z-index: 10;
}
.tooltip-box {
    visibility: hidden;
    opacity: 0;
    position: fixed;
    width: 300px;
    max-width: min(300px, 90vw);
    background: #1e293b;
    color: #f1f5f9;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 12px;
    line-height: 1.6;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    z-index: 9999;
    pointer-events: none;
    transition: opacity 0.15s;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.tooltip-box.active {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto;
}
.tooltip-term { color: #93c5fd; font-weight: 700; }
.tooltip-desc { color: #e2e8f0; }

/* ===============================================
   DARK MODE — FULL CONTRAST OVERHAUL
   =============================================== */
[data-theme="dark"] {
    --white: #1e293b;
    --gray-50: #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-400: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-800: #f1f5f9;
}

[data-theme="dark"] body { background: #0a0e1a; color: #e2e8f0; }
[data-theme="dark"] .main-content { background: #0a0e1a; }
[data-theme="dark"] .topbar { background: #131b2e; border-bottom-color: #243044; }
[data-theme="dark"] .page-title h1 { color: #f8fafc; }
[data-theme="dark"] .page-title span { color: #94a3b8; }
[data-theme="dark"] .toggle-btn { background: #1e293b; color: #cbd5e1; }
[data-theme="dark"] .toggle-btn:hover { background: #334155; }
[data-theme="dark"] .date-badge { background: rgba(59,130,246,0.15); color: #93c5fd; }

/* Cards & containers */
[data-theme="dark"] .stat-card,
[data-theme="dark"] .phase-card,
[data-theme="dark"] .form-group,
[data-theme="dark"] .step-header,
[data-theme="dark"] .step-progress,
[data-theme="dark"] .indicator-preview,
[data-theme="dark"] .chart-card,
[data-theme="dark"] .sw-card,
[data-theme="dark"] .detail-group,
[data-theme="dark"] .history-table-wrap,
[data-theme="dark"] .hstat-card,
[data-theme="dark"] .um-section,
[data-theme="dark"] .um-step,
[data-theme="dark"] .um-faq,
[data-theme="dark"] .about-section,
[data-theme="dark"] .ind-overview-card,
[data-theme="dark"] .aspect-card,
[data-theme="dark"] .score-card,
[data-theme="dark"] .manual-step-card,
[data-theme="dark"] .modal-box,
[data-theme="dark"] .code-gate,
[data-theme="dark"] .compare-eval-card,
[data-theme="dark"] .compare-chart-card,
[data-theme="dark"] .compare-table-wrap,
[data-theme="dark"] .chart-interpretation-box,
[data-theme="dark"] .framework-comp,
[data-theme="dark"] .step-timeline-content,
[data-theme="dark"] .um-page-card,
[data-theme="dark"] .access-choice-card {
    background: #141d2e !important;
    border-color: #2a374d !important;
}

/* Headings & primary text */
[data-theme="dark"] .phase-card h4,
[data-theme="dark"] .stat-info h3,
[data-theme="dark"] .step-header h2,
[data-theme="dark"] .section-title h3,
[data-theme="dark"] .chart-card-title,
[data-theme="dark"] .detail-group-name,
[data-theme="dark"] .sw-title,
[data-theme="dark"] .history-table-title,
[data-theme="dark"] td, [data-theme="dark"] th,
[data-theme="dark"] .ind-name,
[data-theme="dark"] .customize-info-text .ind-name,
[data-theme="dark"] .um-step-title, [data-theme="dark"] .um-faq-q,
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3, [data-theme="dark"] h4,
[data-theme="dark"] .result-company-name,
[data-theme="dark"] .compare-eval-score,
[data-theme="dark"] .about-hero-content h2,
[data-theme="dark"] .step-timeline-content h4,
[data-theme="dark"] label,
[data-theme="dark"] .form-group label span:not([style]),
[data-theme="dark"] .access-choice-card h4,
[data-theme="dark"] .diag-card h4 {
    color: #f1f5f9 !important;
}

/* Secondary / muted text */
[data-theme="dark"] .phase-card p,
[data-theme="dark"] .stat-info p,
[data-theme="dark"] .step-header p,
[data-theme="dark"] .section-title p,
[data-theme="dark"] .chart-card-desc,
[data-theme="dark"] .detail-group-meta,
[data-theme="dark"] .diag-card p,
[data-theme="dark"] .access-choice-card p,
[data-theme="dark"] .about-section-header p,
[data-theme="dark"] .um-sec-hdr p,
[data-theme="dark"] .manual-step-body p,
[data-theme="dark"] .ind-bar-label,
[data-theme="dark"] .framework-comp p {
    color: #94a3b8 !important;
}

/* Inputs */
[data-theme="dark"] .form-input,
[data-theme="dark"] .code-gate-input,
[data-theme="dark"] .history-search {
    background: #0f172a; border-color: #334155; color: #f1f5f9;
}
[data-theme="dark"] .form-input::placeholder { color: #64748b; }

/* Indicator rows */
[data-theme="dark"] .indicator-group .ind-preview-row,
[data-theme="dark"] .customize-row,
[data-theme="dark"] .sw-item,
[data-theme="dark"] .diag-card,
[data-theme="dark"] .ind-cat-tag,
[data-theme="dark"] .indicator-category {
    background: #0f172a !important; border-color: #334155 !important;
    color: #cbd5e1 !important;
}
[data-theme="dark"] .scoring-table tbody tr:hover,
[data-theme="dark"] .detail-table tbody tr:hover,
[data-theme="dark"] .history-table tbody tr:hover {
    background: #0f172a !important;
}
[data-theme="dark"] .scoring-table thead tr { background: #0a0e1a; }
[data-theme="dark"] .scoring-table tbody tr,
[data-theme="dark"] .detail-table tbody tr,
[data-theme="dark"] .history-table tbody tr {
    border-bottom-color: #243044 !important;
}
[data-theme="dark"] .score-desc-row td { background: #0f172a !important; }
[data-theme="dark"] .score-desc-text { color: #cbd5e1 !important; }
[data-theme="dark"] .score-desc-placeholder { color: #475569 !important; }

/* Sidebar / nav unaffected since it's already dark, but ensure good contrast always */
[data-theme="dark"] .sidebar { background: #0a0e1a; }
[data-theme="dark"] .nav-item { color: rgba(255,255,255,0.65); }
[data-theme="dark"] .nav-item:hover { background: rgba(255,255,255,0.06); }

/* Radio labels / score badges keep their own colors — ensure number visible */
[data-theme="dark"] .radio-label span { background: #1e293b; border-color: #334155; color: #94a3b8; }

/* Tags / pills general */
[data-theme="dark"] .criteria-tag,
[data-theme="dark"] .phase-tag,
[data-theme="dark"] .scope-tag,
[data-theme="dark"] .persp-pill,
[data-theme="dark"] .ind-cat-tag,
[data-theme="dark"] .group-criteria-tag {
    filter: brightness(1.15);
}

/* Info / customize boxes */
[data-theme="dark"] .info-box {
    background: rgba(59,130,246,0.1) !important;
    border-color: rgba(59,130,246,0.3) !important;
    color: #93c5fd !important;
}
[data-theme="dark"] .customize-info {
    background: rgba(251,191,36,0.1) !important;
    border-color: rgba(251,191,36,0.3) !important;
    color: #fcd34d !important;
}
[data-theme="dark"] .um-tip,
[data-theme="dark"] .manual-tip-box {
    background: rgba(59,130,246,0.1) !important;
    border-color: rgba(59,130,246,0.3) !important;
}
[data-theme="dark"] .manual-tip-box p,
[data-theme="dark"] .um-tip p { color: #cbd5e1 !important; }

/* Code gate / access bar */
[data-theme="dark"] .code-active-bar {
    background: rgba(59,130,246,0.1) !important;
    border-color: rgba(59,130,246,0.3) !important;
}
[data-theme="dark"] .code-active-info { color: #93c5fd !important; }

/* Detail table description text */
[data-theme="dark"] .td-desc, [data-theme="dark"] .td-ind, [data-theme="dark"] .td-sub {
    color: #cbd5e1 !important;
}

/* Empty states */
[data-theme="dark"] .empty-state, [data-theme="dark"] .loading-state,
[data-theme="dark"] .history-empty, [data-theme="dark"] .result-empty,
[data-theme="dark"] .compare-empty {
    color: #64748b !important;
}

/* Chart canvas backgrounds stay transparent, Chart.js text handled via JS options already light */

/* ── Result Interpretation Banner ── */
.interpretation-banner {
    margin: 16px 32px 0;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 16px 20px;
}
.interpretation-icon {
    width: 36px; height: 36px;
    background: #1a56db; color: white;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0;
}
.interpretation-label {
    font-size: 11px; font-weight: 700; color: #1a56db;
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px;
}
.interpretation-text p { font-size: 13px; color: #1e3a8a; line-height: 1.6; }
[data-theme="dark"] .interpretation-banner { background: rgba(59,130,246,0.1) !important; border-color: rgba(59,130,246,0.3) !important; }
[data-theme="dark"] .interpretation-text p { color: #93c5fd !important; }

/* ── Chart Mini Interpretation ── */
.chart-mini-interpretation {
    display: flex; align-items: flex-start; gap: 8px;
    margin-top: 14px; padding-top: 14px;
    border-top: 1px dashed #e2e8f0;
    font-size: 12px; color: #64748b; line-height: 1.6;
}
.chart-mini-interpretation i { color: #d97706; flex-shrink: 0; margin-top: 1px; }
[data-theme="dark"] .chart-mini-interpretation { border-top-color: #334155; color: #94a3b8 !important; }

/* ── Chart Interpretation Box (Full) ── */
.chart-interpretation-box {
    margin: 0 32px 0;
    background: white;
    border-radius: 14px;
    padding: 24px 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border-left: 4px solid #7c3aed;
}
.cib-header {
    display: flex; align-items: center; gap: 10px;
    font-size: 15px; font-weight: 700; color: #1e293b;
    margin-bottom: 14px;
}
.cib-header i { color: #7c3aed; }
.cib-body p { font-size: 13px; color: #475569; line-height: 1.7; margin-bottom: 10px; }
.cib-body p:last-child { margin-bottom: 0; }
[data-theme="dark"] .chart-interpretation-box { background: #141d2e !important; }
[data-theme="dark"] .cib-header { color: #f1f5f9 !important; }
[data-theme="dark"] .cib-body p { color: #cbd5e1 !important; }

/* =============================================
   DARK MODE FIX PART 3 — HISTORY TABLE HEADER
   Append this to the BOTTOM of assets/css/style.css
   ============================================= */

[data-theme="dark"] .history-table thead tr {
    background: #0a1428 !important;
}
[data-theme="dark"] .history-table th {
    color: #93c5fd !important;
}
[data-theme="dark"] .history-table-header {
    border-bottom-color: #243044 !important;
}

/* =============================================
   DARK MODE FIX PART 5 — FINAL PATCH
   Append this to the VERY BOTTOM of assets/css/style.css
   (must be AFTER part 1, 2, 3, 4)
   ============================================= */

/* ── Section Titles: force bright white ── */
[data-theme="dark"] .result-section-title,
[data-theme="dark"] .result-section-title span {
    color: #ffffff !important;
}

/* ── Detail Group Header (the clickable "Economic" / "Environmental" bar) ── */
[data-theme="dark"] .detail-group-header {
    background: #141d2e !important;
}
[data-theme="dark"] .detail-group {
    background: #141d2e !important;
    border: 1px solid #2a374d !important;
}

/* ── Detail Table Header Row (NO / INDICATOR / SUB-ASPECT / SCORE / SCORE DESCRIPTION) ── */
[data-theme="dark"] .detail-table-wrap {
    background: #141d2e !important;
}
[data-theme="dark"] .detail-table thead tr,
[data-theme="dark"] .detail-table thead {
    background: #0a1428 !important;
}
[data-theme="dark"] .detail-table th {
    color: #93c5fd !important;
    background: #0a1428 !important;
}

/* =============================================
   CYCLE DIAGRAM FIX — long Indonesian labels
   (e.g. "Pengembangan") no longer collide with
   the center circle.
   Append this to the BOTTOM of assets/css/style.css
   ============================================= */

.cycle-diagram {
    width: 240px;
}

.cycle-item.right {
    right: -3px;
}
.cycle-item.left {
    left: -3px;
}

.cycle-item span {
    font-size: 9.5px;
    max-width: 84px;
    text-align: center;
    white-space: normal;
    line-height: 1.25;
}

.hero-visual {
    padding-right: 8px;
}

/* =============================================
   SCORE LEGEND BADGE FIX — force white number text
   Append this to the BOTTOM of assets/css/style.css
   ============================================= */
.um-badge,
.um-badge span {
    color: #ffffff !important;
}
[data-theme="dark"] .um-badge,
[data-theme="dark"] .um-badge span {
    color: #ffffff !important;
}