/* ═══════════════════════════════════════════════
   LicitIA — Sistema de Diseño
   Identidad visual unificada para todas las páginas
   ═══════════════════════════════════════════════ */

/* ── Variables de Marca ── */
:root {
  /* Colores primarios */
  --primary:       #2563eb;     /* Azul LicitIA — botones, CTAs, enlaces */
  --primary-hover: #1d4ed8;     /* Azul hover */
  --primary-soft:  rgba(37, 99, 235, 0.12);  /* Azul fondo suave */

  /* Colores secundarios */
  --success:       #10b981;     /* Verde esmeralda — éxito, activo */
  --success-hover: #059669;
  --success-soft:  rgba(16, 185, 129, 0.12);

  --warning:       #f59e0b;     /* Ámbar — alertas, Pro */
  --warning-soft:  rgba(245, 158, 11, 0.15);

  --danger:        #ef4444;     /* Rojo — errores */
  --danger-soft:   rgba(239, 68, 68, 0.12);

  /* Fondos oscuros (tema dark) */
  --bg-body:       #05070a;
  --bg-surface:    #0d1117;     /* Tarjetas, sidebar */
  --bg-elevated:   #161b22;     /* Inputs, items elevados */
  --bg-overlay:    rgba(5, 7, 10, 0.95);

  /* Bordes */
  --border:        #30363d;
  --border-active: #58a6ff;

  /* Texto */
  --text-primary:  #e6edf3;
  --text-secondary:#9ca3af;
  --text-muted:    #6b7280;
  --text-link:     #60a5fa;

  /* Sombras */
  --shadow-sm:     0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md:     0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg:     0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-blue:   0 4px 16px rgba(37, 99, 235, 0.25);

  /* Radios */
  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     16px;
  --radius-xl:     20px;
  --radius-full:   9999px;

  /* Tipografía */
  --font-sans:     'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ── Tarjetas Glass (dark) ── */
.glass {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.glass-hover {
  transition: border-color 0.2s ease;
}
.glass-hover:hover {
  border-color: var(--border-active);
}

/* ── Botones ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  box-shadow: var(--shadow-blue);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
  font-size: 0.875rem;
}
.btn-secondary:hover {
  border-color: var(--border-active);
}

.btn-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #15803d;
  color: white;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
  font-size: 0.875rem;
}
.btn-success:hover {
  background: var(--success-hover);
}

/* ── Inputs ── */
.input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.2s ease;
  color: var(--text-primary);
  font-family: var(--font-sans);
  width: 100%;
}
.input:focus {
  border-color: var(--border-active);
}
.input::placeholder {
  color: var(--text-muted);
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.badge-free {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.badge-pro {
  background: var(--warning-soft);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ── Sidebar ── */
.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.nav-item.active {
  background: rgba(37, 99, 235, 0.15);
  color: var(--text-link);
  border-left: 3px solid var(--primary);
}

.nav-locked {
  opacity: 0.4;
  cursor: not-allowed !important;
}
.nav-locked .lock-icon {
  display: inline-block !important;
}
.lock-icon {
  display: none;
  font-size: 10px;
  margin-left: auto;
  color: var(--warning);
}

/* ── Sector Buttons ── */
.sector-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s ease;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
}
.sector-btn:hover {
  border-color: var(--border-active);
}
.sector-btn.active {
  border-color: var(--success);
  background: var(--success-soft);
}
.sector-btn.active:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.sector-btn.active:hover .icon-check { display: none; }
.sector-btn.active:hover .icon-remove { display: inline !important; }

/* ── Score Bar ── */
.score-bar {
  height: 5px;
  border-radius: 3px;
  background: var(--bg-elevated);
  overflow: hidden;
}
.score-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #3fb950, #2ea043);
}

/* ── Status Indicators ── */
.dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}
.status-online {
  background: var(--success-soft);
  color: var(--success);
}
.status-offline {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ── Error Box ── */
.error-box {
  background: var(--danger-soft);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  display: none;
}

/* ── Tab Buttons ── */
.tab-btn {
  flex: 1;
  padding: 10px;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
}
.tab-btn.active {
  background: rgba(37, 99, 235, 0.15);
  color: var(--text-link);
}

/* ── Gradient Text ── */
.grad-text {
  background: linear-gradient(90deg, #58a6ff, #3fb950);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Toast Notifications ── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 13px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.3s ease;
}

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

/* ── Sections ── */
.section { display: none; }
.section.active { display: block; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar { display: none; }
}

/* ── Print ── */
@media print {
  .sidebar, .nav-item, button { display: none !important; }
  body { background: white; color: black; }
}
