/* ── Cabeceras y filas de listados (layouts flex personalizados) ── */
.cabecera_tablas {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: center;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f8f8ff;
}
.cabecera_tablas div {
    font-weight: 400;
    padding: 5px 10px;
    font-size: 16px;
}

.linea_tablas {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: center;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid gray;
}
.linea_tablas div {
    font-weight: 100;
    padding: 5px 10px;
    font-size: 14px;
}

/* .linea_tablas como clase de estado sobre <tr>: restaurar comportamiento tabla */
table tr.linea_tablas {
    display: table-row;
    flex-direction: initial;
    flex-wrap: initial;
    align-items: initial;
    justify-content: initial;
}
table tr.linea_tablas > th,
table tr.linea_tablas > td {
    display: table-cell;
}

#listadoRuedasDeclaradas div {
    display: flex;
}

/* ══════════════════════════════════════════════════════════════
   TABLAS RESPONSIVAS — MODO TARJETA EN MÓVIL / PDA
   Funciona con cualquier <table class="table"> del sitio.
   El JS de foot.php añade data-label a cada <td> automáticamente.
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 767.98px) {

    /* Ocultar cabeceras de columna — los labels aparecen inline en cada celda */
    .table-mobile-card thead {
        display: none;
    }

    .table-mobile-card,
    .table-mobile-card tbody,
    .table-mobile-card tr,
    .table-mobile-card td,
    .table-mobile-card th {
        display: block;
        width: 100%;
    }

    /* Cada fila = tarjeta */
    .table-mobile-card tbody tr {
        border: 1px solid #dee2e6;
        border-radius: 8px;
        margin-bottom: 12px;
        padding: 6px 0;
        background: #fff;
        box-shadow: 0 1px 4px rgba(0,0,0,.08);
    }

    /* Filas coloreadas (ok/ko/success/warning) conservan su color */
    .table-mobile-card tbody tr.alert-success { background: #d4edda; }
    .table-mobile-card tbody tr.alert-warning  { background: #fff3cd; }
    .table-mobile-card tbody tr.text-muted     { opacity: .7; }

    /* Celdas: label en negrita + valor en la misma línea */
    .table-mobile-card td,
    .table-mobile-card th {
        border: none;
        padding: 5px 14px;
        text-align: left !important;
        font-size: 15px;
        line-height: 1.4;
    }

    .table-mobile-card td::before {
        content: attr(data-label) ": ";
        font-weight: 700;
        color: #444;
        margin-right: 4px;
    }

    /* Celda sin label (p.ej. botones de acción): centrada */
    .table-mobile-card td[data-label=""],
    .table-mobile-card td:not([data-label]) {
        text-align: center !important;
        padding-top: 8px;
    }
    .table-mobile-card td[data-label=""]::before,
    .table-mobile-card td:not([data-label])::before {
        content: none;
    }

    /* Botones de acción: tamaño cómodo para el dedo */
    .table-mobile-card .btn {
        min-height: 44px;
        min-width: 44px;
        font-size: 16px;
        margin: 2px;
    }

    /* ── Flex layouts originales en móvil ── */
    .cabecera_tablas {
        flex-direction: column;
        align-items: flex-start;
    }
    .cabecera_tablas div {
        font-size: 14px;
        padding: 3px 8px;
    }
    .linea_tablas {
        flex-direction: column;
        align-items: flex-start;
    }
    .linea_tablas div {
        font-size: 13px;
        padding: 3px 8px;
        width: 100%;
    }

    /* ── font-size mínimo 16 px en inputs — evita zoom automático en iOS ── */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="tel"],
    input[type="search"],
    input[type="date"],
    textarea,
    select {
        font-size: 16px !important;
    }

    /* ── Targets táctiles: mínimo 44 px en todos los botones y links-botón ── */
    .btn,
    button,
    input[type="submit"],
    input[type="button"],
    input[type="reset"],
    a.btn {
        min-height: 44px;
        min-width: 44px;
        font-size: 16px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    /* ── Botón principal de formularios: ancho completo en móvil ── */
    .btn-block-mobile {
        display: block;
        width: 100%;
    }
    .iq-card-body .btn[type="submit"],
    .iq-card-body input[type="submit"] {
        display: block;
        width: 100%;
        margin-top: 8px;
    }
}
