:root {
  --primary: #470f86; /*#6017b1; */
  --primary-dark: #2e0959;
  --primary-light: #440187;
  --secondary-1: #5c05b3;
  --secondary-2: #ffe704;
  --secondary-3: #972bb5;
  --success: #5407a2;
  --error: #dc3545;
  --warning: #ffec34;
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #2e2e2e;
  --text-light: #616161;
  --border: #e0e0e0;
  --link: #950ae1;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: "Montserrat", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.4;
  padding: 0.75rem;
  font-size: 14px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

header {
  background: var(--primary);
  padding: 1.5rem 2rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
}

header h1 {
  color: white;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card h2 {
  color: var(--text);
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.description {
  color: var(--text-light);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

.form-group {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

input[type="text"] {
  flex: 1;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9375rem;
  font-family: "Montserrat", sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(96, 23, 177, 0.1);
}

.btn {
  padding: 0.625rem 1.5rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: "Montserrat", sans-serif;
  cursor: pointer;
  transition: background-color 0.2s;
  white-space: nowrap;
}

.btn:hover {
  background: var(--primary-dark);
}

.btn:active {
  transform: scale(0.98);
}

.result {
  display: none;
  padding: 1rem;
  border-radius: 6px;
  font-size: 0.9375rem;
}

.result.loading {
  display: block;
  background: #fef3c7;
  border-left: 3px solid var(--warning);
  color: #92400e;
}

.result.success {
  display: block;
  background: #d1fae5;
  border-left: 3px solid var(--success);
  color: #58065f;
}

.result.error {
  display: block;
  background: #fee2e2;
  border-left: 3px solid var(--error);
  color: #991b1b;
}

.result h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
  background: white;
  border-radius: 6px;
  overflow: hidden;
  font-size: 0.875rem;
}

.result-table thead {
  background: var(--primary);
  color: white;
}

.result-table th {
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.result-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}

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

.result-table tbody tr:hover {
  background: #f9fafb;
}

.stock-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.stock-badge.high {
  background: #d1fae5;
  color: #065f46;
}

.stock-badge.medium {
  background: #fef3c7;
  color: #92400e;
}

.stock-badge.low {
  background: #fee2e2;
  color: #991b1b;
}

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

  header h1 {
    font-size: 1.5rem;
  }

  .form-group {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0.75rem;
  }

  header {
    padding: 1.25rem 1.5rem;
  }

  .card {
    padding: 1.25rem;
  }

  .result-table {
    font-size: 0.8125rem;
  }

  .result-table th,
  .result-table td {
    padding: 0.5rem;
  }
}

/* Estilos para módulos */
.module-nav {
  margin-bottom: 2rem;
}

.btn-back {
  background: #6b7280;
  color: white;
  text-decoration: none;
  padding: 0.625rem 1.25rem;
  border-radius: 6px;
  display: inline-block;
  font-weight: 500;
  transition: background-color 0.2s;
}

.btn-back:hover {
  background: #4b5563;
}

.module-body {
  padding: 0;
}

.input-large {
  padding: 0.875rem 1rem;
  font-size: 1rem;
}

.btn-large {
  padding: 1rem 1.75rem;
  font-size: 1rem;
}

.form-group-vertical {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.form-group-vertical label {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9375rem;
}

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

input[type="number"],
select,
textarea {
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9375rem;
  font-family: "Montserrat", sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="number"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(96, 23, 177, 0.1);
}

textarea {
  resize: vertical;
}

.warning-box {
  background: #fef3c7;
  border-left: 3px solid var(--warning);
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 6px;
  color: #92400e;
}

/* Header mejorado */
.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-info span {
  color: white;
  font-weight: 500;
}

.btn-secondary {
  background: white;
  color: var(--primary);
  padding: 0.5rem 1rem;
}

.btn-secondary:hover {
  background: #f3f4f6;
  color: var(--primary-dark);
}

/* Dashboard grid */
.welcome-section {
  text-align: center;
  margin-bottom: 3rem;
}

.welcome-section h2 {
  color: var(--text);
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.welcome-section p {
  color: var(--text-light);
  font-size: 1.125rem;
}

.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.module-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.3s, box-shadow 0.3s;
}

.module-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(96, 23, 177, 0.15);
}

.module-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.module-card h3 {
  color: var(--text);
  font-size: 1.375rem;
  margin-bottom: 0.75rem;
}

.module-description {
  color: var(--text-light);
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.btn-module {
  background: var(--primary);
  color: white;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  display: inline-block;
  font-weight: 600;
  transition: background-color 0.2s;
}

.btn-module:hover {
  background: var(--primary-dark);
}

.dashboard-footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
  font-size: 0.875rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

/* Login/Auth styles */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  background: var(--surface);
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-width: 450px;
  width: 100%;
}

.login-card h1 {
  text-align: center;
  color: var(--primary);
  margin-bottom: 2rem;
  font-size: 1.75rem;
}

.login-card .form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.login-card label {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  font-size: 0.9375rem;
}

.login-card input {
  width: 100%;
}

input[type="email"],
input[type="password"] {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9375rem;
  font-family: "Montserrat", sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="email"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(96, 23, 177, 0.1);
}

.btn-primary {
  width: 100%;
  background: var(--primary);
  color: white;
  padding: 0.875rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-top: 0.5rem;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

/* Action Buttons Group - Aligned button layout */
.action-buttons-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: nowrap;
  align-items: center;
}

.action-buttons-group button {
  flex: 1 1 0;
  padding: 0.65rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  line-height: 1.2;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  min-width: 0;
}

.btn-edit-prices {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-edit-prices:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-find-sku {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.btn-find-sku:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

.btn-edit-title {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
}

.btn-edit-title:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 172, 254, 0.4);
}

.error-message {
  color: var(--error);
  background: #fee2e2;
  padding: 0.75rem;
  border-radius: 6px;
  margin-top: 1rem;
  font-size: 0.875rem;
  display: none;
}

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

.success-message {
  color: #155724;
  background: #d4edda;
  padding: 0.75rem;
  border-radius: 6px;
  margin-top: 1rem;
  font-size: 0.875rem;
  display: none;
}

.success-message.show {
  display: block;
}

.auth-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
  text-align: center;
}

.auth-links a {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.875rem;
}

.auth-links a:hover {
  text-decoration: underline;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--surface);
  padding: 2rem;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
  color: var(--text);
  margin-bottom: 1rem;
}

/* Modal styles for POS (different naming convention) */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.modal-overlay[style*="display: flex"] {
  display: flex !important;
}

.modal-box {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  padding: 0;
  overflow: hidden;
  max-width: 600px;
  width: 90%;
  animation: modalFadeIn 0.3s ease-out;
}

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

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #2e0959 0%, #5c05b3 100%);
}

.modal-header h3 {
  margin: 0;
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: white;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.modal-body {
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e0e0e0;
  background: #f8f9fa;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .modules-grid {
    grid-template-columns: 1fr;
  }

  .header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .user-info {
    flex-direction: column;
  }
}

/* ========================================
   SIDEBAR STYLES - COMPACTO Y PROFESIONAL
   ======================================== */

/* Layout principal con sidebar */
body.with-sidebar {
  padding-left: 200px;
  padding-top: 0;
  padding-right: 0;
  padding-bottom: 0;
  transition: padding-left 0.3s ease;
}

body.with-sidebar.sidebar-collapsed {
  padding-left: 0;
}

/* Container del sidebar - ANCHO OPTIMIZADO */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 200px;
  height: 100vh;
  background: linear-gradient(180deg, #1f1535 0%, #2d1f4a 30%, #1a1228 100%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: 6px 0 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
  font-size: 13px;
}

/* Scrollbar personalizada para el sidebar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Header del sidebar - MEJORADO CON MÁS CONTRASTE */
.sidebar-header {
  padding: 0.75rem 1rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Header Actions (Notifications + Toggle) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Notification Button */
.notification-btn {
  position: relative;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.notification-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.notification-icon {
  font-size: 1.2rem;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Notification Dropdown */
.notification-dropdown {
  position: fixed;
  top: 4.5rem;
  left: 220px;
  width: 360px;
  max-height: 500px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.notification-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f9fafb;
}

.notification-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
}

.notification-count {
  background: var(--primary, #7c3aed);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  min-width: 24px;
  text-align: center;
}

.notification-body {
  flex: 1;
  overflow-y: auto;
  max-height: 400px;
}

.notification-loading,
.notification-empty,
.notification-error {
  padding: 2rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.9rem;
}

.notification-error {
  color: #ef4444;
}

.notification-board-group {
  border-bottom: 1px solid #f3f4f6;
}

.notification-board-group:last-child {
  border-bottom: none;
}

.notification-board-title {
  padding: 0.75rem 1.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #fafafa;
}

.notification-item {
  display: block;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid #f3f4f6;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
}

.notification-item:hover {
  background: #f9fafb;
  border-left: 3px solid var(--primary, #7c3aed);
  padding-left: calc(1.25rem - 3px);
}

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

.notification-item-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  margin-left: 1.4rem;
}

.notification-action-btn {
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid #d1d5db;
  background: white;
  color: #6b7280;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.notification-action-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
  color: #374151;
  transform: translateY(-1px);
}

.notification-action-btn.dismiss {
  color: #ef4444;
  border-color: #fecaca;
}

.notification-action-btn.dismiss:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

.notification-action-btn.snooze {
  color: #f59e0b;
  border-color: #fcd34d;
}

.notification-action-btn.snooze:hover {
  background: #fffbeb;
  border-color: #f59e0b;
}

.notification-item-header {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.notification-priority {
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.notification-item-title {
  font-weight: 600;
  color: #1f2937;
  font-size: 0.9rem;
  line-height: 1.4;
  flex: 1;
}

.notification-item-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: #6b7280;
  margin-left: 1.4rem;
}

.notification-list-name {
  font-weight: 500;
}

.notification-due-date {
  color: #f59e0b;
  font-weight: 500;
}

.sidebar-logo {
  margin: 0;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  line-height: 1.2;
  text-decoration: none;
  transition: all 0.3s ease;
}

.sidebar-logo:hover {
  transform: translateX(2px);
}

.logo-text-main {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #ffffff 0%, #e0d4ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-text-sub {
  font-size: 0.7rem;
  font-weight: 600;
  opacity: 0.85;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.9);
}

/* Botón toggle para móvil (inicialmente oculto) */
.sidebar-toggle-mobile {
  display: none;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  transition: all 0.3s;
}

.sidebar-toggle-mobile span {
  width: 18px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s;
}

.sidebar-toggle-mobile:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Navegación del sidebar */
.sidebar-nav {
  flex: 1;
  padding: 0.5rem 0.75rem;
  overflow-y: auto;
}

/* Items de menú - DISEÑO MEJORADO CON MÁS CONTRASTE */
.sidebar-item {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.85rem;
  margin: 0.1rem 0;
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
  border-radius: 8px;
  position: relative;
  background: transparent;
  border: 1px solid transparent;
  font-weight: 500;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: translateX(3px);
  border-left: 3px solid rgba(255, 255, 255, 0.5);
  padding-left: calc(0.85rem - 3px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-item.active {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.08) 100%);
  color: #ffffff;
  border-left: 4px solid #a78bfa;
  padding-left: calc(0.85rem - 4px);
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(167, 139, 250, 0.25);
}

.sidebar-item-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.sidebar-icon {
  font-size: 1rem;
  margin-right: 0.7rem;
  min-width: 20px;
  text-align: center;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
}

.sidebar-item.active .sidebar-icon {
  filter: drop-shadow(0 2px 4px rgba(167, 139, 250, 0.5));
  transform: scale(1.05);
}

.sidebar-label {
  flex: 1;
  font-size: 0.8125rem;
  line-height: 1.3;
  letter-spacing: 0.15px;
}

/* Divisor de secciones - MÁS CONTRASTE */
.sidebar-divider {
  padding: 1rem 1rem 0.75rem 1rem;
  margin: 0.75rem 0 0.5rem 0;
  border-top: 2px solid rgba(255, 255, 255, 0.15);
  position: relative;
}

.divider-text {
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.5) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Submenús - colapsables */
.sidebar-submenu {
  display: flex;
  flex-direction: column;
}

.sidebar-submenu-trigger {
  display: flex;
  align-items: center;
  padding: 0.45rem 1rem;
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  user-select: none;
  font-weight: 500;
  font-size: 0.8rem;
  position: relative;
}

.sidebar-submenu-trigger:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border-left-color: rgba(255, 255, 255, 0.4);
}

.sidebar-submenu-trigger.active {
  background: rgba(0, 0, 0, 0.4);
  color: #ffe704;
  border-left-color: #ffe704;
  font-weight: 600;
}

.sidebar-submenu-trigger .sidebar-icon {
  font-size: 0.95rem;
  margin-right: 0.6rem;
  min-width: 18px;
  text-align: center;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.sidebar-submenu-trigger .sidebar-label {
  flex: 1;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.2;
}

/* Flecha del submenú */
.submenu-arrow {
  margin-left: 0.5rem;
  font-size: 0.7rem;
  transition: transform 0.3s ease;
  font-weight: 400;
  opacity: 0.5;
}

.submenu-arrow.rotated {
  transform: rotate(90deg);
}

/* Contenido del submenú - colapsable */
.sidebar-submenu-content {
  background: transparent;
  padding-top: 0.15rem;
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 1;
}

.sidebar-submenu-content.collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
}

.sidebar-subitem {
  display: flex;
  align-items: center;
  padding: 0.35rem 1rem 0.35rem 3.5rem;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.75rem;
  border-left: 3px solid transparent;
}

.sidebar-subitem:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  padding-left: 3.65rem;
}

.sidebar-subitem.active {
  color: #ffe704;
  border-left-color: #ffe704;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.4);
}

.sidebar-subitem .sidebar-icon {
  font-size: 0.85rem;
  margin-right: 0.55rem;
}

/* Footer del sidebar - PERFECTAMENTE CENTRADO Y ALINEADO */
.sidebar-footer {
  padding: 0.7rem 0.8rem;
  border-top: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.2);
}

.user-profile {
  display: ruby;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  transition: all 0.25s ease;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  overflow: hidden;
}

.user-profile:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.user-avatar {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.5) 0%, rgba(139, 92, 246, 0.5) 100%);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.user-details {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.user-name {
  color: #ffffff;
  font-weight: 600;
  font-size: 0.75rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  display: block;
  width: 100%;
}

.user-role {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.6rem;
  line-height: 1.2;
  font-weight: 500;
}

.btn-logout-sidebar {
  padding: 0.4rem 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 1.35rem;
  cursor: pointer;
  transition: all 0.25s ease;
  display: contents;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 6px;
  width: auto;
  height: 100%;
}

.btn-logout-sidebar:hover {
  background: rgba(220, 53, 69, 0.2);
  color: #ff6b6b;
  border-color: rgba(220, 53, 69, 0.4);
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Dropdown de usuario */
.user-dropdown {
  position: absolute;
  bottom: 50px;
  left: 10px;
  right: 10px;
  background: rgba(20, 20, 30, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 1001;
  overflow: hidden;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  padding: 0.7rem 1rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  gap: 0.6rem;
  font-size: 0.8rem;
}

.user-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.dropdown-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.dropdown-arrow {
  margin-left: auto;
  font-size: 1.2rem;
  opacity: 0.6;
}

/* Submenu de temas */
.theme-submenu {
  position: absolute;
  bottom: 50px;
  left: 10px;
  right: 10px;
  background: rgba(20, 20, 30, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 1002;
  padding: 0.5rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.theme-option:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.theme-preview {
  width: 100%;
  height: 30px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.theme-option span {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.7rem;
  font-weight: 500;
}

/* Temas de color - Sistema completo con variables CSS */

/* Tema Morado (default) */
.sidebar.theme-purple {
  background: linear-gradient(180deg, #1e0f2e 0%, #5c2d91 40%, #5528a8 70%, #1e0f2e 100%);
}

html.theme-purple,
body.theme-purple {
  --primary: #7c3aed;
  --primary-dark: #5c2d91;
  --primary-light: #a78bfa;
}

/* Tema Amarillo/Dorado */
.sidebar.theme-yellow {
  background: linear-gradient(180deg, #2e2510 0%, #8b7436 40%, #937526 70%, #2e2510 100%);
}

html.theme-yellow,
body.theme-yellow {
  --primary: #d4af37;
  --primary-dark: #8b7436;
  --primary-light: #f0d98d;
}

/* Tema Rojo */
.sidebar.theme-red {
  background: linear-gradient(180deg, #2e1010 0%, #8b2323 40%, #8e1616 70%, #2e1010 100%);
}

html.theme-red,
body.theme-red {
  --primary: #dc2626;
  --primary-dark: #8b2323;
  --primary-light: #f87171;
}

/* Tema Naranja */
.sidebar.theme-orange {
  background: linear-gradient(180deg, #2e1d10 0%, #8b5a23 40%, #a8590d 70%, #2e1d10 100%);
}

html.theme-orange,
body.theme-orange {
  --primary: #f97316;
  --primary-dark: #8b5a23;
  --primary-light: #fb923c;
}

/* Tema Gris Oscuro */
.sidebar.theme-black {
  background: linear-gradient(180deg, #000000 0%, #1a1a1a 40%, #262626 70%, #000000 100%);
}

html.theme-black,
body.theme-black {
  --primary: #3a3a3a;
  --primary-dark: #1a1a1a;
  --primary-light: #525252;
}

/* Tema Rosado */
.sidebar.theme-pink {
  background: linear-gradient(180deg, #2e1024 0%, #8b2d6f 40%, #a82868 70%, #2e1024 100%);
}

html.theme-pink,
body.theme-pink {
  --primary: #ec4899;
  --primary-dark: #8b2d6f;
  --primary-light: #f9a8d4;
}

/* Tema Azul (nuevo) */
.sidebar.theme-blue {
  background: linear-gradient(180deg, #0f1f35 0%, #2563eb 40%, #275aa8 70%, #0f1f35 100%);
}

html.theme-blue,
body.theme-blue {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #93c5fd;
}

/* Tema Verde (nuevo) */
.sidebar.theme-green {
  background: linear-gradient(180deg, #0f2e1a 0%, #16a34a 40%, #177538 70%, #0f2e1a 100%);
}

html.theme-green,
body.theme-green {
  --primary: #22c55e;
  --primary-dark: #16a34a;
  --primary-light: #86efac;
}

/* Tema Turquesa (nuevo) */
.sidebar.theme-cyan {
  background: linear-gradient(180deg, #0f2e35 0%, #0891b2 40%, #06788f 70%, #0f2e35 100%);
}

html.theme-cyan,
body.theme-cyan {
  --primary: #06b6d4;
  --primary-dark: #0891b2;
  --primary-light: #67e8f9;
}

/* Tema Violeta Profundo */
.sidebar.theme-white {
  background: linear-gradient(180deg, #3d1f5c 0%, #5e2f7e 40%, #7c4b9f 70%, #3d1f5c 100%);
}

.sidebar.theme-white .sidebar-logo,
.sidebar.theme-white .sidebar-item,
.sidebar.theme-white .user-name,
.sidebar.theme-white .user-role,
.sidebar.theme-white .divider-text {
  color: #ffffff !important;
}

.sidebar.theme-white .sidebar-item:hover {
  background: rgba(255, 255, 255, 0.15);
}

.sidebar.theme-white .sidebar-item.active {
  background: rgba(255, 255, 255, 0.2);
}

html.theme-white,
body.theme-white {
  --primary: #7c4b9f;
  --primary-dark: #5e2f7e;
  --primary-light: #a67cc1;
}

/* Responsive - Móvil (<768px) */
@media (max-width: 768px) {
  body.with-sidebar {
    padding-left: 0;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.sidebar-open,
  body.with-sidebar:not(.sidebar-collapsed) .sidebar {
    transform: translateX(0);
  }

  .sidebar-toggle-mobile {
    display: flex;
  }

  /* Backdrop para móvil */
  body.with-sidebar:not(.sidebar-collapsed)::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
  }
}

/* Print styles - Ocultar sidebar al imprimir */
@media print {
  .sidebar {
    display: none !important;
  }

  body.with-sidebar {
    padding-left: 0 !important;
  }
}

/* Loading Screen Global - CSS Pure Animation */
#globalLoadingScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 1;
  transition: opacity 0.4s ease-out;
}

#globalLoadingScreen.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Spinner circular moderno */
.spinner-container {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 2rem;
}

.spinner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 4px solid transparent;
  border-top-color: #5c2d91;
  border-right-color: #7c3aed;
  border-radius: 50%;
  animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(2) {
  border-top-color: #7c3aed;
  border-right-color: #8b5cf6;
  animation-delay: -0.3s;
  width: 80%;
  height: 80%;
  top: 10%;
  left: 10%;
}

.spinner-ring:nth-child(3) {
  border-top-color: #8b5cf6;
  border-right-color: #9f7aea;
  animation-delay: -0.6s;
  width: 60%;
  height: 60%;
  top: 20%;
  left: 20%;
}

/* Puntos pulsantes debajo del spinner */
.spinner-dots {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.spinner-dots span {
  width: 10px;
  height: 10px;
  background: #5c2d91;
  border-radius: 50%;
  animation: pulseDot 1.4s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(92, 45, 145, 0.6);
}

.spinner-dots span:nth-child(2) {
  animation-delay: 0.2s;
  background: #7c3aed;
}

.spinner-dots span:nth-child(3) {
  animation-delay: 0.4s;
  background: #8b5cf6;
}

#globalLoadingScreen .loading-text {
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  animation: fadeInOut 2s ease-in-out infinite;
}

/* Animaciones */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulseDot {
  0%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

@keyframes fadeInOut {
  0%, 100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.8;
  }
}
