/* ==========================================================================
   SISTEMA DE ASISTENCIA DE TALLER
   Diseño: Minimalista Azul Empresarial con Blanco + Modo Oscuro Opcional
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600;700&display=swap');

:root {
  /* Paleta Light (Azul Empresarial y Blanco - Por Defecto) */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-header: rgba(255, 255, 255, 0.96);
  --bg-item: #f8fafc;

  --border-color: #e2e8f0;
  --border-subtle: #cbd5e1;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;

  /* Acentos Empresariales */
  --corp-blue: #1d4ed8;         /* Azul Corporativo */
  --corp-blue-dark: #1e3a8a;    /* Azul Marino Profundo */
  --corp-blue-light: #3b82f6;   /* Azul Claro */
  --corp-blue-subtle: #eff6ff;  /* Fondo tenue azul */
  --corp-blue-border: #bfdbfe;

  --accent-success: #059669;    /* Verde Éxito */
  --accent-success-subtle: #ecfdf5;
  --accent-warning: #d97706;    /* Ámbar */
  --accent-warning-subtle: #fffbeb;
  --accent-danger: #dc2626;     /* Rojo */
  --accent-danger-subtle: #fef2f2;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 4px 6px -1px rgba(15, 23, 42, 0.1), 0 2px 4px -2px rgba(15, 23, 42, 0.06);

  --transition-smooth: all 0.2s ease-in-out;
}

/* ==========================================================================
   MODO OSCURO (ACTIVADO MEDIANTE [data-theme="dark"])
   ========================================================================== */
[data-theme="dark"] {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: #1e293b;
  --bg-card-hover: #263349;
  --bg-header: rgba(17, 24, 39, 0.95);
  --bg-item: #151e2e;

  --border-color: #334155;
  --border-subtle: #475569;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --corp-blue: #3b82f6;
  --corp-blue-dark: #60a5fa;
  --corp-blue-light: #93c5fd;
  --corp-blue-subtle: rgba(59, 130, 246, 0.12);
  --corp-blue-border: rgba(59, 130, 246, 0.3);

  --accent-success: #10b981;
  --accent-success-subtle: rgba(16, 185, 129, 0.12);
  --accent-warning: #f59e0b;
  --accent-warning-subtle: rgba(245, 158, 11, 0.12);
  --accent-danger: #f43f5e;
  --accent-danger-subtle: rgba(244, 63, 94, 0.12);

  --shadow-card: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 4px 10px 0 rgba(0, 0, 0, 0.5);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.25s ease, color 0.25s ease;
}

img, svg, video, canvas, audio, iframe, embed, object {
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   HEADER CORPORATIVO Y NAVEGACIÓN
   ========================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  width: 38px;
  height: 38px;
  background: var(--corp-blue);
  color: #ffffff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.25);
}

.brand-info h1 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.brand-info span.subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-primary);
  padding: 0.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-link:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: #ffffff;
  background: var(--corp-blue);
  box-shadow: 0 1px 3px rgba(29, 78, 216, 0.3);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-smooth);
}

.btn-theme-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-subtle);
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--accent-success-subtle);
  border: 1px solid rgba(5, 150, 105, 0.25);
  color: var(--accent-success);
}

.live-badge.offline {
  background: var(--accent-danger-subtle);
  border-color: rgba(220, 38, 38, 0.25);
  color: var(--accent-danger);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-success);
}

.live-badge.offline .pulse-dot {
  background: var(--accent-danger);
}

.clock-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-card);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
}

/* ==========================================================================
   SELECTOR DE ZONAS (PESTAÑAS CÓRDOBA VS PASO RAYÓN)
   ========================================================================== */
.zone-selector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 1rem;
}

.zone-tabs-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.zone-selector-bar > div:last-child {
  max-width: 400px;
}

.zone-tab-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.95rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.zone-tab-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.zone-tab-btn.active {
  background: var(--corp-blue);
  color: #ffffff;
  border-color: var(--corp-blue);
  box-shadow: 0 1px 3px rgba(29, 78, 216, 0.25);
}

.zone-badge-pill {
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.08);
}

.zone-tab-btn.active .zone-badge-pill {
  background: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   METRICAS GLOBALES SUPERIORES (KPI CARDS)
   ========================================================================== */
.stats-banner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  align-items: stretch;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.stat-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--border-subtle);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--stat-accent, var(--corp-blue));
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.stat-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--corp-blue-subtle);
  color: var(--corp-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.stat-body {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.stat-target {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  margin-left: auto;
}

.badge-blue {
  background: var(--corp-blue-subtle);
  color: var(--corp-blue);
  border: 1px solid var(--corp-blue-border);
}

.badge-green {
  background: var(--accent-success-subtle);
  color: var(--accent-success);
  border: 1px solid rgba(5, 150, 105, 0.25);
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: var(--border-color);
  border-radius: var(--radius-full);
  margin-top: 0.85rem;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--corp-blue);
  transition: width 0.4s ease;
}

/* ==========================================================================
   GRID DE CAJONES POR PUESTO (MECÁNICOS: 3/4, ELÉCTRICOS: 2/3)
   ========================================================================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.15rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.badge-count {
  background: var(--corp-blue-subtle);
  color: var(--corp-blue);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--corp-blue-border);
}

.quick-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-accordion-all {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition-smooth);
}

.btn-accordion-all:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--corp-blue-border);
}

.puestos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

/* Tarjeta Cajón Comprimida */
.cajon-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  box-shadow: var(--shadow-card);
  transition: all 0.25s ease-in-out;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cajon-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-subtle);
}

.cajon-card.status-completo {
  border-left: 4px solid var(--accent-success);
}

.cajon-card.status-incompleto {
  border-left: 4px solid var(--accent-warning);
}

.cajon-card.status-vacio {
  border-left: 4px solid var(--border-subtle);
}

.cajon-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  min-height: 48px;
}

.cajon-puesto-info {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.puesto-text-group {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.puesto-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.puesto-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
  overflow-wrap: break-word;
}

.puesto-cve {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}

.puesto-zone-badge {
  font-size: 0.64rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--corp-blue-subtle);
  color: var(--corp-blue);
  font-weight: 700;
  border: 1px solid var(--corp-blue-border);
}

.cajon-metric-box {
  text-align: right;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  margin-left: 0.25rem;
}

.cajon-counter {
  font-size: 1.45rem;
  font-weight: 800;
  font-family: 'Inter', sans-serif;
  line-height: 1;
  color: var(--text-main);
  white-space: nowrap;
}

.cajon-counter .presentes {
  color: var(--corp-blue);
}

.cajon-card.status-completo .cajon-counter .presentes {
  color: var(--accent-success);
}

.cajon-card.status-incompleto .cajon-counter .presentes {
  color: var(--accent-warning);
}

.cajon-counter .divider {
  color: var(--text-dim);
  font-weight: 300;
  margin: 0 2px;
}

.cajon-counter .esperados {
  color: var(--text-muted);
  font-size: 1.15rem;
}

.cajon-progress {
  margin-top: 0.35rem;
  margin-bottom: 0.45rem;
  height: 4px;
}

.cajon-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding-top: 0.2rem;
}

.status-badge-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  font-size: 0.68rem;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-full);
}

.chip-success {
  background: var(--accent-success-subtle);
  color: var(--accent-success);
  border: 1px solid rgba(5, 150, 105, 0.25);
}

.chip-warning {
  background: var(--accent-warning-subtle);
  color: var(--accent-warning);
  border: 1px solid rgba(217, 119, 6, 0.25);
}

.chip-danger {
  background: var(--accent-danger-subtle);
  color: var(--accent-danger);
  border: 1px solid rgba(220, 38, 38, 0.25);
}

/* Indicador de Desglose */
.cajon-toggle-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--corp-blue);
  background: var(--corp-blue-subtle);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  user-select: none;
  transition: var(--transition-smooth);
}

.cajon-toggle-indicator .chevron {
  display: inline-block;
  transition: transform 0.25s ease;
  font-size: 0.65rem;
}

.cajon-card.is-expanded .cajon-toggle-indicator .chevron {
  transform: rotate(180deg);
}

/* Cajón Lista Personal Desglosable (Colapsada por Defecto) */
.cajon-personal-list {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  padding-top: 0;
  border-top: 1px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, margin-top 0.25s ease, padding-top 0.25s ease;
}

.cajon-card.is-expanded .cajon-personal-list {
  max-height: 380px;
  opacity: 1;
  overflow-y: auto;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-color);
}

.cajon-personal-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: var(--bg-item);
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.cajon-personal-item.item-en-permiso {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid #f59e0b;
}

[data-theme="dark"] .cajon-personal-item.item-en-permiso {
  background: rgba(245, 158, 11, 0.12);
  border-left-color: #fbbf24;
}

.cajon-personal-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--corp-blue-border);
  transform: translateX(2px);
}

.cajon-personal-item .personal-thumb-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-color);
  flex-shrink: 0;
  margin-top: 1px;
}

.personal-name-cve {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  overflow: hidden;
}

.personal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  width: 100%;
}

.personal-name-cve span.p-nom {
  font-weight: 700;
  color: var(--text-main);
  display: block;
  font-size: 0.77rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}

.cajon-personal-item.item-en-permiso span.p-nom {
  color: #b45309;
}

[data-theme="dark"] .cajon-personal-item.item-en-permiso span.p-nom {
  color: #fcd34d;
}

.personal-sub-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  width: 100%;
}

.personal-name-cve span.p-cve {
  font-size: 0.69rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}

.p-permiso-autorizado {
  font-size: 0.68rem;
  color: #1e3a8a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
  margin-top: 0.05rem;
}

[data-theme="dark"] .p-permiso-autorizado {
  color: #93c5fd;
}

.personal-time {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 0.67rem;
  font-weight: 700;
  color: var(--corp-blue);
  font-family: 'JetBrains Mono', monospace;
  background: var(--corp-blue-subtle);
  padding: 0.14rem 0.42rem;
  border-radius: 4px;
  line-height: 1.2;
}

.personal-time.time-permiso {
  color: #b45309;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

[data-theme="dark"] .personal-time.time-permiso {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.4);
}

.personal-empty-msg {
  font-size: 0.74rem;
  color: var(--text-dim);
  text-align: center;
  padding: 0.5rem 0;
  font-style: italic;
}

/* ==========================================================================
   FEED EN VIVO / ULTIMOS REGISTROS
   ========================================================================== */
.feed-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-card);
}

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-color);
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 320px;
  overflow-y: auto;
}

.feed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-item);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  transition: var(--transition-smooth);
}

.feed-item:hover {
  background: var(--bg-card-hover);
}

.feed-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.feed-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--corp-blue-subtle);
  border: 1px solid var(--corp-blue-border);
  color: var(--corp-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
}

.feed-info h4 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.feed-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.feed-badge-puesto {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
}

[data-theme="dark"] .feed-badge-puesto {
  background: rgba(255, 255, 255, 0.08);
}

.feed-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}

.feed-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
}

.feed-caseta {
  font-size: 0.68rem;
  color: var(--corp-blue);
  font-weight: 600;
  text-transform: uppercase;
}

/* ==========================================================================
   TERMINAL CASETA (ESCÁNER USB / BOLA)
   ========================================================================== */
.caseta-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 0.5rem;
}

@media (max-width: 900px) {
  .caseta-layout { grid-template-columns: 1fr; }
}

.scanner-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hardware-banner {
  background: var(--corp-blue-subtle);
  border: 1px solid var(--corp-blue-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-main);
}

.gun-input-box {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.gun-input-box label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.gun-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-item);
  border: 2px solid var(--corp-blue);
  color: var(--text-main);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem;
  outline: none;
  transition: var(--transition-smooth);
}

.gun-input:focus {
  border-color: var(--corp-blue-dark);
  box-shadow: 0 0 0 3px var(--corp-blue-border);
}

.reader-window {
  width: 100%;
  min-height: 200px;
  border-radius: var(--radius-sm);
  background: #000000;
  border: 1px dashed var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#reader {
  width: 100% !important;
  border: none !important;
}

.camera-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: #94a3b8;
  padding: 1.5rem;
  text-align: center;
}

/* Tarjeta de resultado en Caseta */
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: var(--shadow-card);
  min-height: 420px;
}

.result-card.success-pop {
  border: 2px solid var(--accent-success);
  background: var(--accent-success-subtle);
}

.badge-avatar-huge {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--corp-blue);
  color: #ffffff;
  font-size: 2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.result-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.result-puesto {
  font-size: 1rem;
  color: var(--corp-blue);
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: var(--corp-blue-subtle);
  padding: 0.2rem 0.85rem;
  border-radius: var(--radius-full);
}

.result-details {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  justify-content: center;
}

.result-details div {
  background: var(--bg-card);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.result-details strong {
  color: var(--text-main);
  display: block;
}

/* ==========================================================================
   ETIQUETAS ADHESIVAS QR PARA IMPRESIÓN
   ========================================================================== */
.label-filter-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 250px;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--corp-blue);
}

.labels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.sticker-label {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1.5px solid #0f172a;
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
  page-break-inside: avoid;
}

.sticker-header {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #1e3a8a;
  border-bottom: 1px dashed #cbd5e1;
  width: 100%;
  padding-bottom: 0.3rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.sticker-qr-box {
  background: #ffffff;
  padding: 4px;
  margin-bottom: 0.4rem;
}

.sticker-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.06em;
  margin-bottom: 0.2rem;
}

.sticker-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sticker-role {
  font-size: 0.72rem;
  font-weight: 600;
  color: #1d4ed8;
  background: #eff6ff;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  margin-top: 0.2rem;
  margin-bottom: 0.3rem;
}

.sticker-zone {
  font-size: 0.68rem;
  font-weight: 700;
  color: #059669;
  text-transform: uppercase;
}

.sticker-actions {
  margin-top: 0.65rem;
  width: 100%;
}

.btn-print-single {
  width: 100%;
  padding: 0.35rem;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
}

.btn-print-single:hover {
  background: #0f172a;
  color: #ffffff;
}

/* ==========================================================================
   BOTONES
   ========================================================================== */
.btn {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition-smooth);
  text-decoration: none;
}

.btn-primary {
  background: var(--corp-blue);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--corp-blue-dark);
}

.btn-secondary {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
}

/* ==========================================================================
   BOTON INSTALAR PWA
   ========================================================================== */
.btn-install-pwa {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-install-pwa:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.45);
}

/* ==========================================================================
   MODAL DE FOTO EN ALTA RESOLUCIÓN (AMPLIADA)
   ========================================================================== */
.photo-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.photo-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.photo-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  max-width: 820px;
  width: 94vw;
  max-height: min(92vh, 680px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
  padding: 1.5rem 1.65rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
  position: relative;
  margin: auto;
  transform: scale(0.92) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.photo-modal-card::-webkit-scrollbar {
  width: 6px;
}
.photo-modal-card::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.photo-modal-backdrop.active .photo-modal-card {
  transform: scale(1) translateY(0);
}

.photo-modal-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 1.35rem;
  align-items: stretch;
  text-align: left;
}

.photo-modal-col-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--bg-item);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 0.85rem;
}

.photo-modal-col-actions {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.75rem;
  text-align: left;
}

.photo-modal-actions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.45rem;
  border-bottom: 1.5px dashed var(--border-color);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--corp-blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-prestamo-section-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.35rem;
}

.prestamo-info-modal-box {
  padding: 0.75rem;
  border-radius: var(--radius-md);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  transition: var(--transition-smooth);
}

body.dark-mode .prestamo-info-modal-box {
  background: rgba(30, 58, 138, 0.25);
  border-color: rgba(59, 130, 246, 0.4);
}

.photo-modal-close-btn {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-item);
  color: var(--text-main);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition-smooth);
}

.photo-modal-close-btn:hover {
  background: var(--accent-danger-subtle);
  color: var(--accent-danger);
  border-color: var(--accent-danger);
}

.photo-modal-img-wrap {
  width: 140px;
  height: 140px;
  margin: 0 auto 0.5rem auto;
  border-radius: 1rem;
  overflow: hidden;
  border: 3.5px solid var(--corp-blue);
  box-shadow: 0 8px 20px rgba(29, 78, 216, 0.2);
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.photo-modal-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.btn-cambiar-foto-modal {
  font-size: 0.76rem;
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.btn-cambiar-foto-modal:hover {
  background: var(--corp-blue-subtle);
  border-color: var(--corp-blue);
  color: var(--corp-blue);
}

.photo-modal-name {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.2rem;
  line-height: 1.2;
}

.photo-modal-id-badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.15rem 0.65rem;
  background: var(--corp-blue-subtle);
  color: var(--corp-blue);
  border: 1px solid var(--corp-blue-border);
  border-radius: var(--radius-full);
  margin-bottom: 0.35rem;
}

.photo-modal-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  width: 100%;
  margin-top: 0.25rem;
  text-align: left;
}

.photo-modal-info-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
}

.photo-modal-info-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.1rem;
}

.photo-modal-info-val {
  font-size: 0.78rem;
  color: var(--text-main);
  font-weight: 600;
  line-height: 1.2;
  word-break: break-word;
}

/* ==========================================================================
   BUSCADOR DE PERSONAL EN DASHBOARD
   ========================================================================== */
.dashboard-search-container {
  margin: 1rem 0 1.25rem 0;
  position: relative;
  z-index: 10;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.dashboard-search-field {
  width: 100%;
  padding: 0.75rem 2.75rem 0.75rem 2.85rem;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: var(--transition-smooth);
}

.dashboard-search-field:focus {
  outline: none;
  border-color: var(--corp-blue);
  box-shadow: 0 0 0 3px var(--corp-blue-subtle), 0 4px 14px rgba(29, 78, 216, 0.15);
}

.btn-clear-search {
  position: absolute;
  right: 0.85rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.btn-clear-search:hover {
  color: var(--accent-danger);
  background: var(--accent-danger-subtle);
}

.search-results-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  max-height: 380px;
  overflow-y: auto;
  z-index: 50;
  padding: 0.5rem;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
}

.search-result-item:hover {
  background: var(--bg-item);
  border-color: var(--border-color);
  transform: translateX(4px);
}

.search-result-thumb {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  border: 1.5px solid var(--border-color);
  background: var(--bg-primary);
}

.search-result-info {
  flex: 1;
  min-width: 0;
}

.search-result-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.15rem;
}

/* ==========================================================================
   SECCIÓN DE GESTIÓN DE PERMISOS EN MODAL FOTO
   ========================================================================== */
.modal-permiso-section {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  text-align: left;
}

.permiso-action-card {
  background: var(--bg-item);
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 0.95rem;
  margin-top: 0.65rem;
}

.permiso-card-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: #b45309;
  margin-bottom: 0.35rem;
}

.permiso-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0 0 0.75rem 0;
}

.permiso-form-group {
  margin-bottom: 0.75rem;
}

.permiso-form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.3rem;
}

.permiso-select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
}

.permiso-custom-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
}

.btn-asignar-permiso {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
  transition: var(--transition-smooth);
}

.btn-asignar-permiso:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.45);
}

.permiso-pending-card {
  background: rgba(245, 158, 11, 0.1);
  border: 1.5px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: 0.95rem;
  margin-top: 0.65rem;
}

.permiso-pending-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: #b45309;
  margin-bottom: 0.5rem;
}

.permiso-pending-detail {
  font-size: 0.8rem;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.permiso-pending-note {
  margin: 0.5rem 0 0.75rem 0;
  font-size: 0.73rem;
  color: #b45309;
  line-height: 1.35;
  background: rgba(255, 255, 255, 0.5);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
}

.btn-cancelar-permiso {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  background: transparent;
  color: #dc2626;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-cancelar-permiso:hover {
  background: #fef2f2;
  border-color: #dc2626;
}

.permiso-active-card {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-top: 0.65rem;
}

.permiso-info-note {
  background: var(--bg-item);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-top: 0.65rem;
  text-align: center;
}

.badge-permiso-pendiente {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  border: 1px solid #fde68a;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* ==========================================================================
   IMPRESIÓN TIPO CREDENCIAL / GAFETE (85mm x 52mm) CON AISLAMIENTO INDIVIDUAL
   ========================================================================== */
@media print {
  @page {
    size: letter portrait;
    margin: 6mm 8mm;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .top-nav, 
  .zone-selector-bar, 
  .label-filter-bar, 
  .hardware-banner, 
  .btn-print-single, 
  .quick-toolbar, 
  .btn-install-pwa,
  .btn-accordion-all,
  .toast-container,
  .photo-modal-backdrop {
    display: none !important;
  }

  .container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }

  .labels-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    align-content: flex-start !important;
    gap: 3mm 4mm !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
  }

  .sticker-label {
    width: 95mm !important;
    height: 49mm !important;
    max-width: 95mm !important;
    max-height: 49mm !important;
    box-sizing: border-box !important;
    padding: 2mm 3.5mm !important;
    border: 1pt solid #000000 !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: space-between !important;
    overflow: hidden !important;
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
  }

  .sticker-header {
    font-size: 7pt !important;
    font-weight: 800 !important;
    color: #000000 !important;
    border-bottom: 0.5pt dashed #555555 !important;
    width: 100% !important;
    padding-bottom: 0.6mm !important;
    margin-bottom: 0.8mm !important;
    text-align: center !important;
  }

  .sticker-qr-box {
    margin-bottom: 0.6mm !important;
    padding: 0 !important;
  }

  .sticker-qr-box img, 
  .sticker-qr-box canvas {
    width: 20mm !important;
    height: 20mm !important;
  }

  .sticker-id {
    font-size: 10pt !important;
    font-weight: 800 !important;
    font-family: 'JetBrains Mono', monospace !important;
    color: #000000 !important;
    letter-spacing: 0.05em !important;
    margin-bottom: 0.2mm !important;
    line-height: 1 !important;
  }

  .sticker-name {
    font-size: 7.5pt !important;
    font-weight: 700 !important;
    color: #000000 !important;
    max-width: 88mm !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.1 !important;
  }

  .sticker-role {
    font-size: 6.5pt !important;
    font-weight: 600 !important;
    color: #000000 !important;
    background: transparent !important;
    border: 0.5pt solid #888888 !important;
    padding: 0.2mm 2mm !important;
    border-radius: 3px !important;
    margin-top: 0.2mm !important;
    margin-bottom: 0.2mm !important;
  }

  .sticker-zone {
    font-size: 6pt !important;
    font-weight: 700 !important;
    color: #000000 !important;
  }

  .sticker-actions {
    display: none !important;
  }

  body.printing-single-mode .labels-grid {
    display: block !important;
  }

  body.printing-single-mode .sticker-label {
    display: none !important;
  }

  body.printing-single-mode .sticker-label.print-only-this {
    display: flex !important;
    margin: 10mm auto !important;
  }
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--corp-blue);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.15rem;
  box-shadow: var(--shadow-hover);
  color: var(--text-main);
  font-size: 0.82rem;
  min-width: 280px;
}

/* ==========================================================================
   BRANDING GRUPO ADIC & LOGO
   ========================================================================== */
.brand-logo-adic {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem;
}

.nav-logo-img {
  height: 38px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  transition: transform 0.2s ease;
}

[data-theme="dark"] .nav-logo-img {
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.75));
}

/* ==========================================================================
   PERFIL DE USUARIO Y BOTÓN DE LOGOUT
   ========================================================================== */
.user-header-profile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.user-chip-tag {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  padding: 0.28rem 0.75rem;
  border-radius: var(--radius-full);
  max-width: 100%;
}

.user-avatar-circle {
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
}

.user-meta-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  min-width: 0;
}

.user-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.user-role {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  line-height: 1.1;
}

.btn-logout {
  background: var(--accent-danger-subtle);
  color: var(--accent-danger);
  border: 1px solid var(--accent-danger);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.btn-logout:hover {
  background: var(--accent-danger);
  color: #ffffff;
}

/* ==========================================================================
   FOTOGRAFÍA DEL COLABORADOR EN CASETA
   ========================================================================== */
.employee-photo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  width: 100%;
}

.photo-wrapper-box {
  width: 150px;
  height: 150px;
  border-radius: 1.25rem;
  border: 4px solid var(--border-color);
  background: var(--bg-card-hover);
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.photo-wrapper-box.verified {
  border-color: var(--accent-success);
  box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.2), 0 12px 28px rgba(0,0,0,0.12);
  animation: photoPop 0.4s ease-out;
}

.photo-wrapper-box.unverified {
  border-color: var(--accent-danger);
  box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.2);
}

.employee-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-placeholder-avatar {
  font-size: 4rem;
  color: var(--text-dim);
}

.photo-check-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  background: var(--accent-success);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.photo-label-badge {
  margin-top: 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-card-hover);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  text-transform: uppercase;
}

.photo-label-badge.badge-success {
  background: var(--accent-success-subtle);
  color: var(--accent-success);
  border-color: var(--accent-success);
}

.photo-label-badge.badge-danger {
  background: var(--accent-danger-subtle);
  color: var(--accent-danger);
  border-color: var(--accent-danger);
}

@keyframes photoPop {
  0% { transform: scale(0.88); opacity: 0.6; }
  70% { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}

/* Miniatures de fotos en Cajones y Feed */
.personal-thumb-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-color);
  flex-shrink: 0;
}

.feed-avatar-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-color);
  flex-shrink: 0;
  background: var(--bg-card-hover);
}

.feed-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   BREAKPOINTS RESPONSIVOS
   ========================================================================== */
/* (Los breakpoints responsivos completos y unificados se declaran al final de este archivo para máxima prioridad de cascada) */

/* ==========================================================================
   ESTILOS PARA EL MÓDULO DE REPORTES Y GENERACIÓN DE NÓMINA (NIVEL 5)
   ========================================================================== */

.report-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem 1rem;
}

/* Tarjeta de Filtros y Control de Período */
.report-filters-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.filter-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.report-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.report-export-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-excel {
  background: linear-gradient(135deg, #107c41, #15803d);
  color: #ffffff;
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(16, 124, 65, 0.25);
  transition: all 0.2s ease;
}

.btn-excel:hover {
  background: linear-gradient(135deg, #0e6b37, #166534);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 124, 65, 0.35);
  color: #ffffff;
}

.filter-controls-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filter-row-primary {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.filter-row-secondary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  align-items: flex-end;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-color);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-group label {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.filter-preset-group {
  flex: 0 0 auto;
}

.preset-pill-group {
  display: inline-flex;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
  width: auto;
  max-width: 100%;
  flex-wrap: wrap;
}

.btn-preset {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  text-align: center;
}

.btn-preset:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}

.btn-preset.active {
  background: var(--corp-blue);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.3);
}

.filter-dates-group {
  display: flex;
  flex-direction: row !important;
  gap: 0.75rem;
  flex: 0 0 auto;
}

.date-box {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 0 0 auto;
}

.date-box label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.filter-actions-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.filter-actions-group .btn {
  height: 38px;
  padding: 0 1.15rem;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.filter-input-date {
  height: 38px;
  width: 155px;
  min-width: 155px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-main);
  padding: 0 0.5rem;
  font-size: 0.84rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

.filter-select {
  height: 38px;
  min-width: 160px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-main);
  padding: 0 0.65rem;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.filter-input-date:focus,
.filter-select:focus {
  border-color: var(--corp-blue);
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrap .search-input {
  width: 100%;
  padding-right: 2rem;
}

.btn-clear-search {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px;
}

.btn-clear-search:hover {
  color: var(--accent-danger);
}

/* Modal de Asignación de Descansos */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 900px;
  max-height: calc(100dvh - 2rem);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: auto;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-close-modal:hover {
  color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.1);
}

.modal-search-bar {
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-card);
}

.modal-search-bar .search-input {
  max-width: 400px;
}

.modal-table-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  padding: 0;
  max-height: 55vh;
}

.modal-footer {
  padding: 0.85rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.descanso-row:hover td {
  background: var(--bg-hover);
}

/* Barra de Resumen KPI */
.report-kpis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.report-kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.kpi-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.kpi-info {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.kpi-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.15;
}

.kpi-sub {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* Pestañas de Reporte */
.report-tabs-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.tabs-header-bar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-primary);
  padding: 0.5rem 0.75rem 0 0.75rem;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

.report-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--text-muted);
  padding: 0.65rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.report-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.report-tab-btn.active {
  background: var(--bg-card);
  color: var(--corp-blue);
  font-weight: 700;
  border-color: var(--border-color);
  border-bottom: 2px solid var(--corp-blue);
}

.tab-count-badge {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

.report-tab-btn.active .tab-count-badge {
  background: var(--corp-blue);
  color: #ffffff;
}

/* Barra de Simbología Oficial */
.report-legend-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding: 0.65rem 1.25rem;
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.legend-title {
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.sym-check { color: #10b981; font-size: 0.95rem; }
.sym-falta { color: #ef4444; font-size: 0.95rem; }
.sym-desc { color: #64748b; font-weight: 700; }
.sym-incap { color: #f59e0b; font-weight: 700; }
.sym-vac { color: #0284c7; font-weight: 700; }
.sym-perm { color: #8b5cf6; font-weight: 700; }
.sym-baja { color: #475569; font-weight: 700; }

/* Contenido de Pestaña */
.tab-content {
  display: none;
  padding: 1.25rem;
}

.tab-content.active {
  display: block;
}

/* Tablas Matriciales (Lun - Dom) */
.table-responsive-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.matrix-table th {
  background: var(--bg-primary);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.74rem;
  padding: 0.65rem 0.65rem;
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

.matrix-day-col {
  padding: 0.45rem 0.35rem !important;
}

.matrix-day-col .day-name {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.matrix-day-col .day-num {
  display: block;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
}

.col-weekend {
  background: rgba(0, 0, 0, 0.03) !important;
}

.matrix-row td {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.matrix-row:hover td {
  background: var(--bg-hover);
}

.specialty-group-header td {
  background: rgba(30, 58, 138, 0.06);
  color: var(--corp-blue);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--corp-blue);
}

.group-bullet {
  font-size: 0.65rem;
  margin-right: 0.35rem;
}

/* Chips de Estado de Asistencia en Celda */
.matrix-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 0.3rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.76rem;
  cursor: pointer;
  pointer-events: none;
  user-select: none;
}

.cell-badge-asist {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.cell-badge-falta {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.cell-badge-desc {
  background: rgba(148, 163, 184, 0.18);
  color: #475569;
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-size: 0.7rem;
}

.cell-badge-incap {
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.cell-badge-vac {
  background: rgba(2, 132, 199, 0.2);
  color: #0284c7;
  border: 1px solid rgba(2, 132, 199, 0.4);
}

.cell-badge-perm {
  background: rgba(147, 51, 234, 0.18);
  color: #7e22ce;
  border: 1px solid rgba(147, 51, 234, 0.35);
}

.cell-badge-baja {
  background: rgba(185, 28, 28, 0.2);
  color: #991b1b;
  border: 1px solid rgba(185, 28, 28, 0.4);
}

/* Celda interactiva para justificación con 1 clic */
.matrix-cell-day {
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease;
  user-select: none;
}

.matrix-cell-day:hover {
  background: rgba(30, 58, 138, 0.08) !important;
}

.matrix-cell-day:hover .matrix-status-chip {
  transform: scale(1.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Estilos para Modales de Incidencias */
.modal-incidencias-card {
  max-width: 950px;
}

.incidencia-form-card {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin: 1rem 1.5rem 0 1.5rem;
}

.incidencia-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.quick-incidencia-pill-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.btn-quick-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.btn-quick-pill:hover,
.btn-quick-pill.selected {
  border-color: var(--corp-blue);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 22px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.72rem;
  flex-shrink: 0;
}

.badge-inc-I { background: rgba(245, 158, 11, 0.2); color: #b45309; }
.badge-inc-V { background: rgba(2, 132, 199, 0.2); color: #0284c7; }
.badge-inc-P { background: rgba(147, 51, 234, 0.2); color: #7e22ce; }
.badge-inc-B { background: rgba(185, 28, 28, 0.2); color: #991b1b; }
.badge-inc-Desc { background: rgba(100, 116, 139, 0.2); color: #475569; }
.badge-inc-X { background: rgba(239, 68, 68, 0.2); color: #dc2626; }

/* Tabla de Especialidades */
.specialty-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.specialty-table th {
  background: var(--bg-primary);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.74rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
}

.specialty-table td {
  padding: 0.65rem 1rem;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.specialty-table tbody tr:hover td {
  background: var(--bg-hover);
}

.specialty-total-row td {
  background: var(--corp-blue-subtle, rgba(30, 58, 138, 0.08));
  border-top: 2px solid var(--corp-blue);
  color: var(--text-main);
  font-weight: 800;
  font-size: 0.92rem;
  padding: 0.75rem 1rem;
}

/* Tabla de Bitácora de Nómina */
.payroll-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.payroll-detail-table th {
  background: var(--bg-primary);
  color: var(--text-muted);
  font-weight: 700;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border-color);
  text-transform: uppercase;
  font-size: 0.74rem;
}

.payroll-detail-table td {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.payroll-detail-table tbody tr:hover td {
  background: var(--bg-hover);
}

.badge-sede {
  background: rgba(30, 58, 138, 0.1);
  color: var(--corp-blue);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.badge-count {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.74rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.lavadores-observaciones-box {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--bg-primary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.lavadores-observaciones-box strong {
  color: var(--text-main);
  display: block;
  margin-bottom: 0.35rem;
}

.obs-lines p {
  margin: 0.2rem 0;
}

/* Badges de Entrada / Salida en Caseta */
.chip-salida {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  color: #ffffff !important;
  border: none !important;
}

.badge-info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* ==========================================================================
   ESTILOS DE IMPRESIÓN OFICIAL (@media print)
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10pt !important;
  }

  .top-nav,
  .report-filters-card,
  .tabs-header-bar,
  .report-export-buttons,
  .btn-theme-toggle,
  .clock-display {
    display: none !important;
  }

  .report-container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .report-tabs-wrapper {
    border: none !important;
    box-shadow: none !important;
  }

  .tab-content {
    display: block !important;
    page-break-after: always;
    padding: 0 !important;
  }

  .matrix-table,
  .specialty-table,
  .payroll-detail-table {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  .matrix-table th,
  .matrix-table td,
  .specialty-table th,
  .specialty-table td,
  .payroll-detail-table th,
  .payroll-detail-table td {
    border: 1px solid #999999 !important;
    color: #000000 !important;
    padding: 4px 6px !important;
  }

  .matrix-status-chip {
    border: none !important;
    font-weight: 800 !important;
  }
}

/* ==========================================================================
   ESTILOS CORPORATIVOS PARA SWEETALERT2 (TEMA CLARO Y MODO OSCURO)
   ========================================================================== */
.swal2-container {
  z-index: 999999 !important;
}

.swal2-popup.swal2-corporate-popup {
  font-family: inherit !important;
  border-radius: var(--radius-lg, 12px) !important;
  border: 1px solid var(--border-color, #e2e8f0) !important;
  box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.35) !important;
  padding: 1.5rem !important;
}

[data-theme="dark"] .swal2-popup.swal2-corporate-popup {
  background: var(--bg-card, #1e293b) !important;
  color: var(--text-main, #f8fafc) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

.swal2-title.swal2-corporate-title {
  font-size: 1.15rem !important;
  font-weight: 800 !important;
  color: var(--text-main, #0f172a) !important;
  margin-bottom: 0.5rem !important;
}

[data-theme="dark"] .swal2-title.swal2-corporate-title {
  color: #f8fafc !important;
}

.swal2-html-container.swal2-corporate-html {
  font-size: 0.92rem !important;
  color: var(--text-muted, #475569) !important;
  line-height: 1.55 !important;
  margin: 0.5rem 0 1rem 0 !important;
}

[data-theme="dark"] .swal2-html-container.swal2-corporate-html {
  color: #94a3b8 !important;
}

.swal2-actions {
  gap: 0.65rem !important;
}

.swal2-confirm,
.swal2-cancel {
  border-radius: var(--radius-sm, 6px) !important;
  font-weight: 700 !important;
  padding: 0.6rem 1.3rem !important;
  font-size: 0.88rem !important;
  transition: all 0.2s ease !important;
}

.swal2-toast {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
  border-radius: 8px !important;
}

/* ==========================================================================
   MODAL FOTO PREVIEW - BOTÓN CAMBIAR / TOMAR FOTO
   ========================================================================== */
.photo-modal-img-wrap {
  position: relative !important;
}

.photo-modal-cam-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--corp-blue, #1d4ed8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.photo-modal-cam-badge:hover {
  transform: scale(1.1);
  background: #1e40af;
}

.btn-cambiar-foto-modal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.45rem 1.15rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 9999px;
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0.35rem auto 0.75rem auto;
}

.btn-cambiar-foto-modal:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
}

/* ==========================================================================
   MÓDULO DE CAPTURA Y GESTIÓN DE FOTOGRAFÍAS (fotos.html)
   ========================================================================== */
.fotos-header-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg, 12px);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.fotos-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.fotos-header-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(59, 130, 246, 0.25));
  color: var(--corp-blue, #2563eb);
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fotos-header-h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 0.2rem 0;
}

.fotos-header-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}

.fotos-stats-counters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.foto-stat-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.foto-stat-pill.stat-total {
  background: var(--bg-secondary, #f1f5f9);
  color: var(--text-main);
  border-color: var(--border-color);
}

.foto-stat-pill.stat-con-foto {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.25);
}

.foto-stat-pill.stat-sin-foto {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.25);
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2); }
  50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15); }
}

/* Barra de Filtros */
.fotos-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.fotos-filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-filter-foto {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md, 8px);
  font-size: 0.84rem;
  font-weight: 700;
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-filter-foto:hover {
  border-color: var(--corp-blue);
  color: var(--corp-blue);
}

.btn-filter-foto.active {
  background: var(--corp-blue, #2563eb);
  color: #ffffff;
  border-color: var(--corp-blue, #2563eb);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.fotos-search-input-wrap {
  position: relative;
  min-width: 280px;
  flex: 1;
  max-width: 420px;
}

.fotos-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  color: var(--text-muted);
  pointer-events: none;
}

.fotos-search-input {
  width: 100%;
  padding: 0.6rem 2.2rem 0.6rem 2.4rem;
  border-radius: var(--radius-md, 8px);
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.fotos-search-input:focus {
  outline: none;
  border-color: var(--corp-blue);
  box-shadow: 0 0 0 3px var(--corp-blue-subtle, rgba(37,99,235,0.15));
}

.fotos-search-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  display: none;
}

/* Grid de Colaboradores */
.fotos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.foto-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg, 12px);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.foto-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  border-color: rgba(37, 99, 235, 0.35);
}

.foto-card.sin-foto-card {
  border-left: 4px solid #ef4444;
}

.foto-card.con-foto-card {
  border-left: 4px solid #10b981;
}

.foto-status-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
}

.foto-status-badge.badge-sin-foto {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.foto-status-badge.badge-con-foto {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.foto-card-avatar-wrap {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  margin: 0.5rem auto 0.85rem auto;
  border: 3px solid var(--border-color);
  background: var(--bg-secondary, #f8fafc);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  position: relative;
  cursor: pointer;
}

.foto-card-avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.foto-card-name {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 0.25rem 0;
  line-height: 1.3;
}

.foto-card-clave {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--corp-blue, #2563eb);
  background: var(--corp-blue-subtle, rgba(37,99,235,0.08));
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  margin-bottom: 0.4rem;
  display: inline-block;
}

.foto-card-puesto {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.foto-card-sede {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

.btn-card-capturar {
  margin-top: auto;
  width: 100%;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-md, 8px);
  font-size: 0.84rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
  background: linear-gradient(135deg, #1e40af, #2563eb);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
}

.btn-card-capturar:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
}

.btn-card-capturar.btn-subir-nueva {
  background: var(--bg-secondary, #f1f5f9);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  box-shadow: none;
}

.btn-card-capturar.btn-subir-nueva:hover {
  background: var(--corp-blue);
  color: #ffffff;
  border-color: var(--corp-blue);
}

/* Modal de Vista Previa y Guardado de Fotografía */
.preview-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.preview-modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.preview-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl, 16px);
  max-width: 440px;
  width: 100%;
  max-height: calc(100dvh - 2rem);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  text-align: center;
  margin: auto;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.preview-modal-backdrop.active .preview-modal-card {
  transform: scale(1);
}

.crop-preview-frame {
  width: 220px;
  height: 220px;
  margin: 1rem auto;
  border-radius: 1rem;
  overflow: hidden;
  border: 4px solid var(--corp-blue);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crop-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  display: block;
}

.preview-modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.btn-guardar-foto {
  flex: 1;
  padding: 0.7rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-md, 8px);
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
}

.btn-guardar-foto:hover {
  background: linear-gradient(135deg, #047857, #059669);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-cancelar-preview {
  padding: 0.7rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-md, 8px);
  background: var(--bg-secondary, #f1f5f9);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cancelar-preview:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.25);
}

/* ==========================================================================
   SISTEMA RESPONSIVO INTEGRAL: LAPTOPS, TABLETS Y CELULARES
   Diseñado para adaptarse dinámicamente desde 320px hasta monitores grandes
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. LAPTOPS Y MONITORES ESTÁNDAR / FULL HD (MAX-WIDTH: 1750px)
   Elimina sobrecarga horizontal en resoluciones comunes como 1920x1080 / 1366x768 / 1280x800
   -------------------------------------------------------------------------- */
@media (max-width: 1750px) {
  .top-nav {
    padding: 0.6rem 1.25rem;
  }

  .brand-wrapper {
    gap: 0.65rem;
  }

  .brand-info span.subtitle {
    display: none; /* Ahorra ~280px horizontales para prevenir desbordes */
  }

  .nav-center {
    gap: 0.25rem;
    padding: 0.2rem;
  }

  .nav-link {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
  }

  .nav-actions {
    gap: 0.45rem;
  }

  #themeToggleText {
    display: none; /* Modo oscuro solo icono en laptops */
  }

  .btn-theme-toggle {
    padding: 0.35rem 0.55rem;
  }

  .user-name {
    max-width: 150px;
  }

  .user-role {
    font-size: 0.62rem;
  }

  .btn-users-header,
  .btn-logout,
  .btn-install-pwa {
    padding: 0.32rem 0.6rem;
    font-size: 0.76rem;
  }

  .live-badge,
  .clock-display {
    padding: 0.25rem 0.5rem;
    font-size: 0.72rem;
  }
}

/* --------------------------------------------------------------------------
   0.1 LAPTOPS COMPACTAS Y RESOLUCIONES MEDIANAS (MAX-WIDTH: 1250px)
   -------------------------------------------------------------------------- */
@media (max-width: 1250px) {
  .container,
  .report-container {
    padding: 1.25rem 1.5rem;
    max-width: 100%;
  }

  .user-name {
    max-width: 115px;
  }

  .filter-row-primary {
    gap: 0.85rem;
  }

  .filter-actions-group {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }

  .exceso-toolbar-card {
    gap: 1rem;
  }

  .exceso-kpi-card {
    min-width: 150px;
    padding: 0.5rem 0.75rem;
  }
}

/* --------------------------------------------------------------------------
   1. TABLETS Y PANTALLAS MEDIANAS (MAX-WIDTH: 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  /* Contenedores */
  .container,
  .report-container {
    padding: 1rem 1.25rem 2.5rem 1.25rem;
    max-width: 100%;
    width: 100%;
  }

  /* Header Superior en Tablet */
  .top-nav {
    padding: 0.65rem 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .brand-wrapper {
    gap: 0.75rem;
  }

  .brand-info h1 {
    font-size: 0.95rem;
  }

  .brand-info span.subtitle {
    display: none;
  }

  .nav-center {
    order: 3;
    width: 100%;
    justify-content: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.25rem 0.5rem;
    gap: 0.35rem;
  }

  .nav-center::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    font-size: 0.78rem;
    padding: 0.4rem 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .nav-actions {
    gap: 0.5rem;
    margin-left: auto;
  }

  .user-name {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Dashboard: KPIs y Grids */
  .stats-banner {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }

  .stats-banner .stat-card:last-child {
    grid-column: span 2;
  }

  .puestos-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }

  /* Terminal Caseta */
  .caseta-layout {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  /* Módulo de Reportes en Tablet */
  .report-filters-card {
    padding: 1.15rem;
  }

  .filter-row-primary {
    gap: 1rem;
    flex-wrap: wrap;
  }

  .filter-row-secondary {
    grid-template-columns: repeat(2, 1fr);
  }

  .report-kpis-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }

  /* Módulo de Fotos en Tablet */
  .fotos-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
  }

  /* Modales en Tablet */
  .modal-card {
    max-width: 94vw;
  }

  .incidencia-form-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .incidencia-form-grid .filter-group[style*="grid-column: span 2"] {
    grid-column: span 2;
  }
}

/* --------------------------------------------------------------------------
   2. CELULARES Y TABLETS COMPACTAS (MAX-WIDTH: 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Contenedores globales */
  .container,
  .report-container {
    padding: 0.75rem 0.65rem 2rem 0.65rem;
    width: 100%;
    max-width: 100%;
  }

  /* Header Móvil Compacto */
  .top-nav {
    padding: 0.5rem 0.75rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .brand-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.6rem;
    width: 100%;
  }

  .nav-logo-img {
    height: 32px;
    max-width: 110px;
  }

  .brand-info h1 {
    font-size: 0.88rem;
    line-height: 1.2;
  }

  .brand-info span.subtitle {
    display: none; /* Ahorra espacio vertical valioso en móviles */
  }

  /* Fila de navegación con scroll táctil limpio */
  .nav-center {
    width: 100%;
    order: 2;
    display: flex;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-radius: var(--radius-md);
    padding: 0.25rem 0.35rem;
    gap: 0.3rem;
  }

  .nav-center::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    font-size: 0.75rem;
    padding: 0.4rem 0.65rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Barra de acciones: Perfil, Tema, Estatus y Reloj (Totalmente libre de solapamientos) */
  .nav-actions {
    width: 100%;
    order: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding-top: 0.45rem;
    border-top: 1px solid var(--border-color);
  }

  /* Descomponer contenedor para que sus botones e identidad participen en flex wrap fluido */
  .user-header-profile {
    display: contents;
  }

  /* Fila 1 en móvil: Identidad del usuario + Botones utilitarios compactos */
  .user-chip-tag {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100% - 150px);
    padding: 0.22rem 0.5rem;
    font-size: 0.74rem;
  }

  .user-meta-text {
    min-width: 0;
    overflow: hidden;
  }

  .user-name {
    max-width: 100%;
    font-size: 0.74rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    line-height: 1.2;
  }

  .user-role {
    font-size: 0.62rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    line-height: 1.1;
  }

  .btn-logout {
    order: 2;
    flex-shrink: 0;
    padding: 0.32rem 0.6rem;
    font-size: 0.72rem;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn-theme-toggle {
    order: 3;
    flex-shrink: 0;
    padding: 0.32rem 0.55rem;
    font-size: 0.75rem;
    min-height: 32px;
  }

  #themeToggleText {
    display: none; /* Solo icono de luna/sol en celulares */
  }

  .btn-install-pwa {
    order: 4;
    flex-shrink: 0;
    padding: 0.32rem 0.6rem;
    font-size: 0.72rem;
    min-height: 32px;
  }

  /* Fila 2 en móvil: Botón Usuarios (Supervisor) + Indicador En Vivo + Reloj */
  .btn-users-header {
    order: 10;
    flex: 1 1 auto;
    min-width: 115px;
    justify-content: center;
    padding: 0.35rem 0.65rem;
    font-size: 0.76rem;
    min-height: 32px;
  }

  .live-badge {
    order: 11;
    flex-shrink: 0;
    padding: 0.28rem 0.55rem;
    font-size: 0.7rem;
    min-height: 32px;
    margin-left: auto;
  }

  .clock-display {
    order: 12;
    flex-shrink: 0;
    padding: 0.28rem 0.55rem;
    font-size: 0.74rem;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
  }

  /* Selector de Zonas */
  .zone-selector-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 0.75rem 0.85rem !important;
    gap: 0.6rem !important;
    margin-bottom: 1rem !important;
  }

  .zone-selector-bar > div:last-child {
    max-width: 100% !important;
    width: 100% !important;
  }

  .zone-tabs-wrap {
    display: flex !important;
    width: 100% !important;
    gap: 0.35rem !important;
    overflow: visible !important;
    padding-bottom: 0 !important;
  }

  .zone-tab-btn {
    flex: 1 1 0px !important;
    min-width: 0 !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0.45rem 0.25rem !important;
    font-size: 0.74rem !important;
    white-space: nowrap !important;
    text-align: center !important;
  }

  .zone-tab-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Banner de Estadísticas Globales */
  .stats-banner {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
    margin-bottom: 1.25rem !important;
  }

  .stats-banner .stat-card:last-child {
    grid-column: span 1 !important;
  }

  .stat-card {
    padding: 0.95rem 1.1rem;
  }

  .stat-number {
    font-size: 1.65rem;
  }

  /* Encabezados y Toolbar Rápido */
  .section-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.65rem !important;
    margin-bottom: 0.85rem !important;
  }

  .section-title {
    font-size: 1.1rem !important;
  }

  .quick-toolbar {
    display: flex !important;
    width: 100% !important;
    gap: 0.35rem !important;
    flex-wrap: wrap !important;
  }

  .quick-toolbar .btn,
  .quick-toolbar .btn-accordion-all {
    flex: 1 1 45% !important;
    min-width: 120px !important;
    justify-content: center !important;
    font-size: 0.72rem !important;
    padding: 0.45rem 0.5rem !important;
  }

  /* Buscador de Personal en Dashboard */
  .dashboard-search-container {
    margin: 0.65rem 0 1rem 0;
  }

  .dashboard-search-field {
    font-size: 0.84rem;
    padding: 0.65rem 2.2rem 0.65rem 2.4rem;
  }

  /* Grids de Puestos (Cajones) */
  .puestos-grid {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
  }

  .cajon-card {
    padding: 0.85rem 0.95rem;
  }

  .cajon-top {
    min-height: auto;
  }

  .puesto-name {
    font-size: 0.86rem;
    max-width: none;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  .cajon-counter .presentes {
    font-size: 1.35rem;
  }

  .cajon-counter .esperados {
    font-size: 1.05rem;
  }

  /* Feed en Vivo */
  .feed-card {
    padding: 1rem 0.85rem;
  }

  .feed-item {
    padding: 0.55rem 0.75rem;
    gap: 0.5rem;
  }

  .feed-info h4 {
    font-size: 0.82rem;
  }

  .feed-meta {
    font-size: 0.7rem;
    flex-wrap: wrap;
    gap: 0.3rem;
  }

  .feed-right {
    flex-shrink: 0;
  }

  .feed-time {
    font-size: 0.76rem;
  }

  /* --------------------------------------------------------------------------
     MODALES EN CELULARES (SOLUCIÓN CRÍTICA DE DESBORDE Y TAMAÑO)
     -------------------------------------------------------------------------- */
  .photo-modal-backdrop,
  .modal-backdrop,
  .preview-modal-backdrop {
    padding: 0.5rem !important;
    align-items: center !important;
  }

  .photo-modal-card {
    width: 100% !important;
    max-width: 440px !important;
    max-height: calc(100dvh - 1rem) !important;
    max-height: 95vh !important;
    padding: 1.15rem 0.95rem !important;
    border-radius: var(--radius-md) !important;
  }

  .photo-modal-layout {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  .photo-modal-col-profile {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
  }

  .photo-modal-col-actions {
    border-top: 1px dashed var(--border-color) !important;
    padding-top: 0.75rem !important;
  }

  .photo-modal-img-wrap {
    width: 130px !important;
    height: 130px !important;
    margin: 0.25rem auto 0.65rem auto !important;
    border-width: 3px !important;
  }

  .btn-cambiar-foto-modal {
    font-size: 0.78rem !important;
    padding: 0.35rem 0.75rem !important;
  }

  .photo-modal-name {
    font-size: 1.05rem !important;
  }

  .photo-modal-id-badge {
    font-size: 0.82rem !important;
    padding: 0.15rem 0.55rem !important;
  }

  .photo-modal-info-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.4rem !important;
    margin-top: 0.65rem !important;
  }

  .photo-modal-info-item {
    padding: 0.45rem 0.55rem !important;
  }

  .photo-modal-info-label {
    font-size: 0.64rem !important;
  }

  .photo-modal-info-val {
    font-size: 0.78rem !important;
  }

  .modal-permiso-section {
    margin-top: 0.75rem !important;
  }

  .permiso-action-card,
  .permiso-pending-card,
  .permiso-active-card {
    padding: 0.85rem !important;
  }

  .btn-asignar-permiso,
  .btn-cancelar-permiso {
    width: 100% !important;
    min-height: 42px !important;
    font-size: 0.82rem !important;
  }

  /* Modal de Días de Descanso e Incidencias (Reportes) */
  .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 1rem) !important;
    max-height: 95vh !important;
    border-radius: var(--radius-md) !important;
  }

  .modal-header {
    padding: 0.75rem 0.85rem !important;
  }

  .modal-header h3 {
    font-size: 0.98rem !important;
  }

  .modal-header p {
    font-size: 0.72rem !important;
  }

  .modal-search-bar {
    padding: 0.65rem 0.85rem !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.4rem !important;
  }

  .modal-search-bar .search-input {
    max-width: 100% !important;
    width: 100% !important;
  }

  .modal-table-wrap {
    max-height: 42vh !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .modal-footer {
    padding: 0.65rem 0.85rem !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
  }

  .modal-footer .btn {
    width: 100% !important;
    min-height: 42px !important;
    justify-content: center !important;
  }

  /* Formulario de Incidencias en Modal */
  .incidencia-form-card {
    margin: 0.65rem 0.75rem 0 0.75rem !important;
    padding: 0.85rem !important;
  }

  .incidencia-form-grid {
    grid-template-columns: 1fr !important;
    gap: 0.65rem !important;
  }

  .incidencia-form-grid .filter-group,
  .incidencia-form-grid .filter-group[style*="grid-column: span 2"] {
    grid-column: span 1 !important;
  }

  #btnGuardarIncidencia {
    width: 100% !important;
    min-height: 42px !important;
  }

  /* Modal de Vista Previa de Fotografía (Fotos) */
  .preview-modal-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 1rem) !important;
    padding: 1.15rem 0.85rem !important;
  }

  .crop-preview-frame {
    width: 160px !important;
    height: 160px !important;
    margin: 0.65rem auto !important;
  }

  .preview-modal-actions {
    flex-direction: column !important;
    gap: 0.5rem !important;
  }

  .preview-modal-actions button {
    width: 100% !important;
    min-height: 42px !important;
    justify-content: center !important;
  }

  /* --------------------------------------------------------------------------
     MÓDULO DE REPORTES EN CELULARES
     -------------------------------------------------------------------------- */
  .report-filters-card {
    padding: 0.95rem 0.85rem;
    margin-bottom: 1rem;
  }

  .filter-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .report-export-buttons {
    width: 100%;
  }

  .btn-excel {
    width: 100%;
    justify-content: center;
    min-height: 42px;
  }

  .filter-row-primary {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .filter-preset-group {
    width: 100%;
  }

  .preset-pill-group {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    min-width: 0 !important;
    width: 100% !important;
    gap: 4px !important;
  }

  .btn-preset {
    padding: 0.45rem 0.25rem !important;
    font-size: 0.75rem !important;
    text-align: center !important;
  }

  .filter-dates-group {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    gap: 0.5rem !important;
  }

  .date-box {
    flex: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .filter-input-date {
    width: 100% !important;
    min-width: 0 !important;
  }

  .filter-actions-group {
    width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
    margin-left: 0 !important;
  }

  .filter-actions-group .btn {
    width: 100% !important;
    justify-content: center !important;
    min-height: 42px !important;
  }

  .filter-row-secondary {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .filter-select {
    width: 100% !important;
    min-width: 0 !important;
  }

  .report-kpis-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    margin-bottom: 1rem;
  }

  .report-kpi-card {
    padding: 0.75rem 0.85rem;
    gap: 0.65rem;
  }

  .kpi-icon-box {
    width: 36px;
    height: 36px;
    font-size: 1.15rem;
  }

  .kpi-val {
    font-size: 1.25rem;
  }

  /* Pestañas de Tablas */
  .tabs-header-bar {
    padding: 0.4rem 0.4rem 0 0.4rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs-header-bar::-webkit-scrollbar {
    display: none;
  }

  .report-tab-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    flex-shrink: 0;
  }

  .report-legend-bar {
    padding: 0.5rem 0.65rem;
    gap: 0.4rem 0.75rem;
    font-size: 0.72rem;
  }

  .tab-content {
    padding: 0.65rem 0.4rem;
  }

  /* Tablas con scroll horizontal y columna congelada */
  .table-responsive-wrapper {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .matrix-table th:first-child,
  .matrix-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--bg-card);
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.08);
  }

  .matrix-table th:first-child {
    background: var(--bg-primary);
    z-index: 3;
  }

  /* --------------------------------------------------------------------------
     MÓDULO DE FOTOS EN CELULARES
     -------------------------------------------------------------------------- */
  .fotos-header-banner {
    padding: 0.95rem 0.85rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .fotos-header-icon {
    width: 38px;
    height: 38px;
    font-size: 1.25rem;
  }

  .fotos-header-h2 {
    font-size: 1.05rem;
  }

  .fotos-header-desc {
    font-size: 0.76rem;
  }

  .fotos-stats-counters {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
  }

  .foto-stat-pill {
    justify-content: center;
    font-size: 0.72rem;
    padding: 0.35rem 0.3rem;
  }

  .fotos-controls-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .fotos-filter-group {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 0.35rem;
  }

  .btn-filter-foto {
    flex: 1 1 30%;
    justify-content: center;
    font-size: 0.75rem;
    padding: 0.45rem 0.5rem;
  }

  #selectSedeFoto {
    width: 100% !important;
    min-width: 0 !important;
  }

  .fotos-search-input-wrap {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }

  .fotos-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* --------------------------------------------------------------------------
     TERMINAL CASETA EN CELULARES
     -------------------------------------------------------------------------- */
  .caseta-layout {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .scanner-panel {
    padding: 1rem 0.85rem;
    gap: 0.85rem;
  }

  .gun-input {
    font-size: 1rem;
    padding: 0.75rem 0.85rem;
  }

  .result-card {
    padding: 1.25rem 0.85rem;
    min-height: auto;
  }

  .badge-avatar-huge {
    width: 70px;
    height: 70px;
    font-size: 1.65rem;
    margin-bottom: 0.65rem;
  }

  .result-name {
    font-size: 1.2rem;
  }

  .result-details {
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
  }

  /* --------------------------------------------------------------------------
     ETIQUETAS QR EN CELULARES
     -------------------------------------------------------------------------- */
  .label-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .labels-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem;
  }
}

/* --------------------------------------------------------------------------
   3. PANTALLAS ULTRA COMPACTAS (MAX-WIDTH: 480px Y 400px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  #btnInstallPwa span:last-child {
    display: none; /* En teléfonos solo muestra el icono para garantizar que quepa en fila 1 sin forzar wrap */
  }

  .btn-install-pwa {
    padding: 0.32rem 0.55rem;
  }
}

@media (max-width: 400px) {
  .brand-info h1 {
    font-size: 0.8rem;
  }

  .user-role {
    display: none; /* Oculta rol secundario en pantallas muy estrechas para no comprimir el nombre */
  }

  .user-name {
    max-width: 95px;
  }

  .stat-number {
    font-size: 1.45rem;
  }

  .cajon-counter .presentes {
    font-size: 1.2rem;
  }

  .cajon-counter .esperados {
    font-size: 0.95rem;
  }

  .fotos-stats-counters {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .report-kpis-grid {
    grid-template-columns: 1fr;
  }

  .quick-incidencia-pill-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   4. SWEETALERT2 POPUPS RESPONSIVOS
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .swal2-popup.swal2-corporate-popup {
    width: 95% !important;
    max-width: 440px !important;
    max-height: 90vh !important;
    max-height: 90dvh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 1.15rem 1rem !important;
  }

  .swal2-actions {
    flex-direction: column !important;
    width: 100% !important;
  }

  .swal2-confirm,
  .swal2-cancel {
    width: 100% !important;
    margin: 0.25rem 0 !important;
    min-height: 42px !important;
  }
}

/* ==========================================================================
   5. MÓDULO DE REPORTE DE EXCESO DE HORARIO LABORAL (>5:00 PM) Y USUARIOS
   ========================================================================== */

.exceso-toolbar-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 0.85rem;
}

.exceso-kpis-mini {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.exceso-kpi-chip {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
}

.exceso-kpi-chip .chip-label {
  color: var(--text-muted);
  font-weight: 600;
}

.exceso-kpi-chip .chip-val {
  color: var(--text-main);
  font-weight: 800;
  font-size: 1rem;
}

.exceso-kpi-chip .chip-val.text-warning {
  color: #f59e0b;
}

.toggle-exceso-control {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  user-select: none;
}

.toggle-exceso-control input[type="checkbox"] {
  accent-color: var(--corp-blue);
  width: 1.15rem;
  height: 1.15rem;
  cursor: pointer;
}

.legend-exceso-bar {
  margin-bottom: 0.85rem;
}

.sym-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 800;
}

.sym-exceso-high {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.sym-exceso-mid {
  background: rgba(249, 115, 22, 0.18);
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.35);
}

.sym-exceso-low {
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.sym-ontime {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.row-has-overtime {
  background: rgba(245, 158, 11, 0.03);
}

.overtime-cell-box {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  min-width: 62px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease;
}

.overtime-cell-box:hover {
  transform: scale(1.06);
}

.overtime-cell-box.cell-badge-overtime-high {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.overtime-cell-box.cell-badge-overtime-mid {
  background: rgba(249, 115, 22, 0.16);
  border: 1px solid rgba(249, 115, 22, 0.4);
  color: #f97316;
}

.overtime-cell-box.cell-badge-overtime-low {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #d97706;
}

.ot-exit-time {
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.15;
}

.ot-badge-tag {
  font-size: 0.67rem;
  font-weight: 800;
  margin-top: 1px;
  line-height: 1.1;
  opacity: 0.95;
}

.cell-badge-ontime {
  display: inline-block;
  padding: 0.2rem 0.45rem;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 5px;
  font-size: 0.76rem;
  font-weight: 700;
}

.cell-badge-nosalida {
  display: inline-block;
  padding: 0.15rem 0.35rem;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* ==========================================================================
   MODAL DE GESTIÓN DE USUARIOS DEL SISTEMA (dbManttoTaller)
   ========================================================================== */

.modal-users-card {
  max-width: 1040px !important;
  width: 95% !important;
  max-height: 90vh !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--border-color) !important;
  background: var(--bg-card) !important;
  overflow: hidden !important;
}

.modal-users-body {
  padding: 1rem 1.25rem !important;
  overflow-y: auto !important;
  flex: 1 !important;
}

/* Card del Formulario de Usuario */
.user-mgmt-form-card {
  background: var(--bg-item);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.95rem 1.15rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.user-mgmt-form-card:focus-within {
  border-color: var(--corp-blue-border);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.user-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.user-form-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--corp-blue);
  background: var(--corp-blue-subtle);
  border: 1px solid var(--corp-blue-border);
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.user-form-badge.mode-editing {
  color: #d97706;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
}

.user-form-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.user-inputs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.15rem;
}

.user-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.user-field-group.user-field-full {
  grid-column: span 2;
}

.user-field-group label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.01em;
}

.user-form-input,
.user-form-select {
  width: 100%;
  padding: 0.55rem 0.8rem;
  font-size: 0.86rem;
  font-family: inherit;
  color: var(--text-main);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  outline: none;
}

.user-form-input:focus,
.user-form-select:focus {
  border-color: var(--corp-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  background: var(--bg-card);
}

.user-form-input[readonly] {
  background: var(--bg-primary);
  opacity: 0.8;
  cursor: not-allowed;
}

.field-micro-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.2;
}

/* Barra de Acciones del Formulario */
.user-form-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  gap: 1rem;
  flex-wrap: wrap;
}

.user-form-msg {
  font-size: 0.82rem;
  font-weight: 700;
  min-height: 1.2rem;
}

.user-form-buttons {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn-user-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--corp-blue);
  color: #ffffff;
  border: none;
  padding: 0.5rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
  transition: all 0.2s ease;
}

.btn-user-submit:hover {
  background: var(--corp-blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.btn-user-reset {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.95rem;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-user-reset:hover {
  background: var(--bg-hover);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

/* Card de la Tabla de Usuarios */
.user-mgmt-table-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.user-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: var(--bg-item);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.75rem;
}

.user-table-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.user-table-count-pill {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--corp-blue);
  background: var(--corp-blue-subtle);
  border: 1px solid var(--corp-blue-border);
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
}

.btn-user-refresh {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-secondary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-user-refresh:hover {
  background: var(--bg-hover);
  border-color: var(--corp-blue-border);
  color: var(--corp-blue);
}

.users-table-scroll-wrapper {
  max-height: 250px;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

/* Tabla Principal de Usuarios */
.users-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.users-admin-table th {
  background: var(--bg-primary);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.70rem;
  letter-spacing: 0.05em;
  padding: 0.55rem 0.75rem;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.users-admin-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  white-space: nowrap;
  color: var(--text-main);
}

.users-admin-table tbody tr:nth-child(even) td {
  background: rgba(0, 0, 0, 0.015);
}

[data-theme="dark"] .users-admin-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

.users-admin-table tbody tr:hover td {
  background: var(--bg-hover) !important;
}

.user-row-inactive td {
  opacity: 0.7;
}

.user-login-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-avatar-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--corp-blue-dark), var(--corp-blue));
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  flex-shrink: 0;
}

.user-login-tag {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--corp-blue);
  background: var(--corp-blue-subtle);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--corp-blue-border);
}

.clave-user-tag {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

/* Badges de Roles de Usuario (Flexibles, sin ancho fijo) */
.role-badge-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.3rem !important;
  padding: 0.2rem 0.55rem !important;
  border-radius: 9999px !important;
  font-size: 0.73rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  border: 1px solid transparent !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.role-badge-pill .role-icon {
  font-size: 0.82rem;
}

.role-badge-pill .role-level-sub {
  font-size: 0.68rem;
  opacity: 0.8;
  font-weight: 600;
}

.role-badge-nivel-1 {
  background: rgba(100, 116, 139, 0.12) !important;
  color: #475569 !important;
  border-color: rgba(100, 116, 139, 0.28) !important;
}

.role-badge-nivel-2 {
  background: rgba(37, 99, 235, 0.12) !important;
  color: #2563eb !important;
  border-color: rgba(37, 99, 235, 0.28) !important;
}

.role-badge-nivel-3 {
  background: rgba(147, 51, 234, 0.12) !important;
  color: #7e22ce !important;
  border-color: rgba(147, 51, 234, 0.28) !important;
}

.role-badge-nivel-5 {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #059669 !important;
  border-color: rgba(16, 185, 129, 0.28) !important;
}

.role-badge-nivel-6 {
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.12), rgba(220, 38, 38, 0.12)) !important;
  color: #c2410c !important;
  border-color: rgba(234, 88, 12, 0.35) !important;
  font-weight: 800 !important;
  box-shadow: 0 1px 3px rgba(234, 88, 12, 0.1) !important;
}

[data-theme="dark"] .role-badge-nivel-1 {
  background: rgba(148, 163, 184, 0.16) !important;
  color: #cbd5e1 !important;
  border-color: rgba(148, 163, 184, 0.3) !important;
}

[data-theme="dark"] .role-badge-nivel-2 {
  background: rgba(59, 130, 246, 0.16) !important;
  color: #93c5fd !important;
  border-color: rgba(59, 130, 246, 0.3) !important;
}

[data-theme="dark"] .role-badge-nivel-3 {
  background: rgba(168, 85, 247, 0.16) !important;
  color: #d8b4fe !important;
  border-color: rgba(168, 85, 247, 0.3) !important;
}

[data-theme="dark"] .role-badge-nivel-5 {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #6ee7b7 !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}

[data-theme="dark"] .role-badge-nivel-6 {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(239, 68, 68, 0.2)) !important;
  color: #fdba74 !important;
  border-color: rgba(249, 115, 22, 0.45) !important;
}

/* Input y búsqueda por cCvePer */
.user-cve-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.user-cve-input-wrap .user-form-input {
  padding-right: 2.5rem;
}

.btn-buscar-cve {
  position: absolute;
  right: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn-buscar-cve:hover {
  background: rgba(0, 0, 0, 0.06);
  transform: scale(1.1);
}

.badge-enter-hint {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(30, 58, 138, 0.08);
  color: var(--corp-blue);
  margin-left: 0.35rem;
  vertical-align: middle;
}

[data-theme="dark"] .badge-enter-hint {
  background: rgba(96, 165, 250, 0.16);
  color: #93c5fd;
}

/* Indicador de quién autorizó el permiso en la card */
.p-permiso-autorizado {
  display: block;
  font-size: 0.69rem;
  font-weight: 600;
  color: #b45309;
  margin-top: 1px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

[data-theme="dark"] .p-permiso-autorizado {
  color: #fcd34d;
}

/* Badges de Estado */
.status-badge-pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  padding: 0.22rem 0.65rem !important;
  border-radius: 9999px !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  width: auto !important;
  height: auto !important;
}

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

.status-badge-pill.status-active {
  background: rgba(16, 185, 129, 0.14) !important;
  color: #059669 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
}

.status-badge-pill.status-active .status-dot {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.status-badge-pill.status-inactive {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #dc2626 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.status-badge-pill.status-inactive .status-dot {
  background: #ef4444;
}

/* Botones de Acción de Usuario */
.user-actions-btn-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.btn-user-action {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.52rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 5px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-user-action.btn-action-edit:hover {
  background: var(--corp-blue-subtle);
  border-color: var(--corp-blue);
  color: var(--corp-blue);
  transform: translateY(-1px);
}

.btn-user-action.btn-action-deactivate:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #dc2626;
  transform: translateY(-1px);
}

.btn-user-action.btn-action-activate:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: #10b981;
  color: #059669;
  transform: translateY(-1px);
}

.btn-users-header {
  background: rgba(37, 99, 235, 0.12);
  color: var(--corp-blue);
  border: 1px solid var(--corp-blue);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.btn-users-header:hover {
  background: var(--corp-blue);
  color: #ffffff;
  transform: translateY(-1px);
}

/* ==========================================================================
   TOOLBAR Y KPIS MEJORADOS PARA EXCESO DE HORARIO (> 5:00 PM)
   ========================================================================== */

.exceso-toolbar-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem 1.35rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.exceso-kpis-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  flex: 1;
}

.exceso-kpi-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-item);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.6rem 0.95rem;
  min-width: 180px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.exceso-kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--corp-blue-border);
}

.exceso-kpi-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.exceso-kpi-icon.icon-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.exceso-kpi-icon.icon-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.exceso-kpi-icon.icon-info {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.exceso-kpi-content {
  display: flex;
  flex-direction: column;
}

.exceso-kpi-title {
  font-size: 0.73rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.exceso-kpi-number {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.exceso-filter-box {
  display: flex;
  align-items: center;
}

.modern-toggle-control {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  background: var(--bg-item);
  border: 1px solid var(--border-color);
  padding: 0.55rem 0.95rem;
  border-radius: 9999px;
  user-select: none;
  transition: all 0.2s ease;
}

.modern-toggle-control:hover {
  background: var(--bg-card-hover);
  border-color: var(--corp-blue-border);
}

.modern-toggle-control input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.modern-toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  background: #cbd5e1;
  border-radius: 20px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

[data-theme="dark"] .modern-toggle-switch {
  background: #475569;
}

.modern-toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-toggle-control input:checked + .modern-toggle-switch {
  background: var(--corp-blue);
}

.modern-toggle-control input:checked + .modern-toggle-switch::after {
  transform: translateX(16px);
}

.modern-toggle-text {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

/* ==========================================================================
   REGLAS RESPONSIVAS MULTI-DISPOSITIVO (TABLET Y CELULAR)
   ========================================================================== */

@media (max-width: 992px) {
  .user-inputs-grid {
    grid-template-columns: 1fr 1fr;
  }
  .user-field-group.user-field-full {
    grid-column: span 2;
  }
}

@media (max-width: 768px) {
  .modal-users-card {
    max-width: 96vw !important;
    width: 96vw !important;
    max-height: 94vh !important;
    margin: 0.5rem auto !important;
  }
  .modal-users-body {
    padding: 0.85rem !important;
  }
  .user-inputs-grid {
    grid-template-columns: 1fr;
  }
  .user-field-group.user-field-full {
    grid-column: span 1;
  }
  .user-form-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .user-form-buttons {
    flex-direction: column;
    width: 100%;
  }
  .btn-user-submit,
  .btn-user-reset {
    width: 100%;
    justify-content: center;
    min-height: 42px;
  }
  .exceso-toolbar-card {
    flex-direction: column;
    align-items: stretch;
    padding: 0.85rem;
  }
  .exceso-kpis-container {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .exceso-kpi-card {
    width: 100%;
  }
  .exceso-filter-box {
    width: 100%;
  }
  .modern-toggle-control {
    width: 100%;
    justify-content: space-between;
  }
  .matrix-table-exceso {
    min-width: 1100px;
  }
}

/* ==========================================================================
   ALERTAS RICAS EN TIEMPO REAL: SALIDAS CON PERMISO OPERATIVO
   ========================================================================== */

#permisoAlertContainer {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  pointer-events: none;
  max-width: 440px;
  width: calc(100% - 2.5rem);
}

.permiso-alert-card {
  pointer-events: auto;
  position: relative;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1.5px solid #f59e0b;
  box-shadow: 0 16px 36px -4px rgba(217, 119, 6, 0.28), 0 0 0 1px rgba(245, 158, 11, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: permisoAlertSlideIn 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="dark"] .permiso-alert-card {
  background: #182032;
  border-color: #d97706;
  box-shadow: 0 16px 40px -4px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(217, 119, 6, 0.35);
}

.permiso-alert-card.closing {
  animation: permisoAlertSlideOut 0.28s cubic-bezier(0.7, 0, 0.84, 0) forwards;
}

@keyframes permisoAlertSlideIn {
  0% {
    opacity: 0;
    transform: translateX(60px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes permisoAlertSlideOut {
  0% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(80px) scale(0.92);
  }
}

.permiso-alert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.95rem;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.08));
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

.permiso-alert-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  font-weight: 800;
  color: #b45309;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

[data-theme="dark"] .permiso-alert-title {
  color: #fbbf24;
}

.permiso-alert-title .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  animation: pulseAmber 1.5s infinite;
}

@keyframes pulseAmber {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px #f59e0b; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.permiso-alert-time {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.btn-close-permiso-alert {
  background: transparent;
  border: none;
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  transition: all 0.15s ease;
}

.btn-close-permiso-alert:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-main);
}

.permiso-alert-body {
  padding: 0.85rem 1rem 0.65rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.permiso-alert-colab-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.permiso-alert-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #f59e0b;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-hover);
}

.permiso-alert-avatar-fallback {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #f59e0b;
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.permiso-alert-colab-info {
  flex: 1;
  min-width: 0;
}

.permiso-alert-name {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.permiso-alert-pills-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}

.permiso-tag-cve {
  font-size: 0.7rem;
  font-weight: 700;
  font-family: monospace;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-muted);
  padding: 1px 5px;
  border-radius: 4px;
}

[data-theme="dark"] .permiso-tag-cve {
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.permiso-tag-puesto {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--corp-blue);
  background: var(--corp-blue-subtle);
  padding: 1px 6px;
  border-radius: 4px;
}

.permiso-tag-sede {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Grilla de Datos de Permiso */
.permiso-alert-data-grid {
  background: var(--bg-item);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.permiso-data-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.78rem;
  gap: 0.5rem;
}

.permiso-data-lbl {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.74rem;
  flex-shrink: 0;
}

.permiso-data-val-motivo {
  font-weight: 800;
  color: #b45309;
  text-align: right;
  word-break: break-word;
}

[data-theme="dark"] .permiso-data-val-motivo {
  color: #fbbf24;
}

.permiso-data-val-autorizo {
  font-weight: 700;
  color: var(--corp-blue);
  text-align: right;
  word-break: break-word;
}

[data-theme="dark"] .permiso-data-val-autorizo {
  color: #93c5fd;
}

.permiso-impact-banner {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #92400e;
  background: rgba(245, 158, 11, 0.1);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  border-left: 3px solid #f59e0b;
}

[data-theme="dark"] .permiso-impact-banner {
  color: #fde68a;
}

.permiso-alert-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.4rem 1rem 0.75rem 1rem;
}

.btn-permiso-locate {
  background: var(--corp-blue);
  color: #ffffff;
  border: none;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-permiso-locate:hover {
  background: var(--corp-blue-dark);
  transform: translateY(-1px);
}

.btn-permiso-dismiss {
  background: var(--bg-secondary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-permiso-dismiss:hover {
  background: var(--bg-hover);
}

.permiso-alert-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: #f59e0b;
  width: 100%;
  animation: permisoProgress 14s linear forwards;
}

@keyframes permisoProgress {
  0% { width: 100%; }
  100% { width: 0%; }
}

/* Efecto de resaltado al localizar la tarjeta del colaborador en el dashboard */
.highlight-target-card {
  animation: flashTargetCard 2.5s ease-out !important;
  box-shadow: 0 0 0 4px #f59e0b, 0 8px 24px rgba(245, 158, 11, 0.4) !important;
  border-color: #f59e0b !important;
  position: relative;
  z-index: 20;
}

@keyframes flashTargetCard {
  0% { transform: scale(1.04); box-shadow: 0 0 0 6px #f59e0b, 0 12px 30px rgba(245, 158, 11, 0.6); }
  25% { transform: scale(1.02); }
  50% { transform: scale(1.04); box-shadow: 0 0 0 6px #f59e0b, 0 12px 30px rgba(245, 158, 11, 0.6); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   ESTILOS PARA TRASPASOS Y PRÉSTAMOS DE PERSONAL (CÓRDOBA ⇄ TEZONAPA)
   ========================================================================== */

.btn-prestamos-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  color: #ffffff;
  border: 1px solid #1e40af;
  border-radius: var(--radius-md);
  padding: 0.45rem 0.95rem;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(29, 78, 216, 0.25);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.btn-prestamos-nav:hover {
  background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(29, 78, 216, 0.35);
}

.badge-count-pill {
  background: #f59e0b;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  line-height: 1;
}

/* Chips en la cabecera de las tarjetas de puestos */
.chip-prestamo-recibido {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  animation: pulseLoanChip 3s infinite ease-in-out;
}

.chip-prestamo-emitido {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
}

@keyframes pulseLoanChip {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.3); }
  50% { box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }
}

/* Items de colaboradores en la lista del cajón */
.item-prestamo-recibido {
  background: linear-gradient(90deg, rgba(239, 246, 255, 0.9) 0%, rgba(255, 255, 255, 0.95) 100%) !important;
  border-left: 3.5px solid #2563eb !important;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.1) !important;
}

.item-prestamo-emitido {
  background: rgba(248, 250, 252, 0.8) !important;
  opacity: 0.75;
  border-left: 3.5px solid #94a3b8 !important;
  filter: grayscale(0.2);
}

.item-prestamo-emitido:hover {
  opacity: 1;
  filter: none;
}

.badge-colab-prestamo {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
  border-radius: 4px;
  padding: 0.08rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.badge-colab-emitido {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0.08rem 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

/* Modal de gestión de préstamos */
.modal-prestamos-card {
  max-width: 960px;
  width: 95vw;
  max-height: min(92vh, 780px);
  display: flex;
  flex-direction: column;
}

.prestamo-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  padding: 1.15rem;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.prestamo-form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.prestamo-form-field label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.prestamo-form-field select,
.prestamo-form-field input {
  height: 38px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-main);
  padding: 0 0.65rem;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.prestamo-form-field select:focus,
.prestamo-form-field input:focus {
  border-color: var(--corp-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-registrar-prestamo {
  height: 38px;
  background: var(--corp-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0 1.25rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  align-self: flex-end;
}

.btn-registrar-prestamo:hover {
  background: var(--corp-blue-dark);
  transform: translateY(-1px);
}

/* Indicador en celdas de Reportes */
.celda-asistencia-prestamo {
  position: relative;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  font-weight: 800 !important;
}

.badge-prestamo-tag {
  display: inline-block;
  font-size: 0.62rem;
  background: #2563eb;
  color: #ffffff;
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  margin-top: 2px;
  font-weight: 700;
}

.badge-prestamo-tag.emitido {
  background: #f59e0b;
}

/* Tab de préstamos en Reportes */
.tabla-prestamos-periodo th {
  background: var(--bg-primary);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.75rem;
  text-align: left;
  border-bottom: 2px solid var(--border-color);
}

.cell-badge-prestamo-recibido {
  background: rgba(37, 99, 235, 0.15) !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe !important;
  font-weight: 700;
}

.cell-badge-prestamo-emitido {
  background: #f1f5f9 !important;
  color: #64748b !important;
  border: 1px solid #cbd5e1 !important;
}

/* Badges de Modalidad de Préstamo */
.badge-tipo-prestamo {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-tipo-jornada {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-tipo-temporal {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}







