/* ================================================================
   SATU DATA — DASHBOARD STATISTIK (REDESIGN)
   Font: Plus Jakarta Sans | Accent: #004F3B / #009966
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.satudata-wrapper {
    width: 100%;
    background: #F0F2F5;
    min-height: 100vh;
    padding-top: 103px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ── Banner ──────────────────────────────────────────────────────*/
.satudata-banner {
    background: #005A3C;
    padding: 36px 0;
    position: relative;
    overflow: hidden;
}
.satudata-banner::before {
    content: '';
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.04) 1px,transparent 0);
    background-size: 24px 24px;
    pointer-events: none;
}
.satudata-banner-container {
    max-width: 1280px; margin: 0 auto; padding: 0 40px; position: relative; z-index: 2;
}
.satudata-banner-title  { font-size: 36px; font-weight: 800; color: #fff; margin-bottom: 6px; }
.satudata-banner-subtitle { font-size: 14px; color: rgba(255,255,255,.8); }

/* ── Main ────────────────────────────────────────────────────────*/
.satudata-main { padding: 28px 0 48px; }
.satudata-main-container { max-width: 1280px; margin: 0 auto; padding: 0 40px; }

/* ── Page Header ─────────────────────────────────────────────────*/
.db-page-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px;
}
.db-page-title  { font-size: 26px; font-weight: 800; color: #0F172A; }
.db-page-period { font-size: 13px; color: #64748B; margin-top: 2px; }
/* ── Date Range Picker ───────────────────────────────────────────*/
.drp-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    z-index: 200;
}
.drp-label {
    font-size: 11px;
    font-weight: 600;
    color: #009966;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

/* Trigger Button */
.drp-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 14px;
    background: #fff;
    border: 1px solid #CBD5E1;
    border-radius: 1px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #1E293B;
    cursor: pointer;
    transition: border-color .18s, box-shadow .18s;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.drp-trigger:hover {
    border-color: #009966;
    box-shadow: 0 0 0 2px rgba(0,153,102,.12);
}
.drp-trigger[aria-expanded="true"] {
    border-color: #009966;
    box-shadow: 0 0 0 2px rgba(0,153,102,.15);
}
.drp-cal-icon {
    width: 16px; height: 16px;
    color: #009966;
    flex-shrink: 0;
}
.drp-range-text {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.drp-chevron {
    width: 16px; height: 16px;
    color: #94A3B8;
    flex-shrink: 0;
    transition: transform .18s;
}
.drp-trigger[aria-expanded="true"] .drp-chevron {
    transform: rotate(180deg);
}

/* Dropdown Card */
.drp-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 1px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.04);
    width: 300px;
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    overflow: hidden;
}
.drp-dropdown--open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Calendar area */
.drp-calendar-area {
    padding: 14px 14px 6px;
}

/* Nav row */
.drp-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.drp-nav-btn {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 1px;
    cursor: pointer;
    color: #475569;
    transition: background .15s, color .15s, border-color .15s;
    padding: 0;
    flex-shrink: 0;
}
.drp-nav-btn:hover:not(:disabled) {
    background: #E6F7F0;
    color: #009966;
    border-color: #009966;
}
.drp-nav-btn:disabled { opacity: .35; cursor: not-allowed; }

.drp-cal-month-year {
    display: flex;
    align-items: center;
    justify-content: center;
}
.drp-cal-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #0F172A;
    user-select: none;
    letter-spacing: -0.2px;
}

/* Day names row */
.drp-day-names {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 4px;
}
.drp-day-name {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #64748B;
    padding: 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Days grid */
.drp-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    row-gap: 3px;
    column-gap: 0;
}
.drp-cell {
    position: relative;
    height: 34px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 500;
    color: #1E293B;
    background: transparent;
    border: none;
    border-radius: 1px;
    cursor: pointer;
    transition: background .12s, color .12s, border-radius .12s;
    padding: 0;
    line-height: 1;
}

/* Hover single date */
.drp-cell:hover:not(:disabled):not(.drp-cell--start):not(.drp-cell--end):not(.drp-cell--in-range) {
    background: #E6F7F0;
    color: #004F3B;
    border-radius: 1px;
}

.drp-cell--disabled {
    color: #CBD5E1;
    cursor: not-allowed;
}

/* Today indicator (outline) */
.drp-cell--today:not(.drp-cell--start):not(.drp-cell--end) {
    border: 1px solid #009966;
    border-radius: 50%;
    color: #009966;
    font-weight: 700;
}

/* Range Band Visuals */
.drp-cell--in-range {
    background: #E6F7F0 !important;
    color: #004F3B !important;
    font-weight: 600;
    border-radius: 0 !important;
}

/* Start date: kapsul bulat di kiri */
.drp-cell--start {
    background: #009966 !important;
    color: #ffffff !important;
    font-weight: 700;
    border-radius: 1px !important;
    z-index: 2;
}

/* End date: kapsul bulat di kanan */
.drp-cell--end {
    background: #009966 !important;
    color: #ffffff !important;
    font-weight: 700;
    border-radius: 1px !important;
    z-index: 2;
}

/* When range exists: kapsul kiri/kanan halus */
.drp-cell--start.drp-has-range {
    border-radius: 17px 0 0 17px !important;
}
.drp-cell--end.drp-has-range {
    border-radius: 0 17px 17px 0 !important;
}
.drp-cell--start.drp-cell--end {
    border-radius: 17px !important;
}

/* Empty cells */
.drp-empty {
    pointer-events: none;
}

/* Footer */
.drp-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px 12px;
    border-top: 1px solid #F1F5F9;
    gap: 8px;
    background: #FAFAFA;
}
.drp-selected-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748B;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.drp-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.drp-btn-reset {
    height: 30px;
    padding: 0 10px;
    background: #fff;
    border: 1px solid #CBD5E1;
    border-radius: 1px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #64748B;
    cursor: pointer;
    transition: border-color .15s, color .15s;
}
.drp-btn-reset:hover {
    border-color: #94A3B8;
    color: #334155;
}
.drp-btn-apply {
    height: 30px;
    padding: 0 12px;
    background: #009966;
    border: none;
    border-radius: 1px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: background .15s;
}
.drp-btn-apply:hover:not(:disabled) { background: #007a52; }
.drp-btn-apply:disabled {
    background: #CBD5E1;
    cursor: not-allowed;
}

/* ── 2-Column Layout ─────────────────────────────────────────────*/
.db-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}
.db-main    { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.db-sidebar { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* ── Stat Cards ──────────────────────────────────────────────────*/
.db-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.db-stat-card {
    background: #fff;
    border-radius: 3px;
    padding: 18px 16px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
    transition: all 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
}
.db-stat-card:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,.07);
    transform: translateY(-2px);
}
.db-stat-blue { background: #004F3B; color: #fff; border-color: #004F3B; }
.db-stat-blue .db-stat-label  { color: rgba(255,255,255,.75); }
.db-stat-blue .db-stat-number { color: #fff; }
.db-stat-blue .db-stat-change { color: rgba(255,255,255,.65); }
.db-stat-blue .db-stat-change span { color: #A7F3D0; }

.db-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.db-stat-icon {
    font-size: 18px;
    color: #94A3B8;
}
.db-stat-label  { font-size: 11px; font-weight: 700; color: #64748B; text-transform: uppercase; letter-spacing: 0.5px; }
.db-stat-number { font-size: 28px; font-weight: 800; color: #0F172A; letter-spacing: -1px; margin-top: 4px; }
.db-stat-change { font-size: 11px; color: #94A3B8; margin-top: auto; }
.db-stat-change.down span { color: #EF4444; font-weight: 700; }

/* Disease Layout */
.db-disease-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 12px;
    min-height: 38px;
}
.db-icd-badge {
    background: #FFF1F2;
    color: #E11D48;
    border: 1px solid #FFE4E6;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
}
.db-disease-desc {
    font-size: 13px;
    font-weight: 700;
    color: #1E293B;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.db-stat-cases-badge {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-top: auto;
}
.db-stat-cases-count {
    font-size: 24px;
    font-weight: 800;
    color: #0F172A;
    line-height: 1;
}
.db-stat-cases-label {
    font-size: 11px;
    color: #64748B;
    font-weight: 500;
}

/* Status Kunjungan Layout */
.db-kunjungan-grid {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
}
.db-kunj-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.db-kunj-info {
    display: flex;
    align-items: center;
    gap: 6px;
}
.db-kunj-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}
.db-kunj-indicator.green { background: #009966; }
.db-kunj-indicator.red { background: #EF4444; }
.db-kunj-val { font-size: 24px; font-weight: 800; line-height: 1; }
.db-kunj-val.green { color: #009966; }
.db-kunj-val.red   { color: #EF4444; }
.db-kunj-txt { font-size: 11px; color: #64748B; font-weight: 500; }
.db-kunj-divider {
    width: 1px;
    height: 28px;
    background: #E2E8F0;
    flex-shrink: 0;
}

/* ── Chart Cards ─────────────────────────────────────────────────*/
.db-chart-card {
    background: #fff;
    border-radius: 1px;
    padding: 20px 24px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.db-chart-title {
    font-size: 15px; font-weight: 700; color: #0F172A; margin-bottom: 16px;
}

/* ── Penyakit Card (vertical bar) ────────────────────────────────*/
.penyakit-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.penyakit-header .db-chart-title { margin-bottom: 0; }
.penyakit-legend {
    display: flex; align-items: center; gap: 14px;
    font-size: 12px; font-weight: 600; color: #475569;
}
.penyakit-legend-item {
    display: flex; align-items: center; gap: 6px;
}
.penyakit-legend-dot {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 3px; flex-shrink: 0;
}
.penyakit-chart-wrap {
    position: relative; height: 260px;
    background: linear-gradient(180deg, #F8FAFC 0%, #fff 100%);
    border-radius: 3px; padding: 8px 4px 0;
}

/* ── Sidebar Cards ───────────────────────────────────────────────*/
.dbs-card {
    background: #fff;
    border-radius: 1px;
    padding: 18px 18px 16px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.dbs-card-head {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px;
}
.dbs-card-title { font-size: 13px; font-weight: 700; color: #0F172A; }
.dbs-card-title-sm {
    font-size: 14px; font-weight: 700; color: #0F172A; margin-bottom: 10px;
}
.dbs-badge {
    font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 3px;
}
.dbs-badge.green { background: #E6F7F0; color: #009966; }
.dbs-badge.red   { background: #FEE2E2; color: #DC2626; }

/* Big percentage */
.dbs-big-pct {
    font-size: 40px; font-weight: 800; color: #009966;
    letter-spacing: -2px; line-height: 1;
}
.dbs-pct-label { font-size: 11px; color: #64748B; margin: 4px 0 14px; }

/* Split row */
.dbs-split {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.dbs-split-item { text-align: center; }
.dbs-split-num  { font-size: 28px; font-weight: 800; letter-spacing: -1px; }
.dbs-split-num.green { color: #009966; }
.dbs-split-num.red   { color: #DC2626; }
.dbs-unit       { font-size: 16px; font-weight: 600; }
.dbs-split-label { font-size: 10px; color: #64748B; margin: 2px 0; }
.dbs-badge-sm {
    display: inline-block; font-size: 10px; font-weight: 700;
    padding: 2px 8px; border-radius: 3px; margin-top: 4px;
}
.dbs-badge-sm.green { background: #E6F7F0; color: #009966; }
.dbs-badge-sm.red   { background: #FEE2E2; color: #DC2626; }

/* Satusehat */
.dbs-sublabel   { font-size: 11px; font-weight: 600; color: #64748B; }
.dbs-satusehat-num { font-size: 32px; font-weight: 800; color: #0F172A; letter-spacing: -1px; margin: 6px 0 2px; }
.dbs-terdaftar-row {
    display: flex; gap: 16px; margin-top: 8px;
}
.dbs-tf-green { font-size: 22px; font-weight: 800; color: #009966; }
.dbs-tf-red   { font-size: 22px; font-weight: 800; color: #EF4444; }
.dbs-tf-labels {
    display: flex; gap: 16px; font-size: 10px; color: #64748B; margin-top: 3px;
}
.dbs-tf-labels span:first-child { min-width: 56px; }

/* Legend & Dots */
.dbs-legend {
    margin-top: 10px; display: flex; flex-direction: column; gap: 4px;
    font-size: 11px; color: #475569;
}
.dbs-dot {
    display: inline-block; width: 9px; height: 9px;
    border-radius: 50%; margin-right: 5px; vertical-align: middle;
}

/* Mutu Layanan */
.dbs-mutu-list { display: flex; flex-direction: column; gap: 8px; }
.dbs-mutu-row {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px dashed #E2E8F0; padding-bottom: 7px;
}
.dbs-mutu-row:last-child { border-bottom: none; padding-bottom: 0; }
.dbs-mutu-name { font-size: 12px; color: #475569; }
.dbs-mutu-val  { font-size: 13px; font-weight: 800; color: #009966; }
.dbs-mutu-note { font-size: 10px; color: #94A3B8; margin-top: 10px; font-style: italic; }

/* Footnote */
.db-footnote {
    margin-top: 20px; font-size: 12px; color: #94A3B8;
    display: flex; align-items: center; gap: 5px;
}

/* ── Info Cards Grid ─────────────────────────────────────────────*/
.db-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.db-info-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 3px;
    padding: 20px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* shared header */
.db-ic-head {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #004F3B;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}
.db-ic-title {
    font-size: 14px;
    font-weight: 700;
    color: #004F3B;
    letter-spacing: -0.2px;
}
.db-ic-meta {
    font-size: 10px;
    color: #94A3B8;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

/* shared footer */
.db-ic-foot {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #F1F5F9;
    font-size: 11px;
    color: #94A3B8;
}
.db-ic-total {
    font-size: 13px;
    font-weight: 700;
    color: #0F172A;
}

/* ── Tenaga Medis ────────────────────────────────────────────────*/
.db-tm-list {
    display: flex;
    flex-direction: column;
    gap: 11px;
    flex: 1;
    margin-bottom: 14px;
}
.db-tm-row { display: flex; flex-direction: column; gap: 5px; }
.db-tm-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.db-tm-name {
    font-size: 12px;
    color: #334155;
    font-weight: 500;
}
.db-tm-n {
    font-size: 12px;
    font-weight: 700;
    color: #0F172A;
    letter-spacing: -0.3px;
}
.db-tm-track {
    height: 5px;
    background: #F1F5F9;
    border-radius: 99px;
    overflow: hidden;
}
.db-tm-fill {
    height: 100%;
    background: #009966;
    border-radius: 99px;
}

/* ── Fasilitas Kesehatan ─────────────────────────────────────────*/
.db-fk-list {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-bottom: 14px;
}
.db-fk-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #F8FAFC;
}
.db-fk-row:last-child { border-bottom: none; }
.db-fk-name {
    font-size: 12px;
    color: #475569;
    font-weight: 500;
}
.db-fk-n {
    font-size: 13px;
    font-weight: 700;
    color: #0F172A;
    letter-spacing: -0.3px;
}

/* ── SPM ─────────────────────────────────────────────────────────*/
.db-spm-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    margin-bottom: 14px;
}
.db-spm-row { display: flex; flex-direction: column; gap: 4px; }
.db-spm-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.db-spm-label {
    font-size: 11px;
    font-weight: 500;
    color: #475569;
}
.db-spm-pct {
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.db-spm-pct.spm-green  { color: #009966; }
.db-spm-pct.spm-yellow { color: #B45309; }
.db-spm-pct.spm-red    { color: #DC2626; }

.db-spm-track {
    height: 5px;
    background: #F1F5F9;
    border-radius: 99px;
    overflow: hidden;
}
.db-spm-fill {
    height: 100%;
    border-radius: 99px;
}
.db-spm-fill.spm-green  { background: #009966; }
.db-spm-fill.spm-yellow { background: #F59E0B; }
.db-spm-fill.spm-red    { background: #EF4444; }

/* ── Responsive ──────────────────────────────────────────────────*/
@media (max-width: 1100px) {
    .db-layout { grid-template-columns: 1fr; }
    .db-sidebar { display: grid; grid-template-columns: repeat(2, 1fr); }
    .db-info-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .satudata-main-container { padding: 0 16px; }
    .satudata-banner-container { padding: 0 16px; }
    .db-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .db-sidebar { grid-template-columns: 1fr; }
    .db-info-grid { grid-template-columns: 1fr; }
    .db-tenaga-row { grid-template-columns: 90px 1fr 38px; }

    /* Page Header Stack on Mobile */
    .db-page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }
    .db-page-title {
        font-size: 22px;
    }

    /* Date Range Picker Full Width on Mobile */
    .drp-wrapper {
        width: 100%;
        align-items: stretch;
    }
    .drp-label {
        align-self: flex-start;
    }
    .drp-trigger {
        width: 100%;
        justify-content: space-between;
        padding: 0 12px;
        height: 42px;
    }
    .drp-range-text {
        max-width: none;
        flex: 1;
        text-align: center;
        font-size: 13px;
    }
    .drp-dropdown {
        width: 100%;
        right: 0;
        left: 0;
        box-sizing: border-box;
    }
    .drp-calendar-area {
        padding: 12px 10px 6px;
    }
    .drp-cell {
        height: 34px;
        font-size: 12px;
    }
}
@media (max-width: 480px) {
    .db-stats-grid { grid-template-columns: 1fr; }
    .satudata-banner-title { font-size: 24px; }
    .db-faskes-grid { grid-template-columns: repeat(3, 1fr); }

    .db-page-title {
        font-size: 20px;
    }
    .drp-range-text {
        font-size: 12px;
    }
    .drp-calendar-area {
        padding: 10px 6px 4px;
    }
    .drp-cell {
        height: 32px;
        font-size: 11px;
    }
    .drp-day-name {
        font-size: 10px;
    }
    .drp-footer {
        padding: 8px 10px 10px;
    }
    .drp-selected-label {
        font-size: 10px;
    }
}
