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

:root {
    --primary: #0F2027;
    --accent: #1e5dd9;
    --bg-light: #f4f7fa;
    --sidebar-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #888888;
    --border: #e2e8f0;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background-color: var(--bg-light); color: var(--text-main); display: flex; }

/* Login Page */
.login-bg { background-color: var(--bg-light); justify-content: center; align-items: center; height: 100vh; }
.login-container { background: #fff; padding: 40px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); width: 100%; 
max-width: 400px; }
.login-header h2 { color: var(--accent); margin-bottom: 5px; }
.login-header p { color: var(--text-muted); font-size: 14px; margin-bottom: 30px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; }
.form-group input, .form-group select { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 4px; outline: 
none; }
.form-group input:focus { border-color: var(--accent); }
.btn { padding: 10px 15px; border: none; border-radius: 4px; cursor: pointer; font-weight: 500; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-block { width: 100%; }
.alert { padding: 10px; border-radius: 4px; margin-bottom: 20px; font-size: 14px; }
.alert-danger { background: #fee2e2; color: #991b1b; }

/* Dashboard Layout */
.sidebar { width: 260px; background: var(--sidebar-bg); height: 100vh; border-right: 1px solid var(--border); position: fixed; 
overflow-y: auto; z-index: 100; transition: 0.3s; }
.sidebar-logo { padding: 20px; text-align: center; border-bottom: 1px solid var(--border); }
.sidebar-logo h3 { color: var(--accent); font-weight: 700; letter-spacing: 1px;}
.menu-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; margin: 20px 20px 10px; font-weight: 600; }
.sidebar-menu { list-style: none; }
.sidebar-menu li a { display: flex; align-items: center; padding: 12px 20px; color: var(--text-main); text-decoration: none; 
font-size: 14px; transition: 0.2s; }
.sidebar-menu li a i { width: 20px; margin-right: 10px; color: var(--text-muted); }
.sidebar-menu li a:hover, .sidebar-menu li a.active { background: #f0f4ff; color: var(--accent); border-right: 3px solid 
var(--accent); }
.sidebar-menu li a.active i { color: var(--accent); }

.main-content { margin-left: 260px; width: calc(100% - 260px); min-height: 100vh; transition: 0.3s; display: flex; flex-direction: column;}
.topbar { background: #fff; height: 60px; padding: 0 30px; display: flex; justify-content: space-between; align-items: center; 
border-bottom: 1px solid var(--border); }
.menu-toggle { cursor: pointer; font-size: 20px; }
.user-profile { cursor: pointer; font-size: 14px; font-weight: 500; }

.content { padding: 30px; }
.page-title { margin-bottom: 20px; font-size: 20px; font-weight: 600; }

/* Cards & Tables */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); display: flex; 
align-items: center; border: 1px solid var(--border);}
.stat-icon { width: 45px; height: 45px; border-radius: 50%; background: #f0f4ff; color: var(--accent); display: flex; 
justify-content: center; align-items: center; font-size: 20px; margin-right: 15px; }
.stat-info h4 { font-size: 24px; color: var(--text-main); }
.stat-info p { font-size: 12px; color: var(--text-muted); }

.data-card { background: #fff; border-radius: 8px; border: 1px solid var(--border); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 20px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { background: #f9fafb; font-weight: 600; color: var(--text-muted); }
.badge { padding: 5px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }

@media (max-width: 768px) {
    .sidebar { left: -260px; }
    .sidebar.active { left: 0; }
    .main-content { margin-left: 0; width: 100%; }
}

/* Topbar & Dropdown Styling */
        .topbar { background: var(--sidebar-bg); border-bottom: 1px solid var(--border); }
        .user-profile-wrap { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 5px 10px; border-radius: 6px; user-select: none; position: relative; }
        .user-profile-wrap:hover { background: rgba(0,0,0,0.05); }
        html.dark-mode .user-profile-wrap:hover { background: rgba(255,255,255,0.05); }
        .user-text { text-align: right; line-height: 1.2; }
        .user-text strong { display: block; font-size: 15px; color: var(--text-main); }
        .user-text small { font-size: 12px; color: var(--text-muted); font-weight: 400; }
        .dropdown-menu {
            position: absolute; top: 100%; right: 0; margin-top: 10px;
            background: var(--sidebar-bg); border: 1px solid var(--border);
            border-radius: 8px; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
            width: 220px; display: none; flex-direction: column; z-index: 9999;
            overflow: hidden;
        }
        .dropdown-menu.show { display: flex; }
        .dropdown-menu a { padding: 12px 20px; text-decoration: none; color: var(--text-main); font-size: 14px; display: flex; align-items: center; gap: 12px; transition: 0.2s; }
        .dropdown-menu a:hover { background: #f8fafc; }
        .dropdown-menu hr { border: none; border-top: 1px solid var(--border); margin: 0; }
.app-footer {
            padding: 20px 30px; text-align: right; font-size: 13px; color: var(--text-muted); text-align: center; /* Diubah menjadi center */
            border-top: 1px solid var(--border); background: var(--sidebar-bg); margin-top: auto;
        }
        
        /* =========================================
   DARK MODE STYLES
   ========================================= */
html.dark-mode body {
    --bg-light: #0f172a;
    --sidebar-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    background-color: var(--bg-light);
    color: var(--text-main);
}

/* Penyesuaian elemen saat Dark Mode aktif */
html.dark-mode .sidebar { background: var(--sidebar-bg); border-color: var(--border); }
html.dark-mode .topbar { background: var(--sidebar-bg); border-color: var(--border); }
html.dark-mode .app-footer { background: var(--sidebar-bg); border-color: var(--border); }
html.dark-mode .data-card, 
html.dark-mode .stat-card, 
html.dark-mode .modal-content { 
    background: #1e293b; 
    border-color: #334155; 
}
html.dark-mode table th { background: #0f172a; color: #f8fafc; border-color: #334155; }
html.dark-mode table td { border-color: #334155; }
html.dark-mode input, 
html.dark-mode select { 
    background: #0f172a; 
    color: #f8fafc; 
    border-color: #475569; 
}
html.dark-mode .dropdown-menu { background: #1e293b; border-color: #334155; }
html.dark-mode .dropdown-menu a:hover { background: #0f172a; }
html.dark-mode .user-profile-wrap:hover { background: rgba(255,255,255,0.05); }

/* Warna Menu Sidebar di Dark Mode */
html.dark-mode .sidebar-menu li a { color: #cbd5e1; }
html.dark-mode .sidebar-menu li a:hover { color: #60a5fa; }
html.dark-mode .sidebar-menu li a.active { background: #334155; color: #60a5fa; }