html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; 
    font-family: 'Roboto', sans-serif !important;
    background-color: #f8f9fa;
    color: #333333;
}

h1, h2, h3, h4, h5, h6, .fw-bold {
    font-family: 'Inter', sans-serif !important;
    letter-spacing: -0.02em;
}

:root {
    --dark-green: #102a14;
    --error-red: #dc3545;
    background-color: #f8f9fa;
}

::view-transition-group(root) {
    animation-duration: 0s;
}

.bg-dark-green { background-color: var(--dark-green) !important; }
.text-dark-green { color: var(--dark-green) !important; }

.table thead.bg-dark-green th {
    background-color: var(--dark-green) !important;
    color: white !important; 
    border-bottom: none;    
}

.table thead th {
    line-height: 1 !important;
    padding-top: 10px !important; 
    padding-bottom: 10px !important;
    vertical-align: middle;
}

.btn-dark-green {
    background-color: var(--dark-green) !important;
    color: white !important;
    border-radius: 4px;
    border: none;
    transition: background-color 0.3s ease;
}

.btn-dark-green:hover {
    background-color: #0a1b0d !important;
    color: white !important;
}



.btn-outline-danger {
    color: var(--error-red);
    border-color: var(--error-red);
    background-color: transparent;
    transition: all 0.2s;
}

.btn-outline-danger:hover {
    background-color: var(--error-red);
    color: white;
}

/* ==========================================
   VIEW TRANSITIONS API (KUNCI SIDEBAR & NAVBAR)
   ========================================== */

/* 0. SAKLAR UTAMA (WAJIB ADA UNTUK MPA) */
@view-transition {
    navigation: auto;
}

/* 1. Matikan animasi pudar bawaan browser untuk SELURUH halaman */
::view-transition-old(root),
::view-transition-new(root) {
    animation: none !important;
    mix-blend-mode: normal;
}

/* 2. Kunci Navbar agar tidak ikut kedip */
.navbar {
    view-transition-name: main-navbar;
    contain: layout;
}

/* 3. Kunci Sidebar agar tetap diam di tempat */
#sidebar {
    view-transition-name: main-sidebar;
    contain: layout;
}

/* 4. Biarkan hanya konten tengah yang bertransisi */
/* Saat halaman baru terbuka, buat konten tengah pudar sebentar 
   agar browser selesai merender sidebar & navbar yang membeku */
#content {
    animation: contentFadeIn 0.3s ease-in-out;
}

@keyframes contentFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 5. Animasi konten tengah agar seperti React/SPA */
::view-transition-old(main-content) {
    animation: fade-out 0.08s ease-out both;
}
::view-transition-new(main-content) {
    animation: fade-in 0.12s ease-in both;
}

.navbar {
    height: 60px;
    z-index: 1050;
}

.wrapper {
    display: flex;
    height: calc(100vh - 60px);
    margin-top: 60px;
    overflow: hidden;
}

#sidebar {
    width: 260px;
    height: 100%;
    background-color: #ffffff;
    flex-shrink: 0;
    z-index: 1000;
    overflow-y: hidden; 
    transition: all 0.3s ease;
}

#sidebar.active { margin-left: -260px; }

#content {
    flex-grow: 1;
    height: 100%;
    background-color: #f8f9fa;
    overflow: hidden; 
    transition: all 0.3s ease;
}

.nav-link {
    font-size: 14px;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 0 8px;
    transition: 0.2s;
    text-decoration: none !important;
    color: #555555 !important;
    display: flex;
    align-items: center;
}

.nav-link:hover, .nav-link.active {
    background-color: #f0f2f0 !important;
    color: var(--dark-green) !important;
    font-weight: 500;
}

.custom-stepper {
    gap: 40px; 
    border-bottom: 1px solid #dee2e6;
}

.stepper-item {
    padding: 10px 5px;
    position: relative;
    pointer-events: none;
    user-select: none;
}

.stepper-label {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

.stepper-item.active .stepper-label {
    color: var(--dark-green);
    font-weight: 700;
}

.stepper-item.active::after {
    content: "";
    position: absolute;
    bottom: -1px; 
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--dark-green);
}

.database-stepper .stepper-item {
    pointer-events: auto !important;
    cursor: pointer !important;
}

.card-body.overflow-y-auto {
    max-height: 100%;
    overflow-x: hidden;
}

.card-body::-webkit-scrollbar { width: 6px; }
.card-body::-webkit-scrollbar-thumb {
    background-color: #dee2e6;
    border-radius: 10px;
}

.section-heading {
    font-weight: 500;
    border-left: 4px solid var(--dark-green);
    padding-left: 12px;
    margin-bottom: 20px;
    color: #333;
}

.form-label {
    font-weight: 500;
    font-size: 13px;
    color: #555;
}

.required-label::after {
    content: " *";
    color: var(--error-red);
    font-weight: bold;
}

.form-control, .form-select {
    padding: 0.2rem 0.4rem;
    border-color: #ced4da;
    font-size: 14px !important; 
    font-family: 'Roboto', sans-serif;
    height: auto;
}

.input-group-text {
    padding: 0.2rem 0.4rem !important;
}

.form-control.is-invalid, .form-select.is-invalid {
    border-color: var(--error-red) !important;
    background-color: #fff8f8;
}

.invalid-feedback {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--error-red);
    margin-top: 4px;
}

#file_list .badge {
    padding: 8px 12px;
    font-weight: 400;
    display: flex;
    align-items: center;
}

.photo-upload-box {
    border: 2px dashed #ddd;
    border-radius: 12px;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}

.photo-upload-box:hover { 
    border-color: var(--dark-green); 
    background-color: #f0f2f0; 
}

#tableSearch:focus {
    box-shadow: none !important;
    border-color: #ced4da;
    outline: 0;
}
.highlight {
    background-color: #ced4da;
    padding: 0 4px;
}

.no-data-row td {
    background-color: #f8f9fa;
    font-style: italic;
}

#dropdownExport {
    color: #6c757d;
    border-color: #6c757d;
    transition: all 0.3s ease;
}

#dropdownExport:hover {
    background-color: #0d2e1f!important;
    border-color: #0d2e1f!important;
    color: #ffffff !important;
}

#dropdownExport:active, 
#dropdownExport.show {
    background-color: #0d2e1f !important;
    border-color: #0d2e1f !important;
    color: #ffffff !important;
}

.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    position: static;     
    display: none;    
    float: none;
    border: none;       
    padding-left: 1.5rem;
    box-shadow: none;  
    background-color: #f8f9fa;
    margin: 0;
}

.dropdown-submenu:hover > .dropdown-menu {
    display: block;
}

.dropdown-submenu:hover > a .bi-chevron-right {
    transform: rotate(90deg);
    transition: transform 0.2s ease;
}

.dropdown-submenu .dropdown-menu .dropdown-item {
    font-size: 0.7rem;
    padding: 0.4rem 1rem;
}

#current-date-display {
    font-size: 10px;
    color: #333 !important;
    letter-spacing: 0.5px;
}

#calendar {
    font-size: 12px;
    max-height: 400px;
}

.fc-toolbar-title {
    display: inline-block;
    margin: 0 15px !important;
    font-size: 14px !important;
    font-weight: bold;
    vertical-align: middle;
}

.fc .fc-toolbar.fc-header-toolbar {
    margin-top: 0px !important; 
    margin-bottom: 5px !important;
}

.fc .fc-daygrid-day.fc-day-today {
    background-color: #0d2e1f !important;
}

.fc-daygrid-day[style*="background-color"]:hover {
    filter: brightness(0.95);
    transition: 0.2s ease-in-out;
}

.fc .fc-day-today .fc-daygrid-day-number {
    color: #fff !important; 
    font-weight: medium;
}

.fc .fc-toolbar-chunk {
    display: flex;
    align-items: center;
}

.fc .fc-button-primary {
    background-color: transparent !important;
    border: none !important;
    color: #333 !important;
    box-shadow: none !important;
}

.fc .fc-button-primary:hover {
    background-color: rgba(0,0,0,0.05) !important;
    color: #000 !important;
}

.fc .fc-daygrid-day-frame {
    min-height: 30px !important;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.fc-daygrid-day-top {
    display: flex;
    justify-content: flex-end;
}

.fc-daygrid-more-link {
    font-size: 10px !important;
    display: block;
    margin-top: auto; 
    padding-bottom: 0px;
}

.fc .fc-col-header-cell-cushion {
    color: #0d2e1f !important;
    text-decoration: none !important;
}

.fc .fc-daygrid-day-number {
    color: #000000 !important;
    text-decoration: none !important;
}

.fc .fc-more-link {
    color: #0d2e1f !important;
    font-weight: 500; 
    text-decoration: none !important;
}

.fc .fc-more-link:hover {
    color: #4A5568 !important;
    text-decoration: underline !important;
}

.bg-danger { background-color: #920000 !important; } 
.bg-warning { background-color: #D4A017 !important; }
.bg-success { background-color: #1B4D3E !important; }
.bg-secondary { background-color: #4A5568 !important; } 
.bg-dark { background-color: #2D3748 !important; }

label {
    font-weight: 500;
    color: #555;
    font-size: 13px;
}

.card-prioritas {
    border: 1px solid #eee;
    border-radius: 8px;
    transition: 0.3s;
}
.card-prioritas:hover {
    border-color: #1B4D3E;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.img-prioritas {
    width: 80px;
    height: 80px;
    background-color: #e9ecef;
    object-fit: cover;
    border-radius: 4px;
}
.text-prioritas {
    font-size: 11px;
    line-height: 1.4;
}
.label-prioritas {
    width: 65px;
    display: inline-block;
    font-weight: 500;
    color: #666;
}

#prevYear, #nextYear {
    transition: all 0.2s ease-in-out;
    border-radius: 50% !important;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    background-color: transparent;
    border: none;
    outline: none;
}

#prevYear:hover, #nextYear:hover {
    background-color: rgba(27, 77, 62, 0.1) !important;
    color: #1B4D3E !important;
    transform: scale(1.1);
    cursor: pointer;
}

#prevYear:active, #nextYear:active {
    transform: scale(0.95);
    background-color: rgba(27, 77, 62, 0.2) !important;
}

#currentYearDisplay {
    font-size: 13px;
    min-width: 140px; 
    text-align: center;
    display: inline-block;
}

.table-scrollable tfoot td:first-child {
    text-align: center;
    font-weight: bold;
    background-color: #f8f9fa;
}

/* style.css */
.editable-cell {
    transition: background-color 0.2s;
    border: 1px dashed transparent;
}


.editable-cell input {
    font-size: 11px !important;
    padding: 2px 5px;
    height: auto;
}

.editable-cell input:focus {
    outline: none !important;     
    box-shadow: none !important; 
    border-color: #1B4D3E;
}

.edit-btn {
    transition: color 0.2s; 
    color: #6c757d;
}

.edit-btn:hover {
    color: #ffc107;
}

.text-dark.fw-bold.small.text-decoration-none {
    transition: color 0.3s ease; 
}

/* Warna saat kursor diarahkan (hover) */
.text-dark.fw-bold.small.text-decoration-none:hover {
    color: #444 !important; 
    text-decoration: underline !important;
}

/* =========================================
   RESPONSIVITAS MOBILE
   ========================================= */
/* =========================================
   RESPONSIVITAS MOBILE (PERBAIKAN HEADER & SCROLL)
   ========================================= */
@media (max-width: 991.98px) {
    /* --- 1. KUNCI SCROLL HALAMAN ... --- */
    html, body {
        overflow-y: auto !important;
        height: auto !important;
    }
    .wrapper {
        height: auto !important;
        overflow: visible !important;
    }
    #content {
        overflow-y: auto !important;
        height: auto !important;
        min-height: calc(100vh - 60px);
        width: 100% !important;
    }

    /* --- 2. SIDEBAR MELAYANG ... --- */
    #sidebar {
        position: fixed !important;
        top: 60px;
        left: 0;
        margin-left: -260px;
        height: calc(100vh - 60px);
        z-index: 1060 !important;
        box-shadow: 4px 0 15px rgba(0,0,0,0.1);
    }
    #sidebar.active { 
        margin-left: 0 !important; 
    }
    #content.active {
        opacity: 0.4;
        pointer-events: none;
    }

    /* --- 3. KALENDER KEMBALI NORMAL ... --- */
    #calendar {
        min-width: 100% !important;
        font-size: 10px !important;
    }
    .fc .fc-toolbar.fc-header-toolbar {
        flex-direction: column;
        gap: 8px;
    }
    .fc-toolbar-title {
        font-size: 14px !important;
    }

    /* --- 4. TABEL BISA DI-SWIPE KANAN-KIRI ... --- */
    .card, .card-body, .tab-content, .tab-pane {
        overflow: visible !important; 
        display: block !important;
        height: auto !important;
    }
    
    .table-responsive, 
    .table-responsive-scroll, 
    .wrapper-rekapitulasi {
        display: block !important;
        overflow-x: auto !important; /* Paksa muncul scroll kanan-kiri */
        overflow-y: hidden !important; /* Matikan scroll atas-bawah internal tabel agar halaman bisa scroll */
        max-height: none !important;  /* PAKSA matikan max-height 145px dari HTML */
        width: 100% !important;
        -webkit-overflow-scrolling: touch !important;
        position: relative !important;
    }
    
    .table {
        width: 100% !important;
        min-width: 1000px !important; /* Angka aman agar kolom tidak dempet dan scroll muncul */
        table-layout: auto !important;
    }
    
    .table th, .table td {
        white-space: nowrap !important; 
    }

    /* --- 5. RAPIKAN KOTAK PENCARIAN & TAB MENU --- */
    .custom-stepper {
        gap: 15px;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 8px;
    }
    .d-flex.justify-content-between.align-items-center.mb-3 {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }
    .d-flex.justify-content-between.align-items-center.mb-3 > div:first-child {
        max-width: 100% !important; 
    }
    .dropdown button {
        width: 100%;
    }

    /* =========================================
       6. PERBAIKAN HEADER MOBILE (LOGO, JUDUL, PROFIL)
       ========================================= */
    
    /* Navbar: Biarkan tinggi otomatis tapi kurangi padding agar kompak */
    .navbar {
        height: auto !important;
        min-height: 60px;
        padding-top: 5px !important;
        padding-bottom: 5px !important;
    }

    /* Container dalam Navbar: Atur d-flex agar ikon profil sejajar dengan baris atas */
    .navbar .container-fluid {
        flex-wrap: nowrap !important; /* Paksa agar tidak jatuh ke baris baru */
    }

    /* Sisi Kiri (Menu + Logo + Judul) */
    .navbar .container-fluid > .d-flex.align-items-center {
        /* Kurangi margin agar lebih kompak */
        margin-right: 0 !important;
    }

    /* Logo Aplikasi: Perkecil logo */
    .navbar img {
        height: 25px !important; /* Kecilkan logo dari 35px jadi 25px */
        margin-right: 5px !important; /* Sesuaikan margin */
    }

    /* Judul Aplikasi: Perkecil font judul dan buang ketebalan font */
    .navbar span {
        font-size: 12px !important; /* Perkecil font judul */
        letter-spacing: -0.01em !important; /* Sesuaikan jarak huruf */
        line-height: 1.2 !important; /* Sesuaikan tinggi baris */
        margin-left: 5px !important; /* Sesuaikan margin */
        fw-bold: normal !important; /* Kurangi ketebalan font agar lebih ramping */
    }

    /* Tombol Menu Sidebar: Kurangi sedikit ukurannya agar proporsional */
    #sidebarToggle {
        padding: 5px 10px !important;
    }

    /* Sisi Kanan (Ikon Profil) */
    .navbar .container-fluid > .ms-auto.d-flex.align-items-center {
        /* Sejajarkan ke kanan atas header */
        margin-left: auto !important; /* Tetap didorong ke kanan */
    }

    /* Ikon Profil: Perkecil sedikit agar tidak terlalu menonjol di HP */
    .navbar .bi-person-circle {
        font-size: 1.5rem !important; /* Perkecil ikon profil (fs-3 Bootstrap itu 1.75rem. fs-4 adalah 1.5rem) */
    }
}