/* =========================================================
   CRUZAMENTO — cruzamento.css (Clean)
   - Topbar + filtros + tabela + heatmap
   - Sticky: P + Jogador
   - Theme: Tech (dark)
   ========================================================= */

/* =========================
   BASE (depende dos tokens do projeto)
========================= */
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 12px;
}

.brand-title {
  font-weight: 950;
  font-size: 20px;
  letter-spacing: -0.25px;
}

.brand-sub {
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--grid);
  background: #fff;
  text-decoration: none;
  color: var(--text);
  font-weight: 900;
  font-size: 12px;
  line-height: 1;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}

.btn:hover {
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.btn--danger {
  border-color: #fecaca;
  background: #fff5f5;
  color: #991b1b;
}

/* =========================
   FILTERS
========================= */
.filters {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
}

.filters.card {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.filters-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.filters-row--small {
  margin-top: 10px;
}

.field {
  min-width: 220px;
}

.field--grow {
  flex: 1;
  min-width: 320px;
}

.label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(71, 85, 105, 0.92);
  font-weight: 900;
  margin: 0 0 8px 2px;
}

.seg {
  display: inline-flex;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
}

.seg-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 12px;
  cursor: pointer;
  color: rgba(71, 85, 105, 0.95);
}

.seg-btn.is-active {
  background: rgba(251, 89, 4, 0.14);
  color: var(--text);
  box-shadow: 0 10px 22px rgba(251, 89, 4, 0.18);
}

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

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  cursor: pointer;
  font-weight: 900;
  font-size: 12px;
  color: rgba(71, 85, 105, 0.95);
  user-select: none;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}

.chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.06);
}

.chip.is-on {
  border-color: rgba(251, 89, 4, 0.55);
  color: var(--text);
  background: rgba(251, 89, 4, 0.1);
}

.chips-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip-action {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  cursor: pointer;
  font-weight: 900;
  font-size: 12px;
  color: rgba(15, 23, 42, 0.85);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}

.chip-action:hover {
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.hint {
  font-size: 12px;
  line-height: 1.35;
  color: rgba(71, 85, 105, 0.92);
  font-weight: 700;
}

/* =========================
   TABLE: sticky P + Jogador
========================= */
.table-wrap {
  overflow: auto;
}

table.sheet th:nth-child(1),
table.sheet td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
}

table.sheet th:nth-child(2),
table.sheet td:nth-child(2) {
  position: sticky;
  left: 46px;
  z-index: 3;
  background: #fff;
}

table.sheet td:nth-child(4),
table.sheet th:nth-child(4) {
  text-align: center;
  width: 56px;
}

.td-center {
  text-align: center;
}

.td-nowrap {
  white-space: nowrap;
}

/* Heatmap (quantis) */
.sheet td.hm1 {
  background: rgba(239, 68, 68, 0.12);
}
.sheet td.hm2 {
  background: rgba(239, 68, 68, 0.06);
}
.sheet td.hm3 {
  background: transparent;
}
.sheet td.hm4 {
  background: rgba(34, 197, 94, 0.06);
}
.sheet td.hm5 {
  background: rgba(34, 197, 94, 0.12);
}

.sheet th.sortable {
  cursor: pointer;
  user-select: none;
}
.sheet th.sortable.is-sorted {
  text-decoration: underline;
}

/* =========================
   THEME: TECH (dark)
========================= */
.theme-tech {
  background: radial-gradient(circle at top, #0f172a 0%, #020617 60%);
}

/* cards/filters */
.theme-tech .card,
.theme-tech .filters.card {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.15);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.08),
    0 10px 40px rgba(0, 0, 0, 0.6);
}

.theme-tech #title {
  color: #e2e8f0;
}

/* labels/hints */
.theme-tech .filters .label {
  color: rgba(255, 255, 255, 0.82);
}
.theme-tech .filters .hint {
  color: rgba(255, 255, 255, 0.68);
}

/* chips/seg */
.theme-tech .chip,
.theme-tech .seg-btn {
  background: #0f172a;
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.theme-tech .chip.is-on,
.theme-tech .seg-btn.is-active {
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  color: #0f172a;
  border: 0;
}

.theme-tech .badge {
  background: #0ea5e9;
  color: #0f172a;
  font-weight: 700;
}

/* table dark */
.theme-tech .sheet {
  background: #0f172a;
  border-collapse: collapse;
}

.theme-tech .sheet thead th {
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  color: #0f172a;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.6px;
  padding: 10px 12px;
  border: 0;
}

.theme-tech .sheet tbody td {
  background: #0b1220;
  color: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  padding: 8px 12px;
  font-weight: 800;
}

.theme-tech .sheet tbody tr:hover td {
  background: #111827;
}

/* força sticky opaco no dark */
.theme-tech table.sheet th:nth-child(1),
.theme-tech table.sheet td:nth-child(1),
.theme-tech table.sheet th:nth-child(2),
.theme-tech table.sheet td:nth-child(2) {
  background: #0b1220;
}

/* Heatmap mais forte no dark */
.theme-tech .sheet td.hm1 {
  background: rgba(239, 68, 68, 0.48) !important;
}
.theme-tech .sheet td.hm2 {
  background: rgba(239, 68, 68, 0.28) !important;
}
.theme-tech .sheet td.hm3 {
  background: rgba(11, 18, 32, 0.85) !important;
}
.theme-tech .sheet td.hm4 {
  background: rgba(34, 197, 94, 0.28) !important;
}
.theme-tech .sheet td.hm5 {
  background: rgba(34, 197, 94, 0.48) !important;
}

/* =========================
   RESPONSIVO
========================= */
@media (max-width: 820px) {
  .topbar-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .field {
    min-width: 160px;
  }
  .field--grow {
    min-width: 100%;
  }
  table.sheet th:nth-child(2),
  table.sheet td:nth-child(2) {
    left: 42px;
  }
}

@media (max-width: 720px) {
  /* topo mais compacto */
  .brand-sub {
    display: none !important;
  }

  .top-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: nowrap;
  }

  .top-actions .btn {
    padding: 6px 10px;
    font-size: 12px;
    min-height: 32px;
    white-space: nowrap;
  }

  /* filtros menores */
  .filters.card {
    padding: 10px;
    border-radius: 14px;
    overflow: visible;
  }

  .filters-row {
    gap: 10px;
  }

  .label {
    font-size: 10px;
    letter-spacing: 0.08em;
    margin: 0 0 6px 2px;
  }

  .seg {
    padding: 3px;
    gap: 3px;
    border-radius: 12px;
  }

  .seg-btn {
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 11px;
  }

  .chip {
    padding: 6px 8px;
    font-size: 11px;
  }

  .chip-action {
    padding: 6px 8px;
    font-size: 11px;
  }
}
