/* =========================
   DASAR
========================= */

:root {
    color-scheme: light;
    --ink: #173c30;
    --muted: #62776d;
    --line: #dce7df;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: #f3f7f4;
}

/* =========================
   HEADER
========================= */

.page-header {
    padding: 22px 30px;
    color: white;
    background: #184d37;
}

.eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #bee1c8;
}

h1 {
    margin: 8px 0;
    font-size: clamp(21px, 3vw, 30px);
}

.page-header p {
    margin: 0;
    color: #d4e5da;
    font-size: 14px;
}

/* =========================
   LAYOUT UTAMA
========================= */

.main-container {
    display: flex;
    min-height: 600px;
    height: calc(100dvh - 137px);
}

.sidebar {
    flex: 0 0 310px;
    padding: 24px;
    background: white;
    overflow-y: auto;
    border-right: 1px solid var(--line);
}

h2 {
    margin: 0 0 10px;
    font-size: 22px;
}

h3 {
    margin: 0 0 15px;
    font-size: 15px;
}

.sidebar-description,
.note {
    color: var(--muted);
    line-height: 1.6;
}

.sidebar-description {
    margin: 0;
    font-size: 14px;
}

.sidebar-section {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

/* =========================
   LEGENDA
========================= */

.legend-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.legend-item {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 11px;
    font-size: 13px;
}

.legend-color {
    width: 18px;
    height: 14px;
    border: 2px solid;
    border-radius: 3px;
    flex-shrink: 0;
}

/* =========================
   RINGKASAN DATA
========================= */

.stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 12px;
    margin-bottom: 8px;
    background: #f2f7f3;
    border-left: 3px solid #368558;
    border-radius: 5px;
    font-size: 12px;
}

.stat-card strong {
    font-size: 16px;
    text-align: right;
}

.note {
    font-size: 11px;
}

/* =========================
   TOMBOL
========================= */

button {
    width: 100%;
    border: 0;
    border-radius: 6px;
    background: #236542;
    color: white;
    padding: 12px;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
}

button:hover {
    background: #184d37;
}

button:disabled {
    opacity: 0.5;
    cursor: default;
}

button:focus-visible {
    outline: 3px solid #e2af3d;
    outline-offset: 3px;
}

/* =========================
   PETA
========================= */

.map-container {
    flex: 1;
    min-width: 0;
    position: relative;
}

#map {
    height: 100%;
    width: 100%;
    min-height: 500px;
    background: #e4ece6;
}

.leaflet-control-layers {
    font-family: inherit;
}

/* =========================
   STATUS DATA
========================= */

#load-status {
    font-size: 12px;
    line-height: 1.5;
}

.load-details {
    list-style: none;
    padding: 0;
    font-size: 11px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.load-details li {
    margin: 8px 0;
}

.load-details .error {
    color: #a5362a;
}

/* =========================
   POPUP
========================= */

.popup-title {
    font-size: 15px;
    margin-bottom: 10px;
    color: #184d37;
}

.popup-table {
    border-collapse: collapse;
    width: 100%;
}

.popup-table th,
.popup-table td {
    text-align: left;
    padding: 5px 7px;
    vertical-align: top;
    border-bottom: 1px solid #eeeeee;
}

.popup-table th {
    font-weight: normal;
    color: #68766f;
}

.popup-table td {
    overflow-wrap: anywhere;
    max-width: 210px;
}

.popup-note {
    font-size: 11px;
    color: #68766f;
}

/* =========================
   TAMPILAN HP
========================= */

@media (max-width: 760px) {
    .page-header {
        padding: 18px 20px;
    }

    .main-container {
        height: auto;
        min-height: 0;
        flex-direction: column;
    }

    .map-container {
        order: -1;
        height: 60dvh;
        min-height: 400px;
        flex: none;
    }

    #map {
        min-height: 400px;
    }

    .sidebar {
        flex: none;
        width: 100%;
        overflow: visible;
        padding: 22px;
    }
}

/* Dashboard dan identitas Kelompok 8 */
[hidden] { display: none !important; }
.page-header { padding-bottom: 0; }
.brand-row { display: grid; grid-template-columns: 160px minmax(0, 1fr) 160px; gap: 24px; align-items: center; }
.brand-title { text-align: center; }
.logo-box { width: 160px; height: 84px; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 9px; padding: 10px; }
.logo-box img { display: block; object-fit: contain; max-width: 140px; max-height: 64px; }
.group-identity { margin-top: 18px; display: flex; flex-direction: column; gap: 3px; text-align: center; font-size: 13px; color: #d4e5da; }
.group-identity strong { font-size: 16px; color: #fff; }
.page-nav { display: flex; gap: 24px; justify-content: center; margin-top: 16px; }
.page-nav button { width: auto; background: transparent; color: #d4e5da; border-radius: 0; padding: 12px 2px; border-bottom: 3px solid transparent; font-size: 14px; }
.page-nav button:hover { color: #fff; }
.page-nav button[aria-current="page"] { color: #fff; border-bottom-color: #bee1c8; font-weight: 700; }
.content-page { max-width: 1160px; margin: 0 auto; padding: 30px; }
.page-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-intro h2 { margin-bottom: 5px; }
.page-intro p, .about-intro p { color: var(--muted); line-height: 1.6; margin: 5px 0; }
.primary-action { width: auto; padding: 12px 18px; white-space: nowrap; }
.secondary-action { background: #fff; color: var(--ink); border: 1px solid var(--line); margin-top: 16px; }
.secondary-action:hover { background: #f2f7f3; }
.dashboard-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi-card { padding: 22px; border: 1px solid var(--line); border-radius: 9px; background: #fff; display: flex; flex-direction: column; gap: 10px; }
.kpi-card span { font-size: 13px; color: var(--muted); }
.kpi-card strong { font-size: 28px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-card small { color: var(--muted); font-size: 12px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 22px; }
.dashboard-panel { border: 1px solid var(--line); border-radius: 9px; padding: 24px; background: #fff; min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 18px; }
.panel-heading h3 { margin: 0; font-size: 17px; }
.panel-heading span { font-size: 12px; color: var(--muted); }
.chart-scale { display: flex; justify-content: space-between; margin: 14px 65px 16px 116px; font-size: 11px; color: var(--muted); }
.chart-row { display: grid; grid-template-columns: 108px minmax(0, 1fr) 60px; gap: 8px; align-items: center; margin: 15px 0; font-size: 12px; }
.chart-track { height: 18px; border-radius: 3px; background: #e5ebe6; overflow: hidden; }
.chart-bar { height: 100%; min-width: 2px; border-radius: 3px; }
.chart-value { text-align: right; font-variant-numeric: tabular-nums; }
.chart-row.failed { color: #a5362a; }
.data-note { color: var(--muted); line-height: 1.6; font-size: 12px; margin: 20px 0 0; }
.crop-block { padding: 16px 0; border-top: 1px solid var(--line); }
.crop-block h4 { margin: 0 0 9px; font-size: 14px; }
.crop-block p { margin: 0 0 8px; line-height: 1.6; overflow-wrap: anywhere; }
.crop-block small { color: var(--muted); font-size: 12px; }
.dashboard-status { font-size: 12px; color: var(--muted); line-height: 1.6; margin-top: 22px; }
.about-intro { text-align: center; max-width: 670px; margin: 0 auto 32px; }
.about-intro h2 { margin: 8px 0; font-size: 28px; }
.section-eyebrow { color: var(--muted); font-size: 11px; letter-spacing: 1.6px; }
.mentor-section { text-align: center; margin-bottom: 32px; }
.mentor-card { display: flex; align-items: center; gap: 22px; max-width: 510px; margin: 16px auto 0; text-align: left; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 24px; }
.person-photo { width: 116px; height: 130px; border-radius: 10px; object-fit: cover; display: block; margin: 0 auto; }
.photo-placeholder { width: 116px; height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: #edf4ee; color: var(--muted); border-radius: 10px; margin: 0 auto; font-size: 12px; flex-shrink: 0; }
.photo-initials { font-size: 26px; color: #789985; }
.mentor-card .person-photo, .mentor-card .photo-placeholder { margin: 0; }
.person-name { font-size: 18px; line-height: 1.4; margin: 0 0 7px; overflow-wrap: anywhere; }
.person-role { color: var(--muted); font-size: 13px; margin: 0; }
.team-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.person-card { padding: 24px 18px; border: 1px solid var(--line); border-radius: 9px; background: #fff; text-align: center; }
.person-card .person-name { font-size: 16px; margin: 16px 0 7px; }
.person-nim { margin: 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.site-footer { padding: 18px 30px; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.7; border-top: 1px solid var(--line); background: #fff; }
.site-footer strong { color: var(--ink); display: block; }
.main-container { height: max(600px, calc(100dvh - var(--header-height, 290px))); }
@media (max-width: 900px) { .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dashboard-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
    .brand-row { grid-template-columns: 1fr 1fr; justify-items: center; gap: 16px; }
    .brand-title { grid-column: 1 / -1; grid-row: 2; }
    .logo-box { width: 128px; height: 72px; }
    .logo-box img { max-width: 108px; max-height: 54px; }
    .group-identity { margin-top: 14px; }
    .content-page { padding: 24px 20px; }
    .main-container { height: auto; min-height: 0; }
    .page-intro { flex-wrap: wrap; }
    .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpi-card { padding: 17px; }
    .kpi-card strong { font-size: 24px; }
    .dashboard-panel { padding: 19px; }
}
@media (max-width: 480px) {
    .team-grid { grid-template-columns: 1fr; }
    .mentor-card { flex-direction: column; text-align: center; }
    .chart-row { grid-template-columns: 84px minmax(0, 1fr) 54px; gap: 6px; }
    .chart-scale { margin-left: 90px; margin-right: 60px; }
    .page-nav { gap: 18px; }
}

/* Lima anggota disusun tiga di atas dan dua di tengah bawah. */
.team-grid[data-member-count="5"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.team-grid[data-member-count="5"] .person-card { grid-column: span 2; }
.team-grid[data-member-count="5"] .person-card:nth-child(4) { grid-column: 2 / span 2; }
.team-grid[data-member-count="5"] .person-card:nth-child(5) { grid-column: 4 / span 2; }
@media (max-width: 760px) {
    .team-grid[data-member-count="5"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .team-grid[data-member-count="5"] .person-card,
    .team-grid[data-member-count="5"] .person-card:nth-child(4),
    .team-grid[data-member-count="5"] .person-card:nth-child(5) { grid-column: auto; }
}
@media (max-width: 480px) {
    .team-grid[data-member-count="5"] { grid-template-columns: 1fr; }
}
/* Logo berdampingan tanpa kotak putih */
.brand-row {
    grid-template-columns: 160px 76px minmax(0, 1fr);
    gap: 20px;
    align-items: center;
}

.brand-row > .logo-box:first-child {
    grid-column: 1;
    grid-row: 1;
}

.brand-row > .logo-box:last-child {
    grid-column: 2;
    grid-row: 1;
}

.brand-row > .brand-title {
    grid-column: 3;
    grid-row: 1;
}

.brand-row > .logo-box {
    width: 100%;
    height: 76px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.brand-row > .logo-box img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 76px;
    object-fit: contain;
}

/* Tampilan di HP */
@media (max-width: 760px) {
    .brand-row {
        grid-template-columns: 150px 70px;
        justify-content: center;
        gap: 16px;
    }

    .brand-row > .brand-title {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}
/* Judul tepat di tengah header */
@media (min-width: 1101px) {
    .brand-row {
        grid-template-columns:
            160px 76px minmax(0, 1fr) 76px 160px;
        gap: 20px;
    }

    .brand-row > .brand-title {
        grid-column: 3;
        grid-row: 1;
        text-align: center;
    }
}

/* Layar kecil: logo berdampingan di atas judul */
@media (max-width: 1100px) {
    .brand-row {
        grid-template-columns: 150px 70px;
        justify-content: center;
        gap: 16px;
    }

    .brand-row > .brand-title {
        grid-column: 1 / -1;
        grid-row: 2;
        text-align: center;
    }
}
/* Kapital untuk judul, lokasi, dan identitas kelompok */
.brand-title,
.group-identity {
    text-transform: uppercase;
}