/**
 * Modal de agenda unificado (site /agendar + painel vendedor).
 * Variáveis locais evitam dependência de --vnd-accent fora do vendedor.
 */
.vnd-agenda-sheet {
  --vnd-accent: #1E2D28;
  --vnd-accent-soft: rgba(30, 45, 40, 0.08);
  --vnd-safe-b: env(safe-area-inset-bottom, 0px);
}

body.af-agenda-open,
body.vnd-agenda-open {
  overflow: hidden;
}

.vnd-agenda-sheet[hidden] {
  display: none !important;
}

.vnd-agenda-sheet {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 560px) {
  .vnd-agenda-sheet {
    align-items: center;
    padding: 1rem;
  }
}

/* Reset: painel.css / site.css estilizam button globalmente */
.vnd-agenda-sheet button {
  margin-top: 0;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.vnd-agenda-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 32, 25, 0.45);
}

.vnd-agenda-sheet__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: min(94dvh, 780px);
  background: #fff;
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  box-shadow: 0 -8px 40px rgba(21, 32, 25, 0.18);
}

@media (min-width: 560px) {
  .vnd-agenda-sheet__panel {
    border-radius: 16px;
    max-height: min(88vh, 680px);
  }
}

.vnd-agenda-sheet__head {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-shrink: 0;
  padding: 1rem 1.15rem 0.65rem;
  border-bottom: 1px solid #d5ddd8;
}

.vnd-agenda-sheet__head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  flex: 1;
  min-width: 0;
}

.vnd-agenda-sheet__steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 0.6rem 1.15rem 0;
}

.vnd-agenda-step {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #a8b3ad;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: #f3f5f4;
}

.vnd-agenda-step.is-active {
  color: var(--vnd-accent);
  background: var(--vnd-accent-soft);
}

.vnd-agenda-step.is-done {
  color: #fff;
  background: var(--vnd-accent);
}

.vnd-agenda-step__line {
  flex: 0 0 1.5rem;
  height: 2px;
  background: #d7ddd9;
  border-radius: 999px;
}

.vnd-agenda-summary {
  margin: 0.6rem 1.15rem 0;
  padding: 0.75rem 0.95rem;
  border-radius: 10px;
  background: #f7f9f8;
  border: 1px solid #d5ddd8;
  font-size: 0.84rem;
  font-weight: 600;
  color: #5a6b62;
  line-height: 1.35;
  flex-shrink: 0;
}

.vnd-agenda-summary.is-partial {
  background: #fff8e8;
  border-color: #e8d4a8;
  color: #7a5a00;
}

.vnd-agenda-summary.is-ready {
  background: var(--vnd-accent-soft);
  border-color: #b8cfc4;
  color: var(--vnd-accent);
  font-weight: 800;
}

.vnd-agenda-section-label {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #5a6b62;
}

.vnd-agenda-section-label--time {
  color: var(--vnd-accent);
}

.vnd-agenda-sheet__close {
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: #eef1ee;
  color: #152019;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.vnd-agenda-sheet__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.85rem 1.15rem 1.35rem;
  -webkit-overflow-scrolling: touch;
}

.vnd-agenda-cal__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.vnd-agenda-cal__filters {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.vnd-agenda-cal__filters::-webkit-scrollbar {
  display: none;
}

.vnd-agenda-filter {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.4rem 0.75rem;
  border: 1px solid #d5ddd8;
  border-radius: 999px;
  background: #fff;
  color: #5a6b62;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 2.25rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.vnd-agenda-filter.is-active {
  background: #eef4ff;
  border-color: #5b7fa8;
  color: #2c5282;
  box-shadow: inset 0 0 0 1px rgba(44, 82, 130, 0.15);
}

.vnd-agenda-cal__nav-btn {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid #d5ddd8;
  border-radius: 999px;
  background: #fff;
  color: var(--vnd-accent);
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.vnd-agenda-dates {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: min(34vh, 240px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 0;
  padding-right: 0.1rem;
}

.vnd-agenda-dates__empty {
  margin: 0.35rem 0 0;
  padding: 0.85rem 0.9rem;
  border-radius: 0.65rem;
  background: #f4f1ec;
  border: 1px dashed rgba(30, 45, 40, 0.22);
  color: #3d4a45;
  font-size: 0.9rem;
  line-height: 1.45;
}

.vnd-agenda-dates__empty.is-no-schedule {
  background: #fdf6e8;
  border-color: rgba(139, 115, 85, 0.35);
  color: #5c4a32;
}

.vnd-agenda-sheet__panel.has-date .vnd-agenda-dates {
  max-height: min(17vh, 132px);
}

.vnd-agenda-sheet__panel.has-date .vnd-agenda-cal {
  margin-bottom: 0.25rem;
}

.vnd-date-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 2px solid #d5ddd8;
  border-radius: 12px;
  background: #fff;
  color: #152019;
  cursor: pointer;
  min-height: 2.85rem;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.vnd-date-item__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  background: #eef1ee;
  color: #5a6b62;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.vnd-date-item__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.vnd-date-item__date {
  font-size: 0.92rem;
  font-weight: 800;
  color: #152019;
}

.vnd-date-item__tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #eef1ee;
  color: #5a6b62;
}

.vnd-date-item__tag--weekend {
  background: #fff4d6;
  color: #7a5a00;
}

.vnd-date-item__mark {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: transparent;
  background: transparent;
}

.vnd-date-item.is-weekend {
  border-color: #e8d4a8;
  background: #fffcf5;
}

.vnd-date-item.is-weekend .vnd-date-item__badge {
  background: #fff4d6;
  color: #7a5a00;
}

.vnd-date-item.is-selected {
  border-color: var(--vnd-accent);
  background: var(--vnd-accent-soft);
  box-shadow: 0 0 0 1px rgba(31, 64, 51, 0.08);
}

.vnd-date-item.is-selected .vnd-date-item__badge {
  background: var(--vnd-accent);
  color: #fff;
}

.vnd-date-item.is-selected .vnd-date-item__mark {
  background: var(--vnd-accent);
  color: #fff;
}

.vnd-date-item:not(.is-selected):hover {
  border-color: #b8cfc4;
  background: #f7faf9;
}

.vnd-agenda-cal__title {
  font-size: 0.95rem;
  font-weight: 800;
}

.vnd-agenda-cal__status {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: #5a6b62;
  text-align: center;
}

.vnd-agenda-slots-wrap {
  margin-top: 0.85rem;
  padding: 0.85rem 0 0.35rem;
  border-top: 2px dashed #d5ddd8;
  flex-shrink: 0;
}

.vnd-agenda-slots-wrap[hidden] {
  display: none !important;
}

.vnd-agenda-slots__heading {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: #152019;
}

.vnd-agenda-slots__heading span {
  color: var(--vnd-accent);
}

.vnd-agenda-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  padding-bottom: 0.25rem;
}

@media (min-width: 400px) {
  .vnd-agenda-slots {
    grid-template-columns: repeat(4, 1fr);
  }
}

.vnd-agenda-slot {
  margin: 0;
  border: 2px solid #c5d0c8;
  background: #fff;
  color: #152019;
  border-radius: 10px;
  padding: 0.55rem 0.35rem;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  min-height: 2.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.vnd-agenda-slot:hover:not(.is-selected) {
  border-color: var(--vnd-accent);
  color: var(--vnd-accent);
  background: #f7faf9;
}

.vnd-agenda-slot.is-selected {
  background: var(--vnd-accent);
  border-color: var(--vnd-accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(31, 64, 51, 0.22);
}

.vnd-agenda-cal__status--warn {
  color: #8b2430;
  font-weight: 700;
}

.vnd-agenda-sheet__foot {
  flex-shrink: 0;
  padding: 0.85rem 1.15rem calc(0.85rem + var(--vnd-safe-b));
  border-top: 1px solid #d5ddd8;
  background: #fff;
  box-shadow: 0 -4px 16px rgba(21, 32, 25, 0.06);
}

.vnd-agenda-sheet__confirm {
  width: 100%;
  margin: 0;
  min-height: 3rem;
  border: 0;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: not-allowed;
  display: block;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.vnd-agenda-sheet__confirm.is-wait-date,
.vnd-agenda-sheet__confirm.is-wait-time,
.vnd-agenda-sheet__confirm:disabled {
  background: #e8ece9;
  color: #8a9690;
  cursor: not-allowed;
}

.vnd-agenda-sheet__confirm.is-ready {
  background: var(--vnd-accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(31, 64, 51, 0.24);
}

.vnd-agenda-sheet__confirm.is-ready:active {
  transform: scale(0.99);
}
