/* ═══════════════════════════════════════
   TBS — Agenda
   Estilos exclusivos da página Agenda
═══════════════════════════════════════ */

/* ─── LAYOUT ─── */
.agenda-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}

/* ─── CALENDÁRIO ─── */
.calendar-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  position: sticky;
  top: calc(var(--topbar-h) + 28px);
}
.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.cal-month {
  font-family: 'Epilogue', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--white);
}
.cal-nav { display: flex; gap: 8px; }
.cal-btn {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.cal-btn:hover { background: var(--surface3); color: var(--white); }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 12px 16px 16px;
}
.cal-day-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  text-align: center;
  padding: 5px 0;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  position: relative;
  gap: 2px;
  transition: background 0.15s;
}
.cal-day:hover     { background: var(--surface2); color: var(--white); }
.cal-day.today     { background: rgba(109,40,217,0.22); color: var(--accent-light); border: 1px solid rgba(109,40,217,0.45); }
.cal-day.selected  { background: linear-gradient(135deg, #6D28D9, #8B5CF6); color: white; box-shadow: 0 2px 12px rgba(109,40,217,0.5); }
.cal-day.has-event::after {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--green);
  position: absolute;
  bottom: 3px;
}
.cal-day.selected::after { background: rgba(255,255,255,0.7); }

/* ─── LISTA DE AGENDAMENTOS ─── */
.agenda-list { display: flex; flex-direction: column; gap: 12px; }
.agenda-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  cursor: pointer;
  transition: all 0.18s;
}
.agenda-card:hover      { border-color: var(--border2); transform: translateY(-1px); }
.agenda-time-col        { min-width: 52px; text-align: right; flex-shrink: 0; }
.agenda-time            { font-size: 13px; font-weight: 700; color: var(--text2); }
.agenda-date-label      { font-size: 10px; color: var(--text3); margin-top: 2px; }
.agenda-bar             { width: 3px; border-radius: 4px; min-height: 44px; flex-shrink: 0; }
.agenda-info            { flex: 1; }
.agenda-title           { font-size: 14px; font-weight: 700; color: var(--white); margin-bottom: 3px; }
.agenda-client          { font-size: 12px; color: var(--text2); }
.agenda-tag             { margin-top: 6px; }

/* ─── SIMULADOR DE TEMPO (botão testar) ─── */
#painel-simulador {
  position: fixed;
  bottom: 80px; right: 20px;
  z-index: 2100;
  background: var(--surface);
  border: 1px solid rgba(109,40,217,0.4);
  border-radius: 18px;
  padding: 18px 20px;
  max-width: 340px;
  width: 90%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ─── HORA FIM DISPLAY (modal de agendamento) ─── */
#ag-hora-fim-display {
  font-weight: 700;
  color: var(--green);
  font-size: 15px;
  font-family: 'Epilogue', sans-serif;
}

/* ─── SLOTS DISPONÍVEIS ─── */
#ag-slots-disponiveis {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
  min-height: 0;
}
.slot-btn {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all 0.15s;
  white-space: nowrap;
  line-height: 1;
}
.slot-btn.slot-livre {
  background: rgba(16,217,160,0.08);
  border-color: rgba(16,217,160,0.3);
  color: var(--green);
}
.slot-btn.slot-livre:hover {
  background: rgba(16,217,160,0.2);
  border-color: var(--green);
  transform: translateY(-1px);
}
.slot-btn.slot-ocupado {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text3);
  cursor: not-allowed;
  opacity: 0.45;
}

/* ─── ALERTA DE CONFLITO ─── */
#ag-conflito-alerta {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.55;
  border: 1px solid rgba(239,68,68,0.25);
}
#ag-conflito-alerta strong { color: var(--red); }
.conflito-sugestao {
  margin-top: 6px;
  padding: 5px 10px;
  background: rgba(34,211,165,0.08);
  border: 1px solid rgba(34,211,165,0.2);
  border-radius: 7px;
  font-size: 11px;
  color: var(--green);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s;
}
.conflito-sugestao:hover { background: rgba(34,211,165,0.16); }

/* ─── CARD DE BLOQUEIO NA LISTA ─── */
.agenda-card.bloqueio {
  border-color: rgba(239,68,68,0.22);
  background: rgba(239,68,68,0.03);
  cursor: default;
  opacity: 0.88;
}
.agenda-card.bloqueio:hover {
  border-color: rgba(239,68,68,0.38);
  transform: none;
}
.agenda-card.bloqueio .agenda-title {
  color: var(--text3) !important;
  font-size: 13px;
}
.agenda-card.bloqueio .agenda-time { color: var(--red); }

/* ─── KPI STRIP (topo da agenda) ─── */
.ag-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.ag-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
}
.ag-kpi-val {
  font-family: 'Epilogue', sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: var(--white);
  line-height: 1.1;
}
.ag-kpi-label { font-size: 11px; color: var(--text3); margin-top: 4px; font-weight: 600; }
.ag-kpi-green .ag-kpi-val { color: var(--green); }
.ag-kpi-purple .ag-kpi-val { color: var(--accent-light); }

/* ─── DIA RESUMO ─── */
.ag-dia-resumo {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.ag-dia-resumo-label { font-size: 12px; font-weight: 700; color: var(--text2); }
.ag-dia-resumo-pills { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ag-dia-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
.ag-dia-pill-total   { background: rgba(109,40,217,0.1);  color: var(--accent-light); border: 1px solid rgba(109,40,217,0.25); }
.ag-dia-pill-orange  { background: rgba(249,115,22,0.1);  color: var(--orange);       border: 1px solid rgba(249,115,22,0.25); }
.ag-dia-pill-green   { background: rgba(34,211,165,0.1);  color: var(--green);        border: 1px solid rgba(34,211,165,0.25); }
.ag-dia-pill-red     { background: rgba(244,63,94,0.08);  color: #f87171;             border: 1px solid rgba(244,63,94,0.25); }

/* ─── MAPS BUTTON no card ─── */
.ag-maps-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-light);
  background: rgba(109,40,217,0.1);
  border: 1px solid rgba(109,40,217,0.25);
  border-radius: 8px;
  padding: 2px 8px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
  font-family: 'Plus Jakarta Sans', sans-serif;
  white-space: nowrap;
}
.ag-maps-btn:hover { background: rgba(109,40,217,0.22); }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .ag-kpi-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .ag-kpi-strip { grid-template-columns: 1fr 1fr; gap: 8px; }
}

/* ── Tema Claro ── */
[data-tema="light"] .cal-month,
[data-tema="light"] .agenda-title { color: var(--text) !important; }
[data-tema="light"] .cal-btn:hover { color: var(--text) !important; }
[data-tema="light"] .cal-day:hover { color: var(--text) !important; }
[data-tema="light"] .ag-kpi-val { color: var(--text) !important; }
