/**
 * ╔═══════════════════════════════════════════════════════════════════════════╗
 * ║                           SGI THEME v2.0                                   ║
 * ║              Sistema de Gestión Integral - Estilos Globales               ║
 * ╚═══════════════════════════════════════════════════════════════════════════╝
 * 
 * Incluir en cualquier vista con: 
 * <link rel="stylesheet" href="{{ asset('css/sgi-theme.css') }}">
 */

/* ============================================================================
   VARIABLES CSS - Paleta SGI
   ============================================================================ */
:root {
  /* Colores Primarios */
  --sgi-primary: #0a2f51;
  --sgi-primary-light: #113d6b;
  --sgi-primary-dark: #061e33;
  --sgi-accent: #f3c311;
  --sgi-accent-light: #ffd43b;
  --sgi-accent-dark: #c9a00c;
  
  /* Colores Semánticos */
  --sgi-success: #10b981;
  --sgi-success-light: #34d399;
  --sgi-danger: #ef4444;
  --sgi-danger-light: #f87171;
  --sgi-warning: #f59e0b;
  --sgi-warning-light: #fbbf24;
  --sgi-info: #3b82f6;
  --sgi-info-light: #60a5fa;
  
  /* Fondos */
  --sgi-bg: #f0f4f8;
  --sgi-bg-alt: #e8eef4;
  --sgi-card-bg: #ffffff;
  
  /* Bordes y Sombras */
  --sgi-border: #e2e8f0;
  --sgi-border-light: #f1f5f9;
  --sgi-shadow-sm: 0 2px 8px rgba(10, 47, 81, 0.06);
  --sgi-shadow: 0 4px 20px rgba(10, 47, 81, 0.08);
  --sgi-shadow-lg: 0 10px 40px rgba(10, 47, 81, 0.12);
  --sgi-shadow-xl: 0 20px 60px rgba(10, 47, 81, 0.15);
  
  /* Textos */
  --sgi-text: #1e293b;
  --sgi-text-light: #475569;
  --sgi-text-muted: #64748b;
  --sgi-text-pale: #94a3b8;
  
  /* Radios */
  --sgi-radius-sm: 8px;
  --sgi-radius: 12px;
  --sgi-radius-lg: 16px;
  --sgi-radius-xl: 24px;
  --sgi-radius-full: 999px;
  
  /* Transiciones */
  --sgi-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --sgi-transition-fast: all 0.15s ease;
}

/* ============================================================================
   CONTENEDOR PRINCIPAL
   ============================================================================ */
.sgi-container {
  padding: 28px;
  background: var(--sgi-bg);
  min-height: 100vh;
}

/* ============================================================================
   HEADER DE PÁGINA
   ============================================================================ */
.sgi-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding: 20px 24px;
  background: linear-gradient(135deg, var(--sgi-primary) 0%, var(--sgi-primary-light) 100%);
  border-radius: var(--sgi-radius-lg);
  box-shadow: var(--sgi-shadow-lg);
  flex-wrap: wrap;
  gap: 16px;
}

.sgi-page-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sgi-page-title i {
  font-size: 1.3rem;
  color: var(--sgi-accent);
}

.sgi-page-subtitle {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 4px;
}

.sgi-page-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ============================================================================
   BOTONES SGI
   ============================================================================ */
.sgi-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: var(--sgi-radius-full);
  border: none;
  cursor: pointer;
  transition: var(--sgi-transition);
  text-decoration: none;
  white-space: nowrap;
}

.sgi-btn:hover {
  transform: translateY(-2px);
  text-decoration: none;
}

.sgi-btn:active {
  transform: translateY(0);
}

/* Variantes de botón */
.sgi-btn-primary {
  background: var(--sgi-accent);
  color: var(--sgi-primary);
  box-shadow: 0 4px 14px rgba(243, 195, 17, 0.4);
}

.sgi-btn-primary:hover {
  background: var(--sgi-accent-light);
  color: var(--sgi-primary);
  box-shadow: 0 6px 20px rgba(243, 195, 17, 0.5);
}

.sgi-btn-secondary {
  background: rgba(255,255,255,0.15);
  color: #fff;
  backdrop-filter: blur(10px);
}

.sgi-btn-secondary:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.sgi-btn-success {
  background: var(--sgi-success);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.sgi-btn-success:hover {
  background: var(--sgi-success-light);
  color: #fff;
}

.sgi-btn-danger {
  background: var(--sgi-danger);
  color: #fff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.sgi-btn-danger:hover {
  background: var(--sgi-danger-light);
  color: #fff;
}

.sgi-btn-outline {
  background: var(--sgi-card-bg);
  color: var(--sgi-text);
  border: 2px solid var(--sgi-border);
}

.sgi-btn-outline:hover {
  border-color: var(--sgi-primary);
  color: var(--sgi-primary);
  background: var(--sgi-bg);
}

.sgi-btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.sgi-btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

/* ============================================================================
   TARJETAS SGI
   ============================================================================ */
.sgi-card {
  background: var(--sgi-card-bg);
  border-radius: var(--sgi-radius-lg);
  box-shadow: var(--sgi-shadow);
  overflow: hidden;
  transition: var(--sgi-transition);
  border: 1px solid var(--sgi-border-light);
}

.sgi-card:hover {
  box-shadow: var(--sgi-shadow-lg);
  transform: translateY(-4px);
}

.sgi-card-header {
  padding: 18px 22px;
  background: linear-gradient(135deg, var(--sgi-primary) 0%, var(--sgi-primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.sgi-card-title {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sgi-card-title i {
  color: var(--sgi-accent);
}

.sgi-card-body {
  padding: 22px;
}

.sgi-card-footer {
  padding: 16px 22px;
  background: var(--sgi-bg-alt);
  border-top: 1px solid var(--sgi-border-light);
}

/* ============================================================================
   BADGES / CHIPS
   ============================================================================ */
.sgi-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--sgi-radius-full);
  transition: var(--sgi-transition-fast);
}

.sgi-badge-primary {
  background: var(--sgi-primary);
  color: #fff;
}

.sgi-badge-accent {
  background: var(--sgi-accent);
  color: var(--sgi-primary);
}

.sgi-badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--sgi-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.sgi-badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--sgi-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.sgi-badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--sgi-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.sgi-badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: var(--sgi-info);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.sgi-badge-light {
  background: rgba(255,255,255,0.2);
  color: #fff;
  backdrop-filter: blur(4px);
}

.sgi-badge-outline {
  background: var(--sgi-card-bg);
  color: var(--sgi-text);
  border: 1px solid var(--sgi-border);
}

/* ============================================================================
   ESTADÍSTICAS / STATS
   ============================================================================ */
.sgi-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.sgi-stat-card {
  background: var(--sgi-card-bg);
  border-radius: var(--sgi-radius-lg);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--sgi-shadow);
  transition: var(--sgi-transition);
  border: 1px solid var(--sgi-border-light);
}

.sgi-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sgi-shadow-lg);
}

.sgi-stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--sgi-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.sgi-stat-icon.primary {
  background: linear-gradient(135deg, var(--sgi-primary) 0%, var(--sgi-primary-light) 100%);
  color: var(--sgi-accent);
}

.sgi-stat-icon.success {
  background: linear-gradient(135deg, var(--sgi-success) 0%, var(--sgi-success-light) 100%);
  color: #fff;
}

.sgi-stat-icon.warning {
  background: linear-gradient(135deg, var(--sgi-warning) 0%, var(--sgi-warning-light) 100%);
  color: #fff;
}

.sgi-stat-icon.danger {
  background: linear-gradient(135deg, var(--sgi-danger) 0%, var(--sgi-danger-light) 100%);
  color: #fff;
}

.sgi-stat-content {
  flex: 1;
}

.sgi-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--sgi-text);
  line-height: 1;
  margin-bottom: 4px;
}

.sgi-stat-label {
  font-size: 0.85rem;
  color: var(--sgi-text-muted);
  font-weight: 600;
}

/* ============================================================================
   LISTAS Y ITEMS
   ============================================================================ */
.sgi-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sgi-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--sgi-card-bg);
  border: 1px solid var(--sgi-border-light);
  border-radius: var(--sgi-radius);
  transition: var(--sgi-transition);
  cursor: pointer;
}

.sgi-list-item:hover {
  border-color: var(--sgi-primary);
  box-shadow: var(--sgi-shadow);
  transform: translateX(6px);
}

.sgi-list-item-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--sgi-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sgi-bg);
  color: var(--sgi-primary);
  font-size: 1.1rem;
}

.sgi-list-item-content {
  flex: 1;
  min-width: 0;
}

.sgi-list-item-title {
  font-weight: 700;
  color: var(--sgi-text);
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.sgi-list-item-subtitle {
  font-size: 0.8rem;
  color: var(--sgi-text-muted);
}

.sgi-list-item-action {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================================================
   GRID RESPONSIVO
   ============================================================================ */
.sgi-grid {
  display: grid;
  gap: 20px;
}

.sgi-grid-2 { grid-template-columns: repeat(2, 1fr); }
.sgi-grid-3 { grid-template-columns: repeat(3, 1fr); }
.sgi-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1200px) {
  .sgi-grid-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 992px) {
  .sgi-grid-3, .sgi-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sgi-grid-2, .sgi-grid-3, .sgi-grid-4 { grid-template-columns: 1fr; }
  .sgi-container { padding: 16px; }
  .sgi-page-header { padding: 16px; }
}

/* ============================================================================
   TABLAS SGI
   ============================================================================ */
.sgi-table-wrapper {
  background: var(--sgi-card-bg);
  border-radius: var(--sgi-radius-lg);
  box-shadow: var(--sgi-shadow);
  overflow: hidden;
}

.sgi-table {
  width: 100%;
  border-collapse: collapse;
}

.sgi-table thead {
  background: linear-gradient(135deg, var(--sgi-primary) 0%, var(--sgi-primary-light) 100%);
}

.sgi-table thead th {
  padding: 16px 18px;
  text-align: left;
  font-weight: 700;
  font-size: 0.82rem;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sgi-table tbody tr {
  border-bottom: 1px solid var(--sgi-border-light);
  transition: var(--sgi-transition-fast);
}

.sgi-table tbody tr:hover {
  background: var(--sgi-bg);
}

.sgi-table tbody td {
  padding: 14px 18px;
  font-size: 0.875rem;
  color: var(--sgi-text);
}

/* ============================================================================
   ALERTAS Y MENSAJES
   ============================================================================ */
.sgi-alert {
  padding: 16px 20px;
  border-radius: var(--sgi-radius);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
}

.sgi-alert i {
  font-size: 1.2rem;
  margin-top: 2px;
}

.sgi-alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--sgi-success);
}

.sgi-alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--sgi-danger);
}

.sgi-alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--sgi-warning);
}

.sgi-alert-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--sgi-info);
}

/* ============================================================================
   FORMULARIOS SGI
   ============================================================================ */
.sgi-form-group {
  margin-bottom: 20px;
}

.sgi-label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--sgi-text);
  margin-bottom: 8px;
}

.sgi-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.9rem;
  border: 2px solid var(--sgi-border);
  border-radius: var(--sgi-radius);
  background: var(--sgi-card-bg);
  color: var(--sgi-text);
  transition: var(--sgi-transition);
}

.sgi-input:focus {
  outline: none;
  border-color: var(--sgi-primary);
  box-shadow: 0 0 0 4px rgba(10, 47, 81, 0.1);
}

.sgi-input::placeholder {
  color: var(--sgi-text-pale);
}

/* ============================================================================
   ANIMACIONES
   ============================================================================ */
@keyframes sgi-fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sgi-slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes sgi-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.sgi-animate-fadeIn {
  animation: sgi-fadeIn 0.4s ease-out;
}

.sgi-animate-slideIn {
  animation: sgi-slideIn 0.4s ease-out;
}

/* Aplicar animación con delay escalonado */
.sgi-stagger > * {
  animation: sgi-fadeIn 0.4s ease-out backwards;
}

.sgi-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.sgi-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.sgi-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.sgi-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.sgi-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.sgi-stagger > *:nth-child(6) { animation-delay: 0.3s; }

/* ============================================================================
   UTILIDADES
   ============================================================================ */
.sgi-text-primary { color: var(--sgi-primary) !important; }
.sgi-text-accent { color: var(--sgi-accent) !important; }
.sgi-text-success { color: var(--sgi-success) !important; }
.sgi-text-danger { color: var(--sgi-danger) !important; }
.sgi-text-warning { color: var(--sgi-warning) !important; }
.sgi-text-muted { color: var(--sgi-text-muted) !important; }

.sgi-bg-primary { background: var(--sgi-primary) !important; }
.sgi-bg-accent { background: var(--sgi-accent) !important; }
.sgi-bg-success { background: var(--sgi-success) !important; }
.sgi-bg-danger { background: var(--sgi-danger) !important; }

.sgi-mb-0 { margin-bottom: 0 !important; }
.sgi-mb-1 { margin-bottom: 8px !important; }
.sgi-mb-2 { margin-bottom: 16px !important; }
.sgi-mb-3 { margin-bottom: 24px !important; }

.sgi-mt-0 { margin-top: 0 !important; }
.sgi-mt-1 { margin-top: 8px !important; }
.sgi-mt-2 { margin-top: 16px !important; }
.sgi-mt-3 { margin-top: 24px !important; }

.sgi-p-0 { padding: 0 !important; }
.sgi-p-1 { padding: 8px !important; }
.sgi-p-2 { padding: 16px !important; }
.sgi-p-3 { padding: 24px !important; }

.sgi-gap-1 { gap: 8px !important; }
.sgi-gap-2 { gap: 16px !important; }
.sgi-gap-3 { gap: 24px !important; }

.sgi-flex { display: flex !important; }
.sgi-flex-wrap { flex-wrap: wrap !important; }
.sgi-items-center { align-items: center !important; }
.sgi-justify-between { justify-content: space-between !important; }
.sgi-justify-center { justify-content: center !important; }

.sgi-hidden { display: none !important; }
.sgi-visible { display: block !important; }

/* Scrollbar personalizado */
.sgi-scrollbar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.sgi-scrollbar::-webkit-scrollbar-track {
  background: var(--sgi-bg);
  border-radius: 4px;
}

.sgi-scrollbar::-webkit-scrollbar-thumb {
  background: var(--sgi-text-pale);
  border-radius: 4px;
}

.sgi-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--sgi-text-muted);
}
