/* Agenda redesenhada (agenda-client-v1.js). As linhas usam o mesmo desenho de
   Ofertas (classes .ofx-* de offers-client-v1.css); aqui ficam só a barra, a
   fileira de dias e o botão Cancelar. */

.customer-shell .agenda-layout.agx-on > .agenda-list {
  display: none !important;
}

/* Barra: blocos e total à esquerda, Atualizar à direita (como em Ofertas). */
.customer-shell .main .panel > .toolbar:has(> .agenda-refresh-btn) {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  margin: 0 0 18px !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.customer-shell .main .panel > .toolbar:has(> .agenda-refresh-btn) > .badge {
  order: 1;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: var(--fx-muted) !important;
}

.customer-shell .main .panel > .toolbar:has(> .agenda-refresh-btn) > .badge::before {
  display: none !important;
}

.customer-shell .main .panel > .toolbar:has(> .agenda-refresh-btn) > .badge.green {
  order: 2;
  padding-left: 14px !important;
  border-left: 1px solid var(--fx-line-2) !important;
  border-radius: 0 !important;
  color: var(--fx-ok-text) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
}

.customer-shell .main .panel > .toolbar > .agenda-refresh-btn {
  order: 3;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  height: 40px !important;
  min-height: 40px !important;
  margin: 0 0 0 auto !important;
  padding: 0 14px !important;
  border-radius: 12px !important;
  border: 1px solid var(--fx-line-2) !important;
  background: var(--fx-surface) !important;
  box-shadow: none !important;
  color: var(--fx-text) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

.customer-shell .main .panel > .toolbar > .agenda-refresh-btn:hover {
  border-color: var(--fx-line-3) !important;
  background: var(--fx-surface-2) !important;
}

.customer-shell .main .panel > .toolbar > .agenda-refresh-btn svg {
  width: 16px !important;
  height: 16px !important;
}

/* Dias: uma fileira em cima da lista, também no computador. */
.customer-shell .agenda-layout.agx-on {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 22px !important;
}

.customer-shell .agenda-layout.agx-on > .day-picker {
  position: static !important;
  display: flex !important;
  flex-direction: row !important;
  gap: 8px !important;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.customer-shell .agenda-layout.agx-on > .day-picker::-webkit-scrollbar {
  display: none;
}

.customer-shell .agenda-layout.agx-on .day-chip {
  flex: 0 0 auto !important;
  width: 64px !important;
  min-width: 64px !important;
  height: 64px !important;
  min-height: 64px !important;
  gap: 3px !important;
  padding: 0 !important;
  border-radius: 14px !important;
  border: 1px solid var(--fx-line-2) !important;
  background: var(--fx-surface) !important;
  box-shadow: none !important;
}

.customer-shell .agenda-layout.agx-on .day-chip:hover {
  border-color: var(--fx-line-3) !important;
}

.customer-shell .agenda-layout.agx-on .day-chip-label {
  color: var(--fx-faint) !important;
  font-size: 10.5px !important;
  font-weight: 500 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
}

.customer-shell .agenda-layout.agx-on .day-chip-num {
  color: var(--fx-text) !important;
  font-size: 20px !important;
  font-weight: 300 !important;
  line-height: 1.1 !important;
}

.customer-shell .agenda-layout.agx-on .day-chip.active {
  border-color: var(--fx-accent) !important;
  background: var(--fx-accent-soft) !important;
  box-shadow: inset 0 0 0 1px var(--fx-accent) !important;
}

.customer-shell .agenda-layout.agx-on .day-chip.active .day-chip-label {
  color: var(--fx-accent-text) !important;
}

.customer-shell .agenda-layout.agx-on .day-chip.active .day-chip-num {
  font-weight: 500 !important;
}

.customer-shell .agenda-layout.agx-on .day-chip::before,
.customer-shell .agenda-layout.agx-on .day-chip::after {
  display: none !important;
}

/* Linha da agenda: sem endereço nem gorjeta, só estação. */
.agx-row .ofx-place {
  justify-content: center;
}

.agx-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid var(--fx-line-2);
  background: transparent;
  color: var(--fx-muted);
  font-size: 13px !important;
  font-weight: 600 !important;
  white-space: nowrap;
}

.agx-cancel svg {
  width: 15px;
  height: 15px;
}

.agx-cancel:hover:not(:disabled) {
  border-color: var(--fx-crit-line);
  background: var(--fx-crit-soft);
  color: var(--fx-crit-text);
}

.agx-cancel:disabled {
  opacity: 0.6;
  cursor: wait;
}

@media (max-width: 640px) {
  .customer-shell .main .panel > .toolbar:has(> .agenda-refresh-btn) {
    margin: -8px 0 16px !important;
  }

  .customer-shell .agenda-layout.agx-on {
    gap: 18px !important;
  }

  /* Fileira de dias de ponta a ponta, rolando de lado. */
  .customer-shell .agenda-layout.agx-on > .day-picker {
    margin: 0 -16px !important;
    padding: 0 16px 2px !important;
    scroll-padding: 0 16px;
    scroll-snap-type: x proximity;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }

  .customer-shell .agenda-layout.agx-on .day-chip {
    scroll-snap-align: start;
    width: 58px !important;
    min-width: 58px !important;
    height: 60px !important;
    min-height: 60px !important;
  }

  .agx-row .ofx-actions {
    justify-content: flex-end;
  }

  .agx-cancel {
    flex: 1;
  }
}

/* Celular: o título da página aparece como nas outras telas (Ofertas, Ganhos). */
@media (max-width: 640px) {
  .customer-shell .main .panel > .page-head:has(+ .toolbar > .agenda-refresh-btn) {
    display: block !important;
  }
}

/* "Todos" é mais longo que os dias: o primeiro botão cresce com o texto. */
.customer-shell .agenda-layout.agx-on .day-chip:first-child {
  width: auto !important;
  padding: 0 14px !important;
}

/* Quantidade de blocos do dia: selo no canto do botão, fora das letras do dia. */
.customer-shell .agenda-layout.agx-on > .day-picker {
  padding-top: 8px !important;
  margin-top: -8px !important;
}

.customer-shell .agenda-layout.agx-on .day-chip {
  position: relative !important;
  overflow: visible !important;
}

.customer-shell .agenda-layout.agx-on .day-chip-count {
  position: absolute !important;
  top: -7px !important;
  right: -6px !important;
  display: grid !important;
  place-items: center !important;
  min-width: 19px !important;
  height: 19px !important;
  margin: 0 !important;
  padding: 0 5px !important;
  border-radius: 999px !important;
  border: 2px solid var(--fx-bg) !important;
  background: var(--fx-accent) !important;
  color: #ffffff !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
}

/* Celular: "Cancelar" compacto na linha do horário (ação secundária, não um botão de tela inteira). */
@media (max-width: 640px) {
  .ofx-row.agx-row {
    grid-template-areas: "place price" "time actions" !important;
    align-items: center;
  }

  .agx-row .ofx-actions {
    align-self: center;
  }

  .agx-row .agx-cancel {
    flex: none;
    height: 36px;
    padding: 0 12px;
  }
}

@media (max-width: 380px) {
  /* Telas estreitas: só o X, com o nome no rótulo de acessibilidade. */
  .agx-row .agx-cancel {
    width: 36px;
    padding: 0;
  }

  .agx-row .agx-cancel span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (max-width: 380px) {
  /* 375 px: sem a duração (o fim do bloco já aparece ao lado), para a linha não quebrar. */
  .agx-row .ofx-time em {
    display: none;
  }
}

/* Resumo em cartão no topo: o total em destaque, a quantidade de blocos embaixo e
   Atualizar à direita. Abre a página como os cartões de Ganhos e Ofertas, em vez de
   números soltos no fundo. */
.customer-shell .main .panel > .toolbar:has(> .agenda-refresh-btn) {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  grid-template-areas: "total refresh" "count refresh" !important;
  align-items: center !important;
  column-gap: 14px !important;
  row-gap: 4px !important;
  padding: 18px 18px 16px !important;
  border: 1px solid var(--fx-line) !important;
  border-radius: 18px !important;
  background:
    radial-gradient(120% 110% at 0% 0%, var(--fx-ok-soft), transparent 58%),
    var(--fx-surface) !important;
}

.customer-shell .main .panel > .toolbar:has(> .agenda-refresh-btn) > .badge.green {
  grid-area: total;
  justify-self: start;
  padding: 0 !important;
  border-left: 0 !important;
  font-size: 30px !important;
  font-weight: 700 !important;
  line-height: 1.1 !important;
  letter-spacing: -0.02em !important;
  font-variant-numeric: tabular-nums;
}

.customer-shell .main .panel > .toolbar:has(> .agenda-refresh-btn) > .badge.gray {
  grid-area: count;
  justify-self: start;
  gap: 6px !important;
  font-size: 13.5px !important;
}

.customer-shell .main .panel > .toolbar:has(> .agenda-refresh-btn) > .badge.gray::before {
  content: "" !important;
  display: inline-block !important;
  flex: 0 0 14px;
  width: 14px !important;
  height: 14px !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: currentColor !important;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2'/><path d='M16 2v4M8 2v4M3 10h18'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='4' width='18' height='18' rx='2'/><path d='M16 2v4M8 2v4M3 10h18'/></svg>") center / contain no-repeat;
  opacity: 0.8;
}

.customer-shell .main .panel > .toolbar:has(> .agenda-refresh-btn) > .badge.gray:only-of-type {
  grid-row: 1 / -1;
  font-size: 15px !important;
  color: var(--fx-text) !important;
}

.customer-shell .main .panel > .toolbar > .agenda-refresh-btn {
  grid-area: refresh;
  margin: 0 !important;
}

@media (max-width: 640px) {
  .customer-shell .main .panel > .toolbar:has(> .agenda-refresh-btn) {
    margin: -12px 0 16px !important;
    padding: 16px 16px 14px !important;
  }

  .customer-shell .main .panel > .toolbar:has(> .agenda-refresh-btn) > .badge.green {
    font-size: 28px !important;
  }
}

/* Sem blocos (nem total nem quantidade): só o Atualizar, sem cartão vazio. */
.customer-shell .main .panel > .toolbar:has(> .agenda-refresh-btn):not(:has(> .badge)) {
  display: flex !important;
  justify-content: flex-end !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
