/* ================================================================
   DETAIL LAPORAN — CSS
================================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ================= CONTAINER ================= */
.detail-container {
    padding: 28px 30px;
    max-width: 1100px;
}

/* ================= BREADCRUMB ================= */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 16px;
}

.breadcrumb a {
    color: #2e7d32;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #1b5e20;
    text-decoration: underline;
}

.breadcrumb span {
    color: #9ca3af;
}

/* ================= PAGE TITLE ================= */
.page-title {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.page-title h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1b5e20;
    flex-shrink: 0;
}

/* Status pill di judul */
.status-pill {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

.status-menunggu_validasi { background:#fff3e0; color:#e65100; }
.status-menunggu          { background:#e3f2fd; color:#1565c0; }
.status-diproses          { background:#f3e5f5; color:#7b1fa2; }
.status-selesai           { background:#e8f5e9; color:#2e7d32; }
.status-ditolak           { background:#ffebee; color:#c62828; }

/* ================= CARD BASE ================= */
.card {
    background: white;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.07);
    transition: box-shadow 0.2s;
}

.card-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #1b5e20;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e8f5e9;
}

.card-icon {
    font-size: 18px;
}

/* ================= TOP GRID ================= */
.top-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    margin-bottom: 20px;
    align-items: start;
}

/* Info kolom kiri */
.info-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ================= INFO LIST (Petani) ================= */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.info-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
}

.info-row:last-child {
    border-bottom: none;
}

.info-key {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    min-width: 90px;
    flex-shrink: 0;
}

.info-val {
    font-size: 14px;
    color: #111827;
    font-weight: 500;
    word-break: break-word;
}

.coord {
    font-family: monospace;
    font-size: 12px;
    background: #f5f5f5;
    padding: 3px 8px;
    border-radius: 6px;
    color: #374151;
}

/* ================= SERANGAN GRID ================= */
.serangan-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

.serangan-item {
    background: #f8faf8;
    border-radius: 10px;
    padding: 12px 14px;
    border-left: 3px solid #4caf50;
}

.serangan-key {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 5px;
}

.serangan-val {
    font-size: 15px;
    font-weight: 700;
    color: #1b5e20;
}

.serangan-val.hama {
    color: #1b5e20;
    font-size: 15px;
}

/* ================= BADGE TINGKAT ================= */
.badge-tingkat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    margin-top: 2px;
}

.badge-tingkat.ringan { background: #e8f5e9; color: #2e7d32; }
.badge-tingkat.sedang { background: #fff3e0; color: #e65100; }
.badge-tingkat.berat  { background: #ffebee; color: #c62828; }

/* ================= DESKRIPSI ================= */
.desc-wrapper {
    border-top: 1px solid #f0f0f0;
    padding-top: 14px;
}

.desc {
    background: #f8faf8;
    border-left: 3px solid #4caf50;
    padding: 12px 14px;
    border-radius: 0 10px 10px 0;
    font-size: 13.5px;
    line-height: 1.7;
    color: #374151;
    margin-top: 8px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ================= FOTO ================= */
.foto-col {
    position: sticky;
    top: 80px;
}

.foto-card {
    height: fit-content;
}

.foto-wrapper {
    position: relative;
}

.foto {
    width: 100%;
    border-radius: 10px;
    display: block;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    object-fit: cover;
    max-height: 320px;
}

.foto:hover {
    opacity: 0.92;
    transform: scale(1.01);
}

.foto-hint {
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 8px;
}

.foto-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 160px;
    background: #f8faf8;
    border-radius: 10px;
    gap: 8px;
    color: #9ca3af;
}

.foto-empty span {
    font-size: 40px;
    opacity: 0.4;
}

.foto-empty p {
    font-size: 13px;
}

/* ================= MAP ================= */
.map-card {
    margin-bottom: 20px;
}

#map {
    width: 100%;
    height: 420px;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 4px;
    z-index: 1;
}

.leaflet-popup-content-wrapper {
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15) !important;
    padding: 4px !important;
}

.leaflet-popup-content {
    font-family: 'Poppins', sans-serif !important;
    font-size: 13px !important;
    margin: 12px 16px !important;
}

/* ================= ACTION BAR ================= */
.action-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

/* Tombol base */
.btn-back,
.btn-analisis,
.btn-validasi,
.btn-tolak,
.btn-edit {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 11px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    white-space: nowrap;
}

.btn-back,
.btn-analisis,
.btn-validasi,
.btn-tolak,
.btn-edit {
    &:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    }
}

.btn-back     { background: #f5f5f5; color: #374151; }
.btn-analisis { background: linear-gradient(135deg, #1565c0, #42a5f5); color: white; }
.btn-validasi { background: linear-gradient(135deg, #2e7d32, #4caf50); color: white; }
.btn-tolak    { background: linear-gradient(135deg, #c62828, #ef5350); color: white; }
.btn-edit     { background: linear-gradient(135deg, #e65100, #ff9800); color: white; }

.btn-back:hover     { background: #eeeeee; }

/* ================= LIGHTBOX ================= */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    font-size: 22px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.3);
}

/* ================================================================
   RESPONSIVE
================================================================ */

/* TABLET (≤ 900px) */
@media screen and (max-width: 900px) {

    .top-grid {
        grid-template-columns: 1fr;
    }

    .foto-col {
        position: static;
    }

    .foto {
        max-height: 280px;
        object-fit: cover;
    }

}

/* MOBILE (≤ 768px) */
@media screen and (max-width: 768px) {

    .detail-container {
        padding: 18px 14px;
    }

    .page-title h2 {
        font-size: 18px;
    }

    .card {
        padding: 16px;
        border-radius: 14px;
    }

    .serangan-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    #map {
        height: 300px;
    }

    .action-bar {
        flex-direction: column;
        gap: 10px;
    }

    .btn-back,
    .btn-analisis,
    .btn-validasi,
    .btn-tolak,
    .btn-edit {
        width: 100%;
        justify-content: center;
        padding: 13px;
        font-size: 14px;
    }

}

/* SMALL MOBILE (≤ 480px) */
@media screen and (max-width: 480px) {

    .detail-container {
        padding: 14px 10px;
    }

    .breadcrumb {
        font-size: 12px;
    }

    .serangan-grid {
        grid-template-columns: 1fr;
    }

    .info-key {
        min-width: 80px;
    }

    #map {
        height: 240px;
    }

}