/**
 * ASTRACK CRM - React Override Styles
 * Sobrescribe los estilos inline de React con diseño profesional
 * Version: 2.0.0
 */

/* ============================================
   COLORES PROFESIONALES
   ============================================ */
:root {
  --primary-color: #2563eb !important;
  --primary-dark: #1e40af !important;
  --success-color: #10b981 !important;
  --danger-color: #ef4444 !important;
  --warning-color: #f59e0b !important;
  --info-color: #3b82f6 !important;
  --bg-light: #f8fafc !important;
  --bg-white: #ffffff !important;
  --text-primary: #1e293b !important;
  --text-secondary: #64748b !important;
  --border-color: #e2e8f0 !important;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1) !important;
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1) !important;
}

/* ============================================
   BODY Y LAYOUT GENERAL
   ============================================ */
body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif !important;
  color: var(--text-primary) !important;
  line-height: 1.6 !important;
}

#root {
  min-height: 100vh !important;
}

/* ============================================
   HEADER Y NAVEGACIÓN
   ============================================ */
header {
  background: var(--bg-white) !important;
  box-shadow: var(--shadow-lg) !important;
  border-bottom: 3px solid var(--primary-color) !important;
}

nav {
  background: transparent !important;
}

/* ============================================
   CARDS Y CONTENEDORES
   ============================================ */
.card,
div[class*="card"],
div[class*="Card"],
section[class*="card"],
section[class*="Card"] {
  background: var(--bg-white) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow-lg) !important;
  border: 1px solid var(--border-color) !important;
  padding: 1.5rem !important;
  transition: all 0.3s ease !important;
}

.card:hover,
div[class*="card"]:hover,
div[class*="Card"]:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1) !important;
}

/* ============================================
   BOTONES
   ============================================ */
button,
.button,
[role="button"],
input[type="button"],
input[type="submit"] {
  border-radius: 8px !important;
  font-weight: 600 !important;
  padding: 0.75rem 1.5rem !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
  border: none !important;
  box-shadow: var(--shadow) !important;
}

/* Botón Primario */
button[class*="primary"],
.btn-primary,
button:not([class*="secondary"]):not([class*="danger"]):not([class*="success"]):not([class*="warning"]) {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
  color: white !important;
}

button:hover,
.button:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.2) !important;
}

/* Botón Cerrar Sesión (Danger) */
button[class*="Cerrar"],
button[class*="cerrar"],
button[class*="Salir"],
button[class*="salir"] {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  color: white !important;
}

/* ============================================
   INPUTS Y FORMULARIOS
   ============================================ */
input,
select,
textarea {
  border: 2px solid var(--border-color) !important;
  border-radius: 8px !important;
  padding: 0.75rem 1rem !important;
  font-size: 1rem !important;
  transition: all 0.2s ease !important;
  background: var(--bg-white) !important;
}

input:focus,
select:focus,
textarea:focus {
  outline: none !important;
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

/* ============================================
   DASHBOARD - PANEL DE ADMINISTRACIÓN
   ============================================ */
.dashboard-container,
div[class*="panel"],
div[class*="Panel"],
main {
  background: var(--bg-light) !important;
  min-height: 100vh !important;
  padding: 2rem !important;
}

/* Título del Dashboard */
h1, h2, h3 {
  color: var(--text-primary) !important;
  font-weight: 700 !important;
  margin-bottom: 1.5rem !important;
}

h1 {
  font-size: 2rem !important;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

/* ============================================
   TARJETAS DE ESTADÍSTICAS
   ============================================ */
.stat-card,
div[class*="stat"],
div[class*="Stat"],
div[class*="metric"],
div[class*="Metric"] {
  background: linear-gradient(135deg, white 0%, #f8fafc 100%) !important;
  border-left: 4px solid var(--primary-color) !important;
  border-radius: 12px !important;
  padding: 1.5rem !important;
  box-shadow: var(--shadow-lg) !important;
}

/* Números grandes en estadísticas */
.stat-card h2,
.stat-card h3,
div[class*="stat"] h2,
div[class*="stat"] h3 {
  font-size: 2.5rem !important;
  font-weight: 700 !important;
  color: var(--primary-color) !important;
}

/* ============================================
   ICONOS DE MENÚ
   ============================================ */
.menu-icon,
div[class*="icon"],
span[class*="icon"] {
  font-size: 2rem !important;
  margin-bottom: 0.5rem !important;
}

/* ============================================
   BADGES Y ETIQUETAS
   ============================================ */
.badge,
span[class*="badge"],
span[class*="Badge"] {
  background: var(--primary-color) !important;
  color: white !important;
  padding: 0.25rem 0.75rem !important;
  border-radius: 999px !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
}

.badge-success {
  background: var(--success-color) !important;
}

.badge-danger {
  background: var(--danger-color) !important;
}

.badge-warning {
  background: var(--warning-color) !important;
}

/* ============================================
   TABLAS
   ============================================ */
table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background: var(--bg-white) !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  box-shadow: var(--shadow-lg) !important;
}

thead {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)) !important;
}

thead th {
  color: white !important;
  font-weight: 600 !important;
  padding: 1rem !important;
  text-align: left !important;
}

tbody tr {
  border-bottom: 1px solid var(--border-color) !important;
  transition: all 0.2s ease !important;
}

tbody tr:hover {
  background: var(--bg-light) !important;
  transform: scale(1.01) !important;
}

tbody td {
  padding: 1rem !important;
}

/* ============================================
   MODALES
   ============================================ */
.modal,
div[role="dialog"],
div[class*="modal"],
div[class*="Modal"] {
  background: var(--bg-white) !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25) !important;
  padding: 2rem !important;
  max-width: 90% !important;
  animation: slideIn 0.3s ease !important;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Overlay del modal */
.modal-overlay,
div[class*="overlay"],
div[class*="Overlay"] {
  background: rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(4px) !important;
}

/* ============================================
   GRID DE OPCIONES (Dashboard, Usuarios, etc)
   ============================================ */
.options-grid,
div[class*="grid"],
div[class*="Grid"] {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
  gap: 1.5rem !important;
  margin-top: 2rem !important;
}

/* Tarjetas de opciones/menú */
.option-card,
.menu-card {
  background: linear-gradient(135deg, white 0%, #f8fafc 100%) !important;
  border-radius: 12px !important;
  padding: 2rem !important;
  text-align: center !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  border: 2px solid var(--border-color) !important;
  box-shadow: var(--shadow) !important;
}

.option-card:hover,
.menu-card:hover {
  transform: translateY(-4px) !important;
  border-color: var(--primary-color) !important;
  box-shadow: var(--shadow-lg) !important;
}

/* ============================================
   ALERTAS Y NOTIFICACIONES
   ============================================ */
.alert,
div[class*="alert"],
div[class*="Alert"] {
  border-radius: 8px !important;
  padding: 1rem 1.5rem !important;
  margin: 1rem 0 !important;
  border-left: 4px solid !important;
}

.alert-success {
  background: #ecfdf5 !important;
  border-color: var(--success-color) !important;
  color: #065f46 !important;
}

.alert-danger,
.alert-error {
  background: #fef2f2 !important;
  border-color: var(--danger-color) !important;
  color: #991b1b !important;
}

.alert-warning {
  background: #fffbeb !important;
  border-color: var(--warning-color) !important;
  color: #92400e !important;
}

.alert-info {
  background: #eff6ff !important;
  border-color: var(--info-color) !important;
  color: #1e40af !important;
}

/* ============================================
   LOADING Y SPINNERS
   ============================================ */
.spinner,
.loading,
div[class*="spinner"],
div[class*="loading"] {
  border: 3px solid var(--border-color) !important;
  border-top-color: var(--primary-color) !important;
  border-radius: 50% !important;
  animation: spin 1s linear infinite !important;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .dashboard-container,
  div[class*="panel"],
  main {
    padding: 1rem !important;
  }
  
  .options-grid,
  div[class*="grid"] {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  
  h1 {
    font-size: 1.5rem !important;
  }
  
  .card,
  div[class*="card"] {
    padding: 1rem !important;
  }
}

/* ============================================
   SCROLLBAR PERSONALIZADO
   ============================================ */
::-webkit-scrollbar {
  width: 8px !important;
  height: 8px !important;
}

::-webkit-scrollbar-track {
  background: var(--bg-light) !important;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color) !important;
  border-radius: 4px !important;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark) !important;
}

/* ============================================
   UTILIDADES
   ============================================ */
.text-center {
  text-align: center !important;
}

.text-right {
  text-align: right !important;
}

.mt-1 { margin-top: 0.5rem !important; }
.mt-2 { margin-top: 1rem !important; }
.mt-3 { margin-top: 1.5rem !important; }
.mt-4 { margin-top: 2rem !important; }

.mb-1 { margin-bottom: 0.5rem !important; }
.mb-2 { margin-bottom: 1rem !important; }
.mb-3 { margin-bottom: 1.5rem !important; }
.mb-4 { margin-bottom: 2rem !important; }

.p-1 { padding: 0.5rem !important; }
.p-2 { padding: 1rem !important; }
.p-3 { padding: 1.5rem !important; }
.p-4 { padding: 2rem !important; }

/* ============================================
   ANIMACIONES ADICIONALES
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.3s ease !important;
}

.animate-slideUp {
  animation: slideUp 0.4s ease !important;
}
