/* ============================================================
   PRONTIO – Agenda
   Estilos específicos da página agenda.html
============================================================ */

/* CONTAINER PRINCIPAL */
.agenda-main {
  max-width: 1120px;
  margin: 0 auto 2rem;
}

/* CARD PRINCIPAL DA AGENDA */
.agenda-card {
  background: var(--color-panel);
  border-radius: 14px;
  padding: 1.4rem 1.6rem 1.6rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
}

/* CABEÇALHO DO CARD */
.agenda-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.agenda-card-header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.agenda-card-header .subtitle {
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: var(--color-text-soft);
}

/* FILTROS (DATA / STATUS) */
.agenda-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.agenda-filters .campo-inline {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8rem;
  color: var(--color-text-soft);
}

.agenda-filters .campo-inline input[type="date"],
.agenda-filters .campo-inline select {
  min-height: 32px;
  padding: 0.25rem 0.6rem;
  border-radius: 8px;
  border: 1px solid #d3d6da;
  font-size: 0.85rem;
}

/* LABEL DE DIA (Hoje, Amanhã, etc.) */
.agenda-day-label {
  margin-top: 12px;
  margin-bottom: 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-soft);
}

/* SLOT DE AGENDA – VISÃO DIA */
.agenda-slot {
  display: flex;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--color-border);
  align-items: flex-start;
}

.agenda-slot-time {
  width: 60px;
  font-size: 0.85rem;
  font-weight: 600;
}

.agenda-slot-main {
  flex: 1;
  min-width: 0;
}

.agenda-slot-nome {
  font-size: 0.95rem;
  font-weight: 600;
}

.agenda-slot-extra {
  font-size: 0.8rem;
  color: var(--color-text-soft);
  margin-top: 2px;
}

/* TAGS DE STATUS / PLANO / TIPO */
.agenda-slot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 6px;
}

.agenda-slot-tags .tag-pill {
  font-size: 0.75rem;
}

/* STATUS ESPECÍFICOS DA AGENDA */
.tag-agenda-pendente {
  background: #fff7e6;
  border-color: #ffe0a3;
  color: #ad7a07;
}

.tag-agenda-confirmado {
  background: #e6f8ed;
  border-color: #b9eccd;
  color: #1d7a3c;
}

.tag-agenda-faltou {
  background: #fee2e2;
  border-color: #fecaca;
  color: #b91c1c;
}

/* AÇÕES (Atender, Editar) */
.agenda-slot-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-end;
}

/* BOTÕES DE STATUS (Confirmar, Faltou, Pendente) */
.agenda-slot-status-actions {
  display: flex;
  gap: 0.35rem;
  margin: 0.5rem 0;
  flex-wrap: wrap;
}

.btn-status {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 0.4rem;
  cursor: pointer;
  border: none;
  transition: 0.15s;
}

.btn-status-confirmar {
  background: #22c55e;
  color: #fff;
}
.btn-status-confirmar:hover {
  background: #16a34a;
}

.btn-status-faltou {
  background: #ef4444;
  color: #fff;
}
.btn-status-faltou:hover {
  background: #dc2626;
}

.btn-status-pendente {
  background: #f59e0b;
  color: #fff;
}
.btn-status-pendente:hover {
  background: #d97706;
}

/******************************************
 * VISUALIZAÇÃO SEMANAL (7 colunas)
 ******************************************/

.agenda-week {
  margin-top: 2rem;
}

.agenda-week-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 600;
  color: #34495e;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 0.75rem;
}

.agenda-week-header div {
  font-size: 0.9rem;
  padding: 0.35rem 0;
}

.agenda-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.75rem;
}

.agenda-week-column {
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 0.75rem;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
  min-height: 150px;
}

.agenda-week-column h4 {
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #516082;
}

.agenda-week-slot {
  background: #f7f9fb;
  padding: 0.4rem 0.55rem;
  border-radius: 0.5rem;
  margin-bottom: 0.45rem;
  border-left: 3px solid #516082;
}

.agenda-week-slot-time {
  font-size: 0.78rem;
  color: #34495e;
  font-weight: 600;
}

.agenda-week-slot-name {
  font-size: 0.78rem;
  color: #111;
}

.agenda-week-slot-type {
  font-size: 0.7rem;
  color: #666;
}

/**********************
 * RESPONSIVO
 **********************/
@media (max-width: 1020px) {
  .agenda-week-header {
    display: none;
  }

  .agenda-week-grid {
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    scroll-behavior: smooth;
  }

  .agenda-week-column {
    min-width: 230px;
  }
}

/* DRAWER – LADO DIREITO */
.agenda-drawer {
  position: fixed;
  right: -600px;
  top: 0;
  width: 600px;
  height: 100%;
  background: #fff;
  box-shadow: -2px 0 12px rgba(0,0,0,0.08);
  transition: right 0.25s ease;
  z-index: 3000;
  overflow-y: auto;
}

.agenda-drawer.aberto {
  right: 0;
}

.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.35);
  z-index: 2500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.drawer-backdrop.visivel {
  opacity: 1;
  pointer-events: all;
}

/* DESTACAR SLOT APÓS SALVAR */
.slot-highlight {
  animation: pulseHighlight 2s ease-out;
  border: 2px solid #22c55e !important;
  border-radius: 10px;
}

.toast.sucesso {
  background: #22c55e;
  color: white;
  font-weight: 600;
}

@keyframes pulseHighlight {
  0%   { background-color: #dcfce7; }
  50%  { background-color: #bbf7d0; }
  100% { background-color: #ffffff; }
}

/* RESPONSIVO GERAL */
@media (max-width: 900px) {
  .agenda-card {
    padding: 1rem 1.2rem;
  }

  .agenda-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .agenda-slot {
    flex-direction: column;
  }

  .agenda-slot-actions {
    flex-direction: row;
    justify-content: flex-start;
  }
}

/* DRAWER – SEÇÕES INTERNAS */
.drawer-section {
  padding: 0.75rem 0 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.drawer-section:last-of-type {
  border-bottom: none;
}

.drawer-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.15rem;
}

.drawer-section-subtitle {
  font-size: 0.78rem;
  color: #6b7280;
  margin-bottom: 0.75rem;
}

.drawer-body {
  padding: 1.1rem 1.25rem 1.4rem;
}

.drawer-header {
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
}

.drawer-subtitle {
  font-size: 0.8rem;
  color: #6b7280;
}

/* AÇÕES DO FORMULÁRIO NO DRAWER */
.acoes-form {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.acoes-form-right {
  display: flex;
  gap: 0.5rem;
}

@media (max-width: 768px) {
  .drawer-body {
    padding: 0.9rem 1rem 1.2rem;
  }

  .acoes-form {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .acoes-form-right {
    width: 100%;
    justify-content: flex-end;
  }

  .acoes-form-right .btn-primario {
    width: 100%;
  }
}

/* AUTOCOMPLETE DE PACIENTE NO DRAWER */
.campo-autocomplete {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
  max-height: 220px;
  overflow-y: auto;
  z-index: 4000;
  display: none;
}

.autocomplete-item {
  padding: 0.45rem 0.7rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: #111827;
}

.autocomplete-item:hover {
  background: #f3f4f6;
}
