html {
    color-scheme: light dark;
    --fondo: #f7f7f2;
    --superficie: #fff;
    --texto: #21241f;
    --secundario: #51574e;
    --borde: #767e71;
    --accion: #245341;
    --sobre-accion: #fff;
}

@media (prefers-color-scheme: dark) {
    html {
        --fondo: #191d1a;
        --superficie: #242a25;
        --texto: #f2f4ee;
        --secundario: #c0c9be;
        --borde: #778475;
        --accion: #a4ddc0;
        --sobre-accion: #122c20;
    }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    background: var(--fondo);
    color: var(--texto);
    font: 1rem/1.5 system-ui, sans-serif;
    overflow-wrap: anywhere;
}

main {
    max-width: 54rem;
    margin: auto;
    padding: 1rem;
}

header, .acciones {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .65rem;
}

header {
    justify-content: space-between;
    padding-block: .5rem 1rem;
    border-bottom: 1px solid var(--borde);
}

h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }
section { margin-top: 1.5rem; }
section > h2, section > h3 { margin-bottom: .6rem; }
.lista { display: grid; gap: .65rem; margin-bottom: 1rem; }

article, #justificante, dialog {
    background: var(--superficie);
    border: 1px solid var(--borde);
    border-radius: .6rem;
    padding: 1rem;
    min-width: 0;
}

article > *, #datos-justificante > *, dialog > * { margin-bottom: .45rem; }
article > :last-child, #datos-justificante > :last-child { margin-bottom: 0; }
.detalle { color: var(--secundario); }
.estado { font-weight: 650; }
#mensaje:not(:empty) { margin-block: 1rem; }
#mensaje-dialogo:empty, #conversion:empty { display: none; }
#login { max-width: 24rem; }

form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .65rem;
    justify-items: start;
}

label { font-weight: 650; }

input, textarea, select, button {
    font: inherit;
    min-height: 44px;
    border: 1px solid var(--borde);
    border-radius: .35rem;
    padding: .5rem .65rem;
    max-width: 100%;
}

input, textarea, select {
    width: 100%;
    min-width: 0;
    color: var(--texto);
    background: var(--superficie);
}

textarea { resize: vertical; }
button { color: var(--texto); background: var(--superficie); cursor: pointer; }
button[type="submit"] { color: var(--sobre-accion); background: var(--accion); }
button:disabled { opacity: .6; cursor: default; }
a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accion); }
:focus-visible { outline: 2px solid var(--accion); outline-offset: 3px; }

dialog {
    color: var(--texto);
    width: min(32rem, calc(100% - 2rem));
    max-height: calc(100% - 2rem);
    overflow: auto;
}

dialog::backdrop { background: #0008; }
#elegir-offset { width: 100%; }
#elegir-offset select { margin-top: .4rem; }
