* {
  box-sizing: border-box;
}

:root {
  --bg: #060913;
  --panel: #0d1324;
  --panel-2: #111a31;
  --text: #f7f9ff;
  --muted: #8e9bb5;
  --line: rgba(255,255,255,.09);
  --blue: #3b82f6;
  --blue-2: #60a5fa;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #f59e0b;
  --shadow: 0 24px 70px rgba(0,0,0,.35);
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(59,130,246,.25), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(96,165,250,.15), transparent 28rem),
    var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(6,9,19,.72);
  backdrop-filter: blur(18px);
  padding: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 34px;
  position: relative;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--blue), #111827);
  font-weight: 900;
  box-shadow: 0 16px 45px rgba(59,130,246,.35);
}

.brand span,
.muted {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 10px;
}

.nav-item,
.ghost-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  border-radius: 14px;
  padding: 13px 14px;
  transition: .2s ease;
}

.nav-item:hover,
.nav-item.active,
.ghost-btn:hover {
  background: rgba(59,130,246,.12);
  color: var(--text);
  border-color: rgba(96,165,250,.2);
}

.sidebar-card {
  margin-top: 30px;
  background: linear-gradient(180deg, rgba(59,130,246,.18), rgba(255,255,255,.04));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
}

.sidebar-stats {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.sidebar-stats div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-stats span {
  color: var(--muted);
  font-size: 12px;
}

.main {
  padding: 34px;
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  margin-bottom: 26px;
  position: relative;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-menu-btn,
.mobile-menu {
  display: none;
}

.mobile-menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.eyebrow {
  color: var(--blue-2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 12px;
  margin: 0 0 8px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 46px);
  margin-bottom: 0;
}

.primary-btn,
.submit-btn {
  border: 0;
  background: linear-gradient(135deg, var(--blue), #2563eb);
  color: white;
  border-radius: 16px;
  padding: 13px 18px;
  font-weight: 800;
  box-shadow: 0 16px 38px rgba(59,130,246,.25);
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.kpi-card,
.panel,
.form-card {
  background: linear-gradient(180deg, rgba(17,26,49,.96), rgba(13,19,36,.94));
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.kpi-card {
  padding: 22px;
}

.kpi-card span {
  color: var(--muted);
  font-size: 14px;
}

.kpi-card strong {
  display: block;
  font-size: 28px;
  margin-top: 8px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 16px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 16px;
  margin-top: 16px;
}

.panel,
.form-card {
  padding: 24px;
}

.panel-header,
.form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.panel-header p,
.config-panel p {
  color: var(--muted);
  margin-bottom: 0;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.055);
  color: var(--text);
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
}

select:focus,
input:focus,
textarea:focus {
  border-color: rgba(96,165,250,.7);
  box-shadow: 0 0 0 4px rgba(59,130,246,.12);
}

select option {
  background: #0d1324;
  color: var(--text);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

textarea {
  resize: vertical;
  min-height: 118px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.summary-list {
  display: grid;
  gap: 12px;
}

.summary-list div,
.mini-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.summary-list span,
.mini-item span {
  color: var(--muted);
}

.mini-list {
  display: grid;
  gap: 10px;
}

.mini-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255,255,255,.035);
}

.form-card {
  max-width: 980px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 16px;
}

.pill {
  border: 1px solid rgba(96,165,250,.25);
  color: var(--blue-2);
  background: rgba(59,130,246,.12);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
}

.result-box {
  grid-column: span 2;
  display: grid;
  gap: 10px;
}

.result-box > span {
  color: var(--muted);
  font-weight: 800;
  font-size: 14px;
}

.status-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.status-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-radius: 16px;
  padding: 13px;
  font-weight: 900;
}

.status-btn.pending.active {
  background: rgba(148,163,184,.18);
  border-color: rgba(148,163,184,.65);
}

.status-btn.green.active {
  background: rgba(34,197,94,.18);
  border-color: rgba(34,197,94,.6);
}

.status-btn.red.active {
  background: rgba(239,68,68,.18);
  border-color: rgba(239,68,68,.6);
}

.status-btn.void.active {
  background: rgba(245,158,11,.18);
  border-color: rgba(245,158,11,.6);
}

.preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 22px 0;
}

.preview div {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  border-radius: 18px;
  padding: 16px;
}

.preview span {
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}

.preview strong {
  font-size: 22px;
}

.positive {
  color: #86efac;
}

.negative {
  color: #fca5a5;
}

.neutral {
  color: #fcd34d;
}

.pending-unit {
  color: #cbd5e1;
}

.bar-chart,
.rank-list,
.finance-history {
  display: grid;
  gap: 12px;
}

.bar-chart {
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  align-items: end;
  min-height: 260px;
}

.bar-column {
  display: grid;
  grid-template-rows: auto 150px auto auto;
  align-items: end;
  justify-items: center;
  gap: 8px;
  color: var(--muted);
  min-width: 0;
}

.bar-value {
  display: grid;
  gap: 2px;
  min-height: 46px;
  text-align: center;
}

.bar-value span,
.rank-values small {
  color: var(--muted);
  font-size: 12px;
}

.vertical-track {
  width: 28px;
  height: 150px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  display: flex;
  align-items: flex-end;
}

.vertical-track.compact {
  height: 128px;
}

.vertical-fill {
  width: 100%;
  border-radius: inherit;
}

.vertical-fill.positive {
  background: linear-gradient(90deg, #22c55e, #86efac);
}

.vertical-fill.negative {
  background: linear-gradient(90deg, #ef4444, #fca5a5);
}

.rank-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 16px;
}

.rank-item,
.finance-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,.035);
}

.rank-item > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-values {
  display: grid;
  justify-items: end;
  gap: 2px;
}

.ranking-panel {
  max-width: 1240px;
}

.ranking-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 16px;
}

.ranking-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255,255,255,.025);
}

.ranking-card h3 {
  margin-bottom: 14px;
}

.ranking-list {
  display: grid;
  gap: 10px;
}

.ranking-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,.035);
}

.ranking-main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.ranking-main strong,
.ranking-main small {
  display: block;
}

.ranking-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-main small,
.ranking-metrics span {
  color: var(--muted);
  font-size: 12px;
}

.ranking-position {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: rgba(59,130,246,.15);
  color: var(--blue-2);
  font-weight: 900;
}

.ranking-metrics {
  display: grid;
  justify-items: end;
  gap: 2px;
  text-align: right;
}

.insight-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 12px;
}

.insight-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255,255,255,.035);
}

.insight-item span,
.insight-item em {
  display: block;
}

.insight-item span {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.insight-item strong {
  display: block;
  margin: 6px 0;
}

.insight-item em {
  font-style: normal;
  font-weight: 900;
}

.submit-btn {
  width: 100%;
  padding: 16px;
}

.filters {
  display: grid;
  grid-template-columns: 170px 260px;
  gap: 10px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 950px;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 13px;
  background: rgba(255,255,255,.04);
}

.status-pill {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
}

.status-pill.green {
  background: rgba(34,197,94,.16);
  color: #86efac;
}

.status-pill.red {
  background: rgba(239,68,68,.16);
  color: #fca5a5;
}

.status-pill.void {
  background: rgba(245,158,11,.16);
  color: #fcd34d;
}

.status-pill.pending {
  background: rgba(148,163,184,.16);
  color: #cbd5e1;
}

.config-panel {
  max-width: 820px;
}

.finance-panel {
  max-width: 1180px;
}

.finance-grid {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 20px;
}

.finance-form .submit-btn {
  margin-top: 18px;
}

.balances-field {
  grid-column: span 2;
}

.finance-item {
  align-items: flex-start;
  flex-direction: column;
}

.finance-item span {
  color: var(--muted);
}

.balance-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.balance-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255,255,255,.04);
}

.balance-card-grid,
.option-builders {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}

.balance-card,
.option-builder,
.config-subcard {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255,255,255,.035);
}

.config-subcard {
  margin-top: 18px;
}

.config-subcard .primary-btn {
  margin-top: 14px;
}

.field-title {
  color: var(--muted);
  font-weight: 800;
  font-size: 14px;
}

.option-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 8px;
}

.option-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.option-chip,
.icon-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  color: var(--text);
  padding: 7px 10px;
  font-weight: 800;
}

.option-chip span {
  color: #fca5a5;
}

.legacy-options,
.legacy-instructions {
  display: none;
}

.history-status {
  min-width: 150px;
  padding: 8px 10px;
  border-radius: 999px;
  border-color: transparent;
  font-weight: 900;
}

.history-status.red {
  background: rgba(239,68,68,.16);
  color: #fca5a5;
}

.history-status.green {
  background: rgba(34,197,94,.16);
  color: #86efac;
}

.history-status.void {
  background: rgba(245,158,11,.16);
  color: #fcd34d;
}

.history-status.pending {
  background: rgba(148,163,184,.16);
  color: #cbd5e1;
}

.history-status.manual {
  background: rgba(59,130,246,.18);
  color: #93c5fd;
}

.day-group-row td {
  background: rgba(59,130,246,.08);
  border-bottom: 1px solid rgba(96,165,250,.18);
}

.day-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.day-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0;
  text-align: left;
}

.day-group strong {
  color: var(--text);
}

.day-group span {
  color: var(--muted);
}

.icon-btn {
  width: 34px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 10px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,.62);
}

.modal.show {
  display: flex;
}

.modal-card {
  width: min(920px, 100%);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(17,26,49,.98), rgba(13,19,36,.98));
  box-shadow: var(--shadow);
}

.config-actions {
  display: flex;
  gap: 10px;
  margin: 16px 0 24px;
}

.options-manager {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 20px;
}

.options-manager .primary-btn {
  margin-top: 16px;
}

.monthly-stakes {
  margin: 18px 0;
}

.monthly-stakes h3 {
  margin-bottom: 12px;
}

.monthly-stake-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 16px;
}

.instructions {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 20px;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: #111827;
  color: white;
  border: 1px solid var(--line);
  padding: 14px 16px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: .2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px 14px 10px;
  }

  .nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 6px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 auto;
    text-align: center;
    min-height: 44px;
    padding: 11px 14px;
    font-size: 13px;
    border-radius: 12px;
    white-space: nowrap;
  }

  .sidebar-card {
    display: none;
  }

  .main {
    width: 100%;
    max-width: 100vw;
    padding: 16px;
    overflow: visible;
  }

  .kpi-grid,
  .dashboard-grid,
  .analytics-grid,
  .finance-grid,
  .rank-grid,
  .ranking-grid,
  .insight-list,
  .form-grid,
  .preview {
    grid-template-columns: 1fr;
  }

  .result-box {
    grid-column: auto;
  }

  .balances-field {
    grid-column: auto;
  }

  .bar-chart {
    grid-template-columns: repeat(12, 72px);
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .monthly-stake-grid {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .filters,
  .status-options,
  .balance-card-grid,
  .option-builders,
  .options-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .panel-header,
  .form-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .primary-btn {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 14px;
  }

  .brand {
    margin-bottom: 0;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .topbar {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 18px;
  }

  .eyebrow {
    font-size: 10px;
    letter-spacing: .08em;
  }

  .panel,
  .form-card,
  .kpi-card {
    border-radius: 16px;
    padding: 12px;
  }

  .kpi-grid,
  .dashboard-grid,
  .analytics-grid,
  .finance-grid,
  .rank-grid,
  .ranking-grid,
  .insight-list,
  .form-grid,
  .preview {
    gap: 12px;
  }

  .kpi-card strong {
    font-size: 20px;
  }

  .panel-header,
  .form-header {
    gap: 12px;
    margin-bottom: 14px;
  }

  .filters {
    width: 100%;
    gap: 8px;
  }

  select,
  input,
  textarea,
  .primary-btn,
  .submit-btn,
  .ghost-btn {
    min-height: 40px;
    border-radius: 11px;
    padding: 10px 12px;
  }

  .sidebar {
    padding: 12px;
  }

  .sidebar .nav {
    display: none;
  }

  .top-actions {
    margin-left: auto;
  }

  .top-actions #openNovaBtn {
    display: none;
  }

  .mobile-menu-btn {
    margin-left: auto;
    width: 42px;
    height: 40px;
    border: 1px solid rgba(96,165,250,.25);
    border-radius: 12px;
    background: rgba(59,130,246,.14);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0;
  }

  .mobile-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 30;
    width: min(230px, calc(100vw - 32px));
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(13,19,36,.98);
    box-shadow: var(--shadow);
  }

  .mobile-menu.show {
    display: grid;
    gap: 6px;
  }

  .mobile-menu button {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    min-height: 40px;
    padding: 9px 10px;
    text-align: left;
    font-weight: 800;
  }

  .mobile-menu button.active,
  .mobile-menu button:hover {
    background: rgba(59,130,246,.14);
    border-color: rgba(96,165,250,.24);
    color: var(--text);
  }

  .status-options {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }

  .status-btn {
    min-height: 44px;
    padding: 11px 8px;
    border-radius: 13px;
    font-size: 12px;
    line-height: 1.15;
  }

  .preview {
    margin: 16px 0;
  }

  .preview div,
  .insight-item,
  .rank-item,
  .finance-item,
  .balance-card,
  .option-builder,
  .config-subcard,
  .ranking-card {
    border-radius: 14px;
    padding: 12px;
  }

  .analytics-grid {
    overflow: hidden;
  }

  .bar-chart {
    display: flex;
    grid-template-columns: none;
    max-width: 100%;
    min-height: 190px;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 8px;
  }

  .bar-column {
    flex: 0 0 54px;
    grid-template-rows: auto 94px auto auto;
    gap: 6px;
    font-size: 12px;
  }

  .bar-value {
    min-height: 38px;
    font-size: 12px;
  }

  .bar-value span,
  .rank-values small,
  .ranking-main small,
  .ranking-metrics span {
    font-size: 11px;
  }

  .vertical-track {
    width: 20px;
    height: 94px;
  }

  .vertical-track.compact {
    height: 94px;
  }

  .rank-grid {
    gap: 10px;
  }

  .rank-item {
    align-items: flex-start;
    padding: 10px;
  }

  .rank-values {
    flex: 0 0 auto;
  }

  .monthly-stake-grid {
    grid-template-columns: 1fr;
  }

  .option-row {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 8px;
  }

  tr {
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255,255,255,.035);
  }

  .history-bet-row.mobile-collapsed {
    display: none;
  }

  td {
    display: grid;
    grid-template-columns: 112px minmax(0,1fr);
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 8px 10px;
    white-space: normal;
    word-break: break-word;
  }

  td::before {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
  }

  td:nth-child(1)::before { content: "Data"; }
  td:nth-child(2)::before { content: "Tipster"; }
  td:nth-child(3)::before { content: "Campeonato"; }
  td:nth-child(4)::before { content: "Time"; }
  td:nth-child(5)::before { content: "Mercado"; }
  td:nth-child(6)::before { content: "Odd"; }
  td:nth-child(7)::before { content: "Stake"; }
  td:nth-child(8)::before { content: "Lucro"; }
  td:nth-child(9)::before { content: "Situação"; }
  td:nth-child(10)::before { content: "Unidades"; }
  td:nth-child(11)::before { content: "Casa"; }
  td:nth-child(12)::before { content: "Editar"; }

  .day-group-row {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .day-group-row td {
    display: block;
    min-height: 0;
    padding: 10px 0 4px;
    background: transparent;
    border: 0;
  }

  .day-group-row td::before {
    content: "";
    display: none;
  }

  .day-group {
    display: block;
    gap: 0;
    border: 1px solid rgba(96,165,250,.18);
    border-radius: 14px;
    padding: 0;
    background: rgba(59,130,246,.08);
  }

  .day-toggle {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto 28px;
    align-items: center;
    gap: 4px 10px;
    min-height: 48px;
    padding: 9px 12px;
  }

  .day-toggle::after {
    content: "+";
    grid-row: 1 / span 2;
    grid-column: 3;
    align-self: center;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(255,255,255,.06);
    color: var(--blue-2);
    font-size: 18px;
    font-weight: 900;
  }

  .day-toggle.open::after {
    content: "-";
  }

  .day-info,
  .day-result {
    display: grid;
    gap: 3px;
    min-width: 0;
  }

  .day-info {
    grid-column: 1;
    justify-items: start;
  }

  .day-result {
    grid-column: 2;
    justify-items: end;
    text-align: right;
  }

  .day-info strong {
    font-size: 14px;
  }

  .day-info span,
  .day-result span {
    font-size: 12px;
  }

  .day-result .positive {
    color: #86efac;
  }

  .day-result .negative {
    color: #fca5a5;
  }

  .day-result .neutral {
    color: #cbd5e1;
  }

  .day-toggle .pending-day {
    color: #fcd34d;
    font-weight: 900;
  }

  .history-status {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    border-radius: 12px;
    padding: 8px 10px;
  }

  .icon-btn {
    width: 44px;
    height: 40px;
    border-radius: 12px;
  }

  .ranking-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .ranking-metrics {
    grid-template-columns: repeat(2, minmax(0,1fr));
    justify-items: start;
    text-align: left;
  }

  .modal {
    padding: 10px;
    align-items: stretch;
  }

  .modal-card {
    width: 100%;
    max-height: calc(100vh - 20px);
    border-radius: 18px;
    padding: 16px;
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
    text-align: center;
  }
}

@media (max-width: 380px) {
  .main {
    padding: 12px;
  }

  .panel,
  .form-card,
  .kpi-card {
    padding: 14px;
  }

  td {
    grid-template-columns: 92px minmax(0,1fr);
    padding: 9px 10px;
  }
}


.ranking-filter {
  min-width: 220px;
}

.ranking-filter label {
  min-width: 220px;
}

.ranking-list {
  max-height: 672px;
  overflow-y: auto;
  padding-right: 6px;
}

.ranking-list::-webkit-scrollbar {
  width: 8px;
}

.ranking-list::-webkit-scrollbar-track {
  background: rgba(255,255,255,.04);
  border-radius: 999px;
}

.ranking-list::-webkit-scrollbar-thumb {
  background: rgba(96,165,250,.35);
  border-radius: 999px;
}

.ranking-card.ranking-card-centered {
  grid-column: 1 / -1;
  width: min(620px, 100%);
  justify-self: center;
}

@media (max-width: 980px) {
  .ranking-filter,
  .ranking-filter label {
    width: 100%;
    min-width: 0;
  }

  .ranking-card.ranking-card-centered {
    width: 100%;
  }
}
