/* ================================================================
   Grúas el Toques — Sistema de diseño UI (paleta y componentes
   reutilizables). Documentado en:
     documentacion/LINEAMIENTO_DISENO_UI.md
   Cargado globalmente desde:
     app/Views/layouts/back/main.php
     app/Views/layouts/back/maincapas.php
   --------------------------------------------------------------
   Convenciones de uso (resumen):
   - Banner principal de vista: <div class="brand-hero"> ... </div>
       contiene <h4> + acciones .btn-brand / .btn-brand-ghost
   - Paneles (filtros / listados): <div class="brand-panel">
       header opcional <div class="brand-panel__header">
   - CTA primario alineado a marca: <button class="btn btn-brand-primary">
   - Headers de modales no destructivos: clase .brand-modal-header
   - Tarjeta estándar de entidad: .entity-card (banner + body + actions)
       Variantes / hooks específicos de cada vista deben usar
       modificadores BEM, ej.: .entity-card--cot, .entity-card__total
   - Botones de acción (icon-only) en footer de tarjeta:
       .btn-primary-soft / .btn-info-soft / .btn-warning-soft /
       .btn-success-soft / .btn-danger-soft
   - Badges de estado: .estado-activo / .estado-inactivo / .estado-bloqueado
   - Headers de modales destructivos: .brand-modal-header--danger
   - Selector radio-card en modales de filtro: .filtro-opcion-label
   ================================================================ */

:root {
    --brand-navy: #1a2b4a;
    --brand-navy-2: #2c4373;
    --brand-red: #c8102e;
    --brand-red-dark: #9b0c23;
    --brand-card-radius: 14px;
    --brand-card-shadow: 0 4px 14px rgba(26, 43, 74, 0.12);
    --brand-card-shadow-hover: 0 10px 24px rgba(26, 43, 74, 0.18);
    --brand-border-soft: 1px solid rgba(26, 43, 74, 0.08);
}

/* ============================================================
   1. HERO / BANNER PRINCIPAL DE VISTA
   ============================================================ */
.brand-hero {
    background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-2) 100%);
    border-bottom: 3px solid var(--brand-red);
    border-radius: var(--brand-card-radius) var(--brand-card-radius) 0 0;
    padding: 22px 26px;
    color: #fff !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: var(--brand-card-shadow);
}

.brand-hero,
.brand-hero h1,
.brand-hero h2,
.brand-hero h3,
.brand-hero h4,
.brand-hero h5,
.brand-hero h6,
.brand-hero p,
.brand-hero span,
.brand-hero a {
    color: #fff !important;
}

.brand-hero h4 {
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-hero h4 i {
    background: rgba(255, 255, 255, 0.18);
    padding: 8px;
    border-radius: 10px;
    font-size: 22px;
    color: #fff;
}

.brand-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* CTA fuerte rojo de marca (hero) */
.btn-brand {
    background: var(--brand-red);
    border: none;
    color: #fff !important;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 10px;
    transition: transform 0.12s ease, background 0.12s ease;
}

.btn-brand:hover,
.btn-brand:focus {
    background: var(--brand-red-dark);
    color: #fff !important;
    transform: translateY(-1px);
}

/* CTA secundario fantasma sobre el hero */
.btn-brand-ghost {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff !important;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 10px;
    transition: background 0.12s ease;
}

.btn-brand-ghost:hover,
.btn-brand-ghost:focus {
    background: rgba(255, 255, 255, 0.26);
    color: #fff !important;
}

/* Outline navy — para usar sobre fondos claros (cards, panels) */
.btn-brand-outline {
    background: transparent;
    border: 1px solid rgba(26, 43, 74, 0.35);
    color: var(--brand-navy) !important;
    font-weight: 500;
    border-radius: 8px;
    transition: background 0.12s ease, border-color 0.12s ease;
}
.btn-brand-outline:hover,
.btn-brand-outline:focus {
    background: rgba(26, 43, 74, 0.06);
    border-color: var(--brand-navy);
    color: var(--brand-navy) !important;
}

/* ============================================================
   2. PANELES (filtros, listados, secciones)
   ============================================================ */
.brand-panel {
    background: #fff;
    border: var(--brand-border-soft);
    border-radius: var(--brand-card-radius);
    box-shadow: 0 4px 14px rgba(26, 43, 74, 0.08);
    overflow: hidden;
}

.brand-panel > .card-header,
.brand-panel__header {
    background: #f8f9fb;
    border-bottom: var(--brand-border-soft);
    font-weight: 700;
    color: var(--brand-navy);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 0.85rem;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-panel__header i {
    color: var(--brand-red);
    font-size: 18px;
}

/* card-body dentro de collapse también necesita padding */
.brand-panel > .card-body,
.brand-panel .card-body,
.brand-panel__body {
    padding: 18px;
}

/* Etiquetas de filtros (un poco más ordenadas) */
.brand-panel .form-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #666;
    font-weight: 600;
    margin-bottom: 4px;
}

/* ============================================================
   3. CTAs primarios alineados a marca
   ============================================================ */
.btn-brand-primary,
.btn.btn-brand-primary {
    background-color: var(--brand-navy);
    border-color: var(--brand-navy);
    color: #fff;
}

.btn-brand-primary:hover,
.btn-brand-primary:focus,
.btn.btn-brand-primary:hover,
.btn.btn-brand-primary:focus {
    background-color: var(--brand-navy-2);
    border-color: var(--brand-navy-2);
    color: #fff;
}

/* ============================================================
   4. MODALES — header navy de marca
   ============================================================ */
.modal-header.brand-modal-header {
    background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-2) 100%);
    border-bottom: 3px solid var(--brand-red);
    color: #fff;
}

.modal-header.brand-modal-header .modal-title,
.modal-header.brand-modal-header .modal-title i,
.modal-header.brand-modal-header span {
    color: #fff;
}

.modal-header.brand-modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* Variante destructiva — para confirmaciones de eliminación permanente */
.modal-header.brand-modal-header--danger {
    background: linear-gradient(135deg, var(--brand-red-dark) 0%, var(--brand-red) 100%);
    border-bottom: 3px solid rgba(255, 255, 255, 0.35);
    color: #fff;
}

.modal-header.brand-modal-header--danger .modal-title,
.modal-header.brand-modal-header--danger .modal-title i,
.modal-header.brand-modal-header--danger span {
    color: #fff;
}

.modal-header.brand-modal-header--danger .btn-close {
    filter: brightness(0) invert(1);
}

/* Separador de subsección dentro de modales */
.brand-section-divider {
    background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-2) 100%);
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    border-left: 4px solid var(--brand-red);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.3px;
}

.brand-section-divider i {
    color: #fff;
}

/* ============================================================
   4.b FORMULARIO DE MODAL DE MARCA
   ------------------------------------------------------------
   Aplicar `.brand-form` al <form> dentro de un modal para
   conseguir un layout moderno y consistente con la marca.
   Compatible con la rejilla de Bootstrap (`row g-3` + `col-md-*`).
   ============================================================ */
.brand-form .form-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--brand-navy);
    margin-bottom: 4px;
}

.brand-form .form-control,
.brand-form .form-select {
    border: 1px solid rgba(26, 43, 74, 0.18);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    background-color: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.brand-form .form-control:focus,
.brand-form .form-select:focus {
    border-color: var(--brand-navy-2);
    box-shadow: 0 0 0 3px rgba(44, 67, 115, 0.15);
}

.brand-form .form-control[type="file"] {
    padding: 6px 10px;
}

/* Avatar / vista previa de imagen actual dentro del formulario */
.brand-form__avatar-preview {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px rgba(26, 43, 74, 0.18), 0 4px 10px rgba(26, 43, 74, 0.12);
    background: #f0f0f0;
}

.brand-form__doc-preview {
    max-width: 160px;
    border-radius: 8px;
    border: 1px solid rgba(26, 43, 74, 0.18);
    padding: 4px;
    background: #fff;
}

/* Preview clicable: amplía la imagen al hacer click (visor a pantalla completa). */
.brand-form__doc-preview--clickable {
    cursor: zoom-in;
    transition: transform .15s ease, box-shadow .15s ease;
}

.brand-form__doc-preview--clickable:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(26, 43, 74, 0.18);
}

/* Wrapper para preview con botón de eliminar superpuesto */
.brand-form__doc-wrap {
    line-height: 0;
} 

.brand-form__doc-delete {
    position: absolute;
    top: 4px; 
    right: 4px;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.85);
    background: rgba(220, 53, 69, 0.92);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: transform .12s ease, background .12s ease;
    z-index: 2;
}

.brand-form__doc-delete:hover {
    background: rgba(200, 35, 51, 1);
    transform: scale(1.08);
}

.brand-form__doc-delete .mdi {
    font-size: 16px;
    line-height: 1;
}

/* Toggle "ojo" de visibilidad de contraseña, alineado al input */
.brand-password-wrap {
    position: relative;
}

.brand-password-wrap > .form-control {
    padding-right: 38px;
}

.btn-password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--brand-navy-2);
    border-radius: 6px;
    cursor: pointer;
    line-height: 1;
    transition: background-color .15s ease, color .15s ease;
}

.btn-password-toggle:hover,
.btn-password-toggle:focus {
    background: rgba(26, 43, 74, 0.08);
    color: var(--brand-navy);
    outline: none;
}

.btn-password-toggle i {
    font-size: 18px;
}

/* Cuando el label `.form-label` está sobre un input con toggle,
   evitamos que el botón quede sobre el label desplazando el centro
   considerando el alto del label. */
.brand-password-wrap .form-label + .form-control + .btn-password-toggle,
.brand-password-wrap .form-label ~ .btn-password-toggle {
    top: calc(50% + 12px);
}

/* ============================================================
   4.c PANEL DE FILTROS (toolbar superior de listado)
   ------------------------------------------------------------
   `.brand-filters` reemplaza la barra de búsqueda + selects
   sueltos por un contenedor consistente con el resto del UI.
   ============================================================ */
.brand-filters {
    background: #fff;
    border: 1px solid rgba(26, 43, 74, 0.08);
    border-radius: 12px;
    padding: 14px 18px;
    box-shadow: 0 4px 14px rgba(26, 43, 74, 0.06);
}

.brand-filters .input-group-text {
    background: #f1f3f7;
    border-color: rgba(26, 43, 74, 0.12);
    color: var(--brand-navy-2);
}

.brand-filters .form-control,
.brand-filters .form-select {
    border-color: rgba(26, 43, 74, 0.18);
}

.brand-filters .form-control:focus,
.brand-filters .form-select:focus {
    border-color: var(--brand-navy-2);
    box-shadow: 0 0 0 3px rgba(44, 67, 115, 0.15);
}

/* ============================================================
   5. BADGES DE ESTADO
   ============================================================ */
.estado-activo,
.estado-inactivo,
.estado-bloqueado,
.entity-card__estado {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.estado-activo {
    background: #d4edda;
    color: #1e7c34;
}

.estado-inactivo {
    background: #fff3cd;
    color: #856404;
}

.estado-bloqueado {
    background: #f8d7da;
    color: var(--brand-red-dark);
}

/* ============================================================
   5.b SELECTOR RADIO-CARD DE FILTRO (.filtro-opcion-label)
   ------------------------------------------------------------
   Reemplaza la clase Bootstrap `border` nativa en los modales
   de filtro. Se usa así:
     <label class="d-flex align-items-center gap-3 p-2 rounded
                   filtro-opcion-label" style="cursor:pointer;">
       <input type="radio" ...>
     </label>
   ============================================================ */
.filtro-opcion-label {
    background: #f8f9fb;
    border: 1px solid rgba(26, 43, 74, 0.14) !important;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.filtro-opcion-label:hover {
    background: rgba(26, 43, 74, 0.05);
    border-color: var(--brand-navy) !important;
}

.filtro-opcion-label:has(input:checked) {
    background: rgba(26, 43, 74, 0.08);
    border-color: var(--brand-navy) !important;
    box-shadow: inset 0 0 0 1px var(--brand-navy);
}

/* ============================================================
   6. TARJETA DE ENTIDAD ESTÁNDAR
   Estructura:
     .entity-card
       .entity-card__banner
       .entity-card__avatar-wrap > .entity-card__avatar
       .entity-card__body
         .entity-card__name
         .entity-card__estado
         .entity-card__info > .info-row*
         .entity-card__dates
       .entity-card__actions > .btn-*-soft*
   ============================================================ */
.entity-card {
    background: #fff;
    border-radius: var(--brand-card-radius);
    overflow: hidden;
    box-shadow: var(--brand-card-shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    border: var(--brand-border-soft);
}

.entity-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--brand-card-shadow-hover);
}

.entity-card__banner {
    height: 70px;
    background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-2) 100%);
    border-bottom: 3px solid var(--brand-red);
}

.entity-card__avatar-wrap {
    display: flex;
    justify-content: center;
    margin-top: -42px;
    margin-bottom: 4px;
}

.entity-card__avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    background: #f0f0f0;
    box-shadow: 0 4px 10px rgba(26, 43, 74, 0.2);
}

.entity-card__body {
    padding: 6px 16px 12px;
    text-align: center;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.entity-card__name {
    font-size: 15px;
    font-weight: 700;
    color: var(--brand-navy);
    margin: 4px 0 8px;
    line-height: 1.2;
    min-height: 36px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.entity-card__estado {
    align-self: center;
}

.entity-card__info {
    margin-top: 12px;
    text-align: left;
    font-size: 12px;
    color: #444;
    flex-grow: 1;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px dashed #f1f1f1;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row i {
    color: var(--brand-red);
    font-size: 16px;
    flex-shrink: 0;
}

.info-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.info-row strong {
    color: var(--brand-navy);
    font-weight: 600;
}

.entity-card__dates {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    font-size: 10px;
    color: #888;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #f1f1f1;
}

.entity-card__dates i {
    color: var(--brand-navy-2);
}

/* ============================================================
   7. FOOTER DE ACCIONES (botones soft con icono)
   ============================================================ */
.entity-card__actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 10px 12px 12px;
    background: #f8f9fb;
    border-top: 1px solid #eee;
}

.entity-card__actions .btn {
    padding: 8px 0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    transition: transform 0.12s ease, filter 0.12s ease;
}

.entity-card__actions .btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.entity-card__actions .btn i {
    font-size: 18px;
}

/* Modificadores por número de acciones */
.entity-card__actions--2 {
    grid-template-columns: repeat(2, 1fr);
}

.entity-card__actions--3 {
    grid-template-columns: repeat(3, 1fr);
}

.entity-card__actions--5 {
    grid-template-columns: repeat(5, 1fr);
}

.entity-card__actions--6 {
    grid-template-columns: repeat(6, 1fr);
}

/* Botones soft (íconos) */
.btn-primary-soft {
    background: rgba(26, 43, 74, 0.10);
    color: var(--brand-navy);
}

.btn-primary-soft:hover {
    background: var(--brand-navy);
    color: #fff;
}

.btn-info-soft {
    background: rgba(44, 67, 115, 0.12);
    color: var(--brand-navy-2);
}

.btn-info-soft:hover {
    background: var(--brand-navy-2);
    color: #fff;
}

.btn-warning-soft {
    background: rgba(245, 166, 35, 0.15);
    color: #b8860b;
}

.btn-warning-soft:hover {
    background: #f5a623;
    color: #fff;
}

.btn-success-soft {
    background: rgba(30, 124, 52, 0.12);
    color: #1e7c34;
}

.btn-success-soft:hover {
    background: #1e7c34;
    color: #fff;
}

.btn-danger-soft {
    background: rgba(200, 16, 46, 0.12);
    color: var(--brand-red);
}

.btn-danger-soft:hover {
    background: var(--brand-red);
    color: #fff;
}

/* ============================================================
   8. ESTADO VACÍO
   ============================================================ */
.brand-empty {
    text-align: center;
    padding: 48px 16px;
    color: #888;
    background: #f8f9fb;
    border: 1px dashed rgba(26, 43, 74, 0.15);
    border-radius: var(--brand-card-radius);
}

.brand-empty i {
    font-size: 48px;
    color: var(--brand-navy-2);
    opacity: 0.6;
    display: block;
    margin-bottom: 10px;
}

.brand-empty p {
    margin: 0;
    font-size: 14px;
}

/* ============================================================
   9. UTILIDADES ESPECÍFICAS DEL COTIZADOR (modificadores BEM)
   ============================================================ */
.entity-card--cot .entity-card__banner {
    height: 70px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #fff;
}

.entity-card__folio-block {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    min-width: 0;
    color: #fff;
}

.entity-card__folio-label {
    font-size: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.85;
    color: #fff;
}

.entity-card__folio {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
}

.entity-card__total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 6px 10px;
    background: linear-gradient(135deg, rgba(26, 43, 74, 0.06), rgba(200, 16, 46, 0.06));
    border-radius: 10px;
    margin-bottom: 10px;
}

.entity-card__total-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
}

.entity-card__total-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--brand-navy);
}

/* ============================================================
   9.b VARIANTE DATOS DE TRANSFERENCIA (QR centrado + datos)
   Uso: <div class="entity-card entity-card--datshow">
   ============================================================ */
.entity-card--datshow .entity-card__banner {
    height: 70px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #fff;
}

.entity-card--datshow.is-inactive {
    opacity: 0.78;
    filter: grayscale(0.15);
}

.entity-card__qr-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px;
    margin: 6px 0 10px;
    background: #f8f9fb;
    border: 1px dashed rgba(26, 43, 74, 0.15);
    border-radius: 10px;
}

.entity-card__qr-wrap small {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
}

.entity-card__qr-wrap a {
    line-height: 0;
    display: inline-block;
    transition: transform 0.15s ease;
}

.entity-card__qr-wrap a:hover {
    transform: scale(1.03);
}

.entity-card__qr-wrap canvas,
.entity-card__qr-wrap img {
    border-radius: 6px;
}

.entity-card__titular {
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-navy);
    margin: 4px 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entity-card__visibles {
    font-size: 11px;
    color: #666;
    margin-bottom: 6px;
    line-height: 1.35;
}

.entity-card__visibles strong {
    color: var(--brand-navy);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 10px;
}

/* ============================================================
   9.c VARIANTE VEHÍCULO UTILITARIO
   Uso: <div class="entity-card entity-card--vehiculo">
   ============================================================ */
.entity-card--vehiculo .entity-card__banner {
    height: 70px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #fff;
}

.entity-card__status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
}

.entity-card__plate {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    text-transform: uppercase;
    flex-shrink: 0;
}

.entity-card__status-select {
    margin: 4px 0 8px;
    padding: 8px 10px;
    border-top: 1px dashed #f1f1f1;
    border-bottom: 1px dashed #f1f1f1;
    background: #fafbfd;
}

.entity-card__status-select label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.entity-card__status-select label i {
    color: var(--brand-red);
}

.entity-card__status-select select {
    width: 100%;
    border-radius: 8px;
    border: 2px solid;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    background: #fff;
}

.entity-card__status-select select:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.entity-card__status-select select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 43, 74, 0.12);
}

/* ============================================================
   9.d VARIANTE GRÚA / TALLER
   ------------------------------------------------------------
   Tarjeta con: badge de fecha en banner + secciones tituladas
   (datos, costos, observaciones, km), galería de fotos y bloque
   de auditoría.
   ============================================================ */

.entity-card--grua .entity-card__banner {
    height: auto;
    min-height: 70px;
    padding: 12px 16px;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.entity-card--grua .entity-card__banner .entity-card__folio-block {
    flex: 1 1 auto;
    min-width: 0;
}

.entity-card--grua .entity-card__date-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.entity-card--grua .entity-card__date-badge i {
    font-size: 14px;
    color: #fff;
}

.entity-card__section {
    padding: 10px 14px;
    border-bottom: 1px dashed rgba(26, 43, 74, 0.08);
}

.entity-card__section:last-of-type {
    border-bottom: none;
}

.entity-card__section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--brand-red);
    font-weight: 700;
    margin-bottom: 6px;
}

.entity-card__section-title i {
    font-size: 14px;
}

.entity-card__cost-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.entity-card__cost-item {
    background: #f8f9fb;
    border-radius: 8px;
    padding: 6px 10px;
    border: 1px solid rgba(26, 43, 74, 0.05);
}

.entity-card__cost-item--full {
    grid-column: 1 / -1;
}

.entity-card__cost-item label {
    display: block;
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #888;
    margin: 0 0 2px;
}

.entity-card__cost-item strong {
    font-size: 14px;
    color: var(--brand-navy);
    font-weight: 700;
}

.entity-card__obs {
    font-size: 12px;
    color: #444;
    line-height: 1.45;
    margin: 0;
    word-break: break-word;
}

.entity-card__km {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(26, 43, 74, 0.08);
    color: var(--brand-navy);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
}

.entity-card__gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 10px 14px 0;
}

.entity-card__gallery img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.entity-card__gallery img:hover {
    border-color: var(--brand-red);
    transform: scale(1.04);
}

.entity-card__gallery-item {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s ease, transform 0.2s ease;
    aspect-ratio: 1 / 1;
}

.entity-card__gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.entity-card__gallery-item:hover {
    border-color: var(--brand-red);
    transform: scale(1.04);
}

.entity-card__gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 43, 74, 0.45);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.entity-card__gallery-item:hover .entity-card__gallery-overlay {
    opacity: 1;
}

.entity-card__audit {
    background: #f8f9fb;
    border-top: 1px solid rgba(26, 43, 74, 0.06);
    padding: 8px 14px;
    font-size: 10.5px;
    color: #777;
    line-height: 1.5;
}

.entity-card__audit .audit-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.entity-card__audit i {
    color: var(--brand-navy-2);
    margin-right: 3px;
    font-size: 12px;
}

/* ============================================================
   9.e VARIANTE INVENTARIO DIGITAL
   ------------------------------------------------------------
   Tarjeta con: folio en banner + badge de estado, datos del
   vehículo y propietario, footer con 1–4 acciones según rol.
   ============================================================ */

.entity-card--inv.is-cancelled {
    border: 1px solid rgba(200, 16, 46, 0.35);
    box-shadow: 0 4px 14px rgba(200, 16, 46, 0.12);
}

.entity-card--inv .entity-card__banner {
    height: auto;
    min-height: 70px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
}

.entity-card--inv .entity-card__folio-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.entity-card--inv .entity-card__folio-label {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.entity-card--inv .entity-card__folio-label i {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
}

.entity-card--inv .entity-card__folio {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entity-card--inv.is-cancelled .entity-card__banner {
    background: linear-gradient(135deg, var(--brand-red-dark) 0%, var(--brand-red) 100%);
    border-bottom-color: var(--brand-navy);
}

.entity-card--inv .entity-card__estado-banner {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 3px 9px;
    border-radius: 10px;
    white-space: nowrap;
}

.entity-card--inv .entity-card__estado-banner i {
    font-size: 12px;
    color: #fff;
}

.entity-card__actions--4 {
    grid-template-columns: repeat(4, 1fr);
}

.entity-card__actions--1 {
    grid-template-columns: 1fr;
}

/* ============================================================
   10. RESPONSIVO
   ============================================================ */
@media (max-width: 480px) {
    .entity-card__actions,
    .entity-card__actions--5 {
        grid-template-columns: repeat(2, 1fr);
    }

    .entity-card__name {
        font-size: 14px;
    }

    .entity-card__folio {
        font-size: 14px;
    }

    .entity-card__total-value {
        font-size: 16px;
    }

    .brand-hero {
        padding: 18px 18px;
    }

    .brand-hero h4 {
        font-size: 0.95rem;
    }
}

/* ================================================================
   12. SIDEBAR DE MARCA (.brand-sidebar)
   ----------------------------------------------------------------
   Convierte el <aside id="layout-menu"> del template Sneat en el
   menú lateral oficial de la marca. Soporta:
     - Drawer off-canvas en <1200px (con backdrop)
     - Sidebar fijo en >=1200px
     - Modo colapsado en desktop (oculta el sidebar y reclama el
       espacio del contenido) — toggle desde el topbar.
   Ver documentacion/LINEAMIENTO_DISENO_UI.md
   ================================================================ */
:root {
    --brand-sidebar-width: 260px;
    --brand-sidebar-bg: linear-gradient(180deg, var(--brand-navy) 0%, var(--brand-navy-2) 100%);
    --brand-sidebar-shadow: 4px 0 18px rgba(0, 0, 0, 0.18);
    --brand-sidebar-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Aplicado al <aside id="layout-menu"> */
#layout-menu.brand-sidebar,
.brand-sidebar { 
    background: var(--brand-sidebar-bg) !important;
    color: #fff;
    border-right: 3px solid var(--brand-red) !important;
    box-shadow: var(--brand-sidebar-shadow) !important;
    width: var(--brand-sidebar-width) !important;
    transition: transform 0.32s var(--brand-sidebar-ease),
        opacity 0.2s var(--brand-sidebar-ease);
    z-index: 1080;
    display: flex;
    flex-direction: column;
}

/* Anula el aspecto Sneat de los items para evitar choque */
.brand-sidebar .menu-inner-shadow {
    display: none !important;
}

/* ----- Cabecera de marca (logo + título + rol) ----- */
.brand-sidebar__brand {
    position: relative;
    padding: 18px 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.12);
}

.brand-sidebar__brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.brand-sidebar__brand-logo img {
    width: 30px;
    height: 26px;
    object-fit: contain;
}

.brand-sidebar__brand-text {
    flex: 1;
    min-width: 0;
}

.brand-sidebar__brand-title {
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    line-height: 1.05;
    margin: 0;
}

.brand-sidebar__brand-title strong {
    color: var(--brand-red);
    font-weight: 800;
}

.brand-sidebar__brand-role {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 999px;
}

.brand-sidebar__brand-role i {
    color: var(--brand-red);
    font-size: 12px;
}

/* Botón cerrar (visible solo en drawer móvil) */
.brand-sidebar__close {
    position: absolute;
    top: 10px;
    right: 8px;
    width: 32px;
    height: 32px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.brand-sidebar__close:hover {
    background: var(--brand-red);
    transform: rotate(90deg);
}

.brand-sidebar__close i {
    font-size: 20px;
}

/* ----- Lista de navegación ----- */
.brand-sidebar__nav {
    list-style: none;
    margin: 0;
    padding: 10px 8px 24px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.brand-sidebar__nav::-webkit-scrollbar {
    width: 6px;
}

.brand-sidebar__nav::-webkit-scrollbar-track {
    background: transparent;
}

.brand-sidebar__nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
}

.brand-sidebar__nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.32);
}

.brand-sidebar__item {
    list-style: none;
    margin: 1px 0;
    position: relative;
}

.brand-sidebar__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    transition: background 0.18s ease, color 0.18s ease, padding-left 0.18s ease;
    position: relative;
}

.brand-sidebar__link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: transparent;
    transition: background 0.18s ease;
}

.brand-sidebar__link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    padding-left: 14px;
}

.brand-sidebar__link:focus-visible {
    outline: 2px solid var(--brand-red);
    outline-offset: -2px;
}

.brand-sidebar__icon {
    flex-shrink: 0;
    width: 22px;
    text-align: center;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.18s ease;
}

.brand-sidebar__link:hover .brand-sidebar__icon {
    color: var(--brand-red);
}

.brand-sidebar__label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-sidebar__caret {
    margin-left: auto;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.5);
    transition: transform 0.25s var(--brand-sidebar-ease);
}

/* Item activo */
.brand-sidebar__item.is-active > .brand-sidebar__link,
.brand-sidebar__link.is-active {
    background: rgba(200, 16, 46, 0.18);
    color: #fff;
    font-weight: 600;
}

.brand-sidebar__item.is-active > .brand-sidebar__link::before,
.brand-sidebar__link.is-active::before {
    background: var(--brand-red);
    box-shadow: 0 0 8px rgba(200, 16, 46, 0.6);
}

.brand-sidebar__item.is-active > .brand-sidebar__link .brand-sidebar__icon,
.brand-sidebar__link.is-active .brand-sidebar__icon {
    color: var(--brand-red);
}

/* Submenú animado */
.brand-sidebar__sub {
    list-style: none;
    margin: 0;
    padding: 2px 0 4px 30px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.32s var(--brand-sidebar-ease),
        opacity 0.22s ease,
        padding 0.22s ease;
}

.brand-sidebar__item.is-open > .brand-sidebar__sub {
    max-height: 600px;
    opacity: 1;
}

.brand-sidebar__item.is-open > .brand-sidebar__link > .brand-sidebar__caret {
    transform: rotate(180deg);
    color: var(--brand-red);
}

.brand-sidebar__sub .brand-sidebar__link {
    padding: 7px 10px 7px 14px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.68);
}

.brand-sidebar__sub .brand-sidebar__link::before {
    left: -16px;
}

.brand-sidebar__sub .brand-sidebar__link:hover {
    color: #fff;
    padding-left: 16px;
}

.brand-sidebar__sub .brand-sidebar__link.is-active {
    background: rgba(200, 16, 46, 0.22);
    color: #fff;
}

/* ----- Footer del sidebar (perfil + logout, solo visible en móvil) ----- */
.brand-sidebar__footer {
    display: none;
    padding: 12px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.18);
    align-items: center;
    gap: 10px;
}

.brand-sidebar__footer-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--brand-red);
    flex-shrink: 0;
}

.brand-sidebar__footer-info {
    flex: 1;
    min-width: 0;
    line-height: 1.2;
}

.brand-sidebar__footer-name {
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-sidebar__footer-role {
    color: rgba(255, 255, 255, 0.65);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.brand-sidebar__footer-logout {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(200, 16, 46, 0.18);
    border: none;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.brand-sidebar__footer-logout:hover {
    background: var(--brand-red);
    transform: translateX(2px);
}

/* ----- Backdrop drawer móvil (solo activo en <992px) ----- */
.brand-sidebar__backdrop {
    position: fixed;
    /* No cubre el navbar superior: empieza ~70px más abajo para que la
       barra de navegación quede siempre visible y clickeable cuando el
       drawer está abierto en móvil/tablet. */
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    z-index: 1075;
    opacity: 0;
    visibility: hidden;
    pointer-events: none; 
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

@media (min-width: 992px) {
    .brand-sidebar__backdrop {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    body.brand-sidebar-mobile-open .brand-sidebar__backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

/* ============================================================
   13. TOPBAR DE MARCA
   ============================================================ */
.layout-navbar.brand-topbar,
.brand-topbar {
    background: #fff !important;
    border-bottom: 2px solid var(--brand-red) !important;
    box-shadow: 0 4px 14px rgba(26, 43, 74, 0.08) !important;
    /* Mantener el navbar siempre por encima del backdrop del drawer
       móvil para que el botón hamburguesa y el dropdown de usuario
       sigan siendo interactuables aunque el sidebar esté abierto. */
    position: relative;
    z-index: 1090;
    border-radius: 12px;
    padding: 6px 14px !important;
}

/* Botón hamburguesa animado (3 spans -> X) */
.brand-topbar__toggle {
    width: 42px;
    height: 42px;
    border: none;
    background: rgba(26, 43, 74, 0.06);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
    flex-direction: column;
    gap: 4px;
    padding: 0;
}

.brand-topbar__toggle:hover {
    background: rgba(26, 43, 74, 0.12);
}

.brand-topbar__toggle:focus-visible {
    outline: 2px solid var(--brand-navy);
    outline-offset: 2px;
}

.brand-topbar__toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--brand-navy);
    border-radius: 2px;
    transition: transform 0.28s var(--brand-sidebar-ease),
        opacity 0.18s ease,
        background 0.18s ease;
    transform-origin: center;
}

/* Variante hamburguesa -> X (móvil cuando drawer está abierto) */
body.brand-sidebar-mobile-open .brand-topbar__toggle--mobile span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
    background: var(--brand-red);
}

body.brand-sidebar-mobile-open .brand-topbar__toggle--mobile span:nth-child(2) {
    opacity: 0;
}

body.brand-sidebar-mobile-open .brand-topbar__toggle--mobile span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
    background: var(--brand-red);
}

/* Toggle desktop (colapsar/mostrar) — usa icono de flecha */
.brand-topbar__collapse {
    width: 42px;
    height: 42px;
    border: none;
    background: rgba(26, 43, 74, 0.06);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-navy);
    cursor: pointer;
    transition: background 0.18s ease, transform 0.25s var(--brand-sidebar-ease);
}

.brand-topbar__collapse:hover {
    background: rgba(26, 43, 74, 0.12);
}

.brand-topbar__collapse i {
    font-size: 22px;
    transition: transform 0.32s var(--brand-sidebar-ease);
}

body.brand-sidebar-collapsed .brand-topbar__collapse i {
    transform: rotate(180deg);
}

/* ----- Avatar y dropdown de usuario en topbar ----- */
.brand-topbar__avatar-btn {
    padding: 0 !important;
    border-radius: 50%;
    transition: transform 0.18s ease;
}

.brand-topbar__avatar-btn:hover {
    transform: scale(1.05);
}

.brand-topbar__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--brand-navy);
    box-shadow: 0 2px 6px rgba(26, 43, 74, 0.18);
}

.brand-topbar__dropdown {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 30px rgba(26, 43, 74, 0.18) !important;
    padding: 0 !important;
    overflow: hidden;
    min-width: 240px;
    margin-top: 8px !important;
}

.brand-topbar__dropdown-header {
    background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-2) 100%);
    border-bottom: 2px solid var(--brand-red);
    padding: 14px 14px 12px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-topbar__dropdown-header img {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    display: block;
}

.brand-topbar__dropdown-header .name {
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.1;
    margin-bottom: 2px;
}

.brand-topbar__dropdown-header .role {
    color: rgba(255, 255, 255, 0.85);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.brand-topbar__dropdown .dropdown-item {
    padding: 10px 14px;
    font-size: 13.5px;
    color: var(--brand-navy);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s ease, color 0.15s ease;
}

.brand-topbar__dropdown .dropdown-item i {
    color: var(--brand-navy-2);
    font-size: 18px;
}

.brand-topbar__dropdown .dropdown-item:hover {
    background: rgba(26, 43, 74, 0.06);
    color: var(--brand-navy);
}

.brand-topbar__dropdown .dropdown-item--danger {
    color: var(--brand-red-dark);
    font-weight: 600;
}

.brand-topbar__dropdown .dropdown-item--danger i {
    color: var(--brand-red);
}

.brand-topbar__dropdown .dropdown-item--danger:hover {
    background: rgba(200, 16, 46, 0.08);
    color: var(--brand-red-dark);
}

.brand-topbar__dropdown .dropdown-divider {
    margin: 0;
    border-color: rgba(26, 43, 74, 0.08);
}

/* ============================================================
   14. RESPONSIVE: drawer móvil + colapso desktop
   ============================================================ */

/* === Desktop (>=992px) === */
@media (min-width: 992px) {
    .brand-sidebar__close {
        display: none !important;
    }

    .brand-topbar__toggle--mobile {
        display: none !important;
    }

    /* Forzar visibilidad del sidebar en desktop. Sneat aplica
       transform: translateX(-100%) por defecto en .layout-menu y solo
       lo muestra cuando <html> tiene la clase layout-menu-expanded.
       Aquí lo sobreescribimos para que siempre esté visible salvo que
       el usuario lo haya colapsado manualmente. */
    #layout-menu.brand-sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(0) !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    /* Reservar el espacio para el sidebar en desktop */
    .layout-page {
        padding-left: var(--brand-sidebar-width) !important;
    }

    /* Modo colapsado: oculta sidebar y reclama el espacio */
    body.brand-sidebar-collapsed #layout-menu.brand-sidebar {
        transform: translateX(-100%) !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    body.brand-sidebar-collapsed .layout-page {
        padding-left: 0 !important;
    }

    /* Solo animamos el padding del contenedor de página. NO tocamos
       margin/width del navbar ni del content-wrapper porque Sneat
       usa `navbar-detached` con márgenes propios y al transicionarlos
       el navbar se desencuadra y bloquea la interacción. */
    .layout-page {
        transition: padding-left 0.32s var(--brand-sidebar-ease);
    }
}

/* === Móvil/tablet (<1200px) === */
@media (max-width: 991.98px) {
    .brand-topbar__collapse {
        display: none !important;
    }

    #layout-menu.brand-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-100%);
        opacity: 0;
        pointer-events: none;
    }

    body.brand-sidebar-mobile-open #layout-menu.brand-sidebar {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .brand-sidebar__close {
        display: inline-flex;
    }

    .brand-sidebar__footer {
        display: flex;
    }

    /* Bloquear scroll del body cuando el drawer está abierto */
    body.brand-sidebar-mobile-open {
        overflow: hidden;
    }
}

@media (max-width: 575.98px) {
    :root {
        --brand-sidebar-width: 86vw;
    }

    #layout-menu.brand-sidebar {
        max-width: 320px;
    }
}


/* ============================================================
   17. LISTADOS COMO CARDS (.brand-list)
   ------------------------------------------------------------
   Sustituye al patrón "tabla densa" para listados de entidades.
   Acciones siempre a la izquierda. Responsive sin scroll horizontal.
   ============================================================ */
.brand-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.brand-list__row {
    display: flex;
    align-items: stretch;
    gap: 14px;
    background: #fff;
    border: 1px solid rgba(26, 43, 74, 0.08);
    border-left: 4px solid var(--brand-navy);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 2px 6px rgba(26, 43, 74, 0.05);
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.brand-list__row:hover {
    box-shadow: 0 6px 18px rgba(26, 43, 74, 0.10);
    transform: translateY(-1px);
}

.brand-list__row.is-inactive {
    border-left-color: #b5bcc8;
    background: #fafbfc;
    opacity: 0.85;
}

.brand-list__row.is-danger {
    border-left-color: var(--brand-red);
}

/* Bloque de acciones siempre primero */
.brand-list__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding-right: 12px;
    border-right: 1px dashed rgba(26, 43, 74, 0.12);
}

.brand-list__actions .btn {
    min-width: 36px;
    padding: 6px 10px;
}

/* Contenido principal */
.brand-list__main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brand-list__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--brand-navy);
    font-size: 15px;
    margin: 0;
}

.brand-list__title small {
    font-weight: 500;
    color: #6b7785;
    font-size: 12px;
}

.brand-list__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    color: #6b7785;
    font-size: 12.5px;
}

.brand-list__meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.brand-list__meta i {
    color: var(--brand-navy-2);
    font-size: 14px;
}

.brand-list__body {
    color: #444;
    font-size: 13.5px;
    line-height: 1.45;
    margin-top: 2px;
}

.brand-list__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.brand-list__chip {
    background: rgba(26, 43, 74, 0.08);
    color: var(--brand-navy);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.brand-list__empty {
    text-align: center;
    color: #6b7785;
    padding: 24px 16px;
    background: #fff;
    border: 1px dashed rgba(26, 43, 74, 0.2);
    border-radius: 12px;
}

@media (max-width: 575.98px) {
    .brand-list__row {
        flex-direction: column;
        gap: 10px;
    }

    .brand-list__actions {
        order: 1;
        border-right: none;
        border-bottom: 1px dashed rgba(26, 43, 74, 0.12);
        padding-right: 0;
        padding-bottom: 10px;
        width: 100%;
    }

    .brand-list__main {
        order: 2;
    }
}

/* ============================================================
   18. NAVEGACION POR PESTANAS (.brand-tabs)
   ------------------------------------------------------------
   Sustituye a "nav nav-tabs" de Bootstrap para alinear con la
   paleta navy/red. Incluye wrapper con scroll-x visible y
   degradados laterales de desvanecimiento.
   ============================================================ */

/* Wrapper con scroll horizontal visible */
.brand-tabs-wrap {
    position: relative;
    margin-bottom: 20px;
}

/* Degradados para indicar que hay más pestañas fuera de vista */
.brand-tabs-wrap::before,
.brand-tabs-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 4px;           /* no tapar la scrollbar */
    width: 28px;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.brand-tabs-wrap::before {
    left: 0;
    background: linear-gradient(to right, rgba(248,249,251,0.96), transparent);
}

.brand-tabs-wrap::after {
    right: 0;
    background: linear-gradient(to left, rgba(248,249,251,0.96), transparent);
}

.brand-tabs-wrap.has-scroll-left::before  { opacity: 1; }
.brand-tabs-wrap.has-scroll-right::after  { opacity: 1; }

/* Barra de tabs */
.brand-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 2px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(26,43,74,0.25) rgba(26,43,74,0.06);
    -webkit-overflow-scrolling: touch;
    border-bottom: 2px solid rgba(26,43,74,0.12);
    padding-bottom: 0;
    margin: 0;
    list-style: none;
    padding-left: 0;
}

.brand-tabs::-webkit-scrollbar {
    height: 4px;
}

.brand-tabs::-webkit-scrollbar-track {
    background: rgba(26,43,74,0.06);
    border-radius: 99px;
}

.brand-tabs::-webkit-scrollbar-thumb {
    background: rgba(26,43,74,0.25);
    border-radius: 99px;
}

.brand-tabs::-webkit-scrollbar-thumb:hover {
    background: rgba(26,43,74,0.45);
}

/* Cada item */
.brand-tabs .nav-item {
    flex-shrink: 0;
}

/* Botones de pestaña */
.brand-tabs .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    font-size: 12.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #6b7785;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    margin-bottom: -2px;   /* solapa el border-bottom del ul */
    white-space: nowrap;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    cursor: pointer;
    text-decoration: none;
}

.brand-tabs .nav-link i {
    font-size: 16px;
    color: inherit;
    transition: color 0.15s ease;
}

.brand-tabs .nav-link:hover {
    color: var(--brand-navy);
    background: rgba(26,43,74,0.04);
    border-bottom-color: rgba(26,43,74,0.25);
}

.brand-tabs .nav-link.active,
.brand-tabs .nav-link[aria-selected="true"] {
    color: var(--brand-navy);
    background: rgba(26,43,74,0.05);
    border-bottom-color: var(--brand-red);
}

.brand-tabs .nav-link.active i {
    color: var(--brand-red);
}

/* Variante "pill" para paneles sin borde inferior de referencia */
.brand-tabs.brand-tabs--pills {
    border-bottom: none;
    gap: 4px;
}

.brand-tabs.brand-tabs--pills .nav-link {
    border: 1.5px solid rgba(26,43,74,0.15);
    border-radius: 8px;
    margin-bottom: 0;
}

.brand-tabs.brand-tabs--pills .nav-link:hover {
    border-color: var(--brand-navy);
    background: rgba(26,43,74,0.04);
}

.brand-tabs.brand-tabs--pills .nav-link.active {
    background: var(--brand-navy);
    border-color: var(--brand-navy);
    color: #fff;
}

.brand-tabs.brand-tabs--pills .nav-link.active i {
    color: #fff;
}

/* ============================================================
   11. MODAL VISTA PREVIA — layout compacto cuadrícula (pvw-*)
   ============================================================ */
.pvw-root {
    font-size: 0.82rem;
    padding: 0 2px;
}

/* Hero strip: identifiers + badges */
.pvw-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    background: #f0f4fa;
    border-radius: 8px;
    padding: 9px 14px;
    margin-bottom: 10px;
    border: 1px solid #dde4f0;
}

.pvw-hero-item {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.pvw-hero-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #94a3b8;
    font-weight: 700;
}

.pvw-hero-main {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--brand-navy);
}

.pvw-hero-tags {
    margin-left: auto;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: center;
}

/* Section */
.pvw-section {
    margin-bottom: 8px;
    border: 1px solid #e8edf3;
    border-radius: 0 0 4px 4px;
    overflow: hidden;
}

.pvw-section-head {
    background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-2) 100%);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-left: 3px solid var(--brand-red);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 2-column grid */
.pvw-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: #fff;
}

.pvw-field {
    padding: 5px 12px 4px;
    border-bottom: 1px solid #f1f5f9;
}

.pvw-field:nth-child(odd) {
    border-right: 1px solid #f1f5f9;
}

.pvw-field:nth-last-child(-n+2) {
    border-bottom: none;
}

/* Solo 1 campo si el siguiente está vacío */
.pvw-field--full {
    grid-column: 1 / -1;
    border-right: none;
}

.pvw-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    font-weight: 700;
    line-height: 1.1;
}

.pvw-value {
    font-size: 0.82rem;
    color: #2d3748;
    font-weight: 500;
    line-height: 1.4;
    word-break: break-word;
}

.pvw-empty {
    color: #cbd5e0;
    font-weight: 400;
}

/* Payment highlight box */
.pvw-pago-box {
    margin-bottom: 8px;
    border: 1px solid #dde4f0;
    border-radius: 0 0 6px 6px;
    overflow: hidden;
    background: #f8fafc;
}

.pvw-pago-box .pvw-section-head {
    border-radius: 0;
}

.pvw-pago-inner {
    padding: 8px 14px 10px;
}

.pvw-pago-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    border-bottom: 1px dashed #e8edf3;
    color: #4a5568;
    font-size: 0.81rem;
}

.pvw-pago-row:last-of-type {
    border-bottom: none;
}

.pvw-pago-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0 2px;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--brand-navy);
    border-top: 2px solid var(--brand-navy);
    margin-top: 4px;
}

.pvw-pago-badges {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ============================================================
   19. CIFRAS DESTACADAS (.brand-metric)
   Bloque etiqueta + valor para totales y comparativos que no
   viven dentro de una .entity-card (p. ej. Costo AMEQ /
   Se cobró / Diferencia en el Cotizador AMEQ).
   ============================================================ */
.brand-metric {
    background: #f8f9fb;
    border: 1px solid rgba(26, 43, 74, 0.10);
    border-radius: 10px;
    padding: 12px 14px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.brand-metric__label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 5px;
}

.brand-metric__label i {
    color: var(--brand-red);
    font-size: 14px;
}

.brand-metric__value {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.15;
    color: var(--brand-navy);
    word-break: break-word;
}

.brand-metric__hint {
    font-size: 11px;
    color: #888;
}

.brand-metric--positive .brand-metric__value {
    color: #1e7c34;
}

.brand-metric--negative .brand-metric__value {
    color: var(--brand-red);
}

.brand-metric--strong {
    background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-2) 100%);
    border-color: transparent;
}

.brand-metric--strong .brand-metric__label {
    color: rgba(255, 255, 255, 0.75);
}

.brand-metric--strong .brand-metric__label i {
    color: #fff;
}

.brand-metric--strong .brand-metric__value {
    color: #fff;
}

@media (max-width: 380px) {
    .brand-metric__value {
        font-size: 19px;
    }
}  

/* ============================================================
   20. HORARIO SEMANAL (.brand-horario)
   Cuadro Lunes–Domingo de una plantilla de horario rotativo.
   Lo comparten "Mi Horario" (usuario final) y el calendario por
   rol de "Gestión de Horarios" (admin) para que ambos se vean
   exactamente igual — ver documentacion/fases/fase-0/ALCANCE_HORARIOS.md
   ============================================================ */

.brand-horario {
    border: var(--brand-border-soft);
    border-radius: var(--brand-card-radius);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--brand-card-shadow);
}

.brand-horario + .brand-horario {
    margin-top: 16px;
}

.brand-horario__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    padding: 10px 14px;
    border-bottom: var(--brand-border-soft);
    background: rgba(26, 43, 74, 0.04);
}

.brand-horario__pos {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--brand-navy);
}

.brand-horario__pos i {
    color: var(--brand-red);
}

.brand-horario__user {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: var(--brand-navy-2);
}

.brand-horario__user i {
    color: var(--brand-navy-2);
}

.brand-horario__user--vacante {
    color: var(--brand-red);
    font-weight: 600;
}

.brand-horario__table {
    margin-bottom: 0;
}

.brand-horario__table thead th {
    background: var(--brand-navy);
    color: #fff;
    font-size: 12px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.brand-horario__cell {
    white-space: nowrap;
    color: var(--brand-navy);
}

.brand-horario__cell--descanso {
    background: #fff3cd;
    color: #856404;
    font-weight: 700;
}

.brand-horario__cell--vacio {
    color: #9aa3b2;
}
