:root {
    --green-dark: #0b3d2e;
    --green-main: #146c43;
    --green-light: #e7f3ed;
    --gold: #d9a441;
    --bg-main: #f4f7f5;
    --text-dark: #1f2933;
    --text-muted: #6b7280;
    --white: #ffffff;
    --danger: #dc3545;
    --border-light: #e5e7eb;
    --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 12px 32px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
    font-family: "Inter", sans-serif;
}

/* ==============================
   LAYOUT
   ============================== */

.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #073022, var(--green-dark));
    color: var(--white);
    padding: 24px 18px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.main-content {
    margin-left: 280px;
    width: calc(100% - 280px);
    min-height: 100vh;
}

.content-area {
    padding: 28px;
}

.topbar {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-light);
    padding: 18px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #f8faf9;
    border: 1px solid var(--border-light);
    padding: 8px 14px;
    border-radius: 999px;
}

/* ==============================
   SIDEBAR
   ============================== */

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.logo-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background-color: var(--green-light);
    color: var(--green-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.sidebar-logo strong {
    display: block;
    font-size: 18px;
}

.sidebar-logo small {
    color: #cfe7dc;
    font-size: 12px;
}

.menu-label {
    color: #9fd3bc;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 22px 0 8px;
}

.sidebar-menu a {
    display: block;
    color: #eef8f3;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: 0.2s;
    font-size: 15px;
}

.sidebar-menu a:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: var(--white);
}

/* ==============================
   TIPOGRAFIA
   ============================== */

h1, h2, h3, h4, h5 {
    color: var(--green-dark);
}

h1 {
    font-weight: 800;
}

.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-weight: 800;
    margin-bottom: 6px;
}

.page-header p {
    color: var(--text-muted);
    margin-bottom: 0;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* ==============================
   CARDS
   ============================== */

.card,
.mbfc-card {
    background-color: var(--white);
    border: none;
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}

.card-body {
    padding: 22px;
}

.action-card,
.dashboard-card,
.mbfc-card-hover {
    transition: 0.22s ease;
}

.action-card:hover,
.dashboard-card:hover,
.mbfc-card-hover:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* ==============================
   CENTRAL DE CONTROLE
   ============================== */

.dashboard-icon,
.mbfc-icon-box {
    display: inline-flex;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background-color: var(--green-light);
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 12px;
}

.dashboard-card h2 {
    font-size: 30px;
    font-weight: 800;
    color: var(--green-dark);
}

.dashboard-card-highlight {
    border-left: 6px solid var(--gold);
}

/* ==============================
   BOTÕES
   ============================== */

.btn,
.mbfc-btn {
    border-radius: 12px;
    font-weight: 600;
    padding: 8px 14px;
}

.btn-success {
    background-color: var(--green-main);
    border-color: var(--green-main);
}

.btn-success:hover {
    background-color: var(--green-dark);
    border-color: var(--green-dark);
}

.btn-primary {
    background-color: #2563eb;
    border-color: #2563eb;
}

.btn-info {
    color: white;
    background-color: #0284c7;
    border-color: #0284c7;
}

.btn-warning {
    color: #1f2933;
    background-color: var(--gold);
    border-color: var(--gold);
}

/* ==============================
   TABELAS
   ============================== */

.table,
.mbfc-table {
    background-color: var(--white);
    border-radius: 16px;
    overflow: hidden;
}

.table thead,
.table-light {
    background-color: #f1f5f3;
}

.table th {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table td {
    vertical-align: middle;
}

/* ==============================
   FORMULÁRIOS
   ============================== */

.form-control,
.form-select {
    border-radius: 12px;
    border-color: #d7dedb;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--green-main);
    box-shadow: 0 0 0 0.2rem rgba(20, 108, 67, 0.15);
}

/* ==============================
   ALERTAS, BADGES E ACCORDIONS
   ============================== */

.alert {
    border: none;
    border-radius: 16px;
}

.badge {
    border-radius: 999px;
    padding: 7px 10px;
    font-weight: 600;
}

.accordion-item {
    border: none;
    border-radius: 16px !important;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    margin-bottom: 14px;
}

.accordion-button {
    font-weight: 800;
    color: var(--green-dark);
}

.accordion-button:not(.collapsed) {
    background-color: var(--green-light);
    color: var(--green-dark);
}

/* ==============================
   UTILITÁRIOS MBFC
   ============================== */

.mbfc-kicker {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}

.mbfc-money {
    color: var(--green-dark);
    font-weight: 800;
}

.mbfc-gold {
    color: var(--gold);
}

/* ==============================
   RESPONSIVIDADE
   ============================== */

@media (max-width: 900px) {

    .app-layout {
        display: block;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .topbar {
        display: block;
    }

    .user-box {
        margin-top: 12px;
        display: inline-flex;
    }
}

@media (max-width: 768px) {

    .content-area {
        padding: 18px;
    }

    h1 {
        font-size: 28px;
    }

    .card-body {
        padding: 18px;
    }

    .table {
        font-size: 14px;
    }

    .btn {
        margin-bottom: 6px;
    }
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-menu i {
    font-size: 17px;
    opacity: 0.9;
}

/* ==============================
   CENTRAL DE CONTROLE PREMIUM
   ============================== */

.control-hero {
    background: linear-gradient(135deg, var(--green-dark), var(--green-main));
    color: var(--white);
    border-radius: 24px;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    box-shadow: var(--shadow-soft);
}

.control-hero h1,
.control-hero p {
    color: var(--white);
}

.control-hero h1 {
    margin: 6px 0;
}

.control-hero .mbfc-kicker {
    color: #cfe7dc;
}

.hero-badge {
    background-color: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
}

.hero-badge i {
    font-size: 30px;
    color: var(--gold);
}

.premium-stat-card .card-body {
    padding: 18px;
}

.premium-stat-icon {
    width: 42px;
    height: 42px;
    background-color: var(--green-light);
    color: var(--green-dark);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 20px;
}

.premium-stat-card p {
    color: var(--text-muted);
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.premium-stat-card h2 {
    font-size: 24px;
    margin-bottom: 2px;
}

.premium-stat-card small {
    color: var(--text-muted);
}

.premium-stat-highlight {
    border-left: 6px solid var(--gold);
}

.section-title {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: start;
    margin-bottom: 18px;
}

.section-title h3 {
    margin-bottom: 3px;
    font-weight: 800;
}

.section-title p {
    color: var(--text-muted);
    margin-bottom: 0;
}

.next-game-item,
.ranking-mini-item,
.finance-line,
.finance-total {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}

.next-game-item:last-child,
.ranking-mini-item:last-child {
    border-bottom: none;
}

.finance-line span {
    color: var(--text-muted);
}

.finance-total {
    margin-top: 8px;
    padding: 18px;
    border-radius: 16px;
    background-color: var(--green-light);
    border-bottom: none;
}

.finance-total span {
    font-weight: 700;
    color: var(--green-dark);
}

.finance-total strong {
    font-size: 22px;
    color: var(--green-dark);
}

.ranking-position {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background-color: var(--green-light);
    color: var(--green-dark);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.quick-action {
    background-color: #f8faf9;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 18px;
    text-decoration: none;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: 0.2s ease;
}

.quick-action i {
    font-size: 24px;
    color: var(--green-main);
}

.quick-action span {
    font-weight: 700;
}

.quick-action:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    color: var(--green-dark);
}

.participant-panel {
    margin-bottom: 20px;
}

@media (max-width: 992px) {

    .control-hero {
        display: block;
    }

    .hero-badge {
        margin-top: 18px;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {

    .quick-actions-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        display: block;
    }
}

/* ==============================
   SIDEBAR PREMIUM
   ============================== */

.premium-sidebar-logo {
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.mbfc-symbol {
    background: radial-gradient(circle at center, var(--gold), #b8871b);
    color: var(--green-dark);
    font-weight: 900;
    letter-spacing: -1px;
}

.mbfc-symbol span {
    font-size: 14px;
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 14px;
    margin-bottom: 24px;
}

.sidebar-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background-color: var(--green-light);
    color: var(--green-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.sidebar-user-card strong {
    display: block;
    color: var(--white);
    font-size: 14px;
}

.sidebar-user-card small {
    color: #cfe7dc;
}

.sidebar-menu a.active {
    background-color: var(--green-light);
    color: var(--green-dark);
    font-weight: 800;
}

.sidebar-menu a.active i {
    color: var(--green-main);
}

.sidebar-footer {
    margin-top: 28px;
    padding: 16px;
    border-radius: 18px;
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--white);
}

.sidebar-footer strong {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
}

.sidebar-footer small {
    color: #cfe7dc;
    font-size: 12px;
}

/* ==============================
   RANKING PREMIUM
   ============================== */

.podium-card {
    position: relative;
    overflow: hidden;
}

.podium-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(20, 108, 67, 0.08),
        rgba(212, 175, 55, 0.12)
    );
    pointer-events: none;
}

.podium-card .card-body {
    position: relative;
    z-index: 1;
}

.podium-1 {
    border-top: 6px solid var(--gold);
}

.podium-2 {
    border-top: 6px solid #b8c2cc;
}

.podium-3 {
    border-top: 6px solid #b7791f;
}

.podium-medal {
    font-size: 42px;
    margin-bottom: 10px;
}

.podium-prize {
    margin-top: 14px;
    font-size: 22px;
    font-weight: 800;
    color: var(--green-dark);
}

.my-ranking-card {
    border-left: 6px solid var(--green-main);
    background: linear-gradient(135deg, #ffffff, var(--green-light));
}

.ranking-current-user {
    background-color: var(--green-light);
}

.sidebar-brand-logo {
    width: 100%;
    max-width: 210px;
    display: block;
    margin: 0 auto;
}

.premium-sidebar-logo {
    justify-content: center;
}

.sidebar-brand-logo {
    width: 100%;
    max-width: 220px;
    display: block;
    margin: 0 auto;
}

.premium-sidebar-logo {
    justify-content: center;
    padding-bottom: 18px;
    margin-bottom: 18px;
}

/* ==============================
   LOGIN
   ============================== */

.login-logo {

    width: 100%;
    max-width: 260px;

    display: block;

    margin: 0 auto 12px auto;

}

.card.shadow-sm {

    border-radius: 22px;

}

/* ==============================
   MOBILE APP / PWA
   ============================== */

.mobile-menu-toggle,
.sidebar-overlay {
    display: none;
}

.topbar-title {
    min-width: 0;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

.admin-boloes-list {
    display: grid;
    gap: 0;
}

.admin-boloes-header,
.admin-bolao-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(72px, 0.7fr) minmax(60px, 0.6fr) minmax(0, auto);
    gap: 14px;
    align-items: center;
}

.admin-boloes-header {
    border-bottom: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 800;
    padding: 0 0 12px;
    text-transform: uppercase;
}

.admin-bolao-row {
    border-bottom: 1px solid var(--border-light);
    padding: 16px 0;
}

.admin-bolao-row:last-child {
    border-bottom: 0;
}

.admin-bolao-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.admin-bolao-actions .btn {
    white-space: nowrap;
}

.admin-bolao-label {
    display: none;
}

.plans-admin-list {
    display: grid;
    gap: 0;
}

.plans-admin-column {
    min-width: 0;
}

.plans-admin-header,
.plans-admin-row {
    display: grid;
    grid-template-columns: minmax(62px, 0.8fr) minmax(68px, 0.75fr) minmax(78px, 0.85fr) minmax(42px, 0.5fr) minmax(50px, 0.55fr) minmax(56px, 0.6fr) minmax(54px, 0.6fr) minmax(86px, auto);
    gap: 8px;
    align-items: center;
    max-width: 100%;
    min-width: 0;
}

.plans-admin-header {
    border-bottom: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    padding: 0 0 10px;
    text-transform: uppercase;
}

.plans-admin-row {
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    padding: 12px 0;
}

.plans-admin-row:last-child {
    border-bottom: 0;
}

.plans-admin-row strong {
    font-size: 15px;
}

.plans-admin-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    min-width: 0;
}

.plans-admin-actions .btn {
    align-items: center;
    border-radius: 12px;
    display: inline-flex;
    font-size: 12px;
    gap: 4px;
    min-height: 34px;
    padding: 6px 8px;
    white-space: nowrap;
}

.plan-power-button {
    align-items: center;
    border: 0;
    border-radius: 999px;
    color: var(--white);
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    min-height: 34px;
    padding: 0;
    transition: 0.2s ease;
    white-space: nowrap;
    width: 38px;
}

.plan-power-button.is-on {
    background: #198754;
}

.plan-power-button.is-off {
    background: #6c757d;
}

.plan-power-button:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
}

.plans-admin-label {
    display: none;
}

@media (max-width: 1200px) {
    .plans-admin-actions .btn span {
        display: none;
    }

    .plans-admin-actions .btn {
        height: 34px;
        justify-content: center;
        padding: 0;
        width: 36px;
    }
}

@media (max-width: 768px) {
    .admin-boloes-header {
        display: none;
    }

    .admin-bolao-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .admin-bolao-label {
        color: var(--text-muted);
        display: inline-block;
        font-size: 12px;
        font-weight: 800;
        margin-right: 6px;
        text-transform: uppercase;
    }

    .admin-bolao-actions {
        justify-content: stretch;
    }

    .admin-bolao-actions .btn {
        flex: 1 1 132px;
    }

}

@media (max-width: 1100px) {
    .plans-admin-header,
    .plans-admin-row {
        grid-template-columns: minmax(58px, 0.8fr) minmax(64px, 0.75fr) minmax(76px, 0.85fr) minmax(36px, 0.45fr) minmax(44px, 0.5fr) minmax(46px, 0.55fr) minmax(48px, 0.55fr) minmax(82px, auto);
        gap: 6px;
    }

    .plans-admin-header {
        font-size: 11px;
    }

    .plans-admin-row {
        font-size: 13px;
    }

    .plans-admin-row strong {
        font-size: 14px;
    }

    .plans-admin-label {
        display: none;
    }

    .plans-admin-actions .btn span {
        display: none;
    }

    .plans-admin-actions .btn {
        height: 32px;
        justify-content: center;
        min-height: 32px;
        padding: 0;
        width: 34px;
    }

    .plan-power-button {
        height: 32px;
        min-height: 32px;
        width: 34px;
    }
}

@media (max-width: 520px) {
    .plans-admin-header {
        display: none;
    }

    .plans-admin-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .plans-admin-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .plans-admin-label {
        color: var(--text-muted);
        display: block;
        font-size: 12px;
        font-weight: 800;
        margin-bottom: 2px;
        text-transform: uppercase;
    }
}

@media (max-width: 900px) {
    .app-layout {
        display: block;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(84vw, 320px);
        height: 100dvh;
        z-index: 1045;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        padding-top: max(18px, env(safe-area-inset-top));
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1040;
        background: rgba(7, 48, 34, 0.42);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        min-width: 0;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 1030;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        gap: 12px;
        align-items: center;
        padding: 12px 16px;
    }

    .mobile-menu-toggle {
        position: relative;
        display: inline-flex;
        width: 42px;
        height: 42px;
        border: 1px solid var(--border-light);
        border-radius: 12px;
        background: var(--white);
        color: var(--green-dark);
        align-items: center;
        justify-content: center;
        font-size: 24px;
        cursor: pointer;
        touch-action: manipulation;
        z-index: 1035;
    }

    .user-box {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: space-between;
        margin-top: 0;
        border-radius: 14px;
    }

    .content-area {
        padding: 18px 14px calc(24px + env(safe-area-inset-bottom));
    }

    .page-header {
        margin-bottom: 18px;
    }

    .page-header h1,
    .control-hero h1 {
        font-size: 32px;
        line-height: 1.08;
    }

    .card,
    .mbfc-card,
    .alert,
    .accordion-item {
        border-radius: 14px;
    }

    .card-body {
        padding: 16px;
    }

    .control-hero {
        border-radius: 18px;
        padding: 22px;
    }

    .hero-badge {
        min-width: 0;
        width: 100%;
    }

    .table-responsive,
    .card:has(.table) {
        overflow-x: auto;
    }

    .table {
        min-width: 680px;
    }

    .btn {
        min-height: 42px;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 15px;
    }

    h1 {
        font-size: 28px;
    }

    h2, h3 {
        font-size: 22px;
    }

    .topbar-title small {
        display: none;
    }

    .user-box {
        font-size: 14px;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr;
    }

    .quick-action {
        min-height: 78px;
    }

    .section-title {
        display: block;
    }

    .section-title .btn,
    .section-title a.btn {
        width: 100%;
        margin-top: 12px;
    }

    .finance-line,
    .finance-total {
        align-items: flex-start;
    }
}
