/* Reset dasar & Font */
body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #343a40;
}

.app-container {
    display: flex;
}

/* Sidebar Styling */
.sidebar {
    width: 250px;
    background-color: #212529;
    color: #adb5bd;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    transition: width 0.3s ease;
    overflow-x: hidden;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    border-bottom: 1px solid #495057;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #ced4da;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.sidebar-nav a:hover {
    background-color: #495057;
    color: white;
}

.sidebar-nav a i {
    font-size: 1.1rem;
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

/* Main Content Styling */
.main-content {
    flex-grow: 1;
    margin-left: 250px; 
    transition: margin-left 0.3s ease;
    padding: 0;
}

.main-header {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.toggle-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #343a40;
}

.user-info {
    margin-left: auto;
}

.content-wrapper {
    padding: 20px;
}

.info-box {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Style untuk Sidebar Tersembunyi */
body.sidebar-hidden .sidebar {
    width: 60px;
}

body.sidebar-hidden .sidebar .nav-text,
body.sidebar-hidden .sidebar .sidebar-title {
    display: none;
}

body.sidebar-hidden .main-content {
    margin-left: 60px;
}

/* Styling untuk Halaman Konten */
.page-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.btn {
display: inline-block;
padding: 8px 15px;
font-size: 14px;
font-weight: 400;
text-align: center;
text-decoration: none;
vertical-align: middle;
cursor: pointer;
border: 1px solid transparent;
border-radius: 0.25rem;
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
}
.btn-primary {
color: #fff;
background-color: #007bff;
border-color: #007bff;
}
.btn-primary:hover {
background-color: #0069d9;
}
.btn-info {
color: #fff;
background-color: #17a2b8;
}
.btn-info:hover {
background-color: #138496;
}
.btn-sm {
padding: 5px 10px;
font-size: 12px;
}
.card {
background-color: #fff;
border: 1px solid rgba(0,0,0,.125);
border-radius: 0.25rem;
box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card-body {
padding: 20px;
}
.table {
width: 100%;
border-collapse: collapse;
}
.table th, .table td {
padding: 12px;
border-top: 1px solid #dee2e6;
text-align: left;
}
.table thead th {
vertical-align: bottom;
border-bottom: 2px solid #dee2e6;
}

/* =================================
   STYLING UNTUK FORMULIR
   ================================= */
.form-group {
    margin-bottom: 1.25rem; 
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600; 
}

/* Ini akan menata input teks, angka, dan textarea sekaligus */
.form-control {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    box-sizing: border-box; 
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); 
}
/* =================================
   STYLING UNTUK HALAMAN DETAIL PROYEK
   ================================= */

/* KOP Proyek */
.kop-proyek {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.kop-proyek .logo img {
    /* INI BAGIAN PALING PENTING */
    max-height: 80px;
    max-width: 100px; 
    object-fit: contain; 
}

.kop-proyek .instansi-info {
    text-align: left;
}

/* =================================
   STYLING BARU UNTUK SUMMARY KEUANGAN
   ================================= */

/* Tata Letak Grid Utama */
.summary-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 25px 0;
}

/* Styling untuk setiap Box */
.summary-box {
    display: flex;
    align-items: center;
    gap: 15px
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-left: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Styling untuk Lingkaran Ikon */
.summary-icon {
    font-size: 22px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff; 
    flex-shrink: 0; 
}

/* Styling untuk Teks di dalam Box */
.summary-text {
    display: flex;
    flex-direction: column;
}

.summary-text span {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 2px;
}

.summary-text strong {
    font-size: 1.6rem;
    font-weight: 600;
    color: #343a40;
}

/* Pewarnaan Latar Belakang Ikon */
.summary-box.pagu .summary-icon        { background-color: #007bff; }
.summary-box.ppn .summary-icon         { background-color: #6c757d; }
.summary-box.pagu-efektif .summary-icon{ background-color: #20c997; }
.summary-box.pendapatan .summary-icon  { background-color: #17a2b8; }
.summary-box.pengeluaran .summary-icon { background-color: #dc3545; }
.summary-box.sisa .summary-icon        { background-color: #28a745; }



@media (max-width: 992px) {
    .summary-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .summary-container {
        grid-template-columns: 1fr;
    }
    .summary-text strong {
        font-size: 1.4rem; 
    }
}


/* Header di dalam Card */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0,0,0,.125);
}
.card-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.table tfoot th {
    font-weight: bold;
    background-color: #f8f9fa;
}

/* Alert & Badge */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
}
.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.badge {
    display: inline-block;
    padding: 5px 8px;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    color: #fff;
}
.badge-cash { background-color: #28a745; }
.badge-transfer { background-color: #17a2b8; }

.btn-success {
    color: #fff;
    background-color: #28a745;
    border-color: #28a745;
}
.btn-success:hover {
    background-color: #218838;
}

.text-muted {
    color: #6c757d !important;
}

.btn-aksi {
    display: inline-block;
    padding: 5px 8px;
    margin: 0 2px;
    font-size: 12px;
    color: white;
    border-radius: 4px;
    text-decoration: none;
}
.btn-aksi.edit { background-color: #ffc107; } /* Kuning */
.btn-aksi.hapus { background-color: #dc3545; } /* Merah */
.btn-aksi:hover { opacity: 0.8; }

/* Style untuk Badge Status */
.badge-warning { background-color: #ffc107; color: #212529; }
.badge-success { background-color: #28a745; }
.badge-danger { background-color: #dc3545; }
.badge-secondary { background-color: #6c757d; }

/* =================================
   STYLING UNTUK DASHBOARD
   ================================= */

/* Layout Grid Dua Kolom */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr; 
    gap: 20px;
    margin-top: 25px;
}

/* Styling Daftar Aktivitas */
.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.activity-list li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 10px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    transition: background-color 0.2s;
}
.activity-list li:last-child a {
    border-bottom: none;
}
.activity-list li a:hover {
    background-color: #f8f9fa;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}
.activity-icon.project { background-color: #007bff; }
.activity-icon.income { background-color: #28a745; }
.activity-icon.expense { background-color: #dc3545; }

.activity-details {
    flex-grow: 1;
}
.activity-details strong, .activity-details span {
    display: block;
    line-height: 1.4;
}
.activity-details strong { font-weight: 600; color: #343a40; }
.activity-details span { color: #495057; font-size: 0.95rem; }
.activity-details small { color: #6c757d; font-size: 0.85rem; }

.text-success { color: #28a745 !important; }
.text-danger { color: #dc3545 !important; }
.text-muted { color: #6c757d !important; }

.activity-time {
    font-size: 0.8rem;
    color: #6c757d;
    margin-left: auto;
    white-space: nowrap;
}

/* Responsif untuk Dashboard */
@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr; 
    }
    .summary-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Styling untuk Menu Dropdown */
.nav-dropdown-toggle .dropdown-icon { margin-left: auto; transition: transform 0.3s; }
.nav-dropdown-toggle.active .dropdown-icon { transform: rotate(180deg); }
.nav-dropdown-menu { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; background-color: #343a40; }
.nav-dropdown-menu a { padding-left: 55px; /* Indentasi submenu */ }

/* Styling untuk Garis Pemisah di Sidebar */
.sidebar-divider {
    border: 0;
    border-top: 1px solid #495057;
    margin: 1rem 1rem; /* Memberi jarak atas dan bawah */
}

/* Styling untuk Tag Versi Aplikasi di Sidebar Header */
.sidebar-title .version-tag {
    font-size: 0.5em; 
    font-weight: normal; 
    color: #adb5bd; 
    vertical-align: super; 
    margin-left: 5px; 
}

/* Styling untuk Link Profil di Header */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}
.profile-link {
    font-size: 1.4rem;
    color: #6c757d;
    transition: color 0.2s;
}
.profile-link:hover {
    color: #007bff;
}

/* =================================
   STYLING HALAMAN LOGIN MODERN
   ================================= */

/* Body khusus untuk halaman login */
body.login-page {
    background-color: #f6f5f7;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
}

/* Kontainer utama yang memiliki bayangan */
.login-container-modern {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
    position: relative;
    overflow: hidden;
    width: 768px;
    max-width: 100%;
    min-height: 480px;
    display: flex;
}

/* Panel Form (kanan) & Panel Overlay (kiri) */
.form-panel, .overlay-panel {
    width: 50%;
    padding: 0 40px;
}

/* Panel Form (kanan) */
.form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.form-panel form {
    width: 100%;
}

.form-panel h1 {
    font-weight: bold;
    margin: 0 0 20px 0;
}

.form-panel input {
    background-color: #eee;
    border: none;
    padding: 12px 15px;
    margin: 8px 0;
    width: 100%;
    box-sizing: border-box;
    border-radius: 5px;
}

/* Panel Overlay (kiri) */
.overlay-panel {
    background: #00b48a;
    background: -webkit-linear-gradient(to right, #00b48a, #00a079);
    background: linear-gradient(to right, #00b48a, #00a079);
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.overlay-panel h1 {
    font-weight: bold;
    margin: 0;
    font-size: 2rem;
}

.overlay-panel p {
    font-size: 14px;
    font-weight: 100;
    line-height: 20px;
    letter-spacing: 0.5px;
    margin: 20px 0 30px;
}

.overlay-illustration {
    width: 80%;
    max-width: 250px;
    height: auto;
    margin-top: 20px;
}

/* Tombol */
button.login-btn {
    border-radius: 20px;
    border: 1px solid #00b48a;
    background-color: #00b48a;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: bold;
    padding: 12px 45px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: transform 80ms ease-in;
    cursor: pointer;
    margin-top: 20px;
}

button.login-btn:active {
    transform: scale(0.95);
}

button.login-btn:focus {
    outline: none;
}

/* Pesan Error */
.login-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 14px;
}

/* =================================
   MEMBUAT TAMPILAN RESPONSIVE UNTUK LOGIN (VERSI FINAL)
   ================================= */

@media (max-width: 768px) {
    body.login-page {
        height: auto;
        min-height: 100vh;
        align-items: flex-start;
        padding-top: 20px; 
        box-sizing: border-box; 
    }

    .login-container-modern {
        flex-direction: column-reverse;
        width: 100%;
        max-width: 400px;
        min-height: auto;
        margin: 0 auto; 
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        border-radius: 10px;
    }

    .form-panel, .overlay-panel {
        width: 100%;
        box-sizing: border-box; 
    }

    .overlay-panel {
        padding: 30px 20px;
        min-height: auto;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        border-bottom-left-radius: 10px;
        border-bottom-right-radius: 10px;
    }
    
    .overlay-illustration {
        max-width: 150px;
        margin-top: 10px;
    }
    
    .form-panel {
        padding: 30px 20px;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
    }

    .form-panel h1, .overlay-panel h1 {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }

    .overlay-panel p {
        margin: 15px 0 20px;
    }

    .form-panel input {
        padding: 10px 15px;
        margin: 5px 0;
    }

    button.login-btn {
        margin-top: 15px;
    }
}