/* =========================================================
   Racha FC — tema futebol
   ========================================================= */
:root {
    --verde: #0b5d2a;
    --verde-2: #12803a;
    --grama: #1f9d4c;
    --grama-claro: #e8f5ec;
    --noite: #0b1a10;
    --amarelo: #f5c400;
    --vermelho: #d62839;
    --azul: #2563eb;
    --texto: #15241a;
    --muted: #6a7a6f;
    --borda: #dfe8e1;
    --fundo: #f2f6f1;
    --branco: #fff;
    --raio: 16px;
    --sombra: 0 1px 2px rgba(10, 40, 20, .06), 0 6px 24px rgba(10, 40, 20, .06);
    --fonte: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    --display: "Bebas Neue", "Oswald", "Arial Narrow", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; max-width: 100%; overflow-x: clip; }
body {
    font-family: var(--fonte);
    color: var(--texto);
    background: var(--fundo);
    font-size: 15px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    width: 100%;
}
a { color: var(--verde-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
small { font-size: .82em; }
code { background: var(--grama-claro); padding: 1px 6px; border-radius: 6px; font-size: .85em; }
hr { border: 0; border-top: 1px dashed var(--borda); margin: 8px 0; }

.muted { color: var(--muted); }
.d-block { display: block; }
.nowrap { white-space: nowrap; }
.r { text-align: right; }
.c { text-align: center; }
.pos { color: #128a3e !important; }
.neg { color: var(--vermelho) !important; }
.inv { color: var(--azul) !important; }
.inline { display: inline; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; width: 100%; max-width: 100%; }

.sidebar {
    width: 264px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    color: #fff;
    background:
        repeating-linear-gradient(180deg, rgba(255,255,255,.035) 0 56px, transparent 56px 112px),
        linear-gradient(180deg, #0d6b31 0%, #0a4f24 100%);
    border-right: 3px solid rgba(255,255,255,.85);
    z-index: 30;
    overflow: visible;
    transition: width .24s cubic-bezier(.4,0,.2,1), transform .26s cubic-bezier(.4,0,.2,1);
}
.sidebar-toggle {
    position: absolute;
    top: 28px;
    right: -15px;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 50%;
    background: var(--amarelo);
    color: #0b2914;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,.22);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    z-index: 35;
    transition: transform .2s, background .15s;
}
.sidebar-toggle:hover { transform: scale(1.08); }
.sidebar-toggle .toggle-ic { display: block; transition: transform .24s ease; transform: translateX(-1px); }

@media (min-width: 901px) {
    .app.sidebar-collapsed .sidebar { width: 78px; }
    .app.sidebar-collapsed .sidebar::after { display: none; }
    .app.sidebar-collapsed .brand { justify-content: center; padding: 18px 10px; }
    .app.sidebar-collapsed .brand > span:not(.brand-ball),
    .app.sidebar-collapsed .sidebar nav .lbl,
    .app.sidebar-collapsed .me > span:not(.avatar) { display: none; }
    .app.sidebar-collapsed .sidebar nav a { justify-content: center; padding: 11px 8px; }
    .app.sidebar-collapsed .sidebar-foot { flex-direction: column; padding: 12px 8px; gap: 10px; }
    .app.sidebar-collapsed .me { justify-content: center; }
    .app.sidebar-collapsed .sidebar-toggle .toggle-ic { transform: rotate(180deg) translateX(-1px); }
}
.sidebar::after { /* linha do meio-campo */
    content: "";
    position: absolute;
    left: 50%; bottom: 120px;
    width: 110px; height: 110px;
    margin-left: -55px;
    border: 2px solid rgba(255,255,255,.08);
    border-radius: 50%;
    pointer-events: none;
}
.brand {
    display: flex; align-items: center; gap: 12px;
    padding: 22px 20px 18px;
    color: #fff;
    border-bottom: 2px solid rgba(255,255,255,.12);
}
.brand:hover { text-decoration: none; }
.brand strong { display: block; font-family: var(--display); font-size: 22px; letter-spacing: .03em; line-height: 1.05; }
.brand small { opacity: .7; font-size: 12px; }
.brand-ball {
    font-size: 30px;
    width: 46px; height: 46px;
    display: grid; place-items: center;
    background: rgba(255,255,255,.12);
    border-radius: 50%;
    animation: quica 3s ease-in-out infinite;
}
.brand-ball.big { width: 84px; height: 84px; font-size: 54px; margin-bottom: 14px; }
@keyframes quica { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(180deg); } }

.sidebar nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sidebar nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px;
    margin-bottom: 2px;
    color: rgba(255,255,255,.88);
    border-radius: 12px;
    transition: background .15s;
}
.sidebar nav a:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.sidebar nav a.active {
    background: #fff;
    color: var(--verde);
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.sidebar nav .ic { font-size: 19px; width: 26px; text-align: center; }
.sidebar nav .lbl { font-weight: 700; font-size: 14.5px; display: flex; flex-direction: column; line-height: 1.15; }
.sidebar nav .lbl small { font-weight: 500; opacity: .65; font-size: 11.5px; }

.sidebar-foot {
    display: flex; align-items: center; gap: 8px;
    padding: 14px;
    border-top: 2px solid rgba(255,255,255,.12);
}
.me { display: flex; align-items: center; gap: 10px; flex: 1; color: #fff; min-width: 0; }
.me:hover { text-decoration: none; }
.me strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { opacity: .7; font-size: 11.5px; }
.logout { font-size: 20px; padding: 6px; border-radius: 10px; }
.logout:hover { background: rgba(255,255,255,.12); text-decoration: none; }

.avatar {
    width: 40px; height: 40px; flex-shrink: 0;
    display: grid; place-items: center;
    border-radius: 50%;
    font-weight: 800; font-size: 14px;
    color: var(--verde);
    background: linear-gradient(135deg, #fff, #d9f2e1);
    border: 2px solid var(--amarelo);
}
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }

.main { flex: 1; min-width: 0; width: 100%; max-width: 100%; display: flex; flex-direction: column; container-type: inline-size; container-name: main; }
.topbar {
    display: flex; align-items: center; gap: 14px;
    padding: 22px 32px 6px;
}
.topbar-titles { min-width: 0; }
.topbar h1 { font-family: var(--display); font-size: 34px; letter-spacing: .02em; text-transform: uppercase; color: var(--verde); }
.topbar .sub { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.burger { display: none; border: 0; background: var(--verde); color: #fff; font-size: 20px; width: 42px; height: 42px; border-radius: 12px; cursor: pointer; }
.content { padding: 14px 32px 32px; flex: 1; }
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 18px; }
.backdrop { display: none; }

/* ---------- Alertas ---------- */
.alert {
    margin: 10px 32px 0;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 600;
    background: #e6f6ea; color: #0e5a27; border: 1px solid #bfe5c9;
    transition: opacity .4s, transform .4s;
}
.alert-erro { background: #fdecee; color: #8f1422; border-color: #f6c3c9; }
.alert-info { background: #eaf1fe; color: #1e3f8a; border-color: #c8d8fb; margin: 0 0 14px; }
.auth-card .alert, .panel .alert { margin: 0 0 14px; }
.alert.hide { opacity: 0; transform: translateY(-6px); }

/* ---------- Botões ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 16px;
    border: 1.5px solid transparent;
    border-radius: 12px;
    font: inherit; font-weight: 700; font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .08s, box-shadow .15s, background .15s;
    text-decoration: none !important;
    color: var(--texto);
    background: #fff;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, var(--grama), var(--verde)); color: #fff; box-shadow: 0 4px 14px rgba(18,128,58,.3); }
.btn-primary:hover { box-shadow: 0 6px 20px rgba(18,128,58,.4); }
.btn-ghost { background: #fff; border-color: var(--borda); }
.btn-ghost:hover { border-color: var(--grama); color: var(--verde); }
.btn-light { background: rgba(255,255,255,.9); }
.btn-danger { background: var(--vermelho); color: #fff; }
.btn-whats { background: #25d366; color: #073b1a; }
.btn-whats::before { content: "💬"; }
.btn-link { background: none; color: var(--muted); padding: 6px 0; font-weight: 600; }
.btn-icon { padding: 6px 9px; background: transparent; border-color: transparent; font-size: 15px; }
.btn-icon:hover { background: var(--grama-claro); }
.btn-block { width: 100%; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Formulários ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13.5px; color: #2b3a30; }
input, select, textarea {
    font: inherit;
    padding: 10px 12px;
    border: 1.5px solid var(--borda);
    border-radius: 10px;
    background: #fff;
    color: var(--texto);
    width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--grama); box-shadow: 0 0 0 4px rgba(31,157,76,.15); }
input[type=checkbox], input[type=radio] { width: auto; }
input[type=file] { padding: 8px; background: var(--fundo); }
.input-big { font-size: 22px; font-weight: 800; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-icon { display: grid; grid-template-columns: 90px 1fr; gap: 14px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
.checks { display: flex; gap: 22px; flex-wrap: wrap; }
.form label.check, label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
fieldset { border: 1.5px dashed var(--borda); border-radius: 14px; padding: 14px 16px 16px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
legend { font-weight: 800; padding: 0 6px; }
.hint { margin: -4px 0 0; color: var(--muted); font-size: 13px; }
.inline-form { flex-direction: row; flex-wrap: wrap; margin-top: 14px; }
.inline-form input, .inline-form select { width: auto; flex: 1; min-width: 120px; }
.inline-form .w-icon { flex: 0 0 70px; min-width: 0; text-align: center; }

/* seletor de tipo */
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; background: var(--fundo); padding: 6px; border-radius: 14px; }
.seg-item { cursor: pointer; }
.seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.seg-item span { display: block; text-align: center; padding: 10px 6px; border-radius: 10px; font-weight: 700; font-size: 13.5px; color: var(--muted); transition: all .15s; }
.seg-item input:checked + span { background: #fff; color: var(--texto); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.seg-pos input:checked + span { color: #128a3e; box-shadow: inset 0 -3px 0 #1f9d4c, 0 2px 8px rgba(0,0,0,.08); }
.seg-neg input:checked + span { color: var(--vermelho); box-shadow: inset 0 -3px 0 var(--vermelho), 0 2px 8px rgba(0,0,0,.08); }
.seg-inv input:checked + span { color: var(--azul); box-shadow: inset 0 -3px 0 var(--azul), 0 2px 8px rgba(0,0,0,.08); }
[data-hint-tipo] span { display: none; }
[data-hint-tipo] span.on { display: inline; }

/* ---------- Painéis ---------- */
.panel {
    background: var(--branco);
    border-radius: var(--raio);
    box-shadow: var(--sombra);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(0,0,0,.03);
    min-width: 0;
    max-width: 100%;
}
.panel > h2 { font-size: 17px; margin-bottom: 12px; }
.panel.narrow { max-width: 760px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2 { font-size: 17px; }
.link { font-weight: 700; font-size: 13.5px; }
.subhead { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 8px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.cols > * { min-width: 0; }

/* ---------- Placar ---------- */
.scoreboard {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 2px;
    border-radius: 22px;
    overflow: hidden;
    margin-bottom: 20px;
    background: #050c07;
    border: 4px solid #1b2a20;
    box-shadow: 0 14px 40px rgba(5, 30, 12, .3), inset 0 0 0 1px rgba(255,255,255,.05);
}
.scoreboard::before { /* pontinhos de LED */
    content: "";
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1.4px);
    background-size: 6px 6px;
    pointer-events: none;
}
.sb-main { padding: 26px 30px; background: linear-gradient(135deg, #0e2416, #07130b); position: relative; }
.sb-main::after {
    content: "⚽";
    position: absolute; right: 22px; top: 50%;
    font-size: 110px; opacity: .06;
    transform: translateY(-50%) rotate(-15deg);
}
.sb-label { color: var(--amarelo); font-weight: 800; text-transform: uppercase; letter-spacing: .14em; font-size: 13px; }
.sb-value {
    font-family: "Consolas", "SFMono-Regular", "Courier New", monospace;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    font-size: clamp(36px, 5vw, 58px);
    color: #6dff9a !important;
    text-shadow: 0 0 18px rgba(109,255,154,.45);
    margin: 6px 0;
    letter-spacing: -.01em;
}
.sb-value.neg { color: #ff6b7a !important; text-shadow: 0 0 18px rgba(255,107,122,.45); }
.sb-hint { color: rgba(255,255,255,.45); font-size: 12.5px; }
.sb-side { display: grid; grid-template-rows: repeat(3, 1fr); gap: 2px; }
.sb-side > div { background: #0b1a10; padding: 12px 22px; display: flex; flex-direction: column; justify-content: center; }
.sb-side span { color: rgba(255,255,255,.55); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.sb-side strong { color: #fff; font-family: "Consolas", monospace; font-size: 22px; font-variant-numeric: tabular-nums; }

/* ---------- Estatísticas ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat {
    display: flex; gap: 12px; align-items: flex-start;
    background: #fff;
    border-radius: var(--raio);
    padding: 16px;
    box-shadow: var(--sombra);
    border-top: 4px solid var(--grama);
}
.stat:nth-child(2) { border-top-color: var(--vermelho); }
.stat:nth-child(3) { border-top-color: var(--amarelo); }
.stat:nth-child(4) { border-top-color: var(--azul); }
.stat > div { min-width: 0; flex: 1; }
.stat-ic { font-size: 22px; width: 42px; height: 42px; display: grid; place-items: center; background: var(--fundo); border-radius: 12px; flex-shrink: 0; }
.stat small { display: block; color: var(--muted); font-weight: 600; font-size: 12.5px; }
.stat strong { display: block; font-size: 21px; font-variant-numeric: tabular-nums; margin: 2px 0; }
.stat em { font-style: normal; color: var(--muted); font-size: 12px; }
.stats.compact .stat strong { font-size: 18px; }

/* ---------- Progresso ---------- */
.progress { height: 8px; background: #e7eee9; border-radius: 99px; overflow: hidden; position: relative; margin: 6px 0 4px; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--grama), #5bd47f); border-radius: 99px; transition: width .8s ease; }
.progress.in > span { background: linear-gradient(90deg, #1f9d4c, #6fe397); }
.progress.out > span { background: linear-gradient(90deg, #ef8a3a, var(--vermelho)); }
.progress.over > span { background: repeating-linear-gradient(45deg, var(--vermelho) 0 8px, #ff5a6b 8px 16px); }

/* ---------- Lembrete ---------- */
.reminder {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 20px;
    border-radius: var(--raio);
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff8d6, #fff2b0);
    border: 1px solid #f0dc7a;
}
.reminder-vermelho { background: linear-gradient(135deg, #ffe3e6, #ffd0d5); border-color: #f4a9b2; }
.reminder-ok { background: linear-gradient(135deg, #e5f8eb, #d3f2dd); border-color: #b4e3c3; }
.reminder-card { font-size: 34px; animation: balanca 2.4s ease-in-out infinite; }
.reminder-ok .reminder-card { animation: none; }
@keyframes balanca { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
.reminder-body { flex: 1; }
.reminder-body p { margin: 2px 0 0; }

/* ---------- Gráfico ---------- */
.chart { width: 100%; max-width: 100%; height: auto; max-height: 260px; display: block; }
.chart .grid { stroke: #e9efea; stroke-dasharray: 4 4; }
.chart .bar-in { fill: #2bb35b; }
.chart .bar-out { fill: #ef5466; }
.chart .line-caixa { fill: none; stroke: var(--azul); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: #fff; stroke: var(--azul); stroke-width: 2.5; }
.chart .lbl { font-size: 12px; fill: var(--muted); text-anchor: middle; font-weight: 600; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.lg-in::before { background: #2bb35b; }
.lg-out::before { background: #ef5466; }
.lg-line::before { background: var(--azul); height: 3px !important; vertical-align: 3px !important; }

/* ---------- Feed / listas ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--borda); }
.feed li:last-child { border-bottom: 0; }
.feed-ic { width: 38px; height: 38px; display: grid; place-items: center; background: var(--fundo); border-radius: 12px; font-size: 18px; flex-shrink: 0; }
.feed-body { flex: 1; min-width: 0; }
.feed-body strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.feed-body small { color: var(--muted); }
.feed-val { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }

.players { list-style: none; margin: 0 0 12px; padding: 0; }
.players li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--borda); }
.players li:last-child { border-bottom: 0; }
.players.big li { padding: 12px 0; flex-wrap: wrap; }
.pl-name { flex: 1; font-weight: 700; display: flex; flex-direction: column; min-width: 140px; }
.pl-name small { font-weight: 500; color: var(--muted); }

/* cartões amarelo / vermelho */
.card-ref {
    display: inline-block;
    width: 16px; height: 22px;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,.25);
    transform: rotate(8deg);
    vertical-align: middle;
    flex-shrink: 0;
}
.card-amarelo { background: linear-gradient(160deg, #ffe14d, var(--amarelo)); }
.card-vermelho { background: linear-gradient(160deg, #ff5c6c, var(--vermelho)); }

.notice { padding: 12px; border-radius: 12px; background: var(--fundo); margin-bottom: 10px; }
.notice.pinned, .notice-card.pinned { border-left: 4px solid var(--amarelo); }
.notice p { margin: 4px 0; font-size: 14px; }
.notice small { color: var(--muted); }

/* metas */
.goal { padding: 10px 0 14px; border-bottom: 1px dashed var(--borda); }
.goal:last-of-type { border-bottom: 0; }
.goal-top { display: flex; justify-content: space-between; font-weight: 700; gap: 8px; }
.goal small { color: var(--muted); }
.goal-bar { height: 12px; overflow: visible; margin: 10px 0 6px; background: repeating-linear-gradient(90deg, #e2ebe4 0 18px, #eef3ef 18px 36px); }
.goal-bar .ball { position: absolute; top: 50%; font-style: normal; font-size: 18px; transform: translate(-50%, -50%); transition: left .8s ease; filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.goal.done .goal-bar > span { background: linear-gradient(90deg, var(--amarelo), #ffdd55); }
.goal-actions { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.goal-actions .aporte { display: flex; gap: 4px; flex: 1; }
.goal-actions .aporte input { padding: 6px 10px; font-size: 13px; }

/* convite */
.invite .code {
    font-family: "Consolas", monospace;
    font-size: 30px; font-weight: 800;
    letter-spacing: .28em;
    text-align: center;
    padding: 14px;
    margin: 12px 0;
    border-radius: 14px;
    color: var(--verde);
    background: repeating-linear-gradient(90deg, #e9f6ed 0 22px, #f4fbf6 22px 44px);
    border: 2px dashed var(--grama);
}

.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.empty.small { padding: 14px 6px; }
.empty.big { padding: 80px 10px; }
.empty-ic { font-size: 44px; margin-bottom: 6px; }
.empty.small .empty-ic { font-size: 30px; }
.empty p { margin: 4px 0 14px; }

.fab {
    position: fixed; right: 26px; bottom: 26px;
    width: 60px; height: 60px; border-radius: 50%;
    display: grid; place-items: center;
    font-size: 32px; font-weight: 400; color: #fff;
    background: linear-gradient(180deg, var(--grama), var(--verde));
    box-shadow: 0 10px 28px rgba(11,93,42,.45);
    text-decoration: none !important;
    z-index: 20;
    transition: transform .15s;
}
.fab:hover { transform: scale(1.08) rotate(90deg); }

/* ---------- Toolbar / filtros ---------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { width: auto; padding: 8px 10px; }
.filters input[type=search] { min-width: 180px; }
.toolbar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.month-nav { display: flex; align-items: center; gap: 4px; background: #fff; border-radius: 12px; padding: 3px; border: 1.5px solid var(--borda); }
.month-nav input { border: 0; padding: 6px; width: auto; }
.month-nav .btn-icon { font-size: 20px; padding: 2px 10px; font-weight: 800; }
.year { padding: 0 10px; font-size: 15px; }
.pill { background: #fff; border: 1.5px solid var(--borda); border-radius: 99px; padding: 7px 14px; font-weight: 700; font-size: 13px; }
.tabs { display: flex; gap: 4px; background: #e4ece6; padding: 4px; border-radius: 12px; }
.tabs a { padding: 8px 14px; border-radius: 9px; font-weight: 700; color: var(--muted); font-size: 14px; }
.tabs a.active { background: #fff; color: var(--verde); box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.tabs a:hover { text-decoration: none; }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px; border-bottom: 2px solid var(--borda); background: #fafcfa; }
.table td { padding: 11px 10px; border-bottom: 1px solid #edf2ee; vertical-align: middle; }
.table tbody tr:hover td { background: #f7fbf8; }
.table tfoot th { border-top: 2px solid var(--borda); border-bottom: 0; color: var(--texto); font-size: 13px; text-transform: none; letter-spacing: 0; }
.table th.r, .table th.c { text-align: inherit; }
.table th.r { text-align: right; }
.table th.c { text-align: center; }
.actions { width: 1%; }
.tag { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tag-pos { background: #e3f6e9; color: #0f7a35; }
.tag-neg { background: #fde8ea; color: #a81b2b; }
.tag-inv { background: #e7efff; color: #1d4ed8; }

.pager { display: flex; gap: 4px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pager a { min-width: 34px; padding: 6px 10px; text-align: center; border-radius: 9px; background: var(--fundo); font-weight: 700; color: var(--texto); }
.pager a.active { background: var(--verde); color: #fff; }

/* grade de mensalidades */
.grid-mens th, .grid-mens td { padding: 7px 4px; }
.grid-mens .sticky { position: sticky; left: 0; background: #fff; z-index: 2; min-width: 170px; padding-left: 10px; }
.grid-mens thead .sticky, .grid-mens tfoot .sticky { background: #fafcfa; }
.grid-mens .hl { background: #f1faf3; }
.grid-mens tbody tr:hover td.sticky { background: #f7fbf8; }
.grid-mens tr.me-row td { background: #fffbe6; }
.grid-mens tr.inactive { opacity: .55; }
.player-cell { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.player-cell span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.player-cell small { font-weight: 500; color: var(--muted); }
.cell, .cell-dot {
    width: 30px; height: 30px;
    display: inline-grid; place-items: center;
    border-radius: 50%;
    border: 2px dashed #d3ddd6;
    background: transparent;
    font-size: 15px;
    padding: 0;
    font-style: normal;
    color: var(--muted);
}
button.cell { cursor: pointer; transition: transform .1s; }
button.cell:hover { transform: scale(1.15); border-color: var(--grama); }
.cell.pago, .cell-dot.pago { border: 0; background: #dff5e6; }
.cell.isento, .cell-dot.isento { border: 2px solid #d3ddd6; background: #f1f4f2; font-weight: 800; }
.cell.aberto, .cell-dot.aberto { border-color: var(--amarelo); background: #fff9db; font-size: 13px; }
.cell.atrasado, .cell-dot.atrasado { border: 0; background: var(--vermelho); width: 20px; height: 26px; border-radius: 4px; transform: rotate(6deg); box-shadow: 0 2px 5px rgba(214,40,57,.35); }
button.cell.atrasado:hover { transform: rotate(6deg) scale(1.15); }
.cell.futuro { border-color: #e6ece8; }
.cell.na { border: 0; }
.cell.na::after { content: "·"; color: #c9d3cc; }
.small-money { font-size: 11.5px !important; white-space: nowrap; }
.small-money small { display: block; color: var(--muted); font-weight: 500; }
.legend-cells { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); font-weight: 600; }
.legend-cells span { display: flex; align-items: center; gap: 6px; }
.legend-cells .cell-dot { width: 22px; height: 22px; font-size: 11px; }
.legend-cells .cell-dot.atrasado { width: 14px; height: 19px; }

/* ---------- Diálogo ---------- */
.dialog {
    border: 0; border-radius: 20px; padding: 26px;
    width: min(460px, calc(100vw - 32px));
    box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
.dialog::backdrop { background: rgba(5, 25, 12, .55); backdrop-filter: blur(3px); }
.dialog h3 { font-size: 20px; }
.dialog form { position: relative; }
.dialog-close { position: absolute; right: -10px; top: -14px; border: 0; background: var(--fundo); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 15px; }
.dialog [data-show] { display: none; flex-direction: column; gap: 14px; }
.dialog [data-show].on { display: flex; }

/* ---------- Figurinhas (elenco) ---------- */
.sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.sticker {
    position: relative;
    background: linear-gradient(180deg, #13843c 0 108px, #fff 108px);
    border-radius: 18px;
    padding: 14px 14px 16px;
    text-align: center;
    box-shadow: var(--sombra);
    border: 3px solid #fff;
    outline: 1px solid var(--borda);
    transition: transform .15s;
}
.sticker:hover { transform: translateY(-3px) rotate(-.6deg); }
.sticker.gold { background: linear-gradient(180deg, #c99a06 0 108px, #fffdf3 108px); outline-color: #f0d36b; }
.sticker-top { display: flex; justify-content: space-between; align-items: center; min-height: 26px; }
.sticker-num { font-family: var(--display); font-size: 30px; color: rgba(255,255,255,.95); font-weight: 800; line-height: 1; text-shadow: 0 2px 0 rgba(0,0,0,.15); }
.sticker-badge { background: rgba(255,255,255,.95); color: #8a6a00; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 99px; }
.sticker-face {
    width: 84px; height: 84px;
    margin: 4px auto 10px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 28px; font-weight: 800;
    color: var(--verde);
    background: radial-gradient(circle at 30% 30%, #fff, #dcefe2);
    border: 4px solid #fff;
    box-shadow: 0 6px 16px rgba(0,0,0,.18);
}
.sticker.gold .sticker-face { color: #8a6a00; }
.sticker-name { font-family: var(--display); font-size: 21px; text-transform: uppercase; letter-spacing: .03em; font-weight: 800; }
.sticker-full { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticker-meta { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.sticker-meta span { background: var(--fundo); padding: 3px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.sticker-actions { margin-top: 10px; display: flex; justify-content: center; gap: 4px; }

/* ---------- Planejamento ---------- */
.budget-row { display: grid; grid-template-columns: 210px 1fr 130px; gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--borda); }
.budget-row:last-of-type { border-bottom: 0; }
.budget-name { font-weight: 700; font-size: 14px; }
.budget-bar small { color: var(--muted); }
.budget-input { text-align: right; padding: 7px 10px; }
.panel .budget-row:not(:has(.budget-input)) { grid-template-columns: 210px 1fr; }

/* ---------- Relatórios / VAR ---------- */
.ranking { list-style: none; padding: 0; margin: 0 0 8px; }
.ranking li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--borda); font-weight: 600; }
.ranking li span:nth-child(2) { flex: 1; }
.rk { width: 30px; text-align: center; font-size: 18px; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 6px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 24px; top: 6px; bottom: 6px; border-left: 2px dashed var(--borda); }
.timeline li { display: flex; gap: 14px; padding: 9px 0; position: relative; }
.tl-ic { width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; background: #fff; border: 2px solid var(--borda); border-radius: 50%; z-index: 1; }
.timeline strong { display: block; font-weight: 600; font-size: 14.5px; }
.timeline small { color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--fundo); padding: 6px 6px 6px 12px; border-radius: 99px; font-size: 13.5px; font-weight: 600; }
.chip small { color: var(--muted); }
.chip-x { border: 0; background: #fff; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; font-size: 11px; color: var(--muted); }
.chip-x:hover { background: var(--vermelho); color: #fff; }
.msg-box { font-family: inherit; font-size: 13.5px; background: var(--fundo); margin-bottom: 10px; resize: vertical; }

/* ---------- Auth ---------- */
body.auth {
    min-height: 100vh;
    background:
        repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 80px, transparent 80px 160px),
        radial-gradient(ellipse at top, #1a8c43, #0a4a22 70%);
    display: grid; place-items: center;
    padding: 30px 16px;
    position: relative;
    overflow-x: hidden;
}
.pitch-lines { position: fixed; inset: 24px; border: 3px solid rgba(255,255,255,.14); border-radius: 6px; pointer-events: none; }
.pitch-lines::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 3px solid rgba(255,255,255,.14); }
.pitch-lines::after { content: ""; position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; margin: -110px 0 0 -110px; border: 3px solid rgba(255,255,255,.14); border-radius: 50%; }
.auth-wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 440px; gap: 50px; align-items: center; max-width: 1020px; width: 100%; }
.auth-hero { color: #fff; }
.auth-hero h1 { font-family: var(--display); font-size: 64px; letter-spacing: .02em; text-transform: uppercase; text-shadow: 0 4px 0 rgba(0,0,0,.15); }
.auth-hero p { font-size: 19px; opacity: .92; max-width: 440px; }
.hero-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.hero-list li { background: rgba(255,255,255,.1); padding: 10px 16px; border-radius: 12px; backdrop-filter: blur(4px); font-weight: 600; width: fit-content; }
.auth-card { background: #fff; border-radius: 24px; padding: 30px; box-shadow: 0 30px 80px rgba(0,0,0,.3); border-top: 6px solid var(--amarelo); }
.auth-card h2 { font-family: var(--display); font-size: 30px; text-transform: uppercase; color: var(--verde); }
.auth-card > p { margin: 4px 0 18px; }
.auth-links { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--borda); font-weight: 700; font-size: 14px; }

/* ---------- Responsivo (Container Queries + Breakpoints) ---------- */
@container main (max-width: 960px) {
    .cols { grid-template-columns: minmax(0, 1fr); }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container main (max-width: 760px) {
    .scoreboard { grid-template-columns: minmax(0, 1fr); }
    .sb-side { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: none; }
    .sb-side > div { padding: 12px 14px; }
    .sb-side strong { font-size: 17px; }
    .budget-row, .panel .budget-row:not(:has(.budget-input)) { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .budget-input { width: 100%; text-align: left; }
}
@container main (max-width: 620px) {
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar-actions { justify-content: space-between; width: 100%; }
    .filters { width: 100%; }
    .filters > * { flex: 1 1 140px; }
    .filters .month-nav { flex: 1 1 100%; justify-content: space-between; }
    .tabs { width: 100%; display: grid; grid-template-columns: 1fr 1fr; text-align: center; }
    .tabs a { padding: 8px 8px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .seg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container main (max-width: 480px) {
    .stats { grid-template-columns: minmax(0, 1fr); }
    .sb-main { padding: 20px; }
    .sb-side { grid-template-columns: minmax(0, 1fr); }
    .sb-side > div { flex-direction: row; justify-content: space-between; align-items: center; padding: 10px 18px; }
    .grid-2, .grid-3, .grid-icon { grid-template-columns: minmax(0, 1fr); }
    .form-actions { flex-direction: column-reverse; align-items: stretch; }
    .form-actions .btn { width: 100%; }
    .sticker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .sticker { padding: 12px 10px 14px; background: linear-gradient(180deg, #13843c 0 84px, #fff 84px); }
    .sticker.gold { background: linear-gradient(180deg, #c99a06 0 84px, #fffdf3 84px); }
    .sticker-face { width: 62px; height: 62px; font-size: 21px; }
    .sticker-name { font-size: 18px; }
    .grid-mens .sticky { min-width: 124px; box-shadow: 3px 0 8px rgba(0,0,0,.05); }
}
@container main (max-width: 360px) {
    .sticker-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1200px) {
    .cols { grid-template-columns: minmax(0, 1fr); }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .sidebar {
        position: fixed; left: 0; top: 0;
        height: 100dvh;
        width: min(272px, calc(100vw - 46px));
        transform: translateX(-100%);
        z-index: 40;
        border-right-width: 2px;
    }
    .sidebar.open { transform: translateX(0); box-shadow: 20px 0 60px rgba(0,0,0,.35); }
    .sidebar-toggle {
        top: 86px; right: auto; left: 100%;
        width: 26px; height: 52px;
        border-radius: 0 12px 12px 0;
        background: linear-gradient(180deg, var(--grama), var(--verde));
        color: #fff;
        border: 2px solid rgba(255,255,255,.9);
        border-left: 0;
        box-shadow: 4px 3px 12px rgba(0,0,0,.22);
    }
    .sidebar:not(.open) .sidebar-toggle .toggle-ic { transform: rotate(180deg); }
    .sidebar.open .sidebar-toggle { background: var(--amarelo); color: #0b2914; }
    .sidebar.open .sidebar-toggle .toggle-ic { transform: none; }
    .backdrop.on {
        display: block; position: fixed; inset: 0;
        background: rgba(5, 20, 10, .48);
        backdrop-filter: blur(2px);
        z-index: 35;
    }
    .topbar {
        position: sticky; top: 0; z-index: 20;
        background: rgba(242,246,241,.92);
        backdrop-filter: blur(8px);
        padding: 12px 16px 10px;
        border-bottom: 1px solid rgba(0,0,0,.05);
    }
    .burger { display: grid; place-items: center; flex-shrink: 0; }
    .topbar h1 { font-size: 26px; }
    .content { padding: 12px 16px 90px; }
    .alert { margin: 10px 16px 0; }
    .fab { right: 18px; bottom: 18px; width: 54px; height: 54px; font-size: 28px; }
    .scoreboard { grid-template-columns: minmax(0, 1fr); }
    .sb-side { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: none; }
    .budget-row, .panel .budget-row:not(:has(.budget-input)) { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .auth-wrap { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .auth-hero { text-align: center; }
    .auth-hero h1 { font-size: 46px; }
    .auth-hero p { margin: 0 auto; }
    .hero-list { display: none; }
    .brand-ball.big { margin: 0 auto 10px; }
}
@media (max-width: 560px) {
    .stats { grid-template-columns: minmax(0, 1fr); }
    .sb-side { grid-template-columns: minmax(0, 1fr); }
    .sb-side > div { flex-direction: row; justify-content: space-between; align-items: center; padding: 10px 18px; }
    .grid-2, .grid-3, .grid-icon { grid-template-columns: minmax(0, 1fr); }
    .reminder { flex-wrap: wrap; }
    .table td, .table th { padding: 8px 6px; }
    .sticker { padding: 12px 10px 14px; background: linear-gradient(180deg, #13843c 0 84px, #fff 84px); }
    .sticker.gold { background: linear-gradient(180deg, #c99a06 0 84px, #fffdf3 84px); }
    .sticker-face { width: 62px; height: 62px; font-size: 21px; }
}

/* ---------- Impressão ---------- */
@media print {
    .sidebar, .sidebar-toggle, .toolbar, .fab, .burger, .foot, .alert { display: none !important; }
    body { background: #fff; }
    .panel, .stat { box-shadow: none; border: 1px solid #ddd; }
    .content, .topbar { padding: 8px; }
    .cols { grid-template-columns: 1fr; }
}
