body {
    font-family: Arial, sans-serif;
    background-color: #f1f5f9;
    margin: 0;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

.contenedor {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
}

.tarjeta {
    width: 320px;
    min-height: 450px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-sizing: border-box;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);

    display: flex;
    flex-direction: column;
    align-items: center;

    overflow: hidden;
}

.foto {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
}

.info {
    width: 100%;
    text-align: center;
}

.info h2 {
    font-size: 22px;
    margin: 10px 0;
    color: #222;

    overflow-wrap: break-word;
    word-wrap: break-word;
}

.matricula {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.info p {
    margin: 8px 0;
    line-height: 1.5;
    color: #444;

    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* ---------- Encabezado con acciones ---------- */

.encabezado {
    text-align: center;
    margin-bottom: 30px;
}

.encabezado h1 {
    margin-bottom: 16px;
}

.acciones-titulo {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.total {
    color: #666;
    font-size: 14px;
    margin: 12px 0 0;
}

.vacio {
    color: #666;
    text-align: center;
}

/* ---------- Botones (colores de los ejemplos del manual) ---------- */

.btn {
    font-family: Arial, sans-serif;
    font-size: 14px;
    padding: 8px 18px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-azul {
    background: #0d6efd;
    color: #fff;
}

.btn-azul:hover:enabled {
    background: #0b5ed7;
}

.btn-gris {
    background: #f8f9fa;
    color: #333;
    border-color: #ced4da;
}

.btn-gris:hover:enabled {
    background: #e9ecef;
}

.btn-rojo {
    background: #dc3545;
    color: #fff;
}

.btn-rojo:hover:enabled {
    background: #bb2d3b;
}

.btn-rojo-borde {
    background: #fff;
    color: #dc3545;
    border-color: #f1aeb5;
}

.btn-rojo-borde:hover {
    background: #fdecee;
}

/* ---------- Acciones de cada tarjeta ---------- */

.acciones-tarjeta {
    margin-top: auto;
    padding-top: 15px;
    display: flex;
    gap: 10px;
}

/* ---------- Aviso ---------- */

.aviso {
    max-width: 600px;
    margin: 0 auto 25px;
    padding: 12px 16px;
    border-radius: 6px;
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
    text-align: center;
}

/* ---------- Modales con el diseño de panel del manual ---------- */

.modal {
    width: min(560px, 94vw);
    padding: 0;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    max-height: 90vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.modal-ancho {
    width: min(640px, 94vw);
}

.modal::backdrop {
    background: rgba(0, 0, 0, 0.45);
}

/* Bloquea el scroll de la página mientras hay un modal abierto */
body:has(dialog[open]) {
    overflow: hidden;
}

.panel-titulo {
    background: #1b3f66;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-titulo-rojo {
    background: #8b1e2b;
}

.cerrar-x {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.panel-cuerpo {
    background: #fff;
    padding: 16px;
}

.panel-cuerpo p {
    color: #444;
    line-height: 1.5;
    margin: 0 0 12px;
}

.fila {
    display: grid;
    grid-template-columns: 140px 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.fila label {
    font-size: 13px;
    font-weight: bold;
    color: #222;
}

.fila-foto {
    align-items: start;
}

.fila-foto label {
    padding-top: 8px;
}

.modal input,
.modal select {
    width: 100%;
    padding: 7px 10px;
    font-size: 14px;
    font-family: Arial, sans-serif;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-sizing: border-box;
    background: #fff;
}

.modal input:focus,
.modal select:focus {
    outline: 2px solid #9ec5fe;
    border-color: #86b7fe;
}

.modal .gris,
.modal input:disabled,
.modal select:disabled {
    background: #e9ecef;
    color: #333;
}

.buscador {
    display: flex;
    gap: 10px;
}

.seccion {
    background: #e7f1ff;
    color: #222;
    font-weight: bold;
    font-size: 14px;
    padding: 8px 10px;
    margin: 6px 0 12px;
    border-radius: 4px;
}

.vista-foto {
    display: block;
    width: 90px;
    height: 90px;
    object-fit: cover;
    margin-top: 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #f1f5f9;
}

.botones {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.botones .btn {
    min-width: 110px;
}

.botones.derecha {
    justify-content: flex-end;
}

.alerta {
    background: #f8d7da;
    color: #842029 !important;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 14px;
}

.error-modal {
    color: #dc3545 !important;
    font-size: 14px;
}

@media (max-width: 520px) {
    .fila {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}
