/* ==========================================================================
   RHumma — theme.css
   Tokens y componentes del header, menú lateral y footer.
   El modo oscuro reutiliza el motor ya incluido en el template (Qompac UI):
   window.IQSetting.theme_scheme('dark') agrega la clase `dark` a <body>,
   la misma que activa dark.min.css para el resto de la aplicación. Aquí solo
   se definen los tokens/estilos para los componentes nuevos (rh-*).
   ========================================================================== */

/* Sobreescribe el "primary" de Bootstrap/Qompac UI (venía en morado #7016d0)
   para que todo lo que ya usa var(--bs-primary...) en el template base
   (fuera de los componentes rh-*) también siga el verde de marca.
   !important: el template (setting-init.js) guarda el color del tema en localStorage
   y lo aplica como estilo en línea en <html>; sin esto, quien ya tenía guardado el
   morado lo seguiría viendo. */
:root {
  --bs-primary: #34A853 !important;
  --bs-primary-rgb: 52, 168, 83 !important;
  --bs-primary-tint-20: #5DB975 !important;
  --bs-primary-tint-40: #85CB98 !important;
  --bs-primary-tint-60: #AEDCBA !important;
  --bs-primary-tint-80: #D6EEDD !important;
  --bs-primary-tint-90: #EBF6EE !important;
  --bs-primary-shade-20: #2A8642 !important;
  --bs-primary-shade-40: #1F6532 !important;
  --bs-primary-shade-60: #154321 !important;
  --bs-primary-shade-80: #0A2211 !important;
}

:root {
  --rh-header-h: 68px;
  --rh-sidebar-w: 260px;
  --rh-radius: 10px;

  --rh-bg: #F4F7F7;
  --rh-surface: #FFFFFF;
  --rh-surface-2: #EEF2F2;
  --rh-ink: #16262A;
  --rh-ink-muted: #5B6E71;
  --rh-ink-faint: #5F7476; /* 4.95:1 en blanco, 4.59:1 en el fondo */
  --rh-border: #DEE6E6;
  --rh-border-strong: #C7D3D3;

  --rh-accent: #34A853;
  --rh-accent-ink: #1E7A3C;
  --rh-accent-soft: #E6F4EA;
  --rh-header-strong: var(--rh-surface);
  --rh-highlight: #C9862B;
  --rh-highlight-soft: #F6E8D3;

  --rh-success: #2E8F5C;
  --rh-success-soft: #E1F1E8;
  --rh-warning: #C97B1D;
  --rh-warning-soft: #F8ECD9;
  --rh-warning-ink: #8A4F0C; /* texto ámbar sobre warning-soft: 5.6:1 */
  --rh-danger: #C4433D;
  --rh-danger-soft: #FBE7E5;

  /* Series de gráficas (validadas para daltonismo y contraste en claro y oscuro) */
  --rh-series-faltas: #EB6834;
  --rh-series-vacaciones: #2A78D6;
  --rh-series-sueldo: #34A853;
  --rh-series-destajo: #4A3AA7;
  --rh-series-bonos: #EDA100;
  --rh-series-extras: #E87BA4;
  --rh-series-sin-dato: #B5C3C3;
  --rh-series-ley: #5B6E71;
  --rh-series-prestamos: #C9862B;
  /* Motivos de falta: escala de naranja (del más al menos frecuente) + neutro para "Otras" */
  --rh-motivo-1: #D9542A;
  --rh-motivo-2: #EF8F5C;
  --rh-motivo-3: #F5BE96;
  --rh-motivo-4: #A8573A;
  --rh-motivo-otras: #D6CCC4;
  /* Áreas en "Empleados por subárea" (de la más a la menos numerosa) + neutro para el resto/"Sin área" */
  --rh-area-1: #2E8F5C;
  --rh-area-2: #C9862B;
  --rh-area-3: #2A78D6;
  --rh-area-4: #8A5CC7;
  --rh-area-5: #1F8A8A;
  --rh-area-otras: #B5C3C3;

  --rh-shadow-sm: 0 1px 2px rgba(15, 35, 38, .06);
  --rh-shadow-md: 0 8px 24px -8px rgba(15, 35, 38, .18);
}

body.dark {
  --rh-bg: #0D1719;
  --rh-surface: #132224;
  --rh-surface-2: #16282B;
  --rh-ink: #E9F1F1;
  --rh-ink-muted: #9BB1B3;
  --rh-ink-faint: #839A9C; /* 5.5:1 en superficie oscura */
  --rh-border: #223638;
  --rh-border-strong: #2C4244;

  --rh-accent: #5FBE85;
  --rh-accent-ink: #B8E6C3;
  --rh-accent-soft: #163B24;
  --rh-header-strong: var(--rh-surface);
  --rh-highlight: #E3A64C;
  --rh-highlight-soft: #3A2C14;

  --rh-success: #4CBE84;
  --rh-success-soft: #163524;
  --rh-warning: #E3A64C;
  --rh-warning-soft: #3A2C14;
  --rh-warning-ink: #F0C27A;
  --rh-danger: #E17168;
  --rh-danger-soft: #3A1D1B;

  --rh-series-faltas: #D95926;
  --rh-series-vacaciones: #3987E5;
  --rh-series-sueldo: #44A56F;
  --rh-series-destajo: #9085E9;
  --rh-series-bonos: #C98500;
  --rh-series-extras: #D55181;
  --rh-series-sin-dato: #3F5557;
  --rh-series-ley: #9BB1B3;
  --rh-series-prestamos: #E3A64C;
  --rh-motivo-1: #E8693A;
  --rh-motivo-2: #B8633A;
  --rh-motivo-3: #8A5438;
  --rh-motivo-4: #F0A27A;
  --rh-motivo-otras: #5E5048;
  --rh-area-1: #4CBE84;
  --rh-area-2: #E3A64C;
  --rh-area-3: #3987E5;
  --rh-area-4: #A98BE3;
  --rh-area-5: #3FB5B5;
  --rh-area-otras: #3F5557;

  --rh-shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --rh-shadow-md: 0 12px 28px -10px rgba(0, 0, 0, .55);
}

/* ---------------- Shell / grid ---------------- */
/* Escritorio (>= 1200px): menú fijo a la izquierda, contraíble a íconos (body.rh-menu-min).
   Tableta y celular: el menú es un cajón que abre la hamburguesa (body.rh-menu-open). */
.rh-shell {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: var(--rh-header-h) auto;
  grid-template-areas:
    "header"
    "main";
  min-height: 100vh;
  background: var(--rh-bg);
}

/* Saltar al contenido: visible solo al enfocarlo con teclado */
.rh-skip {
  position: fixed; left: 12px; top: -60px; z-index: 2000;
  padding: 8px 14px; border-radius: 8px;
  background: var(--rh-surface); color: var(--rh-ink); box-shadow: var(--rh-shadow-md);
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.rh-skip:focus { top: 12px; }

/* ---------------- Menú lateral ---------------- */
.rh-sidebar {
  grid-area: sidebar;
  background: var(--rh-surface);
  /* Borde derecho con sombra interior: el encabezado (logo) lo tapa y se une con la barra superior sin línea */
  box-shadow: inset -1px 0 0 var(--rh-border);
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: fixed;
  left: 0;
  top: 0;
  width: var(--rh-sidebar-w);
  height: 100vh;
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform .2s ease, visibility .2s;
  z-index: 1030;
}
body.rh-menu-open .rh-sidebar { transform: translateX(0); visibility: visible; box-shadow: var(--rh-shadow-md); }
body.rh-menu-open::after {
  content: "";
  position: fixed; inset: 0; background: rgba(15, 25, 27, .45);
  z-index: 1025;
}
.rh-sidebar-head {
  height: var(--rh-header-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-bottom: 1px solid var(--rh-border);
  background: var(--rh-surface);
  text-decoration: none;
}
.rh-sidebar-brand { min-width: 0; }
.rh-mark {
  width: 32px; height: 32px; border-radius: 8px; flex: none;
  background: var(--rh-accent);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--bs-body-font-family, sans-serif); font-weight: 700; font-size: 15px;
}
.rh-brand-word { font-size: 17px; white-space: nowrap; color: var(--rh-accent-ink); font-family: var(--bs-body-font-family, sans-serif); font-weight: 600; line-height: 1.1; }
.rh-brand-sub { font-size: 11px; color: var(--rh-ink-faint); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.dark .rh-brand-word { color: #fff; }

.rh-sidebar-scroll { flex: 1 1 auto; overflow-y: auto; padding: 12px 10px 16px; scrollbar-width: thin; }
.rh-nav-lista { list-style: none; margin: 0; padding: 0; }
.rh-nav-group + .rh-nav-group, .rh-nav-group + .rh-nav-plegable { margin-top: 16px; }
.rh-nav-group-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--rh-ink-faint); padding: 0 10px 6px; font-weight: 700; white-space: nowrap;
}
.rh-nav-link {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 38px; padding: 0 10px; border: 0; border-radius: 8px;
  background: none; color: var(--rh-ink);
  text-decoration: none; text-align: left; font-size: 13.6px; font-weight: 500; white-space: nowrap; overflow: hidden;
  cursor: pointer;
}
.rh-nav-link svg { flex: none; width: 18px; height: 18px; color: var(--rh-ink-muted); }
.rh-nav-link:hover { background: var(--rh-surface-2); color: var(--rh-ink); }
.rh-nav-link.active { background: var(--rh-accent-soft); color: var(--rh-accent-ink); font-weight: 600; }
.rh-nav-link.active svg { color: var(--rh-accent-ink); }
body.dark .rh-nav-link { color: var(--rh-ink-muted); }
body.dark .rh-nav-link:hover { color: var(--rh-ink); }
body.dark .rh-nav-link.active { color: var(--rh-accent-ink); }
.rh-nav-texto { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rh-nav-link .rh-chip {
  margin-left: auto; min-width: 22px; text-align: center; font-size: 11px; font-weight: 700;
  color: var(--rh-warning-ink); background: var(--rh-warning-soft); padding: 1px 7px; border-radius: 999px;
}
.rh-nav-link.is-proximamente { color: var(--rh-ink-faint); cursor: default; }
.rh-nav-link.is-proximamente:hover { background: none; }
.rh-nav-pronto { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--rh-ink-faint); }

/* Catálogos y administración: grupo plegable */
.rh-nav-plegable { margin-top: 16px; }
.rh-nav-plegable > summary { list-style: none; }
.rh-nav-plegable > summary::-webkit-details-marker { display: none; }
.rh-nav-flecha { margin-left: auto; width: 15px !important; height: 15px !important; transition: transform .15s ease; }
.rh-nav-plegable[open] .rh-nav-flecha { transform: rotate(90deg); }
.rh-nav-sublista { padding-left: 30px; }
.rh-nav-sublista .rh-nav-link { min-height: 34px; font-size: 13.2px; }

.rh-sidebar-foot { border-top: 1px solid var(--rh-border); padding: 8px 10px; flex: none; display: none; }
/* Contraer menú: botón destacado para que no se pierda al fondo del menú */
.rh-nav-link.rh-sidebar-contraer {
  justify-content: center; border: 1px solid color-mix(in srgb, var(--rh-accent) 35%, transparent);
  background: var(--rh-accent-soft); color: var(--rh-accent-ink); font-weight: 600;
}
.rh-nav-link.rh-sidebar-contraer svg { color: var(--rh-accent-ink); transition: transform .15s ease; }
.rh-nav-link.rh-sidebar-contraer:hover { background: color-mix(in srgb, var(--rh-accent) 22%, var(--rh-surface)); color: var(--rh-accent-ink); }

.rh-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--rh-accent-soft); color: var(--rh-accent-ink);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12.5px;
}
.rh-user-meta { min-width: 0; }
.rh-user-meta .rh-name, .rh-panel-cuenta .rh-name { display: block; font-size: 12.8px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--rh-ink); }
.rh-user-meta .rh-role, .rh-panel-cuenta .rh-role { display: block; font-size: 11.5px; color: var(--rh-ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Escritorio: menú fijo y contraíble */
@media (min-width: 1200px) {
  .rh-shell {
    grid-template-columns: var(--rh-sidebar-w) minmax(0, 1fr);
    grid-template-areas:
      "sidebar header"
      "sidebar main";
    transition: grid-template-columns .18s ease;
  }
  .rh-sidebar { position: sticky; grid-row: 1 / span 2; transform: none; visibility: visible; transition: none; }
  body.rh-menu-open::after { display: none; }
  .rh-sidebar-foot { display: block; }
  .rh-topbar .rh-menu-toggle, .rh-topbar .rh-topbar-brand { display: none; }

  body.rh-menu-min .rh-shell { grid-template-columns: 68px minmax(0, 1fr); }
  body.rh-menu-min .rh-sidebar { width: 68px; }
  body.rh-menu-min .rh-sidebar-head { justify-content: center; padding: 0; }
  body.rh-menu-min .rh-sidebar-brand,
  body.rh-menu-min .rh-nav-group-label,
  body.rh-menu-min .rh-nav-texto,
  body.rh-menu-min .rh-nav-pronto,
  body.rh-menu-min .rh-nav-flecha,
  body.rh-menu-min .rh-nav-sublista { display: none; }
  body.rh-menu-min .rh-nav-link { justify-content: center; padding: 0; position: relative; }
  body.rh-menu-min .rh-nav-link .rh-chip { position: absolute; top: 2px; right: 4px; min-width: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; }
  body.rh-menu-min .rh-nav-group + .rh-nav-group,
  body.rh-menu-min .rh-nav-plegable { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--rh-border); }
  body.rh-menu-min .rh-sidebar-contraer svg { transform: rotate(180deg); }
}

/* ---------------- Barra superior ---------------- */
.rh-topbar {
  grid-area: header;
  background: var(--rh-surface);
  border-bottom: 1px solid var(--rh-border);
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px;
  min-width: 0;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.rh-topbar-brand { display: flex; align-items: center; text-decoration: none; }

.rh-caret { width: 13px; height: 13px; color: var(--rh-ink-faint); flex: none; }

.rh-icon-btn {
  width: 40px; height: 40px; border-radius: 10px; border: 0;
  background: transparent; color: var(--rh-ink-muted);
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none;
  position: relative;
}
.rh-icon-btn:hover { background: var(--rh-surface-2); color: var(--rh-ink); }
.rh-icon-btn svg { width: 19px; height: 19px; }

/* Foco visible en todo el shell (antes no había) */
.rh-icon-btn:focus-visible, .rh-nav-link:focus-visible, .rh-topbar-user:focus-visible, .rh-sidebar-head:focus-visible,
.rh-topbar-brand:focus-visible, .rh-buscar-boton:focus-visible, .rh-panel-item:focus-visible, .rh-panel-pie:focus-visible,
.rh-paleta-item:focus-visible {
  outline: 2px solid var(--rh-accent); outline-offset: 2px;
}

/* Título de tarjeta que regresa a la pantalla principal del módulo */
.rh-title-link { color: inherit; text-decoration: none; }
.rh-title-link:hover, .rh-title-link:focus-visible { color: var(--rh-accent-ink); text-decoration: underline; text-underline-offset: 3px; }
body.dark .rh-title-link:hover, body.dark .rh-title-link:focus-visible { color: var(--rh-accent); }

/* Texto clicable que abre edición (ej. nombre en listas): se ve como enlace con lápiz */
.rh-edit-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 6px; margin: -2px -6px; border: 0; border-radius: 6px;
  background: transparent; color: var(--rh-accent-ink); font: inherit; font-weight: 600;
  text-align: left; cursor: pointer;
}
.rh-edit-link svg { width: 14px; height: 14px; flex: none; opacity: .45; transition: opacity .15s; }
.rh-edit-link:hover, .rh-edit-link:focus-visible {
  background: var(--rh-accent-soft); text-decoration: underline; text-underline-offset: 3px;
}
.rh-edit-link:hover svg, .rh-edit-link:focus-visible svg { opacity: 1; }
body.dark .rh-edit-link { color: var(--rh-accent); }

.rh-topbar-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
/* Campana en ámbar y tema en verde para que se distingan (como antes del rediseño) */
.rh-topbar .rh-bell { background: var(--rh-highlight-soft); color: var(--rh-warning-ink); }
.rh-topbar .rh-bell:hover { background: var(--rh-highlight-soft); color: var(--rh-warning-ink); filter: brightness(.96); }
.rh-topbar .rh-theme-toggle { background: var(--rh-accent-soft); color: var(--rh-accent-ink); }
.rh-topbar .rh-theme-toggle:hover { background: var(--rh-accent-soft); color: var(--rh-accent-ink); filter: brightness(.96); }
.rh-topbar .rh-bell .rh-badge-count { border-color: var(--rh-surface); }
@media (max-width: 575.98px) {
  /* Celular: el acceso a Plantilla laboral ya está en el menú */
  .rh-topbar-right > a.rh-icon-btn, .rh-topbar .rh-divider-v { display: none; }
}
.rh-divider-v { width: 1px; align-self: stretch; margin: 8px 4px; background: var(--rh-border); }
.rh-badge-dot {
  position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--rh-danger); border: 1.5px solid var(--rh-surface);
}
.rh-topbar-user {
  display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; border: 0; border-radius: 10px;
  background: none; cursor: pointer; text-decoration: none; color: inherit; text-align: left;
}
.rh-topbar-user:hover { background: var(--rh-surface-2); }

/* ---------------- Loader inicial de página ---------------- */
/* El markup/estilos base (#loading > .loader.simple-loader > .loader-body) son
   del template (qompac-ui.css) y se dejan igual -- aquí solo se sobreescribe el
   color de fondo y se reemplaza el logo morado genérico por la marca rh-*.
   Se antepone #loading para ganarle en especificidad a esas reglas sin tener
   que tocar el CSS del vendor. */
#loading .loader.simple-loader { background: var(--rh-bg); }
.rh-loader-badge { position: relative; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; }
.rh-loader-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--rh-accent-soft);
  border-top-color: var(--rh-accent);
  animation: rh-loader-spin .8s linear infinite;
}
.rh-loader-mark {
  width: 36px; height: 36px; border-radius: 9px; background: var(--rh-accent);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--bs-body-font-family, sans-serif); font-weight: 700; font-size: 15px;
}
@keyframes rh-loader-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .rh-loader-ring { animation: none; }
}

/* ---------------- Main content ---------------- */
.rh-main { grid-area: main; min-width: 0; }
.rh-main:focus { outline: none; }

@media (max-width: 991.98px) {
  .rh-topbar-user .rh-user-meta, .rh-topbar-user .rh-caret { display: none; }
}
@media (max-width: 575.98px) {
  .rh-topbar { gap: 4px; padding: 0 10px; }
  .rh-icon-btn { width: 44px; height: 44px; }
  .rh-topbar-user { padding: 4px; }
  .rh-topbar-user .rh-avatar { width: 36px; height: 36px; }
}

/* ==========================================================================
   Componentes de módulo: tarjetas, tablas, pills, botones, modal
   Reutilizables en cualquier catálogo/listado (Puestos, Áreas, etc.)
   ========================================================================== */

/* ---------------- Card ---------------- */
.rh-card {
  background: var(--rh-surface);
  border: 1px solid var(--rh-border);
  border-radius: var(--rh-radius);
  box-shadow: var(--rh-shadow-sm);
  overflow: hidden;
}
.rh-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--rh-border);
  flex-wrap: wrap;
}
.rh-card-head h1, .rh-card-head h2, .rh-card-head h4 {
  margin: 0; font-size: 18px; color: var(--rh-ink);
  font-family: var(--bs-body-font-family, sans-serif); font-weight: 600;
}
/* Variante para cabeceras de sub-secciones dentro de un mismo formulario/página
   (ej. los grupos de campos de empleado-info-general): más chica y con fondo
   suave para diferenciarla de un título de página como .rh-card-head normal. */
.rh-card-head-compact {
  padding: 12px 20px;
  background: var(--rh-surface-2);
}
.rh-card-head-compact h2, .rh-card-head-compact h4 {
  font-size: 13.5px;
}
.rh-card-body { padding: 20px; }

.rh-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------------- Search ---------------- */
.rh-search-box {
  display: flex; align-items: center; gap: 7px;
  border-bottom: 1px solid var(--rh-border-strong);
  padding: 5px 2px;
  color: var(--rh-ink-faint);
  min-width: 220px;
  transition: border-color .12s ease;
}
.rh-search-box:focus-within { border-bottom-color: var(--rh-accent); color: var(--rh-accent); }
.rh-search-box svg { width: 16px; height: 16px; flex: none; }
.rh-search-input {
  border: 0; background: transparent; outline: 0; color: var(--rh-ink);
  font-size: 13.3px; width: 100%;
}
.rh-search-input::placeholder { color: var(--rh-ink-faint); }

/* ---------------- Buttons ---------------- */
.rh-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid transparent;
  font-size: 13.3px; font-weight: 600; line-height: 1.2; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: filter .12s ease, background-color .12s ease;
}
.rh-btn svg { width: 15px; height: 15px; flex: none; }
.rh-btn:focus-visible { outline: 2px solid var(--rh-accent); outline-offset: 2px; }

.rh-btn-primary { background: var(--rh-accent); color: #fff; }
.rh-btn-primary:hover { filter: brightness(1.08); color: #fff; }

.rh-btn-secondary { background: var(--rh-surface); color: var(--rh-ink-muted); border-color: var(--rh-border-strong); }
.rh-btn-secondary:hover { background: var(--rh-surface-2); color: var(--rh-ink); }

.rh-btn-danger-soft { background: var(--rh-danger-soft); color: var(--rh-danger); }
.rh-btn-danger-soft:hover { filter: brightness(0.97); color: var(--rh-danger); }

.rh-btn-danger { background: var(--rh-danger); color: #fff; }
.rh-btn-danger:hover { filter: brightness(1.08); color: #fff; }

.rh-btn-sm { padding: 6px 12px; font-size: 12.5px; }

/* ---------------- Table ---------------- */
.rh-table-wrap { overflow-x: auto; }

/* Deja que el dropdown de una fila se salga del recorte de la tarjeta/tabla mientras está abierto */
.rh-table-wrap:has(.dropdown-menu.show),
.rh-card:has(.dropdown-menu.show) { overflow: visible; }
.dropdown-menu.show { z-index: 1090; }

/* Igual que arriba, pero para el <x-popover> (ej. confirmación de eliminar en Referencias):
   .rh-card tiene overflow:hidden para las esquinas redondeadas, y eso recorta el popover
   flotante si no se libera mientras está abierto. */
.rh-card:has(.rh-popover) { overflow: visible; }
.rh-table-wrap:has(.rh-popover) { overflow: visible; }
.rh-table { width: 100%; border-collapse: collapse; font-size: 13.3px; }
.rh-table thead th {
  text-align: left; font-size: 10.8px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--rh-ink-muted); font-weight: 700; padding: 11px 18px;
  background: var(--rh-surface-2); border-bottom: 1px solid var(--rh-border); white-space: nowrap;
}
.rh-table tbody td { padding: 12px 18px; border-bottom: 1px solid var(--rh-border); color: var(--rh-ink); vertical-align: middle; }
.rh-table tbody tr:last-child td { border-bottom: 0; }
.rh-table tbody tr:hover td { background: var(--rh-surface-2); }
.rh-table .rh-col-id { color: var(--rh-ink-faint); font-variant-numeric: tabular-nums; width: 1%; }
.rh-table .rh-col-actions { text-align: right; white-space: nowrap; width: 1%; }
.rh-table .rh-col-actions .rh-btn + .rh-btn { margin-left: 6px; }

/* Encabezados ordenables */
.rh-table th.is-sortable { cursor: pointer; user-select: none; }
.rh-table th.is-sortable:hover { color: var(--rh-ink); }
.rh-table th.is-sortable .rh-sort-icon { display: inline-block; width: 10px; opacity: .35; margin-left: 2px; }
.rh-table th.is-sortable.is-sorted .rh-sort-icon { opacity: 1; color: var(--rh-accent); }

/* Primera columna fija al hacer scroll horizontal */
.rh-table .rh-col-sticky {
  position: sticky; left: 0; z-index: 1;
  background: var(--rh-surface);
  box-shadow: 1px 0 0 0 var(--rh-border);
}
.rh-table thead th.rh-col-sticky { background: var(--rh-surface-2); z-index: 2; }
.rh-table tbody tr:hover td.rh-col-sticky { background: var(--rh-surface-2); }

/* Atenúa la tabla mientras hay una request en curso (búsqueda / filtro / orden / paginación) */
.rh-table-wrap { transition: opacity .1s ease; }
.rh-table-dim { opacity: .45; pointer-events: none; }

.rh-icon-btn-sm { width: 28px; height: 28px; border-radius: 7px; }
.rh-icon-btn-sm svg { width: 15px; height: 15px; }

/* ---------------- Pills ---------------- */
.rh-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.3px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}
.rh-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.rh-pill-success { background: var(--rh-success-soft); color: var(--rh-success); }
.rh-pill-neutral { background: var(--rh-surface-2); color: var(--rh-ink-faint); }
.rh-pill-warning { background: var(--rh-warning-soft); color: var(--rh-warning); }
.rh-pill-danger { background: var(--rh-danger-soft); color: var(--rh-danger); }

/* ---------------- Lista de contactos (referencias de empleado) ---------------- */
.rh-ref-list { display: flex; flex-direction: column; }
.rh-ref-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px; border-bottom: 1px solid var(--rh-border);
}
.rh-ref-row:last-child { border-bottom: 0; }
.rh-ref-info { min-width: 0; flex: 1 1 auto; }
.rh-ref-name {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13.6px; font-weight: 600; color: var(--rh-ink);
}
.rh-ref-tag {
  font-size: 10.8px; font-weight: 700; color: var(--rh-ink-faint);
  background: var(--rh-surface-2); padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.rh-ref-contact {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 3px;
  font-size: 12px; color: var(--rh-ink-muted);
}
.rh-ref-contact span { display: inline-flex; align-items: center; gap: 5px; }
.rh-ref-contact svg { width: 13px; height: 13px; color: var(--rh-ink-faint); flex: none; }
.rh-ref-actions { display: flex; align-items: center; gap: 4px; flex: none; }

/* ---------------- Saludo / encabezado de dashboard ---------------- */
.rh-greet { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.rh-greet-eyebrow { font-size: 11.5px; color: var(--rh-ink-faint); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.rh-greet-title { font-size: 20px; font-weight: 700; color: var(--rh-ink); margin: 0; font-family: var(--bs-body-font-family, sans-serif); }

/* ---------------- Barras horizontales de ranking (ej. empleados por área) ---------------- */
.rh-bar-list { display: flex; flex-direction: column; gap: 9px; }
.rh-bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 42px; align-items: center; gap: 10px; }
.rh-bar-row-label { font-size: 12.3px; color: var(--rh-ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rh-bar-track { height: 8px; border-radius: 5px; background: var(--rh-surface-2); overflow: hidden; }
.rh-bar-fill { display: block; height: 100%; border-radius: 5px; background: var(--rh-accent); }
.rh-bar-row-value { font-size: 12.5px; font-weight: 700; color: var(--rh-ink); text-align: right; font-variant-numeric: tabular-nums; }

/* Barras agrupadas por área (ej. empleados por subárea en el dashboard) */
.rh-bar-group { display: flex; flex-direction: column; gap: 7px; }
.rh-bar-group + .rh-bar-group { border-top: 1px solid var(--rh-border); padding-top: 9px; }
.rh-bar-group-head { display: flex; justify-content: space-between; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--rh-ink); }
.rh-bar-group-head span:last-child { color: var(--rh-ink-faint); font-variant-numeric: tabular-nums; }
.rh-bar-row-sub .rh-bar-row-label { padding-left: 10px; }
.rh-bar-row-muted .rh-bar-fill { background: var(--rh-border-strong); }

/* Subárea colapsable: la fila es un botón que muestra/oculta sus puestos */
.rh-bar-toggle { width: 100%; padding: 2px 0; margin: -2px 0; border: 0; background: none; text-align: left; font: inherit; cursor: pointer; border-radius: 5px; }
.rh-bar-toggle:hover .rh-bar-row-label { color: var(--rh-ink); }
.rh-bar-toggle:focus-visible { outline: 2px solid var(--rh-accent); outline-offset: 2px; }
.rh-bar-row-sub.rh-bar-toggle .rh-bar-row-label { padding-left: 0; display: flex; align-items: center; gap: 4px; }
.rh-bar-chevron { width: 12px; height: 12px; flex: none; color: var(--rh-ink-faint); transition: transform .15s ease; }
.rh-bar-chevron.is-open { transform: rotate(90deg); }
.rh-bar-sub-items { display: flex; flex-direction: column; gap: 6px; padding-top: 6px; }

/* Subárea > área > puesto: barra dividida por área, leyenda y bloques de puestos por área */
.rh-bar-track-segs { display: flex; }
.rh-bar-seg { display: block; height: 100%; flex: none; }
.rh-bar-seg + .rh-bar-seg { margin-left: 2px; }
.rh-bar-row-muted .rh-bar-seg { background: var(--rh-border-strong) !important; }
.rh-area-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 10px; font-size: 11.5px; color: var(--rh-ink-muted); }
.rh-area-legend span { display: inline-flex; align-items: center; gap: 5px; }
.rh-area-legend i, .rh-area-block-head i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; flex: none; }
.rh-area-blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; padding: 8px 0 4px 16px; }
.rh-area-block { border: 1px solid var(--rh-border); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rh-area-block-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--rh-ink); }
.rh-area-block-head span:first-child { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.rh-area-block-head span:last-child { color: var(--rh-ink-faint); font-variant-numeric: tabular-nums; }
.rh-area-block-row { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--rh-ink-muted); }
.rh-area-block-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-area-block-row b { font-weight: 600; color: var(--rh-ink); font-variant-numeric: tabular-nums; }

/* Puestos dentro de una subárea: más sangría, texto y barra más tenues */
.rh-bar-row-puesto { margin-top: -3px; }
.rh-bar-row-puesto .rh-bar-row-label { padding-left: 22px; font-size: 11.5px; color: var(--rh-ink-faint); }
.rh-bar-row-puesto .rh-bar-track { height: 5px; }
.rh-bar-row-puesto .rh-bar-fill { opacity: .45; }
.rh-bar-row-puesto .rh-bar-row-value { font-size: 11.5px; font-weight: 600; color: var(--rh-ink-muted); }

/* Desglose de motivos de falta bajo la gráfica de nómina y ausentismo */
.rh-motivos { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rh-border); display: flex; flex-direction: column; gap: 9px; }
.rh-motivos-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 10px; font-size: 12px; color: var(--rh-ink-muted); }
.rh-motivos-head b { color: var(--rh-ink); font-variant-numeric: tabular-nums; }
.rh-motivos-hint { font-size: 11px; color: var(--rh-ink-faint); }
.rh-motivos-bar { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; background: var(--rh-surface-2); }
.rh-motivos-bar span { display: block; height: 100%; flex-basis: 0; transition: flex-grow .2s ease; }
.rh-motivos-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px 12px; }
.rh-motivos-item { display: flex; flex-direction: column; gap: 1px; font-size: 11.5px; color: var(--rh-ink-muted); min-width: 0; }
.rh-motivos-item .rh-motivos-label { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rh-motivos-item i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.rh-motivos-item b { font-size: 15px; color: var(--rh-ink); font-variant-numeric: tabular-nums; }
.rh-motivos-item small { font-size: 11px; font-weight: 500; color: var(--rh-ink-faint); }
.rh-motivos-empty { font-size: 12px; color: var(--rh-ink-faint); }
@media (prefers-reduced-motion: reduce) { .rh-motivos-bar span { transition: none; } }

/* Leyenda de gráficas */
.rh-chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 8px; font-size: 12px; color: var(--rh-ink-muted); }
.rh-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rh-chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
/* ---------------- Dashboard: pestañas y pestaña "Nómina" ---------------- */
/* Pestañas a la derecha, en la misma fila del saludo (alineadas con el título) */
.rh-dash-tabs-wrap { display: flex; align-items: center; gap: 10px; align-self: flex-end; margin-left: auto; }
.rh-dash-tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--rh-border); }
.rh-dash-tab {
  background: transparent; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 8px 14px; font-size: 13.5px; font-weight: 600; color: var(--rh-ink-muted); cursor: pointer;
}
.rh-dash-tab:hover { color: var(--rh-ink); }
.rh-dash-tab.is-active { color: var(--rh-accent-ink); border-bottom-color: var(--rh-accent); }
.rh-dash-tab:focus-visible { outline: 2px solid var(--rh-accent); outline-offset: -2px; border-radius: 6px 6px 0 0; }
.rh-dash-loading { font-size: 12px; color: var(--rh-ink-faint); }

.rh-dash-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.rh-dash-toolbar-text { font-size: 13px; color: var(--rh-ink-muted); }
.rh-dash-range { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12.5px; color: var(--rh-ink-muted); }
.rh-dash-range select { width: auto; }

.rh-delta { display: block; font-size: 11px; font-weight: 600; color: var(--rh-ink-faint); font-variant-numeric: tabular-nums; margin-top: 2px; }
.rh-delta.is-good { color: var(--rh-success); }
.rh-delta.is-bad { color: var(--rh-danger); }

.rh-dash-alert { font-size: 12.5px; color: var(--rh-warning); background: var(--rh-warning-soft); border-radius: 8px; padding: 7px 11px; margin: -6px 0 16px; }
.rh-dash-meta { font-size: 11px; color: var(--rh-ink-faint); }
.rh-dash-hint { font-size: 12.5px; color: var(--rh-ink-muted); margin: 0 0 6px; }

.rh-dash-mini { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.rh-dash-mini > div { flex: 1 1 100px; border: 1px solid var(--rh-border); border-radius: 8px; padding: 6px 10px; }
.rh-dash-mini b, .rh-dash-ytd b { display: block; font-size: 16px; font-weight: 700; color: var(--rh-ink); font-variant-numeric: tabular-nums; }
.rh-dash-mini span, .rh-dash-ytd span { font-size: 11px; color: var(--rh-ink-muted); }
.rh-dash-ytd { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rh-dash-ytd > div { border: 1px solid var(--rh-border); border-radius: 8px; padding: 9px 12px; }
.rh-dash-ytd b { font-size: 18px; }

/* Tabla desplegable con los datos de una gráfica */
.rh-chart-table { margin-top: 12px; }
.rh-chart-table summary { cursor: pointer; font-size: 12.5px; color: var(--rh-ink-muted); width: fit-content; }
.rh-chart-table summary:hover { color: var(--rh-ink); }
.rh-chart-table summary:focus-visible { outline: 2px solid var(--rh-accent); outline-offset: 2px; border-radius: 4px; }
.rh-chart-table .rh-table-wrap { margin-top: 8px; }
.rh-chart-table .rh-table td { font-variant-numeric: tabular-nums; }

.rh-chart-legend i.rh-legend-line { width: 14px; height: 2px; border-radius: 2px; background: var(--rh-accent); }

/* ---------------- Stat cards ---------------- */
.rh-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 10px; margin-bottom: 18px; }
.rh-stat-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--rh-surface); border: 1px solid var(--rh-border); border-radius: var(--rh-radius);
  padding: 11px 13px; cursor: pointer; text-align: left;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.rh-stat-card:hover { box-shadow: var(--rh-shadow-md); transform: translateY(-2px); }
.rh-stat-card.active { border-color: var(--rh-stat-color, var(--rh-accent)); box-shadow: var(--rh-shadow-md); }
.rh-stat-icon {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--rh-stat-soft, var(--rh-accent-soft)); color: var(--rh-stat-color, var(--rh-accent));
}
.rh-stat-icon svg { width: 18px; height: 18px; }
.rh-stat-body { min-width: 0; flex: 1; }
.rh-stat-card .rh-stat-count { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; color: var(--rh-ink); }
.rh-stat-card .rh-stat-label {
  font-size: 11px; color: var(--rh-ink-muted); margin-top: 1px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------------- Periodo card ---------------- */
.rh-periodo-card.is-actual { box-shadow: 0 0 0 2px var(--rh-accent); }

.rh-add-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 100%; height: 100%; min-height: 96px;
  border: 1.5px dashed var(--rh-border-strong); border-radius: var(--rh-radius);
  background: transparent; color: var(--rh-ink-faint); cursor: pointer;
  font-size: 12px; font-weight: 600;
  transition: border-color .12s ease, color .12s ease;
}
.rh-add-tile:hover { border-color: var(--rh-accent); color: var(--rh-accent); }
.rh-add-tile svg { width: 20px; height: 20px; }

/* ---------------- Progress ---------------- */
.rh-progress { height: 6px; border-radius: 999px; background: var(--rh-surface-2); overflow: hidden; }
.rh-progress-bar { height: 100%; background: var(--rh-success); border-radius: 999px; transition: width .2s ease; }

/* ---------------- Empty state ---------------- */
.rh-empty { padding: 48px 20px; text-align: center; color: var(--rh-ink-faint); font-size: 13.5px; }

/* ---------------- Alert / flash ---------------- */
.rh-alert {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: 8px; font-size: 13.3px; font-weight: 500;
  margin-bottom: 16px;
}
.rh-alert svg { width: 17px; height: 17px; flex: none; }
.rh-alert-success { background: var(--rh-success-soft); color: var(--rh-success); }
.rh-alert-danger { background: var(--rh-danger-soft); color: var(--rh-danger); }
.rh-alert-info { background: var(--rh-accent-soft); color: var(--rh-accent-ink); }
.rh-alert-warning { background: var(--rh-warning-soft); color: var(--rh-warning-ink); }

/* ---------------- Modal (Alpine-driven) ---------------- */
.rh-modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 35, 38, .45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  z-index: 1200;
}
.rh-modal {
  background: var(--rh-surface); border-radius: var(--rh-radius); box-shadow: var(--rh-shadow-md);
  width: 100%; max-width: 420px; padding: 26px;
  max-height: calc(100vh - 40px); overflow-y: auto;
}
.rh-modal-lg { max-width: 760px; padding: 0; }
.rh-modal-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--rh-danger-soft); color: var(--rh-danger);
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.rh-modal-icon svg { width: 22px; height: 22px; }
.rh-modal h3 {
  margin: 0 0 6px; font-size: 17.5px; color: var(--rh-ink);
  font-family: var(--bs-body-font-family, sans-serif); font-weight: 600;
}
.rh-modal p { margin: 0 0 22px; font-size: 13.5px; color: var(--rh-ink-muted); line-height: 1.5; }
.rh-modal p b { color: var(--rh-ink); }
.rh-modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------------- Checador: navegador de fecha ---------------- */
.rh-date-nav { display: flex; align-items: center; gap: 4px; background: var(--rh-surface); border: 1px solid var(--rh-border); border-radius: 8px; padding: 4px; }
.rh-date-nav-btn { width: 30px; height: 30px; border-radius: 6px; border: 0; background: transparent; color: var(--rh-ink-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.rh-date-nav-btn:hover { background: var(--rh-surface-2); }
.rh-date-nav-btn:disabled { opacity: .4; cursor: default; }
.rh-date-nav-btn svg { width: 16px; height: 16px; }
.rh-date-nav-label { font-size: 13.3px; font-weight: 600; color: var(--rh-ink); padding: 0 10px; white-space: nowrap; }

/* ---------------- Checador: celda de empleado en tabla ---------------- */
.rh-emp-cell { display: flex; align-items: center; gap: 10px; }
.rh-emp-name { font-weight: 600; font-size: 13.4px; color: var(--rh-ink); }
.rh-emp-sub { font-size: 11.5px; color: var(--rh-ink-faint); }

/* ---------------- Checador: panel de detalle por checada ---------------- */
.rh-events-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; padding: 20px; }
.rh-event-card { border: 1px solid var(--rh-border); border-radius: 9px; overflow: hidden; }
.rh-event-card.is-flagged { border-color: var(--rh-warning); }
.rh-event-card-head { padding: 10px 12px; background: var(--rh-surface-2); font-size: 11.5px; font-weight: 700; color: var(--rh-ink-muted); text-transform: uppercase; letter-spacing: .04em; }
.rh-event-photo { height: 92px; margin: 12px; border-radius: 8px; overflow: hidden; background: var(--rh-surface-2); }
.rh-event-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rh-event-photo.is-empty { display: flex; align-items: center; justify-content: center; color: var(--rh-ink-faint); background: linear-gradient(150deg, var(--rh-surface-2), var(--rh-border)); }
.rh-event-photo.is-empty svg { width: 28px; height: 28px; }
.rh-event-body { padding: 0 12px 12px; }
.rh-event-time { font-size: 15px; font-weight: 700; color: var(--rh-ink); }
.rh-event-meta { display: flex; align-items: center; gap: 5px; font-size: 11.8px; color: var(--rh-ink-muted); margin-top: 3px; }
.rh-event-meta svg { width: 13px; height: 13px; color: var(--rh-ink-faint); flex: none; }
.rh-event-pill { margin-top: 8px; }

/* ---------------- Buscador global (Ctrl+K) y paneles de la barra ---------------- */
.rh-buscar-boton {
  display: flex; align-items: center; gap: 8px;
  width: min(400px, 36vw); height: 40px; padding: 0 10px 0 12px;
  border: 1px solid var(--rh-border); border-radius: 10px;
  background: var(--rh-surface-2); color: var(--rh-ink-faint); font-size: 13px; cursor: text;
}
.rh-buscar-boton:hover { border-color: var(--rh-border-strong); }
.rh-buscar-boton svg { width: 16px; height: 16px; flex: none; }
.rh-buscar-texto { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rh-buscar-kbd, .rh-paleta-pie kbd {
  margin-left: auto; padding: 0 6px; border: 1px solid var(--rh-border); border-bottom-width: 2px; border-radius: 5px;
  background: var(--rh-surface-2); color: var(--rh-ink-muted); font: 600 11px/1.6 inherit; white-space: nowrap;
}
@media (max-width: 767.98px) {
  /* Celular: solo la lupa, del tamaño del dedo */
  .rh-buscar-boton { width: 44px; height: 44px; padding: 0; justify-content: center; border: 0; margin: 0; background: none; color: var(--rh-ink-muted); }
  .rh-buscar-boton svg { width: 19px; height: 19px; }
  .rh-buscar-texto, .rh-buscar-kbd { display: none; }
}

/* Visible con .is-abierto (Alpine); no se usa x-cloak porque Livewire lo regresa al redibujar */
.rh-paleta-fondo {
  position: fixed; inset: 0; z-index: 1100;
  display: none; align-items: flex-start; justify-content: center;
  padding: 12vh 16px 16px; background: rgba(15, 35, 38, .45);
}
.rh-paleta-fondo.is-abierto { display: flex; }
.rh-paleta {
  width: min(620px, 100%); max-height: 76vh; display: flex; flex-direction: column;
  border-radius: 14px; background: var(--rh-surface); box-shadow: var(--rh-shadow-md); overflow: hidden;
}
.rh-paleta-input { display: flex; align-items: center; gap: 10px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--rh-border); flex: none; }
.rh-paleta-input > svg { width: 18px; height: 18px; color: var(--rh-ink-muted); flex: none; }
.rh-paleta-input input {
  flex: 1; min-width: 0; height: 54px; border: 0; background: none; font-size: 15px; color: var(--rh-ink); font-family: inherit;
}
.rh-paleta-input input:focus { outline: none; box-shadow: none; }
.rh-paleta-input input::placeholder { color: var(--rh-ink-faint); }
.rh-paleta-cargando { font-size: 12px; color: var(--rh-ink-faint); white-space: nowrap; }
.rh-paleta-cerrar { display: none; }
.rh-paleta-res { overflow-y: auto; padding: 6px; }
.rh-paleta-grupo { margin: 10px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--rh-ink-faint); }
.rh-paleta-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; text-decoration: none; }
.rh-paleta-item:hover, .rh-paleta-item[aria-selected="true"] { background: var(--rh-accent-soft); }
.rh-paleta-icono { width: 18px; height: 18px; flex: none; color: var(--rh-ink-muted); }
.rh-paleta-titulo { display: block; font-size: 13.4px; font-weight: 600; color: var(--rh-ink); }
.rh-paleta-sub { display: block; font-size: 12px; color: var(--rh-ink-faint); }
.rh-paleta-vacio { margin: 4px 10px 10px; font-size: 12.8px; color: var(--rh-ink-faint); }
.rh-paleta-pie { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--rh-border); font-size: 11.5px; color: var(--rh-ink-faint); flex: none; }
.rh-paleta-pie kbd { margin: 0; }
@media (max-width: 767.98px) {
  .rh-paleta-fondo { padding: 0; }
  .rh-paleta { width: 100%; height: 100%; max-height: none; border-radius: 0; }
  .rh-paleta-cerrar { display: flex; }
  .rh-paleta-pie { display: none; }
}

/* Paneles desplegables de la barra: pendientes (campana) y usuario */
.rh-panel.dropdown-menu {
  width: 340px; padding: 6px; border: 1px solid var(--rh-border); border-radius: 12px;
  background: var(--rh-surface); box-shadow: var(--rh-shadow-md); margin-top: 8px !important;
}
.rh-panel-usuario.dropdown-menu { width: 250px; }
.rh-panel-titulo { margin: 6px 10px 8px; font-size: 13px; font-weight: 700; color: var(--rh-ink); }
.rh-panel-cuenta { padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--rh-border); list-style: none; }
.rh-panel-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--rh-ink); font-size: 13px; font-weight: 500; text-align: left; text-decoration: none; cursor: pointer;
}
.rh-panel-item:hover { background: var(--rh-surface-2); color: var(--rh-ink); }
.rh-panel-item-titulo { display: block; font-size: 13px; font-weight: 600; color: var(--rh-ink); }
.rh-panel-item-sub { display: block; font-size: 12px; color: var(--rh-ink-faint); }
.rh-panel-num { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--rh-warning-ink); }
.rh-panel-vacio { margin: 4px 10px 10px; font-size: 12.8px; color: var(--rh-ink-faint); }
.rh-panel-pie {
  display: block; margin-top: 4px; padding: 9px 10px; border-top: 1px solid var(--rh-border);
  font-size: 12.5px; font-weight: 600; text-decoration: none;
}
.rh-panel-salir, .rh-panel-salir:hover { color: var(--rh-danger); }
@media (max-width: 575.98px) {
  .rh-panel.dropdown-menu { position: fixed !important; inset: calc(var(--rh-header-h) + 4px) 10px auto 10px !important; transform: none !important; width: auto; }
}

.rh-badge-count {
  position: absolute; top: 1px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #B3322C; color: #fff; font-size: 10.5px; font-weight: 700; line-height: 14px; text-align: center;
  border: 2px solid var(--rh-surface); box-sizing: border-box;
}

/* Hover / selección en menús desplegables y links: verde suave de marca (el template los traía en morado) */
.dropdown-item:hover, .dropdown-item:focus { color: var(--rh-accent-ink); background-color: var(--rh-accent-soft); }
.dropdown-item.active, .dropdown-item:active { color: var(--rh-accent-ink); background-color: var(--rh-accent-soft); }
