:root {
    --bg-main: #FAF9F6;
    --sidebar-bg: #2C2420;
    --sidebar-text: #D4C5B0;
    --accent: #A68A64;
    --white: #FFFFFF;
    --danger: #e74c3c;
    --border: #e0e0e0;
    --shadow: 0 4px 20px rgba(0,0,0,0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }
body { background-color: var(--bg-main); color: #333; height: 100vh; overflow: hidden; }
.hidden { display: none !important; }

.login-wrapper { position: fixed; inset: 0; background: var(--bg-main); display: flex; justify-content: center; align-items: center; z-index: 9999; padding: 20px; }
.login-box { background: var(--white); padding: 40px; border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,0.1); width: 100%; max-width: 400px; text-align: center; }
.login-header h2 { font-family: 'Playfair Display', serif; font-size: 2rem; color: var(--sidebar-bg); }
.dot { color: var(--accent); }
.input-group { background: #f5f5f5; border-radius: 8px; padding: 12px; margin-bottom: 15px; display: flex; align-items: center; border: 1px solid transparent; transition: 0.3s; }
.input-group:focus-within { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(166, 138, 100, 0.1); }
.input-group input { border: none; background: transparent; outline: none; width: 100%; margin-left: 10px; }
.error-msg { color: var(--danger); font-size: 0.9rem; margin-top: 10px; }
#login-form { width: 100%; margin-top: 20px; }

/* LAYOUT */
.dashboard-layout { display: flex; height: 100vh; position: relative; }
.sidebar { width: 260px; background-color: var(--sidebar-bg); color: var(--sidebar-text); display: flex; flex-direction: column; padding: 20px; transition: 0.3s; z-index: 1000; }
.brand { margin-bottom: 40px; text-align: center; position: relative; }
.brand h3 { color: var(--white); font-family: 'Playfair Display'; font-size: 1.5rem; }
.close-sidebar-btn { display: none; position: absolute; right: 0; top: 0; background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; }

.menu { display: flex; flex-direction: column; gap: 10px; }
.menu-item { background: none; border: none; color: var(--sidebar-text); padding: 12px 15px; text-align: left; cursor: pointer; border-radius: 8px; transition: 0.3s; font-size: 0.95rem; display: flex; align-items: center; gap: 12px; text-decoration: none; }
.menu-item:hover, .menu-item.active { background-color: rgba(255,255,255,0.1); color: var(--white); }
.divider { height: 1px; background: rgba(255,255,255,0.1); margin: 20px 0; }
.logout { color: #ff6b6b; }

.main-content { flex: 1; padding: 30px; overflow-y: auto; width: 100%; }
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.top-bar-left { display: flex; align-items: center; gap: 15px; }
.sidebar-toggle { display: none; background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--sidebar-bg); }
.user-profile { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.avatar { width: 40px; height: 40px; background: var(--accent); color: var(--white); border-radius: 50%; display: flex; align-items: center; justify-content: center; }

.btn-primary, .btn-primary-full { background-color: var(--sidebar-bg); color: var(--white); border: none; padding: 12px 24px; border-radius: 8px; cursor: pointer; transition: 0.3s; font-weight: 500; }
.btn-primary-full { width: 100%; }
.btn-primary:hover { background-color: var(--accent); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.stat-card { background: var(--white); padding: 20px; border-radius: 12px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 20px; }
.stat-icon { width: 50px; height: 50px; background: #fdf5e6; color: var(--accent); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.stat-info h4 { font-size: 0.9rem; color: #888; }
.stat-info span { font-size: 1.5rem; font-weight: 700; color: var(--sidebar-bg); }

.table-container { background: var(--white); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); margin-top: 20px; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 500px; /* Ensure scrolling on small screens */ }
.data-table th, .data-table td { padding: 15px; text-align: left; border-bottom: 1px solid #eee; }
.data-table th { color: #888; font-weight: 500; font-size: 0.9rem; }
.thumb-img { width: 50px; height: 50px; object-fit: cover; border-radius: 6px; }
.btn-delete { background: #ffe5e5; color: var(--danger); border: none; padding: 8px 12px; border-radius: 6px; cursor: pointer; transition: 0.2s; }
.btn-delete:hover { background: var(--danger); color: white; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; justify-content: center; align-items: center; padding: 15px; }
.modal-box { background: var(--white); width: 100%; max-width: 500px; border-radius: 12px; padding: 30px; }
.modal-header { display: flex; justify-content: space-between; margin-bottom: 20px; }
.close-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; }
.input-clean { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 15px; outline: none; }
.input-clean:focus { border-color: var(--accent); }
.input-group-modern { margin-bottom: 15px; }

.toast { position: fixed; bottom: 30px; right: 30px; background: var(--sidebar-bg); color: var(--white); padding: 15px 25px; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); animation: slideIn 0.3s; z-index: 2000; }
@keyframes slideIn { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* --- ADMIN RESPONSIVE --- */
@media (max-width: 768px) {
    .sidebar { position: fixed; left: -100%; top: 0; height: 100%; width: 80%; max-width: 300px; box-shadow: 5px 0 20px rgba(0,0,0,0.2); }
    .sidebar.active { left: 0; }
    .close-sidebar-btn { display: block; }
    .sidebar-toggle { display: block; }
    .main-content { padding: 20px; }
    .hide-mobile { display: none; }
    .stat-card { padding: 15px; }
    .modal-box { padding: 20px; }
}

/* TAMBAHAN UNTUK FORM BUILDER (Grid & Tab) */
.form-grid-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; margin-top: 20px; }
.tab-btn { background: none; border: none; padding: 10px 15px; cursor: pointer; font-weight: 500; font-size: 1rem; color: #888; transition: 0.3s; }
.tab-btn.active { color: var(--sidebar-bg); border-bottom: 2px solid var(--accent); }
