:root {
    color-scheme: light;
    --ink: #17211b;
    --muted: #69746e;
    --paper: #ffffff;
    --canvas: #f4f1ea;
    --line: #ddd8cc;
    --green: #145a3a;
    --green-soft: #e4f2e9;
    --red: #a52d2d;
    --red-soft: #fbe9e7;
    --gold: #b48731;
    --shadow: 0 18px 50px rgba(36, 45, 39, .10);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 0%, rgba(180, 135, 49, .12), transparent 32rem),
        radial-gradient(circle at 100% 30%, rgba(20, 90, 58, .10), transparent 30rem),
        var(--canvas);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }

.page {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0 72px;
}

.hero {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-bottom: 28px;
}

.hero__symbol {
    display: grid;
    place-items: center;
    flex: 0 0 76px;
    width: 76px;
    height: 76px;
    border: 1px solid rgba(180, 135, 49, .36);
    border-radius: 22px;
    background: rgba(255,255,255,.75);
    box-shadow: 0 8px 30px rgba(68, 58, 37, .08);
    font-size: 38px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--green);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1;
    letter-spacing: -.035em;
}

.intro {
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.notice {
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 12px;
    font-weight: 650;
}

.notice--closed { background: #fff4d9; color: #684c14; }
.notice--error { background: var(--red-soft); color: var(--red); }

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 18px;
}

.stat {
    min-width: 0;
    padding: 17px 18px;
    border: 1px solid rgba(221, 216, 204, .85);
    border-radius: 15px;
    background: rgba(255,255,255,.72);
}

.stat__label {
    display: block;
    margin-bottom: 6px;
    overflow: hidden;
    color: var(--muted);
    font-size: .77rem;
    font-weight: 750;
    letter-spacing: .045em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.stat strong { font-size: clamp(1.25rem, 2.4vw, 1.75rem); }
.stat--paid strong { color: var(--green); }
.stat--pending strong { color: var(--red); }

.card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--paper);
    box-shadow: var(--shadow);
}

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 17px 20px;
    border-bottom: 1px solid #ece8df;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #faf8f3;
    color: #59635d;
    font-size: .74rem;
    letter-spacing: .075em;
    text-transform: uppercase;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .2s ease, opacity .2s ease; }
tbody tr:hover { background: #fcfbf8; }
tbody tr.is-paid { background: rgba(228, 242, 233, .43); }
tbody tr.is-saving { opacity: .58; }

.player-name { font-weight: 720; }
.center { text-align: center; }
.right { text-align: right; }
.amount { font-variant-numeric: tabular-nums; font-weight: 720; white-space: nowrap; }

.stepper {
    display: inline-grid;
    grid-template-columns: 42px 58px 42px;
    overflow: hidden;
    border: 1px solid #cfc9bb;
    border-radius: 11px;
    background: white;
}

.stepper__button {
    min-height: 42px;
    border: 0;
    background: #f5f2eb;
    color: var(--green);
    cursor: pointer;
    font-size: 1.35rem;
    font-weight: 700;
}

.stepper__button:hover:not(:disabled) { background: var(--green-soft); }
.stepper__button:disabled { color: #aaa; cursor: not-allowed; }

.decimos-input {
    width: 58px;
    min-height: 42px;
    border: 0;
    border-inline: 1px solid #ddd8cc;
    outline: 0;
    text-align: center;
    font-weight: 750;
    -moz-appearance: textfield;
}

.decimos-input::-webkit-inner-spin-button,
.decimos-input::-webkit-outer-spin-button { margin: 0; -webkit-appearance: none; }
.decimos-input:focus { box-shadow: inset 0 0 0 2px var(--green); }

.check { display: inline-grid; place-items: center; cursor: pointer; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check span[aria-hidden] {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 2px solid #b9b5aa;
    border-radius: 9px;
    background: white;
    transition: .15s ease;
}

.check input:checked + span {
    border-color: var(--green);
    background: var(--green);
}

.check input:checked + span::after {
    content: "✓";
    color: white;
    font-size: 19px;
    font-weight: 900;
}

.check input:focus-visible + span { outline: 3px solid rgba(20, 90, 58, .24); outline-offset: 2px; }
.check input:disabled + span { background: #eee; cursor: not-allowed; opacity: .65; }

.empty { margin: 0; padding: 30px; color: var(--muted); text-align: center; }
.footnote { margin: 15px 4px 0; color: var(--muted); font-size: .87rem; }

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 20;
    max-width: min(390px, calc(100vw - 40px));
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 12px 35px rgba(0,0,0,.2);
    color: white;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: .2s ease;
}

.toast--visible { opacity: 1; transform: translateY(0); }
.toast--success { background: var(--green); }
.toast--error { background: var(--red); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 760px) {
    .page { width: min(100% - 20px, 680px); padding: 24px 0 48px; }
    .hero { align-items: flex-start; gap: 14px; }
    .hero__symbol { flex-basis: 54px; width: 54px; height: 54px; border-radius: 16px; font-size: 27px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card { border-radius: 16px; }

    table, tbody { display: block; }
    thead { display: none; }
    tbody { padding: 7px 14px; }
    tbody tr {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 12px 16px;
        padding: 17px 0;
        border-bottom: 1px solid #e8e3d9;
    }
    tbody tr:last-child { border-bottom: 0; }
    td { display: block; padding: 0; border: 0; text-align: initial; }
    td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 5px;
        color: var(--muted);
        font-size: .67rem;
        font-weight: 750;
        letter-spacing: .055em;
        text-transform: uppercase;
    }
    .player-name { grid-column: 1 / -1; font-size: 1.05rem; }
    .player-name::before { display: none; }
    td[data-label="Importe"], td[data-label="Pagado"] { align-self: center; text-align: right; }
    .footnote { padding: 0 4px; }
}

@media (max-width: 390px) {
    .stats { grid-template-columns: 1fr 1fr; }
    .stat { padding: 14px; }
    .stat__label { font-size: .66rem; }
    .stepper { grid-template-columns: 38px 52px 38px; }
    .decimos-input { width: 52px; }
}
