/* =========================================================
   Dashboard — mengikuti token desain CLAUDE.md Bagian 5
   ========================================================= */

.db {
    max-width: 1320px;
    margin: 0 auto;
    padding: clamp(1.5rem, 3vw, 2.5rem) var(--pad-x) 4rem;
}

/* ---------- Header + filter ---------- */
.db-head {
    display: flex; flex-wrap: wrap; gap: 1.5rem;
    align-items: flex-end; justify-content: space-between;
    padding-bottom: 1.4rem;
    margin-bottom: 1.8rem;
    border-bottom: 1px solid rgba(11, 61, 58, .12);
}
.db-head__title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.8rem, 3.4vw, 2.6rem);
    letter-spacing: -0.025em;
    color: var(--laut-dalam);
    margin: .5rem 0 0;
}
.db-filter { display: flex; flex-wrap: wrap; gap: .8rem; }
.db-filter label { display: grid; gap: .3rem; }
.db-filter span {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .14em;
    font-weight: 600; color: var(--tinta-lembut);
}
.db-filter select {
    font-family: var(--font-body); font-size: .92rem; font-weight: 500;
    padding: .5rem .8rem;
    border: 1px solid rgba(11, 61, 58, .18);
    border-radius: 10px;
    background: var(--putih);
    color: var(--laut-dalam);
    cursor: pointer;
    min-width: 150px;
}
.db-filter select:hover { border-color: var(--hijau-kepri); }

/* ---------- Panel 1: kartu ringkasan ---------- */
.db-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.4rem;
}
@media (max-width: 1000px) { .db-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .db-cards { grid-template-columns: 1fr; } }

.db-card {
    background: var(--putih);
    border: 1px solid rgba(11, 61, 58, .1);
    border-radius: 16px;
    padding: 1.3rem 1.4rem 1.2rem;
    box-shadow: 0 14px 40px -26px rgba(11, 61, 58, .3);
}
.db-card--sorot { border-color: rgba(201, 138, 59, .4); background: #FFFCF6; }
.db-card__label {
    font-size: .72rem; text-transform: uppercase; letter-spacing: .13em;
    font-weight: 600; color: var(--tinta-lembut);
}
.db-card__num {
    font-family: var(--font-display); font-weight: 500;
    font-size: clamp(1.9rem, 3vw, 2.6rem); line-height: 1.05;
    letter-spacing: -0.03em; color: var(--laut-dalam);
    margin: .55rem 0 .5rem;
}
.db-card__unit {
    font-family: var(--font-body); font-size: .95rem; font-weight: 500;
    color: var(--tinta-lembut); margin-left: .35rem;
}
.db-card__foot { font-size: .82rem; color: var(--tinta-lembut); }
.delta {
    font-weight: 600; font-variant-numeric: tabular-nums;
    padding: .1rem .4rem; border-radius: 6px; margin-right: .3rem;
}
.delta--naik { background: rgba(21, 122, 82, .12); color: var(--hijau-kepri); }
.delta--turun { background: rgba(201, 138, 59, .16); color: #9a6420; }

/* ---------- Kerangka panel ---------- */
.db-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.4rem;
    margin-bottom: 1.4rem;
}
@media (max-width: 1000px) { .db-grid { grid-template-columns: 1fr; } }

.db-panel {
    background: var(--putih);
    border: 1px solid rgba(11, 61, 58, .1);
    border-radius: 18px;
    padding: 1.5rem 1.6rem 1.7rem;
    box-shadow: 0 18px 50px -30px rgba(11, 61, 58, .3);
    margin-bottom: 1.4rem;
}
.db-grid > .db-panel { margin-bottom: 0; }
.db-panel__head { margin-bottom: 1.2rem; }
.db-panel__head h2 {
    font-family: var(--font-display); font-weight: 600;
    font-size: 1.18rem; letter-spacing: -0.015em;
    color: var(--laut-dalam); margin: 0 0 .35rem;
}
.db-panel__head p { font-size: .86rem; color: var(--tinta-lembut); margin: 0; line-height: 1.5; }

/* ---------- Panel 2: batang peringkat ---------- */
.db-legend {
    display: inline-flex; align-items: center; gap: .5rem;
    font-size: .78rem; color: var(--tinta-lembut); margin-bottom: .9rem;
}
.db-legend__line {
    width: 22px; height: 0;
    border-top: 2px dashed var(--laut-dalam); opacity: .6;
}

.bars { position: relative; display: grid; gap: .55rem; }
.bars__prov {
    position: absolute;
    left: calc(140px + (100% - 140px - 76px) * var(--prov) / 100%);
    top: 0; bottom: 0; width: 0;
    border-left: 2px dashed rgba(11, 61, 58, .45);
    z-index: 2; pointer-events: none;
}
.bar-row {
    display: grid;
    grid-template-columns: 140px 1fr 76px;
    align-items: center; gap: .7rem;
}
.bar-row__nama { font-size: .86rem; font-weight: 500; color: var(--laut-dalam); }
.bar-row__track {
    height: 22px; border-radius: 6px;
    background: rgba(11, 61, 58, .06);
    overflow: hidden;
}
.bar-row__fill {
    display: block; height: 100%;
    background: linear-gradient(90deg, var(--hijau-kepri), var(--turkis-dangkal));
    border-radius: 6px;
    transform-origin: left;
    animation: barGrow .8s cubic-bezier(.2, .8, .2, 1) both;
}
.bar-row__fill.is-bawah {
    background: linear-gradient(90deg, #b8792e, var(--kayu-perahu-2));
}
@keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bar-row__nilai {
    font-size: .88rem; font-weight: 600; text-align: right;
    color: var(--laut-dalam); white-space: nowrap;
}

/* ---------- Penanda kualitas data ---------- */
.tanda {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: .68rem; font-weight: 700;
    border-radius: 999px; margin-left: .3rem;
}
.tanda--ragu {
    width: 16px; height: 16px;
    background: var(--kayu-perahu); color: #fff; cursor: help;
}
.tanda--proksi {
    padding: .12rem .5rem; font-style: italic; font-weight: 600;
    background: rgba(201, 138, 59, .15); color: #8a5a1c;
    margin-right: .35rem; margin-left: 0;
}
.tanda--tunggu {
    padding: .25rem .7rem;
    background: rgba(11, 61, 58, .1); color: var(--laut-dalam);
    letter-spacing: .06em; text-transform: uppercase; margin-left: 0;
}

/* ---------- Chart ---------- */
.db-chart { position: relative; height: 300px; }

/* ---------- Panel 5: jaringan ---------- */
.db-net {
    display: grid;
    grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr);
    gap: 1.6rem;
}
@media (max-width: 1000px) { .db-net { grid-template-columns: 1fr; } }
.db-net__canvas {
    background: linear-gradient(180deg, #FAFCFE, #EFF6FA);
    border-radius: 14px;
    border: 1px solid rgba(11, 61, 58, .08);
    overflow: hidden;
}
.db-net__canvas svg { width: 100%; height: auto; display: block; }
.db-net__side h3 {
    font-family: var(--font-display); font-weight: 600; font-size: 1rem;
    color: var(--laut-dalam); margin: 0 0 .3rem;
}
.db-net__hint { font-size: .8rem; color: var(--tinta-lembut); margin: 0 0 .8rem; }
.db-rapuh {
    list-style: none; padding: 0; margin: 0;
    max-height: 430px; overflow-y: auto;
    display: grid; gap: .4rem;
}
.db-rapuh li {
    display: grid; gap: .1rem;
    padding: .5rem .7rem;
    background: rgba(201, 138, 59, .07);
    border-left: 3px solid var(--kayu-perahu);
    border-radius: 0 8px 8px 0;
    font-size: .82rem;
}
.db-rapuh strong { color: var(--laut-dalam); }
.db-rapuh__kab { color: var(--tinta-lembut); font-size: .74rem; }
.db-rapuh__trayek { color: #8a5a1c; font-size: .74rem; font-weight: 600; }

/* simpul & sisi pada SVG */
.net-sisi { stroke: #7FB1D4; stroke-width: 1; opacity: .45; fill: none; }
.net-simpul { fill: var(--hijau-kepri); opacity: .85; cursor: pointer; transition: opacity .2s; }
.net-simpul:hover { opacity: 1; }
.net-label { font-family: var(--font-body); font-size: 9px; fill: var(--tinta-lembut); }

/* ---------- Panel 4: slider ---------- */
.db-slider {
    display: flex; align-items: center; gap: .8rem;
    margin-bottom: 1rem; font-size: .82rem; color: var(--tinta-lembut);
}
.db-slider input[type=range] { flex: 1; accent-color: var(--hijau-kepri); }
.db-slider output {
    font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
    color: var(--laut-dalam); min-width: 3.4rem; text-align: right;
}

/* ---------- Panel 6: kalkulator ---------- */
.db-kalk { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-bottom: 1rem; }
.db-kalk label { display: grid; gap: .3rem; }
.db-kalk span {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .14em;
    font-weight: 600; color: var(--tinta-lembut);
}
.db-kalk select {
    font-family: var(--font-body); font-size: .9rem;
    padding: .5rem .7rem;
    border: 1px solid rgba(11, 61, 58, .18);
    border-radius: 10px; background: var(--putih); color: var(--laut-dalam);
}
.db-hasil { display: grid; gap: .6rem; }
.hasil-row {
    display: grid; gap: .25rem;
    padding: .8rem .9rem;
    border: 1px solid rgba(11, 61, 58, .1);
    border-radius: 12px;
    background: #FBFDFC;
}
.hasil-row__atas {
    display: flex; justify-content: space-between; align-items: baseline; gap: .6rem;
}
.hasil-row__jenis { font-size: .78rem; font-weight: 600; color: var(--hijau-kepri); }
.hasil-row__tarif {
    font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
    color: var(--laut-dalam); font-variant-numeric: tabular-nums;
}
.hasil-row__tahunan {
    font-size: .84rem; color: var(--tinta-lembut);
}
.hasil-row__tahunan strong { color: #9a6420; font-variant-numeric: tabular-nums; }
.hasil-row__dasar { font-size: .7rem; color: var(--tinta-lembut); opacity: .85; }
.db-hasil__kosong { font-size: .86rem; color: var(--tinta-lembut); padding: .8rem 0; }

/* ---------- Panel menunggu data ---------- */
.db-panel--kosong {
    background: repeating-linear-gradient(45deg,
        #FBF8F1 0 12px, #F6F1E6 12px 24px);
    border-style: dashed;
    border-color: rgba(11, 61, 58, .2);
}
.db-kosong { max-width: 62ch; }
.db-kosong h2 {
    font-family: var(--font-display); font-weight: 600; font-size: 1.2rem;
    color: var(--laut-dalam); margin: 0 0 .6rem;
}
.db-kosong p { font-size: .92rem; line-height: 1.6; color: var(--tinta-lembut); margin: 0 0 1rem; }
.db-kosong__aksi { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; font-size: .82rem; color: var(--tinta-lembut); }
.db-kosong code {
    background: rgba(11, 61, 58, .08); padding: .15rem .45rem;
    border-radius: 5px; font-size: .8rem;
}

/* ---------- Footer ---------- */
.db-foot {
    margin-top: 2rem; padding-top: 1.2rem;
    border-top: 1px solid rgba(11, 61, 58, .12);
    display: grid; gap: .6rem;
    font-size: .8rem; color: var(--tinta-lembut); line-height: 1.6;
}
.db-foot__tanda { display: flex; align-items: center; gap: .4rem; }

@media (prefers-reduced-motion: reduce) {
    .bar-row__fill { animation: none; }
}
