/* ============================================================
   Tema Merah Marun — Sistem Informasi Arsip
   KPU Kabupaten Lombok Timur
   ============================================================ */
:root {
    /* Palet marun */
    --maroon: #7a1220;
    --maroon-dark: #590d17;
    --maroon-deep: #430a12;
    --maroon-soft: #f6ebec;
    --maroon-line: #e6d2d5;

    /* Nama lama (dipakai di blade) — mengarah ke marun */
    --red: #7a1220;
    --red-dark: #590d17;

    --ink: #2b2224;
    --muted: #7c6e71;
    --line: #ece3e5;
    --bg: #f7f5f5;
    --card: #ffffff;
    --ok: #146c43;
    --warn: #9a5b0b;
    --radius: 12px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

.container { width: min(1240px, 94vw); margin: 0 auto; }

/* ---------- Topbar (marun) ---------- */
.topbar {
    background: linear-gradient(135deg, var(--maroon) 0%, var(--maroon-dark) 62%, var(--maroon-deep) 100%);
    color: #fff;
    box-shadow: 0 3px 16px rgba(67, 10, 18, .38);
    position: sticky; top: 0; z-index: 50;
    border-bottom: 3px solid rgba(255, 255, 255, .14);
    max-height: 120px; /* batas atas agar animasi menutup bisa halus */
    transition: max-height .28s ease, box-shadow .28s ease;
}
/* Auto-hide topbar — menutup otomatis saat area tabel diklik agar ruang lega */
body.topbar-hidden .topbar {
    max-height: 0; overflow: hidden;
    border-bottom-width: 0; box-shadow: none;
}
.topbar-inner { display: flex; align-items: center; gap: 18px; padding: 11px 0; }
.brand { display: flex; align-items: center; gap: 11px; }
/* Logo KPU di topbar — tampil apa adanya, tanpa bingkai/kotak */
.brand-logo { height: 44px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15px; letter-spacing: .2px; }
.brand-text small { font-size: 11.5px; opacity: .8; }
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav-link {
    color: #fff; text-decoration: none; padding: 8px 15px; border-radius: 8px;
    font-weight: 600; font-size: 14px; opacity: .9;
    transition: background .15s ease, opacity .15s ease;
}
.nav-link:hover { background: rgba(255, 255, 255, .14); opacity: 1; }
.nav-link.is-active {
    background: #fff; color: var(--maroon); opacity: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}
.nav-toggle {
    display: none; margin-left: auto;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .35);
    color: #fff; font-family: inherit; font-size: 12.5px; font-weight: 700;
    letter-spacing: .6px; text-transform: uppercase;
    padding: 8px 15px; border-radius: 8px; cursor: pointer;
}
.nav-toggle:hover { background: rgba(255, 255, 255, .22); }

/* ---------- Layout ---------- */
.main { padding: 24px 0 44px; }
.footer { border-top: 1px solid var(--line); padding: 16px 0 26px; color: var(--muted); font-size: 13px; background: #fff; }
/* Logo KPU di footer — tanpa bingkai */
.footer-inner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer-logo { height: 38px; width: auto; display: block; flex-shrink: 0; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; letter-spacing: -.2px; position: relative; padding-left: 14px; }
.page-head h1::before {
    content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px; border-radius: 4px;
    background: linear-gradient(180deg, var(--maroon), var(--maroon-deep));
}
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }

.card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px; margin-bottom: 16px; box-shadow: 0 6px 22px rgba(67, 10, 18, .05);
}
.card h2 { margin: 0 0 12px; font-size: 15.5px; color: var(--maroon-dark); }

/* ---------- Forms ---------- */
label.field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.input, select.input, textarea.input {
    width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
    font-size: 14.5px; background: #fff; color: var(--ink); font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus {
    outline: none; border-color: var(--maroon);
    box-shadow: 0 0 0 3px rgba(122, 18, 32, .14);
}
textarea.input { resize: vertical; min-height: 88px; }

.search-wrap { position: relative; }
.search-wrap .input { height: 48px; font-size: 15.5px; padding: 0 88px 0 15px; }
.search-hint {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    font-size: 10.5px; font-weight: 700; letter-spacing: .5px; color: var(--maroon);
    border: 1px solid var(--maroon-line); border-radius: 6px; padding: 3px 8px;
    background: var(--maroon-soft); pointer-events: none;
}

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 14px; }

.btn {
    display: inline-flex; align-items: center; gap: 7px; justify-content: center;
    padding: 9px 16px; border-radius: 9px; border: 1px solid transparent; cursor: pointer;
    font-size: 14px; font-weight: 600; font-family: inherit; text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn-primary {
    background: linear-gradient(135deg, var(--maroon), var(--maroon-dark)); color: #fff;
    box-shadow: 0 4px 12px rgba(122, 18, 32, .28);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 6px 16px rgba(122, 18, 32, .36); }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--maroon-line); }
.btn-ghost:hover { background: var(--maroon-soft); color: var(--maroon-dark); border-color: var(--maroon); }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; }
.btn-danger { background: #fff; color: var(--maroon); border-color: var(--maroon-line); }
.btn-danger:hover { background: var(--maroon-soft); }
.btn-link {
    background: none; border: 0; color: var(--maroon); font-weight: 700; cursor: pointer;
    font-size: 13px; padding: 4px 6px; font-family: inherit;
    text-decoration: underline; text-underline-offset: 3px;
}
.btn-link:hover { color: var(--maroon-deep); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filter-flag {
    padding: 1px 9px; border-radius: 999px; background: var(--maroon-soft); color: var(--maroon-dark);
    font-size: 11px; font-weight: 700; margin-left: 2px;
}
.result-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px 2px 12px; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.result-meta strong { color: var(--ink); }

/* ---------- Table (elegan, zebra marun muda) ---------- */
.table-scroll {
    overflow: auto;
    max-height: 72vh; /* Fixed header: header tetap, isi tabel yang bergulir */
    overscroll-behavior: contain;
    border: 1px solid var(--maroon-line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 12px 30px rgba(67, 10, 18, .08);
    transition: opacity .2s ease, max-height .3s ease;
}
/* Saat topbar menutup, tabel membesar mengisi ruang yang tersisa */
body.topbar-hidden .table-scroll { max-height: calc(100vh - 150px); }
/* Scrollbar halus senada tema */
.table-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.table-scroll::-webkit-scrollbar-track { background: #faf6f6; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--maroon-line); border-radius: 999px; }
.table-scroll::-webkit-scrollbar-thumb:hover { background: #cdb4b8; }
.table-scroll { scrollbar-width: thin; scrollbar-color: var(--maroon-line) #faf6f6; }
.opacity-60 { opacity: .6; }

table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.6px; }
table.data thead th {
    background: linear-gradient(180deg, var(--maroon) 0%, var(--maroon-dark) 100%);
    color: #fff; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px;
    padding: 12px; text-align: left; vertical-align: middle; white-space: nowrap;
    border-bottom: 2px solid var(--maroon-deep);
    /* Fixed header: tetap menempel di atas saat isi tabel bergulir */
    position: sticky; top: 0; z-index: 3;
    box-shadow: 0 4px 8px -4px rgba(0, 0, 0, .3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}
table.data thead th.sortable { cursor: pointer; user-select: none; transition: filter .15s ease; }
table.data thead th.sortable:hover { filter: brightness(1.12); }
.sort-ind {
    display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px;
    background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .38);
    font-size: 9.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
    vertical-align: middle; text-shadow: none;
}
table.data tbody td {
    padding: 10px 12px; text-align: left; vertical-align: top;
    border-bottom: 1px solid var(--line);
    transition: background .15s ease;
}
table.data tbody tr { transition: background .15s ease; }
table.data tbody tr:nth-child(even) { background: #fbf7f7; }
table.data tbody tr:hover, table.data tbody tr:hover > td { background: var(--maroon-soft); }
table.data tbody tr:last-child td { border-bottom: 0; }

.row-num {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 26px; padding: 2px 8px; border-radius: 7px;
    background: var(--maroon-soft); color: var(--maroon-dark);
    font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.perihal-cell { min-width: 260px; max-width: 420px; }

.badge {
    display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
    font-size: 11.5px; font-weight: 700; letter-spacing: .3px; white-space: nowrap;
    border: 1px solid transparent;
}
.badge-red { background: #f9dcdc; color: var(--maroon-dark); border-color: #f0c3c6; }
.badge-green { background: #e3f4ea; color: var(--ok); border-color: #c4e5d3; }
.badge-amber { background: #fbf0dc; color: var(--warn); border-color: #eeddb7; }
.badge-gray { background: #f2eef0; color: #584c4f; border-color: #e5dee1; }
.badge-blue { background: #e9edfa; color: #27418f; border-color: #d4dcf3; }

/* ---------- Kolom Aksi: status ditemukan / tidak ditemukan ---------- */
.count-not-found { color: var(--maroon); }
table.data tbody tr.row-not-found,
table.data tbody tr.row-not-found:hover,
table.data tbody tr.row-not-found:hover > td { background: #fbe9ea; }
table.data tbody tr.row-not-found td { border-bottom-color: #f2d3d5; }

.status-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: 999px; cursor: pointer;
    font-size: 11.5px; font-weight: 700; letter-spacing: .3px; white-space: nowrap;
    font-family: inherit; border: 1px solid transparent;
    transition: background .15s ease, border-color .15s ease;
}
.status-btn:disabled { opacity: .6; cursor: wait; }
.status-btn--found { background: #e3f4ea; color: var(--ok); border-color: #c4e5d3; }
.status-btn--found:hover { background: #d2ecdd; }
.status-btn--not-found { background: #f9dcdc; color: var(--maroon-dark); border-color: #f0c3c6; }
.status-btn--not-found:hover { background: #f5cbcd; }

/* ---------- Penomoran isian form arsip (angka di kiri input) ---------- */
.form-urut { display: flex; align-items: flex-start; gap: 10px; }
.form-urut-no {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; margin-top: 1px; border-radius: 999px;
    background: var(--maroon); color: #fff;
    font-size: 12px; font-weight: 700; line-height: 1; user-select: none;
}
.form-urut-isi { flex: 1 1 auto; min-width: 0; }
.form-urut-isi > .input { width: 100%; }
.form-urut-isi > .field-label { display: block; }

/* ---------- Menu aksi kolom Aksi (titik tiga) ---------- */
.aksi-td { position: relative; text-align: center; vertical-align: middle; }
.aksi { position: relative; display: inline-flex; }
.aksi-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; padding: 0; border-radius: 8px; cursor: pointer;
    border: 1px solid transparent; background: transparent; color: var(--muted);
    font-size: 18px; line-height: 1; font-family: inherit;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.aksi-btn:hover,
.aksi-btn[aria-expanded="true"] {
    background: var(--maroon-soft); color: var(--maroon-dark); border-color: var(--maroon-line);
}
.aksi-menu {
    position: absolute; right: 0; top: calc(100% + 4px); z-index: 40;
    min-width: 170px; padding: 4px; display: flex; flex-direction: column; gap: 2px;
    background: #fff; border: 1px solid var(--maroon-line); border-radius: 10px;
    box-shadow: 0 12px 26px rgba(89, 13, 23, .16);
}
.aksi-menu--atas { top: auto; bottom: calc(100% + 4px); }
.aksi-item {
    display: flex; align-items: center; gap: 6px; width: 100%;
    padding: 6px 10px; border: 0; border-radius: 7px; background: transparent;
    color: var(--ink); font-size: 12.5px; font-weight: 600; text-align: left;
    text-decoration: none; cursor: pointer; font-family: inherit; white-space: nowrap;
}
.aksi-item:hover { background: var(--maroon-soft); color: var(--maroon-dark); }
/* Item status memakai warna status (hijau/merah) tetapi tetap rapi sebaris */
.aksi-menu .aksi-item.status-btn {
    border: 0; border-radius: 7px; padding: 6px 10px; width: 100%;
    font-size: 12.5px; font-weight: 600; justify-content: flex-start;
}
.aksi-menu .aksi-item.status-btn--found:hover { background: #d2ecdd; color: var(--ok); }
.aksi-menu .aksi-item.status-btn--not-found:hover { background: #f5cbcd; color: var(--maroon-dark); }

.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pagination .pages { display: flex; gap: 6px; flex-wrap: wrap; }
.page-btn {
    min-width: 36px; padding: 7px 11px; border: 1px solid var(--maroon-line); background: #fff;
    border-radius: 8px; cursor: pointer; font-size: 13.5px; font-family: inherit;
    color: var(--maroon); font-weight: 600; transition: all .15s ease;
}
.page-btn:hover:not(:disabled) { background: var(--maroon); border-color: var(--maroon); color: #fff; }
.page-btn.is-active {
    background: linear-gradient(135deg, var(--maroon), var(--maroon-dark));
    border-color: var(--maroon-dark); color: #fff; box-shadow: 0 4px 10px rgba(122, 18, 32, .3);
}
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-btn--nav { padding: 7px 14px; }
.page-info { color: var(--muted); font-size: 13px; }

/* ---------- Detail expand ---------- */
.detail-box {
    background: linear-gradient(180deg, #fdf9f9, #faf4f5);
    border: 1px solid var(--maroon-line); border-radius: 10px; padding: 14px 16px;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px 20px; font-size: 13.4px;
}
.detail-box dt { color: var(--maroon); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 2px; font-weight: 700; }
.detail-box dd { margin: 0 0 6px; }

/* ---------- Jenis keterangan ---------- */
.ket-text { white-space: pre-wrap; max-width: 620px; line-height: 1.5; }
.ket-empty { color: var(--muted); font-style: italic; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.form-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ---------- Toast ---------- */
.toast {
    position: fixed; right: 20px; bottom: 20px; z-index: 100;
    background: linear-gradient(135deg, var(--maroon), var(--maroon-deep)); color: #fff;
    padding: 12px 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
    box-shadow: 0 10px 26px rgba(67, 10, 18, .35);
    animation: toast-in .25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .nav-toggle { display: block; }
    .nav {
        display: none; position: absolute; top: 100%; left: 0; right: 0;
        background: linear-gradient(180deg, var(--maroon-dark), var(--maroon-deep));
        flex-direction: column; padding: 8px; box-shadow: 0 12px 24px rgba(0, 0, 0, .25);
    }
    .nav--open { display: flex; }
    .brand-text small { display: none; }
    .brand-logo { height: 36px; }
    .footer-logo { height: 32px; }
}

/* ---------- Print: buka scroll container, header kembali statis ---------- */
@media print {
    .table-scroll { max-height: none !important; overflow: visible !important; box-shadow: none !important; }
    table.data thead th { position: static !important; box-shadow: none !important; }
}

/* ============================================================
   Dashboard Awal
   ============================================================ */
.dashboard { padding: 28px 0 44px; }

/* ---------- Kepala halaman ---------- */
.dashboard .page-head { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 20px; }
.dashboard .page-head .sub { margin-top: 5px; color: var(--muted); font-size: 13.5px; }
.page-head-actions { display: flex; justify-content: flex-end; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border: 1px solid var(--maroon); border-radius: 10px; background: linear-gradient(135deg, var(--maroon), var(--maroon-dark)); color: #fff; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; box-shadow: 0 4px 12px rgba(122, 18, 32, .28); transition: background .15s ease, transform .15s ease; }
.btn:hover { filter: brightness(1.08); box-shadow: 0 6px 16px rgba(122, 18, 32, .36); }
.btn:active { transform: translateY(1px); }
.btn-icon { font-size: 16px; line-height: 1; }

/* ---------- Kartu ringkasan ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(216px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card { background: #fff; border: 1px solid var(--maroon-line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 2px 10px rgba(67, 10, 18, .06); }
.card-num { font-size: 26px; font-weight: 800; color: var(--maroon); letter-spacing: -1px; line-height: 1.1; }
.card-lab { font-size: 12.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.card--found .card-num { color: var(--ok); }
.card--missing .card-num { color: var(--maroon-dark); }
.card--kinds .card-num { color: var(--maroon); }

/* ---------- Denah ruang arsip (tata letak seperti denah) ---------- */
.denah-wrap { margin-bottom: 24px; }
.denah-wrap .section-head { margin-bottom: 16px; }

/* Kepala denah: judul di kiri, dropdown tahun di kanan */
.denah-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; }
.denah-head > div { min-width: 0; }

/* Dropdown tahun denah (Semua Tahun / 2019 / 2014) */
.denah-tahun { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.denah-tahun label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); white-space: nowrap; }
.denah-tahun .denah-tahun-select {
    width: auto; min-width: 156px; padding: 8px 10px;
    border: 1.5px solid #101010; border-radius: 6px; background: #fff;
    font-size: 13px; font-weight: 700; color: #101010; cursor: pointer;
}
.denah-tahun .denah-tahun-select:focus {
    outline: none; border-color: var(--maroon);
    box-shadow: 0 0 0 3px rgba(122, 18, 32, .14);
}

/* Area abu-abu di sekeliling ruangan (koridor) */
.denah {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: clamp(14px, 2vw, 24px);
    border: 3px solid #101010;
    border-radius: var(--radius);
    background: #b7b7b7;
    box-shadow: 0 10px 26px rgba(67, 10, 18, .12);
}

/* Ruangan: lantai putih berdinding tebal seperti denah */
.denah-room {
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 2.4vw, 26px);
    padding: clamp(14px, 2vw, 26px);
    background: #fbfbf9;
    border: 4px solid #101010;
    border-radius: 3px;
    min-width: 0;
}

/* Satu blok = satu kode klasifikasi utama (plat nama + baris sel) */
.denah-blok { display: flex; flex-direction: column; gap: 7px; min-width: 0; }

/* Plat nama klasifikasi — label blok di atas baris sel */
.denah-plate {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1.5px solid #101010; border-radius: 4px;
    padding: 5px 10px; box-shadow: 0 2px 0 rgba(0, 0, 0, .18);
    min-width: 0;
}
.denah-code { font-family: "Consolas", "Courier New", monospace; font-size: 13.5px; font-weight: 800; color: var(--maroon-dark); letter-spacing: .5px; }
.denah-name { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.denah-count { margin-left: auto; flex-shrink: 0; background: var(--maroon); color: #fff; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }

/* Lorong: blok kiri, label jumlah kode/arsip di lorong tengah, blok kanan */
.denah-lorong {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    column-gap: clamp(16px, 4vw, 64px);
    align-items: start;
}
.denah-lorong-cap { align-self: center; text-align: center; color: #101010; padding: 0 4px; white-space: nowrap; }
.denah-lorong-cap strong { display: block; font-size: 17px; font-weight: 800; line-height: 1.05; }
.denah-lorong-cap span { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.denah-lorong-cap small { display: block; font-size: 10px; color: #333; margin-top: 3px; }

/* Baris sel — tiap sel satu kode klasifikasi level-2 */
.denah-cells { display: flex; flex-wrap: wrap; gap: 5px; align-content: flex-start; }

/* Satu sel (peta kode) di dalam denah */
.denah-sel {
    flex: 0 0 auto;
    min-width: 56px; padding: 0 6px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #8fd2a0;
    border: 1.5px solid #101010; border-radius: 3px;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
    color: #0d0d0d; text-decoration: none;
    white-space: nowrap; overflow: hidden;
    transition: background .12s ease, transform .12s ease, box-shadow .12s ease;
}
.denah-sel:hover,
.denah-sel:focus-visible {
    background: #ffd21e;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, .3);
    outline: none;
}

/* Strip bawah: penanda masuk + blok klasifikasi terakhir */
.denah-bawah { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: flex-start; }
.denah-bawah .denah-blok { flex: 1 1 240px; }
.denah-masuk {
    align-self: center; flex-shrink: 0;
    background: #ffd21e; border: 1.5px solid #101010; border-radius: 4px;
    padding: 9px 18px; font-size: 12px; font-weight: 800; letter-spacing: 1px;
    text-transform: uppercase; color: #101010;
    box-shadow: 0 2px 0 rgba(0, 0, 0, .28);
}

/* Keterangan denah di bawah ruangan (area abu-abu) */
.denah-kaki { display: flex; flex-wrap: wrap; gap: 10px; }
.denah-kunci {
    display: inline-flex; align-items: center; gap: 7px;
    border: 1.5px solid #101010; border-radius: 4px;
    padding: 6px 14px; font-size: 12px; font-weight: 700;
}
.denah-kunci--sel { background: #fff; color: #101010; }
.denah-kunci--klik { background: #2f6fdb; color: #fff; }
.denah-swatches { width: 16px; height: 11px; background: #8fd2a0; border: 1.5px solid #101010; border-radius: 2px; }

.denah-empty {
    text-align: center;
    color: var(--muted); background: #fff;
    border: 1.5px dashed rgba(0, 0, 0, .3);
    border-radius: 8px;
    padding: 24px;
    font-size: 13px;
}

/* ---------- Table tweaks ---------- */
.w-code { width: 110px; }
.w-label { width: 230px; }
.w-jml { width: 150px; text-align: right; }
.w-persen { width: 130px; text-align: right; }
.data td.num, .data th.num { text-align: right; }
.data td.code { font-family: "Consolas", "Courier New", monospace; font-weight: 700; color: var(--maroon-dark); }
.status-badge { white-space: nowrap; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    /* Lorong kiri-kanan ditumpuk agar sel tetap terbaca */
    .denah-lorong { grid-template-columns: minmax(0, 1fr); row-gap: 10px; }
    .denah-lorong-cap { padding: 4px 0; }
}

@media (max-width: 860px) {
    .cards { grid-template-columns: 1fr; }
    .denah { padding: 12px; }
    .denah-room { padding: 12px; gap: 16px; }
    .denah-sel { min-width: 48px; height: 24px; font-size: 10px; }
    .denah-plate { flex-wrap: wrap; }
    .denah-tahun { width: 100%; }
    .denah-tahun .denah-tahun-select { flex: 1; min-width: 0; }
    .page-head { flex-wrap: wrap; }
    .page-head-actions { width: 100%; justify-content: flex-start; margin-top: 12px; }
}

