.agenda-view { min-width: 0; }
.agenda-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; justify-content: space-between; margin-bottom: 16px; }
.agenda-toolbar__group { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.agenda-field { display: grid; gap: 5px; font-size: 12px; font-weight: 650; color: var(--text-2); }
.agenda-field select, .agenda-field input { min-height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); padding: 0 10px; }
.agenda-segmented { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.agenda-segmented button { display: flex; gap: 7px; align-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); padding: 8px 11px; font: inherit; font-weight: 650; cursor: pointer; }
.agenda-segmented button[aria-pressed=true] { background: var(--blue); color: #fff; }
.agenda-period { display: flex; align-items: center; gap: 8px; }
.agenda-period__label { min-width: 190px; text-align: center; font-size: 13px; font-weight: 700; }
.agenda-icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; }
.agenda-icon-button:hover { border-color: var(--blue); color: var(--blue); }
.agenda-state { padding: 34px; text-align: center; color: var(--text-2); border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }

.agenda-calendar { overflow: auto; max-height: calc(100vh - 230px); min-height: 560px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 1px 3px rgba(15, 23, 42, .04); }
.agenda-calendar__header { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: 56px repeat(7, minmax(132px, 1fr)); min-width: 980px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(8px); }
.agenda-day-title { min-height: 62px; display: grid; place-content: center; gap: 3px; text-align: center; border-left: 1px solid var(--line); font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.agenda-day-title strong { width: 29px; height: 29px; display: grid; place-items: center; margin: 0 auto; border-radius: 50%; font-size: 14px; letter-spacing: 0; color: var(--text); }
.agenda-day-title.is-today { color: var(--blue); background: color-mix(in srgb, var(--blue) 4%, var(--surface)); }
.agenda-day-title.is-today strong { background: var(--blue); color: #fff; }
.agenda-calendar__body { display: grid; grid-template-columns: 56px repeat(7, minmax(132px, 1fr)); min-width: 980px; }
.agenda-times { position: relative; min-height: 780px; background: var(--surface); }
.agenda-time { position: absolute; right: 8px; transform: translateY(-50%); font-size: 10px; font-variant-numeric: tabular-nums; color: var(--text-3); }
.agenda-day { position: relative; min-height: 780px; border-left: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0, transparent 29px, color-mix(in srgb, var(--line) 55%, transparent) 30px, transparent 31px, transparent 59px, var(--line) 60px); }
.agenda-day.is-today { background-color: color-mix(in srgb, var(--blue) 2.5%, var(--surface)); }
.agenda-now-line { position: absolute; z-index: 4; left: 0; right: 0; height: 1px; background: #e64b4b; pointer-events: none; }
.agenda-now-line::before { content: ''; position: absolute; left: -3px; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: #e64b4b; }
.agenda-event { --event-column: 0; --event-columns: 1; position: absolute; z-index: 2; left: calc((100% / var(--event-columns)) * var(--event-column) + 4px); width: calc((100% / var(--event-columns)) - 7px); min-height: 34px; border: 0; border-left: 3px solid #3272d9; border-radius: 6px; background: #edf4ff; color: #173b72; padding: 5px 6px; text-align: left; overflow: hidden; cursor: pointer; box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.agenda-event:hover, .agenda-event:focus-visible { z-index: 6; outline: 2px solid currentColor; outline-offset: 1px; filter: saturate(1.08); }
.agenda-event--pendente { border-color: #d88716; background: #fff6df; color: #70420a; }
.agenda-event--em_atendimento { border-color: #7657d7; background: #f2efff; color: #493295; }
.agenda-event--concluido { border-color: #16865b; background: #eaf8f1; color: #145c43; }
.agenda-event--cancelado { border-color: #94a3b8; background: #f1f5f9; color: #64748b; }
.agenda-event--no_show { border-color: #c45151; background: #fff0f0; color: #853737; }
.agenda-event__time { display: block; font-size: 10px; line-height: 1.2; font-weight: 800; font-variant-numeric: tabular-nums; }
.agenda-event__client { display: block; margin-top: 2px; font-size: 11px; line-height: 1.2; font-weight: 750; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.agenda-event__meta { display: block; margin-top: 2px; font-size: 9px; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; opacity: .88; }

/* Colunas fixas para o cabeçalho e todas as linhas baterem. Antes cada card era
   um grid independente com colunas `auto`, então "Confirmado" e "Não compareceu"
   empurravam as colunas de lugares diferentes em cada linha. */
.agenda-list {
  display: grid; gap: 10px;
  --agenda-list-cols: 38px minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1.15fr) 120px 248px;
}
.agenda-list-head {
  display: grid; grid-template-columns: var(--agenda-list-cols); gap: 14px;
  padding: 4px 15px 0; font-size: 11px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--text-3);
}
.agenda-list-card { display: grid; grid-template-columns: var(--agenda-list-cols); gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: inherit; text-decoration: none; cursor: pointer; }
.agenda-list-card:hover, .agenda-list-card:focus-visible { border-color: var(--blue); outline: 2px solid color-mix(in srgb, var(--blue) 25%, transparent); }
.agenda-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.agenda-avatar--fallback { display: grid; place-items: center; border: 1px solid var(--line); color: var(--text-2); font-size: 12px; font-weight: 750; }
.agenda-card-title { font-weight: 750; }
.agenda-card-meta { margin-top: 3px; font-size: 12px; color: var(--text-2); }
.agenda-status { display: inline-flex; border-radius: 999px; padding: 4px 8px; background: var(--surface-2); font-size: 11px; font-weight: 700; text-transform: capitalize; }

@media (max-width: 800px) {
  .agenda-toolbar, .agenda-toolbar__group { align-items: stretch; }
  .agenda-toolbar__group { width: 100%; }
  .agenda-field { flex: 1; }
  .agenda-period__label { min-width: 130px; }
  /* Empilhado no celular não há colunas para rotular, então o cabeçalho sai. */
  .agenda-list-head { display: none; }
  .agenda-list-card { grid-template-columns: auto minmax(0, 1fr); }
  .agenda-list-card__service, .agenda-list-card__prof, .agenda-status, .agenda-card-acoes { grid-column: 2; }
  .agenda-view { margin-inline: -4px; }
}

/* =========================================================
   VISÃO "VER TODOS" E ESTADO DO BOTÃO HOJE
   ========================================================= */
/* Fora do dia de hoje o botão fica discreto, para não sugerir que
   a data em foco é a atual. */
.agenda-period .btn.is-muted {
  color: var(--text-3);
  background: var(--surface-2);
  border-color: var(--line-2);
  box-shadow: none;
  opacity: .65;
}
.agenda-period .btn.is-muted:hover { opacity: 1; color: var(--text); }

.agenda-grupo + .agenda-grupo { margin-top: 28px; }
.agenda-grupo__titulo {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 4px;
}
.agenda-grupo__aviso {
  font-size: 12.5px;
  color: var(--text-2);
  margin: 0 0 10px;
}
.agenda-dia-separador {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-3);
  padding: 14px 2px 6px;
}
.agenda-dia-separador:first-child { padding-top: 4px; }

/* =========================================================
   LINHA DA AGENDA: BARBEIRO COM FOTO E AÇÕES RÁPIDAS
   ========================================================= */
.agenda-list-card__prof { display: flex; align-items: center; gap: 9px; min-width: 0; }
.agenda-list-card__prof .agenda-card-title { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-avatar--sm { width: 30px; height: 30px; font-size: 11px; }

.agenda-card-acoes { display: flex; gap: 6px; flex-wrap: wrap; }
.agenda-card-acoes .btn { padding: 5px 11px; font-size: 12px; }
.agenda-card-acoes .btn.is-danger { color: var(--red); }
.agenda-card-acoes .btn.is-danger:hover { border-color: var(--red); }

/* Status com a cor do significado, em vez de cinza para tudo. */
.agenda-status--cancelado, .agenda-status--no_show { color: var(--red); }
.agenda-status--concluido { color: var(--green); }
.agenda-status--em_atendimento { color: var(--orange); }

/* =========================================================
   ATENDIMENTOS QUE NÃO ACONTECERAM
   Cancelado sai de cena visualmente; falta chama atenção.
   ========================================================= */
.agenda-list-card--cancelado { opacity: .55; }
.agenda-list-card--cancelado .agenda-card-title { text-decoration: line-through; }
.agenda-list-card--cancelado:hover { opacity: 1; }

.agenda-list-card--no_show {
  background: rgba(220, 38, 38, .06);
  border-color: rgba(220, 38, 38, .28);
}
.agenda-list-card--no_show:hover { background: rgba(220, 38, 38, .1); }

/* =========================================================
   ATENDIMENTO ACONTECENDO AGORA
   Bloco que veio do Ao Vivo, não da agenda. Pulsa de leve para
   o operador distinguir do que está apenas marcado.
   ========================================================= */
.agenda-event--ao-vivo {
  border-color: var(--green, #16a34a) !important;
  background: rgba(34, 197, 94, 0.14) !important;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35) inset;
}
.agenda-event__agora {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 3px; font-size: 10.5px; font-weight: 700;
  color: #15803d; letter-spacing: .01em;
}
.agenda-event__agora::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #16a34a; animation: agenda-pulso 1.4s ease-in-out infinite;
}
@keyframes agenda-pulso { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }

.agenda-list-card--em_atendimento { border-left: 3px solid var(--green, #16a34a); }
