/* --- SISTEMA DE DISEÑO Y CONFIGURACIÓN PREMIUM --- */

:root {
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Paleta de Colores por Defecto (Estilo Light Mode Premium con acento Turquesa) */
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f8fafc;
  --card-bg: #ffffff;
  --border-color: rgba(15, 23, 42, 0.08);
  
  --primary: #0d9488;          /* Turquesa/Teal */
  --primary-hover: #0f766e;
  --secondary: #64748b;
  --secondary-hover: #475569;
  --accent: #06b6d4;
  --accent-hover: #0891b2;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --text-main: #0f172a;        /* Azul/Negro profundo */
  --text-muted: #64748b;
  --text-gradient: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-glass: 0 8px 32px 0 rgba(15, 23, 42, 0.05);
  
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  --border-radius-sm: 8px;
  --border-radius-md: 14px;
  --border-radius-lg: 20px;
}

/* Soporte para Tema Claro (Compatibilidad de variable) */
html[data-theme="claro"] {
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f8fafc;
  --card-bg: #ffffff;
  --border-color: rgba(15, 23, 42, 0.08);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --secondary: #64748b;
  --secondary-hover: #475569;
  --success: #0d9488;
}

/* Soporte para Tema Oscuro (Anterior default) */
html[data-theme="oscuro"] {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --card-bg: rgba(31, 41, 55, 0.45);
  --border-color: rgba(255, 255, 255, 0.08);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --secondary: #4b5563;
  --secondary-hover: #374151;
  --accent: #06b6d4;
  --accent-hover: #0891b2;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-gradient: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

html[data-theme="claro"] .modal-overlay {
  background-color: rgba(15, 23, 42, 0.35);
}

html[data-theme="claro"] .modal-card {
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Reset y Estilos Globales */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* Efectos de Texto y Degradados */
.text-gradient {
  background: var(--text-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- DISEÑO DEL CONTENEDOR PRINCIPAL (DASHBOARD) --- */
.dashboard-container {
  display: flex;
  min-height: 100vh;
}

/* --- BARRA LATERAL (SIDEBAR REDISEÑADO) --- */
.sidebar {
  width: 240px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 16px 10px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 0 6px;
}

.brand-logo {
  font-size: 26px;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.sidebar-menu {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.menu-dropdown-wrapper {
  display: flex;
  flex-direction: column !important;
  width: 100% !important;
}

.menu-item {
  display: flex;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  height: 36px !important;
  padding: 0 10px !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: var(--border-radius-sm) !important;
  color: var(--text-muted) !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  text-align: left !important;
  transition: all var(--transition-fast) !important;
  box-sizing: border-box !important;
  outline: none !important;
}

.menu-item:hover {
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-main) !important;
}

.menu-item.active {
  background-color: rgba(99, 102, 241, 0.15) !important;
  color: var(--primary) !important;
  box-shadow: inset 3px 0 0 var(--primary) !important;
  font-weight: 600 !important;
}

/* Desempaquetar trigger-label si existiera */
.trigger-label {
  display: contents !important;
}

.dropdown-trigger {
  width: 100%;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

.hidden-perm,
.menu-item.hidden-perm,
.menu-dropdown-wrapper.hidden-perm,
.submenu-item.hidden-perm {
  display: none !important;
}

.nav-icon,
.menu-item > i:first-child {
  width: 20px !important;
  min-width: 20px !important;
  height: 20px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 14px !important;
  text-align: center !important;
  margin-right: 10px !important;
  margin-left: 0 !important;
  flex-shrink: 0 !important;
}

.nav-text,
.menu-item > span:not(.dropdown-chevron) {
  flex-grow: 1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  line-height: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
}

.dropdown-chevron {
  width: 14px !important;
  height: 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 10px !important;
  color: var(--text-muted) !important;
  margin-left: auto !important;
  flex-shrink: 0 !important;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.menu-dropdown-wrapper.open .dropdown-chevron {
  transform: rotate(180deg) !important;
}

.submenu-container {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  padding-left: 14px !important;
  margin-top: 2px !important;
  margin-bottom: 2px !important;
}

.menu-dropdown-wrapper.open .submenu-container {
  max-height: 200px;
}

.submenu-item {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  height: 32px !important;
  padding: 0 8px !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: var(--border-radius-sm) !important;
  color: var(--text-muted) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  text-align: left !important;
  transition: all var(--transition-fast) !important;
  box-sizing: border-box !important;
  outline: none !important;
}

.submenu-item .nav-icon,
.submenu-item > i:first-child {
  width: 18px !important;
  min-width: 18px !important;
  height: 18px !important;
  font-size: 12px !important;
  margin-right: 8px !important;
}

.submenu-item:hover {
  background-color: rgba(255, 255, 255, 0.04) !important;
  color: var(--text-main) !important;
}

.submenu-item.active {
  background-color: rgba(99, 102, 241, 0.12) !important;
  color: var(--primary) !important;
  box-shadow: inset 3px 0 0 var(--primary) !important;
  font-weight: 600 !important;
}

/* User Profile Badge */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: 30px;
  transition: all var(--transition-fast);
}

.user-profile-badge:hover {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent, #06b6d4));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.user-info {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.2;
}

.user-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-main);
  white-space: nowrap;
}

.user-role {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: capitalize;
  white-space: nowrap;
}

.submenu-item i {
  width: 18px;
  text-align: center;
  font-size: 13px;
  display: inline-block;
}

.submenu-item:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.submenu-item.active {
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* Badge y Tarjeta de Usuario Logueado */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  user-select: none;
}

.user-profile-badge:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.12);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #0d9488 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  box-shadow: 0 2px 4px rgba(13, 148, 136, 0.25);
  flex-shrink: 0;
}

.user-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.2;
  overflow: hidden;
  text-align: left;
}

.user-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  display: block;
}

.user-role {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: block;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-sm);
  margin-bottom: 10px;
}

.sidebar-user-card .user-name {
  color: #ffffff;
}

.sidebar-user-card .user-role {
  color: #94a3b8;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.online {
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
}

/* Área de Contenido */
.main-content {
  flex-grow: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  overflow-y: auto;
  max-width: calc(100% - 280px);
}

/* Encabezado */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.main-header h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.8px;
  margin-bottom: 4px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 15px;
}

/* --- TARJETAS PREMIUM CON GLASSMORPHISM --- */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-glass);
}

.card {
  padding: 30px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.card-header h2 {
  font-size: 20px;
  font-weight: 600;
}

.card-icon {
  font-size: 22px;
  color: var(--primary);
}

/* Grid de Tarjetas */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  align-items: start;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}

/* --- DISEÑO DE FORMULARIOS --- */
.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="tel"],
select {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 12px 16px;
  color: var(--text-main);
  font-size: 15px;
  outline: none;
  transition: var(--transition-fast);
}

input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.input-with-icon {
  position: relative;
}

.input-with-icon i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input-with-icon input {
  width: 100%;
  padding-left: 45px;
}

.form-section-title {
  margin-top: 30px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border-color);
}

.form-section-title h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

.warning-title h3 {
  color: var(--warning);
}

/* Checkboxes de Perfiles */
.perfiles-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.checkbox-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 16px;
  cursor: pointer;
  user-select: none;
  transition: var(--transition-fast);
}

.checkbox-tile i {
  font-size: 20px;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.checkbox-tile span {
  font-size: 14px;
  font-weight: 500;
  text-transform: capitalize;
}

.checkbox-tile input[type="checkbox"] {
  display: none;
}

.checkbox-tile:hover {
  border-color: rgba(99, 102, 241, 0.4);
}

.checkbox-tile.selected {
  background-color: rgba(99, 102, 241, 0.1);
  border-color: var(--primary);
  color: var(--text-main);
}

.checkbox-tile.selected i {
  color: var(--primary);
  transform: scale(1.1);
}

/* Secciones Colapsables */
.collapse-section {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
}

.collapse-section.open {
  max-height: 500px;
  transition: max-height 0.4s ease-in-out;
}

.collapse-content {
  padding: 10px 0;
}

/* Switch UI */
.switch-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 16px 20px;
  margin: 24px 0;
}

.switch-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.switch-label {
  font-size: 15px;
  font-weight: 600;
}

.switch-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.theme-switch {
  display: inline-block;
  height: 26px;
  position: relative;
  width: 50px;
}

.theme-switch input {
  display: none;
}

.slider {
  background-color: var(--bg-tertiary);
  bottom: 0;
  cursor: pointer;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: .4s;
  border: 1px solid var(--border-color);
}

.slider:before {
  background-color: var(--text-muted);
  bottom: 3px;
  content: "";
  height: 18px;
  left: 4px;
  position: absolute;
  transition: .4s;
  width: 18px;
}

input:checked + .slider {
  background-color: var(--success);
}

input:checked + .slider:before {
  transform: translateX(22px);
  background-color: #fff;
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--border-radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  border: none;
}

.btn-primary {
  background: var(--text-gradient);
  color: white;
}

.btn-primary:hover {
  filter: brightness(1.15);
}

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

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

.btn-accent {
  background-color: var(--accent);
  color: var(--bg-primary);
}

.btn-accent:hover {
  background-color: var(--accent-hover);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 30px;
}

/* --- SECCIÓN ESCÁNER DNI --- */
.dni-scanner-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  text-align: center;
}

.scanner-box {
  position: relative;
  width: 100%;
  height: 180px;
  background-color: rgba(255, 255, 255, 0.02);
  border: 2px dashed rgba(99, 102, 241, 0.25);
  border-radius: var(--border-radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  cursor: pointer;
  overflow: hidden;
  transition: var(--transition-normal);
}

.scanner-box:hover {
  background-color: rgba(99, 102, 241, 0.05);
  border-color: var(--primary);
}

.scanner-corners {
  position: absolute;
  font-size: 24px;
  color: var(--primary);
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.scanner-icon {
  font-size: 40px;
  color: var(--text-muted);
}

.scanner-laser {
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--text-gradient);
  box-shadow: 0 0 10px var(--primary);
  animation: scan 2.5s infinite ease-in-out;
  pointer-events: none;
}

.helper-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.w-100 {
  width: 100%;
}

@keyframes scan {
  0%, 100% { top: 10px; }
  50% { top: calc(100% - 13px); }
}

/* --- SECCIÓN MATRIZ --- */
.flex-header {
  justify-content: space-between;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--border-radius-sm);
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.matrix-table th, .matrix-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.matrix-table th {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.matrix-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.01);
}

.modulo-nombre-cell {
  font-weight: 600;
  color: var(--text-main);
}

.modulo-desc-cell {
  font-size: 13px;
  color: var(--text-muted);
  display: block;
  margin-top: 4px;
}

.matrix-switch {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --- SECCIÓN LISTADO --- */
.listado-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.search-box {
  position: relative;
  width: 320px;
}

.search-box i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  padding-left: 45px;
}

.personas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.persona-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.persona-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.3);
}

.persona-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.persona-card-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.persona-meta-dni {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-primary {
  background-color: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-accent {
  background-color: rgba(6, 182, 212, 0.15);
  color: var(--accent);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.persona-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.detail-item {
  display: flex;
  justify-content: space-between;
}

.detail-label {
  color: var(--text-muted);
}

.persona-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-perfil {
  font-size: 11px;
  font-weight: 600;
  background-color: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.loading-state, .empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* --- MODALES --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  z-index: 1000;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  padding: 30px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 24px;
}

/* --- TOAST NOTIFICATIONS --- */
.toast {
  position: fixed;
  bottom: 30px;
  right: -300px;
  background-color: var(--bg-secondary);
  border-left: 4px solid var(--success);
  border-top: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 16px 24px;
  border-radius: var(--border-radius-sm);
  box-shadow: var(--shadow-lg);
  font-weight: 500;
  z-index: 9999;
  transition: right 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.toast.show {
  right: 30px;
}

/* Secciones Ocultas */
.content-section {
  display: none;
}

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

.loading-inline {
  color: var(--text-muted);
  font-size: 14px;
}

/* --- COMPONENTE ESTÁNDAR: ESCÁNER IA COLAPSABLE --- */
.ia-scanner-component {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  margin-bottom: 24px;
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.ia-scanner-component:hover {
  border-color: rgba(99, 102, 241, 0.3);
}

.ia-scanner-trigger {
  width: 100%;
  background: none;
  border: none;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  color: var(--text-main);
  outline: none;
}

.trigger-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
}

.ia-icon-sparkle {
  font-size: 18px;
}

.trigger-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.helper-badge {
  font-size: 11px;
  font-weight: 700;
  background-color: rgba(6, 182, 212, 0.15);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}

.trigger-chevron {
  font-size: 14px;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.trigger-chevron.rotated {
  transform: rotate(180deg);
}

.ia-scanner-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
  padding: 0 20px;
}

.ia-scanner-content.open {
  max-height: 600px;
  padding-bottom: 20px;
  transition: max-height 0.4s ease-in, padding 0.4s ease-in;
}

.ia-scanner-box-wrapper {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.ia-scanner-dropzone {
  background-color: var(--bg-secondary);
  border: 2px dashed rgba(99, 102, 241, 0.2);
  border-radius: var(--border-radius-sm);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition-fast);
}

.ia-scanner-dropzone:hover {
  background-color: rgba(99, 102, 241, 0.03);
  border-color: var(--primary);
}

.dropzone-icon {
  font-size: 30px;
  color: var(--text-muted);
}

.dropzone-text {
  font-size: 13px;
  font-weight: 500;
}

.dropzone-subtext {
  font-size: 11px;
  color: var(--text-muted);
}

.ia-scanner-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Listado de archivos previsualizados */
.ia-file-preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-color);
}

.ia-file-card {
  position: relative;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.ia-file-thumb {
  width: 100%;
  height: 60px;
  border-radius: 4px;
  object-fit: cover;
}

.ia-file-pdf-icon {
  font-size: 32px;
  color: var(--danger);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ia-file-name {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.btn-remove-file {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--danger);
  border: none;
  color: white;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.btn-remove-file:hover {
  transform: scale(1.1);
}

/* --- ESTILOS DE VALIDACIÓN INTERACTIVA (CAMPOS ROSAS/ROJOS) --- */
.was-validated input:invalid,
.was-validated select:invalid {
  background-color: rgba(239, 68, 68, 0.04) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.was-validated input:valid,
.was-validated select:valid {
  border-color: rgba(16, 185, 129, 0.3) !important;
}

/* --- REDISEÑO COMPACTO Y DE ALTA DENSIDAD PARA AUDITORÍA --- */
.compact-card {
  padding: 14px 18px !important;
}

.filters-inline-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  margin-bottom: 14px;
  width: 100%;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 6px 12px;
  transition: var(--transition-fast);
}

.filter-item:focus-within {
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.filter-item select,
.filter-item input {
  background: none !important;
  border: none !important;
  color: var(--text-main) !important;
  font-size: 13px !important;
  padding: 2px 0 !important;
  outline: none !important;
  box-shadow: none !important;
  cursor: pointer;
}

.filter-icon {
  font-size: 13px;
  color: var(--text-muted);
}

.filter-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  border-right: 1px solid var(--border-color);
  padding-right: 8px;
}

.filter-search {
  flex-grow: 1;
  max-width: 320px;
}

.filter-search input {
  width: 100%;
  cursor: text;
}

.compact-table th {
  padding: 8px 10px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--text-muted) !important;
}

.compact-table td {
  padding: 8px 10px !important;
  font-size: 13px !important;
  vertical-align: middle !important;
}

/* --- BOTONES DE ACCIÓN DENTRO DE INPUTS --- */
.btn-input-action {
  opacity: 0.6;
}

.btn-input-action:hover {
  opacity: 1 !important;
  color: var(--primary-color) !important;
  transform: scale(1.15);
}

/* --- ESTILOS PREMIUM PARA LA INTERFAZ DE LOGIN --- */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #f8fafc 0%, #cbd5e1 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 99999;
  padding: 20px;
  transition: opacity 0.4s ease, visibility 0.4s ease, background 0.3s ease;
}

html[data-theme="oscuro"] .login-overlay {
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.95) 0%, rgba(3, 7, 18, 0.99) 100%);
}

.login-card {
  width: 100%;
  max-width: 440px;
  padding: 48px 40px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  text-align: center;
  transform: translateY(0);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

html[data-theme="oscuro"] .login-card {
  background: rgba(17, 24, 39, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-glass);
}

.login-header {
  margin-bottom: 36px;
}

.login-logo {
  font-size: 48px;
  margin-bottom: 16px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.login-brand {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

html[data-theme="oscuro"] .login-brand {
  color: #ffffff;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 6px;
}

/* Animación de error al loguear */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.login-card.shake {
  animation: shake 0.4s ease-in-out;
  border-color: rgba(239, 68, 68, 0.4);
}

/* Botón de Logout en el Sidebar */
.btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.12);
  color: #f87171;
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition-fast);
  margin-bottom: 18px;
}

.btn-logout:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
  transform: translateY(-2px);
}

.btn-logout i {
  font-size: 15px;
  transition: transform var(--transition-fast);
}

.btn-logout:hover i {
  transform: translateX(-2px);
}

/* --- ESTILOS DEL MÓDULO DE MIGRACIONES --- */
.badge-chofer {
  background-color: rgba(6, 182, 212, 0.15) !important;
  color: #06b6d4 !important;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.badge-socio {
  background-color: rgba(99, 102, 241, 0.15) !important;
  color: #6366f1 !important;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.badge-titular {
  background-color: rgba(16, 185, 129, 0.15) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-mecanico {
  background-color: rgba(245, 158, 11, 0.15) !important;
  color: #f59e0b !important;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.kpi-card {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
}

/* --- ESTILOS DE TARJETAS COMPACTAS Y GRILLA DE PERSONAL --- */
.persona-card-compact {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-glass);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.persona-card-compact:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.view-toggles-wrapper button {
  transition: var(--transition-fast);
}

.view-toggles-wrapper button.active {
  background-color: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
}

.view-toggles-wrapper button:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: var(--text-main) !important;
}

/* --- MULTI-SELECT DE PERFILES --- */
.multi-select-perfiles {
  position: relative;
  display: inline-block;
}

.multi-select-perfiles .dropdown-toggle {
  background-color: var(--secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.multi-select-perfiles .dropdown-toggle:hover {
  background-color: var(--secondary-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.multi-select-perfiles .dropdown-menu-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  padding: 12px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: dropdownFadeIn 0.15s ease-out;
  max-height: 300px;
  overflow-y: auto;
}

.multi-select-perfiles .dropdown-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-muted);
  user-select: none;
  font-size: 13.5px;
}

.multi-select-perfiles .dropdown-option:hover {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.multi-select-perfiles .dropdown-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  accent-color: var(--primary);
  cursor: pointer;
}

.multi-select-perfiles .dropdown-option i {
  font-size: 14px;
  width: 18px;
  text-align: center;
  color: var(--text-muted);
}

.multi-select-perfiles .dropdown-option.selected {
  color: var(--text-main);
  background-color: rgba(99, 102, 241, 0.08);
}

.multi-select-perfiles .dropdown-option.selected i {
  color: var(--primary);
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- ESTILOS COMPORTAMIENTO EXPANDIBLE --- */

/* Tarjetas */
.persona-card-compact {
  cursor: pointer !important;
}

.persona-card-compact .persona-details {
  max-height: 0;
  overflow: hidden;
  padding: 0;
  border-top: none;
  border-bottom: none;
  margin-bottom: 0;
  opacity: 0;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease, margin 0.3s ease, opacity 0.2s ease;
}

.persona-card-compact.expanded .persona-details {
  max-height: 300px;
  opacity: 1;
  padding: 12px 0;
  margin-bottom: 8px;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.persona-card-compact .persona-card-header h3 {
  transition: color var(--transition-fast);
}

.persona-card-compact:hover .persona-card-header h3 {
  color: var(--primary) !important;
}

/* Grilla (Tabla) */
.fila-persona {
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.fila-persona:hover {
  background-color: rgba(99, 102, 241, 0.04) !important;
}

.fila-persona.expanded {
  background-color: rgba(99, 102, 241, 0.02) !important;
}

.fila-detalle {
  display: none;
  background-color: rgba(0, 0, 0, 0.15);
}

.fila-detalle.open {
  display: table-row;
}

.detalle-expandido-container {
  padding: 16px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  border-left: 3px solid var(--primary);
  background: rgba(99, 102, 241, 0.015);
  animation: dropdownFadeIn 0.2s ease-out;
}

.detalle-expandido-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detalle-expandido-item span.label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.detalle-expandido-item span.valor {
  font-size: 14px;
  color: var(--text-main);
  font-weight: 500;
}

/* --- BADGES INDICADORES PREMIUM EN HEADER --- */
.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
  user-select: none;
}

.header-badge:hover {
  background: rgba(255, 255, 255, 0.07);
  transform: translateY(-1px);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.12);
}

.header-badge i {
  font-size: 13px;
}

.header-badge .badge-val {
  font-weight: 700;
  color: var(--primary);
}

.header-badge.badge-accent .badge-val {
  color: var(--accent);
}

.header-badge.badge-warning .badge-val {
  color: var(--warning);
}

.header-badge.badge-danger .badge-val {
  color: var(--danger);
}

.header-badge.badge-success .badge-val {
  color: var(--success);
}

/* --- CONFIGURACIÓN DE COMBOS DE VEHÍCULOS --- */
.combos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  width: 100%;
}

.combos-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.combo-items-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0 0;
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.combo-items-list::-webkit-scrollbar {
  width: 6px;
}

.combo-items-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.combo-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  transition: var(--transition-fast);
}

.combo-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.combo-item span {
  font-size: 14px;
  font-weight: 500;
}

.combo-item .item-actions {
  display: flex;
  gap: 6px;
}

.combo-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

/* Badges específicos de Vehículos */
.badge-marca {
  background-color: rgba(99, 102, 241, 0.12) !important;
  color: var(--primary) !important;
  border: 1px solid rgba(99, 102, 241, 0.25) !important;
}

.badge-modelo {
  background-color: rgba(6, 182, 212, 0.12) !important;
  color: var(--accent) !important;
  border: 1px solid rgba(6, 182, 212, 0.25) !important;
}

.badge-color {
  background-color: rgba(245, 158, 11, 0.12) !important;
  color: var(--warning) !important;
  border: 1px solid rgba(245, 158, 11, 0.25) !important;
}

/* Tarjetas de vehículos */
.vehiculo-card-compact {
  cursor: pointer !important;
}

.vehiculo-card-compact .vehiculo-details {
  max-height: 0;
  overflow: hidden;
  padding: 0;
  border-top: none;
  border-bottom: none;
  margin-bottom: 0;
  opacity: 0;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease, margin 0.3s ease, opacity 0.2s ease;
}

.vehiculo-card-compact.expanded .vehiculo-details {
  max-height: 400px;
  opacity: 1;
  padding: 12px 0;
  margin-bottom: 8px;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.vehiculo-card-compact .vehiculo-card-header h3 {
  transition: color var(--transition-fast);
}

.vehiculo-card-compact:hover .vehiculo-card-header h3 {
  color: var(--primary) !important;
}

/* --- TABS PARA SECCIONES --- */
.tabs-navigation {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.02);
  padding: 6px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  width: fit-content;
}

.tab-btn {
  background: none;
  border: none;
  padding: 10px 20px;
  color: var(--text-muted);
  font-size: 14.5px;
  font-weight: 600;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.tab-btn.active {
  color: #fff;
  background: var(--primary);
  box-shadow: var(--shadow-md);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: dropdownFadeIn 0.25s ease-out;
}

/* --- ESTILOS DE PATENTES REALISTAS --- */
.patente-container {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-family: 'Outfit', 'Inter', sans-serif;
  font-weight: 800;
  user-select: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  vertical-align: middle;
  box-sizing: border-box;
}

.patente-mercosur {
  width: 90px;
  height: 32px;
  background: #ffffff;
  border: 1.5px solid #002244;
  position: relative;
  overflow: hidden;
}

.patente-header-mercosur {
  width: 100%;
  height: 8px;
  background: #0052a5;
  color: #ffffff;
  font-size: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.3px;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1;
}

.patente-mercosur .patente-texto {
  font-size: 13.5px;
  color: #001f3f;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
  line-height: 1;
  padding-bottom: 1px;
  font-weight: 800;
}

.patente-vieja {
  width: 90px;
  height: 32px;
  background: #111111;
  border: 1.5px solid #666666;
  position: relative;
  overflow: hidden;
}

.patente-header-vieja {
  width: 100%;
  height: 7px;
  border-bottom: 0.5px solid #333;
  color: #3b82f6;
  font-size: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1;
}

.patente-vieja .patente-texto {
  font-size: 13.5px;
  color: #ffffff;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
  line-height: 1;
  padding-bottom: 1px;
  font-weight: 800;
}

/* --- BOTÓN FLOTANTE DE ACCESO RÁPIDO (FAB) --- */
.fab-btn {
  position: fixed !important;
  bottom: 32px !important;
  right: 32px !important;
  width: 58px !important;
  height: 58px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45), 0 3px 8px rgba(0, 0, 0, 0.2) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 24px !important;
  cursor: pointer !important;
  z-index: 99999 !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.fab-btn:hover {
  transform: translateY(-4px) scale(1.08) !important;
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.6), 0 4px 12px rgba(0, 0, 0, 0.25) !important;
  color: #ffffff !important;
}

.fab-btn:active {
  transform: translateY(0) scale(0.95) !important;
}

/* --- ADAPTACIÓN RESPONSIVA Y MENÚ MÓVIL (OFF-CANVAS DRAWER) --- */
.btn-hamburger {
  display: none !important;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

@media (max-width: 992px) {
  .dashboard-container {
    flex-direction: column;
  }

  .btn-hamburger {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    z-index: 9999;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main-content {
    width: 100%;
    padding: 16px;
  }

  .main-header {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }

  .header-title h1 {
    font-size: 19px !important;
  }

  .personas-grid, .card-grid, .combos-grid {
    grid-template-columns: 1fr !important;
  }

  .fab-btn {
    bottom: 24px !important;
    right: 24px !important;
    width: 52px !important;
    height: 52px !important;
    font-size: 22px !important;
  }
}

@media (max-width: 576px) {
  .listado-header > div {
    flex-direction: column;
    align-items: stretch !important;
  }

  .search-box {
    width: 100% !important;
  }

  .listado-header .btn-primary {
    width: 100% !important;
    justify-content: center;
  }

  .kpis-container {
    grid-template-columns: 1fr !important;
  }
}

/* Estilos para el Calendario de Vencimientos de Cuotas */
.calendar-day-cell {
  background: #ffffff;
  min-height: 100px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
  overflow: hidden;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  cursor: pointer;
  position: relative;
}

.calendar-day-cell:hover {
  background: rgba(13, 148, 136, 0.03);
}

.calendar-day-cell.other-month {
  background: #f8fafc;
  opacity: 0.55;
  cursor: default;
}

.calendar-day-cell.is-today {
  background: rgba(13, 148, 136, 0.05);
  box-shadow: inset 0 0 0 2px #0d9488;
}

.calendar-day-header-num {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.day-number {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.calendar-day-cell.is-today .day-number {
  background: #0d9488;
  color: #ffffff;
}

.due-events-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.due-event-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform 0.15s ease;
}

.due-event-badge:hover {
  transform: translateY(-1px);
}

.due-event-badge.estado-atrasada {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.due-event-badge.estado-pendiente {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fef3c7;
}

.due-event-badge.estado-parcial {
  background: #f0f9ff;
  color: #075985;
  border: 1px solid #bae6fd;
}

.due-event-badge.estado-pagada {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.due-day-summary {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: right;
  margin-top: 4px;
}

/* Botones de Filtro Multiselect por Estado */
.btn-estado-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 50px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  font-family: inherit;
}

.btn-estado-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  color: var(--text-main);
}

.chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-atrasada { background-color: #ef4444; }
.dot-pendiente { background-color: #f59e0b; }
.dot-parcial { background-color: #0284c7; }
.dot-pagada { background-color: #10b981; }

.chip-count {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(0,0,0,0.05);
  color: var(--text-muted);
  transition: all 0.2s ease;
}

/* Estados Seleccionados / Activos */
.btn-estado-chip.active {
  background: rgba(13, 148, 136, 0.08);
  color: #0d9488;
  border-color: #0d9488;
  font-weight: 700;
}

.btn-estado-chip.active .chip-count {
  background: #0d9488;
  color: #ffffff;
}
.btn-estado-chip.chip-atrasada.active {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}
.btn-estado-chip.chip-atrasada.active .chip-count {
  background: rgba(239, 68, 68, 0.15);
  color: #991b1b;
}

.btn-estado-chip.chip-pendiente.active {
  background: #fffbeb;
  color: #92400e;
  border-color: #fef3c7;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}
.btn-estado-chip.chip-pendiente.active .chip-count {
  background: rgba(245, 158, 11, 0.15);
  color: #92400e;
}

.btn-estado-chip.chip-parcial.active {
  background: #f0f9ff;
  color: #075985;
  border-color: #bae6fd;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}
.btn-estado-chip.chip-parcial.active .chip-count {
  background: rgba(2, 132, 199, 0.15);
  color: #075985;
}

.btn-estado-chip.chip-pagada.active {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}
.btn-estado-chip.chip-pagada.active .chip-count {
  background: rgba(16, 185, 129, 0.15);
  color: #065f46;
}

/* ==========================================================================
   REDISEÑO MÓDULO CHECKLIST: PESTAÑAS, FOTOS & CUBIERTAS
   ========================================================================== */

/* Pestañas de Navegación del Modal */
.modal-tabs-header {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chk-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
  border-bottom: 3px solid transparent;
}

.chk-tab-btn:hover {
  color: var(--primary);
  background: rgba(13, 148, 136, 0.05);
}

.chk-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(13, 148, 136, 0.08);
  font-weight: 700;
}

.chk-tab-pane {
  display: none;
  animation: fadeInTab 0.25s ease-in-out;
}

.chk-tab-pane.active {
  display: block;
}

@keyframes fadeInTab {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Grilla de Carrocería & Daños Visibles con Fotos */
.carroceria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.carroceria-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s ease;
}

.carroceria-card:hover {
  border-color: var(--primary);
}

.carroceria-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-main);
}

.carroceria-card-header i {
  color: var(--primary);
  font-size: 16px;
}

.carroceria-foto-upload {
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 12px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.carroceria-foto-upload:hover {
  border-color: var(--primary);
  background: rgba(13, 148, 136, 0.03);
}

.carroceria-foto-preview {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: var(--border-radius-sm);
  display: none;
  margin-top: 8px;
}

/* Grilla de Cubiertas */
.cubiertas-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: rgba(13, 148, 136, 0.06);
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(13, 148, 136, 0.15);
}

.cubiertas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.cubierta-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cubierta-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

/* ==========================================================================
   DISEÑO DE ALTA GAMA PARA FORMULARIOS Y TARJETAS DE CHECKLIST
   ========================================================================== */

/* Tarjetas de Agrupación */
.chk-card-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.chk-card-section-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.2px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 10px;
}

.chk-card-section-title i {
  color: var(--primary);
  font-size: 15px;
}

/* Campos de Formulario */
.chk-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.chk-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chk-input,
.chk-select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: #0f172a;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
}

.chk-input:focus,
.chk-select:focus {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* Switches de Toggle Interactivos */
.chk-switch-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.chk-switch-card:hover {
  border-color: #0284c7;
  background: #f8fafc;
  transform: translateY(-1px);
}

.chk-switch-card.checked {
  background: rgba(2, 132, 199, 0.04);
  border-color: rgba(2, 132, 199, 0.4);
}

.chk-switch-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chk-switch-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.chk-switch-card.checked .chk-switch-icon {
  background: rgba(2, 132, 199, 0.15);
  color: #0284c7;
}

.chk-switch-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}

/* Custom Switch Slider UI */
.chk-custom-switch {
  position: relative;
  width: 46px;
  height: 24px;
  background-color: #cbd5e1;
  border-radius: 50px;
  transition: background-color 0.25s ease;
  flex-shrink: 0;
}

.chk-custom-switch::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="checkbox"]:checked + .chk-custom-switch {
  background-color: #10b981;
}

input[type="checkbox"]:checked + .chk-custom-switch::before {
  transform: translateX(22px);
}

/* Grilla Responsiva */
.chk-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.chk-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.chk-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

/* Estilos para el diseño exactamente según la maqueta del usuario */
.chk-modal-card-userstyle {
  background: #f8fafc !important;
  border-radius: 20px !important;
}

.chk-white-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
  border: 1px solid #e2e8f0;
  margin-bottom: 16px;
}

/* Fila de Formulario Horizontal */
.chk-form-row-aligned {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.chk-form-row-aligned label {
  width: 150px;
  font-size: 13.5px;
  font-weight: 600;
  color: #334155;
  margin: 0;
  flex-shrink: 0;
}

.chk-form-row-aligned .chk-input,
.chk-form-row-aligned .chk-select {
  max-width: 320px;
}

/* Tarjeta de Nivel de Combustible (Nafta y GNC) */
.chk-fuel-card-inline {
  background: #ffffff;
  border-radius: 16px;
  padding: 18px 24px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.chk-fuel-card-inline .chk-label-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.chk-gauge-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.chk-gauge-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 800;
  color: #0f172a;
  flex-shrink: 0;
}

.chk-gauge-circle.blue {
  border-color: #0284c7;
}

/* Filas de Kit de Seguridad (Screenshot 2) */
.chk-security-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.02);
}

.chk-security-item-title {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.chk-security-item-title i {
  font-size: 18px;
  color: #1e40af;
  width: 24px;
  text-align: center;
}

.chk-security-item-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chk-pill-button {
  background: #1e40af;
  color: #ffffff;
  padding: 6px 18px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Tabla Grilla de Cubiertas */
.chk-cubiertas-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}

.chk-cubiertas-table th {
  background: #f8fafc;
  padding: 12px 16px;
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid #e2e8f0;
}

.chk-cubiertas-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

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

/* Componente Reloj velocímetro (Gauge Dials para Nafta y GNC) */
.chk-gauge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.chk-gauge-box {
  background: #ffffff;
  border-radius: 16px;
  padding: 16px 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chk-gauge-header {
  width: 100%;
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
  text-align: left;
}

.chk-gauge-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.chk-gauge-svg-wrap {
  position: relative;
  width: 210px;
  height: 125px;
  display: flex;
  justify-content: center;
}

.chk-gauge-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chk-gauge-icon-badge {
  position: absolute;
  right: 5px;
  bottom: 15px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.chk-gauge-select-wrap {
  margin-top: 6px;
  width: 100%;
  max-width: 190px;
}

.chk-gauge-select {
  text-align: center;
  font-weight: 700;
}

/* Botones Modal Checklist (Estética Exacta de la Aplicación) */
.chk-btn-cancel {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  height: 42px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chk-btn-cancel:hover {
  background: #e2e8f0;
  color: #000000;
}

.chk-btn-submit {
  background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  height: 42px;
  padding: 0 28px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
  transition: all 0.2s ease;
}

.chk-btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(6, 182, 212, 0.4);
}

/* --- ESTADOS DE VEHÍCULOS (BADGES & DASHBOARD HOME) --- */
.badge-estado-comercial,
.badge-estado-operativo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

/* Estado Comercial Badges */
.badge-comercial-disponibles,
.badge-comercial-disponible {
  background-color: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-comercial-reservado {
  background-color: rgba(99, 102, 241, 0.12);
  color: #6366f1;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-comercial-alquilado {
  background-color: rgba(13, 148, 136, 0.12);
  color: #0d9488;
  border: 1px solid rgba(13, 148, 136, 0.3);
}

.badge-comercial-en_proceso_devolucion {
  background-color: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-comercial-baja_comercial {
  background-color: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Estado Operativo Badges */
.badge-operativo-en_circulacion {
  background-color: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-operativo-en_preparacion {
  background-color: rgba(14, 165, 233, 0.12);
  color: #0284c7;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.badge-operativo-mantenimiento_preventivo {
  background-color: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-operativo-reparacion_correctiva {
  background-color: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-operativo-espera_repuestos {
  background-color: rgba(168, 85, 247, 0.12);
  color: #7e22ce;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.badge-operativo-baja_fisica {
  background-color: rgba(100, 116, 139, 0.15);
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.3);
}

/* Home Dashboard Styles */
.home-welcome-card {
  background: linear-gradient(135deg, rgba(13, 148, 136, 0.08) 0%, rgba(6, 182, 212, 0.08) 100%);
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: var(--border-radius-md);
  padding: 24px 28px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.home-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.home-kpi-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.home-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.home-kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

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

.home-kpi-val {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}

.home-kpi-lbl {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.home-panels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.home-panel-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 22px;
}

.home-panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-breakdown-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.home-progress-bar {
  height: 8px;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
  width: 100%;
}

.home-progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}

.home-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.home-action-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.home-action-btn:hover {
  border-color: var(--primary);
  background: rgba(13, 148, 136, 0.05);
  transform: translateY(-2px);
  color: var(--primary);
}

/* ==========================================================================
   FILTROS DE ESTADO VEHÍCULOS (BOTONES PILL)
   ========================================================================== */
.btn-filter-pill {
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  user-select: none;
}

.btn-filter-pill:hover {
  border-color: var(--primary);
  color: var(--text-main);
  background: rgba(99, 102, 241, 0.08);
}

.btn-filter-pill.active {
  background: var(--primary);
  color: #ffffff !important;
  border-color: var(--primary) !important;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-filter-pill .pill-cnt {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
}

.btn-filter-pill.active .pill-cnt {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.btn-filter-pill.zero-count {
  opacity: 0.45;
  filter: grayscale(0.6);
}

.btn-filter-pill.zero-count:hover {
  opacity: 0.85;
  filter: none;
}

/* Colores específicos de estado comercial activo */
.btn-filter-pill.pill-comercial-disponible.active { background: #10b981 !important; border-color: #10b981 !important; }
.btn-filter-pill.pill-comercial-reservado.active { background: #3b82f6 !important; border-color: #3b82f6 !important; }
.btn-filter-pill.pill-comercial-alquilado.active { background: #06b6d4 !important; border-color: #06b6d4 !important; }
.btn-filter-pill.pill-comercial-en_proceso_devolucion.active { background: #f59e0b !important; border-color: #f59e0b !important; }
.btn-filter-pill.pill-comercial-baja_comercial.active { background: #ef4444 !important; border-color: #ef4444 !important; }

/* Colores específicos de estado operativo activo */
.btn-filter-pill.pill-operativo-en_circulacion.active { background: #10b981 !important; border-color: #10b981 !important; }
.btn-filter-pill.pill-operativo-en_preparacion.active { background: #06b6d4 !important; border-color: #06b6d4 !important; }
.btn-filter-pill.pill-operativo-mantenimiento_preventivo.active { background: #f59e0b !important; border-color: #f59e0b !important; }
.btn-filter-pill.pill-operativo-reparacion_correctiva.active { background: #ef4444 !important; border-color: #ef4444 !important; }
.btn-filter-pill.pill-operativo-espera_repuestos.active { background: #8b5cf6 !important; border-color: #8b5cf6 !important; }
.btn-filter-pill.pill-operativo-baja_fisica.active { background: #64748b !important; border-color: #64748b !important; }

/* ==========================================================================
   MÓDULO NOTIFICACIONES & WHATSAPP
   ========================================================================== */
.tag-chip-btn {
  background: rgba(99, 102, 241, 0.08);
  border: 1px dashed var(--primary);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: monospace;
}

.tag-chip-btn:hover {
  background: var(--primary);
  color: #ffffff;
  border-style: solid;
  transform: translateY(-1px);
}

.destinatario-item-row:hover {
  background: rgba(0, 0, 0, 0.03);
}

.emoji-chip-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  padding: 3px 7px;
  border-radius: 8px;
  font-size: 13.5px;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.emoji-chip-btn:hover {
  background: #ffffff;
  border-color: #0d9488;
  transform: scale(1.22);
}

.format-chip-btn {
  background: #0f172a;
  border: 1px solid #334155;
  color: #ffffff;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.format-chip-btn:hover {
  background: #0d9488;
  border-color: #0d9488;
  transform: translateY(-1px);
}

/* ==========================================================================
   SISTEMA DE RESPONSIVIDAD Y DISEÑO MOBILE (TABLETS & SMARTPHONES)
   ========================================================================== */

@media screen and (max-width: 992px) {
  .dashboard-container {
    flex-direction: column !important;
    position: relative;
    overflow-x: hidden;
  }

  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    z-index: 10000 !important;
    width: 280px !important;
    max-width: 85vw !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25) !important;
  }

  .sidebar.active,
  .sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  .sidebar-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(15, 23, 42, 0.5) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 9999 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease !important;
  }

  .sidebar-overlay.active,
  .sidebar-overlay.mobile-open {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    padding: 12px 12px 24px 12px !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .btn-hamburger {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
    border-radius: var(--border-radius-sm) !important;
  }
}

@media screen and (max-width: 768px) {
  .main-header,
  #cabecera_sistema {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 12px 14px !important;
    margin-bottom: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .main-header > div:first-child {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
  }

  .header-title {
    width: 100% !important;
  }

  .header-title h1 {
    font-size: 18px !important;
    line-height: 1.3 !important;
    word-break: break-word !important;
    white-space: normal !important;
  }

  .header-title .subtitle,
  #descripcion_seccion_actual {
    font-size: 12px !important;
    line-height: 1.4 !important;
  }

  .header-actions {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .user-profile-badge {
    padding: 4px 10px !important;
    max-width: 100% !important;
  }

  .user-profile-badge .user-name {
    max-width: 120px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  #indicadores_header_contenedor {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
    margin-top: 4px !important;
  }

  #indicadores_header_contenedor > div {
    flex-shrink: 0 !important;
  }

  .controls-bar,
  .filters-bar,
  div[style*="display: flex; justify-content: space-between"],
  div[style*="display: grid; grid-template-columns"] {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    gap: 10px !important;
  }

  .search-box, 
  .input-with-icon,
  .form-group,
  select,
  input[type="text"],
  input[type="date"],
  input[type="number"],
  button.btn {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .chips-container,
  #container_tabs_satelite,
  #container_tabs_vehiculos,
  div[id*="container_tabs_"],
  div[style*="overflow-x: auto"] {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 6px !important;
    max-width: 100% !important;
    width: 100% !important;
    gap: 6px !important;
  }

  .btn-estado-chip,
  .btn-chip-dia,
  .chip {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: 12px !important;
    padding: 6px 12px !important;
  }

  .card,
  .glass-card {
    padding: 14px !important;
    border-radius: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .cards-grid,
  .grid-cards,
  div[style*="grid-template-columns: repeat(auto-fill"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .table-container,
  div[style*="overflow-y: auto"] {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 10px !important;
  }

  .matrix-table,
  table {
    min-width: 600px !important;
  }

  .modal {
    padding: 10px !important;
  }

  .modal-card,
  .modal-content,
  div[id^="modal_"] > div {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 16px !important;
    border-radius: 14px !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
  }
}

@media screen and (max-width: 480px) {
  body {
    font-size: 12.5px;
  }

  .header-title h1 {
    font-size: 17px !important;
  }

  .btn {
    padding: 8px 12px !important;
    font-size: 12.5px !important;
  }

  .user-profile-badge {
    display: none !important;
  }
}







