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

:root {
  --color-bg: #f1f5f9;
  --color-surface: #ffffff;
  --color-text: #0f172a;
  --color-text-secondary: #64748b;
  --color-border: #e2e8f0;
  --color-nav: #0f172a;
  --color-nav-text: #ffffff;
  --color-accent: #2563eb;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 14px 36px rgba(15, 23, 42, 0.16);

  --module-captacion: #2563eb;
  --module-relaciones: #059669;
  --module-capacitacion: #ea580c;
  --module-bienestar: #db2777;
  --module-seguridad: #dc2626;
  --module-seguridad-fisica: #334155;
  --module-compensacion: #7c3aed;
  --module-plantilla: #0d9488;
  --module-repositorio: #06b6d4;
  --module-chatfiat: #4f46e5;
  --module-desarrollo: #d97706;
  --module-finanzas: #1e3a8a;
  --module-oportunidades: #059669;
  --module-usuarios: #0ea5e9;
  --module-gourmet: #a16207;
  --module-ti: #0e7490;
  --module-venta-autos: #0369a1;
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

input, button, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}
* {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

/* ===== LOGIN ===== */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(37, 99, 235, 0.10), transparent 60%),
    radial-gradient(700px 420px at 0% 110%, rgba(217, 119, 6, 0.10), transparent 60%),
    linear-gradient(180deg, #f8fafc, #f1f5f9);
  position: relative;
  overflow: hidden;
}

.login-page > canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.login-page > * {
  position: relative;
  z-index: 1;
}

.login-logo {
  width: 100%;
  max-width: 360px;
  text-align: center;
  margin-bottom: 32px;
}

.login-circle {
  width: 100%;
  height: 94px;
  margin: 0 auto;
  background: transparent url('../icons/braindev_logo.svg') center / contain no-repeat;
}

.login-form {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

.login-form::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 4px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(90deg, #2563eb, #4f46e5, #db2777);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  color: var(--color-text-secondary);
}

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.password-field {
  position: relative;
}

.password-field .form-input {
  padding-right: 44px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}

.password-toggle:hover {
  color: var(--color-text);
  background: var(--color-bg);
}

.btn {
  height: 44px;
  padding: 0 24px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-text);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  height: 44px;
  padding: 0 16px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.login-form .btn-block {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.login-form .btn-block:hover {
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.4);
}

.login-error {
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  color: #dc2626;
  font-size: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.login-error.show {
  display: block;
}

.login-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #16a34a;
}

/* ===== LAYOUT ===== */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ===== TOP NAV ===== */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-nav);
  color: var(--color-nav-text);
  display: flex;
  align-items: center;
  padding: 0 32px;
  height: 60px;
  gap: 24px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.topnav-brand {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.12s;
}

.topnav-brand:hover {
  opacity: 0.7;
}

.topnav-brand span {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.5px;
  margin-left: 8px;
}

.topnav-logo {
  width: 94px;
  height: 36px;
  margin-right: 10px;
  display: inline-block;
  vertical-align: middle;
  background: transparent url('../icons/braindev_logo.svg') center / contain no-repeat;
  filter: brightness(0) invert(1);
}

.topnav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #fff;
}

.topnav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.topnav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.topnav-toggle.open span:nth-child(2) { opacity: 0; }
.topnav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.topnav-spacer {
  flex: 1;
}

.nav-home-icon { display: none; }

.nav-select {
  height: 36px;
  padding: 0 32px 0 12px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 13px;
  outline: none;
  appearance: none;
  cursor: pointer;
  min-width: 220px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.15s, background 0.15s;
}

.nav-select option {
  background: #1e293b;
  color: #fff;
}

.nav-select:hover {
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.12);
}

/* ===== Menú de módulos por Unidad (desplegable personalizado) ===== */
.nav-dropdown { position: relative; }
.nav-drop-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 36px;
  min-width: 220px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--color-nav);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.nav-drop-btn:hover {
  border-color: rgba(255,255,255,0.6);
  background: #f8fafc;
}
.nav-drop-btn svg { flex: none; transition: transform 0.15s; color: var(--color-nav); }
.nav-drop-icon { font-size: 16px; flex: none; display: inline-block; }
.nav-dropdown.open .nav-drop-btn svg { transform: rotate(180deg); }
.nav-drop-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-drop-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 1200;
  min-width: 280px;
  max-width: 320px;
  max-height: 62vh;
  overflow-y: auto;
  background: #fff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 40px rgba(15,23,42,0.18);
  padding: 8px;
}
.nav-dropdown.open .nav-drop-panel { display: block; }
.nav-drop-group {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 6px;
  font-size: 10.5px;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.6px;
  border-top: 1px solid #f1f5f9;
  margin-top: 6px;
}
.nav-drop-group:first-child { border-top: none; margin-top: 0; padding-top: 6px; }
.nav-drop-group i { font-size: 12px; }
.nav-drop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #1e293b;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}
.nav-drop-item:hover { background: #f1f5f9; color: #0f172a; }
.nav-drop-item i { font-size: 16px; flex: none; }
.nav-drop-item span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #1e293b; }
.nav-drop-item.current { background: #f1f5f9; color: #0f172a; font-weight: 600; }
.nav-drop-check { color: #34d399; font-size: 13px !important; }

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
}

.nav-user-menu {
  position: relative;
}

.nav-user-menu-btn {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, opacity 0.15s;
}

.nav-user-menu-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.nav-user-menu-btn:active {
  opacity: 0.7;
}

.nav-user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 270px;
  background: #ffffff;
  color: #1e293b;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(2, 6, 23, 0.28);
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 6px;
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.nav-user-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-drop-header {
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 6px;
}

.user-drop-name {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
}

.user-drop-email {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
  word-break: break-all;
}

.user-drop-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.user-drop-meta span {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
}

.user-drop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}

.user-drop-item:hover {
  background: #f1f5f9;
}

.user-drop-danger {
  color: #dc2626;
}

.user-drop-danger:hover {
  background: #fef2f2;
}

.user-drop-version {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding: 9px 14px 6px;
  border-top: 1px solid #e2e8f0;
}

.user-drop-version-label {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.user-drop-version-badge {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  background: #eef2f7;
  border: 1px solid #e2e8f0;
  padding: 2px 8px;
  border-radius: 999px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(255,255,255,0.86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.topbar-breadcrumb {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.content-area {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

/* ===== DASHBOARD GRID ===== */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.module-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.module-card:hover {
  transform: translateY(-3px);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.module-card-accent {
  width: 100%;
  height: 4px;
  position: absolute;
  top: 0;
  left: 0;
}

.module-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-top: 16px;
  margin-bottom: 6px;
}

.module-card p {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.module-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  background: var(--color-bg);
  border-radius: var(--radius-md);
}

.module-count {
  margin-top: 16px;
  font-size: 11px;
  color: var(--color-text-secondary);
}

/* Forzar que los campos de contraseña NUNCA sean mayúsculas */
input[type="password"] {
  text-transform: none !important;
}


/* ===== MODULE PAGE ===== */
.module-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.module-page-header h2 {
  font-size: 20px;
  font-weight: 700;
}

.module-actions {
  display: flex;
  gap: 8px;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  height: 44px;
  padding: 0 16px;
  font-size: 12px;
  transition: border-color 0.15s, background 0.15s;
}

.btn-outline:hover {
  border-color: var(--color-text);
  background: #f8fafc;
  transform: none;
}

/* Botones de acción dentro de tablas: compactos, uno al lado del otro */
.data-table td .btn,
.data-table td .btn-outline,
.table td .btn,
.table td .btn-outline {
  height: 30px;
  min-height: 30px;
  padding: 0 8px;
  white-space: nowrap;
}
.data-table td .btn-sm,
.table td .btn-sm {
  height: 30px;
  min-height: 30px;
  padding: 0 8px;
}
.data-table td .btn i.fi,
.table td .btn i.fi {
  font-size: 13px;
}

/* ===== MODULE LAYOUT (panel + content) ===== */
.module-layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

.module-panel {
  width: 60px;
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 10px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  justify-content: flex-start;
}

.panel-title {
  display: none;
}

.panel-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  cursor: pointer;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  transition: all 0.15s;
  position: relative;
}

.panel-item:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.panel-item.active {
  background: var(--color-bg);
  color: var(--color-text);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.panel-item i.fi {
  color: #94a3b8;
}

.panel-item.active .panel-item-indicator.bg-captacion ~ i.fi { color: var(--module-captacion); }
.panel-item.active .panel-item-indicator.bg-relaciones ~ i.fi { color: var(--module-relaciones); }
.panel-item.active .panel-item-indicator.bg-capacitacion ~ i.fi { color: var(--module-capacitacion); }
.panel-item.active .panel-item-indicator.bg-bienestar ~ i.fi { color: var(--module-bienestar); }
.panel-item.active .panel-item-indicator.bg-seguridad ~ i.fi { color: var(--module-seguridad); }
.panel-item.active .panel-item-indicator.bg-seguridad-fisica ~ i.fi { color: var(--module-seguridad-fisica); }
.panel-item.active .panel-item-indicator.bg-compensacion ~ i.fi { color: var(--module-compensacion); }
.panel-item.active .panel-item-indicator.bg-repositorio ~ i.fi { color: var(--module-repositorio); }
.panel-item.active .panel-item-indicator.bg-chatfiat ~ i.fi { color: var(--module-chatfiat); }
  .panel-item.active .panel-item-indicator.bg-desarrollo ~ i.fi { color: var(--module-desarrollo); }
  .panel-item.active .panel-item-indicator.bg-finanzas ~ i.fi { color: var(--module-finanzas); }
  .panel-item.active .panel-item-indicator.bg-oportunidades ~ i.fi { color: var(--module-oportunidades); }
  .panel-item.active .panel-item-indicator.bg-usuarios ~ i.fi { color: var(--module-usuarios); }
  .panel-item.active .panel-item-indicator.bg-gourmet ~ i.fi { color: var(--module-gourmet); }
  .panel-item.active .panel-item-indicator.bg-ti ~ i.fi { color: var(--module-ti); }
.panel-item-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  display: none;
}

.panel-item.active .panel-item-indicator {
  display: block;
}

.panel-item svg {
  width: 20px;
  height: 20px;
}

.panel-item-label {
  display: none;
}
@media (max-width: 640px) {
  .panel-item-label {
    display: block;
    font-size: 9px;
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 56px;
    margin-top: -1px;
  }
}

/* Botón "más herramientas" (solo móvil cuando hay >4) */
.panel-more-btn {
  display: none;
  cursor: pointer;
}
.panel-more-btn .panel-more-dots {
  font-size: 18px;
  letter-spacing: 2px;
  color: #94a3b8;
  line-height: 1;
}
.panel-more-popup {
  position: fixed;
  bottom: calc(62px + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  z-index: 300;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(2, 6, 23, 0.22);
  padding: 6px;
  min-width: 200px;
  max-height: 55vh;
  overflow: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.panel-more-popup.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.panel-more-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
}
.panel-more-item:hover {
  background: var(--color-bg);
}
.panel-more-item.active {
  background: var(--color-bg);
  color: var(--color-text);
  font-weight: 600;
}

.module-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.module-content {
  flex: 1;
  padding: 24px 32px;
  overflow: hidden auto;
}

#atsTableView {
  height: calc(100vh - 180px);
  overflow-y: auto;
}

#atsKanbanView {
  height: calc(100vh - 220px);
  overflow-y: auto;
}

#estUnidadesView {
  height: calc(100vh - 180px);
  overflow-y: auto;
}

.tool-section {
  display: none;
}

.tool-section.active {
  display: block;
}

.tool-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.tool-section-header h2 {
  font-size: 18px;
  font-weight: 700;
}

/* ===== INDICADORES DE GESTIÓN ===== */
.ind-subtitle {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
}

.ind-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 0;
  align-items: stretch;
}

.ind-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
  min-height: 150px;
}

.ind-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.ind-card-head i.fi {
  color: var(--module-color);
}

.ind-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.ind-value-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ind-divider {
  border-top: 1px solid var(--color-border);
}

.ind-val1-sub {
  font-size: 12px;
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}

.ind-value-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ind-val2-label {
  font-size: 11px;
  color: var(--color-text-secondary);
  text-align: left;
}

.ind-hint {
  margin-top: auto;
  padding-top: 6px;
  font-size: 11px;
  color: var(--color-text-secondary);
}

.ind-sub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text);
  padding-top: 5px;
}

.ind-sub strong {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

#tool-indicadores {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  align-items: stretch;
}

#tool-indicadores.ind-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#tool-indicadores.ind-cols-3 > .ind-section {
  min-width: 0;
}

#tool-indicadores.ind-cols-3 > .ind-table-section {
  grid-column: 1 / -1;
}

#tool-indicadores.active {
  display: grid;
}

#tool-indicadores > .ind-grid {
  grid-column: 1 / -1;
}

@media (max-width: 920px) {
  #tool-indicadores.ind-cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  #tool-indicadores {
    grid-template-columns: 1fr;
  }
  #tool-indicadores.ind-cols-3 {
    grid-template-columns: 1fr;
  }
}

.ind-section {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.ind-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.ind-section-head i.fi {
  color: var(--module-color);
  font-size: 16px;
}

.ind-section-head h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}

.ind-section .ind-subtitle {
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.ind-donut {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px;
  flex: 1;
  width: 100%;
}

.ind-donut svg {
  flex: 0 0 auto;
  display: block;
  margin: 0 auto;
}

.ind-chart-wrap {
  position: relative;
  width: 100%;
  height: 300px;
  min-height: 300px;
  flex: 1;
}

#tool-indicadores .ind-chart-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}

[id^="indChart-"] {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 300px;
  height: 300px;
}

.ind-legend {
  display: grid;
  gap: 4px;
  min-width: 180px;
  flex: 1;
}

.ind-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.ind-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.ind-legend-label {
  color: var(--color-text);
}

.ind-legend-val {
  margin-left: auto;
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ind-legend-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  margin-top: 8px;
  border-top: 1px dashed var(--color-border);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.ind-legend-total span:last-child {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ind-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
  padding: 24px;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 13px;
}

.ind-empty::before {
  content: '◌';
  display: block;
  font-size: 34px;
  line-height: 1;
  opacity: 0.45;
}

@media (max-width: 920px) {
  .ind-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .ind-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== TABLES ===== */
.data-table {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  background: #f8fafc;
}

.data-table td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: #f8fafc;
}

#tool-indicadores .data-table {
  table-layout: fixed;
  width: 100%;
}

#tool-indicadores .ind-table-section {
  grid-column: 1 / -1;
}

#tool-indicadores .ind-table-section .tabla-scroll {
  width: 100%;
  overflow-x: auto;
}

#tool-indicadores .data-table th,
#tool-indicadores .data-table td {
  padding: 10px 12px;
  vertical-align: middle;
  overflow-wrap: break-word;
  word-break: break-word;
}

#tool-indicadores .data-table td:nth-child(2) {
  font-weight: 500;
  white-space: normal;
}

#tool-indicadores .data-table th:last-child,
#tool-indicadores .data-table td:last-child {
  padding-right: 12px;
}

#tool-indicadores .data-table th:nth-child(1),
#tool-indicadores .data-table td:nth-child(1),
#tool-indicadores .data-table th:nth-child(n+4),
#tool-indicadores .data-table td:nth-child(n+4) {
  white-space: nowrap;
}

/* Tooltip de ayuda con interrogante en encabezados de tabla */
.th-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
}
.th-help .th-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  margin-left: 5px;
  border-radius: 50%;
  background: var(--color-text-secondary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}
.th-help .th-help-text {
  visibility: hidden;
  opacity: 0;
  position: fixed;
  width: 260px;
  padding: 10px 12px;
  background: var(--color-nav);
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.55;
  text-transform: none;
  letter-spacing: 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  white-space: normal;
  text-align: left;
  z-index: 9999;
  transition: opacity 0.15s ease;
}
.th-help .th-help-text strong {
  color: #fff;
}
.th-help .th-help-text::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: var(--color-nav);
}
.th-help .th-help-text.th-help-flip::before {
  top: auto;
  bottom: -4px;
}

/* Tablas secundarias (módulos con .table) */
.table {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  background: #f8fafc;
}

.table td {
  padding: 12px 16px;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover td {
  background: #f8fafc;
}

/* Redondeo de esquinas en tablas sin overflow:hidden (para que el
   encabezado sticky no quede cuadrado sobre el borde redondeado) */
.data-table thead th:first-child,
.table thead th:first-child {
  border-top-left-radius: var(--radius-md);
}
.data-table thead th:last-child,
.table thead th:last-child {
  border-top-right-radius: var(--radius-md);
}
.data-table tbody tr:last-child td:first-child,
.table tbody tr:last-child td:first-child {
  border-bottom-left-radius: var(--radius-md);
}
.data-table tbody tr:last-child td:last-child,
.table tbody tr:last-child td:last-child {
  border-bottom-right-radius: var(--radius-md);
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--color-border);
  border-radius: 999px;
}

.badge-active {
  border-color: #a7f3d0;
  background: rgba(5, 150, 105, 0.08);
  color: #059669;
}

.badge-pending {
  border-color: #fed7aa;
  background: rgba(234, 88, 12, 0.08);
  color: #ea580c;
}

.badge-inactive {
  border-color: #fecaca;
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
}

/* ===== FORM ===== */
.form-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 640px;
  box-shadow: var(--shadow-sm);
}

.form-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
  resize: vertical;
  min-height: 100px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Module color variants */
.btn-captacion { background: var(--module-captacion); }
.btn-relaciones { background: var(--module-relaciones); }
.btn-capacitacion { background: var(--module-capacitacion); }
.btn-bienestar { background: var(--module-bienestar); }
.btn-seguridad { background: var(--module-seguridad); }
.btn-seguridad-fisica { background: var(--module-seguridad-fisica); }
.btn-compensacion { background: var(--module-compensacion); }
.btn-plantilla { background: var(--module-plantilla); }
.btn-repositorio { background: var(--module-repositorio); }
.btn-chatfiat { background: var(--module-chatfiat); }
.btn-desarrollo { background: var(--module-desarrollo); }
.btn-finanzas { background: var(--module-finanzas); }
.btn-oportunidades { background: var(--module-oportunidades); }
.btn-usuarios { background: var(--module-usuarios); }
.btn-gourmet { background: var(--module-gourmet); }
.btn-ti { background: var(--module-ti); }
.btn-venta-autos { background: var(--module-venta-autos); }

.border-captacion { border-color: var(--module-captacion); }
.border-relaciones { border-color: var(--module-relaciones); }
.border-capacitacion { border-color: var(--module-capacitacion); }
.border-bienestar { border-color: var(--module-bienestar); }
.border-seguridad { border-color: var(--module-seguridad); }
.border-compensacion { border-color: var(--module-compensacion); }
.border-plantilla { border-color: var(--module-plantilla); }
.border-repositorio { border-color: var(--module-repositorio); }
.border-chatfiat { border-color: var(--module-chatfiat); }
.border-desarrollo { border-color: var(--module-desarrollo); }
.border-finanzas { border-color: var(--module-finanzas); }
.border-oportunidades { border-color: var(--module-oportunidades); }
.border-usuarios { border-color: var(--module-usuarios); }
.border-venta-autos { border-color: var(--module-venta-autos); }

.text-captacion { color: var(--module-captacion); }
.text-relaciones { color: var(--module-relaciones); }
.text-capacitacion { color: var(--module-capacitacion); }
.text-bienestar { color: var(--module-bienestar); }
.text-seguridad { color: var(--module-seguridad); }
.text-compensacion { color: var(--module-compensacion); }
.text-plantilla { color: var(--module-plantilla); }
.text-repositorio { color: var(--module-repositorio); }
.text-chatfiat { color: var(--module-chatfiat); }
.text-desarrollo { color: var(--module-desarrollo); }
.text-finanzas { color: var(--module-finanzas); }
.text-oportunidades { color: var(--module-oportunidades); }
.text-usuarios { color: var(--module-usuarios); }
.text-venta-autos { color: var(--module-venta-autos); }

.bg-captacion { background: var(--module-captacion); }
.bg-relaciones { background: var(--module-relaciones); }
.bg-capacitacion { background: var(--module-capacitacion); }
.bg-bienestar { background: var(--module-bienestar); }
.bg-seguridad { background: var(--module-seguridad); }
.bg-seguridad-fisica { background: var(--module-seguridad-fisica); }
.bg-compensacion { background: var(--module-compensacion); }
.bg-plantilla { background: var(--module-plantilla); }
.bg-repositorio { background: var(--module-repositorio); }
.bg-chatfiat { background: var(--module-chatfiat); }
.bg-desarrollo { background: var(--module-desarrollo); }
.bg-finanzas { background: var(--module-finanzas); }
.bg-oportunidades { background: var(--module-oportunidades); }
.bg-usuarios { background: var(--module-usuarios); }
.bg-gourmet { background: var(--module-gourmet); }
.bg-ti { background: var(--module-ti); }
.bg-venta-autos { background: var(--module-venta-autos); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.empty-state h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 20px;
}

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.modal-close:hover {
  border-color: var(--color-text);
  background: var(--color-bg);
  color: var(--color-text);
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
}

.modal-footer {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
}

/* ===== LOADING ===== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--color-text-secondary);
  font-size: 13px;
}

.spinner {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 5%, var(--module-color, var(--color-text)) 45%, var(--module-color, var(--color-text)) 55%, transparent 95%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  animation: spin 0.8s linear infinite;
  margin-right: 10px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== SKELETON LOADING ===== */
.skeleton {
  position: relative;
  overflow: hidden;
  height: 14px;
  background: #e2e8f0;
  border-radius: var(--radius-sm);
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  100% { transform: translateX(100%); }
}
.skeleton-block { height: 18px; }
.skeleton-thumb {
  height: auto;
  aspect-ratio: 16/9;
  border-radius: var(--radius-md);
}
.skeleton-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.skeleton-card-body .skeleton { margin-top: 8px; }
.skeleton-card-body .skeleton:first-child { margin-top: 0; }
.skeleton-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
}
.skeleton-panel .skeleton { margin-top: 10px; }
.skeleton-panel .skeleton:first-child { margin-top: 0; }
.skeleton-table td { padding: 12px 16px; }
.skeleton-table td .skeleton { height: 13px; }
.skeleton-table td:nth-child(4n+1) .skeleton { width: 90%; }
.skeleton-table td:nth-child(4n+2) .skeleton { width: 68%; }
.skeleton-table td:nth-child(4n+3) .skeleton { width: 78%; }
.skeleton-table td:nth-child(4n+4) .skeleton { width: 55%; }

/* ===== TRANSICIONES DE CONTENIDO ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.tool-section.active { animation: fadeIn .22s ease; }
.fade-in { animation: fadeIn .22s ease; }

/* ===== UTILITIES ===== */
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.ml-2 { margin-left: 8px; }
.mr-2 { margin-right: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-secondary { color: var(--color-text-secondary); }
.font-semibold { font-weight: 600; }

/* ===== KANBAN BOARD ===== */
.view-toggle {
  display: flex;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
}

.view-toggle button {
  height: 34px;
  padding: 0 14px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 12px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.view-toggle button:not(:last-child) {
  border-right: 1px solid var(--color-border);
}

.view-toggle button:hover {
  background: var(--color-bg);
}

.view-toggle button.active {
  background: var(--color-text);
  color: #fff;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  min-height: 400px;
  height: calc(100vh - 220px);
}

.kanban-column {
  min-width: 0;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.kanban-column-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--color-border);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  background: #f8fafc;
}

.kanban-column-count {
  font-size: 11px;
  color: var(--color-text-secondary);
  background: var(--color-border);
  border-radius: 999px;
  padding: 1px 8px;
}

.kanban-column-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  min-height: 60px;
}

.kanban-column[data-col="Nuevo"]     { border-top: 3px solid #2563EB; }
.kanban-column[data-col="Nuevo"] .kanban-column-header { background: rgba(37,99,235,0.08); color:#2563EB; }
.kanban-column[data-col="Nuevo"] .kanban-column-count { background: rgba(37,99,235,0.15); color:#2563EB; }
.kanban-column[data-col="Contacto"]  { border-top: 3px solid #0891B2; }
.kanban-column[data-col="Contacto"] .kanban-column-header { background: rgba(8,145,178,0.08); color:#0891B2; }
.kanban-column[data-col="Contacto"] .kanban-column-count { background: rgba(8,145,178,0.15); color:#0891B2; }
.kanban-column[data-col="Entrevista"] { border-top: 3px solid #D97706; }
.kanban-column[data-col="Entrevista"] .kanban-column-header { background: rgba(217,119,6,0.08); color:#D97706; }
.kanban-column[data-col="Entrevista"] .kanban-column-count { background: rgba(217,119,6,0.15); color:#D97706; }
.kanban-column[data-col="Tecnica"]   { border-top: 3px solid #EA580C; }
.kanban-column[data-col="Tecnica"] .kanban-column-header { background: rgba(234,88,12,0.08); color:#EA580C; }
.kanban-column[data-col="Tecnica"] .kanban-column-count { background: rgba(234,88,12,0.15); color:#EA580C; }
.kanban-column[data-col="Medica"]    { border-top: 3px solid #DB2777; }
.kanban-column[data-col="Medica"] .kanban-column-header { background: rgba(219,39,119,0.08); color:#DB2777; }
.kanban-column[data-col="Medica"] .kanban-column-count { background: rgba(219,39,119,0.15); color:#DB2777; }
.kanban-column[data-col="Elegible"]  { border-top: 3px solid #059669; }
.kanban-column[data-col="Elegible"] .kanban-column-header { background: rgba(5,150,105,0.08); color:#059669; }
.kanban-column[data-col="Elegible"] .kanban-column-count { background: rgba(5,150,105,0.15); color:#059669; }
.kanban-column[data-col="No elegible"] { border-top: 3px solid #DC2626; }
.kanban-column[data-col="No elegible"] .kanban-column-header { background: rgba(220,38,38,0.08); color:#DC2626; }
.kanban-column[data-col="No elegible"] .kanban-column-count { background: rgba(220,38,38,0.15); color:#DC2626; }

.kanban-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card.dragging {
  opacity: 0.45;
  border: 1px dashed var(--color-border);
  transform: rotate(2deg);
}

.kanban-column-body.drag-over {
  background: rgba(37, 99, 235, 0.06);
  outline: 2px dashed rgba(37, 99, 235, 0.4);
  outline-offset: -3px;
}

.kanban-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.kanban-card-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.kanban-card-sub {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
  font-size: 10px;
  color: var(--color-text-secondary);
}

.kanban-card-body {
  cursor: pointer;
}

.kanban-card-arrows {
  display: flex;
  border-top: 1px solid var(--color-border);
  margin-top: 8px;
  padding-top: 6px;
  gap: 4px;
}

.kanban-arrow {
  flex: 1;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 4px 0;
  cursor: pointer;
  font-size: 11px;
  color: var(--color-text-secondary);
  transition: 0.12s;
}

.kanban-arrow:hover:not(:disabled) {
  background: var(--color-border);
  color: var(--color-text);
}

.kanban-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.kanban-hidden {
  display: none;
}

/* ===== ORG TREE ===== */
.org-tree {
  padding: 0;
}

.org-card {
  padding: 12px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid transparent;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  margin-bottom: 6px;
}

.org-card-title {
  font-weight: 600;
  font-size: 13px;
}

.org-card-sub {
  font-size: 10px;
  color: var(--color-text-secondary);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.org-card-jefe {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--color-border);
}

.org-card-tree {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  cursor: default;
}

.org-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.org-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 12px;
}

.org-card-has-children {
  cursor: pointer;
}

.org-card-has-children:hover {
  border-color: #cbd5e1;
}

.org-toggle {
  display: inline-block;
  width: 18px;
  font-size: 10px;
  color: var(--color-text-secondary);
  margin-right: 4px;
  user-select: none;
}

.org-children {
  display: none;
  padding: 4px 0 4px 32px;
  position: relative;
}

.org-children::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e2e8f0;
}

.org-children.open {
  display: block;
}

.org-children > .org-card,
.org-children > .org-cargo-item {
  position: relative;
}

.org-children > .org-card::before,
.org-children > .org-cargo-item::before {
  content: '';
  position: absolute;
  left: -17px;
  top: 50%;
  width: 17px;
  height: 2px;
  background: #e2e8f0;
  transform: translateY(-1px);
}

/* Cargo items as bullet text */
.org-cargo-item {
  padding: 7px 0 7px 0;
  margin-left: 0;
  font-size: 13px;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.org-cargo-item:last-child {
  border-bottom: none;
}

.org-cargo-bullet {
  color: var(--color-text-secondary);
  font-size: 10px;
}

.org-cargo-jefe {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.org-cargo-vac {
  font-size: 11px;
  color: var(--module-captacion);
  margin-left: auto;
  font-weight: 600;
  white-space: nowrap;
}

.org-card-direccion { border-left-color: var(--module-captacion); }
.org-card-gerencia { border-left-color: #0891B2; }
.org-card-departamento { border-left-color: #D97706; }
.org-card-cargo { border-left-color: #6B7280; }

/* ===== UI DIALOGS (reemplazo alert/confirm) ===== */
.ui-dialog-overlay {
  z-index: 2000;
}
.ui-dialog {
  max-width: 440px;
}
.ui-dialog-content {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.ui-dialog-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.ui-dialog-icon.type-info { background: #e0f2fe; color: #0284c7; }
.ui-dialog-icon.type-success { background: #d1fae5; color: #059669; }
.ui-dialog-icon.type-error { background: #fee2e2; color: #dc2626; }
.ui-dialog-icon.type-warning { background: #fef3c7; color: #d97706; }
.ui-dialog-message {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
  color: var(--color-text);
  word-break: break-word;
}

/* ===== BOTÓN SPLASH (ver splash activo) ===== */
.nav-splash-btn {
  height: 44px;
  margin-left: 10px;
  padding: 0;
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.15s, transform 0.15s;
}
.nav-splash-btn:hover {
  opacity: 0.75;
  transform: translateY(-1px);
}
.nav-splash-btn:active {
  transform: translateY(0);
}
.nav-splash-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}
.nav-splash-btn {
  animation: navBlink 1.6s ease-in-out infinite;
}
@keyframes navBlink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

/* ===== CAMPANA DE ALERTAS (global) ===== */
.nav-alerta-btn {
  position: relative;
  width: 44px;
  height: 44px;
  margin-left: 10px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 17px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s;
}
.nav-alerta-btn:hover {
  background: rgba(255, 255, 255, 0.32);
  transform: translateY(-1px);
}
.nav-alerta-btn:active {
  transform: translateY(0);
}
.nav-alerta-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--color-nav);
}
.nav-alerta-panel {
  position: fixed;
  z-index: 9999;
  width: 400px;
  max-width: calc(100vw - 24px);
  max-height: 70vh;
  flex-direction: column;
  background: #fff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}
.nav-alerta-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid #eef2f7;
  background: #f8fafc;
  font-size: 13px;
}
.nav-alerta-readall {
  border: 0;
  background: transparent;
  color: var(--module-relaciones, #059669);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}
.nav-alerta-readall:hover {
  background: rgba(5, 150, 105, 0.1);
}
.nav-alerta-empty {
  padding: 26px 16px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}
.nav-alerta-list {
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav-alerta-item {
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.nav-alerta-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.nav-alerta-item.leido {
  opacity: 0.6;
}
.nav-alerta-tipo {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
  margin-bottom: 5px;
}
.nav-alerta-tipo.acuerdo_creado { background: #d1fae5; color: #047857; }
.nav-alerta-tipo.acuerdo_por_vencer { background: #fef3c7; color: #b45309; }
.nav-alerta-tipo.acuerdo_vencido { background: #fee2e2; color: #b91c1c; }
.nav-alerta-msg {
  font-size: 13px;
  line-height: 1.45;
  color: #0f172a;
}
.nav-alerta-fecha {
  margin-top: 4px;
  font-size: 11px;
  color: #b45309;
  font-weight: 700;
}
.nav-alerta-hora {
  margin-top: 2px;
  font-size: 11px;
  color: #94a3b8;
}

/* ===== CARRUSEL DE SPLASH (overlay global) ===== */
.splash-show-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
}
.splash-show-overlay.show {
  display: flex;
}
.splash-show-content {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 92%;
  max-width: 980px;
  max-height: 88vh;
  overflow: hidden;
  border-radius: 14px;
}
.splash-show-media {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: 14px 0 0 14px;
}
.splash-show-img {
  width: 100%;
  height: 100%;
  max-height: 88vh;
  object-fit: contain;
  display: block;
  cursor: pointer;
}
.splash-show-video {
  width: 100%;
  height: 100%;
  max-height: 88vh;
  object-fit: contain;
  display: none;
  border: 0;
  outline: none;
  background: #000;
}
.splash-show-panel {
  flex: 0 0 300px;
  min-height: 0;
  background: #111;
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 14px;
  color: #fff;
  text-align: left;
  overflow-y: auto;
  border-radius: 0 14px 14px 0;
}
.splash-show-caption {
  margin-top: auto;
  color: #d1d5db;
  font-size: 14.5px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.splash-show-caption strong {
  display: block;
  font-weight: 700;
  font-size: 19px;
  color: #fff;
  margin-bottom: 8px;
}
.splash-show-count {
  margin-bottom: auto;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
}
.splash-show-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  transition: opacity 0.18s ease, background 0.18s ease;
}
.splash-show-close:hover {
  background: rgba(0, 0, 0, 0.65);
  opacity: 1;
}
.splash-show-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  transition: opacity 0.18s ease, background 0.18s ease;
}
.splash-show-arrow:hover {
  background: rgba(255, 255, 255, 0.4);
  opacity: 1;
}
.splash-show-arrow.left {
  left: 12px;
}
.splash-show-arrow.right {
  right: 12px;
}
.splash-show-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.splash-show-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  border: none;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), 0 1px 4px rgba(0, 0, 0, 0.4);
  transition: background 0.15s ease, transform 0.15s ease;
}
.splash-show-dot:hover {
  transform: scale(1.2);
}
.splash-show-dot.active {
  background: #fff;
}

/* ===== VISTA DETALLE DEL SPLASH (estilo Facebook) ===== */
.splash-detail-card {
  display: flex;
  flex-direction: row;
  position: relative;
  max-width: 720px;
  width: calc(100% - 40px);
  background: var(--color-surface, #fff);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.splash-detail-card .splash-show-close {
  top: 10px;
  right: 10px;
}
.splash-detail-img-wrap {
  flex: 0 0 48%;
  min-height: 280px;
  background: #000;
}
.splash-detail-img-wrap img {
  width: 100%;
  height: 100%;
  max-height: 460px;
  object-fit: cover;
  display: block;
}
.splash-detail-img-wrap video {
  width: 100%;
  height: 100%;
  max-height: 460px;
  object-fit: contain;
  display: block;
  background: #000;
}
.splash-detail-texto {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  overflow-y: auto;
  max-height: 460px;
  background: var(--color-surface, #fff);
}
.splash-detail-texto h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
}
.splash-detail-texto p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-text-secondary, #555);
  white-space: pre-wrap;
}
.splash-detail-fecha {
  font-size: 12px;
  color: var(--color-text-secondary, #999);
}
@media (max-width: 640px) {
  .splash-detail-card {
    flex-direction: column;
    width: calc(100% - 24px);
  }
  .splash-detail-img-wrap {
    flex: none;
    min-height: 0;
  }
  .splash-detail-img-wrap img {
    max-height: 240px;
  }
  .splash-detail-texto {
    max-height: none;
  }
  .splash-show-content {
    flex-direction: column;
    max-height: 90vh;
  }
  .splash-show-media {
    flex: none;
  }
  .splash-show-img {
    max-height: 45vh;
  }
  .splash-show-panel {
    flex: 1;
    max-height: 45vh;
  }
}

.help-module-sub {
  margin: 0 0 18px;
  color: var(--color-text-secondary);
  font-size: 13px;
  line-height: 1.6;
}
.help-tools-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
}
.help-tools-title i.fi {
  color: var(--module-help-accent, var(--color-accent));
  font-size: 14px;
}
.help-tool {
  display: flex;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.help-tool:hover {
  border-color: var(--module-help-accent, var(--color-accent));
  box-shadow: var(--shadow-sm);
}
.help-tool-icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: rgba(37, 99, 235, 0.1);
  background: color-mix(in srgb, var(--module-help-accent, var(--color-accent)) 12%, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
}
.help-tool-icon i.fi {
  font-size: 18px;
  color: var(--module-help-accent, var(--color-accent));
}
.help-tool-body h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
}
.help-tool-body p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--color-text-secondary);
}

/* ===== RESPONSIVE ===== */
.tabla-scroll {
  overflow-x: auto;
}

@media (max-width: 900px) {
  .topnav {
    padding: 0 16px;
    gap: 12px;
  }
  .content-area {
    padding: 20px;
  }
  .module-content {
    padding: 18px 16px;
  }
  .module-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 640px) {
  html {
    font-size: 13px;
  }

  /* Top nav: colapsado tras el botón hamburguesa */
  .topnav {
    flex-wrap: nowrap;
    height: 52px;
    padding: 0 12px;
    gap: 8px;
    position: sticky;
  }
  .topnav-brand {
    font-size: 14px;
  }
  .topnav-brand span {
    display: none;
  }
  .nav-home-icon {
    display: inline-block;
    font-size: 18px;
    color: #fff;
    margin-right: 6px;
    vertical-align: middle;
  }
  .topnav-logo {
    width: 72px;
    height: 28px;
    margin-right: 6px;
  }
  .nav-select {
    order: 2;
    flex: 1 1 0;
    min-width: 0;
    height: 32px;
    font-size: 12px;
    padding: 0 28px 0 10px;
    background-color: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    color: #fff;
  }
  .nav-dropdown {
    order: 2;
    flex: 1 1 0;
    min-width: 0;
    display: none;
  }
  .nav-drop-btn { width: 100%; min-width: 0; }
  .nav-drop-panel { left: 0; right: 0; min-width: 0; }
  .nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    order: 3;
  }
  .topnav-spacer {
    display: none;
  }
  .nav-splash-btn {
    display: none;
  }
  .topnav.open .nav-splash-btn {
    order: 3;
    margin-left: 0;
  }
  .topnav.open {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 12px;
    gap: 8px;
  }
  .topnav-brand {
    order: 1;
  }
  .topnav.open .nav-select {
    order: 2;
    flex: 1 1 0;
  }
  .topnav.open .nav-dropdown {
    order: 2;
    display: block;
    flex-basis: 100%;
  }
  .topnav.open .topnav-spacer {
    display: none;
  }
  .splash-show-arrow.left {
    left: 6px;
  }
  .splash-show-arrow.right {
    right: 6px;
  }
  .splash-show-close {
    top: 8px;
    right: 8px;
  }

  /* Contenido y barras */
  .content-area {
    padding: 14px 12px;
  }
  .topbar {
    padding: 12px 16px;
  }
  .topbar h1 {
    font-size: 16px;
  }

  /* Dashboard: una columna */
  .module-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .module-card {
    padding: 20px;
  }

  /* Layout del módulo: herramientas como barra fija inferior */
  .module-layout {
    flex-direction: column;
  }
  .module-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 80;
    width: 100%;
    height: auto;
    min-height: 62px;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 8px;
    border-right: none;
    border-bottom: none;
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -2px 8px rgba(15, 23, 42, 0.08);
    overflow-x: auto;
    flex-shrink: 0;
  }
  .panel-item {
    flex-shrink: 0;
    width: auto;
    min-width: 52px;
    height: auto;
    padding: 4px 6px 2px;
    flex-direction: column;
    gap: 2px;
  }
  .module-panel.panel-more .panel-item.panel-more-hidden {
    display: none;
  }
  .module-panel.panel-more .panel-more-btn {
    display: flex;
    width: auto;
    min-width: 52px;
    height: auto;
    padding: 4px 6px 2px;
  }
  .module-body {
    padding-bottom: 62px;
  }
  .module-content {
    padding: 14px 12px 72px;
    overflow-y: auto;
  }
  .tool-section.active {
    overflow-x: auto;
  }

  /* Vistas con altura fija: scroll interno del section */
  #atsTableView,
  #atsKanbanView,
  #estUnidadesView {
    height: auto;
    max-height: calc(100vh - 220px);
  }

  /* Tablas: scroll horizontal */
  .tabla-scroll {
    overflow-x: auto;
  }
  .data-table,
  .table {
    min-width: 560px;
  }

  /* Toolbars que envuelven */
  .toolbar-content {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .tool-section-header,
  .module-page-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Formularios y modales */
  .form-row {
    grid-template-columns: 1fr;
  }
  .form-card {
    padding: 20px;
  }
  .modal {
    margin: 12px;
    max-height: 92vh;
  }
  .modal-body {
    padding: 16px;
  }
  .modal-header {
    padding: 14px 16px;
  }
  .modal-footer {
    padding: 12px 16px;
  }

  /* Kanban: scroll horizontal */
  .kanban-board {
    grid-template-columns: repeat(6, minmax(230px, 1fr));
    overflow-x: auto;
    height: auto;
    min-height: 320px;
  }

  /* Login */
  .login-page {
    padding: 16px;
  }
  .login-form {
    padding: 24px;
  }
  .login-logo {
    margin-bottom: 24px;
  }
  .login-circle {
    width: 100%;
    height: 80px;
  }
}

/* Switch de estado (toggle) */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
  vertical-align: middle;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #cbd5e1;
  transition: 0.2s;
  border-radius: 20px;
}
.switch .slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  transition: 0.2s;
  border-radius: 50%;
}
.switch input:checked + .slider {
  background: #059669;
}
.switch input:checked + .slider:before {
  transform: translateX(18px);
}

/* Aplicación automatizada de pruebas psicológicas */
.tests-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
  border: 1px dashed rgba(37, 99, 235, 0.4);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(29, 78, 216, 0.05));
}
.tests-banner-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.tests-banner-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}
.tests-banner-text {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}
.tests-banner-text strong { color: var(--color-text); }

.tests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.test-card {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.test-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.4);
}
.test-card-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.test-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 3px;
}
.test-card-desc {
  font-size: 12.5px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

/* ============================================
   MÓVIL: tablas anchas convertidas en tarjetas
   (la clase .table-cards la agrega js/ui.js a las
   tablas con más de 4 columnas en pantallas <= 640px)
   ============================================ */
@media (max-width: 640px) {
  table.table-cards {
    display: block;
    width: 100%;
    min-width: 0;
    background: transparent;
    border: none;
    box-shadow: none;
  }
  .table-cards thead {
    display: none;
  }
  .table-cards tbody {
    display: block;
  }
  .table-cards tbody > tr {
    display: block;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 6px 0;
    margin-bottom: 10px;
  }
  .table-cards tbody > tr:last-child {
    margin-bottom: 0;
  }
  .table-cards tbody > tr:hover td {
    background: transparent;
  }
  .table-cards td {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 7px 14px;
    border-bottom: 1px solid #f1f5f9;
    border-left: none;
    font-size: 13px;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
  }
  .table-cards td:last-child {
    border-bottom: none;
  }
  .table-cards td::before {
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
      letter-spacing: 0.4px;
    color: var(--color-text-secondary);
    margin-bottom: 2px;
  }
  .table-cards td[colspan] {
    text-align: center;
    color: #64748b;
    padding: 18px 14px;
  }
  /* Celdas con botones o controles: etiqueta arriba, controles en fila */
  .table-cards td.cell-actions,
  .table-cards td.cell-ctrl {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  .table-cards td.cell-actions::before,
  .table-cards td.cell-ctrl::before {
    flex-basis: 100%;
  }
}

/* ============================================
   BOTONES CON ICONO (global)
   En escritorio: icono + texto. En móvil
   (<=640px): solo icono.
   ============================================ */
.ui-icon-btn {
  justify-content: center;
}

.btn-text {
  font: inherit;
}

/* ============================================
   FILTROS COLAPSABLES (global)
   En escritorio los filtros quedan expandidos
   en línea; en móvil se ocultan tras el botón
   de filtro (icono).
   ============================================ */
.filter-collapse {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  flex: 1 1 auto;
  order: -1;
  box-sizing: border-box;
}

.filter-collapse .form-group {
  margin: 0;
}

.filter-toggle-btn {
  display: none;
  position: relative;
}

.filter-toggle-btn.active {
  background: var(--color-text);
  color: #fff;
}

.filter-toggle-btn.has-value::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid var(--color-surface, #fff);
}

@media (max-width: 640px) {
  .btn-text {
    display: none;
  }

  .btn.ui-icon-btn,
  .btn-outline.ui-icon-btn {
    padding: 0;
    min-width: 44px;
  }

  .view-toggle button.ui-icon-btn,
  .ti-tab.ui-icon-btn {
    padding: 0 10px;
  }

  .filter-collapse {
    display: none;
    width: 100%;
  }

  .filter-collapse.open {
    display: flex;
    padding: 10px 0 4px;
  }

  .filter-toggle-btn {
    display: inline-flex;
  }
}

/* ===== Selector de pestañas compartido (estilo TI Inventario) ===== */
.mod-tabs {
  display: inline-flex;
  align-items: stretch;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
  height: 40px;
  box-sizing: border-box;
}

.mod-tab {
  border: none;
  background: transparent;
  padding: 0 14px;
  border-radius: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.mod-tab.active {
  background: var(--color-surface);
  color: var(--module-color, var(--module-ti));
  box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
  .mod-tabs {
    height: auto;
    flex-wrap: wrap;
  }
  .mod-tab {
    min-height: 34px;
  }
}

/* MAYUSCULAS GLOBALES: campos de texto se ven en mayusculas */
input[type="text"]:not(.no-upper),
input[type="search"]:not(.no-upper),
input[type="tel"]:not(.no-upper),
input[type="email"]:not(.no-upper),
input[type="url"]:not(.no-upper),
input:not([type]):not(.no-upper),
textarea:not(.no-upper),
select:not(.no-upper) {
}



