/* Direktori PPTGPs - mod_pptgps_direktori */
.ptg-dir {
  --d-navy: #0d1b48; --d-navy-2: #23408a; --d-yellow: #f2b705; --d-orange: #e8612c;
  --d-text: #1d2340; --d-muted: #5d6478; --d-line: #e3e6ee; --d-soft: #f4f6fb;
  color: var(--d-text); font-size: 15px;
}
.ptg-dir .dir-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Kepala: kad cerah dengan carian (tajuk utama sudah ada dalam jalur navy artikel) */
.dir-hero {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 22px 26px; border-radius: 14px; color: var(--d-text);
  background: var(--d-soft); border: 1px solid var(--d-line); border-left: 5px solid var(--d-yellow);
}
.dir-hero-text { position: relative; z-index: 1; }
.dir-hero h2 { margin: 0 0 2px; color: var(--d-navy) !important; font-size: 22px; font-weight: 800; line-height: 1.25; }
.dir-hero p { margin: 0 0 12px; color: var(--d-muted); }
.dir-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--d-muted); }
.dir-stats b { color: var(--d-navy); font-size: 18px; margin-right: 3px; }
.dir-stats a { color: var(--d-navy) !important; font-weight: 700; text-decoration: none !important; border-bottom: 1px dashed var(--d-navy-2); }
.dir-stats i { color: var(--d-orange); margin-right: 4px; }
.dir-search { position: relative; z-index: 1; flex: 0 1 380px; margin: 0; }
.dir-search i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--d-muted); }
.dir-search input {
  width: 100%; height: 50px; padding: 0 16px 0 44px; border: 1.5px solid var(--d-line); border-radius: 30px; font-size: 15px;
  background: #fff; color: var(--d-text);
}
.dir-search input:focus { outline: 3px solid var(--d-yellow); outline-offset: 1px; border-color: var(--d-navy-2); }

/* Cip unit */
.dir-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 8px; }
.dir-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 30px;
  border: 1.5px solid var(--d-line); background: #fff; color: var(--d-navy); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.dir-chip span { min-width: 24px; padding: 1px 7px; border-radius: 20px; background: var(--d-soft); color: var(--d-muted); font-size: 12px; text-align: center; }
.dir-chip:hover { border-color: var(--d-navy-2); transform: translateY(-1px); }
.dir-chip[aria-pressed="true"] { background: var(--d-navy); border-color: var(--d-navy); color: #fff; }
.dir-chip[aria-pressed="true"] span { background: var(--d-yellow); color: var(--d-navy); }
.dir-chip:focus-visible { outline: 3px solid var(--d-orange); outline-offset: 2px; }
.dir-result { min-height: 1.4em; margin: 6px 2px 10px; color: var(--d-muted); font-size: 14px; }

/* Kad unit + jadual */
.dir-unit { margin: 0 0 26px; border-radius: 12px; background: #fff; box-shadow: 0 4px 16px rgba(20, 30, 80, .08); overflow: hidden; }
.dir-unit[hidden] { display: none; }
.dir-unit > header {
  display: flex; align-items: center; gap: 14px; padding: 16px 22px;
  border-bottom: 3px solid var(--d-yellow); background: linear-gradient(90deg, #f7f8fc, #fff);
}
.dir-unit-ico { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px;
  border-radius: 10px; background: var(--d-navy); color: #fff; font-size: 18px; }
.dir-unit h3 { flex: 1; margin: 0; color: var(--d-navy) !important; font-size: 19px; font-weight: 800; }
.dir-count { padding: 4px 12px; border-radius: 20px; background: var(--d-soft); color: var(--d-muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.dir-table-wrap { overflow-x: auto; }
.dir-table { width: 100%; margin: 0; border-collapse: collapse; }
.dir-table th {
  padding: 11px 18px; background: var(--d-soft); color: var(--d-navy); text-align: left;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border: 0;
}
.dir-table td { padding: 12px 18px; border: 0; border-top: 1px solid var(--d-line); vertical-align: middle; }
.dir-table tbody tr { transition: background .15s ease; }
.dir-table tbody tr:nth-child(even) { background: #fbfcfe; }
.dir-table tbody tr:hover { background: #eef2fb; }
.dir-table tr[hidden] { display: none; }
.dir-no { width: 56px; color: var(--d-muted); font-weight: 600; text-align: center; }
.dir-table th:first-child { text-align: center; }
.dir-name { display: flex; align-items: center; gap: 12px; min-width: 260px; }
.dir-name b { display: block; font-weight: 700; color: var(--d-text); line-height: 1.35; }
.dir-ava {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 50%; background: linear-gradient(135deg, var(--d-navy-2), var(--d-navy)); color: #fff;
  font-size: 14px; font-weight: 700; letter-spacing: .02em;
}
.dir-mail { transition: none !important; display: inline-flex; align-items: center; gap: 5px; margin-top: 2px; color: var(--d-navy-2) !important; font-size: 13px; text-decoration: none !important; word-break: break-all; }
.dir-mail a { color: var(--d-navy-2) !important; text-decoration: none !important; transition: none !important; }
.dir-mail a:hover { color: var(--d-orange) !important; text-decoration: underline !important; }
.dir-pos { color: var(--d-muted); min-width: 200px; }
.dir-grade { width: 130px; white-space: nowrap; }
.dir-gred { display: inline-block; margin: 2px 4px 2px 0; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.dir-g-pengurusan { background: #e3e9fb; color: #1b2f6b; }
.dir-g-kewangan { background: #e2f4ea; color: #1d6b43; }
.dir-g-teknikal { background: #fdf0d9; color: #8a5a00; }
.dir-g-sokongan { background: #eef0f5; color: #3d4560; }
.dir-g-operasi { background: #fde7df; color: #a33f17; }
.dir-g-lain { background: #f1e8fb; color: #5b2a8c; }
mark.dir-hit { padding: 0 1px; border-radius: 3px; background: #ffe58a; color: inherit; }

.dir-empty { margin: 30px 0; padding: 30px; border-radius: 12px; background: var(--d-soft); color: var(--d-muted); text-align: center; }
.dir-updated { margin: 6px 0 0; color: #9aa0b0; font-size: 13px; text-align: right; }

/* Telefon: baris jadi kad */
@media (max-width: 767px) {
  .dir-hero { flex-direction: column; align-items: stretch; padding: 18px 18px; }
  .dir-hero h2 { font-size: 19px; }
  .dir-search { flex: 1 1 auto; }
  .dir-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .dir-chip { flex: 0 0 auto; }
  .dir-unit > header { padding: 14px 16px; }
  .dir-unit h3 { font-size: 17px; }
  .dir-table thead { display: none; }
  .dir-table, .dir-table tbody { display: block; }
  .dir-table tr { display: block; padding: 14px 16px; border-top: 1px solid var(--d-line); }
  .dir-table tr[hidden] { display: none; }
  .dir-table tbody tr:nth-child(even) { background: #fff; }
  .dir-table td { display: block; padding: 0; border: 0; }
  .dir-table .dir-no { display: none; }
  .dir-table td.dir-name { display: flex; min-width: 0; }
  .dir-pos, .dir-grade { min-width: 0; width: auto; margin: 4px 0 0 52px; }
  .dir-pos { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .dir-chip, .dir-table tbody tr { transition: none; }
  .dir-chip:hover { transform: none; }
}
