@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-color: #f1f5f9;
    --sidebar-bg: #0f172a;
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --sidebar-border: rgba(255, 255, 255, 0.08);

    --card-bg: #ffffff;
    --card-header-bg: #f8fafc;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: #eff6ff;
    --secondary: #e2e8f0;
    --secondary-hover: #cbd5e1;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.05), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.07), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- SPLASH SCREEN PRELOADER --- */
#appSplashScreen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

#appSplashScreen.splash-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-logo-img {
    max-width: 160px;
    max-height: 160px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 12px 28px rgba(59, 130, 246, 0.28));
    animation: splashLogoIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.splash-progress-track {
    width: 140px;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.splash-progress-bar {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #3b82f6, #a855f7, #06b6d4);
    animation: splashProgressFill 2s linear forwards;
}

@keyframes splashLogoIn {
    0% {
        opacity: 0;
        transform: scale(0.88) translateY(8px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes splashProgressFill {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* --- LOGIN OVERLAY (MODERN DUAL-COLUMN) --- */
#loginOverlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
    overflow-y: auto;
}

#loginOverlay .login-ambient-1 {
    position: absolute;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle, #bfdbfe 0%, #dbeafe 60%, transparent 80%);
    top: -10%;
    left: -5%;
    filter: blur(120px);
    pointer-events: none;
    opacity: 0.6;
}

#loginOverlay .login-ambient-2 {
    position: absolute;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    background: radial-gradient(circle, #c7d2fe 0%, #e0e7ff 60%, transparent 80%);
    bottom: -10%;
    right: -5%;
    filter: blur(120px);
    pointer-events: none;
    opacity: 0.6;
}

.login-container-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 860px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.03), 0 20px 40px -12px rgba(37, 99, 235, 0.08);
    overflow: hidden;
}

/* Left Panel: Branding */
.login-brand-panel {
    background: linear-gradient(150deg, #f8faff 0%, #eef4ff 100%);
    border-right: 1px solid #e2e8f0;
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.login-brand-top {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.login-brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.login-brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.login-brand-middle {
    margin: 2.5rem 0;
}

.login-brand-middle h1 {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.3;
    color: #0f172a;
    letter-spacing: -0.025em;
    margin-bottom: 0.75rem;
}

.login-brand-middle h1 span {
    color: #2563eb;
}

.login-brand-middle p {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 0;
}

.login-brand-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.775rem;
    color: #64748b;
}

.login-status-dot {
    width: 7px;
    height: 7px;
    background: #16a34a;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

/* Right Panel: Form */
.login-form-panel {
    padding: 3rem 2.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
}

.login-form-header {
    margin-bottom: 1.75rem;
}

.login-form-header h2 {
    font-size: 1.55rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin-bottom: 0.3rem;
}

.login-form-header p {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 0;
}

.login-input-group {
    margin-bottom: 1.15rem;
}

.login-input-group label {
    display: block;
    font-size: 0.825rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.45rem;
}

.login-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-wrap .field-icon {
    position: absolute;
    left: 1rem;
    color: #94a3b8;
    pointer-events: none;
    font-size: 0.9rem;
}

.login-input-wrap input {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 0.8rem 1rem 0.8rem 2.75rem;
    font-size: 0.9rem;
    color: #0f172a;
    outline: none;
    transition: all 0.2s ease;
    margin-bottom: 0;
}

.login-input-wrap input:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.login-pass-toggle {
    position: absolute;
    right: 0.85rem;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.35rem;
    transition: color 0.2s ease;
}

.login-pass-toggle:hover {
    color: #0f172a;
}

/* Captcha styling */
.login-captcha-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    align-items: center;
}

.login-captcha-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 0.7rem 1rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: #2563eb;
    user-select: none;
}

.login-captcha-refresh {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 0.2rem;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.login-captcha-refresh:hover {
    color: #2563eb;
    transform: rotate(90deg);
}

.login-captcha-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.login-captcha-input-wrap input {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 0.8rem 1rem 0.8rem 2.5rem;
    font-size: 0.9rem;
    color: #0f172a;
    outline: none;
    transition: all 0.2s ease;
    margin-bottom: 0;
}

.login-captcha-input-wrap input:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.login-captcha-input-wrap .field-icon {
    position: absolute;
    left: 0.9rem;
    color: #94a3b8;
    pointer-events: none;
    font-size: 0.9rem;
}

/* Error message */
.login-error-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    font-size: 0.825rem;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    margin-bottom: 1.15rem;
    display: none;
    align-items: center;
    gap: 0.5rem;
}

/* Submit Button */
.login-submit-btn {
    width: 100%;
    padding: 0.85rem;
    border-radius: 12px;
    background: #2563eb;
    border: none;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    transition: all 0.2s ease;
    margin-top: 1.25rem;
}

.login-submit-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.login-submit-btn:active {
    transform: translateY(0);
}

.login-footer-text {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.775rem;
    color: #64748b;
}

@media (max-width: 768px) {
    .login-container-card {
        grid-template-columns: 1fr;
        max-width: 440px;
    }
    .login-brand-panel {
        display: none;
    }
    .login-form-panel {
        padding: 2.5rem 1.75rem;
    }
}

/* --- ADMIN LAYOUT --- */
#adminLayout {
    display: none; /* Shown after login */
    width: 100%;
    height: 100vh;
}
#adminLayout.active {
    display: flex;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    padding: 1.25rem 0 1rem 0;
    display: flex;
    flex-direction: column;
    z-index: 50;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.05);
}
.sidebar-brand {
    padding: 0 1.25rem 1.25rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    border-bottom: 1px solid var(--sidebar-border);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.sidebar-menu {
    list-style: none;
    flex: 1;
    overflow-y: auto;
}
.sidebar-menu li {
    margin: 0.2rem 0.75rem;
}
.sidebar-menu .menu-heading {
    padding: 1rem 0.65rem 0.4rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 0;
}
.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
}
.sidebar-menu a i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    transition: transform 0.2s ease;
}
.sidebar-menu a:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
}
.sidebar-menu a:hover i {
    transform: scale(1.1);
}
.sidebar-menu a.active {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: var(--bg-color);
}
.topbar {
    min-height: 70px;
    height: auto;
    flex-shrink: 0;
    padding: 0.85rem 2rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}
.content-area {
    padding: 2.25rem 2.5rem;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}
.page-title {
    font-size: 1.65rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    letter-spacing: -0.025em;
}
.page-title i {
    color: var(--primary);
    background: var(--primary-soft);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

/* Common UI Elements */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}
.card:hover {
    box-shadow: var(--shadow-md);
}
.form-group {
    margin-bottom: 1.25rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.95rem;
}
.form-control {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    color: var(--text-color);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.form-control:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.4rem;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn i {
    font-size: 1.05em;
}
.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}
.btn-secondary {
    background: #ffffff;
    color: var(--text-color);
    border: 1px solid #cbd5e1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.btn-secondary:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    transform: translateY(-1px);
}
.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
}
.btn-small {
    padding: 0.45rem 0.85rem;
    font-size: 0.825rem;
    border-radius: 8px;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
th, td {
    padding: 0.95rem 1.15rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}
th {
    font-weight: 700;
    color: #475569;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
}
tr:hover td {
    background: #f8fafc;
}
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f8fafc;
}
tr:hover td {
    background: #f8fafc;
}
tr td:first-child, tr th:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}
tr td:last-child, tr th:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

/* --- DASHBOARD STATS WIDGETS --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-widget {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 1.35rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: transparent;
    transition: background 0.25s ease;
}

.stat-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.08);
    border-color: #cbd5e1;
}

.stat-widget.primary::before { background: #2563eb; }
.stat-widget.success::before { background: #16a34a; }
.stat-widget.purple::before { background: #9333ea; }
.stat-widget.warning::before { background: #ea580c; }

.stat-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.stat-widget.primary .stat-icon-wrap { background: #eff6ff; color: #2563eb; }
.stat-widget.success .stat-icon-wrap { background: #ecfdf5; color: #16a34a; }
.stat-widget.purple .stat-icon-wrap { background: #faf5ff; color: #9333ea; }
.stat-widget.warning .stat-icon-wrap { background: #fff7ed; color: #ea580c; }

.stat-details {
    display: flex;
    flex-direction: column;
}

.stat-title {
    font-size: 0.775rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-color);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.stat-subtext {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Quick Action Bar */
.quick-actions-bar {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 0.65rem 1.15rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: all 0.2s ease;
}

.quick-action-btn:hover {
    background: #f8fafc;
    border-color: #93c5fd;
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.08);
}

.quick-action-btn i {
    color: var(--primary);
    font-size: 0.95rem;
}

/* System Health Banner */
.health-banner {
    background: linear-gradient(135deg, #f8faff 0%, #eef4ff 100%);
    border: 1px solid #dbeafe;
    border-radius: 18px;
    padding: 1.5rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.health-status-pills {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.health-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #ffffff;
    border: 1px solid #bfdbfe;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e3a8a;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.05);
}

.health-pill .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
}

.health-pill .dot.offline {
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

/* --- INTERACTIVE STEPPER & ACCORDION --- */
.guide-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s ease;
}
.guide-accordion-header:hover {
    opacity: 0.9;
}
.guide-accordion-toggle {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    font-size: 0.85rem;
}
.guide-accordion-toggle.collapsed {
    transform: rotate(-180deg);
}

.guide-body-collapse {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}
.guide-body-collapse.collapsed {
    display: none;
}

/* Horizontal Flow Stepper */
.workflow-stepper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
    position: relative;
}

.step-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.15rem 1.25rem;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.step-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.06);
    transform: translateY(-2px);
}

.step-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.6rem;
}

.step-number {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #eff6ff;
    color: var(--primary);
    border: 1.5px solid #bfdbfe;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-title {
    font-size: 0.925rem;
    font-weight: 700;
    color: var(--text-color);
}

.step-desc {
    font-size: 0.825rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0;
}

/* Dashboard Guideline Cards */
.guide-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
    padding: 1.5rem;
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
    transition: all 0.25s ease;
}
.guide-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(37, 99, 235, 0.08);
    border-color: #bfdbfe;
}
.guide-card h4 {
    color: var(--primary);
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.guide-card ul {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0;
    padding-left: 1.2rem;
    line-height: 1.6;
}

/* Checkbox container */
.checkbox-list {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1rem;
    max-height: 250px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.6rem;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0;
    cursor: pointer;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    border: 1px solid var(--border-color);
    font-size: 0.875rem;
}
.checkbox-item:hover {
    border-color: #93c5fd;
    background: #f8faff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.06);
}

.view-section {
    display: none;
}
.view-section.active {
    display: block;
    animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- STATUS BADGE --- */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.status-idle {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}
.status-running {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}
.status-running i {
    animation: pulse 2s infinite;
}

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

/* --- MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal-overlay.active {
    display: flex;
}
.modal-content {
    background: #ffffff;
    border-radius: 20px;
    padding: 2.25rem 2.5rem;
    width: 90%;
    max-width: 540px;
    position: relative;
    animation: slideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.15);
    border: 1px solid #e2e8f0;
}
.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close:hover {
    color: var(--text-color);
    background: #f1f5f9;
}
.modal-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 700;
}

/* SweetAlert */
div:where(.swal2-container) div:where(.swal2-popup) {
    border-radius: 20px;
    font-family: 'Inter', sans-serif;
}

/* --- FOOTER --- */
.app-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: auto;
}
.app-footer span {
    font-weight: 600;
    color: var(--primary);
}
.login-footer {
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}
.login-footer span {
    font-weight: 600;
    color: var(--text-color);
}

/* --- RESPONSIVE MOBILE --- */
.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 999;
}
.sidebar-overlay.open {
    display: block;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    .sidebar.open {
        left: 0;
    }
    .hamburger {
        display: block;
    }
    .topbar {
        justify-content: space-between;
        padding: 1rem 1.5rem;
    }
    .topbar-status-wrapper {
        justify-content: flex-end;
        gap: 0.5rem !important;
        margin-top: 0.5rem;
    }
    .content-area {
        padding: 1.5rem;
    }
}

/* --- TERMINAL --- */
#terminalBody {
    background: #0f172a !important;
    border-radius: 0;
    padding: 1.5rem !important;
    height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    color: #f8fafc !important;
    font-family: 'Consolas', 'Monaco', monospace !important;
}

.activity-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    animation: fadeIn 0.3s ease;
}

.activity-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 0.9rem;
    margin-top: 2px;
}

.activity-icon.info { color: #3b82f6; }
.activity-icon.success { color: #22c55e; }
.activity-icon.warn { color: #eab308; }
.activity-icon.error { color: #ef4444; }

.activity-content {
    flex: 1;
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: flex-start;
}

.activity-time {
    font-size: 0.85rem;
    color: #64748b;
    white-space: nowrap;
}

.activity-message {
    color: #f8fafc;
    font-size: 0.9rem;
    line-height: 1.5;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Fix SweetAlert z-index behind modals */
.swal2-container { z-index: 9999 !important; }
