/**
 * miniSYS-HGP — Compatibilidad Safari, Chrome y Firefox.
 *
 * Fallback de alto (100vh → dvh → --ms-app-height), safe-area iOS,
 * inputs a 16px en móvil (evita zoom de Safari) y overlays sin `inset`.
 * color-mix() se ignora si el motor no lo entiende: los tokens ya usan rgba().
 */

html {
    height: 100%;
    height: 100vh;
    height: 100dvh;
    height: var(--ms-app-height, 100dvh);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    min-height: var(--ms-app-height, 100dvh);
}

img,
video,
svg,
canvas {
    max-width: 100%;
}

button,
a,
summary,
label,
input[type="button"],
input[type="submit"] {
    -webkit-tap-highlight-color: rgba(0, 96, 156, 0.18);
    touch-action: manipulation;
}

/* Overlays a pantalla completa: Safari < 14.1 no aplica `inset: 0`.
 * El stack de toasts NO va aquí: vive anclado abajo a la derecha. */
.minisys-confirm-overlay,
.sidebar-overlay,
.func-overlay,
.prod-overlay,
.sgh-pdf-overlay,
.minisys-conn-backdrop {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

@media (max-width: 1100px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
    select,
    textarea {
        font-size: 16px;
    }
}

/*
 * Paneles laterales/hojas con formulario: el cuerpo scrollea y el pie
 * (Guardar) queda visible en tablet y teléfono.
 */
.func-panel form,
.prod-panel form,
.usr-panel form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.func-panel-body,
.prod-panel-body,
.usr-panel-body {
    min-height: 0;
}

@supports not (height: 100dvh) {
    html,
    body {
        height: 100vh;
        min-height: 100vh;
        max-height: 100vh;
    }
}

/*
 * Crédito chico al final del contenido de cada vista (no pie de chrome).
 * Hereda color/tipografía; opacidad baja para no competir con la UI.
 */
.ms-dev-mark {
    display: block;
    width: 100%;
    max-width: 40rem;
    min-width: 0;
    box-sizing: border-box;
    margin: 1.15rem auto 0.35rem;
    padding: 0;
    pointer-events: none;
    text-align: center;
    background: transparent;
    border: 0;
    font-family: inherit;
    font-size: 0.58rem;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0.01em;
    color: var(--text-muted, #64748b);
    opacity: 0.58;
    overflow-wrap: anywhere;
    word-break: break-word;
}
