.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; 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; 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; }

.agenda-list { display: grid; gap: 10px; }
.agenda-list-card { display: grid; grid-template-columns: auto minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: inherit; text-decoration: none; }
.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; }
  .agenda-list-card { grid-template-columns: auto minmax(0, 1fr); }
  .agenda-list-card__service, .agenda-status { grid-column: 2; }
  .agenda-view { margin-inline: -4px; }
}
