/* ============================================================================
   HR — Employee Directory
   [2026-08-30] Redesigned. The page was never slow after the scope fix earlier
   today (191ms TTFB, 1.0s complete); what was wrong was what each card SHOWED.

   The old card printed eight label:value rows per person — including
   "Folder: employees/employee_EMP-0025/", a filesystem path, and the login
   email. Those are a developer's details on an HR manager's screen. Thirty of
   them stacked 250px tall each is a wall of text to scan for one name.

   The job of this page is one thing: find a person, then open one of two
   things about them — their intake form or their documents. Everything here
   serves that and nothing else. The card is now a name, what they do, and the
   two links, at roughly half the height.

   Grouped by campaign (Life / Credit) because Omnitel runs two and the HR
   manager thinks in those terms.

   Light-only, matching the rest of the platform — there is no dark theme and
   no :root token layer in this codebase, so colours are literal here by
   convention, not by oversight.
   ========================================================================== */

.hr-employees-page {
  display: grid;
  gap: 18px;
}

.hr-employees-page .hre-header,
.hr-employees-page .hre-toolbar,
.hr-employees-page .hre-card,
.hr-employees-page .hre-empty {
  margin-bottom: 0;
}

.hr-employees-page .hre-header,
.hr-employees-page .hre-toolbar {
  border-radius: 18px;
  padding: 22px 22px 20px;
}

.hr-employees-page .hre-kicker {
  font-size: 14px;
  font-weight: 600;
  color: #1d4ed8;
  margin-bottom: 6px;
}

.hr-employees-page .hre-title {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.15;
}

.hr-employees-page .hre-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.hr-employees-page .hre-actions .btn {
  min-width: 180px;
  justify-content: center;
}

/* --- toolbar: search carries the page, so give it the room ---------------- */

.hr-employees-page .hre-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px;
}

.hr-employees-page .hre-toolbar .input {
  flex: 1 1 260px;
  min-width: 0;
  min-height: 44px;
  border-radius: 12px;
}

.hr-employees-page .hre-toolbar select.input {
  flex: 0 0 auto;
  min-width: 190px;
}

.hr-employees-page .hre-toolbar-hint {
  flex: 0 0 auto;
  margin-left: auto;
}

/* --- campaign sections --------------------------------------------------- */

.hr-employees-page .hre-section + .hre-section {
  margin-top: 26px;
}

.hr-employees-page .hre-section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 2px 12px;
}

.hr-employees-page .hre-section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #0f172a;
}

.hr-employees-page .hre-section-count {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.hr-employees-page .hre-section-rule {
  flex: 1 1 auto;
  height: 1px;
  background: #e2e8f0;
}

.hr-employees-page .hre-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  align-content: start;
}

/* --- the card ------------------------------------------------------------ */

.hr-employees-page .hre-card,
.hr-employees-page .hre-empty {
  border-radius: 14px;
  overflow: hidden;
}

.hr-employees-page .hre-card {
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "avatar identity"
    "links  links";
  column-gap: 12px;
  row-gap: 12px;
  align-items: start;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
  border: 1px solid #e8edf4;
  cursor: pointer;
  transition: border-color .13s ease, box-shadow .13s ease;
}

.hr-employees-page .hre-card:focus-visible,
.hr-employees-page .hre-card:hover {
  border-color: #bfd0ee;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
  outline: none;
}

.hr-employees-page .hre-card:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
}

/* Initials. Colour is derived from the name in PHP, so a given person keeps
   the same tile every visit — it becomes a position marker you can aim at
   rather than decoration. */
.hr-employees-page .hre-avatar {
  grid-area: avatar;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .02em;
  user-select: none;
}

.hr-employees-page .hre-identity {
  grid-area: identity;
  min-width: 0;
}

.hr-employees-page .hre-card-name {
  margin: 0 0 3px;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 700;
  color: #0f172a;
  overflow-wrap: anywhere;
}

/* What the person does — the only description the page needs. */
.hr-employees-page .hre-role {
  font-size: 13px;
  line-height: 1.35;
  color: #475569;
}

.hr-employees-page .hre-sub {
  margin-top: 3px;
  font-size: 11px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

/* Active is the normal case and says nothing worth a badge. Only the
   exceptions get one. */
.hr-employees-page .hre-flag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  margin-top: 6px;
  margin-right: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hr-employees-page .hre-flag.is-inactive {
  background: #fee2e2;
  color: #991b1b;
}

.hr-employees-page .hre-flag.is-review {
  background: #fef3c7;
  color: #92400e;
}

.hr-employees-page .hre-flag.is-joined {
  background: #e0e7ff;
  color: #3730a3;
}

/* --- the two links ------------------------------------------------------- */

.hr-employees-page .hre-card-actions {
  grid-area: links;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 11px;
  border-top: 1px solid #eef2f7;
}

.hr-employees-page .hre-card-actions .btn {
  flex: 1 1 0;
  min-width: 108px;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

/* Destructive controls are rare, gated, and must never sit level with the two
   links someone clicks all day. */
.hr-employees-page .hre-danger {
  flex: 1 1 100%;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hr-employees-page .hre-danger button {
  background: none;
  border: 0;
  padding: 2px 0;
  font-size: 11px;
  font-weight: 700;
  color: #b91c1c;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hr-employees-page .hre-danger button:hover {
  color: #7f1d1d;
}

/* --- empty states -------------------------------------------------------- */

.hr-employees-page .hre-empty {
  padding: 18px;
  color: #64748b;
  font-size: 13px;
  border: 1px dashed #cbd5e1;
  box-shadow: none;
}

.hr-employees-page .hre-no-match {
  display: none;
  grid-column: 1 / -1;
}

@media (max-width: 720px) {
  .hr-employees-page .hre-header,
  .hr-employees-page .hre-toolbar,
  .hr-employees-page .hre-card {
    padding: 14px;
  }

  .hr-employees-page .hre-grid {
    grid-template-columns: 1fr;
  }

  .hr-employees-page .hre-toolbar-hint {
    display: none;
  }

  .hr-employees-page .hre-actions .btn {
    width: 100%;
    flex-basis: 100%;
  }
}

/* [2026-08-30] The employee you just created. Landing on the directory after an
   intake without this leaves you scanning forty near-identical cards for the one
   person you care about. The marker fades on its own — it answers "where is
   she?" once, then stops being noise on every later visit. */
.hr-employees-page .hre-created-banner {
  border-radius: 12px;
  padding: 14px 18px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 14px;
}

.hr-employees-page .hre-card.is-just-added {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .18);
}

/* [2026-08-30] The highlight does NOT fade. It first ran for six seconds and had
   already expired before anyone looked at it — which defeats the one thing it is
   for. It stays for the visit and is gone on the next load, because the marker
   comes from the ?new= parameter rather than any stored state. */
.hr-employees-page .hre-card.is-just-added .hre-card-name::after {
  content: "RECIÉN AGREGADO";
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
  vertical-align: middle;
  white-space: nowrap;
}

html[lang="en"] .hr-employees-page .hre-card.is-just-added .hre-card-name::after {
  content: "JUST ADDED";
}
