/* e-Rapor SD - responsive fixes for narrow laptop screens (1280px and up)
   Added 2026-11-26.

   1. The 6 KPI cards on /visualisasi_data use Bootstrap's col-xl-2, which
      squeezes all six into ~207px each on a 1280px screen and makes the
      headings wrap onto 3 lines. We give the KPI row its own grid so all six
      stay in ONE row, as in the reference design.
   2. The "Nilai Tertinggi / Terendah" card shows "98 / 36". The decorative
      watermark icon used to sit in the same flex row as the number and
      squeezed it, so the number wrapped. The icon is taken out of the text
      flow and the value is forced onto one line. */

/* ---- 1. KPI row: six cards in one row ---- */
@media (min-width: 1200px) {
    #viz-kpi-row {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 12px;
    }
    #viz-kpi-row > div {
        width: auto !important;
        padding-left: 0;
        padding-right: 0;
    }
}

/* Below 1200px keep a comfortable 2-3 up layout instead of six squeezed. */
@media (min-width: 768px) and (max-width: 1199px) {
    #viz-kpi-row {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }
    #viz-kpi-row > div {
        width: auto !important;
        padding-left: 0;
        padding-right: 0;
    }
}

/* ---- 2. Keep the numbers on one line ---- */
#viz-kpi-row .viz-kpi-value {
    white-space: nowrap;
    line-height: 1.15;
}

/* The watermark icon is decoration only - lift it out of the text flow so it
   cannot squeeze the value. The card body is already position:relative. */
#viz-kpi-row .viz-kpi .card-body {
    position: relative;
    padding-right: 14px;
}

#viz-kpi-row .viz-kpi-icon {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 0;
    pointer-events: none;
    line-height: 1;
}

/* The text block sits above the watermark. */
#viz-kpi-row .viz-kpi .card-body > .d-flex {
    position: relative;
    z-index: 1;
}

/* The label may wrap to two lines (the reference does too), but keep it tidy. */
#viz-kpi-row .viz-kpi-label {
    line-height: 1.25;
    padding-right: 26px;
}

/* Equal-height cards so the row bottom is a clean line. */
#viz-kpi-row .viz-kpi {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#viz-kpi-row .viz-kpi .card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

/* ---- 3. Chart panels ---- */
@media (max-width: 1399px) {
    .viz-card .card-body {
        padding: 0.75rem;
    }
    .viz-card canvas {
        max-width: 100%;
    }
}

/* ---- 4. Room for the fixed footer ----
   `.page-wrapper` has `height: 100%` in app.css, so padding-bottom does NOT
   extend the scroll area - only margin-bottom grows the scrollable height. */
.page-wrapper {
    margin-bottom: 72px !important;
}
