html {
    font-size: 14px;
}

body {
    font-family: sans-serif;
    margin: 0;
    background-color: #f9f9f9;
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
    display: none;
}

body.auth-ok {
    display: block;
}

header {
    display: flex;
    align-items: center;
    background-color: #a8c8f0;
    gap: 1rem;
    padding: 1rem;
    justify-content: center;
}

header img {
    height: 80px;
}

header h1 {
    margin: 0;
    font-size: 3rem;
    color: #003366;
}

.config-bar {
    background-color: #fdd9cc;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

main {
    padding: 20px 0;
}

.panel {
    flex: 0 0 50%;
    max-width: 50%;
    background-color: #ffffff;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
}

h2 {
    font-size: 1.2rem;
    margin-top: 0;
}

.panel h2 {
    min-height: 3em;
    /* ajusta según tamaño de fuente */
    display: flex;
    align-items: flex-end;
}


table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th {
    background-color: #f5a9a9;
    color: #600000;
    text-align: left;
    padding: 8px;
}

td {
    padding: 8px;
    border-bottom: 1px solid #ddd;
}

button {
    padding: 4px 8px;
    height: auto;
    line-height: 1.2;
    font-weight: bold;
    border: none;
    outline: none;
    border-radius: 4px;
    font-size: 1rem;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: background-color 0.2s transform, 0.2s;
}

button:hover {
    background-color: #dcdcdc;
    transform: scale(1.05);
}

input,
select {
    border: none;
    outline: none;
    border-radius: 6px;
    font-size: 1rem;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
}

input:focus,
select:focus {
    box-shadow: 0 0 3px #aaa;
}

#resultadoInput,
#guardarBtn {
    display: none;
}

.alerta {
    background-color: #ffdddd;
    color: #a33;
    padding: 10px;
    margin: 10px;
    border: 1px solid #a33;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
}

footer {
    background-color: #a8c8f0;
    color: #333;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
    margin-top: 2rem;
    border-top: 1px solid #ccc;
}

footer p {
    margin: 0.3rem 0;
}

#panelResultados {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

#panelAspectacion {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
}

#panelAspectacion .panel {
    flex: 0 0 50%;
    max-width: 50%;
    box-sizing: border-box;
}

#tablaPiramide {
    border-collapse: collapse;
    margin: 1rem auto;
    width: auto;
    max-width: 100%;
}

#tablaPiramide td {
    text-align: center;
    vertical-align: middle;
    border: 1px solid #ccc;
    width: 0.8rem;
    height: 0.8rem;
    font-size: 0.8rem;
    font-weight: bold;
    color: #333;
    background-color: #f9f9f9;
}

#tablaPiramide td.vacio {
    border: none;
    background-color: transparent;
}

.grid-submatrices {
    display: grid;
    grid-template-columns: repeat(6, auto);
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.submatriz table {
    border-collapse: collapse;
}

.submatriz td {
    text-align: center;
    border: 1px solid #ccc;
    width: 0.8rem;
    height: 0.8rem;
    font-size: 0.8rem;
}

.submatriz td.vacio {
    border: none;
    background-color: transparent;
}

.resaltado {
    background-color: #ffefc5;
    font-weight: bold;
    color: #000;
}

.submatriz td.resaltado {
    background-color: #ffefc5 !important;
    font-weight: bold;
    color: #000;
    border: 2px solid #ffa500;
}

.info-anterior {
    font-size: 0.95rem;
    font-style: italic;
    color: #555;
    margin: 0.5rem 0 0.5rem 0;
    text-align: center;
}

.modal {
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-contenido {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.modal-cerrar {
    float: right;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    margin-top: -10px;
    margin-right: -10px;
}

.modal-cerrar:hover {
    color: #000;
}

.modal-botones {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.modal-botones button {
    padding: 6px 12px;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    background-color: #a8c8f0;
    color: #003366;
    cursor: pointer;
}

.modal-botones button:hover {
    background-color: #84b1e0;
}

.tab-panel {
    display: none;
}

.tab-panel.activo {
    display: flex;
    flex-direction: row;
}

.cerrar-sesion {
    font-size: 0.85em;
    color: #333;
    text-decoration: none;
    margin-left: auto;
    padding: 5px 10px;
}

.cerrar-sesion:hover {
    color: #a00;
    text-decoration: underline;
}


@media (max-width: 991px) {
    body {
        max-width: 100%;
        padding: 0 10px;
    }

    .panel {
        flex: 1 1 100%;
        max-width: 100%;
    }

    main {
        padding: 10px 0;
    }

    .config-bar {
        flex-direction: column;
        align-items: stretch;
    }

    #panelResultados,
    #panelAspectacion {
        flex-direction: column;
    }
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
}

.login-form {
    background: white;
    padding: 2em;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 300px;
}

.login-form input {
    width: 100%;
    padding: 0.8em;
    margin-bottom: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.login-form button {
    padding: 0.8em;
    width: 100%;
    background-color: #004d99;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.login-form button:hover {
    background-color: #0066cc;
}

#mensajeError {
    color: #a94442;
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    padding: 10px;
    margin-bottom: 1em;
    border-radius: 4px;
    display: none;
    text-align: center;
    font-size: 0.9em;
}

.login-logo {
    height: 80px;
    margin-bottom: 1rem;
}

body.login-visible {
    display: block;
}

#canvasDibujo {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1000;
    pointer-events: auto;
}

.menu-canvas li:hover {
    background-color: #f0f0f0;
}