:root {
    --primary: #0d6efd;
    --primary-dark: #0a58ca;
    --bg-light: #f4f7f6;
    --text-dark: #333;
    --white: #ffffff;
    --shadow: 0 4px 12px rgba(0,0,0,0.1);
}

* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body, html {
    width: 100%; height: 100%;
    background-color: var(--bg-light);
    overflow: hidden; /* Mencegah double scroll */
}

/* --- VIEW MANAGEMENT --- */
.view-section {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
}

.hidden { display: none !important; }

/* --- SPLASH SCREEN --- */
.splash-container {
    background: var(--primary);
    color: white;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.splash-logo { width: 120px; margin-bottom: 20px; }
.splash-title { font-size: 1.2rem; text-align: center; }

/* --- LOGIN CARD --- */
#view-login {
    background: #e9ecef;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.login-card {
    background: var(--white);
    width: 100%; max-width: 400px;
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-align: center;
}
.login-logo { width: 80px; margin-bottom: 10px; }
.app-subtitle { font-size: 0.9rem; color: #666; margin-bottom: 5px; }
.app-title { font-size: 1.2rem; color: var(--primary); margin-bottom: 25px; font-weight: bold; }

/* --- FORM STYLING --- */
.form-group { width: 100%; margin-bottom: 15px; text-align: left; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 600; font-size: 0.9rem; }
.form-control {
    width: 100%; /* 🔥 PATCH: Hapus !important agar Flexbox di HTML bisa bekerja */
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,110,253,0.1); }
.password-field { position: relative; }
.toggle-eye { position: absolute; right: 12px; top: 12px; cursor: pointer; }
.btn-primary {
    width: 100%; padding: 14px;
    background: var(--primary); color: white;
    border: none; border-radius: 8px;
    font-weight: bold; font-size: 1rem;
    cursor: pointer; margin-top: 10px;
}

/* --- APP LAYOUT --- */
.app-header {
    height: 70px; background: var(--primary);
    color: white; padding: 0 20px;
    display: flex; justify-content: space-between; align-items: center;
    box-shadow: var(--shadow);
}
.header-left { display: flex; align-items: center; gap: 15px; }
.btn-burger { background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; }
.header-info h1 { font-size: 1rem; margin: 0; }
.status-badge { font-size: 0.7rem; padding: 2px 8px; border-radius: 10px; }
.online { background: #198754; }
.offline { background: #6c757d; }
.btn-logout-icon { background: none; border: none; font-size: 1.2rem; cursor: pointer; }

/* --- CONTENT AREA --- */
.content-body {
    flex: 1; overflow-y: auto; padding: 20px;
    -webkit-overflow-scrolling: touch;
}
.content-card {
    background: white; padding: 20px; border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* --- SIDEBAR --- */
.sidebar {
    position: fixed; top: 0; left: -280px;
    width: 280px; height: 100%;
    background: white; z-index: 2000;
    transition: 0.3s ease;
    box-shadow: 5px 0 15px rgba(0,0,0,0.1);
}
.sidebar.active { left: 0; }
.sidebar-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 1500;
    display: none;
}
.sidebar-overlay.active { display: block; }
.sidebar-user-box {
    background: var(--primary); color: white;
    padding: 30px 20px; display: flex; align-items: center; gap: 15px;
}
.sidebar-avatar { width: 50px; }
.sidebar-nav { padding: 10px 0; }
.menu-item {
    display: block; padding: 15px 25px;
    text-decoration: none; color: #333;
    border-bottom: 1px solid #f0f0f0; cursor: pointer;
}
.menu-item:hover { background: #f8faff; color: var(--primary); }
.text-danger { color: #dc3545 !important; }

/* --- UTILS --- */
.divider { margin: 20px 0; border: 0; border-top: 1px solid #eee; }
.animate-fade { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
