:root {
    --papel: #f3efe6;
    --hoja: #fffdf8;
    --tinta: #1e2430;
    --suave: #5c6570;
    --linea: #e4dccf;
    --verde: #1d6b4f;
    --verde-claro: #e7f3ec;
    --verde-propio: #3cb371;
    --ambar: #8a5a12;
    --ambar-claro: #fbf3e4;
    --rojo: #9d341f;
    --rojo-claro: #fdecea;
    --sombra: 0 12px 32px rgba(40, 32, 20, 0.07);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--tinta);
    background:
        radial-gradient(circle at top left, #efe4cf 0, transparent 36%),
        var(--papel);
    font-family: "Segoe UI", "Helvetica Neue", sans-serif;
    font-variant-numeric: tabular-nums;
    line-height: 1.45;
}

a {
    color: var(--verde);
}

:focus-visible {
    outline: 2px solid var(--verde);
    outline-offset: 2px;
}

.barra {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 0.85rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 253, 248, 0.94);
    border-bottom: 1px solid var(--linea);
}

.marca {
    justify-self: start;
    color: var(--tinta);
    font-weight: 750;
    text-decoration: none;
}

.marca::before {
    content: "";
    display: inline-block;
    width: 0.7rem;
    height: 0.7rem;
    margin-right: 0.45rem;
    border-radius: 3px;
    background: var(--verde);
    box-shadow: 0.32rem 0.32rem 0 #e0b15a;
    vertical-align: 0.05rem;
}

.menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.2rem;
}

.menu a {
    color: var(--suave);
    text-decoration: none;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
}

.menu a:hover,
.menu a.activo {
    color: var(--verde);
    background: var(--verde-claro);
}

.perfil {
    justify-self: end;
    position: relative;
}

.perfil summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.45rem 0.3rem 0.3rem;
    border-radius: 999px;
    list-style: none;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 750;
}

.perfil summary::-webkit-details-marker {
    display: none;
}

.perfil[open] summary {
    background: var(--verde-claro);
    color: var(--verde);
}

.icono-usuario {
    width: 1.85rem;
    height: 1.85rem;
    padding: 0.28rem;
    border-radius: 50%;
    background: var(--verde-claro);
    color: var(--verde);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.menu-perfil {
    position: absolute;
    right: 0;
    top: calc(100% + 0.4rem);
    min-width: 11.5rem;
    display: flex;
    flex-direction: column;
    padding: 0.35rem;
    border: 1px solid var(--linea);
    border-radius: 12px;
    background: var(--hoja);
    box-shadow: var(--sombra);
}

.menu-perfil a {
    display: block;
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    color: var(--tinta);
    text-decoration: none;
}

.menu-perfil a:hover {
    background: var(--verde-claro);
    color: var(--verde);
}

form.salir {
    margin: 0;
}

.pagina {
    width: min(920px, calc(100% - 2rem));
    margin: 1.75rem auto 3rem;
}

.pagina h1 {
    margin: 0 0 1rem;
    font-size: 1.7rem;
    letter-spacing: -0.02em;
}

.pagina.acceso .formulario,
.pagina.centrado .formulario,
.pagina.centrado .ficha {
    margin-inline: auto;
}

.pagina.acceso .formulario {
    width: min(100%, 26rem);
}

.formulario,
.ficha,
.aviso {
    max-width: 34rem;
    background: var(--hoja);
    border: 1px solid var(--linea);
    border-radius: 16px;
    padding: 1.4rem 1.35rem 1.2rem;
    box-shadow: var(--sombra);
}

.aviso {
    margin-inline: auto;
    border-color: #f0c9c1;
}

fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-inline-size: 0;
}

legend {
    padding: 0;
}

.formulario h1,
.aviso h1 {
    margin-top: 0;
}

.campo {
    margin: 0 0 0.9rem;
}

.campo label,
.opciones + .campo label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 650;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #d5cdbf;
    border-radius: 8px;
    background: #fff;
    color: var(--tinta);
    font: inherit;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--verde);
    outline: none;
    box-shadow: 0 0 0 3px rgba(29, 107, 79, 0.15);
}

.casilla {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.2rem 0 1rem;
}

.casilla label {
    font-weight: 500;
}

.opciones {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.opcion {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--linea);
    border-radius: 10px;
    background: #fff;
}

.opcion:has(input:checked) {
    border-color: var(--verde);
    background: var(--verde-claro);
}

input[type="submit"],
a.boton {
    display: inline-block;
    border: 0;
    border-radius: 8px;
    padding: 0.65rem 1.1rem;
    background: var(--verde);
    color: #fff;
    font: inherit;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}

input[type="submit"]:hover,
a.boton:hover {
    background: #18583f;
}

.aviso input[type="submit"] {
    background: var(--rojo);
}

.aviso input[type="submit"]:hover {
    background: #822b1a;
}

.menu-perfil input[type="submit"] {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--rojo);
    text-align: left;
}

.menu-perfil input[type="submit"]:hover {
    background: var(--rojo-claro);
}

.error,
.ok {
    margin: 0 0 1rem;
    padding: 0.7rem 0.85rem;
    border-radius: 8px;
}

.error {
    background: var(--rojo-claro);
    color: var(--rojo);
}

.ok {
    background: var(--verde-claro);
    color: var(--verde);
}

.ficha h2 {
    margin: 0.4rem 0 0.9rem;
    font-size: 1.15rem;
}

.pie {
    margin: 1rem 0 0;
    color: var(--suave);
}

.vacio {
    margin: 0;
    padding: 1rem 1.1rem;
    border: 1px dashed var(--linea);
    border-radius: 12px;
    background: var(--hoja);
    color: var(--suave);
}

.servicios,
.filas {
    list-style: none;
    margin: 0;
    padding: 0;
}

.servicios {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.servicios a {
    display: block;
    min-height: 5.5rem;
    padding: 1.15rem;
    border: 1px solid var(--linea);
    border-radius: 14px;
    background: var(--hoja);
    color: var(--tinta);
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--sombra);
}

.servicios a:hover {
    border-color: var(--verde);
}

.filas {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.filas li {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.9rem 1rem;
    border: 1px solid var(--linea);
    border-radius: 12px;
    background: var(--hoja);
}

.filas a.nombre {
    color: var(--tinta);
    font-weight: 700;
    text-decoration: none;
}

.filas a.nombre:hover {
    color: var(--verde);
}

.meta {
    margin: 0.15rem 0 0;
    color: var(--suave);
}

.estado {
    justify-self: start;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.estado.pagada {
    background: var(--verde-claro);
    color: var(--verde);
}

.estado.pendiente {
    background: var(--ambar-claro);
    color: var(--ambar);
}

.estado.pagada.propia {
    background: var(--verde-propio);
    color: #fff;
}

.estado.pendiente.propia {
    background: var(--rojo-claro);
    color: var(--rojo);
}

.acciones {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.acciones form {
    margin: 0;
}

.acciones a,
.acciones button {
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--linea);
    border-radius: 8px;
    color: var(--tinta);
    text-decoration: none;
    background: #fff;
    font: inherit;
    cursor: pointer;
}

.acciones button {
    border-color: var(--verde);
    background: var(--verde);
    color: #fff;
}

.acciones button:hover {
    background: #18583f;
}

.acciones a:hover {
    border-color: var(--verde);
    color: var(--verde);
}

.acciones a.peligro {
    color: var(--rojo);
    border-color: #f0c9c1;
}

.acciones a.peligro:hover {
    background: var(--rojo-claro);
}

.resumen {
    margin: 0 0 1rem;
    padding: 1rem 1.1rem;
    border-radius: 12px;
    background: var(--verde-claro);
}

.ficha dl {
    display: grid;
    gap: 0.85rem;
    margin: 0 0 1.2rem;
}

.ficha dt {
    color: var(--suave);
    font-size: 0.85rem;
}

.ficha dd {
    margin: 0.1rem 0 0;
    font-size: 1.15rem;
}

.ficha .acciones,
.aviso .acciones {
    margin-top: 1rem;
}

select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #d5cdbf;
    border-radius: 8px;
    background: #fff;
    color: var(--tinta);
    font: inherit;
}

.formulario.ancha {
    max-width: none;
    margin-bottom: 1.5rem;
}

.tableros {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tableros .tablero {
    margin-bottom: 0;
}

.tablero {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1.3rem;
    border: 1px solid var(--linea);
    border-radius: 16px;
    background: var(--hoja);
    box-shadow: var(--sombra);
}

.tablero h2 {
    margin: 0 0 0.35rem;
}

.torta {
    width: 210px;
    height: 210px;
    border-radius: 50%;
    background: conic-gradient(var(--verde) 0 var(--parte), #e0b15a 0);
}

.torta.propia {
    background: conic-gradient(var(--verde-propio) 0 var(--parte), #d36b5c 0);
}

.torta.vacia {
    background: var(--linea);
}

.leyenda {
    margin: 0.8rem 0 0;
    padding: 0;
    list-style: none;
}

.leyenda li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.35rem;
}

.muestra {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
}

.muestra.pagada {
    background: var(--verde);
}

.muestra.pendiente {
    background: #e0b15a;
}

.muestra.pagada.propia {
    background: var(--verde-propio);
}

.muestra.pendiente.propia {
    background: #d36b5c;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 30;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(30, 36, 48, 0.45);
}

.modal:target {
    display: flex;
}

.modal-caja {
    width: min(100%, 34rem);
    max-height: 80vh;
    overflow: auto;
    padding: 1.2rem;
    border-radius: 16px;
    background: var(--hoja);
    box-shadow: var(--sombra);
}

.modal-caja h2 {
    margin: 0 0 1rem;
}

.cerrar {
    color: var(--suave);
    text-decoration: none;
}

.tabla {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border: 1px solid var(--linea);
    border-radius: 12px;
    background: var(--hoja);
}

.tabla th,
.tabla td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--linea);
    text-align: left;
}

.tabla th {
    color: var(--suave);
    font-size: 0.85rem;
    font-weight: 650;
}

.tabla tr:last-child td {
    border-bottom: 0;
}

@media (max-width: 800px) {
    .barra {
        grid-template-columns: 1fr auto;
        padding: 0.85rem 1rem;
    }

    .menu {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .filas li {
        grid-template-columns: 1fr;
    }

    .tablero,
    .tableros {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .tabla {
        display: block;
        overflow-x: auto;
    }
}
