/* Agenda semanal: grade clínica por horários, sem alterar o fluxo de dados existente. */
.weekly-agenda-shell {
  --agenda-slot-height: 42px;
  width: 100%;
  overflow: auto;
  padding: 2px 2px 6px;
  border-radius: 26px;
  scrollbar-width: thin;
  scrollbar-color: rgba(84, 133, 230, 0.32) transparent;
}

.weekly-agenda-shell::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.weekly-agenda-shell::-webkit-scrollbar-thumb {
  background: rgba(84, 133, 230, 0.28);
  border-radius: 999px;
}

.weekly-agenda-grid {
  position: relative;
  display: grid;
  grid-template-columns: 74px repeat(7, minmax(128px, 1fr));
  min-width: 1020px;
  overflow: hidden;
  border: 1px solid rgba(176, 204, 252, 0.78);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 255, 0.94)),
    radial-gradient(circle at top left, rgba(84, 166, 255, 0.12), transparent 34%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.weekly-agenda-corner,
.weekly-agenda-day-header,
.weekly-agenda-time {
  position: sticky;
  z-index: 4;
  background: rgba(249, 252, 255, 0.96);
  backdrop-filter: blur(14px);
}

.weekly-agenda-corner {
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  border-right: 1px solid rgba(176, 204, 252, 0.76);
  border-bottom: 1px solid rgba(176, 204, 252, 0.76);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.weekly-agenda-day-header {
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(176, 204, 252, 0.76);
  border-left: 1px solid rgba(223, 234, 255, 0.9);
}

.weekly-agenda-day-header strong {
  color: var(--text);
  font-size: 0.92rem;
}

.weekly-agenda-day-header span,
.weekly-agenda-day-header small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.15;
}

.weekly-agenda-day-header.is-today {
  background: linear-gradient(180deg, rgba(226, 238, 255, 0.98), rgba(247, 251, 255, 0.96));
}

.weekly-agenda-day-header.is-today strong {
  color: var(--accent-strong);
}

.weekly-agenda-time {
  left: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8px;
  border-right: 1px solid rgba(176, 204, 252, 0.76);
  border-top: 1px solid rgba(223, 234, 255, 0.9);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.weekly-agenda-slot {
  appearance: none;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-left: 1px solid rgba(223, 234, 255, 0.72);
  border-top: 1px solid rgba(223, 234, 255, 0.72);
  background: transparent;
  cursor: pointer;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.weekly-agenda-slot:hover,
.weekly-agenda-slot:focus-visible {
  outline: none;
  background: rgba(84, 133, 230, 0.08);
  box-shadow: inset 0 0 0 1px rgba(84, 133, 230, 0.22);
}

.weekly-agenda-event {
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  margin: 3px 5px;
  padding: 8px 10px;
  border: 1px solid rgba(84, 133, 230, 0.32);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(234, 242, 255, 0.96), rgba(255, 255, 255, 0.94));
  box-shadow: 0 12px 22px rgba(42, 82, 152, 0.13);
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.weekly-agenda-event:hover,
.weekly-agenda-event:focus-visible,
.weekly-agenda-event.is-selected {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(47, 106, 236, 0.72);
  box-shadow: 0 16px 28px rgba(42, 82, 152, 0.17);
}

.weekly-agenda-event strong {
  color: var(--accent-strong);
  font-size: 0.78rem;
  line-height: 1.1;
}

.weekly-agenda-event span {
  width: 100%;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weekly-agenda-event small,
.weekly-agenda-event em {
  width: 100%;
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
  line-height: 1.12;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weekly-agenda-event.schedule-tone-assessment {
  border-color: rgba(73, 148, 236, 0.38);
  background: linear-gradient(145deg, rgba(229, 243, 255, 0.98), rgba(249, 253, 255, 0.95));
}

.weekly-agenda-event.schedule-tone-sedation {
  border-color: rgba(67, 174, 129, 0.4);
  background: linear-gradient(145deg, rgba(226, 247, 236, 0.98), rgba(249, 253, 255, 0.95));
}

body.mobile-shell .weekly-agenda-shell {
  --agenda-slot-height: 38px;
  margin-inline: -2px;
}

body.mobile-shell .weekly-agenda-grid {
  grid-template-columns: 62px repeat(7, minmax(118px, 1fr));
  min-width: 900px;
}

body.mobile-shell .weekly-agenda-day-header {
  padding: 8px 9px;
}

body.mobile-shell .weekly-agenda-event {
  margin: 2px 4px;
  padding: 7px 8px;
  border-radius: 15px;
}
