/* File: dashboard/css/style.css */
:root {
    --bg-main: #f4f6f9;
    --bg-card: #ffffff;
    --bg-sidebar: #1e293b;
    --text-main: #333333;
    --text-sidebar: #cbd5e1;
    --border-color: #e2e8f0;
    --primary: #0ea5e9;
    --primary-hover: #0284c7;
    --success: #10b981;
    --danger: #ef4444;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
}

[data-theme="dark"] {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #0b1120;
    --text-main: #f8fafc;
    --text-sidebar: #94a3b8;
    --border-color: #334155;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: background-color 0.3s, color 0.3s;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    overflow-x: hidden;
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--bg-sidebar);
    color: var(--text-sidebar);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: width 0.3s ease, transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 25px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    white-space: nowrap;
}

.icon-logo {
    font-size: 1.5rem;
    color: var(--primary);
    margin-right: 15px;
    min-width: 30px;
}

.sidebar-menu {
    list-style: none;
    margin-top: 20px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: var(--text-sidebar);
    text-decoration: none;
    font-size: 1rem;
    white-space: nowrap;
    transition: all 0.2s;
}

.sidebar-menu li a i {
    font-size: 1.2rem;
    min-width: 30px;
    margin-right: 15px;
}

.sidebar-menu li.active a, 
.sidebar-menu li a:hover {
    background-color: rgba(255,255,255,0.05);
    color: var(--primary);
    border-left: 4px solid var(--primary);
}

.sidebar.collapsed { width: var(--sidebar-collapsed-width); }
.sidebar.collapsed .logo-text, .sidebar.collapsed .menu-text { display: none; }

/* --- MAIN CONTENT --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    width: 100%;
}

.main-content.expanded { margin-left: var(--sidebar-collapsed-width); }

/* --- TOPBAR --- */
.topbar {
    height: 70px;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left, .topbar-right { display: flex; align-items: center; gap: 20px; }
.btn-icon { background: transparent; border: none; color: var(--text-main); font-size: 1.2rem; cursor: pointer; padding: 8px; border-radius: 50%; outline: none; }
.btn-icon:hover { background-color: rgba(0,0,0,0.05); }
[data-theme="dark"] .btn-icon:hover { background-color: rgba(255,255,255,0.1); }
.user-profile { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.avatar { width: 35px; height: 35px; background-color: var(--primary); color: white; border-radius: 50%; display: flex; justify-content: center; align-items: center; }

/* --- CONTENT AREA & CARD --- */
.content-area { padding: 30px; }
.card { background-color: var(--bg-card); padding: 25px; border-radius: 10px; border: 1px solid var(--border-color); box-shadow: 0 2px 10px rgba(0,0,0,0.02); }
.status-card h1 { color: var(--primary); margin-top: 10px; font-size: 2.5rem; }

/* --- TABLE STYLING --- */
.table-responsive { width: 100%; overflow-x: auto; margin-top: 15px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(--border-color); }
.data-table th { background-color: rgba(0,0,0,0.02); font-weight: 600; }
[data-theme="dark"] .data-table th { background-color: rgba(255,255,255,0.05); }
.badge { padding: 5px 10px; border-radius: 20px; font-size: 0.85rem; font-weight: bold; color: white; }
.badge.pemasukan { background-color: var(--success); }
.badge.pengeluaran { background-color: var(--danger); }

/* --- OVERLAY (Mobile) --- */
.sidebar-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); z-index: 90; display: none; opacity: 0; transition: opacity 0.3s; }
.sidebar-overlay.active { display: block; opacity: 1; }

/* --- BUTTON STYLES --- */
.btn-primary, .btn-secondary { padding: 10px 20px; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 0.95rem; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary { background-color: var(--primary); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-secondary { background-color: rgba(0,0,0,0.1); color: var(--text-main); }
[data-theme="dark"] .btn-secondary { background-color: rgba(255,255,255,0.1); }
.btn-secondary:hover { opacity: 0.8; }

/* --- MODAL POPUP --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); z-index: 200; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-card { background-color: var(--bg-card); width: 100%; max-width: 450px; border-radius: 12px; padding: 25px; box-shadow: 0 10px 30px rgba(0,0,0,0.2); transform: translateY(-20px); transition: transform 0.3s; border: 1px solid var(--border-color); }
.modal-overlay.active .modal-card { transform: translateY(0); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }

/* --- FORM INPUTS --- */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; font-size: 0.95rem; }
.form-control { width: 100%; padding: 12px 15px; border: 1px solid var(--border-color); border-radius: 6px; background-color: var(--bg-main); color: var(--text-main); font-size: 1rem; outline: none; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2); }

/* --- RESPONSIVITAS (MOBILE) --- */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.mobile-open { transform: translateX(0); width: var(--sidebar-width); }
    .sidebar.mobile-open .logo-text, .sidebar.mobile-open .menu-text { display: inline; }
    .main-content { margin-left: 0 !important; }
    .topbar { padding: 0 15px; }
    .content-area { padding: 15px; }
    .status-card h1 { font-size: 2rem; }
}