/* styles.css — Base global · "Relay Link · Corporate" (Uber Freight-style)
 * Light, limpio, restraint. Tipografía Inter, superficies blancas, acento verde,
 * botones negros, foco accesible, motion sobrio.
 */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
}

#root { position: relative; z-index: 1; }

/* ── Tipografía base ─────────────────────────────────────────── */
h1, h2, h3, .display {
  font-family: var(--font-display);
  letter-spacing: -0.018em;
  line-height: 1.12;
  color: var(--color-text);
}
h1 { font-weight: 800; }
h2, h3 { font-weight: 700; }

/* Cifras tabulares para datos financieros (alineación de tablero) */
.mono, .tnum, .lane-code, .rate-figure,
.kpi-value, .price-tag, .price-tag-small,
.card-details-grid .detail-col .val {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ── Selección + scrollbars ──────────────────────────────────── */
::selection { background: rgba(var(--color-accent-rgb), 0.18); color: var(--color-text); }

* { scrollbar-width: thin; scrollbar-color: var(--color-slate-700) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--color-slate-700);
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--color-slate-600); background-clip: content-box; }

/* ── Foco accesible ──────────────────────────────────────────── */
:focus-visible {
  outline: none;
  box-shadow: var(--ring-accent);
  border-radius: var(--radius-sm);
}

/* ── Firma · línea de carril (sutil) ─────────────────────────── */
.lane-line {
  --_c: var(--lane-color);
  height: 2px;
  width: 100%;
  background-image: repeating-linear-gradient(
    90deg, var(--_c) 0, var(--_c) var(--lane-dash),
    transparent var(--lane-dash), transparent calc(var(--lane-dash) + var(--lane-gap))
  );
  background-size: calc(var(--lane-dash) + var(--lane-gap)) 100%;
}
.lane-line--v {
  width: 2px; height: 100%;
  background-image: repeating-linear-gradient(
    180deg, var(--_c) 0, var(--_c) var(--lane-dash),
    transparent var(--lane-dash), transparent calc(var(--lane-dash) + var(--lane-gap))
  );
  background-size: 100% calc(var(--lane-dash) + var(--lane-gap));
}
.lane-line--active { --_c: var(--lane-active); }

/* ── Motion utilitario (sobrio) ──────────────────────────────── */
@keyframes nh-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes nh-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}
.nh-fade-up { animation: nh-fade-up var(--dur-slow) var(--ease-out) both; }
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-success);
  animation: nh-pulse 1.8s var(--ease-in-out) infinite;
}

/* ── Acentos utilitarios ─────────────────────────────────────── */
.text-accent { color: var(--color-accent); }
.text-money  { color: var(--color-money); }
.text-muted-2 { color: var(--color-text-muted); }

/* ── Overrides de Bootstrap (botones negros estilo Uber) ─────── */
body .btn {
  font-family: var(--font-sans);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur) var(--ease-out), background var(--dur) var(--ease-out), filter var(--dur) var(--ease-out);
}
body .btn:active { transform: translateY(1px); }
body .btn-primary {
  background: var(--color-ink);
  border: 1px solid var(--color-ink);
  color: var(--color-on-ink);
  box-shadow: var(--shadow-sm);
}
body .btn-primary:hover { background: var(--color-ink-700); border-color: var(--color-ink-700); color: var(--color-on-ink); box-shadow: var(--shadow-md); }
body .btn-outline-primary { color: var(--color-accent); border-color: rgba(var(--color-accent-rgb), 0.45); }
body .btn-outline-primary:hover { background: rgba(var(--color-accent-rgb), 0.08); color: var(--color-accent-700); border-color: var(--color-accent); }

body a { color: var(--color-accent-700); text-decoration: none; }
body a:hover { color: var(--color-accent); }

/* Inputs Bootstrap sobre superficie clara */
body .form-control, body .form-select {
  background-color: var(--color-surface-800);
  border: 1px solid var(--color-slate-700);
  color: var(--color-text);
  border-radius: var(--radius-md);
}
body .form-control::placeholder { color: var(--color-text-subtle); }
body .form-control:focus, body .form-select:focus {
  background-color: var(--color-surface-800);
  border-color: var(--color-accent);
  color: var(--color-text);
  box-shadow: var(--ring-accent);
}

/* ── Movimiento reducido ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ── Integraciones (Settings) — adaptativo dark/light vía tokens ── */
.intg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-top: 12px; }
.intg-card { background: var(--color-surface-800); border: 1px solid var(--overlay-soft); border-radius: var(--radius-lg); padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 10px; }
.intg-head { display: flex; align-items: center; gap: 11px; }
.intg-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(var(--color-accent-rgb), 0.14); color: var(--color-accent); font-size: 1rem; flex: 0 0 auto; }
.intg-title { display: flex; flex-direction: column; gap: 3px; }
.intg-title b { color: var(--color-text); font-size: 0.98rem; }
.intg-badge { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 8px; border-radius: 999px; width: fit-content; }
.intg-badge.on { background: rgba(var(--color-money-rgb), 0.16); color: var(--color-money); }
.intg-badge.warn { background: rgba(var(--color-accent-rgb), 0.16); color: var(--color-accent); }
.intg-badge.off { background: var(--overlay-soft); color: var(--color-text-subtle); }
.intg-blurb { color: var(--color-text-muted); font-size: 0.82rem; margin: 0; line-height: 1.45; }
.intg-field { display: flex; flex-direction: column; gap: 5px; }
.intg-field > span { font-size: 0.72rem; font-weight: 600; color: var(--color-text-muted); }
.intg-input { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--overlay-medium); border-radius: var(--radius-md); padding: 9px 11px; font-size: 0.86rem; transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out); }
.intg-input::placeholder { color: var(--color-text-subtle); }
.intg-input:focus { outline: none; border-color: var(--color-accent); box-shadow: var(--ring-accent); }
.intg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.intg-msg { font-size: 0.78rem; margin: 4px 0 0; font-weight: 600; }
.intg-msg.ok { color: var(--color-money); }
.intg-msg.err { color: var(--color-danger); }
