@import url('glass.css');

@font-face {
    font-family: 'Nothing';
    src: url("../fonts/nothing-font-5x7.otf") format('opentype');
    font-weight: 400 800;
    font-display: swap;
}

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --info-color: #0891b2;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --glass-page-bg: radial-gradient(1200px 800px at -10% -10%, rgba(99, 102, 241, 0.20), transparent 60%),
                      radial-gradient(1000px 700px at 110% 10%, rgba(59, 130, 246, 0.18), transparent 60%),
                      linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
}

html, body.theme-glass { min-height: 100vh; }
html { background-color: #0f172a; background-image: var(--glass-page-bg); }
html.theme-light { background-color: #f1f5f9; background-image: radial-gradient(1200px 800px at -10% -10%, rgba(59, 130, 246, 0.08), transparent 60%), radial-gradient(1000px 700px at 110% 10%, rgba(16, 185, 129, 0.06), transparent 60%), linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%); }
body.theme-glass { background-color: transparent; }
body { background-color: var(--light-bg); font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; }

.sidebar {
    position: fixed; top: 20px; left: 20px; bottom: 20px; width: 280px;
    background: linear-gradient(180deg, var(--gray-900) 0%, var(--gray-800) 100%);
    border-radius: 16px; box-shadow: var(--shadow-lg);
    z-index: 1000; overflow-y: auto; overflow-x: hidden;
}
.sidebar .nav-link {
    color: var(--gray-300); padding: 0.875rem 1.25rem; border-radius: 0.75rem;
    margin: 0.25rem 0; transition: all 0.2s ease; font-weight: 500;
    position: relative; font-size: 0.95rem;
}
.sidebar .nav-link:hover { color: var(--white); background-color: rgba(255,255,255,0.08); transform: translateX(2px); }
.sidebar .nav-link.active {
    color: var(--white);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: var(--shadow-md);
}
.sidebar .nav-link.active::before {
    content: ''; position: absolute; left: -0.75rem; top: 50%;
    transform: translateY(-50%); width: 3px; height: 1.5rem;
    background: var(--primary-color); border-radius: 0 2px 2px 0;
}
.sidebar .nav-link i { width: 20px; text-align: center; margin-right: 12px; font-size: 1.1rem; }

.main-content { background: transparent; min-height: 100vh; margin-left: 320px; padding: 20px; }

.navbar-brand {
    font-weight: 800; color: var(--white) !important; font-size: 1.75rem;
    letter-spacing: -0.02em; text-decoration: none;
    display: flex; align-items: center; gap: 12px;
}
.navbar-brand .logo-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, #2563eb 0%, #06b6d4 50%, #22c55e 100%);
    border-radius: 12px; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
    position: relative; overflow: hidden;
}
.navbar-brand .logo-icon::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.2) 50%, transparent 70%);
    animation: shimmer 2s infinite;
}
@keyframes shimmer {
    0% { transform: translateX(-100%); } 100% { transform: translateX(100%); }
}
.navbar-brand .logo-icon img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.navbar-brand .brand-text, .navbar-brand .brand-dot {
    background: linear-gradient(135deg, #2563eb 0%, #06b6d4 50%, #22c55e 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.navbar-brand .brand-text { font-family: 'Montserrat', sans-serif; font-weight: 800; }
.navbar-brand .brand-dot { font-family: 'Nothing', 'Montserrat', sans-serif; font-weight: 400; letter-spacing: 0.02em; }
.navbar-brand .brand-wordmark { display: inline-flex; align-items: baseline; line-height: 1; }

.top-navbar {
    background-color: var(--white); border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm); backdrop-filter: blur(8px);
    position: relative; z-index: 1000;
}

/* Glass-theme top navbar — matches the live SciVerify/Portal/SciTrace apps */
body.theme-glass .top-navbar {
    background: rgba(255, 255, 255, 0.12) !important;
    backdrop-filter: saturate(160%) blur(20px);
    -webkit-backdrop-filter: saturate(160%) blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.22) !important;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.28) !important;
    border-radius: 16px;
    margin: 8px 12px 20px 12px;
    padding: 6px 8px;
}
body.theme-glass .top-navbar .search-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.14);
}
body.theme-glass .top-navbar .form-control { background: transparent !important; color: #e5e7eb !important; border: none; }
body.theme-glass .top-navbar .form-control::placeholder { color: rgba(229, 231, 235, 0.55); }
body.theme-glass .top-navbar .form-control:focus { box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25); }
body.theme-glass .top-navbar .btn-outline-secondary {
    color: #e5e7eb !important; border-color: rgba(255, 255, 255, 0.25) !important; background: rgba(255,255,255,0.04);
}
body.theme-glass .top-navbar .btn-outline-secondary:hover { background: rgba(255,255,255,0.10) !important; }
body.theme-glass .top-navbar .text-muted { color: #cbd5e1 !important; }
body.theme-glass .top-navbar .notification-bell:hover { background-color: rgba(255,255,255,0.08); }
body.theme-glass .top-navbar .user-profile .fw-bold { color: white !important; }

.card { border: none; box-shadow: var(--shadow); background-color: var(--white); border-radius: 0.75rem; transition: all 0.2s ease; }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.hover-lift { transition: all 0.3s ease; cursor: pointer; }
.hover-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.btn { border-radius: 0.5rem; font-weight: 500; padding: 0.625rem 1.25rem; transition: all 0.2s ease; }
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none; box-shadow: var(--shadow-sm); color: white !important;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); color: white !important; }
.btn-outline-primary { border-color: var(--primary-color) !important; color: var(--primary-color) !important; }
.btn-outline-primary:hover { background-color: var(--primary-color) !important; border-color: var(--primary-color) !important; color: white !important; }
.btn-outline-success { color: var(--success-color) !important; border-color: var(--success-color) !important; }
.btn-outline-success:hover { background-color: var(--success-color) !important; border-color: var(--success-color) !important; color: white !important; }
.btn-outline-secondary { color: var(--secondary-color) !important; border-color: var(--secondary-color) !important; }
.btn-outline-secondary:hover { background-color: var(--secondary-color) !important; border-color: var(--secondary-color) !important; color: white !important; }
.btn-outline-danger { color: var(--danger-color) !important; border-color: var(--danger-color) !important; }
.btn-outline-danger:hover { background-color: var(--danger-color) !important; border-color: var(--danger-color) !important; color: white !important; }
.btn-success, .btn-warning, .btn-info, .btn-secondary, .btn-danger { color: white !important; }

.badge { color: white !important; font-weight: 500; border-radius: 0.375rem; padding: 0.375rem 0.75rem; }
.badge.badge-pending { background-color: var(--secondary-color) !important; }
.badge.badge-ongoing { background-color: var(--warning-color) !important; }
.badge.badge-done { background-color: var(--success-color) !important; }
.badge.badge-low { background-color: var(--success-color) !important; }
.badge.badge-medium { background-color: var(--warning-color) !important; }
.badge.badge-urgent { background-color: var(--danger-color) !important; }

.card-header { background-color: var(--white); border-bottom: 1px solid var(--gray-200); border-radius: 0.75rem 0.75rem 0 0 !important; padding: 1.25rem 1.5rem; }
.card-body { padding: 1.5rem; }

.search-box {
    background-color: var(--gray-50); border: 1px solid var(--gray-200);
    border-radius: 0.75rem; padding: 0.75rem 1rem; transition: all 0.2s ease;
}
.search-box:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); background-color: var(--white); }

.user-profile { display: flex; align-items: center; gap: 12px; position: relative; }
.user-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--info-color) 100%);
    display: flex; align-items: center; justify-content: center;
    color: var(--white); font-weight: 600; font-size: 1.1rem; box-shadow: var(--shadow-sm);
}
.notification-bell { position: relative; cursor: pointer; padding: 0.5rem; border-radius: 0.5rem; transition: all 0.2s ease; }
.notification-bell:hover { background-color: var(--gray-100); }
.notification-badge {
    position: absolute; top: 0; right: 0;
    background: linear-gradient(135deg, var(--danger-color) 0%, #ef4444 100%);
    color: var(--white); border-radius: 50%; width: 20px; height: 20px;
    font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-sm);
}

.form-control { border-radius: 0.5rem; border: 1px solid var(--gray-300); padding: 0.75rem 1rem; transition: all 0.2s ease; }
.form-control:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.alert { border-radius: 0.75rem; border: none; box-shadow: var(--shadow-sm); }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

.sidebar-divider { border-color: rgba(255, 255, 255, 0.15); }
.sidebar-section-label { font-size: 0.7rem; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.4); }

body.theme-glass.theme-light .sidebar-divider { border-color: rgba(0, 0, 0, 0.1); }
body.theme-glass.theme-light .sidebar-section-label { color: #6b7280; }

/* Page heading reused across apps */
.page-heading { margin-bottom: 1.5rem; }
.page-heading h1 { font-weight: 800; letter-spacing: -0.02em; color: white; margin: 0; font-size: 2rem; }
.page-heading p { color: rgba(255,255,255,0.6); margin: 0.25rem 0 0; font-size: 0.95rem; }

.welcome-banner {
    background: linear-gradient(135deg, rgba(37,99,235,0.18) 0%, rgba(6,182,212,0.12) 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 1rem; padding: 1.5rem; margin-bottom: 1.5rem;
    display: flex; align-items: center; gap: 1.25rem;
}
.welcome-avatar {
    width: 60px; height: 60px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--info-color) 100%);
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 1.6rem; flex-shrink: 0;
}
.welcome-text h2 { color: white; font-weight: 700; margin: 0; font-size: 1.4rem; }
.welcome-text p { color: rgba(255,255,255,0.6); margin: 0.25rem 0 0; font-size: 0.95rem; }

/* Stat cards for dashboards */
.stat-card {
    background: rgba(17,24,39,0.55); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 1rem; padding: 1.25rem;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.stat-card .stat-label { color: rgba(255,255,255,0.55); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.stat-card .stat-value { color: white; font-size: 1.9rem; font-weight: 800; margin-top: 0.25rem; }
.stat-card .stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: white; }

/* Tab styling for in-app pages — matches Bootstrap 5 nav-tabs against glass */
.nav-tabs { border-bottom: 1px solid rgba(255,255,255,0.1); }
.nav-tabs .nav-link {
    color: rgba(255,255,255,0.65); border: none; border-radius: 0; padding: 0.75rem 1.25rem;
    font-weight: 500; background: transparent; border-bottom: 2px solid transparent;
}
.nav-tabs .nav-link:hover { color: white; border-color: transparent; background: rgba(255,255,255,0.04); }
.nav-tabs .nav-link.active {
    color: white; background: transparent;
    border-bottom: 2px solid var(--primary-color);
}

/* In-app card style on glass backgrounds */
body.theme-glass .card { background: rgba(17,24,39,0.55); border: 1px solid rgba(255,255,255,0.08); color: rgba(255,255,255,0.85); backdrop-filter: blur(20px); }
body.theme-glass .card-header { background: rgba(17,24,39,0.65); border-color: rgba(255,255,255,0.08); color: white; }
body.theme-glass .text-muted { color: rgba(255,255,255,0.5) !important; }
body.theme-glass .form-control { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); color: white; }
body.theme-glass .form-control::placeholder { color: rgba(255,255,255,0.4); }
body.theme-glass .form-control:focus { background: rgba(255,255,255,0.08); color: white; }
body.theme-glass .form-label { color: rgba(255,255,255,0.8); font-weight: 500; }
body.theme-glass .table { color: rgba(255,255,255,0.85); }
body.theme-glass .table thead th { color: rgba(255,255,255,0.65); border-color: rgba(255,255,255,0.1); font-weight: 600; }
body.theme-glass .table tbody td { border-color: rgba(255,255,255,0.06); }
body.theme-glass .modal-content { background: rgba(17,24,39,0.95); color: white; }

/* Metric badge — SciVerify check tool */
.metric-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
.metric-badge.success { background: rgba(34,197,94,0.18); color: #4ade80; border: 1px solid rgba(34,197,94,0.35); }
.metric-badge.warn { background: rgba(251,191,36,0.18); color: #fbbf24; border: 1px solid rgba(251,191,36,0.35); }
.metric-badge.fail { background: rgba(248,113,113,0.18); color: #f87171; border: 1px solid rgba(248,113,113,0.35); }
.metric-badge.critical { background: rgba(220,38,38,0.25); color: #fca5a5; border: 1px solid rgba(220,38,38,0.5); }
.metric-badge.info { background: rgba(59,130,246,0.18); color: #93c5fd; border: 1px solid rgba(59,130,246,0.35); }

/* Fade-in */
.fade-in { animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Score ring (circular) */
.score-ring {
    width: 96px; height: 96px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.5rem;
    background: conic-gradient(var(--ring-color, #34d399) calc(var(--score, 80) * 1%), rgba(255,255,255,0.08) 0);
    position: relative;
}
.score-ring::after {
    content: ''; position: absolute; inset: 8px; border-radius: 50%;
    background: rgba(17,24,39,0.9);
}
.score-ring span { position: relative; z-index: 1; color: white; }
.score-ring.success { --ring-color: #34d399; }
.score-ring.warn { --ring-color: #fbbf24; }
.score-ring.fail { --ring-color: #f87171; }

/* Demo notice */
.demo-ribbon {
    position: fixed; top: 12px; right: 12px; z-index: 2000;
    background: linear-gradient(135deg, #f59e0b 0%, #dc2626 100%);
    color: white; padding: 6px 14px; border-radius: 999px;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em;
    text-transform: uppercase; box-shadow: 0 4px 14px rgba(220,38,38,0.4);
}

/* Upload overlay */
#demo-overlay {
    position: fixed; inset: 0; background: rgba(11,18,32,0.85);
    z-index: 9999; display: none; align-items: center; justify-content: center;
    backdrop-filter: blur(6px);
}
#demo-overlay.active { display: flex; }
#demo-overlay .overlay-box { background: rgba(17,24,39,0.95); padding: 2rem 3rem; border-radius: 1rem; text-align: center; color: white; border: 1px solid rgba(255,255,255,0.1); }
#demo-overlay .spinner-border { color: var(--primary-color); }

/* Light-theme overrides for demo page components */
body.theme-glass.theme-light .page-heading h1 { color: #1f2937; }
body.theme-glass.theme-light .page-heading p { color: #4b5563; }
body.theme-glass.theme-light .welcome-banner { background: rgba(37, 99, 235, 0.06); border-color: rgba(37, 99, 235, 0.15); }
body.theme-glass.theme-light .welcome-banner h2 { color: #1f2937; }
body.theme-glass.theme-light .welcome-banner p { color: #4b5563; }
body.theme-glass.theme-light .welcome-avatar { color: white; }
body.theme-glass.theme-light .stat-card { background: rgba(255, 255, 255, 0.8); border: 1px solid rgba(0, 0, 0, 0.06); }
body.theme-glass.theme-light .stat-card .stat-label { color: #6b7280; }
body.theme-glass.theme-light .stat-card .stat-value { color: #1f2937; }
body.theme-glass.theme-light .nav-tabs { border-bottom-color: rgba(0, 0, 0, 0.1); }
body.theme-glass.theme-light .nav-tabs .nav-link { color: #6b7280; }
body.theme-glass.theme-light .nav-tabs .nav-link:hover { color: #1f2937; background: rgba(0, 0, 0, 0.04); }
body.theme-glass.theme-light .nav-tabs .nav-link.active { color: #1f2937; border-bottom-color: var(--primary-color); }
body.theme-glass.theme-light .top-navbar .search-box { background: rgba(0, 0, 0, 0.04); border-color: rgba(0, 0, 0, 0.1); }
body.theme-glass.theme-light .top-navbar .form-control { color: #1f2937 !important; }
body.theme-glass.theme-light .top-navbar .form-control::placeholder { color: #6b7280; }
body.theme-glass.theme-light .top-navbar .btn-outline-secondary { color: #1f2937 !important; border-color: rgba(0, 0, 0, 0.15) !important; background: rgba(0, 0, 0, 0.04); }
body.theme-glass.theme-light .top-navbar .btn-outline-secondary:hover { background: rgba(0, 0, 0, 0.08) !important; }
body.theme-glass.theme-light .top-navbar .text-muted { color: #6b7280 !important; }
body.theme-glass.theme-light .top-navbar .user-profile .fw-bold { color: #1f2937 !important; }
body.theme-glass.theme-light .user-profile .text-muted { color: #6b7280 !important; }
body.theme-glass.theme-light .notification-bell:hover { background-color: rgba(0, 0, 0, 0.05); }
body.theme-glass.theme-light .score-ring::after { background: rgba(255, 255, 255, 0.9); }
body.theme-glass.theme-light .score-ring span { color: #1f2937; }
body.theme-glass.theme-light .table { color: #1f2937; }
body.theme-glass.theme-light .table thead th { color: #4b5563; border-color: rgba(0, 0, 0, 0.1); }
body.theme-glass.theme-light .table tbody td { border-color: rgba(0, 0, 0, 0.06); }
body.theme-glass.theme-light .modal-content { background: rgba(255, 255, 255, 0.95); color: #1f2937; }
body.theme-glass.theme-light .demo-ribbon { background: linear-gradient(135deg, #f59e0b 0%, #dc2626 100%); color: white; }
body.theme-glass.theme-light #demo-overlay { background: rgba(255, 255, 255, 0.85); }
body.theme-glass.theme-light #demo-overlay .overlay-box { background: rgba(255, 255, 255, 0.95); color: #1f2937; border: 1px solid rgba(0, 0, 0, 0.1); }

/* Login page light theme */
body.theme-glass.theme-light .login-card { background: rgba(255, 255, 255, 0.85); border-color: rgba(0, 0, 0, 0.08); }
body.theme-glass.theme-light .login-card h2 { color: #1f2937; }
body.theme-glass.theme-light .login-card .sub { color: #6b7280; }
body.theme-glass.theme-light .demo-quick { background: rgba(37, 99, 235, 0.06); border-color: rgba(37, 99, 235, 0.2); }
body.theme-glass.theme-light .demo-quick .demo-quick-label { color: #374151; }

/* Card header / form focus — override hardcoded white */
body.theme-glass.theme-light .card-header { color: #1f2937; }
body.theme-glass.theme-light .form-control:focus { color: #1f2937; }

/* Wizard step navigation (shared across all 6 wizard-step pages) */
body.theme-glass.theme-light .step-nav .step-item { color: #6b7280; }
body.theme-glass.theme-light .step-nav .step-item.active { color: #1f2937; }
body.theme-glass.theme-light .step-nav .step-item.done { color: #4b5563; }

/* Dashboard app cards */
body.theme-glass.theme-light .app-name { color: #1f2937; }
body.theme-glass.theme-light .app-desc { color: #4b5563; }
body.theme-glass.theme-light .stat-pill { color: #374151; }
body.theme-glass.theme-light .stat-pill .stat-num { color: #1f2937; }

/* Dataflow view — CSV preview, run records, pipeline, terminal */
body.theme-glass.theme-light .csv-preview-table tbody td { color: #1f2937 !important; }
body.theme-glass.theme-light .run-record { background: rgba(0, 0, 0, 0.03); border-color: rgba(0, 0, 0, 0.08); color: #1f2937; }
body.theme-glass.theme-light .run-record .run-record-header { color: #1f2937; }
body.theme-glass.theme-light .pipeline-detail .detail-label { color: #6b7280; }
body.theme-glass.theme-light .pipeline-detail .detail-value { color: #1f2937; }
body.theme-glass.theme-light .pipeline-arrow::after { color: rgba(0, 0, 0, 0.3); }
body.theme-glass.theme-light .pipeline-node-arrow { color: rgba(0, 0, 0, 0.15); }
body.theme-glass.theme-light .terminal-title { color: #6b7280; }
/* Terminal output in light mode is handled by dataflow-view inline styles */
body.theme-glass.theme-light .node-rationale .rationale-badge { color: #374151; }

/* File preview / script viewer — keep code blocks readable */
body.theme-glass.theme-light .file-preview pre,
body.theme-glass.theme-light pre.file-content {
  color: #1f2937;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Workflow metadata / stats section labels (inline style overridden) */
body.theme-glass.theme-light .section-label-sm { color: #6b7280; }

/* Submission review / assignment / checktool — metadata labels */
body.theme-glass.theme-light .meta-section-label { color: #6b7280; }
body.theme-glass.theme-light .meta-section-value { color: #1f2937; }
body.theme-glass.theme-light .fig-card .fig-cap { color: #374151; }
body.theme-glass.theme-light .fig-card .fig-num { color: #6b7280; }
body.theme-glass.theme-light .msg-meta { color: #6b7280; }
body.theme-glass.theme-light .msg-body { color: #1f2937; }
body.theme-glass.theme-light .sub-score .label { color: #6b7280; }
body.theme-glass.theme-light .sub-score .score-row { color: #1f2937; }
body.theme-glass.theme-light .keyword-badge { background: rgba(37, 99, 235, 0.08); border-color: rgba(37, 99, 235, 0.2); }
body.theme-glass.theme-light .file-badge { background: rgba(0, 0, 0, 0.04); border-color: rgba(0, 0, 0, 0.1); }

/* Reviewer assignment page */
body.theme-glass.theme-light .assignment-body { color: #1f2937; }
body.theme-glass.theme-light .assignment-meta { color: #6b7280; }

/* Author review page */
body.theme-glass.theme-light .review-heading { color: #1f2937; }

/* Search page */
body.theme-glass.theme-light .search-result-title { color: #1f2937; }
body.theme-glass.theme-light .search-result-desc { color: #4b5563; }

/* ═══ Pipeline lifecycle grid ═══ */
.pipeline-grid { display: flex; align-items: flex-start; gap: 0; padding: 8px 4px; }
.pipeline-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.pipeline-header { padding: 6px 8px; border-radius: 6px 6px 0 0; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.pipeline-header .fa { margin-right: 3px; }
.pipeline-body { border: 1px solid rgba(255,255,255,0.08); border-radius: 0 0 6px 6px; padding: 4px; display: flex; flex-direction: column; gap: 2px; min-height: 120px; }
.pipeline-node { padding: 4px 7px; border-radius: 4px; font-size: 0.7rem; font-weight: 500; cursor: pointer; transition: background 0.15s, transform 0.1s; border-left: 3px solid transparent; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipeline-node:hover { transform: translateX(2px); }
.pipeline-node .node-type-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.pipeline-node.type-raw_data { background: rgba(16,185,129,0.1); border-left-color: #10b981; color: #6ee7b7; }
.pipeline-node.type-raw_data:hover { background: rgba(16,185,129,0.2); }
.pipeline-node.type-processing { background: rgba(37,99,235,0.1); border-left-color: #2563eb; color: #93c5fd; }
.pipeline-node.type-processing:hover { background: rgba(37,99,235,0.2); }
.pipeline-node.type-visualization { background: rgba(245,158,11,0.1); border-left-color: #f59e0b; color: #fcd34d; }
.pipeline-node.type-visualization:hover { background: rgba(245,158,11,0.2); }
.pipeline-node.type-output { background: rgba(239,68,68,0.1); border-left-color: #ef4444; color: #fca5a5; }
.pipeline-node.type-output:hover { background: rgba(239,68,68,0.2); }
.pipeline-node.risk-warn { border-left: 3px solid #f59e0b; }
.pipeline-node.risk-critical { border-left: 3px solid #dc2626; }
.pipeline-arrow { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; width: 32px; padding-top: 28px; }
.pipeline-arrow::after { content: '→'; font-size: 1.1rem; color: rgba(255,255,255,0.3); font-weight: 300; }
.pipeline-node-arrow { display: flex; justify-content: center; color: rgba(255,255,255,0.15); font-size: 0.55rem; line-height: 1; padding: 0; }
.pipeline-node-arrow::before { content: '▾'; }
.pipeline-fig-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.pipeline-fig-grid .pipeline-node { font-size: 0.62rem; padding: 3px 5px; }
.pipeline-detail { margin-top: 10px; background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; padding: 12px 16px; display: none; }
.pipeline-detail.visible { display: block; }
.pipeline-detail .detail-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; color: rgba(255,255,255,0.45); font-weight: 700; margin-bottom: 2px; }
.pipeline-detail .detail-val { font-size: 0.82rem; margin-bottom: 8px; color: #e5e7eb; }
.pipeline-detail .detail-badge { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 0.62rem; font-weight: 600; }

/* Light-theme pipeline overrides */
body.theme-glass.theme-light .pipeline-header { color: #fff; }
body.theme-glass.theme-light .pipeline-body { border-color: rgba(0,0,0,0.08); }
/* Column header tints in light mode — lighter versions of the legend colors. */
body.theme-glass.theme-light .pipeline-header.header-raw-data { background: rgba(16, 185, 129, 0.22) !important; color: #047857; }
body.theme-glass.theme-light .pipeline-header.header-processing { background: rgba(37, 99, 235, 0.22) !important; color: #1d4ed8; }
body.theme-glass.theme-light .pipeline-header.header-visualization { background: rgba(245, 158, 11, 0.22) !important; color: #b45309; }
body.theme-glass.theme-light .pipeline-node.type-raw_data { background: rgba(16,185,129,0.08); color: #047857; }
body.theme-glass.theme-light .pipeline-node.type-raw_data:hover { background: rgba(16,185,129,0.15); }
body.theme-glass.theme-light .pipeline-node.type-processing { background: rgba(37,99,235,0.08); color: #1d4ed8; }
body.theme-glass.theme-light .pipeline-node.type-processing:hover { background: rgba(37,99,235,0.15); }
body.theme-glass.theme-light .pipeline-node.type-visualization { background: rgba(245,158,11,0.08); color: #b45309; }
body.theme-glass.theme-light .pipeline-node.type-visualization:hover { background: rgba(245,158,11,0.15); }
body.theme-glass.theme-light .pipeline-node.type-output { background: rgba(239,68,68,0.08); color: #b91c1c; }
body.theme-glass.theme-light .pipeline-node.type-output:hover { background: rgba(239,68,68,0.15); }
body.theme-glass.theme-light .pipeline-arrow::after { color: rgba(0,0,0,0.25); }
body.theme-glass.theme-light .pipeline-node-arrow { color: rgba(0,0,0,0.12); }
body.theme-glass.theme-light .pipeline-detail { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.08); }
body.theme-glass.theme-light .pipeline-detail .detail-label { color: #6b7280; }
body.theme-glass.theme-light .pipeline-detail .detail-val { color: #1f2937; }

/* Accent-color badges / score-rings inherited from dark theme. */
body.theme-glass.theme-light .metric-badge.success {
    background: rgba(34, 197, 94, 0.10);
    color: #047857;
    border-color: rgba(34, 197, 94, 0.30);
}
body.theme-glass.theme-light .metric-badge.warn {
    background: rgba(245, 158, 11, 0.10);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.30);
}
body.theme-glass.theme-light .metric-badge.fail {
    background: rgba(220, 38, 38, 0.10);
    color: #b91c1c;
    border-color: rgba(220, 38, 38, 0.30);
}
body.theme-glass.theme-light .metric-badge.critical {
    background: rgba(220, 38, 38, 0.12);
    color: #991b1b;
    border-color: rgba(220, 38, 38, 0.35);
}
body.theme-glass.theme-light .metric-badge.info {
    background: rgba(37, 99, 235, 0.10);
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, 0.30);
}
body.theme-glass.theme-light .score-ring.success { --ring-color: #059669; }
body.theme-glass.theme-light .score-ring.warn    { --ring-color: #b45309; }
body.theme-glass.theme-light .score-ring.fail    { --ring-color: #b91c1c; }

/* ═══ Mobile responsiveness ═══ */
.sidebar-toggle { display: none; }

@media (max-width: 900px) {
  /* Sidebar: hidden off-screen by default, slides in as overlay */
  .sidebar,
  body.theme-glass .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 2000;
    border-radius: 0 20px 20px 0;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  body.sidebar-open .sidebar,
  body.sidebar-open.theme-glass .sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.5);
  }

  /* Main content: full width */
  .main-content {
    margin-left: 0 !important;
    padding: 10px;
    width: 100%;
  }

  /* Backdrop overlay */
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  /* Hamburger toggle button */
  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    cursor: pointer;
    font-size: 1.15rem;
    transition: background 0.2s;
    flex-shrink: 0;
    padding: 0;
    margin-right: 0.5rem;
  }

  .sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.18);
  }

  body.theme-glass.theme-light .sidebar-toggle {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: #1f2937;
  }

  body.theme-glass.theme-light .sidebar-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
  }

  /* Topbar compact */
  body.theme-glass .top-navbar {
    margin: 0 0 15px 0;
    padding: 6px 10px;
    border-radius: 12px;
  }

  /* Hide search on mobile */
  .top-navbar .search-box {
    display: none !important;
  }

  /* Hide back/forward buttons on mobile */
  .top-navbar .btn-outline-secondary {
    display: none !important;
  }

  /* Notification bell smaller margin */
  .top-navbar .notification-bell {
    margin-right: 0.5rem !important;
  }

  /* User profile: hide text, keep avatar */
  .user-profile .d-flex.flex-column {
    display: none !important;
  }

  /* Welcome banner stacked */
  .welcome-banner {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }

  .welcome-avatar {
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
  }

  .welcome-text h2 {
    font-size: 1.2rem;
  }

  .welcome-text p {
    font-size: 0.85rem;
  }

  /* Page heading smaller */
  .page-heading h1 {
    font-size: 1.4rem;
  }

  /* Cards more compact */
  .card {
    margin-bottom: 0.75rem;
  }

  .card-body {
    padding: 1rem;
  }

  .card-header {
    padding: 0.75rem 1rem;
  }

  /* Demo ribbon smaller */
  .demo-ribbon {
    font-size: 0.62rem;
    padding: 4px 10px;
    top: 6px;
    right: 6px;
  }

  /* Bootstrap grid: single column */
  .row.g-4 > [class*="col"] {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Stat row wrap */
  .stat-row {
    gap: 0.5rem;
  }

  .stat-pill {
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
  }

  /* App card smaller padding */
  .app-card-header {
    padding: 1.25rem 1.25rem 1rem !important;
  }

  .app-card-body {
    padding: 1rem 1.25rem 1.25rem !important;
  }

  /* Stat cards compact */
  .stat-card {
    padding: 0.9rem;
  }

  .stat-card .stat-value {
    font-size: 1.4rem;
  }

  /* Tables scroll horizontally */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }

  /* Pipeline grid reflow */
  .pipeline-grid {
    flex-wrap: wrap;
    gap: 6px;
  }

  .pipeline-col {
    flex: 1 1 calc(50% - 6px);
    min-width: 140px;
  }

  .pipeline-arrow {
    display: none;
  }

  .pipeline-node-arrow {
    display: none;
  }
}

/* ── Light theme: step-nav (wizard sidebar) ── */
body.theme-glass.theme-light .step-nav {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
body.theme-glass.theme-light .step-nav .step-item {
    color: #6b7280;
}
body.theme-glass.theme-light .step-nav .step-item.active {
    background: rgba(37, 99, 235, 0.10);
    color: #1d4ed8;
    font-weight: 600;
}
body.theme-glass.theme-light .step-nav .step-item.done {
    color: #374151;
}
body.theme-glass.theme-light .step-nav .step-num {
    background: rgba(0, 0, 0, 0.06);
    color: #4b5563;
}
body.theme-glass.theme-light .step-nav .step-item.active .step-num {
    background: var(--primary-color);
    color: white;
}
body.theme-glass.theme-light .step-nav .step-item.done .step-num {
    background: #059669;
    color: white;
}
