/* Styles for the Application Statuses tab on lrs.html.
   Note: the global .btn rule in style.css adds a peach :before bubble and
   27px left-margin to every Bootstrap button. We avoid the .btn class
   inside this tab and use custom classes (.doc-link, .pager-chevron). */

/* -------- Tabs (centered + enhanced) ------------------------------------ */
.lrs-tabs {
  border-bottom: 2px solid #e5e9ef;
  gap: 4px;
}
.lrs-tabs .nav-item { margin-bottom: -2px; }
.lrs-tabs .nav-link {
  color: #5f6c7b;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .2px;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 14px 28px;
  background: transparent;
  border-radius: 8px 8px 0 0;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.lrs-tabs .nav-link i { color: inherit; }
.lrs-tabs .nav-link:hover {
  color: #1565c0;
  background: rgba(21, 101, 192, 0.05);
}
.lrs-tabs .nav-link.active {
  color: #1565c0;
  border-bottom-color: #1565c0;
  background: rgba(21, 101, 192, 0.06);
}

/* -------- Grouped stat cards -------------------------------------------- */
.group-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  border: 1px solid #eef1f5;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.group-card-header {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: #fff;
  padding: 10px 18px;
  background: linear-gradient(135deg, #455a64 0%, #607d8b 100%);
}
.group-card.group-overview   .group-card-header { background: linear-gradient(135deg, #1565c0 0%, #1e88e5 100%); }
.group-card.group-completed  .group-card-header { background: linear-gradient(135deg, #2e7d32 0%, #43a047 100%); }
.group-card.group-inprogress .group-card-header { background: linear-gradient(135deg, #ef6c00 0%, #fb8c00 100%); }

.group-card-body {
  padding: 8px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.group-card .metric {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid #f1f4f8;
  transition: background .15s ease, box-shadow .15s ease;
}
.group-card .metric:last-child { border-bottom: none; }
.group-card .metric.clickable {
  cursor: pointer;
  position: relative;
}
.group-card .metric.clickable:hover {
  background: #f8fafc;
}
.group-card .metric.clickable:focus-visible {
  outline: 2px solid #1565c0;
  outline-offset: -2px;
}
.group-card .metric.is-active {
  background: #e3f2fd;
}
.group-card .metric.is-active::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1565c0;
  transform: translateY(-50%);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.18);
}

.group-card .metric-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  background: #eceff1;
  color: #455a64;
  flex-shrink: 0;
}
.group-card .metric-body { min-width: 0; flex: 1; }
.group-card .metric-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  color: #1f2937;
}
.group-card .metric-label {
  font-size: 12.5px;
  color: #64748b;
  margin-top: 3px;
}

/* Tints per metric (icon-only color) */
.metric.tint-total     .metric-icon { background: #e3f2fd; color: #1565c0; }
.metric.tint-rate      .metric-icon { background: #e0f7fa; color: #00838f; }
.metric.tint-district  .metric-icon { background: #e8eaf6; color: #283593; }
.metric.tint-approved  .metric-icon { background: #e8f5e9; color: #2e7d32; }
.metric.tint-rejected  .metric-icon { background: #ffebee; color: #c62828; }
.metric.tint-shortfall .metric-icon { background: #fff3e0; color: #ef6c00; }
.metric.tint-fee       .metric-icon { background: #f3e5f5; color: #6a1b9a; }
.metric.tint-pending   .metric-icon { background: #eeeeee; color: #424242; }

/* -------- Search bar ---------------------------------------------------- */
.applicant-search-bar .input-group-text {
  background: #f5f7fa;
  color: #455a64;
  border-right: none;
}
.applicant-search-bar .form-control {
  border-left: none;
}
.applicant-search-bar .form-control:focus {
  box-shadow: none;
  border-color: #ced4da;
}

/* Export Excel button (sits to the right of the search field).
   Custom class — NOT .btn — to bypass the global :before bubble. */
button.applicant-export-btn,
.applicant-export-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 10px 20px !important;
  margin: 0 !important;
  font-family: inherit !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  letter-spacing: 0.3px !important;
  text-transform: none !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, #1e7e34 0%, #28a745 100%) !important;
  border: 1px solid #1e7e34 !important;
  border-left: none !important;
  border-radius: 0 6px 6px 0 !important;
  box-shadow: 0 1px 3px rgba(40, 167, 69, 0.25) !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  outline: none !important;
  position: relative;
  z-index: 1;
  transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
}
.applicant-export-btn:hover,
.applicant-export-btn:focus {
  background: linear-gradient(135deg, #166528 0%, #1e7e34 100%) !important;
  box-shadow: 0 3px 10px rgba(40, 167, 69, 0.45) !important;
  color: #ffffff !important;
}
.applicant-export-btn:active { transform: translateY(1px); }
.applicant-export-btn i {
  font-size: 15px !important;
  color: #ffffff !important;
  opacity: 1 !important;
}
.applicant-export-btn span {
  color: #ffffff !important;
  font-weight: 700 !important;
}
.applicant-export-btn[disabled] { opacity: 0.6; cursor: not-allowed; }
/* Belt-and-braces: kill any pseudo decoration the global .btn rule might add */
.applicant-export-btn::before,
.applicant-export-btn::after { content: none !important; background: none !important; }

@media (max-width: 575.98px) {
  .applicant-search-bar .input-group { flex-wrap: wrap; }
  .applicant-export-btn {
    border-left: 1px solid #1e7e34 !important;
    border-radius: 6px !important;
    margin-top: 8px !important;
    width: 100% !important;
  }
}

/* -------- Grid ---------------------------------------------------------- */
.applicant-grid thead { background: #f5f7fa; }
.applicant-grid th {
  font-size: 13px;
  font-weight: 600;
  color: #37474f;
  vertical-align: middle;
}
.applicant-grid td {
  font-size: 13px;
  vertical-align: middle;
}
.applicant-grid .app-no {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  font-size: 12px;
}
.applicant-grid .app-loc { font-size: 11px; }

/* Status pill */
.status-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eceff1;
  color: #455a64;
  white-space: nowrap;
}
.pill-card-approved  { background: #e8f5e9; color: #2e7d32; }
.pill-card-shortfall { background: #fff3e0; color: #ef6c00; }
.pill-card-rejected  { background: #ffebee; color: #c62828; }
.pill-card-fee       { background: #f3e5f5; color: #6a1b9a; }
.pill-card-pending   { background: #eeeeee; color: #424242; }

/* Document link — plain text link with external icon (NOT .btn) */
.applicant-grid .doc-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  color: #1565c0;
  white-space: nowrap;
  cursor: pointer;
  margin: 0 !important; /* defensively neutralize .btn margin if it leaks */
  padding: 0;
  background: transparent;
  border: none;
  transition: color .15s ease;
}
.applicant-grid .doc-link:hover,
.applicant-grid .doc-link:focus {
  color: #0d47a1;
  text-decoration: underline;
}
.applicant-grid .doc-link i {
  font-size: 10px;
  opacity: 0.75;
}
/* Defensive: ensure no global .btn pseudo decoration leaks in */
.applicant-grid .doc-link::before,
.applicant-grid .doc-link::after { content: none !important; }

/* -------- Pagination (matches IPLP tab style) --------------------------- */
.applicant-pager label { color: #455a64; font-size: 13px; }
.applicant-pager .form-select { font-size: 13px; }
.applicant-pager .pager-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  color: #455a64;
  background: #fff;
  border: 1px solid #cfd8dc;
  cursor: pointer;
  user-select: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.applicant-pager .pager-chevron:hover {
  background: #eceff1;
  color: #1565c0;
  border-color: #b0bec5;
}
.applicant-pager .pager-chevron.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}
.applicant-pager #applicant-page-info {
  font-size: 13px;
  font-weight: 600;
  color: #37474f;
}
.applicant-pager #applicant-total {
  font-size: 13px;
}

/* -------- Active-filter chip ------------------------------------------- */
.applicant-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 14px;
  background: #e3f2fd;
  border: 1px solid #bbdefb;
  border-radius: 999px;
  font-size: 13px;
  color: #0d47a1;
}
.applicant-filter-chip[hidden] { display: none; }
.applicant-filter-chip .chip-label {
  font-weight: 500;
  color: #455a64;
}
.applicant-filter-chip .chip-value {
  font-weight: 700;
}
.applicant-filter-chip .chip-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #1565c0;
  color: #fff;
  border: none;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  margin: 0 !important; /* defend against .btn leak */
  transition: background .15s ease;
}
.applicant-filter-chip .chip-clear:hover { background: #0d47a1; }
.applicant-filter-chip .chip-clear::before,
.applicant-filter-chip .chip-clear::after { content: none !important; }
