/* =============================================
   SISTEMA DE DISEÑO - FICHAJE CONSTRUCCIÓN
   Rediseño v3 — paleta índigo, sombras teñidas, Inter
   ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* ── FUENTE ÚNICA DE TOKENS (consolidada) ──────────────────────────────
     Registro product · base neutra + verde mínimo (FACELIFT v5) ·
     contraste AA (Impeccable). Antes vivía repartida en 3 bloques :root
     que cascadeaban (v3 → FACELIFT → Impeccable); acá ya resuelta al
     valor final. No reintroducir :root duplicados más abajo. */

  /* Acción / marca */
  --ink: #111827;                /* gray-900 — botón primario (carbón) */
  --ink-hover: #000000;
  --primary: #16a34a;            /* verde acento / éxito (mínimo) */
  --primary-dark: #15803d;
  --primary-light: #f0fdf4;
  --primary-mid: #bbf7d0;

  /* Estados */
  --success: #16a34a; --success-dark: #15803d; --success-light: #f0fdf4;
  --warning: #d97706; --warning-dark: #b45309; --warning-light: #fff7ed;
  --danger:  #dc2626; --danger-dark:  #b91c1c; --danger-light:  #fef2f2;
  --info:    #2563eb; --info-light: #eff6ff;
  --secondary: #2563eb; --secondary-light: #eff6ff;

  /* Superficies / texto */
  --bg: #f7f8fa;                 /* canvas */
  --surface: #ffffff;
  --border: #eef0f3;
  --border-dark: #e3e6eb;
  --text: #0f172a;               /* on-surface */
  --text-muted: #64748b;
  --text-light: #5b6675;         /* AA ≥4.5:1 sobre blanco/tinte */

  /* Radios */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;                /* botones / inputs */
  --radius-lg: 16px;             /* tarjetas */
  --radius-xl: 24px;             /* modales */
  --radius-full: 9999px;

  /* Sombras (teñidas frías, suaves) */
  --shadow-xs: 0 1px 2px rgba(16,24,40,0.04);
  --shadow-sm: 0 1px 3px rgba(16,24,40,0.06), 0 1px 2px rgba(16,24,40,0.04);
  --shadow:    0 4px 16px rgba(16,24,40,0.06);
  --shadow-md: 0 10px 28px rgba(16,24,40,0.08);
  --shadow-lg: 0 22px 48px rgba(16,24,40,0.14);

  /* Dimensiones del shell */
  --topbar-h: 64px;
  --sidebar-w: 260px;

  /* Escala tipográfica (pasos discretos — evita tamaños casi-idénticos)
     micro-label · meta · secundario · cuerpo · subtítulo · título · display */
  --fs-2xs:  11px;   /* micro-label en mayúscula (tablas, chips) */
  --fs-xs:   12px;   /* meta / ayudas */
  --fs-sm:   13px;   /* texto secundario */
  --fs-base: 14px;   /* cuerpo */
  --fs-md:   16px;   /* énfasis / inputs */
  --fs-lg:   19px;   /* subtítulo de sección */
  --fs-xl:   24px;   /* título de página */
  --fs-2xl:  30px;   /* display / KPI grande */
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Títulos más nítidos con tracking negativo */
h1, h2, h3, .stat-value, .page-title { letter-spacing: -0.02em; }

/* ---- TOPBAR ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--topbar-h);
  background: linear-gradient(135deg, #1e1b4b 0%, #4338ca 60%, #4f46e5 100%);
  color: white;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  box-shadow: 0 2px 16px rgba(30,27,75,0.35);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  color: white;
  white-space: nowrap;
}

.topbar-brand .brand-icon {
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,0.18);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.topbar-sep {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,0.2);
}

.topbar-title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.topbar-badge {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.9);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 500;
}

.topbar-btn {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.topbar-btn:hover { background: rgba(255,255,255,0.22); }

/* ---- NAV TABS ---- */
.nav-tabs {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  position: sticky;
  top: var(--topbar-h);
  z-index: 100;
  box-shadow: var(--shadow-xs);
}
.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 13px 16px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  background: none;
}
.nav-tab:hover { color: var(--primary); background: var(--primary-light); }
.nav-tab.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--primary-light); font-weight: 600; }

/* ---- LAYOUT ---- */
.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 18px;
}
.page-wrap-sm { max-width: 860px; }
.page-wrap-xs { max-width: 600px; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header-left h1 {
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.page-header-left p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ---- STAT CARDS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: default;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--stat-clr, var(--primary));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  margin-bottom: 10px;
  background: var(--stat-bg, var(--primary-light));
}
.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--stat-clr, var(--primary));
  line-height: 1;
}

.stat-success { --stat-clr: var(--success); --stat-bg: var(--success-light); }
.stat-warning { --stat-clr: var(--warning); --stat-bg: var(--warning-light); }
.stat-danger  { --stat-clr: var(--danger);  --stat-bg: var(--danger-light);  }
.stat-info    { --stat-clr: var(--info);    --stat-bg: var(--info-light);    }
.stat-purple  { --stat-clr: #7c3aed;        --stat-bg: #ede9fe;              }

/* ---- CARDS ---- */
.card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  overflow: hidden;
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fafbfd;
}
.card-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-body { padding: 20px; }

/* ---- TABLES ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; }

thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
thead th.sortable { cursor: pointer; user-select: none; }
thead th.sortable:hover { color: var(--primary); background: var(--primary-light); }

tbody tr { transition: background 0.12s; }
tbody tr:hover td { background: #f5f9ff; }
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }

/* ---- AVATAR ---- */
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  border: 2px solid var(--border);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 30px; height: 30px; font-size: 11px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-primary  { background: var(--primary-light); color: var(--primary); }
.badge-success  { background: var(--success-light); color: var(--success-dark); }
.badge-warning  { background: var(--warning-light); color: var(--warning-dark); }
.badge-danger   { background: var(--danger-light);  color: var(--danger-dark);  }
.badge-info     { background: var(--info-light);    color: var(--info); }
.badge-gray     { background: #f1f5f9; color: #475569; }
.badge-purple   { background: #ede9fe; color: #6d28d9; }
.badge-entry    { background: #dcfce7; color: #166534; }
.badge-exit     { background: #fee2e2; color: #991b1b; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-xs  { padding: 4px 9px; font-size: 11.5px; border-radius: var(--radius-sm); }
.btn-sm  { padding: 6px 12px; font-size: 12.5px; }
.btn-lg  { padding: 12px 24px; font-size: 15px; }
.btn-xl  { padding: 15px 30px; font-size: 16px; border-radius: var(--radius-lg); }
.btn-block { width: 100%; }

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); box-shadow: 0 4px 14px rgba(37,99,235,0.35); transform: translateY(-1px); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover:not(:disabled) { background: var(--success-dark); box-shadow: 0 4px 14px rgba(22,163,74,0.35); transform: translateY(-1px); }

.btn-danger  { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled)  { background: var(--danger-dark); box-shadow: 0 4px 14px rgba(220,38,38,0.35); transform: translateY(-1px); }

.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover:not(:disabled) { background: var(--warning-dark); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-dark);
  color: var(--text-muted);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

/* ---- FORMS ---- */
.form-group { margin-bottom: 15px; }
.form-label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.form-control::placeholder { color: var(--text-light); }
.form-control[type="date"] { color-scheme: light; }

.form-row { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }

.input-with-icon { position: relative; }
.input-with-icon .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
  font-style: normal;
  font-size: 14px;
}
.input-with-icon .form-control { padding-left: 36px; }

/* ---- FILTER BAR ---- */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  padding: 14px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.filter-bar .form-control { min-width: 0; background: white; }

/* ---- SEARCH ---- */
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 160px;
  max-width: 280px;
}
.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
  font-size: 13px;
}
.search-wrap .form-control { padding-left: 34px; }

/* ---- EMPTY STATE (reutilizable) ---- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 4px;
  padding: 44px 24px;
  color: var(--text-muted);
}
/* Ícono en chip (los SVG de Lucide ignoran font-size — se dimensionan por w/h) */
.empty-state .empty-icon {
  width: 52px; height: 52px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-light); margin-bottom: 8px;
}
.empty-state .empty-icon [data-lucide] { width: 24px; height: 24px; }
.empty-state p { font-size: var(--fs-md); font-weight: 700; color: var(--text); margin: 0; }
.empty-state .empty-sub { font-size: var(--fs-sm); color: var(--text-light); max-width: 340px; margin-top: 2px; }

/* ---- TOAST ---- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 380px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  font-weight: 500;
  pointer-events: all;
  animation: toastIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  background: white;
  border: 1px solid color-mix(in srgb, var(--toast-clr, var(--primary)) 28%, var(--border));
  color: var(--text);
}
.toast-success { --toast-clr: var(--success); }
.toast-error   { --toast-clr: var(--danger); }
.toast-warning { --toast-clr: var(--warning); }
.toast-info    { --toast-clr: var(--primary); }
.toast .toast-icon { display: flex; align-items: center; flex-shrink: 0; color: var(--toast-clr, var(--primary)); }
.toast .toast-icon [data-lucide],
.toast .toast-icon svg.lucide { width: 18px; height: 18px; display: block; }
.toast .toast-msg  { flex: 1; line-height: 1.4; }
.toast .toast-close {
  cursor: pointer;
  opacity: 0.35;
  font-size: 17px;
  background: none;
  border: none;
  color: inherit;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.toast .toast-close:hover { opacity: 0.8; }
@keyframes toastIn {
  from { transform: translateX(100%) scale(0.9); opacity: 0; }
  to   { transform: translateX(0) scale(1); opacity: 1; }
}
.toast.hiding {
  animation: toastOut 0.25s ease-in forwards;
}
@keyframes toastOut {
  to { transform: translateX(110%); opacity: 0; }
}

/* ---- MODAL ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(3px);
  /* Por encima del visor de fotos / comparador facial (lightbox z-index 999) para
     que los diálogos de confirmación nunca queden detrás. */
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}
.modal-backdrop.hidden { display: none; }
.modal-box {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  animation: scaleIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 20px; line-height: 1;
  padding: 0; width: 28px; height: 28px; display: flex;
  align-items: center; justify-content: center; border-radius: 50%;
}
.modal-close:hover { background: var(--bg); }
.modal-body { padding: 20px 22px; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---- ALERTS ---- */
.alert {
  padding: 11px 15px;
  border-radius: var(--radius);
  font-size: 13.5px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 15px;
  border: 1px solid transparent;
}
.alert-success { background: var(--success-light); color: #14532d; border-color: #bbf7d0; }
.alert-warning { background: var(--warning-light); color: #78350f; border-color: #fde68a; }
.alert-danger  { background: var(--danger-light);  color: #7f1d1d; border-color: #fecaca; }
.alert-info    { background: var(--info-light);    color: #164e63; border-color: #a5f3fc; }

/* ---- LOADING ---- */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}
.spinner-dark {
  border-color: rgba(0,0,0,0.1);
  border-top-color: var(--primary);
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton, .skel {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 300% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
/* Variantes reutilizables: línea de texto, número de KPI, chip/badge, avatar.
   display:inline-block para que ocupen su slot sin texto real. */
.skel { display: inline-block; vertical-align: middle; }
.skel-line  { width: 100%; height: 12px; }
.skel-num   { width: 64px;  height: 26px; border-radius: var(--radius); }
.skel-num.sm{ width: 44px;  height: 20px; }
.skel-chip  { width: 78px;  height: 20px; border-radius: var(--radius-full); }
.skel-avatar{ width: 38px;  height: 38px; border-radius: 50%; }
.skel-avatar.lg { width: 56px; height: 56px; }
/* Fila skeleton dentro de tabla: la celda lleva .skel directamente */
tbody tr.skeleton-row td { padding: 14px 16px; }
tbody tr.skeleton-row:hover td { background: transparent; }
@media (prefers-reduced-motion: reduce) {
  .skeleton, .skel { animation: none; background: #eef1f5; }
}

/* ---- FACE VERIFICATION BADGE (anti-fraude) ----
   Estado de la verificación facial por fichaje. Verde=verificado, rojo=no coincide
   (alarma fuerte), ámbar=no se pudo verificar (revisión). Pill con punto/ícono. */
.face-badge {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 4px; padding: 2px 8px;
  font-size: var(--fs-2xs, 11px); font-weight: 700;
  border-radius: var(--radius-full);
  border: 1px solid transparent; white-space: nowrap;
}
.face-badge [data-lucide], .face-badge svg.lucide { width: 12px; height: 12px; }
.face-badge.fb-ok   { background: var(--success-light); color: var(--success-dark); border-color: #bbf7d0; }
.face-badge.fb-bad  { background: var(--danger-light);  color: var(--danger);       border-color: #fecaca;
                      box-shadow: 0 0 0 2px rgba(220,38,38,.10); }
.face-badge.fb-warn { background: var(--warning-light); color: var(--warning-dark);  border-color: #fde68a; }

/* ---- INFO ROWS ---- */
.info-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  width: 140px;
  flex-shrink: 0;
  padding-top: 1px;
}
.info-value { font-size: 14px; font-weight: 500; color: var(--text); }

/* ---- TAB BAR (segmented) ---- */
.tab-bar-seg {
  display: flex;
  background: var(--bg);
  padding: 4px;
  border-radius: 10px;
  gap: 2px;
}
.tab-seg {
  flex: 1;
  padding: 9px 16px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
  text-align: center;
}
.tab-seg:hover:not(.active) { color: var(--text); }
.tab-seg.active {
  background: white;
  color: var(--primary);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* ---- UTILITIES ---- */
.flex         { display: flex; }
.items-center { align-items: center; }
.gap-2        { gap: 8px; }
.gap-3        { gap: 12px; }
.flex-1       { flex: 1; }
.text-muted   { color: var(--text-muted); }
.text-small   { font-size: 12px; }
.fw-600       { font-weight: 600; }
.fw-700       { font-weight: 700; }
.w-full       { width: 100%; }
.mt-1         { margin-top: 4px; }
.mt-2         { margin-top: 8px; }
.mt-3         { margin-top: 12px; }
.mb-3         { margin-bottom: 12px; }
.truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- TABLE ACTIONS ---- */
.table-actions { display: flex; gap: 5px; flex-wrap: wrap; }

/* ---- PROGRESS ---- */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.6s ease;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .page-wrap  { padding: 14px 12px; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .nav-tabs   { padding: 0 12px; }
  .filter-bar { padding: 10px 12px; }
  thead th, tbody td { padding: 9px 10px; }
  .topbar { padding: 0 14px; }
  .topbar-brand span.brand-text { display: none; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .modal-box { border-radius: var(--radius-lg); }
}

/* ---- TABLAS → CARDS EN MÓVIL ----
   Las tablas con .table-cards dejan de scrollear horizontal y se apilan como
   tarjetas. Cada <td> muestra su columna vía data-label (::before). La primera
   celda de identidad usa .cell-head (título de la tarjeta, sin label); la celda
   de acciones usa .cell-actions (botones a lo ancho). Patrón sin JS extra. */
@media (max-width: 768px) {
  table.table-cards thead {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  table.table-cards, table.table-cards tbody { display: block; width: 100%; }
  table.table-cards tr {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    padding: 4px 14px;
    margin-bottom: 12px;
  }
  table.table-cards tr:last-child td { border-bottom: 1px solid var(--border); }
  table.table-cards tr td:last-child { border-bottom: none; }
  table.table-cards tr:hover td { background: transparent; }
  table.table-cards td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
    text-align: right;
    white-space: normal;
  }
  table.table-cards td::before {
    content: attr(data-label);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-align: left;
    flex-shrink: 0;
  }
  /* celda de identidad: título de la tarjeta, a lo ancho, sin etiqueta */
  table.table-cards td.cell-head {
    display: block; text-align: left; padding: 12px 0 10px;
  }
  table.table-cards td.cell-head::before { content: none; }
  /* celda de acciones: botones a lo ancho, sin etiqueta */
  table.table-cards td.cell-actions { display: block; text-align: left; padding-top: 11px; }
  table.table-cards td.cell-actions::before { content: none; }
  table.table-cards td.cell-actions .table-actions { flex-wrap: wrap; }
  table.table-cards td.cell-actions .table-actions .btn { flex: 1 1 auto; }
  /* filas skeleton: mantener una sola barra a lo ancho en móvil */
  table.table-cards tr.skeleton-row td { display: block; }
  table.table-cards tr.skeleton-row td::before { content: none; }
}

/* =============================================
   REDISEÑO v3 — MEJORAS GLOBALES (estética + a11y)
   ============================================= */

/* Foco visible y accesible (teclado) */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible) { outline: none; }

/* Animación de entrada escalonada para tarjetas y stats */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card, .stat-card, .report-card, .stats-grid > * {
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.stats-grid > *:nth-child(1)  { animation-delay: 0.00s; }
.stats-grid > *:nth-child(2)  { animation-delay: 0.04s; }
.stats-grid > *:nth-child(3)  { animation-delay: 0.08s; }
.stats-grid > *:nth-child(4)  { animation-delay: 0.12s; }
.stats-grid > *:nth-child(5)  { animation-delay: 0.16s; }
.stats-grid > *:nth-child(6)  { animation-delay: 0.20s; }

/* Elevación suave al pasar el mouse sobre tarjetas interactivas */
.report-card, .stat-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.report-card:hover, .stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Brillo sutil superior en botones primarios (iluminación) */
.btn-primary, button.btn-primary {
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.18);
}

/* Glassmorphism en modales */
.modal-overlay { backdrop-filter: blur(6px) saturate(140%); }

/* Respeta la preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* =============================================
   STITCH LAYOUT v4 — Sidebar 260px + topbar claro
   (basado en el design system "Gestionando Empleos")
   Sobrescribe .topbar/.nav-tabs originales.
   ============================================= */

.app-shell { display: block; }

/* ---- SIDEBAR ---- */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: #ffffff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 300;
  padding: 18px 14px;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 6px 8px 18px;
  margin-bottom: 4px;
  text-decoration: none;
  color: var(--text);
}
.sidebar-brand .brand-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, #10b981 100%);
  color: #fff; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(0,135,90,0.30);
}
.sidebar-brand .brand-text { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.sidebar-brand .brand-sub  { display: block; font-size: 11px; font-weight: 500; color: var(--text-light); margin-top: 1px; }
.sidebar-brand .sidebar-logo { height: 30px; width: auto; display: block; }

.sidebar-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; overflow-y: auto; }
.sidebar-nav .nav-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--text-light); padding: 14px 10px 6px;
}

/* Items de navegación (reusa la clase .nav-tab, ahora vertical) */
.sidebar .nav-tab {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none; border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px; font-weight: 500;
  text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s;
}
.sidebar .nav-tab .ico { width: 22px; text-align: center; font-size: 16px; flex-shrink: 0; }
.sidebar .nav-tab:hover { background: var(--bg); color: var(--text); }
.sidebar .nav-tab.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }

.sidebar-foot { margin-top: auto; padding-top: 12px; }
.help-card {
  background: linear-gradient(135deg, #00875a 0%, #2170e4 135%);
  border-radius: 12px; padding: 10px 12px; color: #fff; margin-bottom: 8px;
}
.help-card .help-title { font-size: 12px; font-weight: 700; }
.help-card .help-sub   { font-size: 10.5px; opacity: .85; margin: 2px 0 9px; line-height: 1.3; }
.help-card .help-btn {
  display: inline-block; background: rgba(255,255,255,0.95); color: var(--primary-dark);
  font-size: 11px; font-weight: 700; padding: 5px 11px; border-radius: 8px; text-decoration: none;
}
.sidebar-logout {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--text-muted); font-size: 13.5px; font-weight: 500; text-decoration: none;
  transition: background .15s, color .15s;
}
.sidebar-logout .ico { width: 22px; text-align: center; }
.sidebar-logout:hover { background: var(--danger-light); color: var(--danger-dark); }

/* ---- COLUMNA PRINCIPAL ---- */
.app-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- TOPBAR CLARO (override del gradiente índigo) ---- */
.topbar {
  position: sticky; top: 0; z-index: 200;
  height: var(--topbar-h);
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  display: flex; align-items: center; gap: 14px;
  padding: 0 28px;
  box-shadow: none;
}
.topbar-title { flex: 1; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.topbar-badge {
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-muted); padding: 6px 12px; border-radius: var(--radius-full);
  font-size: 12.5px; font-weight: 600;
}
.topbar-btn {
  background: #fff; border: 1px solid var(--border-dark); color: var(--text-muted);
  padding: 7px 14px; border-radius: var(--radius-full); cursor: pointer;
  font-size: 13px; font-weight: 600; text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; transition: all .18s;
}
.topbar-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.sidebar-toggle {
  display: none;
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--text); padding: 0; width: 34px; line-height: 1;
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(2,32,71,0.35); z-index: 290;
  backdrop-filter: blur(2px);
}

/* refresh badge (dashboard) en versión clara */
.refresh-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--primary-light); border: 1px solid var(--primary-mid);
  color: var(--primary-dark); padding: 6px 13px; border-radius: var(--radius-full);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.refresh-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); animation: pulseDot 2s infinite; }
@keyframes pulseDot {
  0%   { box-shadow: 0 0 0 0 rgba(0,135,90,0.45); }
  70%  { box-shadow: 0 0 0 7px rgba(0,135,90,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,135,90,0); }
}

/* Acción esmeralda (en vez de azul índigo) en botones/inputs */
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); box-shadow: 0 6px 18px rgba(0,135,90,0.30); transform: translateY(-1px); }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,135,90,0.14); }
.nav-tab:hover { background: transparent; }   /* neutraliza hover horizontal viejo */

/* ---- MÓVIL: sidebar deslizable ---- */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-overlay { display: block; }
  .app-main { margin-left: 0; }
  .sidebar-toggle { display: inline-flex; align-items: center; }
  .topbar { padding: 0 16px; }
}

/* =============================================================
   FACELIFT v5 — Estilo Edgelabs / Aloom
   Base neutra · botones carbón · iconos Lucide · verde mínimo
   (tokens ya consolidados en el :root canónico de arriba) */

body { color: var(--text); letter-spacing: -0.006em; }

/* ---- ICONOS LUCIDE ---- */
[data-lucide], svg.lucide {
  width: 18px; height: 18px; stroke-width: 2;
  vertical-align: middle; flex-shrink: 0; display: inline-block;
}
.btn [data-lucide], .btn svg.lucide { width: 16px; height: 16px; }
.topbar-btn svg.lucide, .topbar-btn [data-lucide] { width: 15px; height: 15px; }

/* punto de color para leyendas (reemplaza círculos emoji) */
.leg-dot { display:inline-block; width:9px; height:9px; border-radius:50%;
  background: var(--d, #94a3b8); vertical-align: middle; flex-shrink:0; }

/* ---- BOTONES (primario carbón, verde = confirmar) ---- */
.btn { border-radius: 10px; font-weight: 600; gap: 7px; }
.btn-primary { background: var(--ink); color: #fff; box-shadow: var(--shadow-xs); }
.btn-primary:hover:not(:disabled) { background: var(--ink-hover); box-shadow: 0 8px 20px rgba(17,24,39,0.22); transform: translateY(-1px); }
.btn-primary, button.btn-primary { box-shadow: var(--shadow-xs); }
.btn-success { background: var(--primary); color: #fff; }
.btn-success:hover:not(:disabled) { background: var(--primary-dark); box-shadow: 0 8px 20px rgba(22,163,74,0.26); transform: translateY(-1px); }
.btn-danger { background: var(--danger); color:#fff; }
.btn-danger:hover:not(:disabled){ background: var(--danger-dark); box-shadow: 0 8px 20px rgba(220,38,38,0.24); transform: translateY(-1px); }
.btn-warning { background: var(--warning); color:#fff; }
.btn-outline { background:#fff; border:1px solid var(--border-dark); color: var(--text); }
.btn-outline:hover:not(:disabled){ border-color: #cbd2db; color: var(--ink); background:#fff; box-shadow: var(--shadow-sm); }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

/* ---- BADGES con punto de estado ---- */
.badge { border-radius: 9999px; font-weight: 600; padding: 4px 10px 4px 9px; gap: 6px; font-size: 11.5px; line-height: 1.4; }
.badge-success, .badge-entry { background: var(--primary-light); color: var(--primary-dark); }
.badge-warning { background: var(--warning-light); color: #b45309; }
.badge-danger, .badge-exit { background: var(--danger-light); color: var(--danger-dark); }
.badge-info { background: var(--info-light); color: #1d4ed8; }
.badge-primary { background: #f1f5f9; color: #334155; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-purple { background: #faf5ff; color: #7e22ce; }
.badge-success::before, .badge-entry::before, .badge-warning::before,
.badge-danger::before, .badge-exit::before, .badge-info::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}

/* ---- STAT / KPI cards (fondo pastel, ícono arriba-derecha) ---- */
.stat-card {
  background: var(--stat-bg, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: none;
  padding: 18px 18px 16px;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.stat-card::after { display: none !important; }
.stat-icon {
  position: absolute; top: 16px; right: 16px; margin: 0;
  width: 34px; height: 34px; border-radius: 10px;
  background: rgba(255,255,255,0.7); border: 1px solid rgba(15,23,42,0.05);
}
.stat-icon [data-lucide], .stat-icon svg.lucide { width: 18px; height: 18px; color: var(--stat-clr, var(--text-muted)); }
.stat-label { color: var(--stat-clr, var(--text-muted)); opacity: .9; padding-right: 40px; }
.stat-value { color: var(--text); font-weight: 700; }
.stat-success { --stat-bg:#f0fdf4; --stat-clr:#15803d; }
.stat-warning { --stat-bg:#fff7ed; --stat-clr:#c2410c; }
.stat-danger  { --stat-bg:#fef2f2; --stat-clr:#b91c1c; }
.stat-info    { --stat-bg:#eff6ff; --stat-clr:#1d4ed8; }
.stat-purple  { --stat-bg:#faf5ff; --stat-clr:#7e22ce; }

/* ---- SIDEBAR refinado (activo neutro + ícono verde) ---- */
.sidebar { padding: 16px 12px; }
.sidebar-brand .brand-icon { background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%); box-shadow: 0 6px 16px rgba(22,163,74,0.30); }
.sidebar .nav-tab { position: relative; border-radius: 9px; padding: 9px 11px; color: #475569; }
.sidebar .nav-tab .ico [data-lucide], .sidebar .nav-tab .ico svg.lucide { width: 18px; height: 18px; color: #94a3b8; }
.sidebar .nav-tab:hover { background: var(--bg); color: var(--text); }
.sidebar .nav-tab:hover .ico [data-lucide] { color: #64748b; }
.sidebar .nav-tab.active { background: #f1f5f9; color: var(--text); font-weight: 600; }
.sidebar .nav-tab.active .ico [data-lucide], .sidebar .nav-tab.active .ico svg.lucide { color: var(--primary); }
.sidebar .nav-tab.active::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--primary);
}
.help-card { background: linear-gradient(135deg, #15803d 0%, #22c55e 90%, #4ade80 130%); }
.sidebar-logout .ico [data-lucide] { width: 18px; height: 18px; }

/* ---- TOPBAR ---- */
.topbar-title { font-size: 17px; }
.sidebar-toggle [data-lucide] { width: 22px; height: 22px; }

/* ---- TABLAS / pills de items ---- */
thead th { font-size: 10.5px; letter-spacing: 0.6px; color: var(--text-light); background: #fcfcfd; }
tbody tr:hover td { background: #fafbfc; }
.tag, .item-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 9999px;
  background: #f1f5f9; color: #475569; font-size: 12px; font-weight: 500;
}

/* ---- INPUTS foco verde ---- */
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,163,74,0.14); }

/* ---- TOAST / icon sizing ---- */
.toast .toast-icon [data-lucide] { width: 18px; height: 18px; }
.toast-success .toast-icon [data-lucide] { color: var(--primary); }
.toast-error   .toast-icon [data-lucide] { color: var(--danger); }
.toast-warning .toast-icon [data-lucide] { color: var(--warning); }
.toast-info    .toast-icon [data-lucide] { color: var(--info); }

/* refresh badge (dashboard live) */
.refresh-badge { background:#f1f5f9; border:1px solid var(--border-dark); color:#334155; }
.refresh-dot { background: var(--primary); }

/* =============================================================
   POLISH v6 — microinteracciones de botones
   transición con rebote · lift + sombra de color · iluminación
   radial que sigue al cursor (--mx/--my desde JS)
   ============================================================= */
.btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform .18s cubic-bezier(.22,1,.36,1),
              box-shadow .24s ease, background .18s ease, border-color .18s ease, filter .18s ease;
  will-change: transform;
}
/* capa de iluminación (spotlight que sigue al mouse) */
.btn::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity .28s ease;
  background: radial-gradient(140px circle at var(--mx,50%) var(--my,50%),
              rgba(255,255,255,.40), rgba(255,255,255,0) 55%);
  z-index: -1;   /* sobre el fondo, debajo del texto (queda nítido) */
}
/* glow visible solo en botones clave (sólidos) */
.btn-primary:hover:not(:disabled)::after,
.btn-success:hover:not(:disabled)::after,
.btn-danger:hover:not(:disabled)::after,
.btn-warning:hover:not(:disabled)::after,
.btn-glow:hover:not(:disabled)::after { opacity: 1; }
/* botón claro (outline): brillo sutil oscuro en vez de blanco */
.btn-outline::after {
  background: radial-gradient(140px circle at var(--mx,50%) var(--my,50%),
              rgba(22,163,74,.12), rgba(22,163,74,0) 55%);
}
.btn-outline:hover:not(:disabled)::after { opacity: 1; }

/* lift + sombra teñida segun tipo */
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(17,24,39,.26); }
.btn-success:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(22,163,74,.30); }
.btn-danger:hover:not(:disabled)  { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(220,38,38,.28); }
.btn-warning:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(217,119,6,.28); }
.btn-outline:hover:not(:disabled) { transform: translateY(-1px); }
/* presión al click */
.btn:active:not(:disabled) { transform: translateY(0) scale(.96); transition-duration: .05s; }

/* botones del topbar: lift suave + sombra */
.topbar-btn { transition: transform .16s ease, box-shadow .2s ease, border-color .18s, color .18s, background .18s; }
.topbar-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* nav del sidebar: deslizamiento sutil al hover */
.sidebar .nav-tab { transition: background .15s, color .15s, transform .15s ease; }
.sidebar .nav-tab:hover { transform: translateX(2px); }

/* tarjetas de acceso rápido / stat: realce al hover */
.quick-card, .report-card { transition: transform .2s cubic-bezier(.22,1,.36,1), box-shadow .24s ease, border-color .2s; }
.quick-card:hover, .report-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-dark); }

/* botón de ayuda del sidebar */
.help-card .help-btn { transition: transform .16s ease, box-shadow .2s ease; }
.help-card .help-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(0,0,0,.18); }

@media (prefers-reduced-motion: reduce) {
  .btn, .btn::after, .topbar-btn, .sidebar .nav-tab, .quick-card, .report-card { transition: none !important; }
  .btn:hover, .quick-card:hover, .report-card:hover { transform: none !important; }
}

/* =============================================================
   V7 — Ancho completo + más color (Stitch) + más dinamismo
   ============================================================= */

/* ---- ANCHO COMPLETO ---- */
/* app-main era flex-column: con margin:0 auto el page-wrap (flex item) se
   encogía al contenido en vez de estirarse. En block fluye normal y llena. */
.app-main      { display: block; }
.page-wrap     { width: 100%; max-width: 1680px; padding: 26px 32px; }
.page-wrap-sm  { max-width: 1280px; }
.page-wrap-xs  { max-width: 660px; }
@media (max-width: 900px) { .page-wrap { padding: 16px 14px; } }

/* ---- PALETA EXTENDIDA (tonos Stitch + acentos divertidos) ---- */
.stat-teal    { --stat-bg:#e3fbf4; --stat-clr:#0d9488; }
.stat-cyan    { --stat-bg:#e6f8ff; --stat-clr:#0e7490; }
.stat-blue    { --stat-bg:#e7f0ff; --stat-clr:#1d4ed8; }
.stat-indigo  { --stat-bg:#eef0ff; --stat-clr:#4f46e5; }
.stat-pink    { --stat-bg:#ffeef6; --stat-clr:#be185d; }
.stat-amber   { --stat-bg:#fff4e2; --stat-clr:#c2410c; }

/* KPI cards: fondo con leve degradé + ícono que reacciona */
.stat-card {
  background: linear-gradient(150deg, var(--stat-bg, #fff) 0%, #ffffff 118%);
  transition: transform .2s cubic-bezier(.22,1,.36,1), box-shadow .24s ease, border-color .2s;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--stat-clr, #94a3b8) 30%, var(--border)); }
.stat-icon { transition: transform .22s cubic-bezier(.22,1,.36,1), background .2s; }
.stat-card:hover .stat-icon { transform: scale(1.14) rotate(-6deg); background: #fff; }
.stat-value { transition: color .2s; }

/* ---- CHIPS DE COLOR en títulos de tarjeta (estilo Aloom) ---- */
.card-title { gap: 10px; }
.card-title > [data-lucide], .card-title > svg.lucide {
  width: 17px; height: 17px;
  color: var(--primary-dark);
  background: var(--primary-light);
  padding: 6px; border-radius: 9px;
  box-sizing: content-box;
}

/* ---- FILAS DE TABLA con realce dinámico ---- */
/* Solo realce de fondo en hover (sin side-stripe: Impeccable lo marca como
   decorativo en registro product). */
tbody tr { transition: background .14s ease; }
tbody tr:hover td { background: #f5faf7; }

/* ---- AVATARS: pop al hover ---- */
.avatar { transition: transform .18s ease, box-shadow .18s ease; }
.avatar:hover { transform: scale(1.08); box-shadow: var(--shadow-sm); z-index: 2; }

/* ---- TABS / segmentos: indicador animado ---- */
.tab-seg, .tab-bar-seg .tab-seg { transition: background .22s ease, color .18s ease, box-shadow .22s ease, transform .15s ease; }
.tab-seg:hover:not(.active) { transform: translateY(-1px); }
.tab-seg.active { transform: translateY(-1px); }

/* ---- BADGES / chips: micro-pop ---- */
.badge { transition: transform .15s ease, box-shadow .15s ease; }
.badge:hover { transform: translateY(-1px); }
.filter-chip, .chip { transition: transform .15s ease, background .18s, color .18s, border-color .18s; }
.filter-chip:hover, .chip:hover { transform: translateY(-1px); }

/* (Sin entrada escalonada de tarjetas: en registro product la carga
   orquestada decora sin comunicar estado — desactivada a propósito.) */

/* ---- NAVEGADOR DE FECHA (compartido dashboard / parte diario) ---- */
.date-nav-btn {
  width: 34px; height: 34px; border-radius: var(--radius);
  border: 1px solid var(--border); background: #fff;
  cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text); transition: background .15s ease, border-color .15s ease;
}
.date-nav-btn:hover { background: var(--bg); border-color: var(--border-dark); }
.date-nav-btn [data-lucide] { width: 16px; height: 16px; }

/* ---- LINKS con subrayado animado ---- */
a.link-anim { position: relative; text-decoration: none; }
a.link-anim::after { content:''; position:absolute; left:0; bottom:-2px; width:100%; height:2px;
  background: var(--primary); transform: scaleX(0); transform-origin: right; transition: transform .25s ease; }
a.link-anim:hover::after { transform: scaleX(1); transform-origin: left; }

@media (prefers-reduced-motion: reduce) {
  .stat-card, .stat-icon, .card, .report-card, .avatar, .tab-seg, .badge { animation: none !important; transition: none !important; }
  .stat-card:hover, .avatar:hover, .badge:hover { transform: none !important; }
}

/* =============================================================
   IMPECCABLE FIXES — auditoría design-skill (registro product)
   Contraste AA · sin side-stripe · sin carga orquestada ·
   motion que comunica estado (no decora) · easing sin rebote
   (--text-light AA, side-stripe y carga orquestada ya resueltos arriba) */
/* KPI: sombra contenida (evita "ghost-card" borde+sombra ancha) e ícono que NO rota (decorativo) */
.stat-card:hover { box-shadow: 0 6px 16px rgba(16,24,40,0.08); }
.stat-card:hover .stat-icon { transform: scale(1.06); }
/* foco accesible visible en todo control interactivo */
a:focus-visible, button:focus-visible, .btn:focus-visible, .nav-tab:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--radius-xs);
}
