* {
    box-sizing: border-box;
}


:root {
    --bg: #ffffff;
    --panel: #f8f9fa;
    --text: #212529;
    --muted: #6c757d;
    --border: #ced4da;

    --button: #0d6efd;
    --button-hover: #0b5ed7;

    --locator: #50ec5d;

    --table-even: #ffffff;
    --table-odd: #f8f9fa;

    --table-head: #6c757d;
    --table-head-text: #ffffff;
}


body.dark {
    --bg: #222222;
    --panel: #343a40;
    --text: #f1f1f1;
    --muted: #adb5bd;
    --border: #666666;

    --button: #375a7f;
    --button-hover: #2f4e70;

    --locator: #50ec5d;

    --table-even: #222222;
    --table-odd: #343434;

    --table-head: #375a7f;
    --table-head-text: #ffffff;
}


html,
body {
    margin: 0;
    min-height: 100%;

    font-family: "Segoe UI", Arial, sans-serif;

    background: var(--bg);
    color: var(--text);
}


body {
    min-width: 900px;
}


.app-shell {
    min-height: 100vh;

    padding: 14px 22px;
}


.app-content {
    width: 100%;

    min-height: calc(100vh - 28px);

    display: flex;
    flex-direction: column;
}


/* ========================================================= */
/* CABECERA                                                   */
/* ========================================================= */

.top-panel {
    min-height: 68px;

    padding: 16px;

    background: var(--panel);

    border-radius: 6px;

    display: grid;

    grid-template-columns: 1fr auto 1fr;

    align-items: center;

    margin-bottom: 12px;
}


.top-center {
    grid-column: 2;

    display: flex;

    align-items: center;

    gap: 12px;

    white-space: nowrap;
}


.info-label {
    font-size: 17px;

    font-weight: 700;
}


/* ========================================================= */
/* BOTONES                                                    */
/* ========================================================= */

.btn,
.theme-button {
    border: 1px solid var(--border);

    border-radius: 5px;

    background: var(--button);

    color: white;

    font-family: inherit;

    cursor: pointer;

    transition: background .15s ease;
}


.btn {
    min-height: 38px;

    padding: 7px 16px;

    font-size: 14px;
}


.btn:hover:not(:disabled),
.theme-button:hover {
    background: var(--button-hover);
}


.btn:disabled {
    opacity: .55;

    cursor: default;
}


.theme-button {
    grid-column: 3;

    justify-self: end;

    width: 42px;

    height: 38px;

    font-size: 18px;
}


/* ========================================================= */
/* FORMULARIO                                                 */
/* ========================================================= */

.form-frame {
    width: 900px;

    max-width: 100%;

    margin: 0 auto;
}


.field {
    display: flex;

    flex-direction: column;
}


.field label {
    text-align: center;

    font-size: 16px;

    font-weight: 700;

    margin-bottom: 5px;
}


.operator-field {
    margin-bottom: 10px;
}


.two-columns {
    display: grid;

    grid-template-columns:
        minmax(0, 8fr)
        minmax(150px, 1fr);

    column-gap: 18px;
}


.large-input {
    width: 100%;

    min-height: 38px;

    padding: 7px 10px;

    border: 1px solid var(--border);

    border-radius: 4px;

    background: var(--bg);

    color: var(--text);

    font: 12px "Segoe UI", Arial, sans-serif;

    outline: none;
}


.large-input:focus {
    border-color: var(--button);
}


.operator-field .large-input {
    font-size: 16px;

    text-align: center;
}


.locator-input {
    background: var(--locator);

    color: #000;

    border-color: #777;

    text-align: center;
}


/* ========================================================= */
/* ACCIONES                                                   */
/* ========================================================= */

.actions {
    display: flex;

    justify-content: center;

    gap: 12px;

    margin: 14px 0 8px;
}


/* ========================================================= */
/* TABLA                                                      */
/* ========================================================= */

.preview-section {
    flex: 1;

    min-height: 0;

    display: flex;

    flex-direction: column;
}


.preview-section h2 {
    margin: 0 0 4px 6px;

    font-size: 16px;
}


.table-wrapper {
    flex: 1;

    min-height: 300px;

    overflow: auto;

    border: 1px solid var(--border);
}


table {
    border-collapse: collapse;

    width: max-content;

    min-width: 100%;

    font-size: 12px;
}


th,
td {
    border: 1px solid var(--border);

    padding: 5px 10px;

    text-align: center;

    white-space: nowrap;

    height: 24px;
}


th {
    position: sticky;

    top: 0;

    z-index: 2;

    background: var(--table-head);

    color: var(--table-head-text);

    font-weight: 700;
}


tbody tr:nth-child(even) {
    background: var(--table-even);
}


tbody tr:nth-child(odd) {
    background: var(--table-odd);
}


/* ========================================================= */
/* PIE                                                        */
/* ========================================================= */

.footer {
    padding: 8px;

    margin-top: 8px;

    text-align: center;

    font-size: 12px;
}


.footer a {
    color: inherit;

    text-decoration: none;
}


.footer a:hover {
    text-decoration: underline;
}


/* ========================================================= */
/* VENTANA AVISO MY_GRIDSQUARE                                */
/* ========================================================= */

.modal-backdrop {
    position: fixed;

    inset: 0;

    z-index: 1000;

    display: flex;

    align-items: center;

    justify-content: center;

    background: rgba(0, 0, 0, 0.45);
}


.modal-backdrop[hidden] {
    display: none;
}


.modal-box {
    width: 650px;

    max-width: calc(100vw - 40px);

    padding: 22px 24px 20px;

    background: var(--bg);

    color: var(--text);

    border: 1px solid var(--border);

    border-radius: 6px;

    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.3);

    text-align: center;
}


.modal-box h3 {
    margin: 0 0 14px;

    font-size: 17px;

    line-height: 1.35;
}


.warning-text {
    margin: 0 0 14px;

    font-size: 14px;

    line-height: 1.45;
}


.question-text {
    margin: 0 0 12px;

    font-size: 14px;
}


.modal-explanation {
    font-size: 13px;

    line-height: 1.45;
}


.modal-explanation p {
    margin: 6px 0;
}


.modal-actions {
    display: flex;

    justify-content: center;

    gap: 12px;

    margin-top: 20px;
}


.modal-btn {
    min-width: 75px;

    min-height: 36px;

    padding: 6px 18px;

    border: 1px solid var(--border);

    border-radius: 5px;

    background: var(--button);

    color: #fff;

    font: 14px "Segoe UI", Arial, sans-serif;

    cursor: pointer;
}


.modal-btn:hover {
    background: var(--button-hover);
}


/* ========================================================= */
/* AJUSTE ALTURAS                                             */
/* ========================================================= */

@media (max-height: 750px) {

    .table-wrapper {
        min-height: 220px;
    }

}
/* Contraste y adaptación a teléfonos y tabletas, 08/10/2026. */
:root {--muted:#515d69;--button:#1857b7;--button-hover:#12458f;--table-head:#475566}
body.dark {color-scheme:dark;--muted:#c5d1df;--button:#24578c;--button-hover:#306ba6;--table-head:#264d77;--border:#8796a6}
body {min-width:0}
body,.form-frame,.app-content {max-width:100%}
input::placeholder {color:var(--muted);opacity:1}
.large-input {font-size:16px}
.btn:disabled {opacity:1;background:var(--panel);color:var(--muted);border-color:var(--border);cursor:not-allowed}
.btn,.theme-button,.modal-btn {min-height:44px}
.modal-box {background:var(--panel);color:var(--text);max-height:calc(100dvh - 24px);overflow:auto}
.modal-explanation,.question-text {color:var(--text)}
.btn:focus-visible,.theme-button:focus-visible,.modal-btn:focus-visible,.large-input:focus-visible {outline:3px solid #9c65c9;outline-offset:3px}
.table-wrapper {max-width:100%;overscroll-behavior-x:contain}
.info-label {overflow-wrap:anywhere}
@media(max-width:1024px) {.app-shell{padding:12px}.top-panel{grid-template-columns:minmax(0,1fr) auto}.top-center{grid-column:1;white-space:normal;flex-wrap:wrap}.theme-button{grid-column:2}.form-frame{width:100%}}
@media(max-width:700px) {.two-columns{grid-template-columns:1fr;gap:12px}.actions,.modal-actions{flex-wrap:wrap}.app-shell{padding:10px}.table-wrapper{min-height:220px}.preview-section{min-width:0}.top-panel{padding:12px}}