/* ==========================================================================
   BASE — elementos HTML sin clase y utilidades de texto.
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Lo oculto queda oculto: ningún display de un módulo puede vencer al atributo hidden. */
[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* html conserva 16px para que las medidas en rem no cambien. */
html,
body {
  margin: 0;
  padding: 0;
}

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

h1, h2, h3, h4, h5, h6 {
  color: var(--ink);
  font-weight: var(--fw-bold);
  line-height: 1.25;
}

h1 { font-size: var(--fs-2xl); font-weight: var(--fw-semibold); }
h2 { font-size: var(--fs-xl); font-weight: var(--fw-semibold); }
h3 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
h4 { font-size: var(--fs-base); font-weight: var(--fw-semibold); }

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: var(--brand-strong);
}

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

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.ui-icon {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
}

/* Utilidades de texto */
.muted,
.topbar-subtitle {
  color: var(--muted);
  font-size: var(--fs-md);
}

.help-text {
  display: block;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.text-clamp-2 {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.right { text-align: right; }
.cell-center { text-align: center; }
.cell-total { text-align: right; white-space: nowrap; }

.thumb-60 {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--line);
}

/* Acceso y páginas sin menú */
.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--gap-lg);
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.auth-card h1 {
  margin: 0 0 var(--gap-sm);
}

.auth-card p {
  margin: 0 0 20px;
  color: var(--muted);
}

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