/* archivo: /assets/css/app.css
   TallerPro — Estilos "industrial / taller" (ADR-024) sobre Bootstrap 5.3.
   Mobile-first: la base es el teléfono del mecánico; el escritorio mejora.
   El reskin se hace redefiniendo las variables por componente de Bootstrap
   (--bs-*) para no recompilar Sass, más el shell propio (sidebar/navbar/KPIs).
   Módulo: Assets | Creado: 03-07-2026 | Última modificación: 04-07-2026 */

/* ============================ Base ============================ */
body.app-body {
    background-color: var(--bs-body-bg);
    min-height: 100vh;
    font-size: var(--bs-body-font-size);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--bs-heading-color);
    letter-spacing: -0.015em;
}
h1, .h1, h2, .h2, h3, .h3 { font-weight: 700; }
.text-wrap-balance { text-wrap: balance; }

a { text-decoration-thickness: 1px; text-underline-offset: 2px; }

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

.num, .tabular { font-variant-numeric: tabular-nums; }
.eyebrow {
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.09em;
    text-transform: uppercase; color: var(--tp-ink-2);
}

/* ==================== Reskin de componentes ==================== */
.btn {
    --bs-btn-border-radius: var(--tp-radius);
    --bs-btn-font-weight: 600;
    --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
.btn-primary {
    --bs-btn-color: var(--tp-accent-ink); --bs-btn-bg: var(--tp-accent); --bs-btn-border-color: var(--tp-accent);
    --bs-btn-hover-color: var(--tp-accent-ink); --bs-btn-hover-bg: var(--tp-accent-hover); --bs-btn-hover-border-color: var(--tp-accent-hover);
    --bs-btn-active-color: var(--tp-accent-ink); --bs-btn-active-bg: var(--tp-accent-hover); --bs-btn-active-border-color: var(--tp-accent-hover);
    --bs-btn-disabled-color: var(--tp-accent-ink); --bs-btn-disabled-bg: var(--tp-accent); --bs-btn-disabled-border-color: var(--tp-accent);
    box-shadow: var(--tp-shadow-sm);
}
.btn-outline-primary {
    --bs-btn-color: var(--tp-accent-soft-ink); --bs-btn-border-color: var(--tp-accent);
    --bs-btn-hover-color: var(--tp-accent-ink); --bs-btn-hover-bg: var(--tp-accent); --bs-btn-hover-border-color: var(--tp-accent);
    --bs-btn-active-color: var(--tp-accent-ink); --bs-btn-active-bg: var(--tp-accent); --bs-btn-active-border-color: var(--tp-accent);
}
.btn-warning {
    --bs-btn-color: #3a2708; --bs-btn-hover-color: #3a2708; --bs-btn-active-color: #3a2708;
}

.card {
    --bs-card-bg: var(--tp-surface);
    --bs-card-border-color: var(--bs-border-color);
    --bs-card-border-radius: var(--tp-radius);
    --bs-card-cap-bg: var(--tp-surface);
    --bs-card-inner-border-radius: calc(var(--tp-radius) - 1px);
    box-shadow: var(--tp-shadow-sm);
}
.card-header {
    font-weight: 600;
    border-bottom-color: var(--bs-border-color);
}
.card-header:first-child { border-radius: var(--tp-radius) var(--tp-radius) 0 0; }

.list-group {
    --bs-list-group-bg: var(--tp-surface);
    --bs-list-group-border-color: var(--bs-border-color);
    --bs-list-group-action-hover-bg: var(--tp-surface-2);
    --bs-list-group-action-active-bg: var(--tp-surface-2);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--tp-surface-2);
    --bs-table-border-color: var(--bs-border-color);
    --bs-table-color: var(--bs-body-color);
}
.table > thead th, .table > thead td {
    font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--tp-ink-2); font-weight: 700; border-bottom-color: var(--tp-line-strong);
}
.table > :not(caption) > * > * {
    padding-top: 0.7rem; padding-bottom: 0.7rem;
}

.form-control, .form-select {
    background-color: var(--tp-surface-2);
    border-color: var(--bs-border-color);
}
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: var(--tp-accent);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.22);
    background-color: var(--tp-surface);
}
.form-check-input:checked { background-color: var(--tp-accent); border-color: var(--tp-accent); }
.form-control::placeholder { color: var(--tp-ink-3); }

.dropdown-menu {
    --bs-dropdown-bg: var(--tp-surface);
    --bs-dropdown-border-color: var(--bs-border-color);
    --bs-dropdown-link-hover-bg: var(--tp-surface-2);
    --bs-dropdown-link-active-bg: var(--tp-accent);
    --bs-dropdown-border-radius: var(--tp-radius);
    box-shadow: var(--tp-shadow);
}
.modal-content, .offcanvas { background-color: var(--tp-surface); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--tp-accent); --bs-nav-pills-border-radius: var(--tp-radius); }
.nav-pills .nav-link { color: var(--bs-body-color); font-weight: 600; }
.page-link { color: var(--bs-link-color); }
.active > .page-link, .page-link.active { background-color: var(--tp-accent); border-color: var(--tp-accent); }

.badge {
    font-weight: 600; letter-spacing: 0.01em;
    padding: 0.4em 0.65em; border-radius: 0.45rem;
}

/* ============================ Shell ============================ */
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.app-content { flex: 1 1 auto; max-width: 1320px; width: 100%; }

/* ============================ Sidebar ============================ */
/* Bootstrap fuerza `.offcanvas-lg{background:transparent!important}` en
   escritorio (≥992px): hay que ganarle con !important o el sidebar pierde
   su fondo grafito y el texto queda ilegible sobre el fondo claro. */
.app-sidebar {
    background-color: var(--tp-sidebar-bg) !important;
    color: var(--tp-sidebar-color);
}
.sidebar-brand, .sidebar-foot { flex-shrink: 0; }
.sidebar-nav { min-height: 0; } /* permite el scroll interno del menú en flex-column */

@media (min-width: 992px) {
    .app-sidebar {
        width: var(--tp-sidebar-width);
        flex: 0 0 var(--tp-sidebar-width);
        position: sticky; top: 0; height: 100vh;
        display: flex; flex-direction: column; /* el cuerpo llena los 100vh */
        border-right: 1px solid var(--tp-sidebar-line);
    }
    /* Bootstrap pone el cuerpo en flex-grow:0 / overflow visible en escritorio,
       lo que hace que el menú se desborde del fondo. Lo revertimos: que llene
       la altura y haga scroll interno, dejando marca y pie fijos. */
    .app-sidebar .offcanvas-body {
        flex-grow: 1; min-height: 0; overflow: hidden;
    }
}

.sidebar-brand {
    min-height: var(--tp-navbar-height);
    display: flex; align-items: center; gap: 11px;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--tp-sidebar-line);
}
.sidebar-mark {
    width: 38px; height: 38px; border-radius: 9px; flex: 0 0 auto;
    display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1rem;
    background: linear-gradient(150deg, var(--tp-accent), #b95a00);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
    letter-spacing: -0.02em;
}
.sidebar-brand-name { color: #fff; font-weight: 700; font-size: 1rem; line-height: 1.1; }
.sidebar-brand-sub { color: var(--tp-sidebar-dim); font-size: 0.72rem; margin-top: 2px; }

.sidebar-nav { padding: 0.5rem 0.6rem 1.25rem; }
.sidebar-section { margin-top: 1rem; }
.sidebar-section:first-child { margin-top: 0.35rem; }
.sidebar-section > .eyebrow { color: var(--tp-sidebar-dim); padding: 0 0.65rem 0.35rem; }
/* Encabezado plegable de la sección Administración (Tema 4) */
.sidebar-section-toggle {
    display: flex; align-items: center; width: 100%;
    background: none; border: 0; cursor: pointer;
    color: var(--tp-sidebar-dim); padding: 0.15rem 0.65rem 0.35rem;
}
.sidebar-section-toggle:hover { color: var(--tp-sidebar-color); }
.sidebar-section-toggle .bi-chevron-down { font-size: 0.85em; transition: transform 0.2s ease; }
.sidebar-section-toggle.collapsed .bi-chevron-down { transform: rotate(-90deg); }

.sidebar-link {
    color: var(--tp-sidebar-color);
    border-radius: var(--tp-radius);
    min-height: 42px;
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.45rem 0.65rem;
    font-size: 0.9rem; font-weight: 500;
    position: relative; margin-bottom: 1px;
}
.sidebar-link .bi { font-size: 1rem; width: 1.15rem; text-align: center; opacity: 0.85; flex: 0 0 auto; }
.sidebar-link:hover, .sidebar-link:focus {
    color: #fff; background-color: var(--tp-sidebar-bg-2);
}
.sidebar-link.active { color: #fff; background-color: var(--tp-sidebar-bg-2); }
.sidebar-link.active::before {
    content: ""; position: absolute; left: -0.6rem; top: 7px; bottom: 7px;
    width: 3px; background: var(--tp-accent); border-radius: 0 3px 3px 0;
}
.sidebar-link.active .bi { opacity: 1; color: var(--tp-accent); }
.sidebar-link .sidebar-tag {
    margin-left: auto; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em;
    background: var(--tp-accent); color: var(--tp-accent-ink);
    padding: 0.1rem 0.45rem; border-radius: 999px;
}
.sidebar-highlight { background: linear-gradient(100deg, rgba(238, 122, 8, 0.16), transparent); }
.sidebar-highlight .bi { color: var(--tp-accent); opacity: 1; }
.sidebar-foot { color: var(--tp-sidebar-dim); font-size: 0.72rem; }

/* ============================ Navbar ============================ */
.app-navbar {
    height: var(--tp-navbar-height);
    background-color: var(--tp-surface);
    border-bottom: 1px solid var(--bs-border-color);
    position: sticky; top: 0; z-index: 1020;
    justify-content: space-between; flex-wrap: nowrap;
}
.navbar-title { font-weight: 700; font-size: 1.02rem; color: var(--bs-heading-color); }

/* Botones-ícono de la barra superior */
.app-navbar .btn-outline-secondary {
    --bs-btn-color: var(--tp-ink-2); --bs-btn-border-color: var(--bs-border-color); --bs-btn-bg: var(--tp-surface);
    --bs-btn-hover-color: var(--tp-ink); --bs-btn-hover-bg: var(--tp-surface-2); --bs-btn-hover-border-color: var(--tp-line-strong);
    --bs-btn-active-color: var(--tp-ink); --bs-btn-active-bg: var(--tp-surface-2); --bs-btn-active-border-color: var(--tp-line-strong);
    border-radius: var(--tp-radius);
}
.global-search { width: clamp(160px, 30vw, 300px); }
.global-search .form-control {
    border-radius: 999px; padding-left: 2.2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238b909b' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: 0.8rem center; background-size: 15px;
}

/* ============================ Avatares ============================ */
.avatar-img { border-radius: 50%; object-fit: cover; }
.avatar-initials {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(150deg, var(--tp-accent), #b95a00);
    color: #fff; font-size: 0.78rem; font-weight: 700; flex: 0 0 auto;
}

/* ==================== Tarjetas de estadística (KPIs) ==================== */
.stat-card { transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease; }
a:hover > .stat-card, a:focus-visible > .stat-card {
    box-shadow: var(--tp-shadow); transform: translateY(-2px); border-color: var(--tp-line-strong);
}
.stat-card .stat-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 46px; height: 46px; border-radius: var(--tp-radius);
    font-size: 1.35rem; flex: 0 0 auto;
}
.kpi-value { font-size: 1.7rem; font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; }

/* ============================ Patente / placa ============================ */
.plate-badge {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    letter-spacing: 0.07em; font-weight: 700;
}

/* ============================ Auth ============================ */
body.auth-body {
    background:
        radial-gradient(1100px 500px at 50% -10%, color-mix(in srgb, var(--tp-accent) 12%, transparent), transparent),
        var(--tp-ground);
    display: grid; place-items: center; min-height: 100vh; padding: 1rem;
}
.auth-wrapper { width: 100%; max-width: 420px; }
.auth-card { border: 1px solid var(--bs-border-color); box-shadow: var(--tp-shadow-lg); }
.auth-logo { max-height: 72px; max-width: 200px; object-fit: contain; }
.auth-logo-fallback {
    display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px; border-radius: 16px;
    background: linear-gradient(150deg, var(--tp-accent), #b95a00);
    color: #fff; font-size: 1.75rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* ============ Accesibilidad táctil (guantes y dedos de taller) ============ */
.btn, .form-control, .form-select, .page-link, .dropdown-item {
    min-height: var(--tp-touch-target);
}
.btn-sm, .pagination-sm .page-link { min-height: 34px; }
.input-group-sm .form-control, .form-control-sm, .form-select-sm { min-height: 34px; }
.form-check-input { width: 1.2em; height: 1.2em; }
.min-w-0 { min-width: 0; }
.dropdown-menu form { margin: 0; }

/* ============================ Typeahead / buscador ============================ */
.global-search-results, .typeahead-menu {
    max-height: 320px; overflow-y: auto; inset: 100% 0 auto 0;
}
.typeahead-menu { position: absolute; }

/* ============================ Órdenes (Fase 3) ============================ */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.5rem; }
.photo-item { position: relative; }
.photo-item img {
    width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
    border-radius: var(--tp-radius); border: 1px solid var(--bs-border-color);
}
/* Marca "el cliente la ve" sobre la miniatura (esquina). */
.photo-visible-badge {
    position: absolute; top: .3rem; left: .3rem; width: 1.4rem; height: 1.4rem;
    display: grid; place-items: center; border-radius: 50%; font-size: .8rem;
    background: var(--bs-success, #1f9d57); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
/* Estado de "optimizando fotos" del formulario de subida. */
.photo-upload-status { font-size: .8rem; }
.signature-pad { cursor: crosshair; touch-action: none; }
.signature-img { max-height: 90px; max-width: 100%; padding: 0.25rem; }

/* ============================ Agenda / avisos (Fase 5) ============================ */
.notif-menu { width: min(360px, 90vw); max-height: 70vh; overflow-y: auto; }
/* Fila de aviso con acción rápida (botón de WhatsApp) al costado del texto.
   El ancla lleva ancho auto + min-width:0 para que CEDA espacio al botón (si no,
   el width:100% de .dropdown-item lo empuja fuera y el overflow-x lo recorta en
   móvil). El botón nunca se encoge (flex:0 0 auto) y queda siempre visible. */
.notif-item { display: flex; align-items: center; gap: .25rem; flex-wrap: nowrap; transition: background-color .12s ease; }
.notif-item:hover { background: var(--bs-dropdown-link-hover-bg, rgba(0,0,0,.05)); }
.notif-item > .dropdown-item { flex: 1 1 auto; min-width: 0; width: auto; }
.notif-item .dropdown-item:hover { background: transparent; }
.notif-item > .btn-success { flex: 0 0 auto; margin-right: .5rem; --bs-btn-padding-y: .15rem; --bs-btn-padding-x: .5rem; }
/* En móvil el desplegable de avisos (anclado al ícono cerca del borde) se
   cortaba. Lo convertimos en un panel fijo de ancho casi completo, siempre
   visible bajo la barra superior. */
@media (max-width: 575.98px) {
    .notif-menu.dropdown-menu {
        position: fixed !important;
        inset: calc(var(--tp-navbar-height) + 0.25rem) 0.5rem auto 0.5rem !important;
        width: auto !important; max-width: none !important;
        transform: none !important;
        max-height: 75vh;
    }
}
/* El menú lateral (offcanvas) abierto no debe superar el ancho del teléfono */
.app-sidebar.offcanvas-lg { --bs-offcanvas-width: min(320px, 85vw); }
.agenda-day { border-left: 3px solid var(--tp-accent); }
.agenda-time {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-weight: 700; color: var(--bs-heading-color);
    background: var(--tp-surface-2); padding: 0.15rem 0.45rem; border-radius: 5px;
}

/* ==================== Defensa responsive global (ADR-027) ==================== */
/* El sidebar offcanvas oculto (translateX(-100%)) ensancha el área desplazable
   en móvil y desborda la página a la derecha. `overflow-x: clip` lo recorta
   SIN crear un contenedor de scroll (no rompe position:sticky del navbar ni
   corta los desplegables verticales, a diferencia de overflow:hidden). */
html { overflow-x: hidden; }
body.app-body { overflow-x: hidden; }
.app-shell { overflow-x: clip; }
.app-main { min-width: 0; max-width: 100%; }
.app-content { width: 100%; min-width: 0; }
.app-content img, .app-content svg, .app-content video, .app-content canvas { max-width: 100%; height: auto; }
.app-content pre { max-width: 100%; overflow-x: auto; }
.app-content { overflow-wrap: break-word; }         /* quiebra URLs/tokens largos */
.auth-wrapper { overflow-wrap: break-word; }         /* lo mismo en login/errores */
.dropdown-menu { max-width: min(92vw, 30rem); }      /* menús nunca más anchos que la pantalla */
.dropdown-menu.notif-menu, .dropdown-menu.global-search-results { max-width: 92vw; }
/* text-truncate dentro de flex necesita min-width:0 para recortar (si no, desborda) */
.d-flex > .text-truncate { min-width: 0; }
/* Bloque de texto de las tarjetas de estadística: que encoja y no desborde el monto */
.stat-card .card-body > div { min-width: 0; }

@media (max-width: 991.98px) {
    /* Encabezados de página: título + acciones deben envolver, no encimarse */
    .page-actions, .app-content > .d-flex.justify-content-between,
    .card-header.d-flex.justify-content-between { flex-wrap: wrap; row-gap: 0.5rem; }
    /* Barras de acción con botones: permitir salto en pantallas chicas */
    .btn-toolbar { flex-wrap: wrap; }
    /* Pestañas y grupos de filtros anchos: scroll suave en vez de desbordar */
    .nav-pills, .nav-tabs { flex-wrap: nowrap; overflow-x: auto; }
    .nav-pills::-webkit-scrollbar, .nav-tabs::-webkit-scrollbar { height: 0; }
}
@media (max-width: 575.98px) {
    /* Grupos de botones pequeños (pestañas segmentadas, toggles): envolver
       en pantallas muy chicas en vez de desbordar la página. */
    .btn-group.btn-group-sm { flex-wrap: wrap; }
}

/* ============ Tablas responsive: apilar en tarjetas en móvil ============ */
/* (ADR-027) Cuando el sidebar está colapsado (<992px), cada fila se muestra
   como tarjeta "etiqueta: valor" — nada de scroll horizontal.
   responsive-table.js pone los data-label desde el <thead>. */
@media (max-width: 991.98px) {
    .table-stack { display: block; width: 100%; border: 0; }
    .table-stack > thead { display: none; }
    .table-stack > tbody { display: block; width: 100%; }
    .table-stack > tbody > tr {
        display: block; width: 100%;
        border: 1px solid var(--bs-border-color);
        border-radius: var(--tp-radius);
        margin-bottom: 0.6rem;
        background: var(--tp-surface);
        box-shadow: var(--tp-shadow-sm);
        overflow: hidden;
    }
    .table-stack > tbody > tr > td {
        display: flex; flex-wrap: wrap; align-items: center;
        justify-content: space-between; gap: 0.2rem 1rem;
        width: 100%; text-align: right;
        padding: 0.5rem 0.85rem;
        border: 0; border-bottom: 1px solid var(--bs-border-color);
        min-height: 0; min-width: 0;
        overflow-wrap: anywhere; word-break: break-word;
    }
    .table-stack > tbody > tr > td:last-child { border-bottom: 0; }
    .table-stack > tbody > tr > td[data-label]::before {
        content: attr(data-label);
        font-weight: 700; color: var(--tp-ink-2);
        text-transform: uppercase; letter-spacing: 0.02em; font-size: 0.7rem;
        text-align: left; flex: 0 0 auto; margin-right: auto;
        white-space: nowrap;
    }
    /* En modo tarjeta hay espacio vertical: mostrar también las columnas que
       normalmente se ocultan en móvil (d-none d-md-table-cell) → ves TODO. */
    .table-stack > tbody > tr > td.d-none.d-md-table-cell,
    .table-stack > tbody > tr > td.d-none.d-lg-table-cell { display: flex !important; }
    /* Celdas que abarcan (colspan): totales, estados vacíos → a lo ancho */
    .table-stack > tbody > tr > td.stack-wide {
        display: block; text-align: center; justify-content: center;
    }
    /* Controles dentro de celdas apiladas: que ocupen el lado del valor */
    .table-stack > tbody > tr > td > .form-control,
    .table-stack > tbody > tr > td > .form-select,
    .table-stack > tbody > tr > td > .input-group,
    .table-stack > tbody > tr > td > form {
        flex: 1 1 60%; max-width: 100%; margin-left: auto; width: auto;
    }
    /* Grupos de botones de acción: alinear a la derecha, permitir salto */
    .table-stack > tbody > tr > td .btn-group,
    .table-stack > tbody > tr > td > .d-flex { justify-content: flex-end; flex-wrap: wrap; }
}

/* ===================================================================
   Ayuda contextual: ícono "i" (help()) y su popover
   =================================================================== */
.help-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    padding: 0;
    margin-inline-start: 0.3rem;
    color: var(--bs-info, #3f82c9);
    line-height: 1;
    font-size: 0.9em;
    cursor: help;
    vertical-align: baseline;
    -webkit-appearance: none;
    appearance: none;
}
.help-tip:hover { color: var(--bs-info-text-emphasis, #245a94); }
.help-tip:focus { outline: none; }
.help-tip:focus-visible {
    outline: 2px solid var(--bs-info, #3f82c9);
    outline-offset: 2px;
    border-radius: 50%;
}
/* En cabeceras/labels con texto claro, el ícono no debe robar peso visual */
.card-header .help-tip,
.form-label .help-tip,
label .help-tip { opacity: 0.85; }
.card-header .help-tip:hover,
.form-label .help-tip:hover,
label .help-tip:hover { opacity: 1; }

.help-popover { --bs-popover-max-width: 320px; }
.help-popover .popover-body { font-size: 0.86rem; line-height: 1.45; }
.help-popover .popover-header { font-size: 0.84rem; font-weight: 600; }

/* Formularios en cuadrícula (.form-grid): cada campo es una columna flex y su
   control se ancla ABAJO (margin-top:auto), así los campos de una misma fila
   quedan alineados aunque sus etiquetas ocupen 1, 2 o 3 líneas (con o sin ícono
   de ayuda). El encabezado etiqueta+ícono va agrupado en .fld-head. */
.form-grid > [class*="col-"]:not(.d-flex) { display: flex; flex-direction: column; }
.form-grid .fld-head { margin-bottom: 0.3rem; }
.form-grid .fld-head .form-label { margin-bottom: 0; }
.form-grid > [class*="col-"] > .form-control,
.form-grid > [class*="col-"] > .form-select,
.form-grid > [class*="col-"] > .input-group,
.form-grid > [class*="col-"] > textarea { margin-top: auto; }

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