:root {
    --primary: #0f172a;
    --secondary: #3b82f6;
    --accent: #eff6ff;
    --success: #10b981;
    --danger: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #cbd5e1; /* Sedikit digelapkan agar tabel lebih jelas */
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }
body { display: flex; background-color: var(--bg-color); min-height: 100vh; color: var(--text-main); }

h1, h2, h3 { color: var(--primary); font-weight: 600; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 25px; }
.mb-2 { margin-bottom: 10px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); font-size: 0.9rem; }

/* Sidebar */
.sidebar { width: 280px; background: var(--card-bg); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 1000; transition: all 0.3s ease; }
.sidebar-header { padding: 30px 20px; text-align: center; border-bottom: 1px solid var(--border); }
.logo-icon { font-size: 2.5rem; color: var(--secondary); margin-bottom: 10px; }
.sidebar-header p { font-size: 0.8rem; color: var(--text-muted); }
.nav-links { list-style: none; padding: 20px 10px; flex: 1; }
.nav-links li { padding: 12px 20px; margin-bottom: 5px; border-radius: 8px; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-weight: 500; }
.nav-links li:hover { background: var(--accent); color: var(--secondary); transform: translateX(5px); }
.nav-links li.active { background: var(--secondary); color: white; box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); }

/* Status Indikator Database */
.status { padding: 8px 15px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; display: flex; align-items: center; gap: 8px; justify-content: center; background: #e2e8f0; color: #475569; transition: all 0.3s ease; }
.status.connected { background: #dcfce7; color: #166534; }
.status.disconnected { background: #fee2e2; color: #991b1b; }

/* Main Content & Header */
.main-content { flex: 1; padding: 30px; overflow-y: auto; height: 100vh; }
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.subtitle { font-size: 0.9rem; color: var(--text-muted); }
.header-user { display: flex; align-items: center; gap: 10px; background: var(--card-bg); padding: 8px 15px; border-radius: 30px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.avatar { background: var(--accent); color: var(--secondary); width: 35px; height: 35px; border-radius: 50%; display: flex; justify-content: center; align-items: center; }

/* Menu Sections */
.menu-section { display: none; opacity: 0; transition: opacity 0.3s ease; }
.menu-section.active { display: block !important; opacity: 1; }

/* Dashboard Cards (4 Kolom) */
.summary-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 20px; }
.card { padding: 25px; border-radius: 16px; display: flex; justify-content: space-between; align-items: center; color: white; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.card::after { content: ''; position: absolute; right: -20px; top: -20px; width: 100px; height: 100px; background: rgba(255,255,255,0.1); border-radius: 50%; }
.bg-gradient-blue { background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%); }
.bg-gradient-green { background: linear-gradient(135deg, #064e3b 0%, #10b981 100%); }
.bg-gradient-red { background: linear-gradient(135deg, #7f1d1d 0%, #ef4444 100%); }
.bg-gradient-orange { background: linear-gradient(135deg, #ea580c 0%, #f97316 100%); }
.card h3 { color: rgba(255,255,255,0.8); font-size: 0.9rem; font-weight: 500; margin-bottom: 5px; }
.card .amount { font-size: 1.8rem; font-weight: 700; }
.card-icon { font-size: 2.5rem; opacity: 0.8; }

/* Containers */
.form-container, .table-container, .chart-container { background: var(--card-bg); padding: 25px; border-radius: 16px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.section-title { margin-bottom: 20px; border-bottom: 2px solid var(--accent); padding-bottom: 10px; }
.section-title h3 { font-size: 1.1rem; display: flex; align-items: center; gap: 10px; }

/* Forms & UI Elements */
.form-glass { background: linear-gradient(145deg, #ffffff, #f8fafc) !important; border: 1px solid rgba(59, 130, 246, 0.1) !important; }
.input-standard { width: 100%; padding: 12px 15px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; outline: none; transition: 0.3s; font-size: 0.95rem; }
.input-standard:focus { border-color: var(--secondary); background: white; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
label { display: block; margin-bottom: 8px; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }

/* Buttons */
.btn-glow { background: linear-gradient(135deg, var(--secondary), #2563eb); color: white; padding: 10px 15px; border: none; border-radius: 8px; font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3); }
.btn-glow:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(59, 130, 246, 0.4); }
.btn-more-sm { background: #f8fafc; color: var(--secondary); border: 1px solid #cbd5e1; padding: 6px 12px; border-radius: 6px; font-size: 0.8rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease; display: inline-block; margin: 2px; }
.btn-more-sm:hover { background: var(--accent); border-color: var(--secondary); transform: translateY(-1px); }
.btn-del { background: #fee2e2; color: var(--danger); padding: 6px 12px; border: none; border-radius: 6px; cursor: pointer; transition: 0.2s; font-size: 0.8rem; font-weight: 600; margin: 2px;}
.btn-del:hover { background: var(--danger); color: white; }

/* Table Header Controls */
.table-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 2px solid var(--accent); padding-bottom: 15px; flex-wrap: wrap; gap: 15px; }
.table-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-box { position: relative; }
.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-box input { padding: 10px 12px 10px 35px; width: 250px; border: 1px solid var(--border); border-radius: 8px; background: #f8fafc; outline: none; transition: 0.3s; }
.search-box input:focus { border-color: var(--secondary); background: white; }

/* Desain Tabel Baru Rapi */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 8px; border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.data-table th, .data-table td { padding: 12px 15px; border: 1px solid var(--border); text-align: left; font-size: 0.85rem; }
.data-table th { background-color: #f1f5f9; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: 0.5px; position: sticky; top: 0; z-index: 1; }
.data-table tbody tr { transition: background 0.2s; }
.data-table tbody tr:nth-child(even) { background-color: #fafafa; }
.data-table tbody tr:hover { background-color: #eff6ff; }

/* Info Footer Tabel */
.table-footer { display: flex; justify-content: space-between; padding: 5px 5px; }

/* Badges */
.history-badge { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; margin: 2px; }
.badge-in { background: #dcfce7; color: #166534; }
.badge-out { background: #fee2e2; color: #991b1b; }
.badge-count { background: var(--accent); color: var(--secondary); padding: 4px 10px; border-radius: 20px; font-weight: 700; font-size: 0.85rem; border: 1px solid #bfdbfe; }

/* MOBILE RESPONSIVE */
.mobile-menu-btn { display: none; background: transparent; border: none; font-size: 1.6rem; color: var(--primary); cursor: pointer; transition: 0.3s; }
.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: rgba(0,0,0,0.6); z-index: 999; opacity: 0; transition: opacity 0.3s ease; }
.sidebar-overlay.active { display: block; opacity: 1; }
.header-left { display: flex; align-items: center; gap: 15px; }
.header-right { display: flex; align-items: center; gap: 15px; }

@media (max-width: 1200px) {
    .summary-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }
    .sidebar { position: fixed; left: -280px; top: 0; height: 100vh; width: 280px; z-index: 1000; transition: left 0.3s ease; box-shadow: 4px 0 15px rgba(0,0,0,0.1); }
    .sidebar.active { left: 0; }
    .main-content { padding: 15px; }
    header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .header-right { width: 100%; justify-content: space-between; flex-direction: row-reverse; }
    .user-name { display: none; } 
    h1 { font-size: 1.4rem; }
    .subtitle { font-size: 0.8rem; }
    .status { font-size: 0.75rem; padding: 6px 10px; }
    .summary-cards { grid-template-columns: 1fr; }
    .table-header { flex-direction: column; align-items: stretch; gap: 10px; }
    .table-controls { flex-direction: column; width: 100%; align-items: stretch; }
    .search-box input { width: 100%; }
    .swal2-popup { width: 95% !important; padding: 15px !important; }
}

.logo-img {
    width: 75px;
    height: 75px;
    object-fit: contain; 
    margin-bottom: 10px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1)); 
}
