/* ===================================
   1. BASE & THEME VARIABLES (MODERN GREEN VIBE)
=================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    /* Modern Green Color Palette */
    --primary: #10b981; /* Emerald Green */
    --primary-hover: #059669; /* Darker Emerald */
    --bg-body: #f8fafc; /* Very soft slate-gray background */
    --bg-surface: #ffffff;
    
    --text-main: #0f172a; /* Slate dark text (very professional) */
    --text-muted: #64748b; /* Slate gray for labels */
    
    --success-bg: #d1fae5;
    --success-text: #059669;
    
    --danger-bg: #fee2e2;
    --danger-text: #dc2626;

    --radius-lg: 20px;
    --radius-md: 12px;
    
    /* Shadows adjusted to fit the slate/green theme */
    --shadow-soft: 0px 4px 20px rgba(15, 23, 42, 0.04);
    --shadow-hover: 0px 10px 25px rgba(15, 23, 42, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background: var(--bg-body);
    color: var(--text-main);
}

/* ===================================
   2. LAYOUT
=================================== */
.wrapper {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

.main-content {
    margin-left: 280px;
    width: calc(100% - 280px);
    transition: 0.3s ease-in-out;
}

.content-wrapper {
    padding: 0 30px 30px 30px;
}

/* ===================================
   3. LIGHT SIDEBAR (CLEAN STYLE)
=================================== */
.sidebar {
    width: 280px;
    background: var(--bg-surface);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    transition: 0.3s ease-in-out;
    z-index: 1000;
    border-right: 1px solid #f1f5f9;
}

.sidebar .logo {
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar .logo h4 {
    color: var(--text-main);
    font-weight: 800;
    font-size: 24px;
    margin: 0;
    letter-spacing: 0.5px;
}

.sidebar .user-box {
    display: none; 
}

.sidebar-menu {
    padding: 0 20px;
}

.menu-title {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 25px 10px 10px;
}

.sidebar .nav-link {
    color: var(--text-muted);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: 0.3s ease;
    border-radius: var(--radius-md);
    margin-bottom: 5px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
}

.sidebar .nav-link i {
    font-size: 18px;
}

.sidebar .nav-link:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.sidebar .nav-link.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.25); /* Glowing green shadow */
}

/* ===================================
   4. TOPBAR (SEAMLESS)
=================================== */
.topbar {
    background: transparent;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.topbar-left h3 {
    color: var(--text-main);
    font-weight: 800;
    font-size: 28px;
    margin: 0;
}

.topbar-left small {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
}

.menu-toggle,
.icon-btn {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: var(--bg-surface);
    color: var(--text-muted);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: 0.3s;
    font-size: 18px;
    border: 1px solid #f1f5f9;
}

.menu-toggle:hover,
.icon-btn:hover {
    color: var(--primary);
    transform: translateY(-2px);
    border-color: var(--primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-profile {
    background: var(--bg-surface);
    padding: 6px 16px 6px 6px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    border: 1px solid #f1f5f9;
}

.user-profile span {
    font-weight: 700;
    color: var(--text-main);
    font-size: 14px;
}

.avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
}

/* ===================================
   5. CARDS & DASHBOARD BOX
=================================== */
.modern-card,
.dashboard-box {
    background: var(--bg-surface);
    border: 1px solid #f1f5f9; /* Subtle border to pop from bg */
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    transition: 0.3s ease;
    height: 100%;
}

.modern-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card-header-custom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header-custom span {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.card-value {
    font-size: clamp(1.4rem, 2vw, 1.8rem);
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    margin: 0;
}

.card-icon {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    flex-shrink: 0;
}

.income-icon {
    background: var(--success-bg);
    color: var(--success-text);
}

.expense-icon {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.dashboard-box h4,
.dashboard-box h5 {
    color: var(--text-main);
    font-weight: 800;
    margin-bottom: 20px;
}

.chart-container,
.placeholder-box {
    min-height: 350px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ===================================
   6. FULLCALENDAR TWEAKS (MODERN CLEAN)
=================================== */
.fc {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Hilangkan semua garis tabel/grid bawaan yang kaku */
.fc-theme-standard td, .fc-theme-standard th, .fc-theme-standard .fc-scrollgrid {
    border: none !important;
}

/* Rapihkan header hari (Sen, Sel, Rab...) */
.fc-col-header-cell {
    padding-bottom: 10px;
}
.fc-col-header-cell-cushion {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    text-decoration: none !important;
}

/* Tengahin angka tanggal */
.fc-daygrid-day-top {
    justify-content: center !important;
    padding-top: 6px !important;
}
.fc-daygrid-day-number {
    font-weight: 700 !important;
    font-size: 14px;
    color: var(--text-main) !important;
    text-decoration: none !important;
}

/* Bentuk kotak (Frame) per tanggal */
.fc-daygrid-day-frame {
    margin: 3px !important; /* Jarak antar tanggal */
    min-height: 45px !important; /* Biar ngga terlalu panjang ke bawah */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent !important; /* Siapin border transparan */
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: 0.2s ease;
}

/* ==== STYLE JIKA ADA TRANSAKSI (BORDER KUNING/ORANGE) ==== */
.has-transaction .fc-daygrid-day-frame {
    border-color: #f59e0b !important; /* Border kuning/orange ala referensi */
}
/* Titik kecil notifikasi di pojok kanan atas */
.has-transaction .fc-daygrid-day-frame::after {
    content: "";
    position: absolute;
    top: 4px;
    right: 6px;
    width: 6px;
    height: 6px;
    background: #f59e0b;
    border-radius: 50%;
}

/* ==== STYLE SAAT TANGGAL DIKLIK ==== */
.fc-day-selected .fc-daygrid-day-frame {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}
.fc-day-selected .fc-daygrid-day-number {
    color: white !important;
}
.fc-day-selected.has-transaction .fc-daygrid-day-frame::after {
    background: white; /* Ubah warna titik jadi putih kalau lagi diklik */
}

/* Tombol Navigasi Kalender */
.fc .fc-button-primary {
    background: #f1f5f9 !important;
    color: var(--text-main) !important;
    border: none !important;
    border-radius: 8px !important;
    font-weight: 700;
    text-transform: capitalize;
    box-shadow: none !important;
}
.fc .fc-button-primary:hover,
.fc .fc-button-primary:not(:disabled).fc-button-active {
    background: var(--primary) !important;
    color: white !important;
}
.fc-toolbar-title {
    font-size: 1.25rem !important;
    font-weight: 800 !important;
    color: var(--text-main);
}

/* ===================================
   7. FIX MOBILE RESPONSIVE
=================================== */
@media (max-width: 992px) {
    .sidebar { width: 90px; }
    .main-content { margin-left: 90px; width: calc(100% - 90px); }
    .menu-title, .sidebar .nav-link span { display: none; }
    .sidebar .logo { padding: 30px 0; justify-content: center; }
    .sidebar .logo h4 { display: none; }
    .sidebar .logo::before { 
        content: "B"; 
        font-size: 28px; 
        font-weight: 800; 
        color: white; 
        background: var(--primary);
        width: 50px; height: 50px;
        display: flex; justify-content: center; align-items: center;
        border-radius: 12px;
        box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
    }
    .sidebar .nav-link { justify-content: center; padding: 14px 0; margin: 5px 15px; }
    .sidebar .nav-link i { margin: 0; font-size: 22px; }
}

@media (max-width: 768px) {
    .wrapper { overflow-x: hidden; }
    
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(15, 23, 42, 0.05);
    }
    
    .main-content { margin-left: 0; width: 100%; }
    
    .sidebar.collapsed { transform: translateX(0); }
    .sidebar.collapsed + .main-content { margin-left: 0; width: 100%; }

    .content-wrapper { padding: 0 16px 20px 16px; }
    
    .topbar {
        padding: 20px 16px;
        flex-wrap: nowrap; 
        gap: 10px;
    }
    
    .topbar-left { gap: 10px; }
    .topbar-left h3 {
        font-size: 1.1rem; 
        white-space: nowrap;
    }
    .topbar-left small { font-size: 0.75rem; }

    .topbar-right { gap: 8px; }
    
    .user-profile span, .user-profile .bi-chevron-down { display: none; }
    
    .user-profile {
        padding: 0;
        background: transparent;
        box-shadow: none;
        border: none;
    }
    
    .menu-toggle, .icon-btn {
        width: 40px;
        height: 40px;
    }

    .modern-card { padding: 20px; }
    .card-header-custom { align-items: center; }
    .card-value {
        font-size: 1.3rem;
        margin-top: 4px;
    }
    .card-icon {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .dashboard-box { padding: 16px; }
    .chart-container, .placeholder-box { min-height: 250px; }
}

/* ===================================
   SIDEBAR COLLAPSE FIX (DESKTOP)
=================================== */
@media (min-width: 993px) {
    .sidebar.collapsed { 
        width: 90px; 
    }
    
    .sidebar.collapsed + .main-content { 
        margin-left: 90px; 
        width: calc(100% - 90px); 
    }
    
    .sidebar.collapsed .logo h4,
    .sidebar.collapsed .menu-title,
    .sidebar.collapsed .nav-link span,
    .sidebar.collapsed .user-box { 
        display: none; 
    }
    
    .sidebar.collapsed .logo { 
        padding: 30px 0 20px; 
        justify-content: center; 
    }
    
    .sidebar.collapsed .logo::before { 
        content: "B"; 
        font-size: 24px; 
        font-weight: 800; 
        color: white; 
        background: var(--primary);
        width: 48px; 
        height: 48px;
        display: flex; 
        justify-content: center; 
        align-items: center;
        border-radius: 12px;
        box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
    }
    
    /* Sentralisasi menu biar pas di tengah sidebar */
    .sidebar.collapsed .sidebar-menu {
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    /* Bikin menu item bentuknya presisi (kotak rounded) & kasih jarak */
    .sidebar.collapsed .nav-link { 
        justify-content: center; 
        padding: 0; 
        margin: 8px 0; 
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }
    
    .sidebar.collapsed .nav-link i { 
        margin: 0; 
        font-size: 22px; 
    }
}

/* Warna buat header yang lagi aktif disortir */
.sort-active {
    color: var(--primary) !important;
    font-weight: bold;
}

/* Panah default warna abu-abu */
.arrow-icon {
    font-size: 12px; 
    color: #cbd5e1; /* Abu-abu default */
    transition: color 0.3s;
}

/* Panah warna hijau emerald kalau aktif */
.arrow-active {
    color: #10b981 !important; /* Hijau Emerald pas aktif */
}