/*
 * Hoja de estilos base para LogistiCrew APP.
 * Incluye normalización, variables de diseño y utilidades simples
 * para facilitar la creación de nuevas vistas.
 */

:root {
  --font-family-base: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --color-bg: #0f172a;
  --color-surface: #111827;
  --color-surface-alt: #1f2937;
  --color-text: #e5e7eb;
  --color-text-muted: #94a3b8;
  --color-primary: #6366f1;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.25);
  --border-radius: 14px;
  --border-radius-sm: 10px;
  --border-color: rgba(255, 255, 255, 0.08);
}

/* Reset y normalización liviana */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-base);
  background: radial-gradient(circle at top left, rgba(99, 102, 241, 0.2), transparent 30%),
    radial-gradient(circle at 80% 20%, rgba(34, 197, 94, 0.18), transparent 26%),
    linear-gradient(135deg, #0b1220 0%, #0c1323 30%, #0e1427 60%, #0f172a 100%);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--color-primary);
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  background: transparent;
}

ul {
  list-style: none;
}

/* Layout base reutilizable */
.container {
  width: min(1100px, 96vw);
  margin: 0 auto;
  padding: 24px 0;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  backdrop-filter: blur(6px);
}

.card + .card {
  margin-top: 18px;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #f8fafc;
  margin-bottom: 12px;
}

.text-muted {
  color: var(--color-text-muted);
}

.grid {
  display: grid;
  gap: 18px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
}

.badge-success {
  color: #22d3ee;
  background: rgba(34, 211, 238, 0.12);
}

.badge-warning {
  color: var(--color-warning);
  background: rgba(245, 158, 11, 0.15);
}

.badge-danger {
  color: var(--color-danger);
  background: rgba(239, 68, 68, 0.15);
}

.realtime-indicator {
  position: fixed;
  inset: auto 18px 18px auto;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--color-warning);
  box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.3);
  animation: pulse 2.5s infinite;
  border: 2px solid rgba(255, 255, 255, 0.35);
  z-index: 30;
}

.realtime-indicator[data-status="online"] {
  background: var(--color-success);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.35);
  animation: pulse 2s infinite;
}

.realtime-indicator[data-status="offline"] {
  background: var(--color-danger);
  box-shadow: none;
  animation: none;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.3);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(99, 102, 241, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
  }
}

/* Utilidades pequeñas para futuros componentes */
.flex {
  display: flex;
  gap: 12px;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chip {
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
}

.helper-text {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}
