/* ================================================================
   PENYULUH — CSS (validasi, ranking, laporan, analisis)
================================================================ */

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

/* ================= PAGE WRAPPER ================= */
.page-wrapper {
    padding: 28px 30px;
    max-width: 1200px;
}

/* ================= 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; }
.breadcrumb a:hover { text-decoration: underline; }

/* ================= PAGE HEADER ================= */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.page-title {
    font-size: 22px;
    font-weight: 700;
    color: #1b5e20;
    margin-bottom: 4px;
}
.page-sub { font-size: 13px; color: #6b7280; }

.header-badge {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.gold-badge { background: #fff8e1; color: #f57f17; }

/* ================= TABLE CARD ================= */
.table-card {
    background: white;
    border-radius: 18px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.07);
    overflow: hidden;
    margin-bottom: 24px;
}
.table-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
    flex-wrap: wrap;
}
.table-label {
    font-size: 14px;
    font-weight: 600;
    color: #1b5e20;
}
.table-topbar input {
    padding: 8px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    outline: none;
    width: 220px;
    background: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.table-topbar input:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46,125,50,0.1);
    background: white;
}

/* ================= TABLE SCROLL ================= */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ================= DATA TABLE ================= */
.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}
.data-table thead tr {
    background: #f8faf8;
    border-bottom: 2px solid #e8f5e9;
}
.data-table th {
    padding: 13px 14px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 700;
    color: #4a7c59;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}
.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13.5px;
    color: #374151;
    vertical-align: middle;
}
.data-row { transition: background 0.15s; }
.data-row:hover { background: #f8fdf8; }
.data-row:last-child td { border-bottom: none; }
.row-click { cursor: pointer; }

/* ================= ROW HIGHLIGHTS ================= */
.row-gold   { background: #fffde7 !important; }
.row-silver { background: #fafafa !important; }
.row-bronze { background: #efebe9 !important; }
.row-highlight { background: #e8f5e9 !important; }

/* ================= CELLS ================= */
.petani-name { font-weight: 600; color: #1b5e20; }
.petani-loc  { font-size: 11.5px; color: #9ca3af; margin-top: 2px; }
.highlight-name { color: #2e7d32; }
.current-tag {
    display: inline-block;
    background: #2e7d32;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 6px;
    vertical-align: middle;
}
.date-cell  { font-size: 12.5px; color: #6b7280; white-space: nowrap; }
.no-cell    { color: #9ca3af; font-size: 12px; font-weight: 500; width: 36px; }
.num-cell   { text-align: center; font-weight: 600; color: #374151; }
.nilai-cell { font-weight: 700; color: #1b5e20; font-family: monospace; font-size: 13px; }
.highlight-val { color: #2e7d32; }

/* ================= HAMA TAG ================= */
.hama-tag {
    display: inline-block;
    background: #f0fdf4;
    color: #166534;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
}

/* ================= STATUS BADGE ================= */
.status-badge {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
    text-transform: capitalize;
}
.s-waiting { background:#fff3e0; color:#e65100; }
.s-info    { background:#e3f2fd; color:#1565c0; }
.s-process { background:#f3e5f5; color:#7b1fa2; }
.s-success { background:#e8f5e9; color:#2e7d32; }
.s-danger  { background:#ffebee; color:#c62828; }

/* ================= TINGKAT BADGE ================= */
.tingkat-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 700;
}
.t-ringan { background:#e8f5e9; color:#2e7d32; }
.t-sedang { background:#fff3e0; color:#e65100; }
.t-berat  { background:#ffebee; color:#c62828; }

/* ================= RANK BADGE ================= */
.rank-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}
.rank-gold   { background:#fff8e1; color:#f57f17; }
.rank-silver { background:#f5f5f5; color:#616161; }
.rank-bronze { background:#efebe9; color:#795548; }
.rank-normal { background:#f0f0f0; color:#6b7280; }

/* ================= ACTION BUTTONS ================= */
.action-group {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
    align-items: center;
}
.btn-sm {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}
.btn-sm:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,0.12); }
.btn-detail  { background:#e3f2fd; color:#1565c0; }
.btn-detail:hover { background:#bbdefb; }
.btn-validasi{ background:#e8f5e9; color:#2e7d32; }
.btn-validasi:hover { background:#c8e6c9; }
.btn-tolak   { background:#ffebee; color:#c62828; }
.btn-tolak:hover { background:#ffcdd2; }
.btn-proses  { background:#fff3e0; color:#e65100; }
.btn-proses:hover { background:#ffe0b2; }
.btn-selesai { background:#e8f5e9; color:#2e7d32; }
.btn-selesai:hover { background:#c8e6c9; }
.btn-analisis{ background:#f3e5f5; color:#7b1fa2; }
.btn-analisis:hover { background:#e1bee7; }

/* ================= EMPTY STATE ================= */
.empty-cell { padding: 40px 20px !important; }
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #9ca3af;
    font-size: 13.5px;
}
.empty-state span { font-size: 36px; opacity: .5; }

/* ================= PODIUM (ranking top 3) ================= */
.podium-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.podium-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
    border-top: 4px solid #e0e0e0;
    transition: transform 0.2s;
}
.podium-card:hover { transform: translateY(-4px); }
.podium-card.rank-1 { border-top-color: #f57f17; background: #fffde7; }
.podium-card.rank-2 { border-top-color: #9e9e9e; }
.podium-card.rank-3 { border-top-color: #795548; background: #efebe9; }
.podium-rank { font-size: 22px; margin-bottom: 8px; }
.podium-name { font-size: 14px; font-weight: 700; color: #1b5e20; margin-bottom: 4px; }
.podium-hama { font-size: 12px; color: #6b7280; margin-bottom: 10px; }
.podium-val  { font-size: 20px; font-weight: 800; color: #2e7d32; }
.podium-label{ font-size: 10px; color: #9ca3af; text-transform: uppercase; letter-spacing:.5px; }

/* ================= FILTER CARD ================= */
.filter-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
    margin-bottom: 20px;
}
.filter-title {
    font-size: 14px;
    font-weight: 700;
    color: #1b5e20;
    margin-bottom: 16px;
}
.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.filter-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.filter-item label {
    font-size: 11.5px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.filter-item input,
.filter-item select {
    padding: 9px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    color: #374151;
    background: #fafafa;
    outline: none;
    transition: border-color 0.2s;
    min-width: 140px;
}
.filter-item input:focus,
.filter-item select:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46,125,50,0.1);
    background: white;
}
.filter-actions { display: flex; gap: 8px; align-items: flex-end; }
.btn-filter {
    padding: 9px 20px;
    background: linear-gradient(135deg,#2e7d32,#4caf50);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
    box-shadow: 0 3px 10px rgba(46,125,50,.3);
    white-space: nowrap;
}
.btn-filter:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(46,125,50,.4); }
.btn-reset {
    padding: 9px 16px;
    background: #f5f5f5;
    color: #374151;
    border-radius: 10px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background .2s;
    white-space: nowrap;
}
.btn-reset:hover { background: #e0e0e0; }

/* ================= ANALISIS CARDS ================= */
.analisis-top-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 18px;
    margin-bottom: 24px;
}
.info-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}
.info-card-title {
    font-size: 14px;
    font-weight: 700;
    color: #1b5e20;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e8f5e9;
}
.info-rows { display: flex; flex-direction: column; gap: 0; }
.ir {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
    gap: 10px;
}
.ir:last-child { border-bottom: none; }
.ir span { color: #6b7280; font-size: 12px; }
.ir strong { text-align: right; color: #1b5e20; font-weight: 600; }

/* Bobot bars */
.bobot-list { display: flex; flex-direction: column; gap: 10px; }
.bobot-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.bobot-label { width: 110px; color: #374151; font-weight: 500; flex-shrink: 0; font-size: 12px; }
.bobot-bar-wrap { flex: 1; height: 8px; background: #e8f5e9; border-radius: 10px; overflow: hidden; }
.bobot-bar { height: 100%; background: linear-gradient(90deg,#2e7d32,#66bb6a); border-radius: 10px; transition: width .5s; }
.bobot-val { font-weight: 700; color: #2e7d32; width: 38px; text-align: right; }

/* Hasil card */
.result-card {
    background: linear-gradient(135deg,#1b5e20,#2e7d32);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 6px 20px rgba(46,125,50,.3);
    color: white;
}
.result-card .info-card-title { color: #a5d6a7; border-bottom-color: rgba(255,255,255,.15); }
.result-big { text-align: center; margin: 12px 0; }
.result-num { font-size: 36px; font-weight: 800; letter-spacing: -1px; }
.result-lbl { font-size: 11px; color: #a5d6a7; text-transform: uppercase; letter-spacing: .5px; }
.result-rank { text-align: center; font-size: 14px; margin: 10px 0 6px; color: #c8e6c9; }
.result-rank span { font-size: 20px; font-weight: 800; color: white; }
.result-note { text-align: center; font-size: 11px; color: #81c784; line-height: 1.5; }

/* Result pill in header */
.result-pill {
    background: #e8f5e9;
    color: #1b5e20;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
}
.result-pill strong { font-size: 18px; }

/* ================= MODAL ================= */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal-box {
    background: white;
    border-radius: 20px;
    padding: 32px 28px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    animation: popIn .25s ease;
}
@keyframes popIn {
    from { transform: scale(.85); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
.modal-icon { font-size: 44px; margin-bottom: 12px; }
.modal-icon.danger { filter: hue-rotate(180deg); }
.modal-box h3 { font-size: 17px; color: #1b5e20; margin-bottom: 8px; }
.modal-box p  { font-size: 13.5px; color: #6b7280; line-height: 1.6; }
.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    justify-content: center;
}
.btn-cancel {
    padding: 10px 20px;
    background: #f5f5f5;
    color: #374151;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: background .2s;
}
.btn-cancel:hover { background: #e0e0e0; }
.btn-confirm {
    padding: 10px 20px;
    background: linear-gradient(135deg,#2e7d32,#4caf50);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(46,125,50,.3);
    transition: transform .2s;
}
.btn-confirm:hover { transform: translateY(-1px); }
.btn-danger-confirm {
    padding: 10px 20px;
    background: linear-gradient(135deg,#c62828,#ef5350);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(198,40,40,.3);
    transition: transform .2s;
}
.btn-danger-confirm:hover { transform: translateY(-1px); }

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

/* TABLET (≤ 1024px) */
@media screen and (max-width: 1024px) {
    .page-wrapper { padding: 22px 20px; }
    .analisis-top-grid { grid-template-columns: 1fr 1fr; }
    .podium-row { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}

/* MOBILE (≤ 768px) */
@media screen and (max-width: 768px) {
    .page-wrapper { padding: 16px 14px; }

    .page-header { gap: 12px; }
    .page-title  { font-size: 18px; }

    /* Podium */
    .podium-row { grid-template-columns: 1fr; gap: 10px; }
    .podium-card { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 16px; }
    .podium-rank { font-size: 26px; margin-bottom: 0; flex-shrink: 0; }
    .podium-val  { font-size: 16px; }
    .podium-label{ font-size: 9px; }

    /* Analisis grid */
    .analisis-top-grid { grid-template-columns: 1fr; }

    /* Filter */
    .filter-form { gap: 10px; }
    .filter-item input,
    .filter-item select { min-width: 100%; width: 100%; }
    .filter-item { width: calc(50% - 5px); }
    .filter-actions { width: 100%; }
    .btn-filter, .btn-reset { flex: 1; text-align: center; }

    /* Table search */
    .table-topbar { flex-direction: column; align-items: flex-start; }
    .table-topbar input { width: 100%; }

    /* Action buttons */
    .action-group { gap: 5px; }
    .btn-sm { padding: 5px 10px; font-size: 11.5px; }

    /* Modal */
    .modal-box { padding: 24px 20px; }
}

/* SMALL MOBILE (≤ 480px) */
@media screen and (max-width: 480px) {
    .page-wrapper { padding: 12px 10px; }
    .filter-item { width: 100%; }

    /* Hide less-critical columns */
    .data-table th:nth-child(3),
    .data-table td:nth-child(3),
    .data-table th:nth-child(4),
    .data-table td:nth-child(4) {
        display: none;
    }

    .bobot-label { width: 80px; font-size: 11px; }
    .result-num  { font-size: 28px; }
}