:root {
    --bg: #f3f6f4;
    --bg-soft: #eef4ef;
    --panel: #ffffff;
    --panel-2: #f9fbfa;
    --text: #132018;
    --muted: #667085;
    --primary: #0c7a43;
    --primary-2: #075c31;
    --primary-soft: #e3f6ec;
    --accent: #f2b705;
    --accent-soft: #fff5cc;
    --danger: #b42318;
    --danger-soft: #fee4e2;
    --warning: #b76e00;
    --warning-soft: #fff1d6;
    --ok: #087443;
    --ok-soft: #dcfae6;
    --info-soft: #e0f2fe;
    --border: #e4e7ec;
    --shadow: 0 18px 45px rgba(16, 24, 40, .08);
    --shadow-soft: 0 8px 20px rgba(16, 24, 40, .06);
    --radius: 20px;
    --radius-sm: 14px;
    --sidebar: 286px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(12,122,67,.12), transparent 32rem),
        linear-gradient(180deg, #f7faf8 0%, var(--bg) 100%);
    color: var(--text);
    font-size: 15px;
    line-height: 1.45;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-2); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }

.app-shell { min-height: 100vh; display: flex; }
.mobile-topbar, .sidebar-backdrop, .mobile-bottom-nav { display: none; }

.sidebar {
    width: var(--sidebar);
    background:
        linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,0)),
        linear-gradient(180deg, #06291d, #07482f 55%, #06321f);
    color: #fff;
    padding: 22px 18px;
    position: fixed;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 16px 0 38px rgba(6,41,29,.16);
    z-index: 40;
}
.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 8px 16px;
    border-bottom: 1px solid rgba(255,255,255,.12);
}
.brand-icon {
    width: 48px;
    height: 48px;
    border-radius: 17px;
    background: rgba(255,255,255,.14);
    display: grid;
    place-items: center;
    font-size: 25px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.brand strong { display: block; font-size: 18px; letter-spacing: -.02em; }
.brand span { display: block; color: rgba(255,255,255,.72); font-size: 12px; margin-top: 3px; max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a {
    color: rgba(255,255,255,.88);
    padding: 12px 13px;
    border-radius: 15px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
}
.sidebar nav a .nav-ico { width: 24px; text-align: center; font-size: 17px; }
.sidebar nav a:hover,
.sidebar nav a.is-active {
    background: rgba(255,255,255,.14);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.sidebar-user {
    margin-top: auto;
    background: rgba(255,255,255,.11);
    padding: 14px;
    border-radius: 18px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.sidebar-user small { display: block; color: rgba(255,255,255,.65); }
.sidebar-user strong { display: block; margin: 4px 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user a { color: #fff; font-weight: 800; }

.main-content {
    margin-left: var(--sidebar);
    width: calc(100% - var(--sidebar));
    padding: 30px;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}
.page-header h1 { margin: 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.04em; }
.page-header p { margin: 7px 0 0; color: var(--muted); max-width: 700px; }

.card,
.stat {
    background: rgba(255,255,255,.92);
    border: 1px solid rgba(228,231,236,.95);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}
.card { padding: 20px; margin-bottom: 18px; }
.card h2 { margin: 0 0 12px; font-size: 20px; letter-spacing: -.02em; }
.card .help + .table-wrap { margin-top: 12px; }
.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 16px;
}
.stat {
    padding: 18px;
    position: relative;
    overflow: hidden;
}
.stat::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
}
.stat span { color: var(--muted); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.stat strong { display: block; font-size: clamp(24px, 3vw, 34px); margin-top: 8px; letter-spacing: -.04em; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: #fff;
}
.table-wrap table { min-width: 760px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    background: #f8faf9;
    position: sticky;
    top: 0;
    z-index: 1;
}
tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fbfdfc; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 14px;
    align-items: end;
}
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
.field label { display: block; font-weight: 800; margin-bottom: 7px; color: #243027; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 13px;
    background: #fff;
    color: var(--text);
    min-height: 44px;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
textarea { min-height: 110px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #98a2b3; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: rgba(12,122,67,.7);
    box-shadow: 0 0 0 4px rgba(12,122,67,.13);
}
input:disabled { background: #f2f4f7; color: #667085; }

.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    min-height: 44px;
    font-weight: 900;
    cursor: pointer;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 8px 18px rgba(12,122,67,.18);
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { background: var(--primary-2); color: #fff; transform: translateY(-1px); box-shadow: 0 11px 24px rgba(12,122,67,.2); }
.btn:active { transform: translateY(0); }
.btn-secondary { background: #eef2f7; color: #17202a; box-shadow: none; }
.btn-secondary:hover { background: #e5e7eb; color: #17202a; box-shadow: none; }
.btn-danger { background: var(--danger); box-shadow: 0 8px 18px rgba(180,35,24,.16); }
.btn-danger:hover { background: #8f1c13; }
.btn-small { padding: 8px 11px; border-radius: 11px; min-height: 36px; font-size: 12px; }

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    background: #eef2f7;
    color: #344054;
    white-space: nowrap;
}
.badge-pago, .badge-recebido, .badge-ativo, .badge-presente { background: var(--ok-soft); color: #05603a; }
.badge-pendente, .badge-atrasado, .badge-falta { background: var(--warning-soft); color: #8a4b00; }
.badge-cancelado, .badge-inativo { background: var(--danger-soft); color: #912018; }
.badge-isento { background: var(--info-soft); color: #075985; }
.alert {
    padding: 13px 16px;
    border-radius: 16px;
    margin-bottom: 16px;
    font-weight: 800;
    border: 1px solid transparent;
}
.alert-success { background: var(--ok-soft); color: #05603a; border-color: #abefc6; }
.alert-danger { background: var(--danger-soft); color: #912018; border-color: #fecdca; }
.alert-warning { background: var(--warning-soft); color: #8a4b00; border-color: #fedf89; }
.alert-info { background: var(--info-soft); color: #075985; border-color: #bae6fd; }
.help { color: var(--muted); font-size: 13px; }
.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary-soft);
    display: inline-grid;
    place-items: center;
    font-weight: 900;
    color: var(--primary);
    border: 1px solid rgba(12,122,67,.12);
}
.inline-form { display: inline-flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; min-width: 126px; padding: 8px 10px; min-height: 36px; border-radius: 11px; }

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
    background:
        radial-gradient(circle at 15% 15%, rgba(242,183,5,.25), transparent 22rem),
        radial-gradient(circle at 85% 0%, rgba(15,154,85,.25), transparent 22rem),
        linear-gradient(135deg, #041710, #07351f 50%, #061b12);
}
.login-card {
    width: min(440px, 100%);
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 28px;
    padding: 30px;
    box-shadow: 0 28px 80px rgba(0,0,0,.30);
}
.login-logo {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 30px;
    margin-bottom: 16px;
}
.login-card h1 { margin: 0 0 8px; font-size: 30px; letter-spacing: -.04em; }
.login-card p { margin: 0 0 22px; color: var(--muted); }
.login-card .btn { width: 100%; margin-top: 4px; }
.login-foot { text-align: center; margin-top: 18px; color: rgba(255,255,255,.68); font-size: 12px; }

@media (max-width: 1180px) {
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    body { padding-bottom: 76px; }
    .app-shell { display: block; }
    .mobile-topbar {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 35;
        min-height: 62px;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 14px;
        background: rgba(255,255,255,.94);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
    }
    .mobile-topbar-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
    .mobile-topbar-title strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .mobile-topbar-title span { color: var(--muted); display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
    .menu-toggle {
        width: 44px;
        height: 44px;
        border-radius: 14px;
        border: 1px solid var(--border);
        background: #fff;
        color: var(--text);
        font-size: 22px;
        display: grid;
        place-items: center;
    }
    .sidebar {
        transform: translateX(-105%);
        transition: transform .22s ease;
        width: min(86vw, 310px);
        padding-top: 18px;
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.42);
        opacity: 0;
        pointer-events: none;
        z-index: 38;
        transition: opacity .2s ease;
    }
    body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 18px 14px 28px;
    }
    .page-header { align-items: stretch; flex-direction: column; margin-bottom: 16px; }
    .page-header .actions, .page-header > .btn { width: 100%; }
    .actions .btn, .page-header > .btn { flex: 1 1 auto; }
    .grid-2, .form-grid, .form-grid.cols-2 { grid-template-columns: 1fr; }
    .cards { grid-template-columns: 1fr 1fr; gap: 12px; }
    .card { padding: 16px; border-radius: 18px; }
    .stat { padding: 15px; border-radius: 18px; }
    .stat span { font-size: 11px; }
    .stat strong { font-size: 24px; }
    .table-wrap { margin-left: -2px; margin-right: -2px; }
    th, td { padding: 11px 10px; }
    .inline-form { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
    .inline-form .btn { grid-column: 1 / -1; }
    .mobile-bottom-nav {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 10px;
        z-index: 34;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
        padding: 8px;
        border-radius: 22px;
        background: rgba(255,255,255,.96);
        border: 1px solid var(--border);
        box-shadow: 0 18px 45px rgba(16, 24, 40, .16);
    }
    .mobile-bottom-nav a {
        min-width: 0;
        color: #344054;
        border-radius: 15px;
        padding: 8px 4px;
        text-align: center;
        font-size: 11px;
        font-weight: 900;
    }
    .mobile-bottom-nav a .nav-ico { display: block; font-size: 18px; line-height: 1; margin-bottom: 3px; }
    .mobile-bottom-nav a.is-active { background: var(--primary-soft); color: var(--primary); }
}

@media (max-width: 520px) {
    body { font-size: 14px; }
    .login-card { padding: 24px 20px; border-radius: 24px; }
    .cards { grid-template-columns: 1fr; }
    .actions { display: grid; grid-template-columns: 1fr; width: 100%; }
    .actions .btn, .btn { width: 100%; }
    .page-header h1 { font-size: 26px; }
    .card h2 { font-size: 18px; }
    input, select, textarea { min-height: 46px; }
    .table-wrap table { min-width: 680px; }
    .mobile-bottom-nav a { font-size: 10px; }
}

@media print {
    body { background: #fff; padding: 0; }
    .sidebar, .mobile-topbar, .mobile-bottom-nav, .sidebar-backdrop, .no-print, .actions, .btn { display: none !important; }
    .main-content { margin: 0; width: 100%; padding: 0; }
    .card, .stat { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
    .table-wrap { overflow: visible; border: 0; }
    .table-wrap table { min-width: 0; }
}

/* Prestação de contas */
.finance-cards .stat strong { color: var(--text); }
.statement-card {
    border-color: rgba(12,122,67,.18);
    background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(227,246,236,.55));
}
.statement-card h2::before {
    content: '📌 ';
}
@media (max-width: 860px) {
    .finance-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
    .finance-cards { grid-template-columns: 1fr; }
}

/* Seleção de meses para geração de mensalidades */
.month-checks {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 8px;
}
.check-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
}
.check-pill input { width: 18px; height: 18px; accent-color: var(--primary); }
.check-pill.is-selected {
    border-color: rgba(12,122,67,.45);
    background: var(--primary-soft);
    color: var(--primary);
}
.badge-goleiro { background: #eef4ff; color: #3538cd; }
.badge-jogador { background: #ecfdf3; color: #027a48; }
@media (max-width: 860px) { .month-checks { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .month-checks { grid-template-columns: 1fr 1fr; } .check-pill { padding: 11px 10px; font-size: 13px; } }

/* Presença rápida */
.presence-summary { margin-bottom: 18px; }
.presence-filter { grid-template-columns: minmax(210px, 260px) minmax(240px, 1fr) minmax(150px, 180px); }
.presence-filter-actions { align-self: end; }
.presence-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}
.presence-toolbar h2 { margin-bottom: 4px; }
.presence-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.presence-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(16,24,40,.04);
}
.presence-player {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.presence-avatar { flex: 0 0 auto; width: 50px; height: 50px; font-size: 15px; }
.presence-player strong {
    display: block;
    font-size: 17px;
    line-height: 1.2;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.presence-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.presence-choice {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8faf9;
    color: #344054;
    font-weight: 900;
    cursor: pointer;
    user-select: none;
    transition: background .12s ease, border-color .12s ease, color .12s ease, transform .12s ease;
}
.presence-choice input { position: absolute; opacity: 0; pointer-events: none; }
.presence-choice:hover { transform: translateY(-1px); }
.presence-choice-present.is-selected { background: var(--ok-soft); color: #05603a; border-color: #8fe3ad; }
.presence-choice-falta.is-selected { background: var(--warning-soft); color: #8a4b00; border-color: #fedf89; }
.presence-choice-clear.is-selected { background: #eef2f7; color: #475467; border-color: #d0d5dd; }
.sticky-save {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}
.presence-hidden { display: none !important; }

@media (max-width: 1180px) {
    .presence-list { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .presence-filter { grid-template-columns: 1fr; }
    .presence-toolbar { flex-direction: column; }
    .presence-toolbar .actions { width: 100%; }
    .presence-item { grid-template-columns: 1fr; align-items: stretch; }
    .presence-player strong { white-space: normal; font-size: 18px; }
    .presence-options { display: grid; grid-template-columns: 1fr 1fr 1fr; justify-content: stretch; }
    .presence-choice { width: 100%; min-height: 50px; }
    .sticky-save {
        position: sticky;
        bottom: 86px;
        z-index: 20;
        background: rgba(255,255,255,.92);
        backdrop-filter: blur(10px);
        padding: 10px;
        margin: 16px -10px -6px;
        border: 1px solid var(--border);
        border-radius: 18px;
        box-shadow: 0 12px 28px rgba(16,24,40,.12);
    }
}
@media (max-width: 520px) {
    .presence-options { grid-template-columns: 1fr; }
    .presence-item { padding: 12px; }
    .presence-avatar { width: 46px; height: 46px; }
}

/* Menu lateral compacto no computador */
@media (min-width: 861px) {
    :root { --sidebar: 238px; }
    .sidebar {
        padding: 14px 12px;
        gap: 10px;
        overflow-y: auto;
        scrollbar-width: thin;
    }
    .brand {
        padding: 4px 6px 10px;
        gap: 10px;
    }
    .brand-icon {
        width: 40px;
        height: 40px;
        border-radius: 14px;
        font-size: 21px;
    }
    .brand strong { font-size: 16px; }
    .brand span { max-width: 145px; font-size: 11px; }
    .sidebar nav { gap: 3px; }
    .sidebar nav a {
        min-height: 38px;
        padding: 9px 10px;
        border-radius: 12px;
        gap: 8px;
        font-size: 14px;
    }
    .sidebar nav a .nav-ico {
        width: 20px;
        font-size: 15px;
    }
    .sidebar-user {
        position: sticky;
        bottom: 8px;
        margin-top: auto;
        padding: 10px;
        border-radius: 14px;
        background: rgba(255,255,255,.14);
    }
    .sidebar-user small { font-size: 11px; }
    .sidebar-user strong {
        margin: 2px 0 7px;
        font-size: 13px;
    }
    .sidebar-logout {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 34px;
        border-radius: 11px;
        background: rgba(255,255,255,.18);
        color: #fff !important;
        font-weight: 900;
    }
}

/* Contas a pagar */
@media (max-width: 860px) {
    .contas-pagar-actions .inline-form {
        grid-template-columns: 1fr;
    }
}

/* Baixa rápida de mensalidades */
.quick-pay-card {
    border-left: 5px solid var(--primary);
}
.quick-pay-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.quick-pay-head h2 {
    margin: 0 0 4px;
}
.quick-pay-form {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(160px, 220px) 1fr;
    gap: 12px;
    align-items: end;
}
.quick-pay-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}
.check-cell {
    width: 84px;
    text-align: center;
}
.row-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.row-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.row-check span {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    border: 2px solid var(--border);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: .12s ease;
}
.row-check span::after {
    content: '✓';
    font-weight: 1000;
    color: #fff;
    transform: scale(.4);
    opacity: 0;
    transition: .12s ease;
}
.row-check input:checked + span {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: 0 8px 18px rgba(12,122,67,.22);
}
.row-check input:checked + span::after {
    opacity: 1;
    transform: scale(1);
}

@media (max-width: 860px) {
    .quick-pay-head { flex-direction: column; }
    .quick-pay-form { grid-template-columns: 1fr; }
    .quick-pay-actions { justify-content: stretch; }
    .quick-pay-actions .btn { width: 100%; }
    .check-cell { width: 56px; }
    .row-check span { width: 36px; height: 36px; }
}

/* Correção definitiva: Contas a Pagar usando o mesmo padrão visual das demais telas */
.contas-pagar-page .page-header,
.contas-pagar-page .card,
.contas-pagar-page .cards,
.contas-pagar-page .grid-2 {
    width: 100%;
}
.contas-pagar-page .contas-summary {
    margin-bottom: 18px;
}
.contas-grid {
    align-items: start;
}
.contas-form,
.contas-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.contas-form .field-wide,
.contas-filter .field-wide {
    grid-column: 1 / -1;
}
.contas-submit {
    align-self: end;
}
.contas-submit .btn {
    width: 100%;
}
.contas-list-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.contas-list-head h2 {
    margin: 0 0 4px;
}
.contas-table-wrap table {
    min-width: 980px;
}
.contas-table td:nth-child(5),
.contas-table th:nth-child(5) {
    text-align: right;
}
.contas-actions-cell {
    min-width: 320px;
}
.contas-pagar-actions {
    align-items: center;
}
.contas-pagar-actions .inline-form {
    margin: 0;
}
.pay-inline input,
.pay-inline select {
    min-width: 118px;
}

/* Menu do PC menor, com o botão Sair sempre visível */
@media (min-width: 861px) {
    .sidebar {
        height: 100vh;
        max-height: 100vh;
        overflow-y: auto;
    }
    .sidebar nav {
        flex: 1 1 auto;
    }
    .sidebar-user {
        flex: 0 0 auto;
    }
}

@media (max-width: 1180px) {
    .contas-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 860px) {
    .contas-form,
    .contas-filter {
        grid-template-columns: 1fr;
    }
    .contas-list-head {
        flex-direction: column;
    }
    .contas-actions-cell {
        min-width: 240px;
    }
    .contas-pagar-actions,
    .contas-pagar-actions .inline-form {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }
    .pay-inline input,
    .pay-inline select,
    .contas-pagar-actions .btn {
        width: 100%;
        min-width: 0;
    }
}

.check-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    cursor: pointer;
}
.check-inline input {
    width: 18px;
    height: 18px;
    accent-color: var(--danger);
}

/* Mensalidades - tela simplificada para operador */
.cobrancas-header { margin-bottom: 14px; }
.operator-filter-card { padding: 16px; }
.operator-filter { grid-template-columns: 150px 120px 170px minmax(220px, 1fr) 120px; gap: 10px; }
.operator-filter-actions { align-self: end; }
.operator-summary { margin-bottom: 18px; }
.operator-panel { border-left: 5px solid var(--primary); }
.operator-panel-head,
.table-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}
.operator-panel-head h2,
.table-title-row h2 { margin: 0 0 4px; }
.operator-actions-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
    gap: 14px;
}
.operator-action-box {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    padding: 16px;
}
.operator-action-box h3,
.admin-delete-form h3 {
    margin: 0 0 12px;
    font-size: 17px;
    letter-spacing: -.02em;
}
.compact-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); gap: 10px; }
.operator-month-field { margin-top: 12px; }
.month-checks-compact {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
}
.month-checks-compact .check-pill {
    justify-content: center;
    padding: 9px 8px;
    border-radius: 13px;
    font-size: 12px;
}
.month-checks-compact .check-pill input { width: 15px; height: 15px; }
.operator-actions-row { margin-top: 12px; }
.operator-action-pay { background: linear-gradient(180deg, #fff, #fbfdfc); }
.empty-simple {
    margin: 0;
    padding: 16px;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary-2);
    font-weight: 800;
}
.admin-details {
    position: relative;
    min-width: 160px;
    text-align: right;
}
.admin-details > summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 14px;
    background: #eef2f7;
    color: #17202a;
    font-weight: 900;
    cursor: pointer;
    user-select: none;
}
.admin-details > summary::-webkit-details-marker { display: none; }
.admin-details[open] > summary { background: var(--primary-soft); color: var(--primary-2); }
.admin-details-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 20;
    width: min(760px, calc(100vw - 64px));
    max-height: 78vh;
    overflow: auto;
    text-align: left;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow);
}
.admin-links { margin-bottom: 12px; }
.admin-delete-form {
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin-top: 14px;
    display: grid;
    gap: 10px;
}
.admin-months { margin-top: 2px; }
.operator-table-wrap table { min-width: 700px; }
.operator-cobrancas-table td { padding-top: 11px; padding-bottom: 11px; }
.operator-row-actions {
    min-width: 250px;
}
.operator-row-actions,
.operator-receive-form {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}
.operator-receive-form select { min-width: 112px; }
.row-more {
    position: relative;
    display: inline-block;
}
.row-more > summary {
    list-style: none;
    cursor: pointer;
    font-weight: 900;
    color: var(--muted);
    padding: 8px 10px;
    border-radius: 11px;
    background: #f2f4f7;
    user-select: none;
}
.row-more > summary::-webkit-details-marker { display: none; }
.row-more[open] > summary { background: var(--danger-soft); color: var(--danger); }
.row-more form {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 10;
    min-width: 150px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}
.row-more .btn { width: 100%; }

@media (max-width: 1180px) {
    .operator-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .operator-filter-actions { grid-column: 1 / -1; }
    .operator-actions-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .operator-panel-head,
    .table-title-row { flex-direction: column; }
    .admin-details { width: 100%; text-align: left; }
    .admin-details > summary { width: 100%; }
    .admin-details-panel {
        position: static;
        width: 100%;
        max-height: none;
        margin-top: 10px;
        box-shadow: var(--shadow-soft);
    }
    .compact-grid { grid-template-columns: 1fr; }
    .month-checks-compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .operator-row-actions { min-width: 220px; }
}
@media (max-width: 520px) {
    .operator-filter { grid-template-columns: 1fr; }
    .operator-summary { grid-template-columns: 1fr 1fr; }
    .month-checks-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .operator-action-box { padding: 13px; }
    .operator-table-wrap table { min-width: 650px; }
}


/* Mensalidades v1.12 - edição/cancelamento/exclusão responsiva */
.btn-warning { background: var(--warning); color: #fff; box-shadow: 0 8px 18px rgba(183,110,0,.14); }
.btn-warning:hover { background: #8a4b00; color: #fff; }
.page-actions-right { justify-content: flex-end; }
.status-row-cancelado td { background: #fffafa; }
.status-row-pago td { background: #fcfffd; }
.cobranca-action-stack {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}
.cobranca-more { position: relative; display: inline-block; }
.cobranca-more > summary {
    list-style: none;
    cursor: pointer;
    font-weight: 900;
    color: #344054;
    padding: 8px 11px;
    border-radius: 11px;
    background: #eef2f7;
    user-select: none;
}
.cobranca-more > summary::-webkit-details-marker,
.edit-details > summary::-webkit-details-marker { display: none; }
.cobranca-more[open] > summary { background: var(--primary-soft); color: var(--primary-2); }
.cobranca-more .row-more-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 7px);
    z-index: 30;
    width: min(560px, calc(100vw - 80px));
    max-height: 76vh;
    overflow: auto;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
    display: grid;
    gap: 10px;
}
.cobranca-more .row-more-panel form,
.cobranca-more .row-more-panel .edit-details {
    position: static;
    inset: auto;
    min-width: 0;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
.edit-details {
    border: 1px solid var(--border) !important;
    border-radius: 14px;
    padding: 10px !important;
    background: #fbfdfc !important;
}
.edit-details > summary {
    cursor: pointer;
    font-weight: 900;
    color: var(--primary-2);
    padding: 2px 0 10px;
}
.cobranca-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.cobranca-edit-obs { grid-column: 1 / -1; }
.cobranca-edit-actions { margin-top: 10px; }
.cobranca-more .row-more-panel .btn { width: 100%; }
.cobrancas-mobile-list { display: none; }
.cobranca-card-mobile {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    padding: 13px;
    box-shadow: 0 8px 18px rgba(16,24,40,.05);
    display: grid;
    gap: 12px;
}
.cobranca-card-mobile.status-pendente { border-left: 5px solid var(--warning); }
.cobranca-card-mobile.status-pago { border-left: 5px solid var(--ok); }
.cobranca-card-mobile.status-cancelado { border-left: 5px solid var(--danger); opacity: .94; }
.cobranca-card-head {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}
.cobranca-card-player { min-width: 0; }
.cobranca-card-player strong {
    display: block;
    font-size: 16px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cobranca-card-player small { display: block; color: var(--muted); margin-top: 3px; }
.cobranca-card-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.cobranca-card-info div {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 9px;
    background: #f8faf9;
}
.cobranca-card-info span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.cobranca-card-info strong { display: block; margin-top: 3px; font-size: 14px; }
.mobile-payment-info { margin: -2px 0 0; }
.row-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}
.row-check input { position: absolute; opacity: 0; pointer-events: none; }
.row-check span {
    width: 22px;
    height: 22px;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
}
.row-check input:checked + span {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: inset 0 0 0 4px #fff;
}

@media (max-width: 1180px) {
    .cobranca-more .row-more-panel { right: auto; left: 0; }
}
@media (max-width: 860px) {
    .page-actions-right { justify-content: stretch; }
    .cobrancas-desktop-table { display: none; }
    .cobrancas-mobile-list { display: grid; gap: 12px; }
    .cobranca-action-stack { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .cobranca-action-stack > .badge { min-height: 40px; }
    .cobranca-action-stack .operator-receive-form {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }
    .cobranca-action-stack .operator-receive-form .btn { grid-column: auto; }
    .cobranca-more { position: static; width: 100%; grid-column: 1 / -1; }
    .cobranca-more > summary { width: 100%; text-align: center; min-height: 44px; display: grid; place-items: center; }
    .cobranca-more .row-more-panel {
        position: static;
        width: 100%;
        max-height: none;
        margin-top: 8px;
        box-shadow: var(--shadow-soft);
    }
    .cobranca-edit-grid { grid-template-columns: 1fr; }
    .cobranca-edit-obs { grid-column: auto; }
}
@media (max-width: 520px) {
    .operator-summary { grid-template-columns: 1fr 1fr; }
    .cobranca-card-head { grid-template-columns: 26px minmax(0, 1fr); }
    .cobranca-card-head .badge { grid-column: 2; justify-self: start; }
    .cobranca-card-info { grid-template-columns: 1fr; }
    .cobranca-action-stack { grid-template-columns: 1fr; }
    .cobranca-action-stack .operator-receive-form { grid-template-columns: 1fr; }
}
