/* TopAfiliados: apresentação e navegação, sem alterações nas regras do painel. */
body.panel-ui {
  --muted: #a5b3cd;
  --line: rgba(148, 177, 230, .18);
  --shadow: 0 10px 32px rgba(0, 5, 18, .18);
}
html[data-theme="light"] body.panel-ui {
  --muted: #536580;
  --line: #d9e3f1;
  --accent-2: #245fbd;
  --shadow: 0 8px 28px rgba(35, 65, 110, .06);
}
.panel-ui [hidden] { display: none !important; }
.panel-ui :is(button, a, input, select, summary):focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 4px;
}
.panel-ui button:disabled { cursor: wait; opacity: .65; }
.panel-ui .ico { display: inline-flex; flex: 0 0 auto; width: 22px; height: 22px; }
.panel-ui .ico svg { width: 100%; height: 100%; }
.panel-ui .btn { gap: 8px; }
.panel-ui .dn-video-stage::after {
  background: linear-gradient(180deg, rgba(5, 12, 25, .76), rgba(5, 12, 25, .92));
}
.panel-ui::before, .panel-ui::after { animation: none; will-change: auto; }
.panel-ui.has-video-background::before { opacity: .08; }
.panel-ui.has-video-background::after { opacity: .03; }
.panel-ui :is(.m-card, .m-pay, .m-team, .m-hist) {
  background: var(--bg-card);
  border-color: var(--line);
  box-shadow: var(--shadow);
}
.panel-ui .m-sticky { background: color-mix(in srgb, var(--bg) 96%, transparent); backdrop-filter: blur(16px); }
.panel-ui .m-logo, .panel-ui .m-head-copy { min-width: 0; }
.panel-ui .m-head-copy strong { line-height: 1.3; }
.panel-ui .m-head-actions { gap: 7px; flex-shrink: 0; }
.panel-ui .m-head-actions .icon-btn { width: 42px; height: 42px; }
.panel-ui .home-welcome { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 12px 0 24px; }
.panel-ui .home-welcome h1 { margin: 7px 0; font-size: clamp(1.75rem, 3vw, 2.3rem); letter-spacing: -.045em; }
.panel-ui .home-welcome p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.6; }
.panel-ui .home-data-status { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.panel-ui .home-data-status > span { max-width: 220px; font-size: .73rem; line-height: 1.5; color: var(--muted); }
.panel-ui .home-data-status.has-error > span { color: var(--warn); }
.panel-ui .home-data-status .btn { width: auto; min-height: 42px; padding: 9px 13px; font-size: .76rem; }
.panel-ui .home-data-status .ico { width: 17px; height: 17px; }
.panel-ui .home-hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-bottom: 28px; }
.panel-ui .home-balance-card {
  display: flex;
  flex-direction: column;
  min-height: 265px;
  padding: 26px;
  border: 1px solid #3762a6;
  border-radius: 22px;
  background: radial-gradient(ellipse at 100% 0, rgba(75, 139, 249, .24), transparent 70%), #102746;
  box-shadow: var(--shadow);
}
.panel-ui .home-balance-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.panel-ui .home-balance-heading .m-kicker { color: #c6dcff; font-size: .78rem; }
.panel-ui .home-balance-heading .ico { color: #91bdff; }
.panel-ui .home-balance-value { margin: 16px 0 5px; font-size: clamp(2.1rem, 3.6vw, 3.25rem); line-height: 1.15; color: #fff; overflow-wrap: anywhere; }
.panel-ui .home-balance-caption { margin: 0 0 24px; color: #b2c5e2; font-size: .79rem; line-height: 1.5; }
.panel-ui .home-balance-actions { margin-top: auto; grid-template-columns: 1fr 1fr; }
.panel-ui .home-balance-actions .btn-ghost { background: rgba(255,255,255,.055); color: #e7f0ff; border-color: rgba(190,215,255,.26); }
.panel-ui .home-balance-card .m-hint { color: #b2c5e2; font-size: .76rem; line-height: 1.6; }
.panel-ui .home-quick-card { min-width: 0; padding: 23px; border: 1px solid var(--line); border-radius: 22px; background: var(--bg-card); box-shadow: var(--shadow); }
.panel-ui .home-quick-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 19px; }
.panel-ui .home-quick-heading h2 { margin: 0; font-size: .98rem; }
.panel-ui .home-quick-heading > span { padding: 5px 9px; border-radius: 8px; background: var(--bg-card-2); color: var(--muted); font-size: .68rem; }
.panel-ui .home-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.panel-ui .home-quick-action { display: grid; grid-template-columns: 25px 1fr 12px; align-items: center; gap: 10px; padding: 17px 12px; min-height: 88px; text-align: left; border: 1px solid var(--line); border-radius: 13px; background: var(--bg-card-2); }
.panel-ui .home-quick-action > .ico { color: var(--accent-2); }
.panel-ui .home-quick-action strong { display: block; font-size: .8rem; line-height: 1.4; }
.panel-ui .home-quick-action small { display: block; margin-top: 5px; color: var(--muted); font-size: .69rem; line-height: 1.5; }
.panel-ui .home-quick-action > span:last-child { color: var(--muted); font-size: .88rem; }
.panel-ui .home-quick-action:hover { border-color: var(--accent-2); background: color-mix(in srgb, var(--bg-card-2) 88%, var(--accent)); }
.panel-ui .home-results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 24px 0 16px; }
.panel-ui .home-results-toolbar h2 { margin: 0; font-size: 1.08rem; }
.panel-ui .home-results-toolbar p { margin: 7px 0 0; font-size: .79rem; color: var(--muted); }
.panel-ui .home-period-wrap { width: min(410px, 100%); flex: 0 1 410px; margin: 0; }
.panel-ui .home-period-wrap .m-period { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 13px; background: var(--bg-card); }
.panel-ui .home-period-wrap .m-period button { min-height: 40px; padding: 8px 6px; font-size: .79rem; border-radius: 8px; box-shadow: none; }
.panel-ui .home-analytics-grid { margin-bottom: 18px; gap: 18px; }
.panel-ui .m-today-grid small { font-size: .76rem; }
.panel-ui .m-today-grid b { font-variant-numeric: tabular-nums; }
.panel-ui .home-withdraw-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; }
.panel-ui .home-withdraw-summary > div { display: flex; align-items: center; gap: 14px; min-width: 0; }
.panel-ui .home-withdraw-summary .ico { color: var(--accent-2); }
.panel-ui .home-withdraw-summary strong { display: block; font-size: .86rem; }
.panel-ui .home-withdraw-summary small { display: block; color: var(--muted); margin-top: 5px; font-size: .77rem; line-height: 1.5; }
.panel-ui .home-withdraw-summary .btn { flex-shrink: 0; width: auto; font-size: .76rem; }
.panel-ui .home-house-total b { color: var(--text); }
.panel-ui .home-house-row { min-height: 78px; }
.panel-ui .home-house-name small, .panel-ui .home-house-total small { font-size: .72rem; }
.panel-ui .home-house-note { font-size: .75rem; line-height: 1.65; }
.panel-ui .platform-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, .42fr); gap: 16px; margin-top: 24px; }
.panel-ui .platform-toolbar label { display: block; margin-bottom: 8px; color: var(--muted); font-size: .78rem; font-weight: 600; }
.panel-ui .platform-search > div { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-card); }
.panel-ui .platform-search .ico { color: var(--muted); width: 19px; height: 19px; }
.panel-ui .platform-search input { width: 100%; min-width: 0; min-height: 48px; border: 0; background: transparent; color: var(--text); font-size: .88rem; }
.panel-ui .platform-search input::placeholder { color: var(--muted); }
.panel-ui .platform-search > div:focus-within { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.panel-ui .platform-search input:focus-visible { outline: none; }
.panel-ui .platform-status select { width: 100%; min-height: 50px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-card); color: var(--text); font-size: .83rem; }
.panel-ui .platform-result-count { margin: 13px 0; font-size: .76rem; color: var(--muted); }
.panel-ui .platform-results { gap: 16px; margin-bottom: 22px; }
.panel-ui .platform-result { min-width: 0; }
.panel-ui .platform-result > .casa-card { width: 100%; height: 100%; margin: 0; }
.panel-ui .panel-empty { padding: 34px 22px; text-align: center; }
.panel-ui .panel-empty > .ico { width: 32px; height: 32px; color: var(--accent-2); }
.panel-ui .panel-empty h1, .panel-ui .panel-empty h2 { font-size: 1.15rem; }
.panel-ui .panel-empty p { color: var(--muted); line-height: 1.65; font-size: .88rem; }
.panel-ui .panel-empty .btn { width: auto; margin: 18px auto 0; }
.panel-ui .panel-details { margin: 24px 0; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-card); }
.panel-ui .panel-details summary { padding: 20px; font-size: .88rem; font-weight: 700; cursor: pointer; }
.panel-ui .panel-details > .m-card { margin: 0; border: 0; background: transparent; box-shadow: none; }
.panel-ui .platform-tools h2 { margin: 0 0 18px; font-size: 1rem; }
.panel-ui .platform-tools-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.panel-ui .platform-tools-grid .m-btn { margin: 0; min-width: 0; }
.panel-ui .panel-loading { padding: 16px 0; }
.panel-ui .panel-loading > p { color: var(--muted); font-size: .88rem; }
.panel-ui .panel-skeleton { min-height: 260px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(100deg, var(--bg-card) 30%, var(--bg-card-2) 50%, var(--bg-card) 70%); background-size: 250% 100%; animation: panel-loading 1.8s ease-in-out infinite; }
.panel-ui .panel-skeleton-wide { min-height: 180px; }
@keyframes panel-loading { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.panel-ui .desktop-nav-help { display: none; }
.panel-ui .nav-label-short { display: none; }
.panel-ui .bottom-nav { background: color-mix(in srgb, var(--bg-elev) 96%, transparent); border-color: var(--line); }
.panel-ui .bottom-nav > button { min-width: 0; font-size: .7rem; }
.panel-ui .bottom-nav > button.active { color: var(--accent-2); }
html[data-theme="light"] .panel-ui .dn-video-stage::after { background: rgba(241,246,254,.97); }
html[data-theme="light"] .panel-ui :is(.login-layout, .login-card, .login-layout .login-card) { background: #fff; border-color: var(--line); }
html[data-theme="light"] .panel-ui .login-showcase { color: #fff; }
html[data-theme="light"] .panel-ui .login-kicker { color: #245fbd; }
html[data-theme="light"] .panel-ui :is(.m-link, .m-chip, .demo-badge, .badge-count) { color: #245fbd; background: #e9f1ff; }
html[data-theme="light"] .panel-ui .bottom-nav > button { color: #536580; }
html[data-theme="light"] .panel-ui .bottom-nav > button.active { color: #1d4ed8; background: #e6efff; border-color: #c3d7fc; }
html[data-theme="light"] .panel-ui .home-balance-card { color: #fff; }

@media (min-width: 1200px) {
  .panel-ui :is(.shell, .shell.home, .shell.m-home, .shell.ativar-page) {
    width: min(1320px, calc(100% - 280px));
    margin-left: max(260px, calc((100% - 1320px + 240px) / 2));
    margin-right: 20px;
    padding: 18px 16px 48px;
  }
  .panel-ui .bottom-nav, .panel-ui .bottom-nav.nav-gerente {
    position: fixed; top: 18px; bottom: 18px; left: 16px; right: auto;
    transform: none; display: flex; flex-direction: column; gap: 6px;
    width: 226px; height: auto; padding: 22px 13px; overflow-y: auto;
    border-radius: 20px; box-shadow: var(--shadow);
  }
  .panel-ui .desktop-nav-brand { display: flex; align-items: center; gap: 10px; margin: 0 0 29px; padding: 0 5px; }
  .panel-ui .desktop-nav-brand img { width: 41px; height: 41px; }
  .panel-ui .desktop-nav-brand strong { font-size: 1rem; }
  .panel-ui .desktop-nav-brand span { font-size: .65rem; }
  .panel-ui .desktop-nav-label { display: block; color: var(--muted); padding: 0 13px 8px; font-size: .65rem; }
  .panel-ui .bottom-nav > button, .panel-ui .desktop-nav-help > button {
    display: flex; flex-direction: row; align-items: center; justify-content: flex-start;
    width: 100%; min-height: 49px; gap: 12px; padding: 12px 14px;
    border: 1px solid transparent; border-radius: 11px; color: var(--muted);
    text-align: left; font-size: .85rem; font-weight: 600;
  }
  .panel-ui .bottom-nav > button:hover, .panel-ui .desktop-nav-help > button:hover { color: var(--text); background: var(--bg-card-2); }
  .panel-ui .bottom-nav > button .ico, .panel-ui .desktop-nav-help .ico { width: 20px; height: 20px; }
  .panel-ui .desktop-nav-help { display: grid; gap: 4px; padding-top: 18px; margin-top: auto; border-top: 1px solid var(--line); }
  .panel-ui .desktop-nav-status { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 0 14px; color: var(--muted); font-size: .67rem; }
}
@media (max-width: 1199px) {
  .panel-ui :is(.shell, .shell.m-home, .shell.ativar-page) { padding-bottom: calc(108px + env(safe-area-inset-bottom)); }
  .panel-ui .bottom-nav { width: min(630px, calc(100% - 16px)); min-height: 72px; }
  .panel-ui .bottom-nav > button { min-height: 55px; }
  .panel-ui .nav-label-full { display: none; }
  .panel-ui .bottom-nav .nav-label-short { display: block; }
}
@media (max-width: 960px) {
  .panel-ui .home-welcome { flex-direction: column; align-items: flex-start; gap: 14px; }
  .panel-ui .home-data-status { width: 100%; justify-content: space-between; }
  .panel-ui .home-data-status > span { max-width: none; }
  .panel-ui .home-hero-grid { grid-template-columns: 1fr; gap: 14px; }
  .panel-ui .home-balance-card { min-height: 0; }
  .panel-ui .home-quick-action { min-height: 76px; }
  .panel-ui .home-results-toolbar { flex-direction: column; align-items: stretch; gap: 14px; }
  .panel-ui .home-period-wrap { width: 100%; flex: none; max-width: none; }
}
@media (max-width: 620px) {
  .panel-ui .m-head-copy strong { font-size: .9rem; }
  .panel-ui .m-logo { gap: 8px; }
  .panel-ui .m-logo .brand-mark { width: 34px; height: 34px; }
  .panel-ui .m-head-actions { gap: 5px; }
  .panel-ui .m-head-actions .icon-btn { width: 38px; height: 38px; }
  .panel-ui .home-welcome { margin: 12px 0 20px; }
  .panel-ui .home-welcome p { font-size: .83rem; }
  .panel-ui .home-balance-card, .panel-ui .home-quick-card { padding: 20px; }
  .panel-ui .home-balance-value { font-size: clamp(2rem, 9vw, 2.8rem); }
  .panel-ui .home-quick-action { grid-template-columns: 22px 1fr; padding: 13px 10px; gap: 8px; }
  .panel-ui .home-quick-action > span:last-child { display: none; }
  .panel-ui .home-quick-action strong { font-size: .77rem; }
  .panel-ui .home-quick-action small { font-size: .69rem; }
  .panel-ui .home-withdraw-summary { align-items: flex-start; flex-direction: column; }
  .panel-ui .home-withdraw-summary .btn { width: 100%; }
  .panel-ui .home-house-row { grid-template-columns: minmax(0, 1fr) auto 16px; }
  .panel-ui .home-house-total { display: block; text-align: right; }
  .panel-ui .home-house-total b { font-size: .76rem; }
  .panel-ui .home-house-total small { font-size: .63rem; }
  .panel-ui .platform-toolbar { grid-template-columns: 1fr; gap: 12px; }
  .panel-ui .platform-search input, .panel-ui .platform-status select { font-size: 16px; }
  .panel-ui .platform-results { gap: 12px; }
  .panel-ui .platform-tools-grid { grid-template-columns: 1fr 1fr; }
  .panel-ui .page-intro { flex-direction: column; gap: 16px; }
  .panel-ui .page-intro .btn { min-height: 44px; }
  .panel-ui .bottom-nav > button, .panel-ui .bottom-nav.nav-gerente > button { font-size: .62rem; padding: 7px 2px; }
  .panel-ui .bottom-nav > button .ico, .panel-ui .bottom-nav > button .ico svg { width: 20px; height: 20px; }
}
@media (max-width: 380px) {
  .panel-ui .platform-results, .panel-ui .platform-tools-grid { grid-template-columns: 1fr; }
  .panel-ui .m-head-actions .icon-btn { width: 34px; height: 36px; }
  .panel-ui .m-head-copy strong { max-width: 100px; }
  .panel-ui .home-balance-actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .panel-ui *, .panel-ui *::before, .panel-ui *::after { animation: none !important; scroll-behavior: auto !important; transition: none !important; }
}

/* X2X2 replaces the previous house while keeping its historical ledger key. */
.panel-ui .x2x2-launch-card { margin: 24px 0; }
.panel-ui .x2x2-launch-card::after { content: "X2X2"; font-size: 7rem; }
.panel-ui .x2x2-launch-card p { color: #dceaff; line-height: 1.6; }
.panel-ui .x2x2-launch-card .home-rate-row span { flex: 1; min-width: 0; text-align: center; }
.panel-ui .home-house-rates { flex-wrap: wrap; }
.panel-ui .ativar-rates { flex-wrap: wrap; }
