/* staff.css — role-scoped styles for the Staff role */
/* Replacement request list */
#mod-replacements .page-header { margin-bottom: 22px; }
#mod-replacements .page-header__title { color: #111827; font-size: 26px; letter-spacing: -.6px; }
#mod-replacements .page-header__eyebrow { gap: 14px; }
#mod-replacements .page-header__badge { background: #2458df; color: #fff; border-radius: 999px; padding: 8px 17px; font-size: 12px; font-weight: 800; letter-spacing: .35px; text-transform: uppercase; }
#mod-replacements .page-header__sub { color: #64748b; font-size: 15px; margin-top: 5px; }
#mod-replacements .content-card { overflow: hidden; border: 1px solid #dbe3ef; border-radius: 22px; background: #fff; box-shadow: 0 12px 30px rgba(30, 64, 175, .09); }
#mod-replacements .replacement-toolbar { display: flex; align-items: center; gap: 14px; padding: 22px 24px; }
#mod-replacements .replacement-search-wrap { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 220px; height: 40px; padding: 0 14px; border: 1.5px solid transparent; border-radius: var(--r-pill); background: rgba(148, 164, 194, 0.12); color: var(--text-muted); transition: all var(--tf); }
#mod-replacements .replacement-search-wrap:focus-within { background: var(--surface); border-color: var(--primary-light); box-shadow: var(--shadow-glow); }
#mod-replacements .replacement-search-wrap svg { width: 14px; height: 14px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; }
#mod-replacements .replacement-search-wrap input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: 13px; }
#mod-replacements .replacement-search-wrap input::placeholder { color: var(--text-placeholder); }
#mod-replacements #replacement-status-filter { width: 220px; height: 52px; padding: 0 16px; border: 1px solid #dbe3ef; border-radius: 16px; background: #fff; color: #263244; font: inherit; font-size: 15px; }
#mod-replacements .replacement-refresh { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 158px; height: 52px; padding: 0 18px; border: 1px solid #c8d7ff; border-radius: 15px; background: #edf2ff; color: #2458df; font: inherit; font-weight: 700; cursor: pointer; }
#mod-replacements .replacement-refresh:hover { background: #e1eaff; }
#mod-replacements .replacement-refresh svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#mod-replacements .table-responsive { overflow-x: auto; }
#mod-replacements .replacement-table { width: 100%; min-width: 850px; border-collapse: collapse; }
#mod-replacements .replacement-table thead tr { background: #f2f5fa; }
#mod-replacements .replacement-table th { padding: 15px 20px; color: #667085; font-size: 13px; font-weight: 800; letter-spacing: .65px; text-align: left; text-transform: uppercase; white-space: nowrap; }
#mod-replacements .replacement-table td { padding: 17px 20px; border-bottom: 1px solid #edf1f6; color: #344054; font-size: 15px; vertical-align: middle; }
#mod-replacements .replacement-table tbody tr:last-child td { border-bottom: 0; }
#mod-replacements .replacement-applicant { display: flex; align-items: center; gap: 13px; min-width: 190px; }
#mod-replacements .replacement-applicant strong { max-width: 210px; color: #202b3d; font-size: 15px; font-weight: 600; line-height: 1.35; white-space: normal; }
#mod-replacements .replacement-avatar { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; flex: 0 0 48px; border-radius: 15px; background: #eaf0ff; color: #244a9d; font-size: 15px; font-weight: 800; }
#mod-replacements .replacement-app-id { white-space: nowrap; }
#mod-replacements .replacement-copy { display: inline-flex; vertical-align: middle; margin-left: 8px; padding: 3px; border: 0; background: transparent; color: #475569; cursor: pointer; }
#mod-replacements .replacement-copy:hover, #mod-replacements .replacement-copy.is-copied { color: #2458df; }
#mod-replacements .replacement-copy:focus-visible { outline: 2px solid #2458df; outline-offset: 2px; border-radius: 4px; }
#mod-replacements .replacement-copy svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#mod-applicants .applicant-id-copy { display: inline-flex; vertical-align: middle; margin-left: 6px; padding: 3px; border: 0; background: transparent; color: #475569; cursor: pointer; }
#mod-applicants .applicant-id-copy:hover, #mod-applicants .applicant-id-copy.is-copied { color: #2458df; }
#mod-applicants .applicant-id-copy:focus-visible { outline: 2px solid #2458df; outline-offset: 2px; border-radius: 4px; }
#mod-applicants .applicant-id-copy svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#mod-applicants .applicant-filter-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  height: 40px;
  padding: 0 14px;
  border: 1.5px solid #9AACC9;
  border-radius: var(--r-md);
  background: #F8FAFC;
  color: #475569;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
#mod-applicants .table-header__actions .barangay-select-wrap select.filter-select {
  height: 40px;
  border-color: #c2d1f1;
  background-color: #fff;
  color: #34425d;
}
#mod-applicants .table-header__actions .barangay-select-wrap:hover select.filter-select,
#mod-applicants .table-header__actions .barangay-select-wrap:focus-within select.filter-select {
  border-color: #7188AD;
}
#mod-applicants .applicant-filter-reset:hover {
  border-color: #7188AD;
  background: #EFF3F8;
}
#mod-applicants .applicant-filter-reset i { font-size: 16px; }
#mod-applicants .applicant-filter-reset:focus-visible { outline: 2px solid #7188AD; outline-offset: 2px; }
@media (min-width: 1200px) {
  #mod-applicants .data-table-card > .table-header {
    flex-wrap: nowrap;
  }
  #mod-applicants .data-table-card > .table-header > div:first-child {
    flex: 0 0 auto;
  }
  #mod-applicants .data-table-card > .table-header > .table-header__actions {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    min-width: 0;
  }
  #mod-applicants .data-table-card > .table-header > .table-header__actions > .table-search {
    flex: 1 1 320px;
    min-width: 220px;
    max-width: 380px;
  }
  #mod-applicants .data-table-card > .table-header > .table-header__actions > .barangay-select-wrap,
  #mod-applicants .data-table-card > .table-header > .table-header__actions > .applicant-filter-reset {
    flex: 0 0 auto;
  }
}
#mod-replacements .replacement-reason-icon { display: inline-flex; vertical-align: middle; margin-right: 9px; color: #f04438; }
#mod-replacements .replacement-reason-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#mod-replacements .replacement-reason-icon:has(svg path[d^="M20 10"]) { color: #326bff; }
#mod-replacements .replacement-table td:nth-child(4) { color: #697586; white-space: nowrap; }
#mod-replacements .replacement-table .status-select__trigger { min-width: 145px; min-height: 44px; justify-content: space-between; padding: 0 15px; border-radius: 999px; font-size: 14px; }
#mod-replacements .replacement-table .row-action { min-width: 88px; min-height: 43px; border: 1px solid #c8d7ff; border-radius: 14px; background: #fff; color: #2458df; font-size: 14px; font-weight: 700; }
#mod-replacements .replacement-table .row-action:hover { background: #edf2ff; }
:root[data-theme="dark"] #mod-replacements .page-header__title { color: #f1f5f9; }
:root[data-theme="dark"] #mod-replacements .page-header__sub { color: #94a3b8; }
:root[data-theme="dark"] #mod-replacements .content-card { background: #172033; border-color: #334155; }
:root[data-theme="dark"] #mod-replacements #replacement-status-filter { background: #111b2d; border-color: #334155; color: #e2e8f0; }
:root[data-theme="dark"] #mod-replacements .replacement-search-wrap input { color: #e2e8f0; }
:root[data-theme="dark"] #mod-replacements .replacement-table thead tr,
:root[data-theme="dark"] #mod-replacements .replacement-table th { background: #202c40; color: #aab6c8; }
:root[data-theme="dark"] #mod-replacements .replacement-table td { color: #d5deeb; border-color: #334155; }
:root[data-theme="dark"] #mod-replacements .replacement-applicant strong { color: #f1f5f9; }
:root[data-theme="dark"] #mod-replacements .replacement-avatar { background: #26395f; color: #bdd0ff; }
:root[data-theme="dark"] #mod-replacements .replacement-table .row-action { background: #172033; }
:root[data-theme="dark"] #mod-applicants .applicant-filter-reset {
  border-color: #52647E;
  background: #1E293B;
  color: #C3CEDD;
}
:root[data-theme="dark"] #mod-applicants .applicant-filter-reset:hover {
  border-color: #7188AD;
  background: #263449;
}
:root[data-theme="dark"] #mod-applicants .table-header__actions .barangay-select-wrap select.filter-select {
  border-color: #3b527f;
  background-color: #172033;
  color: #e2e8f0;
}
:root[data-theme="dark"] #mod-applicants .table-header__actions .barangay-select-wrap:hover select.filter-select,
:root[data-theme="dark"] #mod-applicants .table-header__actions .barangay-select-wrap:focus-within select.filter-select {
  border-color: #7188AD;
}
@media (max-width: 760px) {
  #mod-replacements .replacement-toolbar { align-items: stretch; flex-direction: column; padding: 16px; }
  #mod-replacements .replacement-search-wrap, #mod-replacements #replacement-status-filter, #mod-replacements .replacement-refresh { width: 100%; }
  #mod-replacements .replacement-table th, #mod-replacements .replacement-table td { padding: 13px 14px; }
}

/* Staff-mode login/title theming */
.auth-shell.staff-mode .auth-hero {
  transform: translateX(85.2%);
  clip-path: ellipse(98% 118% at 100% 50%);
  background: linear-gradient(150deg, #6F101C 0%, #9B1B2D 48%, #C73546 100%);
  color: #fff;
}

.auth-shell.staff-mode .auth-hero-logo-name,
.auth-shell.staff-mode .auth-hero-title,
.auth-shell.staff-mode .auth-hero-action {
  color: #fff
}

.auth-shell.staff-mode .auth-hero-logo-sub,
.auth-shell.staff-mode .auth-hero-desc {
  color: rgba(255, 255, 255, .82)
}

.auth-shell.staff-mode .auth-hero-action {
  border-color: rgba(255, 255, 255, .88)
}

.auth-shell.staff-mode .auth-hero-action:hover {
  background: #fff;
  color: #9B1B2D
}

.auth-shell.staff-mode .auth-field-label {
  color: var(--danger-dark)
}

.auth-shell.staff-mode .auth-input:focus {
  border-color: #D9233A;
  box-shadow: 0 0 0 3px rgba(217, 35, 58, .14)
}

.auth-shell.staff-mode .auth-input:focus+i,
.auth-shell.staff-mode .auth-input-wrap:focus-within i {
  color: var(--primary)
}

.auth-shell.staff-mode .auth-input-wrap .auth-input:focus~i {
  color: var(--primary)
}

.auth-shell.staff-mode .auth-input-icon-right:hover {
  color: var(--danger-dark);
  background: var(--danger-bg)
}

.auth-shell.staff-mode .auth-submit {
  background: linear-gradient(135deg, #9B1B2D 0%, #D9233A 100%);
  box-shadow: 0 4px 18px rgba(217, 35, 58, .26);
}

.auth-shell.staff-mode .auth-submit:hover {
  box-shadow: 0 8px 28px rgba(217, 35, 58, .34);
  transform: translateY(-1px)
}

/* Separate the person registry from the application work queue. */
.applications-summary-cards {
  grid-template-columns: repeat(5, minmax(0, 1fr))
}

#mod-applicants .data-table {
  min-width: 820px
}

#mod-applications .data-table {
  min-width: 0;
  width: 100%;
}

/* =========================================================
   APPLICANT PROFILE MODAL PREVIEW & DETAILS
   ========================================================= */

#applicant-profile-modal.modal-backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 16px;
  z-index: 1050;
  display: none;
  align-items: center;
  justify-content: center;
}

#applicant-profile-modal.modal-backdrop.show {
  display: flex;
}

.modal.applicant-profile-modal {
  width: 100%;
  max-width: 960px;
  min-height: auto;
  max-height: calc(100dvh - 36px);
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 1px rgba(15, 23, 42, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: applicantModalIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes applicantModalIn {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(8px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Modal Header */
.applicant-profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border, #f1f5f9);
  background: var(--surface, #ffffff);
  flex-shrink: 0;
}

.applicant-profile-header__identity {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.applicant-profile-avatar {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #f0f9ff;
  color: #17649A;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px #e0f2fe;
}

:root[data-theme="dark"] .applicant-profile-avatar {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.3);
}

.applicant-profile-header__text {
  min-width: 0;
}

.applicant-profile-title {
  margin: 0;
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

@media (min-width: 640px) {
  .applicant-profile-title {
    font-size: 1.25rem;
  }
}

.applicant-profile-sub {
  margin: 4px 0 0 0;
  font-size: 0.875rem;
  color: var(--text-muted, #64748b);
  line-height: 1.3;
}

.applicant-profile-close {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface, #ffffff);
  color: var(--text-muted, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
}

.applicant-profile-close:hover {
  background: var(--bg-alt, #f8fafc);
  color: var(--text-primary, #0f172a);
  border-color: var(--border-strong, #cbd5e1);
}

/* Modal Body */
.applicant-profile-body {
  padding: 24px 28px 28px 28px;
  overflow-y: auto;
  max-height: calc(100dvh - 120px);
  background: var(--surface, #ffffff);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Applicant Information Grid */
.applicant-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.applicant-profile-card {
  min-width: 0;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(226, 232, 240, 0.9));
  background: var(--bg, rgba(248, 250, 252, 0.7));
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

:root[data-theme="dark"] .applicant-profile-card {
  background: rgba(17, 27, 45, 0.6);
  border-color: var(--border, #334155);
}

.applicant-profile-card:hover {
  border-color: #bae6fd;
}

:root[data-theme="dark"] .applicant-profile-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
}

.applicant-profile-card__label {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted, #64748b);
  line-height: 1.2;
}

.applicant-profile-card__val {
  margin: 6px 0 0 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary, #1e293b);
  word-break: break-word;
  line-height: 1.4;
}

.applicant-profile-card__status-wrap {
  margin-top: 6px;
  display: flex;
  align-items: center;
}

/* Status Pills with Dots */
.profile-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 9999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.profile-status-pill--sm {
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-status-pill .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Status variants */
.status-pill--pending {
  background-color: #fef3c7;
  color: #92400e;
}

.status-pill--pending .status-dot {
  background-color: #f59e0b;
}

.status-pill--success {
  background-color: #d1fae5;
  color: #065f46;
}

.status-pill--success .status-dot {
  background-color: #10b981;
}

.status-pill--info {
  background-color: #e0f2fe;
  color: #075985;
}

.status-pill--info .status-dot {
  background-color: #0284c7;
}

.status-pill--danger {
  background-color: #ffe4e6;
  color: #9f1239;
}

.status-pill--danger .status-dot {
  background-color: #f43f5e;
}

:root[data-theme="dark"] .status-pill--pending {
  background-color: rgba(245, 158, 11, 0.2);
  color: #fde68a;
}

:root[data-theme="dark"] .status-pill--success {
  background-color: rgba(16, 185, 129, 0.2);
  color: #a7f3d0;
}

:root[data-theme="dark"] .status-pill--info {
  background-color: rgba(2, 132, 199, 0.2);
  color: #bae6fd;
}

:root[data-theme="dark"] .status-pill--danger {
  background-color: rgba(244, 63, 94, 0.2);
  color: #fecdd3;
}

/* Application History Section */
.applicant-profile-history-section {
  display: flex;
  flex-direction: column;
}

.applicant-profile-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border, #e2e8f0);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.applicant-profile-history-title {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary, #475569);
}

.applicant-profile-history-count {
  font-size: 12px;
  color: var(--text-placeholder, #94a3b8);
}

.applicant-profile-history__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.applicant-profile-history__item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--surface, #ffffff);
  padding: 14px 18px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

:root[data-theme="dark"] .applicant-profile-history__item {
  background: rgba(17, 27, 45, 0.4);
}

.applicant-profile-history__item:hover {
  border-color: #bae6fd;
  box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.05);
}

:root[data-theme="dark"] .applicant-profile-history__item:hover {
  border-color: rgba(56, 189, 248, 0.4);
}

@media (min-width: 640px) {
  .applicant-profile-history__item {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.applicant-profile-history__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  column-gap: 12px;
  row-gap: 8px;
  min-width: 0;
}

.applicant-profile-history__id {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #0f172a);
}

.applicant-profile-history__type {
  font-size: 12px;
  color: var(--text-muted, #64748b);
}

.applicant-profile-history__sep {
  color: #cbd5e1;
  font-size: 12px;
  user-select: none;
}

:root[data-theme="dark"] .applicant-profile-history__sep {
  color: #475569;
}

.applicant-profile-history__date {
  font-size: 12px;
  color: var(--text-muted, #64748b);
}

.applicant-profile-history__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary, #334155);
  background: var(--surface, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}

.applicant-profile-history__btn:hover {
  border-color: #429EBD;
  background-color: #f0f9ff;
  color: #053F5C;
}

:root[data-theme="dark"] .applicant-profile-history__btn {
  background: rgba(23, 32, 51, 0.8);
}

:root[data-theme="dark"] .applicant-profile-history__btn:hover {
  border-color: #38bdf8;
  background-color: rgba(56, 189, 248, 0.15);
  color: #e0f2fe;
}

.applicant-profile-history__btn svg {
  transition: transform 0.15s ease;
}

.applicant-profile-history__btn:hover svg {
  transform: translateX(2px);
}

.applicant-profile-history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 16px;
  border-radius: 12px;
  border: 1px dashed var(--border, #e2e8f0);
  color: var(--text-muted, #64748b);
  text-align: center;
  font-size: 13px;
}

@media(max-width:1200px) {
  .applications-summary-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr))
  }
}

@media(max-width:800px) {
  .applicant-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media(max-width:700px) {
  .applications-summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }
}

@media(max-width:560px) {
  .applicant-profile-header {
    padding: 16px 18px;
  }

  .applicant-profile-body {
    padding: 18px 16px 22px 16px;
    gap: 22px;
  }

  .applicant-profile-title {
    font-size: 1.05rem;
  }

  .applicant-profile-grid {
    grid-template-columns: 1fr;
  }

  .applicant-profile-history__item {
    flex-direction: column;
    align-items: flex-start;
  }

  .applicant-profile-history__btn {
    width: 100%;
  }
}

/* ── Batch Operations dropdown ── */
.batch-ops-wrap {
  position: relative;
  display: inline-block
}

.batch-ops__trigger {
  position: relative
}

.batch-ops__trigger:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  pointer-events: auto;
}

.batch-ops__trigger:disabled:hover {
  transform: none;
  box-shadow: none;
  background: var(--primary-glass);
  border-color: var(--primary-border)
}

.batch-ops__arrow {
  width: 12px;
  height: 12px;
  color: inherit;
  transition: transform .2s
}

.batch-ops-wrap.open .batch-ops__arrow {
  transform: rotate(180deg)
}

.batch-ops-wrap.open .batch-ops__trigger {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary)
}

.batch-ops__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 210px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 12px 36px rgba(13, 27, 62, 0.16);
  padding: 6px;
  z-index: 60;
  display: none;
  flex-direction: column;
  gap: 2px
}

.batch-ops-wrap.open .batch-ops__menu {
  display: flex
}

.batch-ops__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: none;
  background: none;
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background .1s, color .1s;
  text-align: left;
  width: 100%;
  font-family: var(--font-body)
}

.batch-ops__item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--text-muted)
}

.batch-ops__item:hover {
  background: var(--bg-alt);
  color: var(--text-primary)
}

.batch-ops__item:hover svg {
  color: var(--primary)
}

.batch-ops__item--danger {
  color: var(--danger)
}

.batch-ops__item--danger svg {
  color: var(--danger)
}

.batch-ops__item--danger:hover {
  background: var(--danger-bg);
  color: var(--danger-dark)
}

.batch-ops__item--danger:hover svg {
  color: var(--danger-dark)
}

.batch-ops__item:disabled {
  opacity: .45;
  cursor: not-allowed
}

.batch-ops__item:disabled:hover {
  background: none;
  color: var(--text-secondary)
}

.batch-ops__item:disabled:hover svg {
  color: var(--text-muted)
}

/* Shared Applications queue summary */
#mod-applications .applications-summary-cards {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* ── Row selection checkboxes ── */
#applications-tbody .row-check,
#select-all-apps {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
  vertical-align: middle
}

.data-table thead .row-check {
  vertical-align: middle
}

/* ═══ Staff Mobile Responsive ═══ */
@media (max-width:768px) {
  #mod-applications .applications-summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  /* Batch operations mobile */
  .batch-ops-wrap {
    width: 100%
  }

  .batch-ops__trigger {
    width: 100%;
    justify-content: space-between
  }

  .batch-ops__menu {
    width: 100%;
    min-width: 0;
    left: 0;
    right: 0
  }

  /* Row selection checkboxes */
  #applications-tbody .row-check,
  #select-all-apps {
    width: 14px;
    height: 14px
  }

  /* Staff-specific form layouts */
  .form-grid-2 {
    grid-template-columns: 1fr
  }
}

@media (max-width:560px) {
  #mod-applications .applications-summary-cards {
    grid-template-columns: 1fr
  }
}

@media (max-width:560px) {
  .batch-ops__menu {
    min-width: 0;
    width: 100%
  }

  .batch-ops__item {
    padding: 10px 14px;
    font-size: 13px
  }
}

/* ═══ Staff Portal: Prevent horizontal scroll ═══ */
@media (max-width:768px) {

  /* Data table card — prevent overflow */
  .data-table-card {
    overflow: hidden
  }

  .data-table {
    min-width: 0
  }

  .data-table th,
  .data-table td {
    min-width: 0
  }

  /* Status tabs — scrollable row, no page push */
  .filter-bar {
    overflow: hidden
  }

  .status-tabs {
    min-width: 0;
    max-width: 100%
  }

  /* Chart containers responsive */
  .chart-wrap {
    max-width: 100%
  }

  .chart-wrap[style] {
    width: 100% !important;
    max-width: 100%
  }

  /* Donut chart responsive */
  .donut-card {
    min-width: 0
  }

  .donut-wrap {
    max-width: 150px
  }

  /* Analytics cards */
  .an-card {
    min-width: 0;
    overflow: hidden
  }

  .an-card__body {
    min-width: 0
  }

  .an-card__body--nop {
    min-width: 0
  }

  /* Tables inside modals */
  .modal .data-table {
    min-width: 0
  }

  .modal .data-table th,
  .modal .data-table td {
    padding: 8px 8px;
    font-size: 12px
  }

  /* Family composition table */
  #family-table {
    min-width: 0
  }

  #family-table th,
  #family-table td {
    padding: 6px 8px;
    font-size: 12px
  }

  /* Document viewer */
  .doc-viewer {
    max-width: 100%;
    left: 0;
    right: 0
  }
}

@media (max-width:560px) {

  /* All tables — prevent any horizontal scroll */
  .data-table-card {
    overflow-x: hidden
  }

  .data-table {
    display: block;
    min-width: 0
  }

  .data-table thead {
    display: none
  }

  .data-table tbody {
    display: block;
    min-width: 0
  }

  .data-table tbody tr {
    display: block;
    padding: 10px 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface)
  }

  .data-table tbody td {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 6px 0 6px 40%;
    border-bottom: 1px dashed var(--bg-alt);
    text-align: right;
    white-space: normal !important;
    overflow: visible !important;
    min-width: 0
  }

  .data-table tbody td::before {
    content: attr(data-label);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 38%;
    text-align: left;
    font-family: var(--font-data);
    font-weight: 700;
    font-size: 10.5px;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--text-placeholder)
  }

  .data-table tbody td[data-label=""]::before,
  .data-table tbody td:not([data-label])::before {
    content: '';
    display: none
  }

  .data-table tbody td:not([data-label]) {
    padding-left: 0;
    justify-content: flex-start;
    text-align: left
  }

  .data-table tbody td:last-child {
    border-bottom: none
  }

  /* Status tabs — smaller on small phones */
  .status-tab {
    padding: 5px 8px;
    font-size: 10.5px;
    gap: 4px
  }

  .status-tab .tab-icon {
    width: 10px;
    height: 10px
  }

  .tab-count {
    min-width: 16px;
    height: 14px;
    font-size: 10px;
    padding: 0 3px
  }

  /* Pills shrink on mobile */
  .app-type-pill,
  .docs-pill {
    font-size: 10.5px;
    padding: 2px 7px
  }

  /* Status select compact on mobile */
  #applications-tbody .status-select__trigger {
    font-size: 10.5px;
    padding: 2px 4px
  }

  #applications-tbody .status-select__option {
    font-size: 10.5px;
    padding: 3px 5px
  }
}

/* ═══ Compact Status Select (Staff tables) ═══ */
#applications-tbody .status-select {
  min-width: 0
}

#applications-tbody .status-select__trigger {
  padding: 2px 5px;
  font-size: 11px;
  gap: 4px;
  min-width: 0
}

#applications-tbody .status-select__icon {
  width: 11px;
  height: 11px
}

#applications-tbody .status-select__icon svg {
  width: 11px;
  height: 11px
}

#applications-tbody .status-select__arrow {
  width: 7px;
  height: 7px
}

#applications-tbody .status-select__option {
  padding: 4px 6px;
  font-size: 11px;
  gap: 5px
}

#applications-tbody .status-select__option-icon {
  width: 11px;
  height: 11px
}

#applications-tbody .status-select__option-icon svg {
  width: 11px;
  height: 11px
}

body>.status-select__menu {
  z-index: 3000
}

#applications-tbody .status-select__menu {
  min-width: 140px;
  border-radius: var(--r-sm);
  padding: 2px 0
}

/* ═══ Application Type pill ═══ */
.app-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-data);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .4px;
  line-height: 1.4;
  vertical-align: middle;
}

.app-type-pill--first {
  background: rgba(5, 150, 105, .08);
  color: #047857;
  border: 1px solid rgba(5, 150, 105, .18);
}

.app-type-pill--replacement {
  background: rgba(217, 119, 6, .08);
  color: #92400e;
  border: 1px solid rgba(217, 119, 6, .18);
}

/* ═══ Documents status pill ═══ */
.docs-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-data);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .3px;
  line-height: 1.4;
  vertical-align: middle;
}

.docs-pill--complete {
  background: rgba(5, 150, 105, .08);
  color: #047857;
  border: 1px solid rgba(5, 150, 105, .18);
}

.docs-pill--incomplete {
  background: rgba(225, 29, 72, .06);
  color: #BE123C;
  border: 1px solid rgba(225, 29, 72, .14);
}

.row-action--icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--r-md);
  color: var(--primary);
  background: var(--primary-muted);
  border: 1px solid var(--primary-border)
}

.row-action--icon:hover {
  color: var(--primary-dark);
  background: var(--primary-border);
  transform: translateY(-1px)
}

.row-action--icon svg {
  width: 17px;
  height: 17px
}

.row-action--icon::after {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%) translateX(4px);
  padding: 6px 9px;
  border-radius: 6px;
  background: #0F172A;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 1000
}

.row-action--icon:hover::after,
.row-action--icon:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0)
}

.barangay-empty-card .bar-chart-wrap {
  position: relative
}

.barangay-empty-card .chart-empty-note {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
  pointer-events: none;
  z-index: 1;
  background: transparent
}

.barangay-empty-card .bar-chart-wrap {
  flex: 1 1 224px;
  min-height: 224px;
  height: auto;
  display: block
}

.barangay-empty-card .bar-chart {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: stretch;
  gap: 12px;
  height: 100%;
  padding: 8px 8px 32px;
  overflow: visible
}

.barangay-empty-card .bar-chart::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 8px 8px 32px;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(25% - 1px), var(--border) calc(25% - 1px), var(--border) 25%);
  opacity: .8;
  pointer-events: none
}

.barangay-empty-card .bar-col {
  position: relative;
  display: block;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
}

.barangay-empty-card .bar-col__bar {
  position: absolute;
  left: 22%;
  bottom: 0;
  width: 56%;
  height: var(--bar-height, 0%);
  max-height: 84%;
  border-radius: 7px 7px 2px 2px;
  background: linear-gradient(180deg, #93C5FD 0%, #3B82F6 100%);
  box-shadow: 0 2px 8px rgba(37, 99, 235, .16);
  transform-origin: bottom;
  transition: height .32s ease, background .18s ease, filter .18s ease
}

.barangay-empty-card .bar-col__bar:hover {
  background: linear-gradient(180deg, #60A5FA 0%, #2563EB 100%);
  filter: saturate(1.08);
  transform: scaleX(1.08)
}

.barangay-empty-card .bar-col__bar--peak {
  background: linear-gradient(180deg, #3B82F6 0%, #1D4ED8 100%);
  box-shadow: 0 3px 12px rgba(29, 78, 216, .28)
}

.barangay-empty-card .bar-col__bar--peak:hover {
  background: linear-gradient(180deg, #2563EB 0%, #1E40AF 100%)
}

.barangay-empty-card .bar-col__value {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: calc(var(--bar-height, 0%) + 5px);
  color: var(--text-secondary);
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  pointer-events: none
}

.barangay-empty-card .bar-col.is-peak .bar-col__value {
  color: var(--primary);
  font-weight: 800
}

.barangay-empty-card .bar-col__label {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  width: calc(100% + 10px);
  transform: translateX(-50%);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere
}

:root[data-theme="dark"] .barangay-empty-card .bar-chart::before {
  border-color: var(--border);
  opacity: .65
}

:root[data-theme="dark"] .barangay-empty-card .bar-col__bar {
  background: linear-gradient(180deg, #60A5FA 0%, #3B82F6 100%);
  box-shadow: 0 2px 10px rgba(59, 130, 246, .24)
}

:root[data-theme="dark"] .barangay-empty-card .bar-col__bar--peak {
  background: linear-gradient(180deg, #93C5FD 0%, #3B82F6 100%);
  box-shadow: 0 3px 14px rgba(59, 130, 246, .36)
}

:root[data-theme="dark"] .barangay-empty-card .bar-col__value {
  color: #CBD5E1
}

:root[data-theme="dark"] .barangay-empty-card .bar-col.is-peak .bar-col__value {
  color: #93C5FD
}

.dash-charts-row .donut-wrap,
.dash-charts-row .donut-svg {
  width: 190px;
  height: 190px;
}

.dash-charts-row .donut-wrap {
  max-width: 100%;
}

.dash-charts-row .donut-inner__pct {
  font-size: 30px;
}

@media (max-width: 560px) {
  .dash-charts-row .donut-wrap,
  .dash-charts-row .donut-svg {
    width: 150px;
    height: 150px;
  }
}

/* Staff analytics command center */
.analytics-hero {
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(420px, 1.6fr);
  gap: 14px;
  align-items: stretch
}

.analytics-hero__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 22px 24px;
  height: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%)
}

:root[data-theme="dark"] .analytics-hero__copy {
  background: linear-gradient(135deg, #172033 0%, #111B2D 100%)
}

:root[data-theme="dark"] .app-type-pill--first,
:root[data-theme="dark"] .docs-pill--complete {
  color: #6EE7B7;
  background: rgba(16, 185, 129, .14);
  border-color: rgba(16, 185, 129, .28)
}

:root[data-theme="dark"] .app-type-pill--replacement {
  color: #FCD34D;
  background: rgba(245, 158, 11, .14);
  border-color: rgba(245, 158, 11, .28)
}

:root[data-theme="dark"] .docs-pill--incomplete {
  color: #FDA4AF;
  background: rgba(244, 63, 94, .14);
  border-color: rgba(244, 63, 94, .28)
}

:root[data-theme="dark"] .row-action--icon::after {
  background: #334155;
  color: #F8FAFC
}

.analytics-hero__copy h2 {
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.15;
  color: var(--text-primary);
  letter-spacing: 0;
  margin: 0
}

.analytics-hero__copy p {
  max-width: 560px;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.55
}

.analytics-hero__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch
}

.analytics-kpi {
  min-height: 132px
}

.analytics-status-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%
}

.analytics-status-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg)
}

.analytics-status-item span {
  width: 9px;
  height: 9px;
  border-radius: var(--r-pill)
}

.analytics-status-item strong {
  font-size: 12.5px;
  color: var(--text-secondary)
}

.analytics-status-item em {
  font-style: normal;
  font-family: var(--font-data);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary)
}

.queue-mix-card {
  box-shadow: 0 10px 28px rgba(15, 23, 42, .07);
}

.queue-mix-card .an-card__header {
  align-items: center;
  padding: 22px 24px 18px;
}

.queue-mix__sample {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
}

.queue-mix__body {
  align-items: center;
  gap: 18px;
  padding: 20px 24px 24px;
}

.queue-mix__chart {
  position: relative;
  width: 190px;
  height: 190px;
  flex: 0 0 auto;
}

.queue-mix__chart .chart-wrap {
  width: 100%;
  height: 100%;
}

.queue-mix__center {
  position: absolute;
  inset: 20%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
}

.queue-mix__center strong {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}

.queue-mix__center span {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .55px;
  white-space: nowrap;
}

.queue-mix__empty-ring {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.queue-mix__empty-ring-hole {
  width: 68%;
  height: 68%;
  border: 18px solid var(--border-subtle);
  border-radius: 50%;
  opacity: .55;
}

.analytics-status-list .analytics-status-item {
  grid-template-columns: 9px minmax(0, 1fr) auto auto;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  border-color: var(--border-subtle);
  border-radius: 12px;
  background: var(--surface);
}

.analytics-status-item strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-status-item small {
  color: var(--text-muted);
  font-family: var(--font-data);
  font-size: 11px;
  text-align: right;
}

.queue-mix__approved > span { background: #059669; }
.queue-mix__pending > span { background: #B45309; }
.queue-mix__review > span { background: #1D4ED8; }
.queue-mix__rejected > span { background: #B91C1C; }

@media (max-width: 520px) {
  .queue-mix-card .an-card__header {
    align-items: flex-start;
  }

  .queue-mix__sample {
    max-width: 48%;
    white-space: normal;
    text-align: right;
  }

  .queue-mix__body {
    padding: 16px;
  }

  .queue-mix__chart {
    width: 170px;
    height: 170px;
  }

  .analytics-status-list .analytics-status-item {
    grid-template-columns: 8px minmax(0, 1fr) auto;
    gap: 6px;
    padding: 9px;
  }

  .analytics-status-item small {
    grid-column: 2 / -1;
    text-align: left;
  }
}

.analytics-action-card .an-card__body {
  gap: 12px;
  justify-content: center
}

.analytics-staff-insights {
  align-items: stretch
}

.staff-dashboard-date-pill {
  font-size: 13px !important;
}

.analytics-action-list {
  padding: 16px 18px
}

.analytics-action-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg)
}

.analytics-action-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  background: var(--primary-muted);
  color: var(--primary);
  flex-shrink: 0
}

.analytics-action-icon i {
  font-size: 16px;
  line-height: 1
}

.analytics-action-item strong {
  display: block;
  font-size: 13px;
  color: var(--text-primary)
}

.analytics-action-item small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted)
}

.analytics-empty-copy {
  margin-top: 2px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: rgba(37, 99, 235, .06);
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.45
}

.analytics-handoff {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 28px 24px;
  text-align: center;
  flex: 1
}

.analytics-handoff__ring {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 190px;
  height: 190px;
  border: 0;
  border-radius: var(--r-pill);
  flex-shrink: 0;
  background: conic-gradient(
    from -90deg,
    #3B82F6 0 var(--handoff-progress, 0%),
    #DBEAFE var(--handoff-progress, 0%) 100%
  )
}

.analytics-handoff__ring::before {
  content: "";
  position: absolute;
  inset: 15px;
  z-index: 0;
  border-radius: inherit;
  background: var(--surface)
}

.analytics-handoff__ring strong {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 38px;
  color: var(--text-primary);
  line-height: 1
}

.analytics-handoff__ring span {
  position: relative;
  z-index: 1;
  font-family: var(--font-data);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 3px
}

.analytics-handoff__copy {
  text-align: center
}

.analytics-handoff__copy strong {
  display: block;
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 8px
}

.analytics-handoff__copy p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 340px;
  margin: 0 auto
}

.staff-ai-insight {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #F1F5F9;
  color: var(--text-primary);
}

:root[data-theme="dark"] .staff-ai-insight {
  border-color: #475569;
  background: #1E293B;
  color: #E2E8F0;
}

:root[data-theme="dark"] .analytics-action-item {
  background: #1E293B;
  border-color: #475569;
}

:root[data-theme="dark"] .analytics-action-icon {
  background: #1E3A8A;
  color: #BFDBFE;
}

:root[data-theme="dark"] .analytics-empty-copy {
  background: #172554;
  color: #CBD5E1;
}

:root[data-theme="dark"] .analytics-handoff__ring {
  background: conic-gradient(
    from -90deg,
    #60A5FA 0 var(--handoff-progress, 0%),
    #1E3A8A var(--handoff-progress, 0%) 100%
  );
}

.analytics-legacy-demographics {
  grid-template-columns: 1fr
}

.analytics-legacy-demographics .an-card:nth-child(2),
.analytics-legacy-issuance,
.analytics-legacy-scorecard {
  display: none
}

@media (max-width:1100px) {
  .analytics-hero {
    grid-template-columns: 1fr
  }

  .analytics-hero__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }
}

@media (max-width:560px) {
  .analytics-hero__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .analytics-handoff {
    padding: 20px 18px;
    gap: 14px
  }
}

#analytics-kpi-strip .analytics-kpi {
  --analytics-kpi-accent: #475569;
  --analytics-kpi-tint: rgba(71, 85, 105, .1);
  min-height: 132px;
  padding: 16px 18px;
  gap: 12px;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
  cursor: default;
}

#analytics-kpi-strip .analytics-kpi:nth-child(1) {
  --analytics-kpi-accent: #a16207;
  --analytics-kpi-tint: rgba(217, 119, 6, .12);
}

#analytics-kpi-strip .analytics-kpi:nth-child(2) {
  --analytics-kpi-accent: #0f766e;
  --analytics-kpi-tint: rgba(15, 118, 110, .1);
}

#analytics-kpi-strip .analytics-kpi:nth-child(3) {
  --analytics-kpi-accent: #15803d;
  --analytics-kpi-tint: rgba(21, 128, 61, .1);
}

#analytics-kpi-strip .analytics-kpi:nth-child(4) {
  --analytics-kpi-accent: #b42318;
  --analytics-kpi-tint: rgba(180, 35, 24, .1);
}

#analytics-kpi-strip .analytics-kpi:hover {
  border-color: var(--analytics-kpi-accent);
  box-shadow: 0 5px 16px rgba(15, 23, 42, .08);
}

#analytics-kpi-strip .stat-card__icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--analytics-kpi-tint);
}

#analytics-kpi-strip .stat-card__icon {
  color: var(--analytics-kpi-accent);
}

#analytics-kpi-strip .stat-card__label {
  font-size: 13px;
  font-weight: 600;
}

#analytics-kpi-strip .stat-card__value {
  font-size: 28px;
  letter-spacing: -1px;
}

:root[data-theme="dark"] #analytics-kpi-strip .analytics-kpi {
  box-shadow: 0 2px 8px rgba(0, 0, 0, .14);
}

:root[data-theme="dark"] #analytics-kpi-strip .analytics-kpi:hover {
  box-shadow: 0 5px 16px rgba(0, 0, 0, .22);
}

/* ═══════════════════════════════════════════════════════════════════
   COMPACT WIDESCREEN DATA TABLE & FILTER BAR (FIT FULLY ON SCREEN)
   ═══════════════════════════════════════════════════════════════════ */

.filter-bar--compact {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  flex-wrap: nowrap;
  overflow-x: auto;
  margin-bottom: 12px;
  scrollbar-width: thin;
}

.btn-all-filter {
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.btn-all-filter:hover {
  background: #1d4ed8;
}

.shrink-0 {
  flex-shrink: 0 !important;
}

.whitespace-nowrap {
  white-space: nowrap !important;
}

.bg-blue-600 {
  background-color: #2563eb !important;
}

.text-white {
  color: #ffffff !important;
}

.rounded-full {
  border-radius: 9999px !important;
}

.filter-bar-right-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.filter-select-wrap,
.sort-select-wrap,
.barangay-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.table-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 130px;
  width: 175px;
  height: 40px;
  padding: 0 14px;
  border: 1.5px solid transparent;
  border-radius: var(--r-pill);
  background: rgba(148, 164, 194, 0.12);
  transition: all var(--tf);
  flex-shrink: 1;
}

.table-search-wrap:focus-within {
  background: var(--surface);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-glow);
}

.table-search-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--text-muted);
  pointer-events: none;
}

.table-search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  font: 13px var(--font-body);
  background: transparent;
  color: var(--text-primary);
  outline: none;
  height: auto;
  transition: none;
}

.table-search-wrap input::placeholder {
  color: var(--text-placeholder);
}

.filter-bar-right-group .app-filter-control,
.barangay-select-wrap select,
.filter-bar-right-group .sort-select {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 6px 28px 6px 10px;
  font-size: 12px;
  background: #ffffff;
  color: #1e293b;
  cursor: pointer;
  outline: none;
  height: 32px;
  flex-shrink: 0;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: none !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.barangay-select-wrap select {
  padding-left: 26px !important;
  padding-right: 28px !important;
}

.filter-bar-right-group .app-filter-control:focus,
.barangay-select-wrap select:focus,
.filter-bar-right-group .sort-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.select-chevron {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: #94a3b8;
  pointer-events: none;
}

#mod-applications .filter-bar--compact {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  width: 100% !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  overflow: hidden !important;
}

#mod-applications .filter-bar-right-group {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

#mod-applications .filter-bar--compact .filter-select,
#mod-applications .filter-bar--compact select {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 0 !important;
}

#mod-applications .filter-bar--compact .table-search-wrap input {
  height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  font-size: 13px !important;
}

#mod-applications .filter-bar--compact .table-search-wrap {
  flex: 0 0 195px !important;
  width: 195px !important;
}

#mod-applications .filter-bar--compact #filter-application-stage,
#mod-applications .filter-bar--compact .barangay-select-wrap select,
#mod-applications .filter-bar--compact .sort-select {
  height: 40px !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  border: 1px solid #c2d1f1 !important;
  border-radius: 12px !important;
  font-size: 13px !important;
}

#mod-applications .filter-bar--compact #filter-application-stage {
  flex: 0 0 110px !important;
  width: 110px !important;
}

#mod-applications .filter-bar--compact .barangay-select-wrap select {
  flex: 0 0 145px !important;
  width: 145px !important;
}

#mod-applications .filter-bar--compact .sort-select {
  flex: 0 0 130px !important;
  width: 130px !important;
}

#mod-applications .applications-filter-reset {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border: 1.5px solid #9AACC9;
  border-radius: var(--r-md);
  background: #F8FAFC;
  color: #475569;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

#mod-applications .applications-filter-reset:hover {
  border-color: #7188AD;
  background: #EFF3F8;
}

#mod-applications .applications-filter-reset:focus-visible {
  outline: 2px solid #7188AD;
  outline-offset: 2px;
}

#mod-applications .applications-filter-reset i {
  font-size: 16px;
}

#mod-applications .filter-bar--compact #filter-application-stage:focus,
#mod-applications .filter-bar--compact .barangay-select-wrap select:focus,
#mod-applications .filter-bar--compact .sort-select:focus {
  border-color: #7188AD !important;
  box-shadow: 0 0 0 3px rgba(113, 136, 173, .13) !important;
}

.barangay-select-wrap__pin {
  position: absolute;
  left: 8px;
  width: 13px;
  height: 13px;
  color: #64748b;
  pointer-events: none;
}

#mod-applications .data-table-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 100%;
}

#mod-applications .data-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  table-layout: fixed !important;
  border-collapse: collapse;
}

#mod-applications .data-table thead tr {
  background: #ffffff;
}

#mod-applications .data-table th {
  padding: 9px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #64748b;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
  user-select: none;
  overflow: hidden;
  text-overflow: ellipsis;
}

#mod-applications .data-table th:first-child,
#mod-applications .data-table td:first-child {
  width: 34px;
  text-align: center;
  padding: 6px 4px;
}

#mod-applications .data-table th:nth-child(2),
#mod-applications .data-table td:nth-child(2) {
  width: 22%;
}

#mod-applications .data-table th:nth-child(3),
#mod-applications .data-table td:nth-child(3) {
  width: 12%;
}

#mod-applications .data-table th:nth-child(4),
#mod-applications .data-table td:nth-child(4) {
  width: 11%;
}

#mod-applications .data-table th:nth-child(5),
#mod-applications .data-table td:nth-child(5) {
  width: 13%;
}

#mod-applications .data-table th:nth-child(6),
#mod-applications .data-table td:nth-child(6) {
  width: 15%;
}

#mod-applications .data-table th:nth-child(7),
#mod-applications .data-table td:nth-child(7) {
  width: 11%;
}

#mod-applications .data-table th:nth-child(8),
#mod-applications .data-table td:nth-child(8) {
  width: 10%;
  text-align: center;
}

#mod-applications .data-table th:nth-child(9),
#mod-applications .data-table td:nth-child(9) {
  width: 6%;
  text-align: center;
}

#mod-applications .data-table tbody tr:nth-child(odd) {
  background: #ffffff;
}

#mod-applications .data-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

#mod-applications .data-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.12s ease;
}

#mod-applications .data-table tbody tr:hover {
  background: #f1f5f9 !important;
}

#mod-applications .data-table td {
  padding: 7px 6px;
  vertical-align: middle;
  font-size: 12px;
  color: #334155;
  white-space: nowrap;
}

#mod-applications .applicant-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

#mod-applications .applicant-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 11.5px;
  font-weight: 700;
  background: #eaf0ff;
  color: #244a9d;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

:root[data-theme="dark"] #mod-applications .applicant-avatar {
  background: #26395f;
  color: #bdd0ff;
}

#mod-applicants .applicant-avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  background: #eaf0ff;
  color: #244a9d;
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mod-applicants .badge {
  border-radius: 999px;
}

#mod-applicants .badge::before {
  display: none;
}

/* Recent Submissions status pills */
.recent-submission-status {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px 11px;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #dbe3ee;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

:root[data-theme="dark"] .recent-submission-status {
  color: #d1d9e6;
  background: #2a3342;
  border-color: #414d60;
}

.recent-submission-status--pending { color:var(--warning-dark); background:var(--warning-bg); border-color:#f4d98c; }
.recent-submission-status--review { color:#3050aa; background:#dde8ff; border-color:#c9d8ff; }
.recent-submission-status--approved,
.recent-submission-status--completed,
.recent-submission-status--process { color:var(--success-dark); background:var(--success-bg); border-color:#b9e6ca; }
.recent-submission-status--ready,
.recent-submission-status--issued { color:var(--purple-dark); background:var(--purple-bg); border-color:#d5c9fa; }
.recent-submission-status--rejected { color:var(--danger-dark); background:var(--danger-bg); border-color:#f4c5c9; }

:root[data-theme="dark"] .recent-submission-status--pending { color:#ffd27a; background:#493716; border-color:#705522; }
:root[data-theme="dark"] .recent-submission-status--review { color:#b9ccff; background:#26365b; border-color:#3d5487; }
:root[data-theme="dark"] .recent-submission-status--approved,
:root[data-theme="dark"] .recent-submission-status--completed,
:root[data-theme="dark"] .recent-submission-status--process { color:#94e0b4; background:#1d4532; border-color:#32684c; }
:root[data-theme="dark"] .recent-submission-status--ready,
:root[data-theme="dark"] .recent-submission-status--issued { color:#d6bcfa; background:#352451; border-color:#5b4080; }
:root[data-theme="dark"] .recent-submission-status--rejected { color:#ffadb3; background:#4c292e; border-color:#754047; }

:root[data-theme="dark"] #mod-applicants .applicant-avatar {
  background: #26395f;
  color: #bdd0ff;
}

#mod-applications .applicant-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  overflow: hidden;
}

#mod-applications .applicant-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

#mod-applications .applicant-id {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  line-height: 1.1;
}

#mod-applications .app-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 8px;
  border-radius: 9999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

#mod-applications .app-type-pill--first {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

#mod-applications .app-type-pill--replacement {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

#mod-applications .docs-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

#mod-applications .docs-pill--complete {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

#mod-applications .docs-pill--incomplete {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

#mod-applications .status-select__trigger {
  padding: 2.5px 8px;
  font-size: 11px;
  font-weight: 500;
  gap: 4px;
  height: 25px;
  border-radius: 9999px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

#mod-applications .status-select__trigger:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

#mod-applications .membership-select__menu {
  min-width: 120px;
}

#mod-applications .row-action-eye {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #dbeafe;
  color: #2563eb;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  margin: 0 auto;
}

#mod-applications .row-action-eye:hover {
  background: #bfdbfe;
  color: #1d4ed8;
  transform: translateY(-1px);
}

#mod-applications .row-action-eye svg {
  width: 15px;
  height: 15px;
}

/* ═══════════════════════════════════════════════════════════════════
   DARK MODE OVERRIDES FOR APPLICATIONS TABLE & FILTER BAR
   ═══════════════════════════════════════════════════════════════════ */

:root[data-theme="dark"] .filter-bar--compact {
  background: #111B2D;
  border-color: #334155;
}

:root[data-theme="dark"] .table-search-wrap input {
  color: #F1F5F9;
}

:root[data-theme="dark"] .table-search-wrap input::placeholder {
  color: #64748B;
}

:root[data-theme="dark"] .filter-bar-right-group .app-filter-control,
:root[data-theme="dark"] .barangay-select-wrap select,
:root[data-theme="dark"] .filter-bar-right-group .sort-select {
  background: #172033;
  border-color: #334155;
  color: #F1F5F9;
}

:root[data-theme="dark"] #mod-applications .applications-filter-reset {
  background: #1E293B;
  border-color: #52647E;
  color: #C3CEDD;
}

:root[data-theme="dark"] #mod-applications .applications-filter-reset:hover {
  background: #263449;
  border-color: #7188AD;
}

:root[data-theme="dark"] .barangay-select-wrap__pin {
  color: #94A3B8;
}

:root[data-theme="dark"] #mod-applications .data-table-card {
  background: #172033;
  border-color: #334155;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}

:root[data-theme="dark"] #mod-applications .data-table thead tr {
  background: #172033;
}

:root[data-theme="dark"] #mod-applications .data-table th {
  background: #172033;
  border-color: #334155;
  color: #94A3B8;
}

:root[data-theme="dark"] #mod-applications .data-table tbody tr:nth-child(odd) {
  background: #172033;
}

:root[data-theme="dark"] #mod-applications .data-table tbody tr:nth-child(even) {
  background: rgba(148, 163, 184, .045);
}

:root[data-theme="dark"] #mod-applications .data-table tbody tr {
  border-bottom: 1px solid rgba(71, 85, 105, .58);
}

:root[data-theme="dark"] #mod-applications .data-table tbody tr:hover {
  background: #1E293B !important;
}

:root[data-theme="dark"] #mod-applications .data-table td {
  color: #CBD5E1;
}

:root[data-theme="dark"] #mod-applications .applicant-name {
  color: #F1F5F9;
}

:root[data-theme="dark"] #mod-applications .applicant-id {
  color: #94A3B8;
}

:root[data-theme="dark"] #mod-applications .status-select__trigger {
  background: #172033;
  border-color: #334155;
  color: #F1F5F9;
}

:root[data-theme="dark"] #mod-applications .status-select__trigger:hover {
  background: #1E293B;
  border-color: #475569;
}

:root[data-theme="dark"] #mod-applications .status-select__menu,
:root[data-theme="dark"] body>.status-select__menu,
:root[data-theme="dark"] body>.membership-select__menu {
  background: #172033;
  border-color: #334155;
  color: #F1F5F9;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}

:root[data-theme="dark"] #mod-applications .status-select__option,
:root[data-theme="dark"] body>.status-select__menu .status-select__option {
  color: #F1F5F9;
}

:root[data-theme="dark"] #mod-applications .status-select__option:hover,
:root[data-theme="dark"] body>.status-select__menu .status-select__option:hover {
  background: #1E293B;
}

:root[data-theme="dark"] #mod-applications .row-action-eye {
  background: rgba(37, 99, 235, .22);
  color: #60A5FA;
}

:root[data-theme="dark"] #mod-applications .row-action-eye:hover {
  background: rgba(37, 99, 235, .35);
  color: #93C5FD;
}

/* ============================================================
   KPI SKELETON LOADING UI COMPONENT
   Modules: Applicant, Application, ID Issuance, Analytics, and Dashboard
   ============================================================ */

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.animate-pulse {
  animation: pulse 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
}

@keyframes kpi-skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* KPI Card Base Loading & Pulse State */
.stat-card.is-loading,
.stat-card--skeleton,
.analytics-kpi.is-loading,
.analytics-kpi--skeleton,
#staff-kpi-strip.is-loading .stat-card,
#applicants-kpi-strip.is-loading .stat-card,
#applications-kpi-strip.is-loading .stat-card,
#issuance-kpi-strip.is-loading .stat-card,
#analytics-kpi-strip.is-loading .analytics-kpi {
  animation: pulse 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
  pointer-events: none !important;
  user-select: none !important;
}

/* Shimmer on child elements during KPI loading */
.stat-card.is-loading .stat-card__icon-wrap,
.stat-card--skeleton .stat-card__icon-wrap,
#staff-kpi-strip.is-loading .stat-card__icon-wrap,
#applicants-kpi-strip.is-loading .stat-card__icon-wrap,
#applications-kpi-strip.is-loading .stat-card__icon-wrap,
#issuance-kpi-strip.is-loading .stat-card__icon-wrap,
.stat-card.is-loading .stat-card__trend,
.stat-card--skeleton .stat-card__trend,
.stat-card.is-loading .stat-card__period,
.stat-card--skeleton .stat-card__period,
#staff-kpi-strip.is-loading .stat-card__trend,
#applicants-kpi-strip.is-loading .stat-card__trend,
#applications-kpi-strip.is-loading .stat-card__trend,
#issuance-kpi-strip.is-loading .stat-card__trend,
#staff-kpi-strip.is-loading .stat-card__period,
#applicants-kpi-strip.is-loading .stat-card__period,
#applications-kpi-strip.is-loading .stat-card__period,
#issuance-kpi-strip.is-loading .stat-card__period,
.stat-card.is-loading .stat-card__label,
.stat-card--skeleton .stat-card__label,
#staff-kpi-strip.is-loading .stat-card__label,
#applicants-kpi-strip.is-loading .stat-card__label,
#applications-kpi-strip.is-loading .stat-card__label,
#issuance-kpi-strip.is-loading .stat-card__label,
.stat-card.is-loading .stat-card__value,
.stat-card--skeleton .stat-card__value,
#staff-kpi-strip.is-loading .stat-card__value,
#applicants-kpi-strip.is-loading .stat-card__value,
#applications-kpi-strip.is-loading .stat-card__value,
#issuance-kpi-strip.is-loading .stat-card__value,
.stat-card.is-loading .stat-card__sub,
.stat-card--skeleton .stat-card__sub,
#staff-kpi-strip.is-loading .stat-card__sub,
#applicants-kpi-strip.is-loading .stat-card__sub,
#applications-kpi-strip.is-loading .stat-card__sub,
#issuance-kpi-strip.is-loading .stat-card__sub,
.analytics-kpi.is-loading .analytics-kpi__label,
.analytics-kpi--skeleton .analytics-kpi__label,
#analytics-kpi-strip.is-loading .analytics-kpi__label,
.analytics-kpi.is-loading strong,
.analytics-kpi--skeleton strong,
#analytics-kpi-strip.is-loading strong,
.analytics-kpi.is-loading span:last-child,
.analytics-kpi--skeleton span:last-child,
#analytics-kpi-strip.is-loading span:last-child {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%) !important;
  background-size: 200% 100% !important;
  animation: kpi-skeleton-shimmer 1.5s ease-in-out infinite !important;
  color: transparent !important;
  border-color: transparent !important;
  border-radius: 6px;
  position: relative;
}

/* Hide inner SVGs, text and icons while shimmering */
.stat-card.is-loading svg,
.stat-card--skeleton svg,
.stat-card.is-loading i,
.stat-card--skeleton i,
#staff-kpi-strip.is-loading .stat-card svg,
#staff-kpi-strip.is-loading .stat-card i,
#applicants-kpi-strip.is-loading .stat-card svg,
#applicants-kpi-strip.is-loading .stat-card i,
#applications-kpi-strip.is-loading .stat-card svg,
#applications-kpi-strip.is-loading .stat-card i,
#issuance-kpi-strip.is-loading .stat-card svg,
#issuance-kpi-strip.is-loading .stat-card i {
  visibility: hidden !important;
  opacity: 0 !important;
}

/* Structure and dimensions matching Staff Dashboard KPI cards */
.stat-card.is-loading .stat-card__icon-wrap,
.stat-card--skeleton .stat-card__icon-wrap,
#staff-kpi-strip.is-loading .stat-card__icon-wrap,
#applicants-kpi-strip.is-loading .stat-card__icon-wrap,
#applications-kpi-strip.is-loading .stat-card__icon-wrap,
#issuance-kpi-strip.is-loading .stat-card__icon-wrap {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 8px;
}

.stat-card.is-loading .stat-card__trend,
.stat-card--skeleton .stat-card__trend,
.stat-card.is-loading .stat-card__period,
.stat-card--skeleton .stat-card__period,
#staff-kpi-strip.is-loading .stat-card__trend,
#applicants-kpi-strip.is-loading .stat-card__trend,
#applications-kpi-strip.is-loading .stat-card__trend,
#issuance-kpi-strip.is-loading .stat-card__trend,
#staff-kpi-strip.is-loading .stat-card__period,
#applicants-kpi-strip.is-loading .stat-card__period,
#applications-kpi-strip.is-loading .stat-card__period,
#issuance-kpi-strip.is-loading .stat-card__period {
  width: 44px;
  height: 18px;
  min-width: 44px;
  border-radius: 6px;
  display: inline-block;
}

.stat-card.is-loading .stat-card__label,
.stat-card--skeleton .stat-card__label,
#staff-kpi-strip.is-loading .stat-card__label,
#applicants-kpi-strip.is-loading .stat-card__label,
#applications-kpi-strip.is-loading .stat-card__label,
#issuance-kpi-strip.is-loading .stat-card__label {
  height: 13px;
  width: 68%;
  min-width: 80px;
  max-width: 140px;
  display: block;
  border-radius: 4px;
}

.stat-card.is-loading .stat-card__value,
.stat-card--skeleton .stat-card__value,
#staff-kpi-strip.is-loading .stat-card__value,
#applicants-kpi-strip.is-loading .stat-card__value,
#applications-kpi-strip.is-loading .stat-card__value,
#issuance-kpi-strip.is-loading .stat-card__value {
  height: 26px;
  width: 44%;
  min-width: 60px;
  max-width: 90px;
  display: block;
  border-radius: 6px;
  margin: 5px 0 3px;
}

.stat-card.is-loading .stat-card__sub,
.stat-card--skeleton .stat-card__sub,
#staff-kpi-strip.is-loading .stat-card__sub,
#applicants-kpi-strip.is-loading .stat-card__sub,
#applications-kpi-strip.is-loading .stat-card__sub,
#issuance-kpi-strip.is-loading .stat-card__sub {
  height: 12px;
  width: 58%;
  min-width: 70px;
  max-width: 130px;
  display: block;
  border-radius: 4px;
}

/* Analytics Hero KPI Card Skeletons */
.analytics-kpi.is-loading .analytics-kpi__label,
.analytics-kpi--skeleton .analytics-kpi__label,
#analytics-kpi-strip.is-loading .analytics-kpi__label {
  height: 12px;
  width: 55%;
  min-width: 70px;
  max-width: 100px;
  display: block;
  border-radius: 4px;
}

.analytics-kpi.is-loading strong,
.analytics-kpi--skeleton strong,
#analytics-kpi-strip.is-loading strong {
  height: 28px;
  width: 42%;
  min-width: 50px;
  max-width: 80px;
  display: block;
  border-radius: 6px;
  margin: 8px 0 4px;
}

.analytics-kpi.is-loading span:last-child,
.analytics-kpi--skeleton span:last-child,
#analytics-kpi-strip.is-loading span:last-child {
  height: 12px;
  width: 68%;
  min-width: 80px;
  max-width: 120px;
  display: block;
  border-radius: 4px;
}

/* Dark Theme Overrides for KPI Skeletons */
:root[data-theme="dark"] .stat-card.is-loading .stat-card__icon-wrap,
:root[data-theme="dark"] .stat-card--skeleton .stat-card__icon-wrap,
:root[data-theme="dark"] #staff-kpi-strip.is-loading .stat-card__icon-wrap,
:root[data-theme="dark"] #applicants-kpi-strip.is-loading .stat-card__icon-wrap,
:root[data-theme="dark"] #applications-kpi-strip.is-loading .stat-card__icon-wrap,
:root[data-theme="dark"] #issuance-kpi-strip.is-loading .stat-card__icon-wrap,
:root[data-theme="dark"] .stat-card.is-loading .stat-card__trend,
:root[data-theme="dark"] .stat-card--skeleton .stat-card__trend,
:root[data-theme="dark"] .stat-card.is-loading .stat-card__period,
:root[data-theme="dark"] .stat-card--skeleton .stat-card__period,
:root[data-theme="dark"] #staff-kpi-strip.is-loading .stat-card__trend,
:root[data-theme="dark"] #applicants-kpi-strip.is-loading .stat-card__trend,
:root[data-theme="dark"] #applications-kpi-strip.is-loading .stat-card__trend,
:root[data-theme="dark"] #issuance-kpi-strip.is-loading .stat-card__trend,
:root[data-theme="dark"] #staff-kpi-strip.is-loading .stat-card__period,
:root[data-theme="dark"] #applicants-kpi-strip.is-loading .stat-card__period,
:root[data-theme="dark"] #applications-kpi-strip.is-loading .stat-card__period,
:root[data-theme="dark"] #issuance-kpi-strip.is-loading .stat-card__period,
:root[data-theme="dark"] .stat-card.is-loading .stat-card__label,
:root[data-theme="dark"] .stat-card--skeleton .stat-card__label,
:root[data-theme="dark"] #staff-kpi-strip.is-loading .stat-card__label,
:root[data-theme="dark"] #applicants-kpi-strip.is-loading .stat-card__label,
:root[data-theme="dark"] #applications-kpi-strip.is-loading .stat-card__label,
:root[data-theme="dark"] #issuance-kpi-strip.is-loading .stat-card__label,
:root[data-theme="dark"] .stat-card.is-loading .stat-card__value,
:root[data-theme="dark"] .stat-card--skeleton .stat-card__value,
:root[data-theme="dark"] #staff-kpi-strip.is-loading .stat-card__value,
:root[data-theme="dark"] #applicants-kpi-strip.is-loading .stat-card__value,
:root[data-theme="dark"] #applications-kpi-strip.is-loading .stat-card__value,
:root[data-theme="dark"] #issuance-kpi-strip.is-loading .stat-card__value,
:root[data-theme="dark"] .stat-card.is-loading .stat-card__sub,
:root[data-theme="dark"] .stat-card--skeleton .stat-card__sub,
:root[data-theme="dark"] #staff-kpi-strip.is-loading .stat-card__sub,
:root[data-theme="dark"] #applicants-kpi-strip.is-loading .stat-card__sub,
:root[data-theme="dark"] #applications-kpi-strip.is-loading .stat-card__sub,
:root[data-theme="dark"] #issuance-kpi-strip.is-loading .stat-card__sub,
:root[data-theme="dark"] .analytics-kpi.is-loading .analytics-kpi__label,
:root[data-theme="dark"] .analytics-kpi--skeleton .analytics-kpi__label,
:root[data-theme="dark"] #analytics-kpi-strip.is-loading .analytics-kpi__label,
:root[data-theme="dark"] .analytics-kpi.is-loading strong,
:root[data-theme="dark"] .analytics-kpi--skeleton strong,
:root[data-theme="dark"] #analytics-kpi-strip.is-loading strong,
:root[data-theme="dark"] .analytics-kpi.is-loading span:last-child,
:root[data-theme="dark"] .analytics-kpi--skeleton span:last-child,
:root[data-theme="dark"] #analytics-kpi-strip.is-loading span:last-child {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%) !important;
  background-size: 200% 100% !important;
}

/* Keep the replacements list as compact as the Applications table. */
#mod-replacements .content-card { border-radius: 12px; }
#mod-replacements .replacement-toolbar { gap: 10px; padding: 16px; }
#mod-replacements .replacement-search-wrap { height: 40px; border-radius: var(--r-pill); font-size: 13px; }
#mod-replacements #replacement-status-filter,
#mod-replacements .replacement-refresh { height: 42px; border-radius: 10px; font-size: 13px; }
#mod-replacements .replacement-search-wrap { padding: 0 14px; }
#mod-replacements .replacement-search-wrap input { font-size: 13px; }
#mod-replacements #replacement-status-filter { width: 170px; padding: 0 12px; }
#mod-replacements .replacement-refresh { min-width: 112px; padding: 0 13px; }
#mod-replacements .replacement-table { min-width: 0; table-layout: fixed; }
#mod-replacements .replacement-table th:nth-child(1), #mod-replacements .replacement-table td:nth-child(1) { width: 22%; }
#mod-replacements .replacement-table th:nth-child(2), #mod-replacements .replacement-table td:nth-child(2) { width: 17%; }
#mod-replacements .replacement-table th:nth-child(3), #mod-replacements .replacement-table td:nth-child(3) { width: 16%; }
#mod-replacements .replacement-table th:nth-child(4), #mod-replacements .replacement-table td:nth-child(4) { width: 16%; }
#mod-replacements .replacement-table th:nth-child(5), #mod-replacements .replacement-table td:nth-child(5) { width: 17%; }
#mod-replacements .replacement-table th:nth-child(6), #mod-replacements .replacement-table td:nth-child(6) { width: 12%; }
#mod-replacements .replacement-table th { padding: 9px 10px; font-size: 12px; letter-spacing: .4px; }
#mod-replacements .replacement-table td { padding: 8px 10px; font-size: 13px; }
#mod-replacements .replacement-applicant { gap: 8px; min-width: 0; overflow: hidden; }
#mod-replacements .replacement-applicant strong { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 13px; white-space: nowrap; }
#mod-replacements .replacement-avatar { width: 32px; height: 32px; flex-basis: 32px; border-radius: 10px; font-size: 11px; }
#mod-replacements .replacement-reason-icon { margin-right: 5px; }
#mod-replacements .replacement-reason-icon svg { width: 16px; height: 16px; }
#mod-replacements .replacement-table .status-select__trigger { min-width: 122px; min-height: 28px; padding: 0 9px; font-size: 12px; }
#mod-replacements .replacement-table .row-action { min-width: 62px; min-height: 29px; padding: 3px 10px; border-radius: 8px; font-size: 13px; }
@media (max-width: 760px) {
  #mod-replacements .replacement-table { min-width: 760px; }
}
:root[data-theme="dark"] #mod-replacements .replacement-table tbody tr:hover > td {
  background: #263449;
  color: #F1F5F9;
}
:root[data-theme="dark"] #mod-replacements .replacement-refresh:hover {
  background: #1E3A8A;
  border-color: #3B82F6;
  color: #DBEAFE;
}
:root[data-theme="dark"] #mod-replacements .replacement-table .row-action:hover {
  background: #1E3A8A;
  border-color: #3B82F6;
  color: #DBEAFE;
}
:root[data-theme="dark"] #mod-replacements .replacement-copy:hover,
:root[data-theme="dark"] #mod-replacements .replacement-copy.is-copied,
:root[data-theme="dark"] #mod-applicants .applicant-id-copy:hover,
:root[data-theme="dark"] #mod-applicants .applicant-id-copy.is-copied {
  color: #93C5FD;
}
#staff-export-modal .staff-export-modal {
  width: min(760px, 100%);
  max-height: calc(100dvh - 40px);
  border-radius: var(--r-2xl);
}

#staff-export-modal .staff-export__header {
  gap: 16px;
  padding: 22px 26px;
}

#staff-export-modal .staff-export__icon {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  background: var(--primary-glass);
  box-shadow: inset 0 0 0 1px var(--primary-border);
}

#staff-export-modal .staff-export__icon i {
  font-size: 19px;
}

#staff-export-modal .staff-export__title {
  font-size: 19px;
  letter-spacing: -.025em;
}

#staff-export-modal .staff-export__description {
  max-width: 520px;
  font-size: 13px;
}

#staff-export-modal .staff-export__body {
  display: grid;
  gap: 20px;
  padding: 22px 26px 24px;
  overflow: auto;
}

#staff-export-modal .staff-export__control {
  min-width: 0;
}

#staff-export-modal .staff-export__label,
#staff-export-modal .staff-export__fields-heading {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
}

#staff-export-modal .staff-export__select {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  transition: border-color var(--tf), box-shadow var(--tf);
}

#staff-export-modal .staff-export__select:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glass);
}

#staff-export-modal .staff-export__filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

#staff-export-modal .staff-export__fields-section {
  min-width: 0;
}

#staff-export-modal .staff-export__fields-heading {
  margin-bottom: 10px;
}

#staff-export-modal .staff-export__fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

#staff-export-modal .staff-export__field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--tf), border-color var(--tf), color var(--tf);
}

#staff-export-modal .staff-export__field:has(input:checked) {
  border-color: var(--primary-border);
  background: var(--primary-glass);
  color: var(--text-primary);
}

#staff-export-modal .staff-export__field:has(input:disabled) {
  cursor: default;
}

#staff-export-modal .staff-export__field input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 0;
  accent-color: var(--primary);
}

#staff-export-modal .staff-export__field input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

#staff-export-modal .staff-export__help {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

#staff-export-modal .staff-export__error {
  padding: 10px 12px;
  border: 1px solid rgba(217, 35, 58, .2);
  border-radius: var(--r-md);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 12px;
  line-height: 1.45;
}

#staff-export-modal .staff-export__actions {
  gap: 10px;
  padding: 16px 26px 20px;
}

#staff-export-modal .staff-export__actions .btn--primary {
  gap: 9px;
  padding-inline: 18px;
}

#staff-export-modal .staff-export__actions .btn--primary i {
  font-size: 13px;
}

@media (max-width: 640px) {
  #staff-export-modal.modal-backdrop {
    align-items: flex-end;
    padding: 10px;
  }

  #staff-export-modal .staff-export-modal {
    width: 100%;
    max-height: calc(100dvh - 20px);
    border-radius: 20px;
  }

  #staff-export-modal .staff-export__header {
    padding: 18px 18px 16px;
  }

  #staff-export-modal .staff-export__body {
    gap: 17px;
    padding: 18px;
  }

  #staff-export-modal .staff-export__filters,
  #staff-export-modal .staff-export__fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #staff-export-modal .staff-export__actions {
    padding: 14px 18px 18px;
  }
}

@media (max-width: 420px) {
  #staff-export-modal .staff-export__filters,
  #staff-export-modal .staff-export__fields {
    grid-template-columns: minmax(0, 1fr);
  }

  #staff-export-modal .staff-export__actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* Staff dashboard KPIs: neutral cards with semantic color accents. */
#staff-kpi-strip .stat-card {
  --staff-kpi-accent: #475569;
  --staff-kpi-tint: rgba(71, 85, 105, .1);
  min-height: 132px;
  padding: 16px 18px;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}

#staff-kpi-strip .stat-card:nth-child(1) {
  --staff-kpi-accent: #8b1e2d;
  --staff-kpi-tint: rgba(139, 30, 45, .1);
}

#staff-kpi-strip .stat-card:nth-child(2) {
  --staff-kpi-accent: #a16207;
  --staff-kpi-tint: rgba(217, 119, 6, .12);
}

#staff-kpi-strip .stat-card:nth-child(3) {
  --staff-kpi-accent: #15803d;
  --staff-kpi-tint: rgba(21, 128, 61, .1);
}

#staff-kpi-strip .stat-card:nth-child(4) {
  --staff-kpi-accent: #0f766e;
  --staff-kpi-tint: rgba(15, 118, 110, .1);
}

#staff-kpi-strip .stat-card:nth-child(5) {
  --staff-kpi-accent: #b42318;
  --staff-kpi-tint: rgba(180, 35, 24, .1);
}

#staff-kpi-strip .stat-card:hover,
#staff-kpi-strip .stat-card.active {
  border-color: var(--staff-kpi-accent);
  box-shadow: 0 5px 16px rgba(15, 23, 42, .08);
}

#staff-kpi-strip .stat-card__icon-wrap[class*="iwrap-"] {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--staff-kpi-tint) !important;
}

#staff-kpi-strip .stat-card__icon-wrap i {
  color: var(--staff-kpi-accent);
}

#staff-kpi-strip .stat-card__label {
  font-size: 13px;
  font-weight: 600;
}

#staff-kpi-strip .stat-card__value {
  font-size: 28px;
  letter-spacing: -1px;
}

#staff-kpi-strip .stat-card__sub {
  font-size: 12px;
}

:root[data-theme="dark"] #staff-kpi-strip .stat-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, .14);
}

:root[data-theme="dark"] #staff-kpi-strip .stat-card:hover,
:root[data-theme="dark"] #staff-kpi-strip .stat-card.active {
  box-shadow: 0 5px 16px rgba(0, 0, 0, .22);
}

@media (max-width: 760px) {
  #staff-kpi-strip .stat-card {
    min-height: 120px;
    padding: 14px;
  }
}

/* Applicants KPIs follow the same neutral card style with status-specific accents. */
#applicants-kpi-strip .stat-card {
  --applicant-kpi-accent: #475569;
  --applicant-kpi-tint: rgba(71, 85, 105, .1);
  min-height: 132px;
  padding: 16px 18px;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}

#applicants-kpi-strip .stat-card:nth-child(1) {
  --applicant-kpi-accent: #8b1e2d;
  --applicant-kpi-tint: rgba(139, 30, 45, .1);
}

#applicants-kpi-strip .stat-card:nth-child(2) {
  --applicant-kpi-accent: #15803d;
  --applicant-kpi-tint: rgba(21, 128, 61, .1);
}

#applicants-kpi-strip .stat-card:nth-child(3) {
  --applicant-kpi-accent: #0f766e;
  --applicant-kpi-tint: rgba(15, 118, 110, .1);
}

#applicants-kpi-strip .stat-card:nth-child(4) {
  --applicant-kpi-accent: #a16207;
  --applicant-kpi-tint: rgba(217, 119, 6, .12);
}

#applicants-kpi-strip .stat-card:hover,
#applicants-kpi-strip .stat-card.active {
  border-color: var(--applicant-kpi-accent);
  box-shadow: 0 5px 16px rgba(15, 23, 42, .08);
}

#applicants-kpi-strip .stat-card__icon-wrap[class*="iwrap-"] {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--applicant-kpi-tint) !important;
}

#applicants-kpi-strip .stat-card__icon {
  color: var(--applicant-kpi-accent);
}

#applicants-kpi-strip .stat-card__label {
  font-size: 13px;
  font-weight: 600;
}

#applicants-kpi-strip .stat-card__value {
  font-size: 28px;
  letter-spacing: -1px;
}

#applicants-kpi-strip .stat-card__sub {
  font-size: 12px;
}

#staff-kpi-strip .stat-card__trend,
#applicants-kpi-strip .stat-card__trend,
#applications-kpi-strip .stat-card__trend,
#issuance-kpi-strip .stat-card__trend {
  font-family: var(--font-data);
  font-weight: 500;
  font-size: 11px;
  padding: 0;
  border-radius: 0;
  background: transparent !important;
  color: var(--text-placeholder) !important;
  letter-spacing: .5px;
  text-transform: uppercase;
  text-align: right;
}

:root[data-theme="dark"] #applicants-kpi-strip .stat-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, .14);
}

:root[data-theme="dark"] #applicants-kpi-strip .stat-card:hover,
:root[data-theme="dark"] #applicants-kpi-strip .stat-card.active {
  box-shadow: 0 5px 16px rgba(0, 0, 0, .22);
}

@media (max-width: 760px) {
  #applicants-kpi-strip .stat-card {
    min-height: 120px;
    padding: 14px;
  }
}

/* Applications KPIs use restrained accents to distinguish workflow states. */
#applications-kpi-strip .stat-card {
  --application-kpi-accent: #475569;
  --application-kpi-tint: rgba(71, 85, 105, .1);
  min-height: 132px;
  padding: 16px 18px;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}

#applications-kpi-strip .stat-card:nth-child(1) {
  --application-kpi-accent: #a16207;
  --application-kpi-tint: rgba(217, 119, 6, .12);
}

#applications-kpi-strip .stat-card:nth-child(2) {
  --application-kpi-accent: #0f766e;
  --application-kpi-tint: rgba(15, 118, 110, .1);
}

#applications-kpi-strip .stat-card:nth-child(3) {
  --application-kpi-accent: #b42318;
  --application-kpi-tint: rgba(180, 35, 24, .1);
}

#applications-kpi-strip .stat-card:nth-child(4) {
  --application-kpi-accent: #8b1e2d;
  --application-kpi-tint: rgba(139, 30, 45, .1);
}

#applications-kpi-strip .stat-card:nth-child(5) {
  --application-kpi-accent: #15803d;
  --application-kpi-tint: rgba(21, 128, 61, .1);
}

#applications-kpi-strip .stat-card:hover,
#applications-kpi-strip .stat-card.active {
  border-color: var(--application-kpi-accent);
  box-shadow: 0 5px 16px rgba(15, 23, 42, .08);
}

#applications-kpi-strip .stat-card__icon-wrap[class*="iwrap-"] {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--application-kpi-tint) !important;
}

#applications-kpi-strip .stat-card__icon {
  color: var(--application-kpi-accent);
}

#applications-kpi-strip .stat-card__label {
  font-size: 13px;
  font-weight: 600;
}

#applications-kpi-strip .stat-card__value {
  font-size: 28px;
  letter-spacing: -1px;
}

#applications-kpi-strip .stat-card__sub {
  font-size: 12px;
}

:root[data-theme="dark"] #applications-kpi-strip .stat-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, .14);
}

:root[data-theme="dark"] #applications-kpi-strip .stat-card:hover,
:root[data-theme="dark"] #applications-kpi-strip .stat-card.active {
  box-shadow: 0 5px 16px rgba(0, 0, 0, .22);
}

@media (max-width: 760px) {
  #applications-kpi-strip .stat-card {
    min-height: 120px;
    padding: 14px;
  }
}

/* ID Issuance KPIs use the shared card treatment with workflow accents. */
#issuance-kpi-strip .stat-card {
  --issuance-kpi-accent: #475569;
  --issuance-kpi-tint: rgba(71, 85, 105, .1);
  min-height: 132px;
  padding: 16px 18px;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}

#issuance-kpi-strip .stat-card:nth-child(1) {
  --issuance-kpi-accent: #8b1e2d;
  --issuance-kpi-tint: rgba(139, 30, 45, .1);
}

#issuance-kpi-strip .stat-card:nth-child(2) {
  --issuance-kpi-accent: #a16207;
  --issuance-kpi-tint: rgba(217, 119, 6, .12);
}

#issuance-kpi-strip .stat-card:nth-child(3) {
  --issuance-kpi-accent: #15803d;
  --issuance-kpi-tint: rgba(21, 128, 61, .1);
}

#issuance-kpi-strip .stat-card:nth-child(4) {
  --issuance-kpi-accent: #0f766e;
  --issuance-kpi-tint: rgba(15, 118, 110, .1);
}

#issuance-kpi-strip .stat-card:hover,
#issuance-kpi-strip .stat-card.active {
  border-color: var(--issuance-kpi-accent);
  box-shadow: 0 5px 16px rgba(15, 23, 42, .08);
}

#issuance-kpi-strip .stat-card__icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--issuance-kpi-tint);
}

#issuance-kpi-strip .stat-card__icon {
  color: var(--issuance-kpi-accent);
}

#issuance-kpi-strip .stat-card__label {
  font-size: 13px;
  font-weight: 600;
}

#issuance-kpi-strip .stat-card__value {
  font-size: 28px;
  letter-spacing: -1px;
}

#issuance-kpi-strip .stat-card__sub {
  font-size: 12px;
}

:root[data-theme="dark"] #issuance-kpi-strip .stat-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, .14);
}

:root[data-theme="dark"] #issuance-kpi-strip .stat-card:hover,
:root[data-theme="dark"] #issuance-kpi-strip .stat-card.active {
  box-shadow: 0 5px 16px rgba(0, 0, 0, .22);
}

@media (max-width: 760px) {
  #issuance-kpi-strip .stat-card {
    min-height: 120px;
    padding: 14px;
  }
}


/* ============================================================
   HISTORICAL APPLICANT IMPORT
   ============================================================ */
.applicant-import-overlay[hidden],
.applicant-import-mapping[hidden],
.applicant-import-progress[hidden],
.applicant-import-result[hidden],
.applicant-import-file-meta[hidden],
.applicant-import-error[hidden] {
  display: none !important;
}
.applicant-import-overlay {
  position: fixed;
  inset: 0;
  z-index: 15000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(12, 25, 43, .62);
  backdrop-filter: blur(4px);
}
.applicant-import-modal {
  display: flex;
  flex-direction: column;
  width: min(980px, 100%);
  max-height: min(92vh, 900px);
  overflow: hidden;
  border: 1px solid var(--border, #dce4ee);
  border-radius: 18px;
  background: var(--surface, #fff);
  color: var(--text, #17243a);
  box-shadow: 0 28px 80px rgba(10, 25, 45, .28);
}
.applicant-import-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--border, #e4eaf2);
}
.applicant-import-header h2 {
  margin: 5px 0 6px;
  color: var(--text, #17243a);
  font-size: 1.35rem;
  font-weight: 800;
}
.applicant-import-header p {
  margin: 0;
  color: var(--text-muted, #66758a);
  font-size: .92rem;
}
.applicant-import-eyebrow {
  color: var(--primary, #2457d6);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .12em;
}
.applicant-import-close {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border, #dce4ee);
  border-radius: 10px;
  background: var(--surface, #fff);
  color: var(--text, #17243a);
  font-size: 24px;
  cursor: pointer;
}
.applicant-import-body {
  min-height: 0;
  overflow: auto;
  padding: 20px 26px 24px;
}
.applicant-import-notice {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #d9e6fa;
  border-radius: 12px;
  background: #f5f8ff;
  color: #324966;
  font-size: .84rem;
  line-height: 1.5;
}
.applicant-import-notice strong { color: #173d77; }
.applicant-import-notice ul { margin: 7px 0 0; padding-left: 18px; }
.applicant-import-notice li + li { margin-top: 3px; }
.applicant-import-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 142px;
  padding: 18px;
  border: 1.5px dashed #93a8c5;
  border-radius: 14px;
  background: var(--surface-soft, #f8faff);
  color: var(--text, #24354c);
  text-align: center;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.applicant-import-dropzone:hover,
.applicant-import-dropzone.is-dragover {
  border-color: var(--primary, #2457d6);
  background: #edf4ff;
}
.applicant-import-dropzone strong { font-size: .98rem; }
.applicant-import-dropzone > span:last-of-type {
  color: var(--text-muted, #76859a);
  font-size: .82rem;
}
.applicant-import-dropzone input { display: none; }
.applicant-import-file-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #e5efff;
  color: #2457d6;
  font-size: 24px;
  font-weight: 800;
}
.applicant-import-file-meta {
  margin-top: 10px;
  color: var(--text-muted, #64748b);
  font-size: .82rem;
}
.applicant-import-error {
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid #f2c7c7;
  border-radius: 10px;
  background: #fff5f5;
  color: #a72828;
  font-size: .86rem;
}
.applicant-import-mapping {
  margin-top: 22px;
}
.applicant-import-section-heading,
.applicant-import-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.applicant-import-section-heading h3 {
  margin: 0 0 4px;
  color: var(--text, #17243a);
  font-size: 1.02rem;
}
.applicant-import-section-heading p {
  margin: 0;
  color: var(--text-muted, #748297);
  font-size: .82rem;
}
.applicant-import-count {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 20px;
  background: #eaf1ff;
  color: #2457d6;
  font-size: .75rem;
  font-weight: 800;
}
.applicant-import-map-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 12px;
  margin-top: 14px;
}
.applicant-import-map-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 1.15fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border, #e1e8f0);
  border-radius: 10px;
  background: var(--surface, #fff);
}
.applicant-import-map-row > span {
  overflow: hidden;
  color: var(--text, #34445b);
  font-size: .79rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.applicant-import-map-row select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--border, #d7e0eb);
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--text, #23364e);
  font-size: .76rem;
}
.applicant-import-preview-heading {
  margin: 20px 0 9px;
  color: var(--text, #23354c);
  font-size: .88rem;
}
.applicant-import-preview-heading span {
  color: var(--text-muted, #7b8799);
  font-size: .76rem;
}
.applicant-import-preview-wrap {
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--border, #e1e8f0);
  border-radius: 10px;
}
.applicant-import-preview-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: .76rem;
}
.applicant-import-preview-table th,
.applicant-import-preview-table td {
  max-width: 220px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--border, #edf0f5);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.applicant-import-preview-table th {
  background: var(--surface-soft, #f4f7fb);
  color: var(--text-muted, #62738a);
  font-size: .7rem;
  font-weight: 800;
}
.applicant-import-preview-table tr:last-child td { border-bottom: 0; }
.applicant-import-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 10px;
  font-size: .8rem;
}
.applicant-import-summary-good { color: #16834f; font-weight: 800; }
.applicant-import-summary-muted { color: var(--text-muted, #78869a); }
.applicant-import-progress { margin-top: 18px; }
.applicant-import-progress-track {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 20px;
  background: #e8edf5;
}
.applicant-import-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #2457d6;
  transition: width .2s ease;
}
.applicant-import-progress-label {
  margin-top: 8px;
  color: var(--text-muted, #65748a);
  font-size: .8rem;
}
.applicant-import-result {
  margin-top: 16px;
  padding: 15px;
  border: 1px solid #b9dfcc;
  border-radius: 12px;
  background: #f1faf5;
  color: #24543d;
  font-size: .84rem;
}
.applicant-import-result > strong { font-size: .98rem; }
.applicant-import-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.applicant-import-result-grid span {
  padding: 10px;
  border: 1px solid #d2e9dc;
  border-radius: 9px;
  background: #fff;
  color: #4a6255;
  font-size: .75rem;
}
.applicant-import-result-grid b {
  display: block;
  margin-bottom: 2px;
  color: #17633d;
  font-size: 1.15rem;
}
.applicant-import-result p { margin: 8px 0 0; }
.applicant-import-result details { margin-top: 10px; }
.applicant-import-result summary { cursor: pointer; font-weight: 800; }
.applicant-import-result ul { max-height: 140px; overflow: auto; padding-left: 18px; }
.applicant-import-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px 26px;
  border-top: 1px solid var(--border, #e4eaf2);
  background: var(--surface, #fff);
}
@media (max-width: 720px) {
  .applicant-import-overlay { align-items: flex-end; padding: 0; }
  .applicant-import-modal {
    width: 100%;
    max-height: 94dvh;
    border-radius: 18px 18px 0 0;
  }
  .applicant-import-header { padding: 18px 17px 14px; }
  .applicant-import-body { padding: 15px 17px 20px; }
  .applicant-import-footer { padding: 12px 17px calc(12px + env(safe-area-inset-bottom)); }
  .applicant-import-map-list { grid-template-columns: 1fr; }
  .applicant-import-result-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 420px) {
  .applicant-import-map-row { grid-template-columns: 1fr; gap: 6px; }
  .applicant-import-result-grid { grid-template-columns: 1fr; }
}


.applicant-import-date-format {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--border, #e1e8f0);
  border-radius: 10px;
  background: var(--surface-soft, #f8faff);
}
.applicant-import-date-format span {
  color: var(--text, #33465f);
  font-size: .8rem;
  font-weight: 700;
}
.applicant-import-date-format select {
  width: min(360px, 55%);
  min-height: 36px;
  padding: 6px 9px;
  border: 1px solid var(--border, #d7e0eb);
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--text, #23364e);
  font-size: .78rem;
}
.applicant-import-summary-duplicate {
  color: #a65b08;
  font-size: .78rem;
  font-weight: 700;
}
