/* === FONT & DASAR === */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f4f7fa;
    margin: 0;
    color: #333;
}
.dashboard-container {
    display: flex;
    flex-direction: column;
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
}

/* === HEADER === */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}
.header-title h1 {
    margin: 0;
    font-size: 24px;
    color: #1a202c;
}
.header-title p {
    margin: 0;
    font-size: 14px;
    color: #718096;
}
.header-login-btn {
    background-color: #3182ce;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s;
}
.header-login-btn:hover {
    background-color: #2b6cb0;
}

/* === KPI CARDS === */
.kpi-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.kpi-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}
.kpi-title {
    font-size: 14px;
    color: #4a5568;
    margin-bottom: 8px;
}
.kpi-value {
    font-size: 30px;
    font-weight: 700;
    color: #1a202c;
}

/* === FILTER BAR === */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.filter-group label {
    font-size: 12px;
    font-weight: 500;
    color: #4a5568;
}
.filter-group select,
.filter-group input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}
.filter-button {
    padding: 9px 15px;
    border: none;
    border-radius: 6px;
    background-color: #48bb78;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}
.filter-button:hover {
    background-color: #38a169;
}
.filter-button.print-btn {
    background-color: #007bff;
    margin-left: 10px;
}
.filter-button.print-btn:hover {
    background-color: #0056b3;
}
.filter-button.print-btn:disabled {
    background-color: #999;
    cursor: not-allowed;
}

/* === MAIN CONTENT (PETA & SIDEBAR) === */
.main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    height: 600px;
}

/* PETA */
.map-container {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}
#map-sebaran {
    width: 100%;
    height: 100%;
}
.popup-photo {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    border-radius: 4px 4px 0 0;
}
.no-photo {
    padding: 10px;
    text-align: center;
    color: #888;
    font-style: italic;
    margin: 0;
}
.popup-content {
    padding: 10px;
    line-height: 1.6;
}

/* SIDEBAR */
.sidebar-list {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.sidebar-header {
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
}
.sidebar-header h3 {
    margin: 0;
    font-size: 18px;
}
.list-container {
    overflow-y: auto;
    flex-grow: 1;
}
.loading-text {
    padding: 20px;
    text-align: center;
    color: #718096;
    font-style: italic;
}

/* Style untuk Ringkasan Area di Sidebar */
.summary-container {
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}
.summary-container h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}
.summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
}
.summary-list li {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}
.summary-list .summary-label {
    color: #555;
    word-break: break-word;
    padding-right: 10px;
}
.summary-list .summary-value {
    font-weight: 600;
    color: #000;
    white-space: nowrap;
}
.summary-list .summary-empty {
    color: #888;
    font-style: italic;
    justify-content: center;
}

/* KARTU KEGIATAN */
.activity-item {
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background-color 0.15s;
}
.activity-item:last-child {
    border-bottom: none;
}
.activity-item:hover {
    background-color: #fafafa;
}
.activity-item.selected {
    background-color: #edf2f7; /* Warna highlight */
}
.activity-item h4 {
    margin: 0 0 5px 0;
    font-size: 15px;
    font-weight: 600;
    color: #2b6cb0;
}
.activity-item p {
    margin: 0 0 10px 0;
    font-size: 13px;
}
.activity-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #718096;
    margin-bottom: 10px;
}
.activity-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
}
.activity-status.proses { background-color: #fff0c7; color: #a05e03; }
.activity-status.selesai { background-color: #c6f6d5; color: #22543d; }
.activity-status.kadaluarsa { background-color: #fed7d7; color: #822727; }

/* === [AREA CETAK] === */
.print-only {
    display: none; /* Sembunyikan di web */
}


/* --- GAYA KHUSUS SAAT MENCETAK --- */
@media print {

    /* 1. Sembunyikan semua elemen web */
    .dashboard-container {
        display: none !important;
    }

    /* 2. Tampilkan container khusus cetak */
    .print-only {
        display: block !important;
    }

    /* 3. Atur body dan layout dasar cetak */
    body {
        font-family: Arial, sans-serif;
        margin: 20px;
        color: #000;
        background: #fff;
    }

    #print-title {
        text-align: center;
        font-size: 18pt;
        margin-bottom: 25px;
    }

    /* 4. Atur KPI untuk cetak */
    #print-kpi-container .kpi-container {
        display: flex;
        justify-content: space-around;
        width: 100%;
        margin-bottom: 20px;
        padding: 0;
    }
     #print-kpi-container .kpi-card {
        border: 1px solid #ccc;
        background: #f9f9f9;
        flex-basis: 23%;
        padding: 10px;
        box-shadow: none;
        color: #000;
     }
     #print-kpi-container .kpi-title { font-size: 11pt; }
     #print-kpi-container .kpi-value { font-size: 16pt; font-weight: bold; }


    /* 5. Atur Peta Statis */
    #print-map-container {
        width: 100%;
        page-break-before: auto;
        page-break-after: always; /* Pindah halaman baru setelah peta */
        margin-top: 15px;
    }
    #print-map-container h3 {
        font-size: 14pt;
        border-bottom: 1px solid #ccc;
        padding-bottom: 5px;
    }
    #print-map-static img,
    #print-map-static canvas {
        width: 100% !important;
        height: auto !important;
        border: 1px solid #999;
    }
    #print-map-static i { /* Untuk "memuat peta..." */
        font-size: 12pt;
        color: #555;
    }

    /* 6. Style untuk Ringkasan di Laporan Cetak */
    #print-summary-container {
        margin-top: 20px;
        margin-bottom: 25px; /* Jarak sebelum tabel data */
        page-break-inside: avoid; /* Jangan pisah tabel ringkasan */
    }
    .summary-table-print {
        width: 80%; /* Tidak perlu full width */
        margin: 0 auto; /* Posisikan di tengah */
        border-collapse: collapse;
        font-size: 10pt;
    }
    .summary-table-print th,
    .summary-table-print td {
        border: 1px solid #666;
        padding: 6px 10px;
    }
    .summary-table-print th {
        background-color: #f0f0f0;
        font-size: 12pt;
        text-align: center;
    }
    .summary-table-print td:last-child {
        text-align: right;
        font-weight: bold;
        width: 150px;
    }
    .summary-table-print td:first-child {
        text-align: left;
    }

    /* 7. Atur Tabel Laporan Data */
    #print-table-container {
        width: 100%;
        margin-top: 20px;
    }
    #print-table-container h3 {
         font-size: 14pt;
         border-bottom: 1px solid #ccc;
         padding-bottom: 5px;
         margin-bottom: 10px;
    }
    #print-table-container table {
        width: 100%;
        border-collapse: collapse;
        font-size: 9pt; /* Perkecil font agar muat */
    }
    #print-table-container th,
    #print-table-container td {
        border: 1px solid #666;
        padding: 6px;
        text-align: left;
        page-break-inside: avoid; /* Hindari baris terpotong */
    }
    #print-table-container th {
        background-color: #f0f0f0;
        font-weight: bold;
    }
}