/* =====================================================================
   VetCarnet · Reset y tipografia base
   ===================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--fuente);
    font-size: var(--txt-base);
    line-height: 1.55;
    color: var(--texto);
    background: var(--fondo);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    font-variant-numeric: tabular-nums;
}

img,
picture,
svg,
video {
    display: block;
    max-width: 100%;
}

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

button {
    background: none;
    border: none;
    cursor: pointer;
}

a {
    color: var(--primario-texto);
    text-decoration: none;
    transition: color var(--trans-rapida);
}

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

h1, h2, h3, h4, h5, h6 {
    line-height: 1.25;
    font-weight: var(--peso-semi);
    letter-spacing: -0.011em;
    color: var(--texto);
}

h1 { font-size: var(--txt-2xl); letter-spacing: -0.02em; }
h2 { font-size: var(--txt-xl); }
h3 { font-size: var(--txt-lg); }
h4 { font-size: var(--txt-base); }

p { text-wrap: pretty; }

ul, ol {
    padding: 0;
    list-style: none;
}

:focus-visible {
    outline: 2px solid var(--primario);
    outline-offset: 2px;
    border-radius: var(--r-sm);
}

::selection {
    background: var(--primario-suave);
    color: var(--primario-texto);
}

/* Scrollbars discretas */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--borde-fuerte) transparent;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: var(--borde-fuerte);
    border-radius: var(--r-full);
    border: 3px solid transparent;
    background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--gris-400);
    background-clip: content-box;
}

/* --------------------------------------------------------------------
   Utilidades
   -------------------------------------------------------------------- */

.oculto { display: none !important; }

/* Tamano por defecto de los iconos SVG. Los componentes que necesitan otro
   tamano lo sobrescriben (.btn .icono, .kpi-marca .icono, etc.). Sin esta regla
   un icono suelto se dibuja del tamano de su viewBox. */
.icono {
    width: 18px;
    height: 18px;
    flex: none;
    display: inline-block;
    vertical-align: middle;
}

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

.fila { display: flex; align-items: center; gap: var(--e-2); }
.fila-entre { display: flex; align-items: center; justify-content: space-between; gap: var(--e-3); }
.fila-fin { display: flex; align-items: center; justify-content: flex-end; gap: var(--e-2); }
.columna { display: flex; flex-direction: column; gap: var(--e-2); }
.crecer { flex: 1 1 auto; min-width: 0; }
.envolver { flex-wrap: wrap; }

.texto-suave { color: var(--texto-suave); }
.texto-tenue { color: var(--texto-tenue); }
.texto-xs { font-size: var(--txt-xs); }
.texto-sm { font-size: var(--txt-sm); }
.texto-lg { font-size: var(--txt-lg); }
.texto-centro { text-align: center; }
.texto-derecha { text-align: right; }
.texto-medio { font-weight: var(--peso-medio); }
.texto-semi { font-weight: var(--peso-semi); }
.mono { font-family: var(--fuente-mono); font-size: 0.92em; }
.truncar {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mt-1 { margin-top: var(--e-1); }
.mt-2 { margin-top: var(--e-2); }
.mt-3 { margin-top: var(--e-3); }
.mt-4 { margin-top: var(--e-4); }
.mt-6 { margin-top: var(--e-6); }
.mb-2 { margin-bottom: var(--e-2); }
.mb-3 { margin-bottom: var(--e-3); }
.mb-4 { margin-bottom: var(--e-4); }
.mb-6 { margin-bottom: var(--e-6); }

@media print {
    body { background: #fff; }
    .no-imprimir { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
