/* MIRC Partner Directory — brand colors come from Partner Orgs → Colors (fallbacks below) */
.pd-stats,
.pd-directory {
  --pd-blue: #1f4077;
  --pd-red: #c8102e;
  --pd-yellow: #f2b705;

  --pd-primary: var(--pd-blue);
  --pd-primary-hover: color-mix(in srgb, var(--pd-blue) 82%, #000);
  --pd-member-bg: color-mix(in srgb, var(--pd-blue) 12%, #fff);
  --pd-member-ink: var(--pd-blue);
  --pd-partner-bg: color-mix(in srgb, var(--pd-red) 11%, #fff);
  --pd-partner-ink: color-mix(in srgb, var(--pd-red) 82%, #000);
  --pd-highlight: color-mix(in srgb, var(--pd-yellow) 16%, #fff);

  --pd-ink: #1f2937;
  --pd-muted: #6b7280;
  --pd-border: #e3e7eb;
  --pd-head: #f3f5f8;
  --pd-radius: 8px;

  color: var(--pd-ink);
  font-family: inherit;
  box-sizing: border-box;
}
.pd-stats *, .pd-directory * { box-sizing: inherit; }

.pd-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Stats ---------- */
.pd-stats { display: flex; flex-wrap: wrap; gap: 20px; }
.pd-stat {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 32px 16px 20px; border-radius: var(--pd-radius); min-width: 260px;
}
.pd-stat__icon svg { width: 44px; height: 44px; display: block; }
.pd-stat__text { display: flex; flex-direction: column; line-height: 1.2; }
.pd-stat__num { font-size: 28px; font-weight: 700; }
.pd-stat__label { font-size: 15px; color: var(--pd-ink); }
.pd-stat--member  { background: var(--pd-member-bg); }
.pd-stat--partner { background: var(--pd-partner-bg); }
.pd-stat--member  .pd-stat__icon, .pd-stat--member  .pd-stat__num { color: var(--pd-member-ink); }
.pd-stat--partner .pd-stat__icon, .pd-stat--partner .pd-stat__num { color: var(--pd-partner-ink); }

/* ---------- Toolbar ---------- */
.pd-directory .pd-toolbar { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.pd-directory .pd-search { position: relative; display: block; flex: 1 1 320px; margin: 0; }
.pd-directory .pd-search svg,
.pd-directory .pd-select svg {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--pd-muted); pointer-events: none;
}
.pd-directory .pd-search svg { left: 14px; }
.pd-directory .pd-select { position: relative; flex: 0 1 240px; }
.pd-directory .pd-select svg { right: 14px; color: var(--pd-ink); }

.pd-directory input.pd-search__input,
.pd-directory select.pd-status {
  width: 100%; height: 44px; margin: 0;
  border: 1px solid var(--pd-border); border-radius: 6px; background: #fff;
  font: inherit; font-size: 15px; color: var(--pd-ink); box-shadow: none;
  transition: border-color .15s, box-shadow .15s;
}
.pd-directory input.pd-search__input { padding: 0 14px 0 42px; }
.pd-directory input.pd-search__input::placeholder { color: var(--pd-muted); }
.pd-directory select.pd-status { padding: 0 40px 0 14px; appearance: none; -webkit-appearance: none; cursor: pointer; }
.pd-directory input.pd-search__input:focus,
.pd-directory select.pd-status:focus {
  outline: none; border-color: var(--pd-blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pd-yellow) 45%, transparent);
}

.pd-directory button.pd-btn {
  height: 44px; padding: 0 28px; border-radius: 6px;
  font: inherit; font-size: 15px; font-weight: 500; line-height: 1;
  cursor: pointer; transition: background-color .15s, border-color .15s;
}
.pd-directory button.pd-btn--primary { min-width: 180px; background: var(--pd-primary); border: 1px solid var(--pd-primary); color: #fff; }
.pd-directory button.pd-btn--primary:hover { background: var(--pd-primary-hover); border-color: var(--pd-primary-hover); color: #fff; }
.pd-directory button.pd-btn--ghost { background: #fff; border: 1px solid var(--pd-border); color: var(--pd-ink); }
.pd-directory button.pd-btn--ghost:hover { background: #fff; border-color: var(--pd-blue); color: var(--pd-blue); }

/* ---------- Table ---------- */
.pd-directory .pd-table-wrap {
  border: 1px solid var(--pd-border); border-radius: var(--pd-radius);
  overflow-x: auto; background: #fff;
}
.pd-directory table.pd-table { width: 100%; margin: 0; border: 0; border-collapse: collapse; font-size: 15px; }
.pd-directory .pd-table th,
.pd-directory .pd-table tbody > tr > td {
  padding: 11px 20px; text-align: left; vertical-align: middle;
  border: 0; border-bottom: 1px solid var(--pd-border); background: transparent;
}
.pd-directory .pd-table thead th { background: var(--pd-head); font-weight: 600; white-space: nowrap; color: var(--pd-ink); }
.pd-directory .pd-table .pd-col-name   { width: 55%; }
.pd-directory .pd-table .pd-col-status { width: 25%; }
.pd-directory .pd-table tbody > tr:last-child > td { border-bottom: 0; }
.pd-directory .pd-table tbody > tr:hover > td { background: var(--pd-highlight); }

.pd-directory button.pd-sort {
  all: unset; display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; cursor: pointer; color: var(--pd-ink);
}
.pd-directory .pd-sort__icon { width: 10px; height: 14px; fill: currentColor; }
.pd-directory .pd-sort__icon path { opacity: .3; }
.pd-directory th[aria-sort="ascending"]  .pd-up,
.pd-directory th[aria-sort="descending"] .pd-down { opacity: 1; fill: var(--pd-blue); }

.pd-directory .pd-pill {
  display: inline-block; padding: 3px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 500; white-space: nowrap;
}
.pd-directory .pd-pill--member  { background: var(--pd-member-bg);  color: var(--pd-member-ink); }
.pd-directory .pd-pill--partner { background: var(--pd-partner-bg); color: var(--pd-partner-ink); }

.pd-directory .pd-ext { width: 14px; height: 14px; flex: none; }
.pd-directory a.pd-visit {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px;
  border: 1.5px solid var(--pd-blue); border-radius: 6px; background: transparent;
  color: var(--pd-blue); font-size: 14px; font-weight: 500; text-decoration: none;
  transition: background-color .15s, color .15s;
}
.pd-directory a.pd-visit:hover,
.pd-directory tbody > tr:hover a.pd-visit { background: var(--pd-blue); color: #fff; }
.pd-directory .pd-dash { color: var(--pd-muted); }
.pd-directory .pd-table tbody > tr.pd-empty > td { padding: 40px 20px; text-align: center; color: var(--pd-muted); }
.pd-directory .pd-table tbody > tr.pd-empty:hover > td { background: transparent; }

/* ---------- Footer / pagination ---------- */
.pd-directory .pd-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; margin-top: 20px;
}
.pd-directory .pd-info { margin: 0; font-size: 15px; color: var(--pd-muted); }
.pd-directory .pd-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pd-directory button.pd-page {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 8px; margin: 0;
  border: 1px solid var(--pd-border); border-radius: 6px; background: #fff;
  font: inherit; font-size: 14px; line-height: 1; color: var(--pd-ink); cursor: pointer;
}
.pd-directory button.pd-page svg { width: 16px; height: 16px; }
.pd-directory button.pd-page:hover:not(:disabled) { border-color: var(--pd-blue); color: var(--pd-blue); background: #fff; }
.pd-directory button.pd-page.is-active,
.pd-directory button.pd-page.is-active:hover { background: var(--pd-blue); border-color: var(--pd-blue); color: #fff; }
.pd-directory button.pd-page:disabled { opacity: .4; cursor: default; }
.pd-directory .pd-ellipsis { padding: 0 4px; color: var(--pd-muted); }

.pd-directory button:focus-visible,
.pd-directory a:focus-visible { outline: 2px solid var(--pd-blue); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .pd-directory * { transition: none !important; }
}

/* ---------- Mobile: rows become cards ---------- */
@media (max-width: 767px) {
  .pd-stat { flex: 1 1 100%; }
  .pd-directory .pd-select { flex: 1 1 100%; }
  .pd-directory button.pd-btn { flex: 1 1 calc(50% - 8px); min-width: 0; padding: 0 12px; }

  .pd-directory .pd-table-wrap { border: 0; background: none; overflow: visible; }
  .pd-directory .pd-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .pd-directory .pd-table,
  .pd-directory .pd-table tbody,
  .pd-directory .pd-table tr { display: block; width: 100%; }
  .pd-directory .pd-table tbody > tr {
    margin-bottom: 12px; padding: 6px 0;
    border: 1px solid var(--pd-border); border-radius: var(--pd-radius); background: #fff;
  }
  .pd-directory .pd-table tbody > tr > td {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 8px 16px; border: 0;
  }
  .pd-directory .pd-table tbody > tr > td::before {
    content: attr(data-label); font-size: 13px; font-weight: 600; color: var(--pd-muted);
  }
  .pd-directory .pd-table tbody > tr > td.pd-name { font-weight: 600; font-size: 16px; }
  .pd-directory .pd-table tbody > tr > td.pd-name::before,
  .pd-directory .pd-table tbody > tr.pd-empty > td::before { content: none; }
  .pd-directory .pd-footer { flex-direction: column; align-items: flex-start; }
}
