:root {
    --primary-color: #2c5530;
    --secondary-color: #4a7c59;
    --accent-color: #7fb069;
    --light-green: #e8f5e8;
    --dark-text: #2d3748;
    --gray-text: #718096;
    --white: #ffffff;
    --light-gray: #f8fafc;
    --border-color: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.navbar-custom {
    background-color: #2c5530 !important;
}

.bg-primary-custom {
    background: linear-gradient(
            135deg,
            var(--primary-color),
            var(--secondary-color)
    ) !important;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-text);
    background: linear-gradient(135deg, #f8fafc 0%, #e8f5e8 100%);
    min-height: 100vh;
}

.header-strip {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    height: 6px;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    overflow: visible; /* evita scroll interno */
}

.hero-section {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(44, 85, 48, 0.1);
    padding: 3rem 2rem;
    margin-bottom: 3rem;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-text);
    margin-bottom: 1.5rem;
    text-align: center;
    line-height: 1.2;
}

.hero-title .medical-cannabis {
    color: var(--primary-color);
    position: relative;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--gray-text);
    text-align: center;
    max-width: 900px;
    margin: 0 auto 2rem;
    line-height: 1.8;
}

.features-section {
    margin: 3rem 0;
}

.feature-card {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    height: 100%;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(44, 85, 48, 0.15);
    border-color: var(--accent-color);
}

.feature-icon {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 1.8rem;
}

.feature-icon.innovation {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.feature-icon.team {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: white;
}

.feature-icon.renewal {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.feature-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 1rem;
    text-align: center;
}

.feature-description {
    color: var(--gray-text);
    text-align: center;
    line-height: 1.7;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--dark-text);
    text-align: center;
    margin: 3rem 0 2rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.action-section {
    background: var(--white);
    border-radius: 16px;
    padding: 3rem 2rem;
    box-shadow: 0 4px 20px rgba(44, 85, 48, 0.1);
    border: 1px solid var(--border-color);
    max-width: 600px;
    margin: 0 auto;
}

.action-icon {
    font-size: 4rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.action-description {
    color: var(--gray-text);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    text-align: center;
    line-height: 1.7;
}

.btn-custom {
    padding: 0.9rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: auto;
}

.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary-custom:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 85, 48, 0.25);
    color: white;
}

.btn-secondary-custom {
    background: transparent;
    color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary-custom:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 124, 89, 0.25);
}

.btn-group-custom {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.btn.btn-primary-custom:disabled {
    background: linear-gradient(
            135deg,
            var(--primary-color) 0%,
            var(--secondary-color) 100%
    );
    color: white;
    border-color: var(--primary-color);
    opacity: 1;
}


@media (min-width: 576px) {
    .btn-group-custom {
        flex-direction: row;
        justify-content: center;
    }
}

.medical-symbol {
    display: inline-block;
    margin-left: 0.5rem;
    opacity: 0.7;
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

.fade-in-up-delay-1 {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.fade-in-up-delay-2 {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* Responsivo */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-section,
    .action-section {
        padding: 2rem 1.5rem;
    }

    .feature-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
}

/* Accesibilidad */
.btn-custom:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* Elementos decorativos */
.decorative-line {
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--accent-color) 50%, transparent 100%);
    margin: 2rem auto;
    max-width: 200px;
}

.step {
    opacity: 0.7;
    transition: all 0.3s ease;
}

.step.active {
    opacity: 1;
    font-weight: bold;
}

.step.completed .step-number {
    background-color: #28a745;
}

.step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #6c757d;
    color: white;
    text-align: center;
}

.custom-card-header2 {
    background-color: var(--bs-gray-200);
}

/*Dynamic modal*/
/* Estilo para el MODAL */
.cm-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(6px);
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

.cm-container {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 8vh;
    z-index: 1001;
    animation: slideDown 0.35s ease-out;
    width: 1000px;
}

.cm-container.expanded {
    padding: 0;
    align-items: stretch;
}

.cm-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    width: 800px;
    max-width: 95vw;
    overflow: hidden;
    animation: scaleIn 0.25s ease;
    display: flex;
    flex-direction: column;
}

.cm-card.expanded {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
}

.cm-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    padding: 16px;
    font-size: 18px;
    border-bottom: 1px solid #e0e0e0;
}

.cm-body {
    padding: 10px;
    font-size: 15.5px;
    color: #333;
    word-wrap: break-word;
    text-align: center;
}

.cm-body.expanded {
    max-height: calc(100vh - 150px);
    font-size: 1.1rem;
    padding: 10px;
}

.cm-container.expanded .cm-body-scroll {
    max-height: calc(100vh - 140px);
}

.cm-footer {
    padding: 16px;
    text-align: right;
    border-top: 1px solid #e0e0e0;
}

.cm-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
}

.cm-btn-error {
    background-color: #e74c3c;
    color: white;
}

.cm-btn-success {
    background-color: #2c5530;
    color: white;
}

.cm-btn-warning {
    background-color: #f39c12;
    color: white;
}

.cm-btn-info {
    background-color: #3498db;
    color: white;
}

.cm-error {
    color: #e74c3c;
}

.cm-success {
    color: #2c5530;
}

.cm-warning {
    color: #f39c12;
}

.cm-info {
    color: #3498db;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.wrap-header {
    white-space: normal !important;
    vertical-align: middle !important;
    text-align: center;
}

/* un poco más de espacio vertical */

table.table-sm th,
table.table-sm td {
    padding-top: .75rem;
    padding-bottom: .75rem;
}

/* posición para el botón eliminar */
.cm-card.legal {
    width: min(900px, 95vw);
}

/* Opcional: mejor lectura para documentos */
.cm-card.legal .cm-body-scroll {
    max-width: 75ch;
    margin: 0 auto;
    font-size: 1rem;
    line-height: 1.7;
}

.fila-sustancia {
    position: relative;
}

.btn-remove {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    z-index: 1;
}

.custom-light-header th {
    background-color: #f0f1f4 !important;
    color: #212529 !important;
}


/* AUMENTAR Z-INDEX DE MODAL CON ESPECIFICIDAD */

.cm-backdrop {
    z-index: 99999 !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(8px) !important; /* Aplicar blur al backdrop */
}

.cm-container {
    z-index: 100000 !important;
    position: fixed !important;
}

/* Cuando hay múltiples modales, aplicar blur a los modales inferiores */

.modal.show ~ .modal .modal-content {
    filter: blur(4px) !important;
    opacity: 0.8 !important;
}

/* Asegurar que el modal activo no tenga blur */

.modal.show:last-of-type .modal-content {
    filter: none !important;
    opacity: 1 !important;
}


.mi-thead {
    background-color: #2c5530;
    color: white;
}

.modal-custom-width {
    max-width: 90%;
}

/* ============================
   SOLUCIÓN PARA SCROLL DOBLE EN HOME
   ============================ */

/* QUITAR TOD0 LO QUE HAY DEBAJO DE "PAGINA @PAGE "/" QUE NO TENGA SCROLL" */
/* Y REEMPLAZAR CON ESTO: */

html, body {
    height: auto;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.layout-container {
    display: block;
    min-height: 100vh;
    height: auto;
}

.layout-header {
    position: relative;
}

.layout-main {
    display: block;
    min-height: auto;
    height: auto;
    overflow-y: visible !important;
    overflow-x: hidden;
}

.container-fluid.py-4 {
    padding: 0 !important;
    height: auto;
    overflow: visible !important;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    overflow: visible !important;
    height: auto;
    min-height: auto;
}

/* ============================
   CLASE ESPECÍFICA PARA HOME SIN SCROLL
   ============================ */

.home-no-scroll {
    overflow: visible !important;
    height: auto !important;
}

.home-no-scroll .hero-section,
.home-no-scroll .features-section,
.home-no-scroll .action-section {
    margin-bottom: 2rem;
    overflow: visible;
}

/* ============================
   ESPECIFICA TEXTBOX REQUERIDO EN EL LABEL
   ============================ */
.required::after {
    content: " *";
    color: red;
}

/* ============================
   TARJETAS DE PRODUCTOS
   ============================ */
.product-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.product-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    border: 1px solid #e9ecef;
    width: 100%;
}

.product-card:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.product-card-header {
    background: #f8f9fa;
    color: #212529;
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
}

.product-card-body {
    padding: 0.75rem 1rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem 1rem;
}

.product-info-row {
    display: flex;
    margin-bottom: 0.15rem;
    font-size: 0.85rem;
    align-items: baseline;
}

.product-info-label {
    flex: 0 0 100px;
    font-weight: 700;
    color: #2c3e50;
    white-space: nowrap;
    margin-right: 8px; /* espacio entre label y valor */
}

.product-info-value {
    flex: 1;
    color: #1e293b;
    word-break: break-word;
}

/* Bloque de concentraciones con borde azul */
.concentraciones-block {
    grid-column: span 2;
    background: #f8f9fa;
    border-left: 4px solid #0d6efd; /* borde azul */
    border-radius: 0 6px 6px 0; /* solo bordes derechos redondeados */
    padding: 0.5rem 0.75rem;
    margin-top: 0.25rem;
    font-size: 0.85rem;
}

.concentraciones-block .fw-bold {
    display: block;
    margin-bottom: 0.25rem;
}

.concentraciones-lista {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.concentracion-item {
    background: #e9ecef;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #2c3e50;
}

/* Botones de acción con borde de color y fondo transparente */
.card-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon-edit {
    background: transparent;
    border: 2px solid #ffc107;
    color: #ffc107;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s;
}

.btn-icon-edit:hover {
    background: #ffc107;
    color: white;
    border-color: #ffc107;
}

.btn-icon-delete {
    background: transparent;
    border: 2px solid #dc3545;
    color: #dc3545;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s;
}

.btn-icon-delete:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* ============================
   CONSENTIMIENTO MODAL
   ============================ */

.cm-body-scroll {
    max-height: 60vh;
    overflow-y: auto;
    text-align: justify;
    font-size: 0.9rem;
    -webkit-overflow-scrolling: touch;
    padding: 1rem;
}

/* ============================
   DYNAMIC MODAL (Bootstrap) - DISEÑO ELEGANTE
   ============================ */

/* Backdrop con desenfoque suave */
.modal-backdrop.show {
    backdrop-filter: blur(4px);
    background-color: rgba(0, 0, 0, 0.5);
}

/* Contenedor del modal */
.modal.show .modal-dialog {
    transform: scale(1);
    transition: transform 0.2s ease-out;
}

.modal.show .modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 6px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Encabezado con gradiente según tipo */
.modal.show .modal-header {
    padding: 1.2rem 1.5rem;
    border-bottom: none;
    position: relative;
}

/* Gradientes personalizados para cada tipo de mensaje */
.modal.show .modal-header.bg-primary {
    background: linear-gradient(135deg, #4361ee, #3a0ca3) !important;
}
.modal.show .modal-header.bg-success {
    background: linear-gradient(135deg, #06d6a0, #118ab2) !important;
}
.modal.show .modal-header.bg-warning {
    background: linear-gradient(135deg, #ffbe0b, #fb5607) !important;
}
.modal.show .modal-header.bg-danger {
    background: linear-gradient(135deg, #e63946, #b5179e) !important;
}
.modal.show .modal-header.bg-info {
    background: linear-gradient(135deg, #4cc9f0, #4895ef) !important;
}

/* Título con icono */
.modal.show .modal-title {
    font-weight: 600;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal.show .modal-title i {
    font-size: 1.5rem;
}

/* Botón de cerrar personalizado */
.modal.show .btn-close {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.modal.show .btn-close:hover {
    opacity: 1;
}

/* Cuerpo del modal */
.modal.show .modal-body {
    padding: 2rem 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #2d3748;
}

/* Icono grande en mensajes de éxito */
.modal.show .modal-body .text-center i.display-4 {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Estilo para las alertas de error */
.modal.show .modal-body .alert {
    border: none;
    border-radius: 12px;
    padding: 1.2rem;
    margin: 0;
}

.modal.show .modal-body .alert ul {
    list-style: none;
    padding-left: 0;
    margin-top: 0.5rem;
}

.modal.show .modal-body .alert li {
    padding: 0.2rem 0;
    border-bottom: 1px dashed rgba(0,0,0,0.05);
}

.modal.show .modal-body .alert li:last-child {
    border-bottom: none;
}

/* Pie del modal */
.modal.show .modal-footer {
    padding: 1rem 1.5rem 1.5rem;
    border-top: none;
    justify-content: center;
}

.modal.show .modal-footer .btn {
    padding: 0.6rem 2rem;
    border-radius: 50px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.modal.show .modal-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Texto de auto‑cierre */
.modal.show .modal-footer small.text-muted {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: #6c757d;
    font-size: 0.85rem;
}

/* ─── Carnet frontal ─────────────────────────────────────── */
.carnet-id-card {
    width: 100%;
    max-width: 420px;
    border: 1px solid #bbb;
    border-radius: 8px;
    overflow: hidden;
    font-family: Arial, sans-serif;
    background: #fff;
    color: #111;
}

.cid-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 6px;
    border-bottom: 1px solid #e0e0e0;
    background: #fff;
}

.cid-gov-block { display: flex; flex-direction: column; align-items: center; }
.cid-gov-label { font-size: 7px; font-weight: 700; color: #c00; text-transform: uppercase; letter-spacing: 0.3px; line-height: 1.1; text-align: center; }
.cid-gov-sub   { font-size: 6px; color: #444; text-transform: uppercase; letter-spacing: 0.5px; }

.cid-logo      { flex-shrink: 0; }

.cid-title-block { margin-left: auto; text-align: right; }
.cid-subtitle    { font-size: 8px; color: #555; text-transform: uppercase; letter-spacing: 0.4px; }
.cid-main-title  { font-size: 14px; font-weight: 900; color: #111; line-height: 1.1; text-transform: uppercase; }

.cid-body { display: flex; padding: 10px 12px 8px; }

.cid-photo-col  { width: 90px; flex-shrink: 0; }
.cid-photo      { width: 90px; height: 110px; object-fit: cover; border-radius: 3px; display: block; }
.cid-photo-placeholder {
    width: 90px; height: 110px;
    background: #e8e8e8; border-radius: 3px;
    display: flex; align-items: center; justify-content: center;
}
.cid-acomp-badge {
    background: #222; color: #fff;
    font-size: 7px; font-weight: 700;
    text-align: center; padding: 3px 2px;
    text-transform: uppercase; letter-spacing: 0.4px;
    margin-top: 4px; border-radius: 2px;
}

.cid-fields-col { flex: 1; padding-left: 12px; display: flex; flex-direction: column; gap: 5px; }
.cid-field      { display: flex; flex-direction: column; }
.cid-lbl        { font-size: 7px; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: 0.4px; }
.cid-val        { font-size: 11px; font-weight: 700; color: #111; line-height: 1.2; }
.cid-val-sm     { font-size: 9px; }
.cid-dates-row  { display: flex; gap: 10px; }
.cid-dates-row .cid-field { flex: 1; }
.cid-firma      {
    font-size: 8px; font-weight: 700; text-align: right;
    color: #444; text-transform: uppercase; letter-spacing: 0.3px;
    border-top: 1px solid #555; padding-top: 2px; margin-top: 2px;
    line-height: 1.3;
}

.cid-footer {
    height: 30px;
    background: linear-gradient(to right, #1a6b3a, #3aaa6a, #7dd18a);
    position: relative; overflow: hidden;
}
.cid-footer svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

/* ─── Reverso ────────────────────────────────────────────── */
.cid-reverso {
    width: 100%;
    max-width: 420px;
    border: 1px solid #bbb;
    border-radius: 8px;
    overflow: hidden;
    font-family: Arial, sans-serif;
    background: #fff;
    display: flex;
}

.cid-rev-numero {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 9px; font-weight: 700;
    letter-spacing: 1.5px; color: #fff;
    background: #1a6b3a;
    padding: 12px 7px;
    white-space: nowrap;
    flex-shrink: 0;
}

.cid-rev-body    { flex: 1; padding: 12px; }
.cid-rev-decreto { font-size: 10px; font-weight: 700; margin-bottom: 8px; text-transform: uppercase; }
.cid-rev-content { display: flex; gap: 10px; align-items: flex-start; }
.cid-rev-text    { font-size: 8px; color: #333; line-height: 1.5; flex: 1; font-style: italic; }
.cid-qr-img      { width: 72px; height: 72px; flex-shrink: 0; border: 1px solid #ccc; }

.validation-summary-errors ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

/* ─── RESPONSIVE BOTONES ──────────────────────────────── */
@media (max-width: 576px) {
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }
    .d-flex.justify-content-between {
        flex-direction: column;
    }
    .gap-2 {
        gap: 0.5rem !important;
    }
}

/* ─── RESPONSIVE CARNET VISUAL (carnetdetalle.razor) ─── */
@media (max-width: 576px) {
    .carnet-id-card .cid-body {
        flex-direction: column;
        align-items: center;
    }
    .cid-photo-col {
        margin-bottom: 1rem;
    }
    .cid-photo-col img,
    .cid-photo-placeholder {
        width: 120px !important;
        height: 120px !important;
    }
    .cid-fields-col {
        width: 100%;
    }
    .cid-lbl {
        font-size: 0.6rem;
    }
    .cid-val {
        font-size: 0.75rem;
    }
    .cid-dates-row {
        flex-direction: column;
    }
    .carnet-id-card {
        margin: 0.5rem;
    }
}

/* ─── RESPONSIVE CARNET PÚBLICO (verificacion.razor) ─── */
@media (max-width: 576px) {
    .carnet-modern .carnet-front .row {
        flex-direction: column;
    }
    .carnet-modern .carnet-photo {
        width: 120px !important;
        margin: 0 auto 1rem auto !important;
    }
    .carnet-modern .carnet-value {
        font-size: 0.75rem;
    }
    .carnet-modern .carnet-label {
        font-size: 0.6rem;
    }
    .carnet-modern .carnet-header .col-4,
    .carnet-modern .carnet-header .col-8 {
        width: 100%;
        text-align: center;
    }
    .carnet-modern .carnet-logo {
        max-height: 50px;
    }
    .carnet-modern .carnet-title {
        font-size: 1rem;
    }
}

/* Contenedor de campos: grid adaptable */
.cid-fields-col {
    display: grid;
    grid-template-columns: 1fr;          /* una columna por defecto */
    gap: 6px 12px;
}

/* En pantallas medianas y grandes, dos columnas */
@media (min-width: 576px) {
    .cid-fields-col {
        grid-template-columns: 1fr 1fr;
    }
    /* los elementos que queramos que ocupen el ancho completo se lo indicamos después */
}

/* Ajuste de los campos individuales */
.cid-field {
    margin-bottom: 2px;   /* reduce espacio vertical */
}

/* Si algún campo debe ocupar tode el ancho (ej. dirección) */
.cid-field.wide {
    grid-column: 1 / -1;   /* ocupa ambas columnas */
}

/* ─── MÓVIL (default) ───────────────────────────────── */
.cid-body {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.cid-photo-col {
    width: 100%;
    max-width: 180px;
    margin: 0 auto;
}

.cid-photo {
    width: 100%;
    height: auto;
    aspect-ratio: 3/4;   /* mantiene proporción tipo carnet */
}

.cid-fields-col {
    grid-template-columns: 1fr;   /* una sola columna */
    gap: 0.5rem;
    width: 100%;
}

.cid-lbl { font-size: 0.55rem; }
.cid-val { font-size: 0.7rem; }

/* Badge del acompañante */
.cid-acomp-badge-custom {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    margin-top: 0.5rem;
}

/* ─── TABLET (576 px – 991 px) ──────────────────────── */
@media (min-width: 576px) and (max-width: 991.98px) {
    .cid-body {
        flex-direction: row;          /* foto y datos lado a lado */
        align-items: flex-start;
        gap: 1.5rem;
    }

    .cid-photo-col {
        width: 40%;
        max-width: 160px;
        flex-shrink: 0;
    }

    .cid-fields-col {
        grid-template-columns: 1fr 1fr;    /* 2 columnas */
        gap: 0.5rem 1rem;
    }

    .cid-lbl { font-size: 0.6rem; }
    .cid-val { font-size: 0.75rem; }
}

/* ─── PC (≥992 px) ─────────────────────────────────── */
@media (min-width: 992px) {
    .cid-body {
        flex-direction: row;
        align-items: flex-start;
        gap: 2rem;
    }

    .cid-photo-col {
        width: 35%;
        max-width: 200px;
    }

    .cid-fields-col {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem 1.5rem;
    }

    .cid-lbl { font-size: 0.6rem; }
    .cid-val { font-size: 0.8rem; }

    /* Opcional: agrandar ligeramente el carnet */
    .carnet-front {
        max-width: 700px;
        margin: 0 auto;
    }

    /* ================== TAMAÑO ESTÁNDAR HORIZONTAL ================== */
    .carnet-uniforme {
        width: 100%;
        max-width: 500px;           /* ancho fijo en desktop */
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    /* Frontal – dimensiones tipo carnet */
    .carnet-uniforme .carnet-id-card {
        width: 100%;
        height: 280px;              /* más bajo que antes */
        background: #fff;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        display: flex;
        flex-direction: column;
    }

    /* Reverso – más compacto */
    .carnet-uniforme .cid-reverso {
        width: 100%;
        height: 90px;
        background: #fff;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }

    /* Ajustes internos del frontal para aprovechar el espacio horizontal */
    .carnet-uniforme .cid-header {
        padding: 6px 12px;
        gap: 8px;
    }
    .carnet-uniforme .cid-logo {
        width: 80px;               /* logo más pequeño */
    }
    .carnet-uniforme .cid-main-title {
        font-size: 12px;
    }
    .carnet-uniforme .cid-subtitle {
        font-size: 7px;
    }

    .carnet-uniforme .cid-body {
        flex: 1;
        display: flex;
        flex-direction: row;       /* foto + campos lado a lado */
        padding: 8px 12px;
        gap: 16px;
    }

    .carnet-uniforme .cid-photo-col {
        width: 85px;
        flex-shrink: 0;
    }
    .carnet-uniforme .cid-photo {
        width: 85px;
        height: 105px;
        object-fit: cover;
    }
    .carnet-uniforme .cid-photo-placeholder {
        width: 85px;
        height: 105px;
    }

    .carnet-uniforme .cid-fields-col {
        flex: 1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px 12px;
    }

    .carnet-uniforme .cid-field {
        margin-bottom: 0;
    }
    .carnet-uniforme .cid-field.wide {
        grid-column: span 2;
    }

    .carnet-uniforme .cid-lbl {
        font-size: 7px;
    }
    .carnet-uniforme .cid-val {
        font-size: 10px;
        font-weight: 600;
    }
    .carnet-uniforme .cid-val-sm {
        font-size: 8px;
    }

    /* Badge acompañante */
    .carnet-uniforme .cid-acomp-badge {
        font-size: 6px;
        padding: 2px;
        margin-top: 4px;
    }

    /* Reverso contenido */
    .carnet-uniforme .cid-reverso {
        display: flex;
        flex-direction: row;
    }
    .carnet-uniforme .cid-rev-numero {
        writing-mode: vertical-rl;
        transform: rotate(180deg);
        font-size: 8px;
        padding: 8px 5px;
        background: #1a6b3a;
        color: white;
    }
    .carnet-uniforme .cid-rev-body {
        padding: 6px 10px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .carnet-uniforme .cid-rev-decreto {
        font-size: 8px;
        margin-bottom: 2px;
    }
    .carnet-uniforme .cid-rev-text {
        font-size: 7px;
        line-height: 1.3;
        margin: 0;
    }
    .carnet-uniforme .cid-qr-img {
        width: 60px;
        height: 60px;
    }

    /* Móviles: reducir ligeramente pero mantener proporción */
    @media (max-width: 576px) {
        .carnet-uniforme {
            max-width: 100%;
        }
        .carnet-uniforme .carnet-id-card {
            height: 260px;
        }
        .carnet-uniforme .cid-body {
            gap: 8px;
            padding: 6px;
        }
        .carnet-uniforme .cid-photo-col {
            width: 70px;
        }
        .carnet-uniforme .cid-photo {
            width: 70px;
            height: 90px;
        }
        .carnet-uniforme .cid-fields-col {
            gap: 4px 8px;
        }
        .carnet-uniforme .cid-lbl {
            font-size: 6px;
        }
        .carnet-uniforme .cid-val {
            font-size: 9px;
        }
        .carnet-uniforme .cid-reverso {
            height: 80px;
        }
    }

    /* Impresión – para que salga bien en papel */
    @media print {
        .carnet-uniforme {
            max-width: 500px;
            break-inside: avoid;
        }
        .carnet-uniforme .carnet-id-card,
        .carnet-uniforme .cid-reverso {
            box-shadow: none;
            border: 1px solid #ccc;
        }
    }
}