* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f5f7;
    color: #1f2937;
}

.cabecera {
    background: #1f3a68;
    color: #fff;
    padding: 30px 20px;
}

.contenedor {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 12px;
}

.cabecera .contenedor {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 12px;
}

.cabecera h1 {
    margin: 0 0 10px 0;
    font-size: 32px;
}

.cabecera p {
    margin: 8px 0;
    line-height: 1.5;
}

.bloque {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    padding: 24px;
    margin: 30px 0;
}

.bloque h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 24px;
}

.bloque h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
}

.subtexto {
    color: #6b7280;
    line-height: 1.5;
}

.panel-fase {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.paso {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px;
    background: #fafafa;
}

.campo {
    margin-bottom: 14px;
}

label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
}

input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #fff;
}

.acciones {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.boton {
    display: inline-block;
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
}

.boton.primario {
    background: #1f3a68;
    color: #fff;
}

.boton.secundario {
    background: #6b7280;
    color: #fff;
}

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

.visor-wrapper,
.resultado-wrapper {
    margin-top: 15px;
}

.visor-vacio {
    width: 100%;
    min-height: 420px;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    text-align: center;
    padding: 20px;
}

.visor-vacio.pequeno {
    min-height: 220px;
}

.visor-imagen {
    width: 100%;
    min-height: 420px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #fff;
    padding: 15px;
    overflow: hidden;
}

.visor-imagen img {
    display: block;
    max-width: 100%;
}

.resultado-marcado {
    width: 100%;
    min-height: 220px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #fff;
    padding: 15px;
    text-align: center;
}

.marcador-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
}

.marcador-container img {
    display: block;
    max-width: 100%;
    max-height: 520px;
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 8px;
}

.marcador-container canvas {
    position: absolute;
    top: 8px;
    left: 8px;
    cursor: crosshair;
}

.instruccion-punto {
    margin-bottom: 14px;
    display: inline-block;
    padding: 10px 14px;
    border-radius: 10px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: bold;
}

.lista-puntos {
    margin: 10px 0 0 0;
    padding-left: 18px;
    color: #374151;
    line-height: 1.5;
}

.lista-puntos li {
    margin-bottom: 6px;
}

.resumen-puntos {
    margin-top: 16px;
}

.resumen-puntos h4 {
    margin-bottom: 10px;
}

.resumen-fase {
    border: 1px solid #d1fae5;
    background: #f0fdf4;
    border-radius: 12px;
    padding: 14px;
    margin-top: 16px;
}

.resumen-fase p {
    margin: 6px 0;
}

.oculto {
    display: none;
}

.analisis-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.analisis-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fafafa;
    padding: 16px;
}

.analisis-card h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

.analisis-imagen-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
    line-height: 0;
    text-align: center;
}

.analisis-imagen {
    display: block;
    width: 100%;
    max-width: 100%;
    border: 1px solid #d1d5db;
    background: #fff;
    padding: 8px;
}

.analisis-canvas {
    position: absolute;
    top: 8px;
    left: 8px;
    pointer-events: none;
}

.tabla-scroll {
    overflow-x: auto;
}

.tabla-analisis {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.tabla-analisis th,
.tabla-analisis td {
    border: 1px solid #d1d5db;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.tabla-analisis th {
    background: #f3f4f6;
}

.texto-interpretacion {
    font-size: 16px;
    line-height: 1.7;
}

@media (max-width: 1100px) {
    .analisis-grid {
        grid-template-columns: 1fr;
    }
}

.crop-stage {
    position: relative;
    width: 100%;
    min-height: 420px;
    background: #f3f4f6;
    overflow: hidden;
    border: 1px solid #d1d5db;
    border-radius: 8px;
}

.crop-stage img {
    display: block;
    max-width: 100%;
}

.crop-stage .cropper-container {
    max-width: 100% !important;
}

.overlay-referencia {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    opacity: 0.35;
    z-index: 20;
    mix-blend-mode: multiply;
}

.controles-overlay {
    margin-top: 14px;
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #dbe3ea;
    border-radius: 8px;
}

.campo-check {
    margin-bottom: 10px;
}

.analisis-grid.registradas .analisis-imagen-wrap {
    background: #ffffff;
}

.badge-metodo {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e8f0fe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
}