/* Virando o Jogo Solo — Fase 6: Agenda e CRM */

.phase6-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.phase6-toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.phase6-segmented {
  display: inline-flex;
  padding: 4px;
  border-radius: 12px;
  background: #eaf0f3;
  border: 1px solid #d9e4e9;
}

.phase6-segmented button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 8px 13px;
  border-radius: 9px;
  color: #526874;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.phase6-segmented button.active {
  background: #fff;
  color: #0d4f6b;
  box-shadow: 0 2px 9px rgba(13, 79, 107, 0.12);
}

.phase6-period-title {
  min-width: 210px;
  text-align: center;
  color: #16384a;
  font-weight: 800;
}

.phase6-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.phase6-metric {
  background: #fff;
  border: 1px solid #dfe8ec;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(13, 79, 107, 0.06);
}

.phase6-metric span {
  display: block;
  color: #6b7e88;
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.phase6-metric strong {
  color: #16384a;
  font-size: 1.55rem;
}

.phase6-panel {
  background: #fff;
  border: 1px solid #dfe8ec;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 14px 36px rgba(13, 79, 107, 0.06);
}

.phase6-empty {
  min-height: 220px;
  display: grid;
  place-content: center;
  text-align: center;
  color: #72838c;
  gap: 8px;
}

.phase6-empty strong {
  color: #16384a;
  font-size: 1.05rem;
}

.phase6-day-group + .phase6-day-group {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #e7edf0;
}

.phase6-day-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.phase6-day-heading h3 {
  margin: 0;
  color: #16384a;
  font-size: 1rem;
}

.phase6-day-heading span {
  color: #778993;
  font-size: 0.82rem;
}

.phase6-agenda-list {
  display: grid;
  gap: 10px;
}

.phase6-agenda-item {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid #e0e9ed;
  border-left: 5px solid #0d4f6b;
  border-radius: 13px;
  padding: 13px 14px;
  background: #fbfdfe;
}

.phase6-agenda-item.status-confirmed { border-left-color: #15935a; }
.phase6-agenda-item.status-completed { border-left-color: #64748b; opacity: 0.82; }
.phase6-agenda-item.status-cancelled { border-left-color: #dc5b5b; opacity: 0.72; }
.phase6-agenda-item.status-no_show { border-left-color: #d97706; }

.phase6-agenda-time {
  color: #0d4f6b;
  font-weight: 800;
  text-align: center;
}

.phase6-agenda-time small {
  display: block;
  color: #83939b;
  font-weight: 600;
  margin-top: 3px;
}

.phase6-agenda-main strong {
  display: block;
  color: #16384a;
  margin-bottom: 4px;
}

.phase6-agenda-main span {
  color: #6f818a;
  font-size: 0.84rem;
}

.phase6-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.phase6-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  background: #edf3f5;
  color: #546a75;
}

.phase6-badge.confirmed { background: #e8f7ef; color: #117548; }
.phase6-badge.completed { background: #eef2f6; color: #475569; }
.phase6-badge.cancelled { background: #fff0f0; color: #b42318; }
.phase6-badge.no_show { background: #fff7e8; color: #9a5b00; }
.phase6-badge.scheduled { background: #eaf5fb; color: #0d6083; }

.phase6-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid #dde7eb;
  border-radius: 14px;
  overflow: hidden;
}

.phase6-calendar-weekday {
  padding: 9px;
  text-align: center;
  background: #edf3f5;
  color: #5b707a;
  font-size: 0.76rem;
  font-weight: 800;
}

.phase6-calendar-day {
  min-height: 120px;
  padding: 9px;
  border-top: 1px solid #e3ebee;
  border-right: 1px solid #e3ebee;
  background: #fff;
}

.phase6-calendar-day:nth-child(7n) { border-right: 0; }
.phase6-calendar-day.muted { background: #f7f9fa; color: #9aa6ac; }
.phase6-calendar-day.today { box-shadow: inset 0 0 0 2px #0d4f6b; }

.phase6-calendar-number {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 0.83rem;
  margin-bottom: 7px;
}

.phase6-calendar-event {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 7px;
  padding: 5px 6px;
  margin-bottom: 5px;
  background: #eaf5fb;
  color: #0d4f6b;
  font: inherit;
  font-size: 0.7rem;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phase6-calendar-more {
  color: #6b7e88;
  font-size: 0.7rem;
  font-weight: 700;
}

.phase6-kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(240px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.phase6-kanban-column {
  background: #f2f6f8;
  border: 1px solid #dce6ea;
  border-radius: 16px;
  min-height: 360px;
  padding: 12px;
}

.phase6-kanban-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.phase6-kanban-head strong {
  color: #16384a;
  font-size: 0.9rem;
}

.phase6-kanban-head span {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: #5f727c;
  font-size: 0.74rem;
  font-weight: 800;
}

.phase6-kanban-cards {
  display: grid;
  gap: 10px;
}

.phase6-opportunity-card {
  background: #fff;
  border: 1px solid #dce6ea;
  border-radius: 13px;
  padding: 12px;
  box-shadow: 0 8px 20px rgba(13, 79, 107, 0.05);
}

.phase6-opportunity-card h4 {
  margin: 0 0 6px;
  color: #16384a;
  font-size: 0.9rem;
}

.phase6-opportunity-card p {
  margin: 0;
  color: #6f818a;
  font-size: 0.78rem;
}

.phase6-opportunity-value {
  margin: 10px 0;
  color: #117548;
  font-weight: 800;
}

.phase6-next-action {
  border-top: 1px solid #e6edef;
  margin-top: 9px;
  padding-top: 9px;
  color: #5f727c;
  font-size: 0.75rem;
}

.phase6-next-action.overdue {
  color: #b42318;
  font-weight: 700;
}

.phase6-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.phase6-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 31, 42, 0.55);
  display: grid;
  place-items: center;
  padding: 18px;
}

.phase6-modal {
  width: min(760px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(5, 25, 35, 0.28);
}

.phase6-modal-head,
.phase6-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
}

.phase6-modal-head { border-bottom: 1px solid #e3ebee; }
.phase6-modal-foot { border-top: 1px solid #e3ebee; justify-content: flex-end; }
.phase6-modal-head h3 { margin: 0; color: #16384a; }
.phase6-modal-body { padding: 20px; }

.phase6-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.phase6-form-grid .full { grid-column: 1 / -1; }

.phase6-field label {
  display: block;
  color: #334d5a;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.phase6-field input,
.phase6-field select,
.phase6-field textarea {
  width: 100%;
  border: 1px solid #cfdae0;
  border-radius: 10px;
  padding: 10px 11px;
  font: inherit;
  color: #16384a;
  background: #fff;
  box-sizing: border-box;
}

.phase6-field textarea { min-height: 90px; resize: vertical; }

.phase6-warning {
  padding: 12px 14px;
  border-radius: 11px;
  background: #fff8e8;
  border: 1px solid #f7d58c;
  color: #7a5200;
  font-size: 0.82rem;
  line-height: 1.45;
}

.phase6-module-disabled {
  min-height: 340px;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #dfe8ec;
  border-radius: 18px;
  padding: 28px;
}

.phase6-module-disabled h2 { margin: 0; color: #16384a; }
.phase6-module-disabled p { margin: 0; color: #6b7e88; max-width: 560px; }

@media (max-width: 1100px) {
  .phase6-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .phase6-calendar-day { min-height: 100px; }
}

@media (max-width: 760px) {
  .phase6-metrics { grid-template-columns: 1fr; }
  .phase6-agenda-item { grid-template-columns: 72px minmax(0, 1fr); }
  .phase6-agenda-item .phase6-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .phase6-calendar-grid { min-width: 760px; }
  .phase6-panel:has(.phase6-calendar-grid) { overflow-x: auto; }
  .phase6-form-grid { grid-template-columns: 1fr; }
  .phase6-form-grid .full { grid-column: auto; }
}
