/* ==============================================================================
   ENROQUE · SISTEMA DE DISEÑO MINIMAL WEB v7.3.0 + LOGIN ESTILO MITTI (v1.4)
   Acento Corporativo: Azul Marino Enroque (#0C2752)
   Escala Neutra Minimal: #141A21 · #1C252E · #454F5B · #637381 · #919EAB · #DFE3E8 · #F4F6F8 · #F9FAFB
   Capa estrictamente visual; conserva intacta toda lógica funcional y datos reales.
   ============================================================================== */

:root {
  --brand-primary: #0C2752;
  --brand-navy: #0C2752;
  --brand-navy-light: #163A75;
  --brand-navy-dark: #081A38;
  --brand-olive: #0C2752;
  --brand-olive-light: #163A75;
  --nordic-fjord: #1B4B91;
  --nordic-fjord-dark: #0C2752;
  --nordic-arctic: #E8EEF7;
  --nordic-pine: #118D57;

  /* Minimal Web v7.3.0 Light Tokens */
  --bg-body: #F4F6F8;
  --bg-neutral: #F4F6F8;
  --bg-subtle: #F9FAFB;
  --bg-sidebar: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: rgba(145, 158, 171, 0.08);
  --bg-input: #FFFFFF;
  --text-main: #1C252E;
  --text-secondary: #454F5B;
  --text-muted: #637381;
  --text-light: #919EAB;
  --border-color: rgba(145, 158, 171, 0.20);
  --border-input: rgba(145, 158, 171, 0.32);
  --border-light: rgba(145, 158, 171, 0.14);
  --border-active: #0C2752;

  /* Radios Minimal v7 */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 16px;

  /* Sombras Minimal v7 */
  --shadow-sm: 0 0 2px 0 rgba(145, 158, 171, 0.20), 0 12px 24px -4px rgba(145, 158, 171, 0.12);
  --shadow-md: 0 0 2px 0 rgba(145, 158, 171, 0.22), 0 16px 32px -4px rgba(145, 158, 171, 0.16);
  --shadow-lg: 0 0 2px 0 rgba(145, 158, 171, 0.24), -20px 20px 40px -4px rgba(145, 158, 171, 0.20);
  --shadow-glow: 0 8px 16px 0 rgba(12, 39, 82, 0.20);

  /* Semánticos Minimal v7 */
  --en-soft: rgba(12, 39, 82, 0.08);
  --en-primary-text: #0C2752;
  --en-success: #118D57;
  --en-success-bg: rgba(34, 197, 94, 0.16);
  --en-warning: #B76E00;
  --en-warning-bg: rgba(255, 171, 0, 0.16);
  --en-danger: #B71D18;
  --en-danger-bg: rgba(255, 86, 48, 0.16);
  --en-info: #006C9C;
  --en-info-bg: rgba(0, 184, 217, 0.16);
  --en-header-bg: rgba(244, 246, 248, 0.84);
  color-scheme: light;
}

html.dark {
  --bg-body: #141A21;
  --bg-neutral: #28323D;
  --bg-subtle: #1C252E;
  --bg-sidebar: #141A21;
  --bg-card: #1C252E;
  --bg-card-hover: rgba(145, 158, 171, 0.10);
  --bg-input: #1C252E;
  --text-main: #FFFFFF;
  --text-secondary: #C4CDD5;
  --text-muted: #919EAB;
  --text-light: #637381;
  --border-color: rgba(145, 158, 171, 0.18);
  --border-input: rgba(145, 158, 171, 0.28);
  --border-light: rgba(145, 158, 171, 0.12);
  --border-active: #93C5FD;
  --shadow-sm: 0 0 2px 0 rgba(0, 0, 0, 0.30), 0 12px 24px -4px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 0 2px 0 rgba(0, 0, 0, 0.34), 0 16px 32px -4px rgba(0, 0, 0, 0.34);
  --shadow-lg: 0 0 2px 0 rgba(0, 0, 0, 0.40), -20px 20px 40px -4px rgba(0, 0, 0, 0.44);
  --en-soft: rgba(147, 197, 253, 0.14);
  --en-primary-text: #93C5FD;
  --en-success: #77ED8B;
  --en-success-bg: rgba(34, 197, 94, 0.18);
  --en-warning: #FFD666;
  --en-warning-bg: rgba(255, 171, 0, 0.18);
  --en-danger: #FFAC82;
  --en-danger-bg: rgba(255, 86, 48, 0.18);
  --en-info: #61F3F3;
  --en-info-bg: rgba(0, 184, 217, 0.18);
  --en-header-bg: rgba(20, 26, 33, 0.84);
  color-scheme: dark;
}

/* Base tipográfica Minimal Web v7.3.0 */
body,
.font-sans {
  font-family: 'Public Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

body {
  background: var(--bg-body);
  color: var(--text-main);
}

html.dark body[class] {
  background: var(--bg-body);
  color: var(--text-main);
}

h1, h2, h3, h4,
.kpi-value,
.module-kpi-value,
.template-title-input,
.template-section-title,
.brand-text,
.card strong.text-3xl,
.card strong.text-2xl {
  font-family: 'Public Sans', 'Plus Jakarta Sans', 'Inter', sans-serif;
  letter-spacing: -0.02em;
}

h1, h2, h3 {
  text-wrap: pretty;
}

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

::selection {
  background: rgba(12, 39, 82, 0.16);
  color: #0C2752;
}

html.dark ::selection {
  background: rgba(147, 197, 253, 0.24);
  color: #FFFFFF;
}

body .text-brandNavy,
body .text-brandOlive {
  color: var(--en-primary-text);
}

body .text-fjordBlue {
  color: #1B4B91;
}

html.dark body .text-fjordBlue {
  color: #93C5FD;
}

body .bg-brandNavy,
body .bg-brandOlive {
  background-color: var(--brand-navy);
}

/* ==============================================================================
   1. SHELL CORPORATIVO MINIMAL WEB v7.3.0 (SIDEBAR + TOPBAR)
   ============================================================================== */
.sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
}

.sidebar.collapsed {
  width: 88px;
}

.sidebar ~ .main-wrapper {
  margin-left: 280px;
}

.sidebar.collapsed ~ .main-wrapper {
  margin-left: 88px;
}

.sidebar-header {
  height: 72px;
  padding: 0 1.25rem;
  background: var(--bg-sidebar);
  border-bottom: 1px dashed var(--border-color);
}

.sidebar-header > a {
  justify-content: flex-start;
  gap: 0.65rem;
  text-decoration: none;
}

.sidebar-wordmark {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
  color: #0C2752;
}

html.dark .sidebar-wordmark {
  color: #FFFFFF;
}

.sidebar-edition-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--en-soft);
  color: var(--en-primary-text);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.sidebar-nav {
  padding: 0.75rem 1rem 1rem;
}

.menu-heading {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  padding: 1.1rem 0.75rem 0.45rem;
  margin-top: 0.15rem;
}

.nav-link {
  --nav-ink: #4f46e5;
  --nav-tint: #eef2ff;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 4px;
  border-radius: 10px;
  border-left: 3px solid transparent;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link > :is(svg, i) {
  width: 28px;
  height: 28px;
  padding: 5.5px;
  border-radius: 8px;
  color: var(--nav-ink);
  background: var(--nav-tint);
  stroke-width: 1.85;
  flex-shrink: 0;
}

.nav-link:has(.lucide-house) { --nav-ink: #4f46e5; --nav-tint: #eef2ff; }
.nav-link:has(.lucide-clipboard-check) { --nav-ink: #2563eb; --nav-tint: #eff6ff; }
.nav-link:has(.lucide-panels-top-left) { --nav-ink: #0891b2; --nav-tint: #ecfeff; }
.nav-link:has(.lucide-users) { --nav-ink: #7c3aed; --nav-tint: #f5f3ff; }
.nav-link:has(.lucide-triangle-alert) { --nav-ink: #d97706; --nav-tint: #fffbeb; }
.nav-link:has(.lucide-shield-check) { --nav-ink: #059669; --nav-tint: #ecfdf5; }
.nav-link:has(.lucide-clipboard-pen) { --nav-ink: #0d9488; --nav-tint: #f0fdfa; }
.nav-link:has(.lucide-siren) { --nav-ink: #e11d48; --nav-tint: #fff1f2; }
.nav-link:has(.lucide-file-chart-column) { --nav-ink: #0284c7; --nav-tint: #f0f9ff; }
.nav-link:has(.lucide-notebook-pen) { --nav-ink: #7c3aed; --nav-tint: #f5f3ff; }
.nav-link:has(.lucide-file-text) { --nav-ink: #2563eb; --nav-tint: #eff6ff; }
.nav-link:has(.lucide-shopping-cart) { --nav-ink: #d97706; --nav-tint: #fffbeb; }
.nav-link:has(.lucide-scale) { --nav-ink: #db2777; --nav-tint: #fdf2f8; }
.nav-link:has(.lucide-badge-check) { --nav-ink: #059669; --nav-tint: #ecfdf5; }
.nav-link:has(.lucide-graduation-cap) { --nav-ink: #4f46e5; --nav-tint: #eef2ff; }
.nav-link:has(.lucide-megaphone) { --nav-ink: #9333ea; --nav-tint: #faf5ff; }
.nav-link:has(.lucide-file-search) { --nav-ink: #0284c7; --nav-tint: #f0f9ff; }
.nav-link:has(.lucide-user) { --nav-ink: #4f46e5; --nav-tint: #eef2ff; }
.nav-link:has(.lucide-settings) { --nav-ink: #64748b; --nav-tint: #f1f5f9; }
.nav-link:has(.lucide-log-out) { --nav-ink: #e11d48; --nav-tint: #fff1f2; }

html.dark .nav-link {
  --nav-tint: rgba(51, 65, 85, 0.42);
}

html.dark .nav-link > :is(svg, i) {
  color: color-mix(in srgb, var(--nav-ink), white 35%);
}

.nav-link:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.nav-link.active {
  border-left-color: #0C2752;
  background: var(--en-soft);
  color: var(--en-primary-text);
  font-weight: 700;
}

html.dark .nav-link.active {
  border-left-color: #93C5FD;
  background: rgba(147, 197, 253, 0.14);
  color: #93C5FD;
}

.nav-link-logout {
  margin-top: 0.5rem;
  color: var(--en-danger);
}

.nav-link-logout:hover {
  background: var(--en-danger-bg);
  color: var(--en-danger);
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--en-danger-bg);
  color: var(--en-danger);
  font-size: 0.6875rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar.collapsed .sidebar-nav {
  padding-inline: 0.75rem;
}

.sidebar.collapsed .nav-link {
  justify-content: center;
  padding-inline: 0;
}

.sidebar.collapsed .sidebar-footer {
  display: none;
}

.sidebar-footer {
  padding: 0.85rem 1rem;
  border-top: 1px dashed var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-align: center;
}

.sidebar-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.sidebar-footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

.sidebar-footer-links a:hover {
  color: var(--en-primary-text);
  text-decoration: underline;
}

.sidebar-version {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-light);
}

/* Topbar Minimal Web v7.3.0 */
.top-header {
  height: 72px;
  padding: 0 2rem;
  background: var(--en-header-bg);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  gap: 0.75rem;
}

.topbar-scope-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 38px;
  padding: 0 0.75rem;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  box-shadow: 0 1px 2px 0 rgba(145, 158, 171, 0.08);
}

.topbar-scope-chip svg {
  color: var(--text-muted);
}

.topbar-scope-controls select {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
}

.topbar-scope-controls option {
  background: var(--bg-card);
  color: var(--text-main);
}

.header-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

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

.topbar-unread-dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #FF5630;
  box-shadow: 0 0 0 2px var(--bg-sidebar);
}

.topbar-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  height: 38px;
  padding: 3px 10px 3px 4px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.topbar-profile-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-input);
}

.topbar-popover {
  position: absolute;
  margin-top: 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  color: var(--text-main);
}

.topbar-menu-item {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-main);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.topbar-menu-item svg {
  color: var(--text-muted);
}

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

.topbar-menu-danger {
  color: var(--en-danger);
  font-weight: 600;
}

.topbar-menu-danger svg {
  color: var(--en-danger);
}

.topbar-menu-danger:hover {
  background: var(--en-danger-bg);
}

.search-bar {
  max-width: 340px;
}

.search-input {
  height: 38px;
  padding: 0 3rem 0 2.25rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(145, 158, 171, 0.10);
  font-size: 0.8125rem;
  color: var(--text-main);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.search-input:hover,
.search-input:focus {
  background: var(--bg-card);
  border-color: var(--border-input);
}

.search-kbd {
  right: 0.5rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.6875rem;
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(145, 158, 171, 0.12);
}

/* ==============================================================================
   2. TARJETAS, MÉTRICAS Y CONTENEDORES MINIMAL WEB v7.3.0
   ============================================================================== */
.content-container {
  padding: 1.75rem 2.25rem 2.5rem;
}

.card,
.template-list-card,
.ats-detail-card,
.training-session-card {
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.card:hover,
.template-list-card:hover {
  box-shadow: var(--shadow-sm);
}

.card .card {
  box-shadow: none;
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.sst-header h1,
.template-list-header h1 {
  font-size: clamp(1.375rem, 1.8vw, 1.625rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.content-container > header h1 {
  letter-spacing: -0.025em;
  font-weight: 700;
}

.content-container .card :is(.text-3xl, .kpi-value) {
  font-weight: 700;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.card .w-9.rounded-xl {
  border-radius: 10px;
}

.card .bg-blue-50,
.card .bg-blue-100 {
  background-color: var(--en-soft);
  color: var(--en-primary-text);
}

.card .bg-amber-50,
.card .bg-amber-100 {
  background-color: var(--en-warning-bg);
  color: var(--en-warning);
}

.card .bg-emerald-50,
.card .bg-green-50 {
  background-color: var(--en-success-bg);
  color: var(--en-success);
}

.card .bg-red-50,
.card .bg-rose-50,
.card .bg-red-100 {
  background-color: var(--en-danger-bg);
  color: var(--en-danger);
}

.card .bg-teal-100 {
  background-color: var(--en-info-bg);
  color: var(--en-info);
}

html.dark .content-container :is(.text-slate-400, .text-slate-500, .text-slate-600, .text-slate-700) {
  color: var(--text-muted);
}

html.dark .content-container :is(.border-b, .border-t, .divide-y > *) {
  border-color: var(--border-color);
}

:is(.sst-empty, .template-empty-questions, .content-container .min-h-52) {
  min-height: 180px;
  padding: 1.5rem;
  flex-direction: column;
  text-align: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.sst-empty::before,
.template-empty-questions::before,
.content-container .min-h-52::before {
  content: '';
  display: block;
  flex: none;
  width: 48px;
  height: 48px;
  margin-inline: auto;
  border-radius: 12px;
  background: var(--bg-neutral) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23919EAB' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='4' width='14' height='17' rx='2.5'/%3E%3Cpath d='M9 3h6v3H9zM9 11h6M9 15h4'/%3E%3C/svg%3E") center/22px no-repeat;
}

.template-empty-questions::before {
  margin-bottom: 0.75rem;
}

.sst-empty:is(.text-red-600, .text-red-500) {
  color: var(--en-danger);
}

.sst-empty:is(.text-red-600, .text-red-500)::before {
  background-color: var(--en-danger-bg);
}

/* ==============================================================================
   3. BOTONES, FORMULARIOS Y PESTAÑAS MINIMAL WEB v7.3.0
   ============================================================================== */
.btn-primary,
.inspection-execute {
  background: #0C2752;
  background-image: none;
  color: #FFFFFF;
  border: 1px solid #0C2752;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.8125rem;
  box-shadow: none;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.btn-primary:hover,
.inspection-execute:hover {
  background: #163A75;
  background-image: none;
  border-color: #163A75;
  box-shadow: 0 8px 16px 0 rgba(12, 39, 82, 0.20);
  transform: none;
}

html.dark .btn-primary,
html.dark .inspection-execute {
  background: #1E427A;
  border-color: #1E427A;
}

html.dark .btn-primary:hover,
html.dark .inspection-execute:hover {
  background: #275396;
  border-color: #275396;
}

.btn-secondary,
.btn-social {
  border: 1px solid var(--border-input);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.8125rem;
  box-shadow: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-secondary:hover,
.btn-social:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-main);
  color: var(--text-main);
  transform: none;
}

.btn-danger {
  background: #FF5630;
  border: 1px solid #FF5630;
  color: #FFFFFF;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: none;
}

.btn-danger:hover {
  background: #B71D18;
  border-color: #B71D18;
}

.action-button {
  border-radius: 8px;
  color: var(--text-muted);
}

.action-button:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.inspection-execute:disabled {
  transform: none;
  box-shadow: none;
  opacity: 0.52;
}

:is(button, a, input, select, textarea, summary):focus-visible {
  outline: 2px solid #0C2752;
  outline-offset: 2px;
}

html.dark :is(button, a, input, select, textarea, summary):focus-visible {
  outline-color: #93C5FD;
}

.form-control,
.filter-control,
.input-field,
.template-search-input,
.template-picker-search input {
  border-radius: 8px;
  border: 1px solid var(--border-input);
  background: var(--bg-input);
  color: var(--text-main);
  min-height: 42px;
  font-size: 0.875rem;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:hover,
.filter-control:hover,
.input-field:hover,
.template-search-input:hover {
  border-color: var(--text-main);
}

.form-control:focus,
.filter-control:focus,
.input-field:focus,
.template-search-input:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px rgba(12, 39, 82, 0.10);
}

html.dark .form-control:focus,
html.dark .filter-control:focus,
html.dark .input-field:focus,
html.dark .template-search-input:focus {
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.16);
}

.form-control::placeholder,
.input-field::placeholder {
  color: var(--text-light);
}

.sst-form label,
.form-label,
.form-field > span,
.input-label {
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.8125rem;
}

input[type='checkbox'],
input[type='radio'] {
  accent-color: #0C2752;
}

input[type='file']::file-selector-button {
  border: 0;
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  margin-right: 0.75rem;
  background: var(--en-soft);
  color: var(--en-primary-text);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

/* Pestañas limpias con subrayado Minimal Web v7.3.0 */
.sst-tabs,
.settings-tabs {
  gap: 1.5rem;
  padding-bottom: 0;
  border-bottom: 1px solid var(--border-color);
}

.sst-tabs button,
.settings-tab,
.subtab {
  border-radius: 0;
  padding: 0.75rem 0.15rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.sst-tabs button:hover,
.settings-tab:hover,
.subtab:hover {
  background: transparent;
  color: var(--text-main);
}

.sst-tabs button.active,
.settings-tab.active,
.subtab.active,
.sst-tabs button.risk-tab-selected,
html.dark .sst-tabs button.active {
  background: transparent;
  color: var(--en-primary-text);
  border-bottom: 2px solid var(--border-active);
  box-shadow: none;
  font-weight: 700;
}

.tab-pills {
  background: var(--bg-neutral);
  border-color: transparent;
  border-radius: 8px;
}

.tab-btn.active {
  color: var(--text-main);
  border-radius: 6px;
}

/* ==============================================================================
   4. TABLAS Y ETIQUETAS SEMÁNTICAS MINIMAL WEB v7.3.0
   ============================================================================== */
.content-container table:not(.hse-table),
.inspection-agenda-table,
.template-list-table {
  color: var(--text-main);
  font-size: 0.8125rem;
  border-collapse: collapse;
}

.content-container table:not(.hse-table) thead,
.template-list-table thead,
.inspection-agenda-table thead,
.table-head {
  background: var(--bg-neutral);
  color: var(--text-muted);
}

.content-container table:not(.hse-table) th,
.template-list-table th,
.inspection-agenda-table th {
  color: var(--text-muted);
  background: var(--bg-neutral);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.01em;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.content-container table:not(.hse-table) td,
.template-list-table td,
.inspection-agenda-table td {
  border-top: 0;
  border-bottom: 1px dashed var(--border-color);
  padding: 0.95rem 1rem;
}

.content-container table:not(.hse-table) tbody tr:last-child td,
.template-list-table tbody tr:last-child td,
.inspection-agenda-table tbody tr:last-child td {
  border-bottom: 0;
}

.content-container table:not(.hse-table) tbody tr:hover,
.template-list-table tbody tr:hover,
.inspection-agenda-table tbody tr:hover {
  background: rgba(145, 158, 171, 0.04);
}

.inspection-agenda-table td strong,
.template-name-cell strong {
  color: var(--text-main);
  font-weight: 600;
}

.inspection-agenda-table td small,
.sst-table small {
  color: var(--text-muted);
}

/* Chips / Labels Minimal Web v7.3.0 */
.status-pill,
.inspection-state,
.inspection-frequency {
  border-radius: 6px;
  padding: 3px 8px;
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.01em;
  border: 0;
}

.inspection-frequency {
  background: var(--en-soft);
  color: var(--en-primary-text);
}

.inspection-state {
  background: rgba(145, 158, 171, 0.16);
  color: var(--text-muted);
}

.inspection-state-warning {
  background: var(--en-warning-bg);
  color: var(--en-warning);
}

.inspection-state-danger {
  background: var(--en-danger-bg);
  color: var(--en-danger);
}

.status-pill:is(.bg-blue-100, .bg-blue-50) {
  background: var(--en-soft);
  color: var(--en-primary-text);
}

.status-pill:is(.bg-green-100, .bg-green-50, .bg-emerald-100, .bg-emerald-50) {
  background: var(--en-success-bg);
  color: var(--en-success);
}

.status-pill:is(.bg-amber-100, .bg-amber-50, .bg-yellow-100) {
  background: var(--en-warning-bg);
  color: var(--en-warning);
}

.status-pill:is(.bg-red-100, .bg-red-50, .bg-rose-100) {
  background: var(--en-danger-bg);
  color: var(--en-danger);
}

/* ==============================================================================
   5. CONSTRUCTOR DE PLANTILLAS, MODALES Y VENTANAS
   ============================================================================== */
.template-page,
.template-builder-page {
  background: var(--bg-body);
  color: var(--text-main);
}

.template-builder-toolbar,
.template-settings-panel {
  background: var(--bg-card);
  border-color: var(--border-color);
}

.template-builder-toolbar {
  backdrop-filter: blur(12px);
}

.template-hero {
  border-bottom: 1px dashed var(--border-color);
}

.template-cover {
  border-radius: 16px;
  background: var(--bg-card);
  color: var(--en-primary-text);
  border-color: var(--border-input);
}

.template-hero-copy h2,
.template-title-input,
.template-section-title,
.template-section-copy h3 {
  color: var(--text-main);
}

.template-title-input:focus,
.template-description-input:focus,
.template-format-input:focus,
.template-section-title:focus,
.template-section-description:focus {
  border-bottom-color: var(--border-active);
}

.template-question-table {
  border-color: var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.template-question-head,
.template-options-editor {
  background: var(--bg-neutral);
}

.template-question-item,
.template-question-table,
.template-response-picker,
.template-project-picker > div {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
}

.template-question-main > input:focus {
  box-shadow: inset 0 0 0 2px var(--border-active);
  background: var(--bg-subtle);
}

.template-add-button,
.template-add-rail {
  border-radius: 8px;
  border-color: var(--border-input);
  background: var(--bg-card);
  color: var(--en-primary-text);
}

.template-locked,
.hse-report-icon {
  background: var(--en-soft);
  color: var(--en-primary-text);
}

.hse-report-card .hse-report-code,
.template-logic-toggle,
.template-options-title button,
.template-add-option,
.template-picker-heading button {
  color: var(--en-primary-text);
}

.modal-overlay,
.modal-backdrop {
  background: rgba(20, 26, 33, 0.48);
  backdrop-filter: blur(4px);
}

.modal-content,
.modal-card {
  border-radius: 16px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: -40px 40px 80px -8px rgba(20, 26, 33, 0.24);
}

.modal-header {
  border-color: var(--border-color);
  background: var(--bg-card);
}

/* ==============================================================================
   6. LOGIN CORPORATIVO ESTILO MITTI (LOGIN A LA DERECHA + PANEL ENROQUE #0C2752)
   ============================================================================== */
.login-container {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(440px, 1.05fr) minmax(440px, 1fr);
  align-items: stretch;
  background: var(--bg-body);
}

.login-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4rem 0 0 4.5rem;
  background: linear-gradient(160deg, #103268 0%, #0C2752 58%, #081B3B 100%);
  color: #FFFFFF;
}

.login-hero-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 12% 52%, rgba(255, 255, 255, 0.45) 1.5px, transparent 2px),
    radial-gradient(circle at 18% 58%, rgba(255, 255, 255, 0.28) 2px, transparent 2.5px),
    radial-gradient(circle at 9% 63%, rgba(255, 255, 255, 0.35) 1.5px, transparent 2px),
    radial-gradient(circle at 24% 49%, rgba(255, 255, 255, 0.22) 1.5px, transparent 2px),
    radial-gradient(circle at 85% 16%, rgba(255, 255, 255, 0.18) 2px, transparent 2.5px);
}

.login-hero-copy {
  position: relative;
  z-index: 2;
  padding-right: 3.5rem;
  max-width: 560px;
}

.login-hero-eyebrow {
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 0.75rem;
  letter-spacing: 0.01em;
}

.login-hero-title {
  font-size: clamp(2rem, 3vw, 2.85rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: #FFFFFF;
}

.login-hero-desc {
  margin-top: 1.15rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.74);
  max-width: 48ch;
}

/* Ventana arquitectónica inferior estilo Mitti */
.login-hero-preview {
  position: relative;
  z-index: 2;
  margin-top: 2.75rem;
  margin-left: 1.5rem;
  padding: 12px 0 0 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  border-top-left-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.login-preview-window {
  background: #F4F6F8;
  color: #1C252E;
  border-top-left-radius: 14px;
  overflow: hidden;
  box-shadow: 0 -10px 40px rgba(4, 12, 28, 0.28);
}

.login-preview-topbar {
  height: 46px;
  padding: 0 1.1rem;
  background: #FFFFFF;
  border-bottom: 1px solid rgba(145, 158, 171, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.login-preview-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 0.85rem;
  color: #0C2752;
  letter-spacing: -0.02em;
}

.login-preview-search {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  border-radius: 7px;
  background: #F4F6F8;
  color: #919EAB;
  font-size: 0.72rem;
}

.login-preview-body {
  display: grid;
  grid-template-columns: 165px minmax(0, 1fr);
  min-height: 250px;
}

.login-preview-sidebar {
  background: #FFFFFF;
  border-right: 1px solid rgba(145, 158, 171, 0.16);
  padding: 0.75rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.login-preview-sidebar span {
  --nav-ink: #4f46e5;
  --nav-tint: #eef2ff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 500;
  color: #637381;
  white-space: nowrap;
}

.login-preview-sidebar span > :is(svg, i) {
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 6px;
  color: var(--nav-ink);
  background: var(--nav-tint);
  flex-shrink: 0;
}

.login-preview-sidebar span:has(.lucide-clipboard-check) { --nav-ink: #2563eb; --nav-tint: #eff6ff; }
.login-preview-sidebar span:has(.lucide-panels-top-left) { --nav-ink: #0891b2; --nav-tint: #ecfeff; }
.login-preview-sidebar span:has(.lucide-users) { --nav-ink: #7c3aed; --nav-tint: #f5f3ff; }
.login-preview-sidebar span:has(.lucide-triangle-alert) { --nav-ink: #d97706; --nav-tint: #fffbeb; }
.login-preview-sidebar span:has(.lucide-shield-check) { --nav-ink: #059669; --nav-tint: #ecfdf5; }
.login-preview-sidebar span:has(.lucide-file-text) { --nav-ink: #2563eb; --nav-tint: #eff6ff; }

.login-preview-sidebar span.active {
  background: rgba(12, 39, 82, 0.09);
  color: #0C2752;
  font-weight: 700;
}

.login-preview-canvas {
  padding: 1.15rem 1.25rem 1.35rem;
}

.login-preview-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.login-preview-header-row strong {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1C252E;
}

.login-preview-pill {
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(12, 39, 82, 0.10);
  color: #0C2752;
  font-size: 0.65rem;
  font-weight: 700;
}

.login-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.login-preview-tile {
  background: #FFFFFF;
  border: 1px solid rgba(145, 158, 171, 0.14);
  border-radius: 12px;
  padding: 0.8rem 0.85rem;
  box-shadow: 0 2px 8px rgba(145, 158, 171, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.login-preview-tile svg {
  color: #0C2752;
  margin-bottom: 0.2rem;
}

.login-preview-tile strong {
  font-size: 0.76rem;
  font-weight: 700;
  color: #1C252E;
}

.login-preview-tile span {
  font-size: 0.66rem;
  color: #637381;
  line-height: 1.4;
}

/* Columna Derecha: Lienzo #F4F6F8 + Tarjeta Blanca + Pie Legal */
.login-form-wrapper {
  background: #F4F6F8;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 2.5rem 1.5rem;
  min-height: 100vh;
  overflow-y: auto;
}

html.dark .login-form-wrapper {
  background: #141A21;
}

.login-right-stage {
  width: 100%;
  max-width: 440px;
  margin: auto 0;
  padding: 1rem 0;
  transition: max-width 0.2s ease;
}

.login-right-stage:has(#viewSignUp:not(.hidden)) {
  max-width: 540px;
}

.login-brand-bar {
  margin-bottom: 1.35rem;
}

.login-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}

.login-brand-wordmark {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0C2752;
}

html.dark .login-brand-wordmark {
  color: #FFFFFF;
}

.login-card {
  width: 100%;
  max-width: none;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 2.15rem 2rem;
  box-shadow: var(--shadow-sm);
  color: var(--text-main);
}

.login-card-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
}

.login-card-subtitle {
  margin-top: 0.3rem;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text-muted);
}

.login-submit-btn {
  width: 100%;
  min-height: 46px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
}

.login-link {
  color: var(--en-primary-text);
  text-decoration: none;
}

.login-link:hover {
  text-decoration: underline;
}

.login-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}

.login-back-link:hover {
  color: var(--text-main);
}

.login-divider {
  position: relative;
  margin: 1.35rem 0;
  text-align: center;
}

.login-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid var(--border-color);
}

.login-divider span {
  position: relative;
  z-index: 1;
  padding: 0 0.75rem;
  background: var(--bg-card);
  color: var(--text-light);
  font-size: 0.75rem;
  font-weight: 500;
}

.login-oauth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 42px;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border-input);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

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

.login-section-tag {
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  background: var(--bg-neutral);
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.login-timer-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: var(--bg-neutral);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.login-timer-box #2faTimerText,
.login-timer-box #resetPinTimerText {
  color: var(--en-primary-text);
}

.login-debug-chip {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--en-soft);
  color: var(--en-primary-text);
  border: 0;
  cursor: pointer;
}

.pin-box {
  border-radius: 8px !important;
  border: 1px solid var(--border-input) !important;
  background: var(--bg-input) !important;
  color: var(--text-main) !important;
  box-shadow: none !important;
}

.pin-box:focus {
  border-color: var(--border-active) !important;
  box-shadow: 0 0 0 3px rgba(12, 39, 82, 0.12) !important;
}

/* Pie inferior de la columna derecha (Fiel a Mitti) */
.login-legal-footer {
  width: 100%;
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem 1.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.login-legal-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.login-legal-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.login-legal-links a:hover {
  color: var(--en-primary-text);
  text-decoration: underline;
}

.login-legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* ==============================================================================
   7. VISTAS PÚBLICAS LEGALES Y SOPORTE (#/terminos, #/privacidad, #/soporte)
   ============================================================================== */
.legal-public-shell {
  min-height: 100vh;
  background: var(--bg-body);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
}

.legal-public-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--en-header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.legal-public-topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  min-height: 70px;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #0C2752;
}

html.dark .legal-brand {
  color: #FFFFFF;
}

.legal-tabs {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 4px;
  border-radius: 10px;
  background: var(--bg-neutral);
}

.legal-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.legal-tab:hover {
  color: var(--text-main);
}

.legal-tab.active {
  background: var(--bg-card);
  color: var(--en-primary-text);
  box-shadow: 0 1px 3px rgba(145, 158, 171, 0.18);
}

.legal-back-login {
  width: auto !important;
  padding: 0.55rem 1rem !important;
}

.legal-public-main {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.legal-authed-wrap {
  max-width: 980px;
  margin: 0 auto;
}

.legal-card {
  padding: 2.5rem;
}

.legal-doc-header {
  padding-bottom: 1.75rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px dashed var(--border-color);
}

.legal-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--en-primary-text);
  margin-bottom: 0.5rem;
}

.legal-doc-header h1 {
  font-size: clamp(1.6rem, 2.4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
}

.legal-doc-header > p {
  margin-top: 0.6rem;
  font-size: 0.925rem;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 72ch;
}

.legal-meta-row {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.legal-meta-row > span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.legal-sections {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.legal-section h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.55rem;
}

.legal-section p {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.legal-section ul {
  margin-top: 0.65rem;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.85rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.legal-inline-link {
  color: var(--en-primary-text);
  font-weight: 600;
  text-decoration: underline;
}

.legal-support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.legal-contact-card {
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.legal-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--en-soft);
  color: var(--en-primary-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.legal-contact-card h2 {
  font-size: 1rem;
  font-weight: 700;
}

.legal-contact-card p {
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text-muted);
  flex: 1;
}

.legal-action-btn {
  width: max-content !important;
  max-width: 100%;
  margin-top: 0.35rem;
  padding: 0.6rem 1rem !important;
  text-decoration: none;
}

.legal-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.legal-faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 0.85rem;
}

.legal-faq-item {
  padding: 1.15rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
}

.legal-faq-item h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.45rem;
}

.legal-faq-item h3 svg {
  color: var(--en-primary-text);
  flex-shrink: 0;
}

.legal-faq-item p {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.legal-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.legal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.legal-status-ok {
  background: var(--en-success-bg);
  color: var(--en-success);
}

.legal-status-warn {
  background: var(--en-warning-bg);
  color: var(--en-warning);
}

.legal-status-neutral {
  background: var(--bg-neutral);
  color: var(--text-muted);
}

.legal-public-footer {
  margin-top: auto;
  padding-top: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.legal-footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.legal-footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.legal-footer-links a:hover {
  color: var(--en-primary-text);
  text-decoration: underline;
}

/* ==============================================================================
   8. ARMONIZACIÓN TRANSVERSAL DE MÓDULOS (PAGINACIÓN, EJECUTIVO, ATS, EPP, USUARIOS)
   ============================================================================== */
.enroque-pagination nav button[aria-current="page"],
.personnel-pagination nav button[aria-current="page"] {
  background: #0C2752 !important;
  color: #FFFFFF !important;
}

.enroque-pagination nav button:not(:disabled):hover {
  background: var(--en-soft) !important;
  color: var(--en-primary-text) !important;
}

.executive-calendar-day.endpoint {
  background: #0C2752 !important;
  color: #FFFFFF !important;
}

.executive-calendar-day.in-range,
.executive-calendar-day:hover {
  background: var(--en-soft) !important;
  color: var(--en-primary-text) !important;
}

.executive-range-duration strong {
  color: var(--en-primary-text) !important;
}

.executive-period {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.executive-period > label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.executive-period select.form-control {
  min-width: 210px;
  max-width: 240px;
  min-height: 46px;
}

.personnel-detail-tabs button[aria-selected=true] {
  border-bottom-color: var(--border-active) !important;
  color: var(--en-primary-text) !important;
}

.ats-detail {
  --ats-brand: var(--en-primary-text) !important;
  --ats-brand-soft: var(--en-soft) !important;
}

.ats-answers input:checked + span {
  background: var(--en-soft) !important;
  color: var(--en-primary-text) !important;
  border-color: var(--border-active) !important;
}

.user-access-heading-icon,
.user-access-module-icon {
  background: var(--en-soft) !important;
  color: var(--en-primary-text) !important;
  border-color: transparent !important;
}

.user-access-save,
.user-access-avatar-button,
.user-access-switch[aria-checked="true"] {
  background: #0C2752 !important;
  border-color: #0C2752 !important;
  color: #FFFFFF !important;
}

.user-access-segments button.selected:not(.is-edit) {
  color: var(--en-primary-text) !important;
}

.ppe-check-card:has(:checked) {
  border-color: var(--border-active) !important;
  background: var(--en-soft) !important;
}

.ppe-check-card input {
  accent-color: #0C2752 !important;
}

.tone-indigo {
  --tone: #0C2752 !important;
  --tone-bg: rgba(12, 39, 82, 0.08) !important;
}

.tone-blue {
  --tone: #1B4B91 !important;
  --tone-bg: rgba(27, 75, 145, 0.10) !important;
}

/* ==============================================================================
   9. RESPONSIVIDAD Y IMPRESIÓN
   ============================================================================== */
@media (min-width: 1600px) {
  .content-container {
    padding-inline: 2.75rem;
  }
}

@media (max-width: 1100px) {
  .content-container {
    padding: 1.5rem;
  }
  .top-header {
    padding-inline: 1.25rem;
  }
}

@media (max-width: 1024px) {
  .login-container {
    grid-template-columns: 1fr;
  }
  .login-hero {
    display: none;
  }
  .login-form-wrapper {
    padding: 1.5rem 1.25rem;
  }
  .sidebar ~ .main-wrapper,
  .sidebar.collapsed ~ .main-wrapper {
    margin-left: 0 !important;
  }
  .sidebar.collapsed {
    width: 280px;
    transform: translateX(0);
    box-shadow: 16px 0 48px rgba(20, 26, 33, 0.24);
  }
  .sidebar.collapsed .brand-text {
    display: flex;
  }
  .sidebar.collapsed :is(.menu-heading, .nav-item-text) {
    display: block;
  }
  .sidebar.collapsed .sidebar-footer {
    display: flex;
  }
  .sidebar.collapsed .sidebar-header {
    padding-inline: 1.25rem;
  }
  .sidebar.collapsed .nav-link {
    justify-content: flex-start;
    padding-inline: 0.75rem;
  }
}

@media (max-width: 768px) {
  .legal-support-grid,
  .legal-faq-grid {
    grid-template-columns: 1fr;
  }
  .legal-card {
    padding: 1.5rem;
  }
}

@media (max-width: 640px) {
  .content-container {
    padding: 1.15rem 1rem;
  }
  .top-header {
    padding-inline: 0.85rem;
  }
  .topbar-scope-chip {
    padding-inline: 0.6rem;
  }
  .card {
    padding: 1.2rem;
    border-radius: 14px;
  }
  .card.p-0 {
    padding: 0;
  }
  .login-card {
    padding: 1.5rem 1.25rem;
  }
  .sst-header {
    gap: 0.85rem;
    margin-bottom: 1.2rem;
  }
  .sst-header > .flex {
    flex-wrap: wrap;
  }
  .executive-period {
    row-gap: 0.8rem;
  }
  .executive-period input,
  .executive-period select {
    max-width: 100%;
  }
  .template-builder-toolbar {
    padding-inline: 0.85rem;
  }
  .template-toolbar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .template-title-input,
  .template-hero-copy h2 {
    font-size: 1.35rem;
  }
  .modal-card,
  .modal-content {
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card, .btn-primary, .btn-secondary, .inspection-execute, .nav-link {
    transition: none;
  }
}

@media print {
  body {
    background: #FFFFFF;
    color: #1C252E;
  }
  .card, .template-list-card {
    box-shadow: none;
  }
}
