:root {
  --bg: #0a0a0b;
  --bg-soft: #111214;
  --border: rgba(219, 169, 79, 0.22);
  --yellow: #dba94f;
  --yellow-strong: #f2c56e;
  --text: #ffffff;
  --muted: #9ca3af;
  --danger: #dc2626;
  --green: #22c55e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(135deg, #000, #0f1115 50%, #000);
  color: var(--text);
}
a { text-decoration: none; }
button, input, select { font: inherit; }
.app-shell { max-width: 1280px; margin: 0 auto; padding: 32px; }
.topbar {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 24px;
}
.brand-wrap { display: flex; align-items: center; gap: 16px; }
.brand-wrap h1 { margin: 0; font-size: 2.2rem; }
.brand-wrap p { margin: 4px 0 0; color: var(--muted); }
.logo-mark { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; }
.logo-mark svg { width: 100%; height: 100%; }
.top-actions, .logged-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.logged-actions { flex-direction: row; align-items: center; flex-wrap: wrap; }
.login-form, .panel, .card { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 18px; }
.login-form { display: flex; align-items: center; gap: 8px; padding: 12px; flex-wrap: wrap; }
.login-form input { background: #000; border: 1px solid #30343b; color: #fff; padding: 10px 12px; border-radius: 10px; }
.btn-primary, .btn-danger, .link-btn {
  display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: 12px; padding: 10px 14px; cursor: pointer;
}
.btn-primary { background: var(--yellow); color: #000; font-weight: 700; }
.btn-danger { background: var(--danger); color: #fff; font-weight: 700; }
.link-btn { background: #1f2937; color: #fff; }
.badge-admin { background: var(--yellow); color: #000; font-weight: 700; border-radius: 999px; padding: 8px 14px; }
.welcome-admin { color: var(--muted); }
.flash { padding: 12px 14px; border-radius: 12px; font-weight: 700; }
.flash.success { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.flash.error { background: rgba(220, 38, 38, 0.15); color: #fca5a5; }
.panel { padding: 24px; margin-bottom: 24px; }
.panel-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.panel-row select, .panel input, .panel select { background: #000; color: #fff; border: 1px solid #30343b; border-radius: 12px; padding: 10px 12px; }
.panel-title, .section-head h2, .panel-header-inline h2 { color: var(--yellow); margin: 0; }
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 24px; }
.card { padding: 24px; min-height: 260px; }
.card-gold { background: var(--yellow); color: #000; }
.center { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; }
.icon { font-size: 56px; }
.highlight-name {
  color: #fff; background: rgba(31, 41, 55, 0.9); border: 1px solid rgba(255,255,255,0.15); padding: 12px 18px; border-radius: 14px; font-size: 1.75rem; font-weight: 800;
}
.subline { color: var(--muted); }
.card-gold .subline { color: #1a1a1a; }
.big-number, .meta-value, .percent { font-weight: 800; }
.big-number { font-size: 4rem; }
.meta-value { font-size: 2rem; }
.percent { font-size: 3.2rem; color: var(--yellow-strong); }
.progress-track { width: 100%; max-width: 340px; height: 32px; background: #1f2937; border-radius: 999px; overflow: hidden; border: 1px solid rgba(219, 169, 79, 0.22); }
.progress-bar { height: 100%; background: var(--yellow); transition: width .5s ease; }
.meta-info { width: 100%; max-width: 340px; display: flex; justify-content: space-between; color: var(--muted); }
.meta-info strong { color: var(--yellow-strong); }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.section-head span, .calendar-title, .panel-row, .subline, .meta-info span { color: var(--muted); }
.ranking-table, .history-head, .history-row { width: 100%; }
.ranking-head, .ranking-row, .history-head, .history-row { display: grid; gap: 12px; }
.ranking-head, .ranking-row { grid-template-columns: minmax(0,1.8fr) .8fr .8fr .8fr; }
.history-head, .history-row { grid-template-columns: 1fr 1fr 1fr; }
.ranking-head, .history-head { color: var(--yellow); font-weight: 700; border-bottom: 1px solid #333842; padding-bottom: 10px; }
.ranking-row, .history-row { border-bottom: 1px solid #22262d; padding: 12px 0; align-items: center; }
.consultor-col { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.consultor-name { font-weight: 700; word-break: break-word; }
.position { width: 28px; color: #fff; font-weight: 700; }
.crown { animation: float 1.6s infinite; }
@keyframes float { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-4px);} }
.leader-row { background: rgba(219, 169, 79, 0.08); box-shadow: 0 0 14px rgba(255,215,0,.2); border-radius: 12px; padding-left: 10px; padding-right: 10px; }
.leader-badge { background: var(--yellow); color: #000; border-radius: 999px; padding: 4px 8px; font-size: .75rem; font-weight: 700; }
.monthly { color: var(--yellow-strong); font-weight: 800; }
.calendar-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.nav-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; background: #374151; color: #fff; border-radius: 10px; }
.nav-btn.disabled { opacity: .35; pointer-events: none; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; }
.weekdays { margin-bottom: 12px; color: #fff; text-align: center; }
.day-cell { background: #374151; border: 1px solid #4b5563; border-radius: 12px; min-height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.day-number { color: #fff; font-weight: 700; }
.day-unlocks { color: var(--yellow-strong); font-size: .8rem; font-weight: 700; }
.blank { min-height: 72px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 18px; }
.pager-box { background: #1f2937; padding: 10px 16px; border-radius: 10px; min-width: 92px; text-align: center; }
.admin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.admin-card.full { grid-column: 1 / -1; }
.stack-form, .setup-form { display: grid; gap: 12px; }
.grid-form { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.full-span { grid-column: 1 / -1; }
.inline-edit-row, .consultor-row, .inline-form-admin, .inline-create-form { display: flex; gap: 10px; align-items: center; }
.inline-edit-row { justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #22262d; }
.icon-save, .icon-edit, .icon-delete {
  width: 38px; height: 38px; border: none; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.icon-save, .icon-edit { background: #1f2937; color: #86efac; }
.icon-delete { background: #1f2937; color: #f87171; }
.list-block { display: grid; gap: 10px; margin-top: 14px; }
.grow { flex: 1; }
.danger-box p { color: var(--muted); }
.setup-page { min-height: 100vh; display: grid; place-items: center; }
.setup-box { width: min(520px, calc(100% - 32px)); background: var(--bg-soft); border: 1px solid var(--border); border-radius: 18px; padding: 24px; }
.setup-box h1 { margin-top: 0; }
@media (max-width: 980px) {
  .cards-grid, .admin-grid, .grid-form { grid-template-columns: 1fr; }
  .ranking-head, .ranking-row, .history-head, .history-row { grid-template-columns: 1fr; }
}
.top-highlight-card .highlight-name {
    margin-top: 18px;
    margin-bottom: 18px;
    padding: 14px 22px;
    line-height: 1.2;
}

.top-highlight-card .top-unlocks-count {
    margin-top: 6px;
    padding-bottom: 6px;
}

.meta-card .progress-track {
    margin-top: 18px;
    margin-bottom: 18px;
}

.meta-card .meta-info {
    margin-top: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.meta-card .percent {
    margin-top: 16px;
}

#dashboard-content.is-loading {
    opacity: 0.55;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
#dashboard-content.is-loading {
    opacity: 0.55;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.dashboard-footer {
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center !important;
    align-items: center;
    margin-top: 18px;
    padding: 10px 0 8px;
    text-align: center;
}

.dashboard-footer small {
    display: block;
    width: 100%;
    font-size: 11px;
    opacity: 0.7;
    color: #cfcfcf;
    letter-spacing: 0.2px;
    text-align: center !important;
}
.date-picker-wrap {
    position: relative;
    width: 100%;
}

.date-input {
    width: 100%;
    padding-right: 52px;
    cursor: pointer;
}

.date-picker-btn {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #dba94f;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}

.date-picker-btn:hover {
    opacity: 0.85;
}

.cpf-mask {
    letter-spacing: 0.5px;
}
/* =========================
   INDEX PREMIUM - HEADER
========================= */
.topbar-public.topbar-premium {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 24px 18px;
    margin-bottom: 28px;
    min-height: 120px;
}

.brand-wrap-centered {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: left;
}

.brand-logo-box {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.brand-logo-original {
    display: block;
    width: auto;
    height: auto;
    max-width: 96px;
    max-height: 128px;
    object-fit: contain;
}

.brand-copy-centered {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.brand-copy-centered h1 {
    margin: 0 0 4px;
    line-height: 1.02;
    font-size: clamp(1.7rem, 3vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #ffffff;
}

.brand-copy-centered p {
    margin: 0;
    font-size: clamp(0.88rem, 1vw, 1rem);
    color: rgba(255, 255, 255, 0.88);
    font-weight: 400;
}

.logged-actions-floating {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
}

.dashboard-content-spaced {
    margin-top: 8px;
}

.topbar-public.topbar-premium::after {
    content: "";
    position: absolute;
    left: 10%;
    right: 10%;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(219, 169, 79, 0.45), transparent);
}

/* =========================
   MODO TV / TELA GRANDE
========================= */
.app-shell-tv {
    max-width: 1440px;
}

.app-shell-tv-mode {
    max-width: 1780px;
    padding: 28px 34px;
}

.tv-mode-body {
    background: radial-gradient(circle at top, #111317 0%, #050505 55%, #000000 100%);
}

.topbar-tv-mode {
    padding-top: 18px;
    padding-bottom: 18px;
    margin-bottom: 22px;
}

.brand-wrap-tv {
    gap: 18px;
}

.brand-logo-tv {
    max-width: 120px;
    max-height: 156px;
}

.brand-copy-tv h1 {
    font-size: clamp(2.2rem, 3.8vw, 3.4rem);
}

.brand-copy-tv p {
    font-size: clamp(1rem, 1.5vw, 1.3rem);
}

.dashboard-content-tv {
    margin-top: 4px;
}

.panel-tv-filter {
    padding-top: 22px;
    padding-bottom: 22px;
}

.month-select-tv {
    min-width: 260px;
    min-height: 52px;
    font-size: 1.15rem;
}

.cards-grid-tv {
    grid-template-columns: repeat(3, minmax(280px, 1fr));
    gap: 26px;
}

.cards-grid-tv-mode {
    gap: 28px;
}

.card-tv {
    min-height: 320px;
    padding: 30px;
}

.card-tv h3 {
    font-size: 1.6rem;
}

.card-tv .highlight-name {
    font-size: 2rem;
    padding: 16px 24px;
}

.card-tv .big-number {
    font-size: 5.2rem;
}

.card-tv .meta-value {
    font-size: 2.8rem;
}

.card-tv .percent {
    font-size: 4.2rem;
}

.card-tv .subline,
.card-tv .meta-info,
.card-tv .meta-info strong {
    font-size: 1.08rem;
}

.icon-tv {
    font-size: 72px;
}

.panel-tv .ranking-head,
.panel-tv .ranking-row {
    font-size: 1.15rem;
}

.panel-tv .leaderboard-position {
    width: 40px;
    min-width: 40px;
    height: 40px;
    font-size: 1rem;
}

.panel-tv .consultor-name {
    font-size: 1.12rem;
}

.dashboard-footer-tv {
    margin-top: 20px;
    padding-bottom: 4px;
}

.dashboard-footer-tv small {
    font-size: 12px;
}

/* =========================
   ANIMAÇÕES LEVES
========================= */
.animated-card {
    animation: cardFadeUp 0.55s ease both;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.animated-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
    border-color: rgba(219, 169, 79, 0.42);
}

.cards-grid .animated-card:nth-child(1) {
    animation-delay: 0.05s;
}

.cards-grid .animated-card:nth-child(2) {
    animation-delay: 0.12s;
}

.cards-grid .animated-card:nth-child(3) {
    animation-delay: 0.19s;
}

.trophy-icon {
    animation: trophyFloat 2.6s ease-in-out infinite;
}

@keyframes cardFadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes trophyFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

/* =========================
   LEADERBOARD PREMIUM
========================= */
.panel-leaderboard {
    position: relative;
    overflow: hidden;
}

.panel-leaderboard::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(219, 169, 79, 0.03), transparent 24%);
    pointer-events: none;
}

.leaderboard-head {
    letter-spacing: 0.02em;
}

.leaderboard-row {
    position: relative;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    border-radius: 14px;
    padding-left: 12px;
    padding-right: 12px;
}

.leaderboard-row:hover {
    transform: scale(1.01);
    background: rgba(255, 255, 255, 0.02);
}

.leaderboard-position {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    min-width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #1f2937;
    color: #fff;
    font-weight: 800;
}

.gold-rank {
    background: linear-gradient(90deg, rgba(219, 169, 79, 0.16), rgba(219, 169, 79, 0.04));
    border: 1px solid rgba(219, 169, 79, 0.30);
    box-shadow: 0 0 18px rgba(219, 169, 79, 0.14);
}

.silver-rank {
    background: linear-gradient(90deg, rgba(203, 213, 225, 0.10), rgba(203, 213, 225, 0.03));
    border-radius: 14px;
}

.bronze-rank {
    background: linear-gradient(90deg, rgba(180, 83, 9, 0.12), rgba(180, 83, 9, 0.03));
    border-radius: 14px;
}

.rank-medal {
    font-size: 1.05rem;
}

.crown-pop {
    animation: crownPulse 1.8s ease-in-out infinite;
}

@keyframes crownPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.12);
    }
}

/* =========================
   RODAPÉ DE ATUALIZAÇÃO
========================= */
.dashboard-footer {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 18px;
    padding: 10px 0 6px;
    text-align: center;
}

.dashboard-footer small {
    font-size: 11px;
    color: #9a9a9a;
    opacity: 0.9;
    letter-spacing: 0.2px;
}

/* =========================
   PAINÉIS MAIS PREMIUM
========================= */
.panel {
    border-radius: 22px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.card {
    border-radius: 24px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.20);
}

.card h3,
.section-head h2,
.calendar-title,
.panel-title {
    letter-spacing: -0.02em;
}

.top-highlight-card .highlight-name {
    border-radius: 18px;
}

.progress-track {
    overflow: hidden;
    border-radius: 999px;
}

.progress-bar {
    border-radius: 999px;
}

/* =========================
   RESPONSIVO
========================= */
@media (max-width: 980px) {
    .topbar-public.topbar-premium {
        padding: 20px 16px 16px;
        margin-bottom: 22px;
        min-height: auto;
        flex-direction: column;
    }

    .brand-wrap-centered {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 10px;
    }

    .brand-copy-centered {
        align-items: center;
    }

    .brand-logo-original {
        max-width: 82px;
        max-height: 108px;
    }

    .brand-copy-centered h1 {
        font-size: clamp(1.45rem, 6vw, 2rem);
        margin-bottom: 4px;
    }

    .brand-copy-centered p {
        font-size: 0.95rem;
    }

    .logged-actions-floating {
        position: static;
        transform: none;
        margin-top: 14px;
    }

    .cards-grid-tv,
    .cards-grid-tv-mode,
    .cards-grid,
    .admin-grid,
    .grid-form {
        grid-template-columns: 1fr;
    }

    .ranking-head,
    .ranking-row,
    .history-head,
    .history-row {
        grid-template-columns: 1fr;
    }

    .app-shell-tv-mode {
        max-width: 100%;
        padding: 20px 16px;
    }

    .brand-logo-tv {
        max-width: 90px;
        max-height: 118px;
    }

    .brand-copy-tv h1 {
        font-size: clamp(1.7rem, 8vw, 2.3rem);
    }

    .brand-copy-tv p {
        font-size: 1rem;
    }

    .card-tv {
        min-height: auto;
        padding: 24px;
    }

    .card-tv .big-number {
        font-size: 4rem;
    }

    .card-tv .percent {
        font-size: 3.4rem;
    }

    .month-select-tv {
        min-width: 100%;
        width: 100%;
    }
}