/* ============================================================
   KBLI-KONVERSI.CSS  —  regulasiku.id
   Styling for the two KBLI 2020<->2025 conversion-table widgets
   appended to the end of .batang-tubuh by _js/kbli-konversi.js —
   each an <h2> (so toc.js picks it up, same as a kategori heading)
   followed by one flat .kbli-konversi-body sibling, mirroring
   kbli-dinamis.js's own heading + .editable-content pairs.
   Their .tooltip-trigger links are picked up by tooltip.js since
   that listens on the whole .peraturan container.
   ============================================================ */

.kbli-konversi-body {
    margin-bottom: 1.5rem;
}

.kbli-konversi-desc {
    margin: 0 0 1rem 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
}

.kbli-konversi-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin: 0 0 1rem 0;
    font-size: 0.8rem;
    color: #475569;
}

.konversi-legend-item {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
}

.konversi-legend-dot {
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    flex: none;
    transform: translateY(0.05rem);
}

.kbli-konversi-toolbar {
    display: flex;
    margin-bottom: 0.9rem;
}

.kbli-konversi-search {
    flex: 1 1 220px;
    max-width: 320px;
    padding: 0.45rem 0.9rem;
    font-size: 0.9rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 999px;
    outline: none;
    color: #334155;
}

.kbli-konversi-table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.kbli-konversi-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.kbli-konversi-table th,
.kbli-konversi-table td {
    padding: 0.55rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eef2f6;
    vertical-align: top;
}

.kbli-konversi-table thead th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.kbli-konversi-table .konversi-th-code {
    white-space: nowrap;
    width: 6.5rem;
}

.kbli-konversi-table td.konversi-code {
    font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
    white-space: nowrap;
}

.kbli-konversi-table tbody tr:hover {
    filter: brightness(0.97);
}

/* Row/legend colors mirror BPS's own Tabel 8 scheme (orange/green/blue),
   plus a 4th color for "banyak ke banyak" — a real, sizeable category
   (~34% of rows) that BPS's illustrative example doesn't show. */
.konversi-row-satu-ke-satu,
.konversi-legend-dot.konversi-row-satu-ke-satu {
    background: #fdecd2;
}

.konversi-row-satu-ke-banyak,
.konversi-legend-dot.konversi-row-satu-ke-banyak {
    background: #d9f2df;
}

.konversi-row-banyak-ke-satu,
.konversi-legend-dot.konversi-row-banyak-ke-satu {
    background: #d9e8f7;
}

.konversi-row-banyak-ke-banyak,
.konversi-legend-dot.konversi-row-banyak-ke-banyak {
    background: #e6dbf5;
}

.konversi-status {
    text-align: center;
    color: #64748b;
    padding: 1.25rem 0.75rem;
}

.kbli-konversi-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.9rem;
    font-size: 0.85rem;
    color: #475569;
}

.kbli-konversi-pagination button {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.kbli-konversi-pagination button:disabled {
    opacity: 0.45;
    cursor: default;
}

@media screen and (max-width: 600px) {
    .kbli-konversi-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .kbli-konversi-search {
        max-width: none;
        /* Undo the desktop flex: 1 1 220px — once the toolbar above
           switches to flex-direction: column, that 220px flex-basis
           applies to height instead of width, ballooning the input
           into a huge oval. Width now comes from align-items: stretch
           on the column-direction toolbar instead. */
        flex: none;
    }
}
