/* Base: reinicio suave, tipografía y utilidades */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: var(--font-size-xl); font-weight: var(--font-weight-bold); }
h2 { font-size: var(--font-size-lg); font-weight: var(--font-weight-bold); }
h3 { font-size: var(--font-size-base); font-weight: var(--font-weight-bold); }
p { margin: 0; }

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

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

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.icon { flex-shrink: 0; }

.muted { color: var(--color-text-muted); }
.text-sm { font-size: var(--font-size-sm); }
.money { font-variant-numeric: tabular-nums; font-weight: var(--font-weight-bold); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Utilidades (reemplazan estilos en línea: la política de seguridad CSP bloquea style="…") */
.contents { display: contents; }
.stack { display: flex; flex-direction: column; gap: var(--space-3); }
.stack-lg { gap: var(--space-4); }
.row-wrap { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.row-center { display: flex; gap: var(--space-3); align-items: center; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.strong { font-weight: var(--font-weight-bold); }
.search-box { flex: 1; min-width: 220px; max-width: 420px; }
.hint-tight { margin-top: -12px; }
.card-grid-wide { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.avatar-lg { width: 56px; height: 56px; font-size: 1.25rem; }
.btn-inline-link { align-self: flex-start; min-height: 44px; padding: 0 var(--space-2); color: var(--color-primary); }
.btn[data-danger] { color: var(--color-danger); }
