/* Modul Isytihar Harta: Dashboard, Laporan, Rujukan & halaman lain (.ihd-page).
   Palet ikut warna asal modul: merah, oren, biru, ungu, hijau. Aksen utama maroon HR Portal. */
.ihd {
    --ihd-accent: #a6192e;
    --ihd-accent-dark: #7f1425;
    --ihd-accent-soft: #f8eef0;
    --ihd-text: #1f2430;
    --ihd-muted: #6b7280;
    --ihd-border: #e4e1ea;
    --ihd-track: #eeecf2;
    --ihd-hover: #f3f4f6;
    font-family: Arial, "Helvetica Neue", sans-serif;
    padding: 0;
    clear: both;
}

/* Jarak atas, kiri, kanan 5px - hanya pada halaman yang ada dashboard ini.
   :not(#ihd-x) tambah spesifisiti supaya mengatasi gaya shell portal. */
html body:has(.ihd) #content.content:not(#ihd-x) { padding: 5px 5px 16px !important; }
html body:has(.ihd) #content.content:not(#ihd-x) > form,
html body:has(.ihd) #content.content:not(#ihd-x) > form > .row { margin-top: 0 !important; }
#divDashAdm.row { margin-left: 0; margin-right: 0; }
.ihd svg text { font-family: Arial, "Helvetica Neue", sans-serif; }
.ihd, .ihd table, .ihd th, .ihd td, .ihd button, .ihd select, .ihd input, .ihd a { font-family: Arial, "Helvetica Neue", sans-serif; }

/* Panel tajuk */
.ihd-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 16px;
    padding: 12px 16px 12px 18px;
    border: 1px solid var(--ihd-border);
    border-left: 5px solid var(--ihd-accent);
    border-radius: 10px;
    background:
        radial-gradient(circle at 92% -30%, rgba(166, 25, 46, .09) 0, rgba(166, 25, 46, 0) 38%),
        radial-gradient(circle at 70% 140%, rgba(166, 25, 46, .05) 0, rgba(166, 25, 46, 0) 34%),
        linear-gradient(120deg, #ffffff 0%, #fdf9fa 60%, #faf1f3 100%);
    box-shadow: 0 3px 10px rgba(31, 36, 48, .05);
}
.ihd-heading-content { min-width: 0; }
.ihd-heading-label { display: block; margin-bottom: 2px; color: var(--ihd-accent); font-size: 9px; font-weight: 700; letter-spacing: 1.05px; text-transform: uppercase; }
.ihd-heading-title { margin: 0; color: var(--ihd-text); font-size: 19px; font-weight: 700; line-height: 1.2; }
.ihd-heading-subtitle { margin: 3px 0 0; color: var(--ihd-muted); font-size: 12px; line-height: 1.3; }
.ihd-heading-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.ihd-hbtn {
    height: 34px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #d9aab4;
    border-radius: 8px;
    background: #fff;
    color: var(--ihd-accent) !important;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.ihd-hbtn:hover, .ihd-hbtn:focus, .ihd .open > .ihd-hbtn { background: var(--ihd-accent); border-color: var(--ihd-accent); color: #fff !important; }
.ihd-hbtn-icon { width: 34px; padding: 0; justify-content: center; }
.ihd-panduan { min-width: 320px; padding: 6px 0; font-size: 12px; border-radius: 8px; }
.ihd-panduan > .dropdown-header { color: var(--ihd-accent); font-weight: 700; text-transform: uppercase; font-size: 10px; letter-spacing: .5px; }
.ihd-panduan > li > a { padding: 6px 14px; white-space: normal; color: var(--ihd-text); }
.ihd-panduan > li > a:hover { background: var(--ihd-hover); color: var(--ihd-text); }
.ihd-panduan > li > a i { color: #d64545; margin-right: 8px; }
@media (max-width: 767px) {
    .ihd-heading { flex-wrap: wrap; }
    .ihd-heading-subtitle { display: none; }
}

.ihd-card {
    background: #fff;
    border: 1px solid var(--ihd-border);
    border-radius: 10px;
    padding: 16px 18px;
}

/* Grid */
.ihd-grid { display: grid; gap: 14px; margin-bottom: 16px; }
.ihd-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
/* dashboard admin: baris status permohonan (4) + baris tindakan staf/Ketua PTJ (3) */
.ihd-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ihd-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 991px) { .ihd-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ihd-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .ihd-grid-4, .ihd-grid-3 { grid-template-columns: minmax(0, 1fr); } }
.ihd-grid-charts { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 16px; }
@media (max-width: 1200px) { .ihd-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 991px)  { .ihd-grid-charts { grid-template-columns: 1fr; } }
@media (max-width: 640px)  { .ihd-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Kad ringkasan: jalur warna di atas, nombor besar berwarna */
.ihd-kpi {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    padding-top: 20px;
    transition: box-shadow .15s ease, border-color .15s ease;
}
/* Jalur warna lurus di dalam kad (tidak dipotong bucu bulat supaya tidak nampak senget) */
.ihd-kpi::before {
    content: "";
    position: absolute;
    left: 18px; right: 18px; top: 0;
    height: 4px;
    border-radius: 0 0 4px 4px;
    background: var(--kad);
}
.ihd-kpi:hover { border-color: var(--kad); box-shadow: 0 4px 12px rgba(31, 36, 48, .08); }
.ihd-kpi.is-active { border-color: var(--kad); background: var(--kad-soft); }
.ihd-kpi-row { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.ihd-kpi-body { min-width: 0; }
.ihd-kpi-title { font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--ihd-muted); text-transform: uppercase; letter-spacing: .02em; }
.ihd-kpi-value { font-size: 28px; font-weight: 700; line-height: 1.2; margin-top: 4px; color: var(--kad); }
.ihd-kpi-icon {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    flex: none;
    order: 2;
    background: var(--kad-soft);
    color: var(--kad);
}
.ihd-kpi-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12px; color: var(--ihd-muted); }
.ihd-kpi-foot b { color: var(--ihd-text); min-width: 34px; text-align: right; }
.ihd-progress { flex: 1; height: 6px; border-radius: 6px; background: var(--ihd-track); overflow: hidden; }
.ihd-progress span { display: block; height: 100%; border-radius: 6px; background: var(--kad); }
.ihd-kpi-link { color: var(--kad); font-weight: 600; }

/* Kepala carta */
.ihd-chart-head {
    display: flex; justify-content: space-between; align-items: center;
    padding-bottom: 10px; margin-bottom: 14px;
    border-bottom: 1px solid var(--ihd-border);
}
.ihd-chart-head h5 { margin: 0; font-weight: 700; font-size: 14px; color: var(--ihd-text); }
.ihd-chart-head h5 i { color: var(--ihd-accent); margin-right: 6px; }
.ihd-chart-head small { color: var(--ihd-muted); }
.ihd-klik { cursor: pointer; transition: opacity .15s ease; }
.ihd svg .ihd-klik:hover { opacity: .8; }

/* Donut */
.ihd-donut-wrap { display: flex; align-items: center; justify-content: center; gap: 20px; flex-wrap: wrap; min-height: 220px; }
.ihd-donut-wrap svg { width: 190px; height: 190px; flex: none; }
.ihd-legend { list-style: none; padding: 0; margin: 0; min-width: 180px; font-size: 12px; color: var(--ihd-text); }
/* Petunjuk: titik | label | bilangan & % (sebaris, nilai di kanan) */
.ihd-legend li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 8px; margin: 0 0 2px; padding: 5px 8px; border-radius: 6px; }
.ihd-legend li:hover, .ihd-legend li.is-active { background: var(--ihd-hover); }
.ihd-legend .ihd-dot { margin: 0; }
.ihd-legend .ihd-leg-label { line-height: 1.3; }
.ihd-legend b { display: inline-flex; align-items: baseline; gap: 5px; font-size: 13px; white-space: nowrap; }
.ihd-legend b small { min-width: 32px; color: var(--ihd-muted); font-size: 11px; font-weight: 600; text-align: right; }
.ihd-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* Bar mendatar PTJ */
.ihd-bars { display: flex; flex-direction: column; gap: 8px; }
.ihd-bar-row {
    display: grid;
    grid-template-columns: minmax(0, 42%) minmax(0, 1fr) 44px;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    padding: 3px 4px;
    border-radius: 6px;
}
.ihd-bar-row:hover { background: var(--ihd-hover); }
.ihd-bar-label { color: var(--ihd-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ihd-bar-track { height: 14px; border-radius: 4px; background: var(--ihd-track); overflow: hidden; }
.ihd-bar-track span { display: block; height: 100%; border-radius: 4px; background: #3fa34d; }
.ihd-bar-val { text-align: right; font-weight: 700; color: var(--ihd-text); }
.ihd-empty { text-align: center; color: var(--ihd-muted); padding: 40px 0; }

/* Panel senarai (warna ikut kategori melalui --kad) */
.ihd-senarai { position: relative; margin-bottom: 18px; scroll-margin-top: 70px; }
.ihd-senarai::before { content: ""; position: absolute; left: 18px; right: 18px; top: 0; height: 4px; border-radius: 0 0 4px 4px; background: var(--kad); }
.ihd-table-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.ihd-table-head h4 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ihd-text); }
.ihd-table-head h4 i { color: var(--kad); margin-right: 7px; }
.ihd-chip { display: inline-block; margin-left: 8px; padding: 3px 10px; border-radius: 999px; background: var(--kad-soft); color: var(--kad); font-size: 12px; font-weight: 600; vertical-align: middle; }
.ihd-table-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.ihd-btn { border: 0; border-radius: 8px; padding: 7px 14px; font-size: 12px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: background-color .15s ease; }
.ihd-btn:disabled { opacity: .65; cursor: wait; }
.ihd-btn-excel { background: #287c4c; color: #fff; }
.ihd-btn-excel:hover { background: #1f6a3f; }
.ihd-btn-print { background: var(--ihd-accent); color: #fff; }
.ihd-btn-print:hover { background: var(--ihd-accent-dark); }
.ihd-btn-light { background: #f1f2f5; color: var(--ihd-text); }
.ihd-btn-light:hover { background: #e5e7eb; }
.ihd-btn-emel { background: var(--kad); color: #fff; padding: 9px 22px; }
.ihd-btn-emel:hover { filter: brightness(.92); }

.ihd-table-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.ihd-pagesize { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; font-size: 13px; color: #374151; }
.ihd-pagesize select { width: auto; min-width: 76px; height: 32px; padding: 4px 8px; border-radius: 6px; }
.ihd-search { position: relative; flex: 0 1 340px; }
.ihd-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ihd-muted); }
.ihd-search input { height: 34px; padding-left: 34px; border-radius: 8px; border: 1px solid var(--ihd-border); font-size: 13px; }
.ihd-search input:focus { border-color: var(--kad); box-shadow: 0 0 0 3px var(--kad-soft); outline: none; }

.ihd-table { width: 100%; border-collapse: collapse; }
.ihd-table th { background: var(--kad-soft); color: var(--ihd-text); font-size: 13px; font-weight: 700; padding: 10px 12px; border: 1px solid var(--ihd-border); border-bottom: 2px solid var(--kad); text-align: left; vertical-align: middle; }
.ihd-table td { padding: 9px 12px; border: 1px solid var(--ihd-border); font-size: 13px; line-height: 1.4; color: var(--ihd-text); vertical-align: top; }
.ihd-table tbody tr:nth-child(even) td { background: #fafafb; }
.ihd-table tbody tr:hover td { background: var(--ihd-hover); }
.ihd-table .ihd-col-pilih { width: 1%; white-space: nowrap; text-align: center; }
.ihd-table .ihd-col-pilih label { margin: 0; font-weight: 700; cursor: pointer; }
.ihd-table .ihd-col-pilih .fa { color: var(--kad); }
.ihd-emel-list { margin: 0; padding-left: 16px; }

.ihd-table-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.ihd-info { font-size: 12px; color: var(--ihd-muted); }
.ihd-paging { display: flex; gap: 4px; flex-wrap: wrap; }
.ihd-paging button { min-width: 32px; height: 32px; padding: 0 9px; border: 1px solid var(--ihd-border); border-radius: 6px; background: #fff; color: #374151; font-size: 13px; cursor: pointer; }
.ihd-paging button.active, .ihd-paging button:hover:not(:disabled) { background: var(--kad); border-color: var(--kad); color: #fff; }
.ihd-paging button:disabled { opacity: .45; cursor: not-allowed; }
/* Halaman Laporan: tab laporan & bekas kandungan */
.ihd-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.ihd-tab {
    flex: 1 1 200px;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 8px 14px;
    border: 1px solid var(--ihd-border);
    border-radius: 9px;
    background: #fff;
    color: var(--ihd-text) !important;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none !important;
    transition: border-color .15s ease, background-color .15s ease;
}
.ihd-tab i { flex: none; width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; background: var(--ihd-accent-soft); color: var(--ihd-accent); font-size: 13px; }
.ihd-tab:hover { border-color: #d9aab4; background: var(--ihd-hover); }
.ihd-tab.is-active { border-color: var(--ihd-accent); background: var(--ihd-accent); color: #fff !important; box-shadow: 0 3px 10px rgba(166, 25, 46, .18); }
.ihd-tab.is-active i { background: rgba(255, 255, 255, .18); color: #fff; }
.ihd-laporan-body { min-width: 0; padding: 14px 16px; }
/* Rujukan: borang & div ajax di dalam kad - buang margin negatif .row supaya tidak terkeluar ke kanan */
.ihd-laporan-body > form > .row { margin-left: 0; margin-right: 0; }
.ihd-laporan-body > form > .row > .col-md-12 { padding-left: 0; padding-right: 0; }
.ihd-laporan-body > form > .row > .col-md-12 > .panel:last-child { margin-bottom: 0; }
.ihd-laporan, .ihd-page { max-width: 100%; min-width: 0; }
.ihd-tab { min-width: 0; }
/* Semua tab sebaris, lebar sama rata; turun baris hanya pada skrin kecil */
.ihd-tabs { flex-wrap: nowrap; }
.ihd-tabs .ihd-tab { flex: 1 1 0; padding: 8px 12px; gap: 8px; }
@media (max-width: 1199px) {
    .ihd-tabs { flex-wrap: wrap; }
    .ihd-tabs .ihd-tab { flex: 1 1 200px; }
}
.ihd-hbtn-icon .fa-home { font-size: 16px; }

/* Ringkasan carta laporan (dipapar terus bila tab dibuka) */
.ihd-ringkasan { margin-bottom: 18px; padding-bottom: 4px; border-bottom: 1px dashed var(--ihd-border); }
.ihd-ringkasan-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ihd-ringkasan-head h5 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ihd-text); }
.ihd-ringkasan-head h5 i { color: var(--ihd-accent); margin-right: 7px; }
.ihd-ringkasan-head small { color: var(--ihd-muted); font-size: 12px; }
/* Kad & carta guna lajur sama lebar dan jarak sama supaya kotak sejajar */
.ihd-grid-auto, .ihd-grid-carta3 { grid-template-columns: repeat(var(--lajur, 3), minmax(0, 1fr)); gap: 16px; }
.ihd-grid-auto > .ihd-card, .ihd-grid-carta3 > .ihd-card { height: 100%; }
@media (max-width: 1200px) { .ihd-grid-auto, .ihd-grid-carta3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px)  { .ihd-grid-auto, .ihd-grid-carta3 { grid-template-columns: 1fr; } }
/* Laporan: donut di atas, petunjuk penuh lebar di bawah */
.ihd-grid-carta3 .ihd-donut-wrap { flex-direction: column; flex-wrap: nowrap; gap: 14px; min-height: 0; }
.ihd-grid-carta3 .ihd-donut-wrap svg { width: 180px; height: 180px; }
.ihd-grid-carta3 .ihd-legend { width: 100%; padding-top: 10px; border-top: 1px dashed var(--ihd-border); }
.ihd-grid-carta3 .ihd-bar-row { grid-template-columns: minmax(0, 48%) minmax(0, 1fr) 40px; }
.ihd-kpi-nota { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ihd-text); font-weight: 600; }

/* Jadual laporan: suis sumber (cth. Status Permohonan / Belum Isytihar) */
.ihd-sumber { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 14px; }
.ihd-sumber-btn { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border: 1px solid var(--ihd-border); border-radius: 999px; background: #fff; color: var(--ihd-text); font-size: 12px; font-weight: 600; cursor: pointer; }
.ihd-sumber-btn b { padding: 1px 8px; border-radius: 999px; background: #eef0f3; font-size: 11px; }
.ihd-sumber-btn:hover { background: var(--ihd-hover); }
.ihd-sumber-btn.is-active { border-color: var(--ihd-accent); background: var(--ihd-accent); color: #fff; }
.ihd-sumber-btn.is-active b { background: rgba(255, 255, 255, .2); }
.ihd-chip-close { color: inherit !important; margin-left: 4px; opacity: .7; text-decoration: none !important; }
.ihd-chip-close:hover { opacity: 1; }

/* Pautan rekod staf & butang surat dalam jadual */
.ihd-table a.ihd-pautan { color: var(--ihd-accent); font-weight: 600; text-decoration: none; border-bottom: 1px dashed currentColor; }
.ihd-table a.ihd-pautan:hover { color: var(--ihd-accent-dark); }
.ihd-aksi { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: 1px solid #d9aab4; border-radius: 6px; background: #fff; color: var(--ihd-accent); font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ihd-aksi:hover { background: var(--ihd-accent); border-color: var(--ihd-accent); color: #fff; }

/* Panel rekod staf (paparan rekod sedia ada dimuat di dalamnya) */
.ihd-rekod { position: relative; margin-top: 16px; scroll-margin-top: 70px; }
.ihd-rekod::before { content: ""; position: absolute; left: 18px; right: 18px; top: 0; height: 4px; border-radius: 0 0 4px 4px; background: var(--ihd-accent); }
.ihd-rekod-body > table:first-child { display: none; } /* butang [Tutup] lama - diganti butang Tutup panel */
.ihd-rekod-body .panel { margin-bottom: 0; border: 0; box-shadow: none; }
.ihd-rekod-body .panel > .panel-heading { display: none; }

/* =====================================================================
   KULIT HALAMAN MODUL (.ihd-page): Permohonan, Sejarah, Aktif Permohonan,
   Keputusan JKTT, Daftar Pengguna, Rujukan, Akses Sistem.
   Menggayakan elemen Bootstrap sedia ada tanpa mengubah logik halaman.
   ===================================================================== */
.ihd-page.row { margin-left: 0; margin-right: 0; }
.ihd-page > .col-md-12 { padding-left: 0; padding-right: 0; }
.ihd-page { color: var(--ihd-text); font-size: 13px; }

/* Panel */
.ihd-page .panel {
    margin-bottom: 16px;
    border: 1px solid var(--ihd-border) !important;
    border-radius: 10px !important;
    background: #fff !important;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .05) !important;
    overflow: visible; /* jangan potong dropdown pada baris akhir */
}
.ihd-page .panel > .panel-heading {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 48px;
    padding: 13px 18px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--ihd-border) !important;
    border-radius: 10px 10px 0 0 !important;
    background: #fff !important;
    color: var(--ihd-text) !important;
}
.ihd-page .panel > .panel-heading::before { content: ""; position: absolute; left: 18px; right: 18px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--ihd-accent); }
.ihd-page .panel > .panel-heading .panel-title { flex: 1 1 auto; margin: 0; color: var(--ihd-text) !important; font-size: 14px; font-weight: 700; }
.ihd-page .panel > .panel-heading .panel-title::before { content: "\f0ca"; font-family: FontAwesome; margin-right: 8px; color: var(--ihd-accent); font-weight: 400; }
.ihd-page .panel-heading-btn { order: 2; margin-left: auto; }
.ihd-page .panel-heading .pull-right { float: none !important; margin: 0 !important; order: 3; }
.ihd-page .panel > .panel-body { padding: 14px 14px 16px !important; background: #fff !important; border-radius: 0 0 10px 10px; }
.ihd-page .panel .panel { box-shadow: none !important; text-align: left; }

/* Bar kawalan senarai (Pagg::pagging_top) */
.ihd-page .modal-header.m-b-10 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 12px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}
.ihd-page .modal-header.m-b-10 > [class*="col-"] { float: none; width: auto; padding: 0; }
.ihd-page .modal-header.m-b-10 > [class*="col-"]:nth-child(2) { flex: 1 1 260px; }
.ihd-page .modal-header.m-b-10 .form-control,
.ihd-page .modal-header.m-b-10 .input-group-addon,
.ihd-page .modal-header.m-b-10 .input-group-btn .btn { height: 34px; font-size: 12px !important; }
.ihd-page .modal-header.m-b-10 .input-group-addon { background: #fff; border-color: #d5d9de; color: #4b5563; font-weight: 600; }
.ihd-page .modal-header.m-b-10 .input-group-btn .btn { border-color: var(--ihd-accent) !important; background: var(--ihd-accent) !important; color: #fff !important; }

/* Jadual: boleh scroll mendatar pada semua saiz skrin (Bootstrap 3 hanya bawah 768px) */
.ihd-page .table-responsive { width: 100%; margin: 0; border: 0; overflow-x: auto; overflow-y: visible; -webkit-overflow-scrolling: touch; }
/* Semasa dropdown dalam jadual dibuka, jangan potong menu di dalam kawasan scroll */
.ihd-page .table-responsive:has(.open > .dropdown-menu, .bootstrap-select.open) { overflow: visible; }
.ihd-page .table-responsive::-webkit-scrollbar { height: 8px; }
.ihd-page .table-responsive::-webkit-scrollbar-thumb { border-radius: 8px; background: #cfd3da; }
.ihd-page .table { width: 100%; margin-bottom: 0; border-collapse: collapse; background: #fff; font-size: 12.5px; }
.ihd-page .table > thead > tr > th,
.ihd-page .table > tbody > tr > th,
.ihd-page .table > tr > th {
    padding: 8px 9px !important;
    border: 1px solid var(--ihd-border) !important;
    border-bottom: 2px solid var(--ihd-accent) !important;
    background: var(--ihd-accent-soft) !important;
    color: var(--ihd-text) !important;
    font-size: 12px;
    font-weight: 700;
    vertical-align: middle !important;
}
.ihd-page .table > tbody > tr > td,
.ihd-page .table > tr > td {
    padding: 7px 9px !important;
    border: 1px solid var(--ihd-border) !important;
    color: var(--ihd-text);
    line-height: 1.4;
    vertical-align: middle !important;
}
.ihd-page .table > tbody > tr:nth-child(even) > td { background: #fafafb; }
/* Sub-jadual (jadual di dalam sel jadual lain) guna merah jambu lebih pudar supaya beza dengan jadual utama */
.ihd-page .table .table > thead > tr > th,
.ihd-page .table .table > tbody > tr > th { background: #fdf7f8 !important; border-bottom: 2px solid #e3b4bd !important; color: #374151 !important; }
.ihd-page .table .table > tbody > tr > td { background: #fff; }
.ihd-page .table > tbody > tr:hover > td { background: var(--ihd-hover) !important; }
.ihd-page .table a:not(.btn) { color: var(--ihd-accent); font-weight: 600; }
.ihd-page .table a:not(.btn):hover { color: var(--ihd-accent-dark); }
/* Item dropdown (selectpicker / dropdown-menu) dalam jadual kekal warna biasa, bukan warna pautan */
.ihd-page .table .dropdown-menu a,
.ihd-page .table .dropdown-menu a:hover { color: var(--ihd-text) !important; font-weight: 400 !important; }
.ihd-page .dropdown-menu > li > a:hover,
.ihd-page .dropdown-menu > li > a:focus { background: var(--ihd-hover) !important; }
.ihd-page .dropdown-menu > li.selected > a,
.ihd-page .dropdown-menu > li.active > a { background: var(--ihd-accent-soft) !important; color: var(--ihd-accent) !important; font-weight: 600 !important; }
.ihd-page td[colspan] > div[align="center"] { padding: 18px; color: var(--ihd-muted); }

/* Kawalan borang di dalam jadual dipadatkan supaya jadual muat */
/* Perkataan tidak dipecah di tengah; hanya turun baris pada ruang (break-word sebagai sandaran sahaja) */
.ihd-page .table > thead > tr > th, .ihd-page .table > tbody > tr > td, .ihd-page .table > tbody > tr > th { overflow-wrap: break-word; word-break: normal; hyphens: none; }
.ihd-page .table .bootstrap-select:not(.input-group-btn),
.ihd-page .table .bootstrap-select[class*="col-"] { width: 100% !important; min-width: 110px; max-width: 200px; }
/* Teks dropdown sebaris dengan "...", caret kekal di kanan */
.ihd-page .table .bootstrap-select > .dropdown-toggle { position: relative; min-height: 34px; padding: 6px 30px 6px 10px; font-size: 12px; white-space: nowrap; text-align: left; }
.ihd-page .table .bootstrap-select > .dropdown-toggle .filter-option { display: block; width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ihd-page .table .bootstrap-select > .dropdown-toggle .bs-caret,
.ihd-page .table .bootstrap-select > .dropdown-toggle .caret { position: absolute; top: 50%; right: 10px; margin-top: -2px; }
.ihd-page .table .bootstrap-select > .dropdown-toggle::after { position: absolute; top: 50%; right: 10px; margin-top: -3px; }
.ihd-page .table .bootstrap-select .dropdown-menu { min-width: 240px; }
.ihd-page .table select.form-control { min-width: 110px; max-width: 200px; height: 32px; font-size: 12px; }
.ihd-page .table textarea.form-control { width: 100%; min-width: 110px; min-height: 58px; padding: 6px 8px; font-size: 12px; resize: vertical; }
.ihd-page .table .form-group { margin: 0; }
/* Pilihan radio/checkbox dalam jadual sebagai cip kecil; radio kekal di dalam sel */
.ihd-page .table .radio, .ihd-page .table .checkbox { margin: 0 0 5px; padding: 0; min-height: 0; }
.ihd-page .table .radio:last-child, .ihd-page .table .checkbox:last-child { margin-bottom: 0; }
.ihd-page .table .radio label, .ihd-page .table .checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    width: 100%;
    margin: 0;
    padding: 5px 9px;
    border: 1px solid var(--ihd-border);
    border-radius: 7px;
    background: #fff;
    color: var(--ihd-text);
    min-width: 150px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.3;
    white-space: normal;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}
.ihd-page .table .radio label:hover, .ihd-page .table .checkbox label:hover { background: var(--ihd-hover); }
.ihd-page .table .radio input[type="radio"], .ihd-page .table .checkbox input[type="checkbox"] { position: static; flex: none; width: 14px; height: 14px; margin: 1px 0 0; }
.ihd-page .table .radio label:has(input:checked), .ihd-page .table .checkbox label:has(input:checked) { border-color: var(--ihd-accent); background: var(--ihd-accent-soft); color: var(--ihd-accent); }
.ihd-page .table td > label { font-size: 12px; font-weight: 400; line-height: 1.3; white-space: normal; }

/* Butang tindakan kecil dalam jadual */
.ihd-page .table .btn-xs { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 9px; margin: 2px; font-size: 14px; }

/* Borang */
.ihd-page .control-label, .ihd-page label { color: #3f464d; font-size: 12px; font-weight: 700; }
.ihd-page .form-control { min-height: 34px; border: 1px solid #d5d9de; border-radius: 8px; box-shadow: none; font-size: 13px; }
.ihd-page .form-control:focus { border-color: var(--ihd-accent); box-shadow: 0 0 0 3px rgba(166, 25, 46, .1); outline: none; }
.ihd-page textarea.form-control { min-height: 80px; }
.ihd-page .bootstrap-select > .dropdown-toggle { min-height: 34px; border-radius: 8px !important; }
.ihd-page input[type="radio"], .ihd-page input[type="checkbox"] { accent-color: var(--ihd-accent); }

/* Butang */
.ihd-page .btn { border-radius: 7px !important; box-shadow: none !important; font-weight: 600; transition: background-color .15s ease, border-color .15s ease; }
.ihd-page .btn-primary { border-color: var(--ihd-accent) !important; background: var(--ihd-accent) !important; color: #fff !important; }
.ihd-page .btn-primary:hover, .ihd-page .btn-primary:focus { border-color: var(--ihd-accent-dark) !important; background: var(--ihd-accent-dark) !important; }
.ihd-page .btn-success { border-color: #287c4c !important; background: #287c4c !important; color: #fff !important; }
.ihd-page .btn-success:hover, .ihd-page .btn-success:focus { background: #1f6a3f !important; }
.ihd-page .btn-warning { border-color: #e08e00 !important; background: #e08e00 !important; color: #fff !important; }
.ihd-page .btn-warning:hover, .ihd-page .btn-warning:focus { background: #c27a00 !important; }
.ihd-page .btn-danger { border-color: #c0392b !important; background: #c0392b !important; color: #fff !important; }
.ihd-page .btn-danger:hover, .ihd-page .btn-danger:focus { background: #a5301f !important; }
.ihd-page .btn-info { border-color: #0a95b8 !important; background: #0a95b8 !important; color: #fff !important; }
.ihd-page .btn-info:hover, .ihd-page .btn-info:focus { background: #08809e !important; }
.ihd-page .btn-inverse, .ihd-page .btn-default, .ihd-page .btn-white { border-color: #d5d9de !important; background: #fff !important; color: var(--ihd-text) !important; }
.ihd-page .btn-inverse:hover, .ihd-page .btn-default:hover, .ihd-page .btn-white:hover { background: var(--ihd-hover) !important; }

/* Seksyen Rekod Perisytiharan Harta Staf: setiap jadual warna berbeza */
.ihd-page :is(.col-md-12, .row):has(> .ihd-sek-keluarga) { --sek: #0a95b8; --sek-soft: #e6f7fb; }
.ihd-page :is(.col-md-12, .row):has(> .ihd-sek-gaji)     { --sek: #3fa34d; --sek-soft: #ebf6ec; }
.ihd-page :is(.col-md-12, .row):has(> .ihd-sek-tambahan) { --sek: #8e44ad; --sek-soft: #f4edf8; }
.ihd-page :is(.col-md-12, .row):has(> .ihd-sek-harta)    { --sek: #e08e00; --sek-soft: #fff5e0; }
.ihd-page :is(.col-md-12, .row):has(> .ihd-sek-ansuran)  { --sek: #d64545; --sek-soft: #fdeeee; }
.ihd-page :is(.col-md-12, .row):has(> .ihd-sek-sah)      { --sek: #5f666d; --sek-soft: #f1f2f4; }
.ihd-page h4.ihd-sek {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 20px 0 0 !important;
    padding: 10px 14px;
    border: 1px solid var(--sek);
    border-bottom: 0;
    border-radius: 9px 9px 0 0;
    background: var(--sek-soft);
    color: var(--sek) !important;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .3px;
    text-decoration: none !important;
}
.ihd-page h4.ihd-sek::before { font-family: FontAwesome; font-weight: 400; font-size: 14px; }
.ihd-page h4.ihd-sek-keluarga::before { content: "\f0c0"; }
.ihd-page h4.ihd-sek-gaji::before     { content: "\f0d6"; }
.ihd-page h4.ihd-sek-tambahan::before { content: "\f055"; }
.ihd-page h4.ihd-sek-harta::before    { content: "\f015"; }
.ihd-page h4.ihd-sek-ansuran::before  { content: "\f09d"; }
.ihd-page h4.ihd-sek-sah::before      { content: "\f046"; }
.ihd-page h4.ihd-sek + .panel-body { padding: 0 !important; border: 1px solid var(--sek); border-top: 3px solid var(--sek); border-radius: 0 0 9px 9px; overflow: hidden; }
.ihd-page h4.ihd-sek + .panel-body > .table-responsive > .table { border: 0; }
.ihd-page :is(.col-md-12, .row):has(> .ihd-sek) .table > thead > tr > th { background: var(--sek-soft) !important; border-bottom: 2px solid var(--sek) !important; color: var(--ihd-text) !important; }
.ihd-page :is(.col-md-12, .row):has(> .ihd-sek) .table a:not(.btn) { color: var(--sek); }
.ihd-page :is(.col-md-12, .row):has(> .ihd-sek) .btn-primary { border-color: var(--sek) !important; background: var(--sek) !important; }
/* Rekod staf: maklumat atas (Nama, No. Staf, Jabatan | Kategori, Tarikh) sebagai 2 kad info.
   <form> bersarang dibuang pelayar, jadi padankan .form-group terus di bawah .panel-body atau di dalam form. */
.ihd-page .panel > .panel-body:has(> .col-md-6 > .panel-body .form-group > label.col-md-3) { display: flex; flex-wrap: wrap; gap: 14px 0; }
.ihd-page .panel > .panel-body:has(> .col-md-6 > .panel-body .form-group > label.col-md-3)::before,
.ihd-page .panel > .panel-body:has(> .col-md-6 > .panel-body .form-group > label.col-md-3)::after { display: none; }
.ihd-page .panel > .panel-body:has(> .col-md-6 > .panel-body .form-group > label.col-md-3) > * { flex: 1 1 100%; min-width: 0; }
.ihd-page .panel > .panel-body:has(> .col-md-6 > .panel-body .form-group > label.col-md-3) > .col-md-6 { flex: 1 1 340px; float: none; width: auto; padding: 0; }
.ihd-page .panel > .panel-body > .col-md-6 > .panel-body:has(.form-group > label.col-md-3) {
    height: 100%;
    padding: 2px 0 !important;
    border: 1px solid var(--ihd-border);
    border-radius: 9px !important;
    background: #fafafb !important;
    text-align: left;
}
/* Dua kad maklumat bersambung menjadi satu kotak (pemisah halus di tengah) */
.ihd-page .panel > .panel-body > .col-md-6 + .col-md-6 > .panel-body:has(.form-group > label.col-md-3) { border-left: 1px dashed var(--ihd-border); border-radius: 0 9px 9px 0 !important; }
.ihd-page .panel > .panel-body > .col-md-6:has(+ .col-md-6) > .panel-body:has(.form-group > label.col-md-3) { border-right: 0; border-radius: 9px 0 0 9px !important; }
@media (max-width: 767px) {
    .ihd-page .panel > .panel-body > .col-md-6 + .col-md-6 > .panel-body:has(.form-group > label.col-md-3) { border-left: 1px solid var(--ihd-border); border-top: 1px dashed var(--ihd-border); border-radius: 0 0 9px 9px !important; }
    .ihd-page .panel > .panel-body > .col-md-6:has(+ .col-md-6) > .panel-body:has(.form-group > label.col-md-3) { border-right: 1px solid var(--ihd-border); border-bottom: 0; border-radius: 9px 9px 0 0 !important; }
    .ihd-page .panel > .panel-body:has(> .col-md-6 > .panel-body .form-group > label.col-md-3) { row-gap: 0; }
}
.ihd-page .panel > .panel-body > .col-md-6 > .panel-body > .form-group,
.ihd-page .panel > .panel-body > .col-md-6 > .panel-body > form > .form-group {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 12px;
    align-items: baseline;
    margin: 0 !important;
    padding: 8px 16px;
    border-bottom: 1px dashed var(--ihd-border);
    text-align: left;
}
/* Buang clearfix Bootstrap (::before/::after) yang menjadi sel grid tambahan */
.ihd-page .panel > .panel-body > .col-md-6 > .panel-body > .form-group::before,
.ihd-page .panel > .panel-body > .col-md-6 > .panel-body > .form-group::after,
.ihd-page .panel > .panel-body > .col-md-6 > .panel-body > form > .form-group::before,
.ihd-page .panel > .panel-body > .col-md-6 > .panel-body > form > .form-group::after { display: none; }
.ihd-page .panel > .panel-body > .col-md-6 > .panel-body > form { margin: 0; }
.ihd-page .panel > .panel-body > .col-md-6 > .panel-body > .form-group:last-child,
.ihd-page .panel > .panel-body > .col-md-6 > .panel-body > form > .form-group:last-child { border-bottom: 0; }
.ihd-page .panel > .panel-body > .col-md-6 > .panel-body .form-group > label.col-md-3 { float: none; width: auto; padding: 0; color: var(--ihd-muted); font-size: 12px; font-weight: 600; text-align: left; }
.ihd-page .panel > .panel-body > .col-md-6 > .panel-body .form-group > .col-md-9 { float: none; width: auto; padding: 0; color: var(--ihd-text); font-size: 13px; font-weight: 700; text-align: left; }

/* Ikon cetak rekod -> butang "Cetak Rekod" di kanan */
.ihd-page .panel > .row:has(img[src*="cetak"]) { display: flex; justify-content: flex-end; margin: 0; padding: 12px 16px 0; }
.ihd-page .panel > .row:has(img[src*="cetak"])::before,
.ihd-page .panel > .row:has(img[src*="cetak"])::after,
.ihd-page .panel > .row:has(img[src*="cetak"]) > .col-md-10,
.ihd-page .panel > .row:has(img[src*="cetak"]) br { display: none; }
.ihd-page .panel > .row:has(img[src*="cetak"]) > [class*="col-"] { float: none; width: auto; padding: 0; }
.ihd-page a:has(> img[src*="cetak"]) {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 8px;
    border: 1px solid #d9aab4;
    border-radius: 8px;
    background: #fff;
    color: var(--ihd-accent) !important;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
}
.ihd-page a:has(> img[src*="cetak"])::after { content: "Cetak Rekod"; }
.ihd-page a:has(> img[src*="cetak"]):hover { border-color: var(--ihd-accent); background: var(--ihd-accent-soft); }
.ihd-page a:has(> img[src*="cetak"]) > img { width: 24px !important; height: auto; }

/* Pengesahan: setiap blok (col-lg-*) jadi kad dalam grid supaya teks tidak bertindih */
.ihd-page .row:has(> .ihd-sek-sah) { margin-left: 0; margin-right: 0; }
.ihd-page .row:has(> .ihd-sek-sah) > p:empty { display: none; }
.ihd-page .row:has(> .ihd-sek-sah) > .panel-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    padding: 14px !important;
    border: 1px solid var(--sek);
    border-top: 3px solid var(--sek);
    border-radius: 0 0 9px 9px;
    background: #fff;
}
.ihd-page .row:has(> .ihd-sek-sah) > .panel-body::before,
.ihd-page .row:has(> .ihd-sek-sah) > .panel-body::after { display: none; } /* buang clearfix Bootstrap dari grid */
.ihd-page .row:has(> .ihd-sek-sah) > .panel-body > [class*="col-"] { float: none; width: auto; min-height: 0; padding: 0; }
.ihd-page .row:has(> .ihd-sek-sah) > .panel-body > [class*="col-"]:empty { display: none; }
.ihd-page .row:has(> .ihd-sek-sah) > .panel-body > [class*="col-"] > table {
    width: 100%;
    height: 100%;
    border: 1px solid var(--ihd-border);
    border-top: 3px solid var(--sek);
    border-radius: 8px;
    border-collapse: separate;
    background: #fafafb;
}
.ihd-page .row:has(> .ihd-sek-sah) > .panel-body > [class*="col-"] > table td {
    padding: 4px 12px;
    color: var(--ihd-text) !important;
    font-size: 12px !important;
    font-weight: 400;
    line-height: 1.4;
    text-align: center;
    white-space: normal;
}
.ihd-page .row:has(> .ihd-sek-sah) > .panel-body > [class*="col-"] > table tr:first-child td { padding-top: 10px; padding-bottom: 6px; border-bottom: 1px dashed var(--ihd-border); color: var(--sek) !important; }
.ihd-page .row:has(> .ihd-sek-sah) > .panel-body > [class*="col-"] > table tr:last-child td { padding-bottom: 10px; }

/* Jadual bersarang (butiran harta / pinjaman) guna kelabu neutral supaya beza dengan jadual induk */
.ihd-page :is(.col-md-12, .row):has(> .ihd-sek) .table .table > thead > tr > th,
.ihd-page :is(.col-md-12, .row):has(> .ihd-sek) .table .table > thead > tr.info > th { background: #f4f5f7 !important; border-bottom: 2px solid #9ca3af !important; font-size: 11.5px; }
.ihd-page .table tr.info > td, .ihd-page .table tbody.collapse > tr > td { background: #fcfcfd !important; }
.ihd-page .table .table { margin: 4px 0; }

/* Paging & tab dalam halaman */
.ihd-page .pagination > li > a, .ihd-page .pagination > li > span { border-color: var(--ihd-border); color: #374151; }
.ihd-page .pagination > .active > a, .ihd-page .pagination > .active > span { border-color: var(--ihd-accent); background: var(--ihd-accent); color: #fff; }
.ihd-page .nav-tabs > li.active > a, .ihd-page .nav-pills > li.active > a { background: var(--ihd-accent) !important; color: #fff !important; }

.ihd-emel-bar { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--ihd-border); }
