/* ========================================================
   SISTEMA DE PLANILLAS DE PROCESO - ESTILO AZUL & BLANCO
   Diseño ergonómico, ameno, moderno y 100% responsive móvil
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Paleta Azul & Blanco */
  --blue-950: #0a192f;
  --blue-900: #0f2b5c;
  --blue-800: #1e3a8a;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  
  --bg-app: #f8fafc;
  --surface: #ffffff;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: #0f172a;
  -webkit-tap-highlight-color: transparent;
}

/* Transiciones suaves */
* {
  box-sizing: border-box;
}

/* Scrollbar estilizada */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Barra lateral azul institucional */
.sidebar-blue {
  background: linear-gradient(180deg, #0d234a 0%, #112d5e 40%, #153770 100%);
  color: #ffffff;
}

/* Enlaces del menú lateral */
.nav-item-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #bfdbfe;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
}

.nav-item-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: translateX(3px);
}

.nav-item-btn.active {
  background-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  font-weight: 700;
}

/* Píldoras y badges */
.badge-blue {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-emerald {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.badge-amber {
  background-color: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-rose {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.badge-purple {
  background-color: #faf5ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
}

/* Grilla tipo planilla de cálculo */
.spreadsheet-container {
  overflow-x: auto;
  border-radius: 0.875rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.spreadsheet-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.spreadsheet-table th {
  background-color: #f1f5f9;
  color: #1e3a8a;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 0.85rem;
  border-bottom: 2px solid #94a3b8;
  border-right: 1px solid #e2e8f0;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.spreadsheet-table td {
  padding: 0;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
  font-size: 0.875rem;
  background-color: #ffffff;
  transition: background-color 0.15s ease;
}

.spreadsheet-table tr:hover td {
  background-color: #f8fafc;
}

/* Inputs de celda en planilla */
.cell-input {
  width: 100%;
  height: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid transparent;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  text-align: center;
  font-weight: 600;
  color: #0f172a;
  outline: none;
  transition: all 0.15s ease;
}

.cell-input:focus {
  background-color: #ffffff;
  border-color: #2563eb;
  box-shadow: inset 0 0 0 1px #2563eb, 0 0 0 3px rgba(37, 99, 235, 0.15);
  z-index: 5;
}

/* Celdas fijas a la izquierda */
.col-sticky-1 {
  position: sticky;
  left: 0;
  z-index: 8;
  background-color: #ffffff !important;
  width: 50px;
  min-width: 50px;
  max-width: 50px;
  text-align: center;
}

.col-sticky-2 {
  position: sticky;
  left: 50px;
  z-index: 8;
  background-color: #ffffff !important;
  box-shadow: 2px 0 6px -2px rgba(0, 0, 0, 0.08);
  min-width: 220px;
}

.spreadsheet-table th.col-sticky-1 {
  z-index: 15;
  background-color: #e2e8f0 !important;
}

.spreadsheet-table th.col-sticky-2 {
  z-index: 15;
  background-color: #f1f5f9 !important;
}

/* Modales y backdrop */
.modal-backdrop {
  background-color: rgba(10, 25, 47, 0.65);
  backdrop-filter: blur(4px);
}

.fade-in {
  animation: fadeIn 0.25s ease-out forwards;
}

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

/* Ergonomía táctil para móviles */
@media (max-width: 768px) {
  button, input, select {
    min-height: 44px;
  }
  
  .spreadsheet-table th, 
  .spreadsheet-table td {
    font-size: 0.8rem;
  }
}

/* Estilos de impresión */
@media print {
  .no-print {
    display: none !important;
  }
  body {
    background: white !important;
    color: black !important;
  }
  .print-area {
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
  }
}
