/* Soft Cyber-Light Ice & Cream Theme with Glassmorphism, Stepper & Scroll Layout Modes */
:root {
    --bg-color: #f1f5f9;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --accent-blue: #2563eb;
    --accent-purple: #7c3aed;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    /* Soft Glass Settings */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 10px 30px rgba(31, 41, 55, 0.04);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --logo-gradient: linear-gradient(135deg, #0f172a, #334155);
}

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

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--bg-color);
    overflow: hidden;
    position: relative;
    line-height: 1.6;
}

/* Cyber Scanlines Effect (Gentle Light Mode) */
.scanlines {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(
        rgba(255, 255, 255, 0) 50%, 
        rgba(0, 0, 0, 0.012) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.8;
}

/* Animated Mesh Background (Soft Ice Pastels) */
.mesh-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: #e8eff5;
}

.blob {
    position: absolute;
    filter: blur(100px);
    border-radius: 50%;
    animation: float 25s infinite alternate ease-in-out;
    opacity: 0.5;
}

.blob-1 {
    width: 800px; height: 800px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, rgba(139, 92, 246, 0.08) 70%);
    top: -250px; left: -150px;
}
.blob-2 {
    width: 700px; height: 700px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.25) 0%, rgba(236, 72, 153, 0.08) 70%);
    bottom: -200px; right: -100px;
    animation-delay: -5s;
}
.blob-3 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.25) 0%, rgba(59, 130, 246, 0.08) 70%);
    top: 35%; left: 25%;
    animation-delay: -10s;
}

/* Tech Grid Pattern */
.mesh-bg::after {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at center, black, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black, transparent 80%);
    pointer-events: none;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1) rotate(0deg); }
    50% { transform: translate(40px, -30px) scale(1.1) rotate(180deg); }
    100% { transform: translate(-30px, 30px) scale(0.9) rotate(360deg); }
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    padding: 16px;
    gap: 16px;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
}

/* SIDEBAR */
.sidebar {
    width: 290px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 32px 24px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-box {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.35);
}

.animate-glow {
    animation: glow-pulse 3s infinite ease-in-out;
}

@keyframes glow-pulse {
    0%, 100% { filter: drop-shadow(0 0 2px rgba(255,255,255,0.6)); }
    50% { filter: drop-shadow(0 0 10px rgba(37, 99, 235, 0.6)); }
}

.logo-text h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.5px;
    background: var(--logo-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-blue);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 10px; }

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    display: block;
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-left: 12px;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-radius: 12px;
    transition: var(--transition);
    margin-bottom: 4px;
    overflow: hidden;
    border: 1px solid transparent;
}

.nav-item i {
    font-size: 20px;
    transition: var(--transition);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.4);
    color: var(--text-main);
    transform: translateX(4px);
}

.nav-item.active {
    background: white;
    color: var(--accent-blue);
    border-color: rgba(37, 99, 235, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.active-indicator {
    position: absolute;
    right: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-blue);
    opacity: 0;
    transform: scale(0);
    transition: var(--transition);
}

.nav-item.active .active-indicator {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 8px var(--accent-blue);
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.system-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--success);
    background: rgba(16, 185, 129, 0.08);
    padding: 8px 16px;
    border-radius: 99px;
}

.pulse-dot {
    width: 6px; height: 6px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.3); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* MAIN CONTENT */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.top-header {
    height: 95px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.gradient-text {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.subtitle {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* HEADER ACTION SWITCHES */
.view-toggle-container {
    display: flex;
    padding: 3px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-right: 16px;
}

.view-toggle-btn {
    padding: 8px 16px;
    border-radius: 9px;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-toggle-btn.active {
    background: white;
    color: var(--accent-blue);
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.tech-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    padding: 8px 14px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-main);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}
.tech-badge i { color: var(--success); font-size: 14px; }

.scroll-container {
    flex: 1;
    overflow-y: auto;
    padding: 30px 40px;
    display: flex;
    flex-direction: column;
}
.scroll-container::-webkit-scrollbar { width: 6px; }
.scroll-container::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 10px; }

.guide-section { 
    display: none; 
    flex-direction: column;
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}
.guide-section.active { display: flex; }

/* STEPPER PROGRESS BAR (HORIZONTAL) */
.stepper-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    margin-bottom: 40px;
    padding: 0 10px;
}

.progress-line {
    position: absolute;
    top: 20px; left: 0; right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.04);
    z-index: 1;
    border-radius: 2px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    width: 0%;
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.step-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    cursor: pointer;
}

.step-node span {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    color: var(--text-muted);
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}

.step-node label {
    margin-top: 8px;
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    transition: var(--transition);
}

.step-node.active span {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.step-node.active label {
    color: var(--accent-blue);
}

.step-node.completed span {
    background: var(--success);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

/* STEP WRAPPER */
.step-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.step-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 32px;
    border-radius: 20px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    width: 100%;
}

.step-content h4 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
}

.step-content p {
    color: var(--text-muted);
    font-size: 15px;
}

.link-highlight {
    color: var(--accent-blue);
    text-decoration: none;
    font-family: var(--font-mono);
    font-weight: 500;
    border-bottom: 1px dashed var(--accent-blue);
}

/* STEPPER CONTROLS */
.stepper-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
}

.btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
    transform: translateY(-2px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid rgba(0,0,0,0.06);
}
.btn-secondary:hover {
    background: #f8fafc;
}
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(0,0,0,0.02);
}

/* 1. SLIDER / STEPPER MODE */
body.mode-stepper .step-content {
    display: none;
}

body.mode-stepper .step-content.active {
    display: block;
    animation: slideInStep 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInStep {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 2. SCROLL / TIMELINE MODE */
body.mode-scroll .stepper-progress {
    display: none;
}

body.mode-scroll .stepper-controls {
    display: none;
}

body.mode-scroll .step-wrapper {
    display: block;
    position: relative;
    padding-left: 24px;
}

body.mode-scroll .step-wrapper::before {
    content: '';
    position: absolute;
    left: 24px; top: 0; bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, transparent, var(--accent-blue) 10%, var(--accent-purple) 90%, transparent);
    opacity: 0.15;
    border-radius: 2px;
}

body.mode-scroll .step-content {
    display: block;
    position: relative;
    padding-left: 64px;
    margin-bottom: 40px;
    background: var(--glass-bg);
}

body.mode-scroll .step-content:last-child {
    margin-bottom: 0;
}

body.mode-scroll .step-content::before {
    content: attr(data-step-num);
    position: absolute;
    left: 8px; top: 28px;
    width: 34px; height: 34px;
    background: var(--bg-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-blue);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.1);
    z-index: 2;
    transition: var(--transition);
}

body.mode-scroll .step-content:hover::before {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    border-color: transparent;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

/* WIDGETS & BRANCHES */
.branch-grid {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.branch-card {
    background: rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.7);
    padding: 20px;
    border-radius: 14px;
    transition: var(--transition);
}

.branch-card.mini-card {
    padding: 16px;
}

.success-glow:hover { box-shadow: 0 8px 20px rgba(16, 185, 129, 0.08); border-color: rgba(16,185,129,0.3); }
.danger-glow:hover { box-shadow: 0 8px 20px rgba(239, 68, 68, 0.08); border-color: rgba(239,68,68,0.3); }
.warning-glow:hover { box-shadow: 0 8px 20px rgba(245, 158, 11, 0.08); border-color: rgba(245,158,11,0.3); }

.card-icon-sun { color: #d97706; font-size: 24px; }
.card-icon-sunset { color: #ea580c; font-size: 24px; }
.card-icon-moon { color: #4f46e5; font-size: 24px; }

.animate-spin-slow {
    animation: spin 10s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.branch-card h5 {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    margin: 6px 0 2px;
}

.time-label {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-blue) !important;
}

.sla-box { display: flex; gap: 16px; margin-top: 16px; }
.sla-item {
    background: white; padding: 12px 16px; border-radius: 10px; flex: 1; border: 1px solid var(--glass-border);
}
.sla-item.compact-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}
.sla-item .label { display: block; font-size: 12px; color: var(--text-muted); font-weight: 600; }
.sla-item .value { font-family: var(--font-mono); font-size: 18px; font-weight: 700; color: var(--text-main); margin-top: 2px;}
.sla-item.alert .value { color: var(--danger); }

.badge {
    padding: 4px 10px; border-radius: 6px; font-family: var(--font-mono); font-size: 11px; font-weight: 600;
}
.badge.yellow { background: rgba(245, 158, 11, 0.08); color: var(--warning); }
.badge.blue { background: rgba(37, 99, 235, 0.08); color: var(--accent-blue); }
.badge.red-badge { background: rgba(239, 68, 68, 0.08); color: var(--danger); }

.bullet-list {
    margin-left: 20px; margin-top: 12px; color: var(--text-muted); font-size: 13px; line-height: 1.8;
}

.alert-box {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    margin-top: 16px;
    background: rgba(255,255,255,0.4);
    border: 1px solid rgba(255,255,255,0.5);
}
.alert-box.info { border-left: 4px solid var(--accent-blue); }
.alert-box.danger { border-left: 4px solid var(--danger); }
.alert-icon { font-size: 20px; }
.info .alert-icon { color: var(--accent-blue); }
.danger .alert-icon { color: var(--danger); }
.alert-text { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.alert-text strong { color: var(--text-main); }

/* TERMINAL MOCK (Clean Light Cyber) */
.terminal-box {
    background: #0f172a;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    position: relative;
}

.terminal-header {
    background: #1e293b;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dots span {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
}
.red { background: #ef4444; }
.yellow { background: #f59e0b; }
.green { background: #10b981; }

.terminal-header .title {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #94a3b8;
    margin-left: 10px;
}

.terminal-body {
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 13px;
}
.prompt { color: #10b981; }
.cmd { color: #e2e8f0; }

.glass-btn {
    position: absolute;
    bottom: 12px; right: 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: var(--transition);
    display: inline-flex; align-items: center; gap: 4px;
}
.glass-btn:hover {
    background: rgba(255,255,255,0.2);
}

.remark-code {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.02);
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 12px;
    border: 1px solid var(--glass-border);
}

.remark-code code {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-blue);
}

.icon-only {
    background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 16px; transition: 0.2s;
}
.icon-only:hover { color: var(--text-main); }

/* TOAST */
#toast-container {
    position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 1000;
}
.toast {
    background: white; color: var(--text-main); padding: 16px 24px; border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.05); font-size: 14px; font-weight: 500;
    display: flex; align-items: center; gap: 12px; border: 1px solid var(--glass-border);
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; opacity: 0; transform: translateX(100%);
}
.toast i { color: var(--success); font-size: 24px; }
.toast.fade-out { animation: slideOut 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes slideIn { to { opacity: 1; transform: translateX(0); } }
@keyframes slideOut { to { opacity: 0; transform: translateX(100%); } }

/* TECH META TAGS */
.tech-meta {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent-purple);
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

/* INTERACTIVE SIMULATORS STYLING & THEME ADAPTABILITY */
.captcha-input {
    background: var(--glass-bg);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
}
.captcha-box {
    background: rgba(0,0,0,0.02);
    border: 1px solid var(--glass-border);
}

table {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}
thead tr {
    background: var(--bg-color);
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-main);
}
tbody tr {
    border-bottom: 1px solid var(--glass-border);
}
tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

/* ANIMATIONS */
.animate-fade-in {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* THEME SWITCHER WIDGET STYLES */
.theme-switcher-container {
    display: flex;
    padding: 3px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-right: 16px;
}

.theme-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.theme-btn:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-main);
}

.theme-btn.active {
    background: white;
    color: var(--accent-blue);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

/* 1. EYE-CARE WARM THEME OVERRIDES */
body.theme-warm {
    --bg-color: #fdf6e3;
    --text-main: #2e3440;
    --text-muted: #5e6472;
    --accent-blue: #2b6cb0;
    --accent-purple: #6b46c1;
    --glass-bg: rgba(253, 246, 227, 0.8);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 10px 30px rgba(94, 100, 114, 0.05);
    --logo-gradient: linear-gradient(135deg, #2e3440, #4c566a);
}
body.theme-warm .mesh-bg {
    background: #f4ebd0;
}
body.theme-warm .theme-switcher-container {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}
body.theme-warm .theme-btn.active {
    background: #fdf6e3;
    color: var(--accent-blue);
}
body.theme-warm .view-toggle-container {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}
body.theme-warm .view-toggle-btn.active {
    background: #fdf6e3;
    color: var(--accent-blue);
}
body.theme-warm .sidebar-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}
body.theme-warm .top-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
body.theme-warm .nav-item.active {
    background: #fdf6e3;
    border-color: rgba(43, 108, 176, 0.1);
}
body.theme-warm .branch-card {
    background: rgba(0,0,0,0.015);
    border-color: rgba(0,0,0,0.04);
}
body.theme-warm .sla-item {
    background: #fdf6e3;
    border-color: rgba(0,0,0,0.06);
}
body.theme-warm .remark-code {
    background: rgba(0,0,0,0.02);
}
body.theme-warm .toast {
    background: #fdf6e3;
    border-color: rgba(0,0,0,0.08);
}

/* 2. COMFORT DARK THEME OVERRIDES (SOFT EYE-FRIENDLY DARK) */
body.theme-dark {
    --bg-color: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent-blue: #38bdf8;
    --accent-purple: #c084fc;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    --logo-gradient: linear-gradient(135deg, #ffffff, #cbd5e1);
}
body.theme-dark .mesh-bg {
    background: #0b0f19;
}
body.theme-dark .blob {
    opacity: 0.25;
}
body.theme-dark .theme-switcher-container {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}
body.theme-dark .theme-btn.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent-blue);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
body.theme-dark .theme-btn:hover {
    background: rgba(255, 255, 255, 0.03);
}
body.theme-dark .view-toggle-container {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.05);
}
body.theme-dark .view-toggle-btn.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent-blue);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
body.theme-dark .sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}
body.theme-dark .top-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
body.theme-dark .nav-item.active {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.05);
}
body.theme-dark .branch-card {
    background: rgba(255, 255, 255, 0.01);
    border-color: rgba(255, 255, 255, 0.03);
}
body.theme-dark .sla-item {
    background: rgba(255, 255, 255, 0.01);
    border-color: rgba(255, 255, 255, 0.04);
}
body.theme-dark .remark-code {
    background: rgba(0,0,0,0.15);
}
body.theme-dark .toast {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.06);
}
body.theme-dark .captcha-input {
    background: rgba(0,0,0,0.2) !important;
    color: white !important;
    border-color: rgba(255,255,255,0.08) !important;
}
body.theme-dark .captcha-box {
    background: rgba(0,0,0,0.25) !important;
    border-color: rgba(255,255,255,0.05) !important;
}
body.theme-dark table {
    background: rgba(0,0,0,0.2) !important;
    border-color: rgba(255,255,255,0.05) !important;
}
body.theme-dark thead tr {
    background: rgba(255,255,255,0.02) !important;
    border-bottom: 1px solid rgba(255,255,255,0.05) !important;
    color: white !important;
}
body.theme-dark tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.02) !important;
}
body.theme-dark tbody tr:hover {
    background: rgba(255,255,255,0.01) !important;
}

/* ADMIN EDIT STEP MODAL LAYOUT & TRANSITIONS */
.admin-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.admin-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.admin-modal {
    width: 90%;
    max-width: 600px;
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.admin-modal-overlay.active .admin-modal {
    transform: scale(1);
}

body.theme-dark .admin-modal-overlay {
    background: rgba(0, 0, 0, 0.6);
}

body.theme-dark .admin-modal textarea,
body.theme-dark .admin-modal input {
    background: rgba(0,0,0,0.2) !important;
    color: white !important;
    border-color: rgba(255,255,255,0.08) !important;
}

body.theme-warm .admin-modal textarea,
body.theme-warm .admin-modal input {
    background: #fdf6e3 !important;
    color: #2e3440 !important;
    border-color: rgba(0,0,0,0.08) !important;
}

@media (max-width: 900px) {
    .branch-grid { grid-template-columns: 1fr !important; }
    .sidebar { width: 80px; }
    .logo-text, .nav-item span, .system-status span, .step-node label { display: none; }
    .sidebar-header { justify-content: center; padding: 24px 0; }
    .nav-item { justify-content: center; padding: 16px; }
}
