/* ================================================
   GENERAL
================================================ */
body {
    font-size: 14px;
}

.login-container {
    min-height: 100vh;
}

.login-card {
    max-width: 420px;
    width: 100%;
    border-radius: 14px;
}

.card-resumen {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.titulo-seccion {
    font-weight: 700;
    color: #0d6efd;
}

.badge-fase {
    font-size: 0.9rem;
}

.table td,
.table th {
    vertical-align: middle;
}

.modal-body strong {
    color: #0d6efd;
}


/* ================================================
   SELECTOR DE MODELOS DE ETIQUETA
================================================ */

#grupoModelos {
    gap: 10px;
}

.modelo-card {
    cursor: pointer;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 8px 10px 6px;
    min-width: 90px;
    text-align: center;
    background: #fff;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    user-select: none;
}

.modelo-card:hover {
    border-color: #0d6efd;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.15);
}

.modelo-card.selected {
    border-color: #0d6efd;
    background: #eef4ff;
    box-shadow: 0 2px 10px rgba(13, 110, 253, 0.2);
}

.modelo-label {
    font-size: 12px;
    font-weight: 700;
    color: #0d6efd;
    line-height: 1.2;
}

.modelo-desc {
    font-size: 10px;
    color: #6c757d;
    margin-bottom: 5px;
    line-height: 1.2;
}

/* Miniaturas esquemáticas dentro de las tarjetas de modelo */
.modelo-mini {
    width: 64px;
    height: 32px;
    border: 1px solid #adb5bd;
    border-radius: 3px;
    background: #f8f9fa;
    margin: 0 auto;
    overflow: hidden;
    box-sizing: border-box;
    padding: 2px;
}

/* Barra de header */
.mm-header {
    height: 5px;
    background: #adb5bd;
    border-radius: 2px;
    margin-bottom: 2px;
}

.mm-body {
    display: flex;
    gap: 2px;
    align-items: center;
}

/* Bloque QR esquemático */
.mm-qr {
    width: 14px;
    min-width: 14px;
    height: 18px;
    background: #6c757d;
    border-radius: 1px;
}

.mm-qr-lg {
    width: 18px;
    min-width: 18px;
    height: 26px;
}

.mm-qr-xl {
    width: 22px;
    min-width: 22px;
    height: 26px;
}

/* Líneas de texto esquemáticas */
.mm-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
}

.mm-lines span {
    display: block;
    height: 3px;
    background: #ced4da;
    border-radius: 1px;
    width: 100%;
}

.mm-lines span.bold {
    background: #6c757d;
    height: 4px;
}

.mm-lines-min span {
    height: 4px;
}

/* Barra footer */
.mm-footer {
    height: 4px;
    background: #adb5bd;
    border-radius: 2px;
    margin-top: 2px;
}


/* ================================================
   PREVISUALIZACIÓN DE ETIQUETA EN PANTALLA
================================================ */

.previsualizacion-wrapper {
    display: inline-block;
    border: 2px dashed #0d6efd;
    border-radius: 6px;
    padding: 10px 12px;
    background: #f0f5ff;
}

/*
 * Escala visual: la etiqueta real es 48×24mm.
 * Mostramos a escala 3× para que sea legible en pantalla.
 * 48mm × 3 ≈ 181px  /  24mm × 3 ≈ 91px
 */
.preview-scale-wrapper {
    transform: scale(3);
    transform-origin: top left;
    width: 48mm;
    height: 24mm;
    /* El espacio que ocupa la versión escalada en el flujo */
    margin-bottom: calc(24mm * 2);
    margin-right: calc(48mm * 2);
}


/* Ocultar el contenedor de impresión en pantalla normal */
#contenedorEtiquetasImpresion {
    display: none;
}

.config-box {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 14px;
    background: #fff;
}

.config-title {
    font-weight: 700;
    color: #0d6efd;
    margin-bottom: 12px;
}

.preview-safe-area {
    outline: 0.4mm dashed #0d6efd;
    outline-offset: 0;
    background: rgba(13, 110, 253, 0.03);
}

.previsualizacion-wrapper {
    display: inline-block;
    border: 2px dashed #0d6efd;
    border-radius: 6px;
    padding: 10px 12px;
    background: #f0f5ff;
    min-width: 220px;
    min-height: 120px;
}

.preview-scale-wrapper {
    transform: scale(3);
    transform-origin: top left;
    width: 48mm;
    height: 24mm;
    margin-bottom: calc(24mm * 2);
    margin-right: calc(48mm * 2);
}

.modelo-card {
    cursor: pointer;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 8px 12px;
    min-width: 110px;
    text-align: center;
    background: #fff;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    user-select: none;
}

.modelo-card:hover {
    border-color: #0d6efd;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.15);
}

.modelo-card.selected {
    border-color: #0d6efd;
    background: #eef4ff;
    box-shadow: 0 2px 10px rgba(13, 110, 253, 0.2);
}

.modelo-label {
    font-size: 12px;
    font-weight: 700;
    color: #0d6efd;
    line-height: 1.2;
}

.modelo-desc {
    font-size: 10px;
    color: #6c757d;
    line-height: 1.2;
}

/* Etiqueta */
.etiqueta-print {
    width: 48mm;
    height: 24mm;
    box-sizing: border-box;
    overflow: hidden;
    page-break-after: always;
    break-after: page;
}

.etiqueta-inner {
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.etq-header {
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.etq-middle {
    display: flex;
    align-items: center;
    flex: 1;
    overflow: hidden;
}

.etq-middle-full {
    height: 100%;
}

.etq-qr {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto;
    /* Caja CUADRADA de lado = alto disponible: el QR nunca se deforma. */
    height: 100%;
    aspect-ratio: 1 / 1;
}

.etq-qr canvas,
.etq-qr img {
    display: block;
    width: 100%;
    height: 100%;
    /* Mantiene el QR cuadrado dentro de su caja, sin estirarlo. */
    object-fit: contain;
}

.etq-data {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.etq-data-min {
    justify-content: center;
    gap: 0.5mm;
}

.etq-inst,
.etq-orden,
.etq-denominacion,
.etq-area,
.etq-anio,
.etq-codigo-b,
.etq-codigo-c,
.etq-footer {
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.etq-inst,
.etq-orden,
.etq-area,
.etq-anio,
.etq-codigo-b,
.etq-codigo-c,
.etq-footer {
    white-space: nowrap;
}

.etq-denominacion {
    word-break: break-word;
}

@media print {
    body * {
        visibility: hidden !important;
    }

    #contenedorEtiquetasImpresion,
    #contenedorEtiquetasImpresion * {
        visibility: visible !important;
    }

    #contenedorEtiquetasImpresion {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 48mm;
        margin: 0;
        padding: 0;
    }

    @page {
        size: 48mm 24mm;
        margin: 0;
    }

    .etiqueta-print {
        margin: 0;
    }
}
/* ===== Layout del panel CoreUI (Gestión Colegio) ===== */
@media (min-width: 992px){
    .wrapper{ margin-left: var(--cui-sidebar-width, 16rem); }
}
@media (max-width: 991.98px){
    .sidebar{ position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 1030;
              transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.show{ transform: translateX(0); }
    .wrapper{ margin-left: 0; }
}
.header.header-sticky{ background: #fff; }
.sidebar .nav-icon{ display:inline-block; width:1.5rem; text-align:center; margin-right:.4rem; }
