/**
 * Modern UI Framework - Kalima ERP
 * Sistema de diseño moderno y responsive
 */

/* ===== VARIABLES CSS ===== */
:root {
  /* Colores - Tema Azul (por defecto) */
  --primary-color: #4361ee;
  --primary-dark: #3a0ca3;
  --primary-light: #7209b7;
  --secondary-color: #3f37c9;
  --accent-color: #f72585;
  --success-color: #2ecc71;
  --warning-color: #f39c12;
  --error-color: #e74c3c;
  --info-color: #3498db;
  
  /* Colores de texto */
  --text-primary: #2d3436;
  --text-secondary: #636e72;
  --text-light: #b2bec3;
  --text-white: #ffffff;
  
  /* Colores de fondo */
  --body-bg: #f8f9fa;
  --card-bg: #ffffff;
  --sidebar-bg: #2d3436;
  --header-bg: #ffffff;
  
  /* Bordes */
  --border-color: #e1e8ed;
  --border-radius: 0.375rem;
  --border-radius-lg: 0.5rem;
  --border-radius-xl: 1rem;
  --border-radius-full: 50%;
  
  /* Sombras */
  --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
  --shadow-xl: 0 1.5rem 4rem rgba(0, 0, 0, 0.2);
  
  /* Espaciado */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  
  /* Tipografía */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Transiciones */
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
  --transition-slow: 0.5s ease-in-out;
  
  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
}

/* ===== RESET Y ESTILOS BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-family: var(--font-family);
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--body-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== LAYOUT ===== */
.main-content {
  margin-left: 250px;
  padding: var(--spacing-lg);
  transition: margin-left var(--transition-normal);
  min-height: 100vh;
}

.sidebar-collapsed .main-content {
  margin-left: 70px;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 250px;
  background-color: var(--sidebar-bg);
  z-index: var(--z-fixed);
  transition: width var(--transition-normal), transform var(--transition-normal);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-collapsed .sidebar {
  width: 70px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background-color: var(--primary-color);
  color: var(--text-white);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
}

.logo-text {
  color: var(--text-white);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-lg);
  white-space: nowrap;
  opacity: 1;
  transition: opacity var(--transition-normal);
}

.sidebar-collapsed .logo-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

/* BOCADILLO CON LÍNEAS DENTRO DE UN CÍRCULO */
.toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-full);
  background-color: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
  position: relative;
  z-index: 10;
}

.toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.toggle-btn:active {
  background-color: rgba(255, 255, 255, 0.3);
}

.toggle-btn-icon {
  width: 18px;
  height: 14px;
  position: relative;
  display: inline-block;
}

.toggle-btn-icon span {
  display: block;
  position: absolute;
  height: 2px;
  width: 100%;
  background: var(--text-white);
  border-radius: 2px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: 0.25s ease-in-out;
}

.toggle-btn-icon span:nth-child(1) {
  top: 0px;
}

.toggle-btn-icon span:nth-child(2) {
  top: 6px;
}

.toggle-btn-icon span:nth-child(3) {
  top: 12px;
}

/* Animación del bocadillo cuando el sidebar está colapsado */
.sidebar-collapsed .toggle-btn-icon span:nth-child(1) {
  top: 6px;
  transform: rotate(135deg);
}

.sidebar-collapsed .toggle-btn-icon span:nth-child(2) {
  opacity: 0;
  left: -60px;
}

.sidebar-collapsed .toggle-btn-icon span:nth-child(3) {
  top: 6px;
  transform: rotate(-135deg);
}

.sidebar-nav {
  padding: var(--spacing-md) 0;
}

.nav-section {
  margin-bottom: var(--spacing-lg);
}

.nav-section-title {
  color: rgba(255, 255, 255, 0.5);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  padding: 0 var(--spacing-md);
  margin-bottom: var(--spacing-sm);
  white-space: nowrap;
  opacity: 1;
  transition: opacity var(--transition-normal);
}

.sidebar-collapsed .nav-section-title {
  opacity: 0;
  height: 0;
  margin: 0;
  overflow: hidden;
}

.nav-item {
  margin-bottom: var(--spacing-xs);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-radius: var(--border-radius);
  margin: 0 var(--spacing-sm);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  color: var(--text-white);
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
  color: var(--text-white);
  background-color: var(--primary-color);
}

.nav-icon {
  font-size: var(--font-size-lg);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-text {
  white-space: nowrap;
  opacity: 1;
  transition: opacity var(--transition-normal);
}

.sidebar-collapsed .nav-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.nav-badge {
  background-color: var(--error-color);
  color: var(--text-white);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  padding: 0.125rem 0.375rem;
  border-radius: var(--border-radius-full);
  margin-left: auto;
  opacity: 1;
  transition: opacity var(--transition-normal);
}

.sidebar-collapsed .nav-badge {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

/* ===== HEADER ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) 0;
  margin-bottom: var(--spacing-lg);
}

.header-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin: 0;
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.user-menu-wrapper {
  position: relative;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  cursor: pointer;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius);
  transition: background-color var(--transition-fast);
}

.user-menu:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-full);
  object-fit: cover;
}

.user-name {
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
}

.user-menu-arrow {
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
  transition: transform var(--transition-normal);
}

.user-menu-wrapper.active .user-menu-arrow {
  transform: rotate(180deg);
}

/* User Dropdown Menu */
.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 250px;
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-normal);
  z-index: var(--z-dropdown);
}

.user-menu-wrapper.active .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
}

.user-dropdown-name {
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  font-size: var(--font-size-base);
}

.user-dropdown-role {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md) var(--spacing-lg);
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.user-dropdown-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--primary-color);
}

.user-dropdown-item i {
  width: 20px;
  text-align: center;
  color: var(--text-secondary);
}

.user-dropdown-item:hover i {
  color: var(--primary-color);
}

.user-dropdown-item-danger {
  color: var(--error-color);
}

.user-dropdown-item-danger:hover {
  background-color: rgba(231, 76, 60, 0.1);
  color: var(--error-color);
}

.user-dropdown-item-danger i {
  color: var(--error-color);
}

.user-dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: var(--spacing-xs) 0;
}

/* ===== CARDS ===== */
.card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--spacing-lg);
  overflow: hidden;
  transition: box-shadow var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow);
}

.card-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.02);
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  margin: 0;
  color: var(--text-primary);
}

.card-body {
  padding: var(--spacing-lg);
}

.card-footer {
  padding: var(--spacing-md) var(--spacing-lg);
  border-top: 1px solid var(--border-color);
  background-color: rgba(0, 0, 0, 0.02);
}

/* ===== BOTONES ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-md);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
}

.btn:hover {
  text-decoration: none;
}

.btn:focus {
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25);
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-primary {
  color: var(--text-white);
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-secondary {
  color: var(--text-white);
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.btn-secondary:hover {
  background-color: #3a2d8a;
  border-color: #3a2d8a;
}

.btn-success {
  color: var(--text-white);
  background-color: var(--success-color);
  border-color: var(--success-color);
}

.btn-success:hover {
  background-color: #27ae60;
  border-color: #27ae60;
}

.btn-warning {
  color: var(--text-white);
  background-color: var(--warning-color);
  border-color: var(--warning-color);
}

.btn-warning:hover {
  background-color: #e67e22;
  border-color: #e67e22;
}

.btn-danger {
  color: var(--text-white);
  background-color: var(--error-color);
  border-color: var(--error-color);
}

.btn-danger:hover {
  background-color: #c0392b;
  border-color: #c0392b;
}

.btn-info {
  color: var(--text-white);
  background-color: var(--info-color);
  border-color: var(--info-color);
}

.btn-info:hover {
  background-color: #2980b9;
  border-color: #2980b9;
}

.btn-outline-primary {
  color: var(--primary-color);
  background-color: transparent;
  border-color: var(--primary-color);
}

.btn-outline-primary:hover {
  color: var(--text-white);
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-secondary {
  color: var(--secondary-color);
  background-color: transparent;
  border-color: var(--secondary-color);
}

.btn-outline-secondary:hover {
  color: var(--text-white);
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.btn-outline-success {
  color: var(--success-color);
  background-color: transparent;
  border-color: var(--success-color);
}

.btn-outline-success:hover {
  color: var(--text-white);
  background-color: var(--success-color);
  border-color: var(--success-color);
}

.btn-outline-warning {
  color: var(--warning-color);
  background-color: transparent;
  border-color: var(--warning-color);
}

.btn-outline-warning:hover {
  color: var(--text-white);
  background-color: var(--warning-color);
  border-color: var(--warning-color);
}

.btn-outline-danger {
  color: var(--error-color);
  background-color: transparent;
  border-color: var(--error-color);
}

.btn-outline-danger:hover {
  color: var(--text-white);
  background-color: var(--error-color);
  border-color: var(--error-color);
}

.btn-outline-info {
  color: var(--info-color);
  background-color: transparent;
  border-color: var(--info-color);
}

.btn-outline-info:hover {
  color: var(--text-white);
  background-color: var(--info-color);
  border-color: var(--info-color);
}

.btn-sm {
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-sm);
}

.btn-lg {
  padding: var(--spacing-md) var(--spacing-lg);
  font-size: var(--font-size-lg);
}

.btn-full {
  width: 100%;
}

.btn-group {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
}

.btn-group > .btn {
  position: relative;
  flex: 1 1 auto;
}

.btn-group > .btn:hover {
  z-index: 1;
}

.btn-group > .btn:focus,
.btn-group > .btn:active {
  z-index: 1;
}

/* ===== FORMULARIOS ===== */
.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
}

.form-control {
  display: block;
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-base);
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--card-bg);
  background-clip: padding-box;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  color: var(--text-primary);
  background-color: var(--card-bg);
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25);
}

.form-control:disabled {
  background-color: var(--body-bg);
  opacity: 1;
}

.form-select {
  display: block;
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-base);
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--card-bg);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M1 6l8 8 8-8'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right var(--spacing-sm) center;
  background-size: 16px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
}

.form-select:focus {
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(67, 97, 238, 0.25);
}

.form-check {
  display: block;
  min-height: 1.5rem;
  padding-left: 1.5em;
  margin-bottom: var(--spacing-xs);
}

.form-check-input {
  width: 1em;
  height: 1em;
  margin-top: 0.25em;
  vertical-align: top;
  background-color: var(--card-bg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  border: 1px solid rgba(0, 0, 0, 0.25);
  appearance: none;
  color-adjust: exact;
  cursor: pointer;
}

.form-check-input[type="checkbox"] {
  border-radius: 0.25em;
}

.form-check-input[type="radio"] {
  border-radius: 50%;
}

.form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.form-check-input:checked[type="checkbox"] {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3 6-6'/%3e%3c/svg%3e");
}

.form-check-input:checked[type="radio"] {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='white'/%3e%3c/svg%3e");
}

.form-check-input:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-check-input:disabled {
  pointer-events: none;
  filter: none;
  opacity: 0.5;
}

/* Checkboxes de liquidaciones con borde amarillo */
.liquidar-checkbox {
  width: 1.25em;
  height: 1.25em;
  border: 2px solid var(--warning-color) !important;
  border-radius: 0.3em;
  background-color: #fff;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.liquidar-checkbox:hover {
  border-color: #e67e22 !important;
  box-shadow: 0 0 0 0.2rem rgba(243, 156, 18, 0.25);
}

.liquidar-checkbox:checked {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3 6-6'/%3e%3c/svg%3e");
}

.liquidar-checkbox:focus {
  border-color: var(--warning-color) !important;
  outline: 0;
  box-shadow: 0 0 0 0.3rem rgba(243, 156, 18, 0.3);
}

/* ===== TABLAS ===== */
.table {
  width: 100%;
  margin-bottom: var(--spacing-lg);
  color: var(--text-primary);
  vertical-align: top;
  border-color: var(--border-color);
}

.table > :not(caption) > * > * {
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: var(--card-bg);
  border-bottom-width: 1px;
  box-shadow: inset 0 0 0 9999px var(--card-bg);
}

.table > tbody {
  vertical-align: inherit;
}

.table > thead {
  vertical-align: bottom;
}

.table > :not(:last-child) > :last-child > * {
  border-bottom-color: currentColor;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== ALERTAS ===== */
.alert {
  position: relative;
  padding: var(--spacing-md) var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  border: 1px solid transparent;
  border-radius: var(--border-radius);
}

.alert-primary {
  color: #084298;
  background-color: #cfe2ff;
  border-color: #b6d4fe;
}

.alert-secondary {
  color: #41464b;
  background-color: #e2e3e5;
  border-color: #d3d6d8;
}

.alert-success {
  color: #0f5132;
  background-color: #d1e7dd;
  border-color: #badbcc;
}

.alert-warning {
  color: #664d03;
  background-color: #fff3cd;
  border-color: #ffecb5;
}

.alert-danger {
  color: #842029;
  background-color: #f8d7da;
  border-color: #f5c2c7;
}

.alert-info {
  color: #055160;
  background-color: #cff4fc;
  border-color: #b6effb;
}

/* ===== ESTADOS DE AVERÍAS ===== */
.estado-badge {
  display: inline-block;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: var(--border-radius);
}

.estado-abierta {
  color: #0a5d0a;
  background-color: #abf3a7;
}

.estado-reclamada {
  color: #8b0000;
  background-color: #ffb0b0;
}

.estado-cerrada {
  color: #856404;
  background-color: #e5e28a;
}

.estado-anulada {
  color: #005a8b;
  background-color: #56e5ff;
}

.estado-liquidada {
  color: #6a0dad;
  background-color: #de97ff;
}

.estado-pte-material {
  color: #8b4513;
  background-color: #f9d0ac;
}

.estado-pte-ingreso {
  color: #5a7c5a;
  background-color: #f4ffd5;
}

.estado-negativa {
  color: #5a5a5a;
  background-color: #d5d5aa;
}

/* ===== GRID SYSTEM ===== */
.container {
  width: 100%;
  padding-right: var(--spacing-md);
  padding-left: var(--spacing-md);
  margin-right: auto;
  margin-left: auto;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: calc(var(--spacing-md) * -0.5);
  margin-left: calc(var(--spacing-md) * -0.5);
}

.col {
  flex: 1 0 0%;
  padding-right: calc(var(--spacing-md) * 0.5);
  padding-left: calc(var(--spacing-md) * 0.5);
}

.col-1 {
  flex: 0 0 auto;
  width: 8.33333333%;
  padding-right: calc(var(--spacing-md) * 0.5);
  padding-left: calc(var(--spacing-md) * 0.5);
}

.col-2 {
  flex: 0 0 auto;
  width: 16.66666667%;
  padding-right: calc(var(--spacing-md) * 0.5);
  padding-left: calc(var(--spacing-md) * 0.5);
}

.col-3 {
  flex: 0 0 auto;
  width: 25%;
  padding-right: calc(var(--spacing-md) * 0.5);
  padding-left: calc(var(--spacing-md) * 0.5);
}

.col-4 {
  flex: 0 0 auto;
  width: 33.33333333%;
  padding-right: calc(var(--spacing-md) * 0.5);
  padding-left: calc(var(--spacing-md) * 0.5);
}

.col-5 {
  flex: 0 0 auto;
  width: 41.66666667%;
  padding-right: calc(var(--spacing-md) * 0.5);
  padding-left: calc(var(--spacing-md) * 0.5);
}

.col-6 {
  flex: 0 0 auto;
  width: 50%;
  padding-right: calc(var(--spacing-md) * 0.5);
  padding-left: calc(var(--spacing-md) * 0.5);
}

.col-7 {
  flex: 0 0 auto;
  width: 58.33333333%;
  padding-right: calc(var(--spacing-md) * 0.5);
  padding-left: calc(var(--spacing-md) * 0.5);
}

.col-8 {
  flex: 0 0 auto;
  width: 66.66666667%;
  padding-right: calc(var(--spacing-md) * 0.5);
  padding-left: calc(var(--spacing-md) * 0.5);
}

.col-9 {
  flex: 0 0 auto;
  width: 75%;
  padding-right: calc(var(--spacing-md) * 0.5);
  padding-left: calc(var(--spacing-md) * 0.5);
}

.col-10 {
  flex: 0 0 auto;
  width: 83.33333333%;
  padding-right: calc(var(--spacing-md) * 0.5);
  padding-left: calc(var(--spacing-md) * 0.5);
}

.col-11 {
  flex: 0 0 auto;
  width: 91.66666667%;
  padding-right: calc(var(--spacing-md) * 0.5);
  padding-left: calc(var(--spacing-md) * 0.5);
}

.col-12 {
  flex: 0 0 auto;
  width: 100%;
  padding-right: calc(var(--spacing-md) * 0.5);
  padding-left: calc(var(--spacing-md) * 0.5);
}

@media (min-width: 576px) {
  .col-sm {
    flex: 1 0 0%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-sm-1 {
    flex: 0 0 auto;
    width: 8.33333333%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-sm-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-sm-3 {
    flex: 0 0 auto;
    width: 25%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-sm-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-sm-5 {
    flex: 0 0 auto;
    width: 41.66666667%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-sm-6 {
    flex: 0 0 auto;
    width: 50%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-sm-7 {
    flex: 0 0 auto;
    width: 58.33333333%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-sm-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-sm-9 {
    flex: 0 0 auto;
    width: 75%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-sm-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-sm-11 {
    flex: 0 0 auto;
    width: 91.66666667%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-sm-12 {
    flex: 0 0 auto;
    width: 100%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
}

@media (min-width: 768px) {
  .col-md {
    flex: 1 0 0%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-md-1 {
    flex: 0 0 auto;
    width: 8.33333333%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-md-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-md-3 {
    flex: 0 0 auto;
    width: 25%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-md-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-md-5 {
    flex: 0 0 auto;
    width: 41.66666667%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-md-6 {
    flex: 0 0 auto;
    width: 50%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-md-7 {
    flex: 0 0 auto;
    width: 58.33333333%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-md-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-md-9 {
    flex: 0 0 auto;
    width: 75%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-md-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-md-11 {
    flex: 0 0 auto;
    width: 91.66666667%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-md-12 {
    flex: 0 0 auto;
    width: 100%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
}

@media (min-width: 992px) {
  .col-lg {
    flex: 1 0 0%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-lg-1 {
    flex: 0 0 auto;
    width: 8.33333333%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-lg-2 {
    flex: 0 0 auto;
    width: 16.66666667%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-lg-3 {
    flex: 0 0 auto;
    width: 25%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-lg-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-lg-5 {
    flex: 0 0 auto;
    width: 41.66666667%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-lg-6 {
    flex: 0 0 auto;
    width: 50%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-lg-7 {
    flex: 0 0 auto;
    width: 58.33333333%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-lg-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-lg-9 {
    flex: 0 0 auto;
    width: 75%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-lg-10 {
    flex: 0 0 auto;
    width: 83.33333333%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-lg-11 {
    flex: 0 0 auto;
    width: 91.66666667%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
  
  .col-lg-12 {
    flex: 0 0 auto;
    width: 100%;
    padding-right: calc(var(--spacing-md) * 0.5);
    padding-left: calc(var(--spacing-md) * 0.5);
  }
}

/* ===== UTILIDADES ===== */
.d-flex {
  display: flex !important;
}

.flex-row {
  flex-direction: row !important;
}

.flex-column {
  flex-direction: column !important;
}

.flex-wrap {
  flex-wrap: wrap !important;
}

.flex-nowrap {
  flex-wrap: nowrap !important;
}

.justify-content-start {
  justify-content: flex-start !important;
}

.justify-content-end {
  justify-content: flex-end !important;
}

.justify-content-center {
  justify-content: center !important;
}

.justify-content-between {
  justify-content: space-between !important;
}

.justify-content-around {
  justify-content: space-around !important;
}

.align-items-start {
  align-items: flex-start !important;
}

.align-items-end {
  align-items: flex-end !important;
}

.align-items-center {
  align-items: center !important;
}

.align-items-baseline {
  align-items: baseline !important;
}

.align-items-stretch {
  align-items: stretch !important;
}

.flex-shrink-0 {
  flex-shrink: 0 !important;
}

.flex-shrink-1 {
  flex-shrink: 1 !important;
}

.flex-grow-0 {
  flex-grow: 0 !important;
}

.flex-grow-1 {
  flex-grow: 1 !important;
}

.ms-auto {
  margin-left: auto !important;
}

.me-auto {
  margin-right: auto !important;
}

.mb-0 {
  margin-bottom: 0 !important;
}

.mb-1 {
  margin-bottom: var(--spacing-xs) !important;
}

.mb-2 {
  margin-bottom: var(--spacing-sm) !important;
}

.mb-3 {
  margin-bottom: var(--spacing-md) !important;
}

.mb-4 {
  margin-bottom: var(--spacing-lg) !important;
}

.mb-5 {
  margin-bottom: var(--spacing-xl) !important;
}

.ms-1 {
  margin-left: var(--spacing-xs) !important;
}

.ms-2 {
  margin-left: var(--spacing-sm) !important;
}

.ms-3 {
  margin-left: var(--spacing-md) !important;
}

.ms-4 {
  margin-left: var(--spacing-lg) !important;
}

.ms-5 {
  margin-left: var(--spacing-xl) !important;
}

.gap-1 {
  gap: var(--spacing-xs) !important;
}

.gap-2 {
  gap: var(--spacing-sm) !important;
}

.gap-3 {
  gap: var(--spacing-md) !important;
}

.gap-4 {
  gap: var(--spacing-lg) !important;
}

.gap-5 {
  gap: var(--spacing-xl) !important;
}

.text-center {
  text-align: center !important;
}

.text-end {
  text-align: right !important;
}

.text-start {
  text-align: left !important;
}

.text-primary {
  color: var(--primary-color) !important;
}

.text-secondary {
  color: var(--text-secondary) !important;
}

.text-success {
  color: var(--success-color) !important;
}

.text-warning {
  color: var(--warning-color) !important;
}

.text-danger {
  color: var(--error-color) !important;
}

.text-info {
  color: var(--info-color) !important;
}

.text-light {
  color: var(--text-light) !important;
}

.text-white {
  color: var(--text-white) !important;
}

.fw-bold {
  font-weight: var(--font-weight-bold) !important;
}

.fw-normal {
  font-weight: var(--font-weight-normal) !important;
}

.fw-medium {
  font-weight: var(--font-weight-medium) !important;
}

.fw-semibold {
  font-weight: var(--font-weight-semibold) !important;
}

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  overflow: hidden;
}

.login-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.bg-gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  opacity: 0.9;
}

.bg-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.login-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: 1200px;
  width: 100%;
  gap: var(--spacing-2xl);
  align-items: center;
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: var(--border-radius-xl);
  padding: var(--spacing-2xl);
  box-shadow: var(--shadow-xl);
  max-width: 450px;
  width: 100%;
  margin: 0 auto;
}

.login-header {
  text-align: center;
  margin-bottom: var(--spacing-xl);
}

.logo-container {
  margin-bottom: var(--spacing-lg);
}

.logo {
  width: 80px;
  height: auto;
  border-radius: var(--border-radius-lg);
}

.login-title {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--primary-color);
  margin-bottom: var(--spacing-sm);
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: var(--font-size-lg);
}

.password-input-container {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: var(--spacing-xs);
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
}

.checkbox-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: var(--font-size-sm);
}

.checkbox-container input {
  display: none;
}

.checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  margin-right: var(--spacing-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.checkbox-container input:checked + .checkmark {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.checkbox-container input:checked + .checkmark::after {
  content: '✓';
  color: white;
  font-size: 12px;
}

.forgot-password {
  color: var(--primary-color);
  font-size: var(--font-size-sm);
  text-decoration: none;
}

.forgot-password:hover {
  text-decoration: underline;
}

.login-footer {
  margin-top: var(--spacing-xl);
  text-align: center;
}

.security-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  color: var(--success-color);
  font-size: var(--font-size-sm);
  margin-bottom: var(--spacing-md);
}

.copyright {
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
}

.features-section {
  color: white;
}

.features-section h2 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--spacing-xl);
  text-align: center;
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-lg);
}

.feature-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all var(--transition-normal);
}

.feature-card:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-5px);
}

.feature-icon {
  width: 60px;
  height: 60px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--spacing-md);
  font-size: var(--font-size-xl);
}

.feature-card h3 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--spacing-sm);
}

.feature-card p {
  font-size: var(--font-size-sm);
  opacity: 0.9;
}

/* ===== ANIMACIONES ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

/* ===== BOTÓN DE MENÚ MÓVIL ===== */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: var(--spacing-md);
  left: var(--spacing-md);
  z-index: 1051;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius-full);
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.mobile-menu-btn:hover {
  background-color: var(--primary-dark);
  transform: scale(1.05);
}

.mobile-menu-btn:active {
  transform: scale(0.95);
}

/* Overlay para móviles */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1040;
  transition: opacity var(--transition-normal);
  opacity: 0;
}

.sidebar-overlay.show {
  display: block;
  opacity: 1;
}

/* ===== RESPONSIVE ===== */
/* Para dispositivos móviles (hasta 768px) */
@media (max-width: 768px) {
  /* Sidebar en móviles */
  .sidebar {
    transform: translateX(-100%);
    z-index: 1050;
    box-shadow: var(--shadow-xl);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  /* Main content en móviles */
  .main-content {
    margin-left: 0;
    padding: var(--spacing-md);
    padding-top: calc(var(--spacing-md) + 60px);
  }

  /* Header en móviles */
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding-top: 0;
  }

  .header-title {
    font-size: var(--font-size-xl);
  }

  .user-name {
    display: none;
  }

  /* Botón de menú en móviles */
  .mobile-menu-btn {
    display: flex;
  }

  /* Login en móviles */
  .login-container {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }

  .features-section {
    display: none;
  }

  /* Cards en móviles */
  .card {
    margin-bottom: var(--spacing-md);
  }

  .card-header, .card-body, .card-footer {
    padding: var(--spacing-md);
  }

  /* Botones en móviles */
  .btn {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
  }

  /* Tablas en móviles */
  .table-responsive {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
  }

  /* Ocultar botón toggle dentro del sidebar en móviles */
  .toggle-btn {
    display: none;
  }
}

/* Para tablets (entre 768px y 992px) */
@media (min-width: 769px) and (max-width: 992px) {
  .main-content {
    margin-left: 0;
    padding: var(--spacing-md);
    padding-top: calc(var(--spacing-md) + 60px);
  }

  .sidebar {
    transform: translateX(-100%);
    z-index: 1050;
    box-shadow: var(--shadow-xl);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .header-title {
    font-size: var(--font-size-xl);
  }

  /* Mostrar botón de menú en tablets */
  .mobile-menu-btn {
    display: flex;
  }

  /* Ocultar botón toggle dentro del sidebar */
  .toggle-btn {
    display: none;
  }

  .user-name {
    display: inline-block;
  }
}

/* Para escritorio pequeño (entre 992px y 1200px) */
@media (min-width: 993px) and (max-width: 1200px) {
  .main-content {
    margin-left: 200px;
  }
  
  .sidebar {
    width: 200px;
  }
  
  .sidebar-collapsed .sidebar {
    width: 60px;
  }
}

/* Para escritorio grande (más de 1200px) */
@media (min-width: 1201px) {
  .container {
    max-width: 1200px;
  }
}

/* ===== TEMAS DE COLOR ===== */
/* Tema Verde */
[data-theme-color="green"] {
  --primary-color: #06a77d;
  --primary-dark: #047857;
  --primary-light: #10b981;
  --secondary-color: #059669;
}

/* Tema Morado */
[data-theme-color="purple"] {
  --primary-color: #7c3aed;
  --primary-dark: #5b21b6;
  --primary-light: #8b5cf6;
  --secondary-color: #6d28d9;
}

/* Tema Rojo */
[data-theme-color="red"] {
  --primary-color: #dc2626;
  --primary-dark: #991b1b;
  --primary-light: #ef4444;
  --secondary-color: #b91c1c;
}

/* Tema Naranja */
[data-theme-color="orange"] {
  --primary-color: #ea580c;
  --primary-dark: #c2410c;
  --primary-light: #f97316;
  --secondary-color: #d97706;
}

/* Tema Rosa */
[data-theme-color="pink"] {
  --primary-color: #ec4899;
  --primary-dark: #be185d;
  --primary-light: #f472b6;
  --secondary-color: #db2777;
}

/* ===== MODO OSCURO ===== */
[data-theme-mode="dark"] {
  --text-primary: #f8f9fa;
  --text-secondary: #adb5bd;
  --text-light: #e9ecef;
  --body-bg: #0f1419;
  --card-bg: #1a1f2e;
  --header-bg: #1a1f2e;
  --sidebar-bg: #151b23;
  --border-color: #2d3748;
}

[data-theme-mode="dark"] .login-card {
  background: rgba(26, 31, 46, 0.95);
}

[data-theme-mode="dark"] .form-control {
  background-color: #2d3748;
  border-color: #4a5568;
  color: #f8f9fa;
}

[data-theme-mode="dark"] .form-control:focus {
  background-color: #2d3748;
  border-color: var(--primary-color);
  color: #f8f9fa;
}

[data-theme-mode="dark"] .form-select {
  background-color: #2d3748;
  border-color: #4a5568;
  color: #f8f9fa;
}

[data-theme-mode="dark"] .form-select:focus {
  background-color: #2d3748;
  border-color: var(--primary-color);
  color: #f8f9fa;
}

[data-theme-mode="dark"] .table {
  color: var(--text-primary);
}

[data-theme-mode="dark"] .table > :not(caption) > * > * {
  background-color: var(--card-bg);
}

/* Mantener compatibilidad con prefers-color-scheme */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme-mode]) {
    --text-primary: #f8f9fa;
    --text-secondary: #adb5bd;
    --text-light: #e9ecef;
    --body-bg: #0f1419;
    --card-bg: #1a1f2e;
    --header-bg: #1a1f2e;
    --sidebar-bg: #151b23;
    --border-color: #2d3748;
  }
}

/* ===== SUBMENÚS DESPLEGABLES ===== */
.nav-item.has-submenu {
  position: relative;
}

.nav-item.has-submenu > .nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-arrow {
  font-size: 0.75rem;
  transition: transform var(--transition-normal);
  margin-left: auto;
}

.nav-item.has-submenu.open > .nav-link .nav-arrow {
  transform: rotate(180deg);
}

.submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal) ease-out;
  background-color: rgba(0, 0, 0, 0.1);
}

.nav-item.has-submenu.open .submenu {
  max-height: 800px;
  transition: max-height var(--transition-normal) ease-in;
}

.submenu-link {
  display: block;
  padding: var(--spacing-sm) var(--spacing-md);
  padding-left: calc(var(--spacing-lg) + var(--spacing-md));
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: var(--font-size-sm);
  transition: all var(--transition-fast);
}

.submenu-link:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: white;
  padding-left: calc(var(--spacing-lg) + var(--spacing-md) + 4px);
}

.sidebar.close .nav-item.has-submenu .submenu {
  display: none;
}

.sidebar.close .nav-arrow {
  display: none;
}