:root {
    color-scheme: dark;
    --bg: #170506;
    --panel: #2c0c10;
    --panel-soft: #35151a;
    --ink: #f4f7f4;
    --muted: #9ca69f;
    --green: #22c96d;
    --forest: #0b2a19;
    --red: #e23b32;
    --yellow: #ffd447;
    --gold: #d7ad45;
    --line: rgba(255,255,255,.09);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { width: 100%; max-width: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    width: 100%;
    max-width: 100%;
    min-width: 280px;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background:
        radial-gradient(circle at 88% 3%, rgba(255,212,71,.08), transparent 24rem),
        radial-gradient(circle at 3% 42%, rgba(226,59,50,.12), transparent 28rem),
        var(--bg);
}

.page-shell { width: min(calc(100% - 32px), 1040px); margin: 28px auto; }
.results-sheet {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: rgba(17,21,18,.97);
    box-shadow: 0 28px 80px rgba(0,0,0,.48);
}

.sheet-header {
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 34px 42px 30px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    background:
        radial-gradient(circle at 88% 15%, rgba(255,212,71,.2), transparent 30%),
        radial-gradient(circle at 72% 110%, rgba(226,59,50,.28), transparent 38%),
        linear-gradient(135deg, #080a08, #141a15);
}
.brand {
    color: var(--ink);
    font-size: clamp(1.7rem, 5vw, 2.5rem);
    font-weight: 950;
    letter-spacing: -.045em;
    text-decoration: none;
}
.brand:before {
    content: "AP";
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    margin-right: 12px;
    border-radius: 13px;
    color: #041108;
    background: var(--green);
    font-size: .82rem;
    letter-spacing: -.03em;
    vertical-align: middle;
}
.sheet-header p { margin: 10px 0 0 56px; color: var(--green); font-size: .76rem; font-weight: 850; letter-spacing: .14em; }
.sheet-date { text-align: right; }
.sheet-date strong, .sheet-date span { display: block; }
.sheet-date strong { color: var(--yellow); font-size: 1.22rem; }
.sheet-date span { margin-top: 7px; color: var(--muted); font-size: .67rem; font-weight: 800; letter-spacing: .09em; }

.client-access {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 17px 32px;
    border-bottom: 1px solid rgba(34,201,109,.18);
    background: var(--forest);
}
.client-access strong, .client-access span { display: block; }
.client-access strong { font-size: .9rem; }
.client-access span { margin-top: 3px; color: #9fc2aa; font-size: .72rem; }
.client-access__actions { display: flex; gap: 8px; }
.client-access__actions a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    border-radius: 12px;
    font-size: .76rem;
    font-weight: 850;
    text-decoration: none;
}
.client-access__login { color: var(--ink); border: 1px solid rgba(255,255,255,.22); }
.client-access__register { color: #041108; background: var(--green); }

.date-toolbar {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 12px;
    padding: 24px 32px 12px;
}
.date-form label { display: block; margin-bottom: 7px; color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.date-form > div { display: flex; }
.date-form input, .date-form button, .date-step, .today-link { min-height: 44px; border: 1px solid var(--line); font: inherit; }
.date-form input { width: 175px; min-width: 0; padding: 9px 12px; color: var(--ink); background: var(--panel-soft); border-radius: 12px 0 0 12px; }
.date-form button { padding: 9px 16px; color: #041108; background: var(--green); border-color: var(--green); border-radius: 0 12px 12px 0; font-weight: 850; cursor: pointer; }
.date-step { width: 44px; display: grid; place-items: center; color: var(--ink); background: var(--panel-soft); border-radius: 12px; font-size: 1.65rem; line-height: 1; text-decoration: none; }
.date-step--disabled { color: #505752; background: #101310; }
.today-link { display: grid; place-items: center; padding: 8px 14px; color: var(--green); border-radius: 12px; font-size: .8rem; font-weight: 850; text-decoration: none; }

.sheet-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 8px;
    margin: 12px 32px 20px;
}
.sheet-summary div { min-width: 0; padding: 13px 10px; text-align: center; border: 1px solid var(--line); border-radius: 15px; background: var(--panel-soft); }
.sheet-summary strong, .sheet-summary span { display: block; }
.sheet-summary strong { color: var(--ink); font-size: 1.15rem; }
.sheet-summary span { margin-top: 3px; color: var(--muted); font-size: .62rem; font-weight: 850; }
.sheet-summary div:nth-child(2) strong { color: var(--green); }
.sheet-summary div:nth-child(3) strong { color: var(--yellow); }

.status-message { margin: 0 32px 18px; padding: 12px 14px; color: #ffe8a4; background: rgba(255,212,71,.08); border: 1px solid rgba(255,212,71,.2); border-radius: 14px; font-size: .84rem; }
.results-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; padding: 0 32px 32px; }
.result-row {
    min-width: 0;
    min-height: 72px;
    display: grid;
    grid-template-columns: 42px minmax(0,1fr) auto;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--green);
    border-radius: 16px;
    background: var(--panel-soft);
}
.result-row--pending { border-left-color: var(--yellow); }
.flag { width: 32px; height: 24px; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(255,255,255,.16); border-radius: 6px; background: #fff; font-size: 1.28rem; line-height: 1; }
.result-name { min-width: 0; }
.result-name h2 { margin: 0; overflow: hidden; color: var(--ink); font-size: .8rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.result-name p { margin: 5px 0 0; color: var(--muted); font-size: .65rem; }
.result-value { min-width: 54px; text-align: right; }
.result-value > strong { display: block; color: var(--gold); font-size: 1.65rem; line-height: 1; letter-spacing: -.04em; }
.ball { display: block; margin-top: 5px; color: var(--muted); font-size: .49rem; font-weight: 850; }
.ball--r { color: #ff7770; }
.pending-result { color: var(--yellow); font-size: .62rem; letter-spacing: .04em; }

.empty-state { margin: 0 32px 32px; padding: 46px 24px; text-align: center; border: 1px solid var(--line); border-radius: 18px; background: var(--panel-soft); }
.empty-state p { margin: 8px 0 0; color: var(--muted); }
.sheet-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 32px; padding: 18px 0 24px; color: var(--muted); border-top: 1px solid var(--line); font-size: .7rem; }
.sheet-footer div { display: grid; gap: 4px; }
.sheet-footer strong { color: var(--ink); }
.whatsapp-link { padding: 11px 15px; color: #041108; background: var(--green); border-radius: 999px; font-size: .74rem; font-weight: 850; text-decoration: none; }
.disclaimer { margin: 15px 0 0; color: #778079; font-size: .7rem; text-align: center; }

.date-step:focus-visible, .today-link:focus-visible, .date-form input:focus-visible, .date-form button:focus-visible, .client-access__actions a:focus-visible, .whatsapp-link:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

@media (max-width: 700px) {
    .page-shell { width: 100%; margin: 0; padding-bottom: 20px; }
    .results-sheet { border-width: 0 0 1px; border-radius: 0 0 24px 24px; }
    .sheet-header { min-height: 120px; padding: 22px 16px 20px; }
    .brand { font-size: 1.5rem; }
    .brand:before { width: 36px; height: 36px; margin-right: 8px; border-radius: 11px; }
    .sheet-header p { margin-left: 45px; font-size: .64rem; }
    .sheet-date strong { font-size: .92rem; }
    .sheet-date span { max-width: 90px; font-size: .53rem; }
    .client-access { align-items: stretch; flex-direction: column; gap: 11px; padding: 14px; }
    .client-access__actions { display: grid; grid-template-columns: 1fr 1fr; }
    .date-toolbar { flex-wrap: wrap; padding: 16px 14px 10px; }
    .date-form { order: -1; width: 100%; }
    .date-form > div { width: 100%; }
    .date-form input { flex: 1; width: auto; font-size: 16px; }
    .date-step { flex: 1; }
    .today-link { flex: 2; }
    .sheet-summary { margin: 8px 14px 14px; gap: 6px; }
    .sheet-summary div { padding: 10px 4px; }
    .sheet-summary strong { font-size: 1.05rem; }
    .sheet-summary span { font-size: .52rem; }
    .status-message { margin: 0 14px 12px; }
    .results-list { grid-template-columns: 1fr; gap: 8px; padding: 0 14px 20px; }
    .result-row { min-height: 66px; }
    .result-name h2 { font-size: .8rem; }
    .result-value > strong { font-size: 1.62rem; }
    .empty-state { margin: 0 14px 20px; }
    .sheet-footer { align-items: stretch; flex-direction: column; margin: 0 14px; }
    .whatsapp-link { text-align: center; }
    .disclaimer { padding: 0 14px; }
}

@media print {
    :root { color-scheme: light; --ink: #0d1830; --muted: #596373; --line: #d3d9df; --panel: #fff; --panel-soft: #f5f7f8; }
    body { color: var(--ink); background: #fff; }
    .page-shell { width: 100%; margin: 0; }
    .results-sheet { border: 0; border-radius: 0; box-shadow: none; background: #fff; }
    .sheet-header { color: #fff; background: #111512; }
    .client-access, .date-toolbar, .disclaimer { display: none; }
}
