:root {
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-blue: #f2f7ff;
  --text: #102039;
  --text-strong: #07152a;
  --muted: #6b7a90;
  --line: #dfe7f1;
  --line-strong: #cfd9e7;
  --navy: #08162b;
  --navy-2: #102d52;
  --blue: #246bfd;
  --blue-dark: #1755db;
  --cyan: #48b7ff;
  --green: #0d9a63;
  --green-soft: #e8f8f1;
  --red: #d34444;
  --red-soft: #fff0f0;
  --yellow: #c78114;
  --yellow-soft: #fff7e5;
  --gray: #66768c;
  --shadow-sm: 0 8px 24px rgba(9, 30, 66, .06);
  --shadow-md: 0 18px 45px rgba(9, 30, 66, .09);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 24px;
  --shell: 1480px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 0%, rgba(72, 183, 255, .10), transparent 25%),
    linear-gradient(180deg, #edf3fa 0, var(--bg) 420px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

/* Header */
.app-header {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(125deg, rgba(8, 22, 43, .98) 0%, rgba(15, 43, 78, .98) 52%, rgba(22, 79, 146, .98) 100%);
}
.app-header::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .12;
  background-image:
    linear-gradient(rgba(255,255,255,.25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.25) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 90%);
}
.header-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(6px);
  pointer-events: none;
}
.header-glow-a {
  width: 420px;
  height: 420px;
  top: -290px;
  left: 8%;
  background: rgba(72,183,255,.24);
}
.header-glow-b {
  width: 390px;
  height: 390px;
  right: 1%;
  bottom: -300px;
  background: rgba(36,107,253,.28);
}
.header-inner {
  position: relative;
  z-index: 1;
  width: min(var(--shell), calc(100% - 40px));
  margin: 0 auto;
  padding: 22px 0 34px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  text-decoration: none;
}
.brand-icon {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  border: 1px solid rgba(255,255,255,.23);
  background: linear-gradient(145deg, rgba(255,255,255,.20), rgba(255,255,255,.08));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 12px 28px rgba(0,0,0,.15);
}
.brand-icon span { font-weight: 900; letter-spacing: -.05em; }
.brand-copy { min-width: 0; }
.brand-copy h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -.04em;
}
.brand-copy h1 em {
  color: #7ed3ff;
  font-style: normal;
  font-weight: 800;
}
.brand-copy p {
  margin: 5px 0 0;
  color: rgba(255,255,255,.67);
  font-size: 12px;
  white-space: nowrap;
}
.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.icon-btn,
.top-actions .btn {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.19);
  border-radius: 12px;
  background: rgba(255,255,255,.09);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.icon-btn:hover,
.top-actions .btn:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.32);
}
.icon-btn > span:first-child { font-size: 16px; line-height: 1; }
.icon-btn.auto-off { background: rgba(199,129,20,.35); border-color: rgba(255,217,151,.45); }
.auto-refresh-status {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.09);
  color: rgba(255,255,255,.88);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.auto-refresh-status::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #82e6b2;
  box-shadow: 0 0 0 4px rgba(130,230,178,.12);
}
.auto-refresh-status.loading::before { background: #79c7ff; animation: pulse 1s infinite; }
.auto-refresh-status.paused::before { background: #ffd27b; }
.auto-refresh-status.error::before { background: #ff8d8d; }
@keyframes pulse { 50% { opacity: .35; } }

.overview {
  display: grid;
  grid-template-columns: minmax(300px, 1.15fr) minmax(520px, 1.85fr);
  gap: 22px;
  margin-top: 38px;
}
.overview-main {
  min-height: 182px;
  padding: 24px 26px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(255,255,255,.12), rgba(255,255,255,.06));
  box-shadow: 0 20px 55px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.12);
  backdrop-filter: blur(12px);
}
.eyebrow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.eyebrow {
  color: rgba(255,255,255,.68);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .10em;
}
.live-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(10, 195, 119, .14);
  border: 1px solid rgba(130, 230, 178, .22);
  color: #c8ffe1;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.live-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #70e3aa;
  box-shadow: 0 0 0 4px rgba(112,227,170,.12);
}
.profit-display {
  display: block;
  margin-top: 18px;
  font-size: clamp(42px, 5vw, 64px);
  line-height: .95;
  letter-spacing: -.065em;
}
.overview-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 17px;
  color: rgba(255,255,255,.67);
  font-size: 12px;
  font-weight: 700;
}
.meta-separator { width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,.35); }
.overview-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.overview-kpi {
  min-height: 182px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 22px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
}
.overview-kpi > span {
  color: rgba(255,255,255,.64);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.overview-kpi strong {
  display: block;
  margin: 13px 0 7px;
  font-size: clamp(30px, 3vw, 40px);
  line-height: 1;
  letter-spacing: -.045em;
}
.overview-kpi small { color: rgba(255,255,255,.62); font-size: 12px; }
.overview-kpi b { color: #fff; }

/* Sticky section nav */
.section-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(207,217,231,.88);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(15px);
}
.section-nav-inner {
  width: min(var(--shell), calc(100% - 40px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.section-nav-inner::-webkit-scrollbar { display: none; }
.section-nav a {
  position: relative;
  flex: 0 0 auto;
  padding: 15px 15px 14px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 850;
}
.section-nav a::after {
  content: "";
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: transparent;
}
.section-nav a:hover,
.section-nav a.active { color: var(--blue-dark); }
.section-nav a.active::after { background: var(--blue); }

/* Shell and common panels */
.dashboard-shell {
  width: min(var(--shell), calc(100% - 40px));
  margin: 22px auto 46px;
}
.panel {
  margin: 0;
  padding: 22px;
  border: 1px solid rgba(207,217,231,.82);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow-sm);
}
.panel-heading,
.section-heading,
.filter-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.panel-heading { margin-bottom: 17px; }
.panel-heading.compact { margin-bottom: 14px; }
.panel-heading h2,
.section-heading h2,
.filter-heading h2 {
  margin: 2px 0 0;
  color: var(--text-strong);
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: -.035em;
}
.panel-heading h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: -.025em;
}
.panel-heading p,
.section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.section-kicker {
  color: var(--blue-dark);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .10em;
  text-transform: uppercase;
}
.updated-at,
.summary-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-blue);
  border: 1px solid #dce9ff;
  color: #45617f;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}
.content-grid { display: grid; gap: 18px; }
.section-block { margin-top: 28px; }
.section-heading { margin: 0 2px 16px; }

/* Filters */
.filter-panel { margin-bottom: 16px; }
.filter-heading { align-items: center; }
.filter-heading-actions { display: flex; align-items: center; gap: 8px; }
.text-btn,
.filter-toggle {
  min-height: 36px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}
.text-btn { padding: 0 10px; }
.text-btn:hover { background: var(--surface-blue); }
.filter-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}
.filter-toggle b { transition: transform .2s ease; }
.filter-toggle[aria-expanded="true"] b { transform: rotate(180deg); }
.filters-body {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) repeat(4, minmax(130px, .7fr));
  gap: 12px;
  margin-top: 18px;
}
.field { min-width: 0; }
.field label {
  display: block;
  margin: 0 0 7px 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}
input, select {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder { color: #9aa7b8; }
input:focus, select:focus {
  border-color: #86afff;
  box-shadow: 0 0 0 4px rgba(36,107,253,.09);
}
.input-with-icon { position: relative; }
.input-with-icon > span {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #8ea0b7;
  font-size: 20px;
  pointer-events: none;
}
.input-with-icon input { padding-left: 39px; }

/* Secondary metrics */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(125px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.metric-card {
  position: relative;
  min-height: 94px;
  overflow: hidden;
  padding: 15px 16px;
  border: 1px solid rgba(207,217,231,.82);
  border-radius: var(--radius);
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow-sm);
}
.metric-card::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -24px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(36,107,253,.05);
}
.metric-card > span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.metric-card strong {
  display: block;
  margin-top: 10px;
  color: var(--text-strong);
  font-size: 25px;
  line-height: 1;
  letter-spacing: -.04em;
}
.metric-green strong { color: var(--green); }
.metric-red strong { color: var(--red); }
.metric-warning strong { color: var(--yellow); }

/* Insights */
.insight-panel { margin-bottom: 18px; }
.insights-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.insight-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid #e4ebf4;
  border-radius: 15px;
  background: linear-gradient(180deg, #fbfdff, #f7faff);
}
.insight-item span {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #eaf2ff;
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 950;
}
.insight-item p {
  margin: 2px 0 0;
  color: #42536a;
  font-size: 13px;
  line-height: 1.45;
}

/* Moment and alerts */
.moment-grid { grid-template-columns: minmax(0, 1.18fr) minmax(330px, .82fr); }
.last-dots {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 78px;
  padding: 14px;
  overflow-x: auto;
  border: 1px solid #e1e9f3;
  border-radius: 16px;
  background: linear-gradient(180deg, #fafcff, #f4f8fd);
  scrollbar-width: thin;
}
.result-dot {
  position: relative;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 3px solid rgba(255,255,255,.8);
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 9px 20px rgba(10,30,60,.13);
}
.result-dot span { font-size: 15px; font-weight: 950; }
.result-dot small {
  position: absolute;
  right: -4px;
  bottom: -5px;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  font-size: 9px;
  font-weight: 900;
}
.result-dot.green { background: linear-gradient(145deg, #20ba7c, #087c50); }
.result-dot.red { background: linear-gradient(145deg, #f26767, #b92d2d); }
.result-dot.void { background: linear-gradient(145deg, #9aa8ba, #59677b); }
.result-dot.pendente { background: linear-gradient(145deg, #f5bd51, #b46e06); }
.result-dot.revisar { background: linear-gradient(145deg, #f7a82f, #9b5700); }
.result-dot.erro { background: linear-gradient(145deg, #f47f94, #a42841); }
.moment-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin-top: 11px;
}
.moment-stats > div {
  padding: 12px 13px;
  border: 1px solid #e2e9f2;
  border-radius: 14px;
  background: #f9fbfd;
}
.moment-stats span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.moment-stats strong {
  display: block;
  margin-top: 7px;
  color: var(--text-strong);
  font-size: 19px;
  line-height: 1;
  letter-spacing: -.035em;
}
.smart-alerts { display: grid; gap: 9px; }
.smart-alert {
  padding: 13px 14px;
  border: 1px solid #e0e8f2;
  border-left-width: 4px;
  border-radius: 13px;
  background: #fafcfe;
}
.smart-alert strong { display: block; color: var(--text-strong); font-size: 12px; }
.smart-alert p { margin: 4px 0 0; color: #55667c; font-size: 12px; line-height: 1.42; }
.smart-alert.good { border-left-color: var(--green); background: #f4fcf8; }
.smart-alert.danger { border-left-color: var(--red); background: #fff7f7; }
.smart-alert.warning { border-left-color: var(--yellow); background: #fffaf0; }
.smart-alert.info { border-left-color: var(--blue); background: #f5f9ff; }

/* Analytics */
.analytics-main { grid-template-columns: minmax(320px, .74fr) minmax(0, 1.26fr); }
.analytics-triple { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; }
.analytics-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); margin-top: 18px; }
.chart-panel { min-height: 334px; }
.chart-canvas-wrap { position: relative; min-height: 245px; }
.chart-canvas-wrap canvas { width: 100%; max-width: 100%; }
.donut-wrap {
  min-height: 245px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  flex-wrap: wrap;
}
.donut {
  --g: 0%; --r: 0%; --p: 0%; --v: 0%;
  width: 166px;
  height: 166px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(
    var(--green) 0 var(--g),
    var(--red) var(--g) calc(var(--g) + var(--r)),
    #e3a12d calc(var(--g) + var(--r)) calc(var(--g) + var(--r) + var(--p)),
    #93a1b4 calc(var(--g) + var(--r) + var(--p)) 100%
  );
  box-shadow: 0 16px 34px rgba(8,22,43,.12);
}
.donut-hole {
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px #eef2f7;
}
.donut-hole strong { color: var(--text-strong); font-size: 29px; line-height: 1; letter-spacing: -.04em; }
.donut-hole span { margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 850; }
.legend { display: grid; gap: 9px; min-width: 165px; }
.legend div {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  align-items: center;
  gap: 6px;
  color: #53647a;
  font-size: 12px;
}
.legend b { color: var(--text-strong); }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.green-bg { background: var(--green) !important; color: #fff !important; }
.red-bg { background: var(--red) !important; color: #fff !important; }
.yellow-bg { background: #d7901d !important; color: #fff !important; }
.gray-bg { background: #7b899c !important; color: #fff !important; }
.neutral-bg { background: #3d4d62 !important; color: #fff !important; }

.bars { display: grid; gap: 10px; }
.bar-row {
  padding: 11px 12px;
  border: 1px solid #e4eaf2;
  border-radius: 13px;
  background: #fafbfd;
}
.bar-head,
.bar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.bar-head strong { color: var(--text-strong); font-size: 12px; }
.bar-head span { color: var(--muted); font-size: 10px; text-align: right; }
.bar-track {
  height: 7px;
  margin: 9px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf4;
}
.bar-fill { height: 100%; min-width: 5px; border-radius: 999px; background: var(--blue); }
.bar-fill.green { background: var(--green); }
.bar-fill.red { background: var(--red); }
.bar-fill.neutral { background: #7c8da2; }
.bar-foot { color: #748297; font-size: 9px; font-weight: 750; }

.rank-table { overflow-x: auto; }
.rank-inner { width: 100%; border-collapse: collapse; }
.rank-inner th,
.rank-inner td {
  padding: 10px 8px;
  border-bottom: 1px solid #e8edf3;
  text-align: left;
  font-size: 11px;
  white-space: nowrap;
}
.rank-inner th {
  color: #78869a;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.rank-inner td:first-child {
  max-width: 240px;
  overflow: hidden;
  color: var(--text-strong);
  font-weight: 800;
  text-overflow: ellipsis;
}
.leagues-performance { margin-top: 18px; }
.split-rank {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.rank-column {
  padding: 15px;
  border: 1px solid #e3eaf2;
  border-radius: 16px;
  background: #fbfcfe;
}
.rank-column-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}
.rank-column-title span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  font-weight: 900;
}
.rank-column-title h4 { margin: 0; color: var(--text-strong); font-size: 13px; }
.rank-best .rank-column-title span { background: var(--green-soft); color: var(--green); }
.rank-worst .rank-column-title span { background: var(--red-soft); color: var(--red); }

/* Signals table */
.signals-panel { margin-top: 28px; }
.signals-heading { align-items: center; }
.table-wrap {
  overflow: auto;
  max-height: 760px;
  border: 1px solid #e1e8f1;
  border-radius: 16px;
  background: #fff;
}
.desktop-table-wrap table {
  min-width: 1660px;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.desktop-table-wrap th,
.desktop-table-wrap td {
  padding: 10px 9px;
  border-bottom: 1px solid #e7edf4;
  text-align: left;
  vertical-align: top;
  font-size: 11px;
}
.desktop-table-wrap th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #667890;
  background: #f7f9fc;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.desktop-table-wrap tbody tr:nth-child(even) td { background: #fbfcfe; }
.desktop-table-wrap tbody tr:hover td { background: #f2f7ff; }
.date-text { color: #5f7086; white-space: nowrap; }
.league-text { color: #455a72; }
.mini-link {
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
  color: var(--blue-dark);
  text-decoration: none;
  font-size: 10px;
  font-weight: 850;
}
.mini-link:hover { text-decoration: underline; }
.cell-input,
.signal-input {
  width: 78px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 11px;
}
.cell-input.tiny { width: 62px; }
.actions { min-width: 220px; }
.btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--blue);
  font-size: 11px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.03); }
.btn.small { min-height: 29px; padding: 0 8px; margin: 2px; border-radius: 8px; font-size: 9px; }
.btn.warning { background: #d7901d; }
.btn.full { width: 100%; min-height: 45px; }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.badge.pendente { background: var(--yellow-soft); color: #9a6007; }
.badge.green { background: var(--green-soft); color: #087849; }
.badge.red { background: var(--red-soft); color: #ad3030; }
.badge.void { background: #eef1f5; color: #5e6d80; }
.badge.revisar { background: #fff5dd; color: #9c5e00; border: 1px solid #f6dea7; }
.badge.erro { background: #ffeded; color: #ae3131; border: 1px solid #f8c9c9; }
.ref-odd {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 8px;
  background: #edf3ff;
  color: #315ba4;
  font-weight: 900;
}
.auto-info { display: inline-block; max-width: 150px; color: #42536a; font-size: 10px; line-height: 1.25; }
.auto-info small { color: #7a899d; }
.cell-readonly { color: var(--text-strong); font-weight: 850; white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.green, .num.green { color: var(--green) !important; font-weight: 900; }
.red, .num.red { color: var(--red) !important; font-weight: 900; }
.warning-text { color: var(--yellow) !important; font-weight: 900; }
.neutral, .num.neutral { color: var(--gray) !important; font-weight: 900; }
.muted { color: var(--muted); }
.empty,
.empty-row {
  padding: 20px;
  color: var(--muted);
  text-align: center;
  border-radius: 13px;
  background: #f8fafc;
}
.mobile-signals { display: none; }

/* Mobile signal cards */
.signal-card {
  overflow: hidden;
  border: 1px solid #dfe7f1;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(9,30,66,.045);
}
.signal-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid #e9eef4;
  background: #fbfcfe;
}
.signal-card-title { min-width: 0; }
.signal-card-title h3 {
  margin: 0;
  overflow: hidden;
  color: var(--text-strong);
  font-size: 14px;
  line-height: 1.3;
  text-overflow: ellipsis;
}
.signal-card-title p {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.signal-card-body { padding: 13px 14px; }
.signal-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.signal-summary-item {
  min-width: 0;
  padding: 9px;
  border: 1px solid #e6ecf3;
  border-radius: 11px;
  background: #fafbfd;
}
.signal-summary-item span {
  display: block;
  color: #8390a2;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.signal-summary-item strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--text-strong);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.signal-card-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin-top: 13px;
}
.signal-detail span {
  display: block;
  color: #8794a6;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.signal-detail strong {
  display: block;
  margin-top: 4px;
  color: #405168;
  font-size: 11px;
  line-height: 1.35;
}
.signal-card-admin {
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid #e8edf3;
}
.signal-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.signal-edit-grid label {
  display: block;
  color: #7f8da0;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}
.signal-edit-grid input {
  height: 37px;
  margin-top: 5px;
  padding: 0 9px;
  font-size: 12px;
}
.signal-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}
.signal-actions .btn { min-width: 0; min-height: 34px; padding: 0 4px; font-size: 8px; }
.signal-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}
.signal-card-footer .mini-link { margin: 0; }
.signal-profit { font-size: 17px; font-weight: 950; letter-spacing: -.03em; }

/* Access mode */
.mode-pill {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,.09);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}
.mode-pill.admin { background: rgba(13,154,99,.22); }
.mode-pill.public { background: rgba(199,129,20,.23); }
.public-mode .admin-only { display: none !important; }
.public-mode .admin-action { display: none !important; }
.public-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 15px;
  border: 1px solid #efddb5;
  border-radius: 14px;
  color: #83540b;
  background: #fff9ed;
  font-size: 12px;
  font-weight: 750;
}
.public-banner a { color: var(--blue-dark); text-decoration: none; font-weight: 900; }

/* Utilities */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  max-width: min(380px, calc(100% - 32px));
  padding: 12px 15px;
  border-radius: 13px;
  color: #fff;
  background: #0a172a;
  box-shadow: 0 18px 46px rgba(3,13,29,.25);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: .2s ease;
  font-size: 12px;
  font-weight: 750;
}
.toast.show { opacity: 1; transform: translateY(0); }
.back-to-top {
  position: fixed;
  right: 19px;
  bottom: 76px;
  z-index: 25;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #dbe4ef;
  border-radius: 50%;
  color: var(--navy);
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow-md);
  cursor: pointer;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 10%, rgba(72,183,255,.20), transparent 25%),
    linear-gradient(135deg, #071427, #123b6c);
}
.login-wrap { width: min(100%, 420px); }
.login-card {
  padding: 27px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 25px;
  background: rgba(255,255,255,.97);
  box-shadow: 0 30px 80px rgba(0,0,0,.26);
}
.login-brand { color: var(--text-strong); }
.login-brand .brand-icon { color: #fff; background: linear-gradient(145deg, #123b6c, #246bfd); }
.login-brand .brand-copy p { color: var(--muted); }
.login-form { display: grid; gap: 9px; margin-top: 24px; }
.login-form label {
  margin-top: 6px;
  color: #5e6d80;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.login-form input { height: 45px; }
.login-error { min-height: 18px; margin: 11px 0 0; color: var(--red); font-size: 12px; font-weight: 800; }
.login-card > .mini-link { margin-top: 7px; }

/* Responsive */
@media (max-width: 1180px) {
  .overview { grid-template-columns: 1fr; }
  .overview-main { min-height: 160px; }
  .overview-kpi { min-height: 145px; }
  .filters-body { grid-template-columns: minmax(260px, 1.5fr) repeat(2, minmax(130px, 1fr)); }
  .metric-strip { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
  .analytics-main,
  .analytics-split { grid-template-columns: 1fr; }
  .analytics-triple { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .moment-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .header-inner,
  .dashboard-shell,
  .section-nav-inner { width: min(100% - 24px, var(--shell)); }
  .header-inner { padding: 16px 0 24px; }
  .topbar { align-items: flex-start; }
  .brand-copy p { display: none; }
  .top-actions { max-width: 58%; }
  .auto-refresh-status { order: 10; width: 100%; justify-content: center; }
  .btn-label { display: none; }
  .icon-btn { width: 39px; padding: 0; }
  .top-actions .btn { min-width: 39px; padding: 0 10px; }
  .overview { margin-top: 24px; gap: 12px; }
  .overview-kpis { gap: 9px; }
  .overview-kpi { min-height: 125px; padding: 16px; }
  .overview-kpi strong { font-size: 29px; }
  .panel { padding: 17px; border-radius: 19px; }
  .filter-toggle { display: inline-flex; }
  .filters-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    max-height: 520px;
    opacity: 1;
    transition: max-height .22s ease, opacity .18s ease, margin .22s ease;
  }
  .filters-body.collapsed { max-height: 0; opacity: 0; margin-top: 0; pointer-events: none; }
  .field-search { grid-column: 1 / -1; }
  .metric-strip {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .metric-strip::-webkit-scrollbar { display: none; }
  .metric-card { flex: 0 0 150px; scroll-snap-align: start; }
  .insights-list { grid-template-columns: 1fr; }
  .analytics-triple { grid-template-columns: 1fr; }
  .split-rank { grid-template-columns: 1fr; }
  .desktop-table-wrap { display: none; }
  .mobile-signals { display: grid; gap: 11px; }
  .signals-panel { padding: 15px; }
  .back-to-top { right: 13px; bottom: 68px; }
}

@media (max-width: 560px) {
  html { scroll-padding-top: 60px; }
  body { background: #f3f6fa; }
  .header-inner,
  .dashboard-shell,
  .section-nav-inner { width: min(100% - 20px, var(--shell)); }
  .app-header::after { background-size: 38px 38px; }
  .brand-icon { flex-basis: 43px; width: 43px; height: 43px; border-radius: 13px; }
  .brand-copy h1 { font-size: 20px; }
  .top-actions { max-width: 55%; gap: 5px; }
  .icon-btn { width: 36px; min-height: 36px; border-radius: 10px; }
  .auto-refresh-status { min-height: 31px; font-size: 9px; }
  .mode-pill { min-height: 31px; font-size: 9px; }
  .overview-main { min-height: 145px; padding: 18px; }
  .profit-display { font-size: 46px; }
  .overview-meta { flex-wrap: wrap; gap: 7px; font-size: 10px; }
  .overview-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-kpi { min-height: 108px; padding: 14px; border-radius: 17px; }
  .overview-kpi:first-child { grid-column: 1 / -1; min-height: 112px; }
  .overview-kpi > span { font-size: 9px; }
  .overview-kpi strong { margin: 10px 0 5px; font-size: 28px; }
  .overview-kpi small { font-size: 10px; }
  .section-nav a { padding: 13px 11px 12px; font-size: 10px; }
  .section-nav a::after { left: 11px; right: 11px; }
  .dashboard-shell { margin-top: 14px; }
  .panel { padding: 15px; border-radius: 17px; }
  .panel-heading,
  .section-heading,
  .filter-heading { gap: 10px; }
  .panel-heading h2,
  .section-heading h2,
  .filter-heading h2 { font-size: 18px; }
  .panel-heading h3 { font-size: 15px; }
  .updated-at { display: none; }
  .filter-heading-actions { align-self: flex-end; }
  .text-btn { display: none; }
  .filters-body { grid-template-columns: 1fr 1fr; gap: 9px; }
  .field-search { grid-column: 1 / -1; }
  .field label { font-size: 9px; }
  input, select { height: 41px; font-size: 12px; }
  .metric-card { flex-basis: 132px; min-height: 82px; padding: 13px; }
  .metric-card strong { font-size: 22px; }
  .moment-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-dot { flex-basis: 42px; width: 42px; height: 42px; }
  .donut-wrap { min-height: 225px; gap: 18px; }
  .donut { width: 146px; height: 146px; }
  .donut-hole { width: 94px; height: 94px; }
  .legend { width: 100%; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legend div { grid-template-columns: 14px 1fr auto; }
  .signals-heading { align-items: flex-start; }
  .signal-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .signal-card-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .signal-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .public-banner { align-items: flex-start; flex-direction: column; }
  .toast { right: 12px; bottom: 12px; }
}

@media (max-width: 380px) {
  .top-actions { max-width: 48%; }
  .overview-kpis { grid-template-columns: 1fr; }
  .overview-kpi:first-child { grid-column: auto; }
  .filters-body { grid-template-columns: 1fr; }
  .field-search { grid-column: auto; }
  .signal-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .signal-edit-grid { grid-template-columns: 1fr; }
  .signal-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
