/* ============================================================
   SANTOOLIVER — COMPONENTES VISUAIS COMPARTILHADOS
   Cards, Grids, Formulários, Botões, Badges e Widgets
   ============================================================ */

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(14px, 1.6vw, 20px);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(19px, 2.2vw, 29px);
  box-shadow: var(--shadow);
  min-width: 0;
}

.col-12 { grid-column: span 12; }
.col-8  { grid-column: span 8; }
.col-6  { grid-column: span 6; }
.col-4  { grid-column: span 4; }

.card h2 {
  font-size: clamp(21px, 1.9vw, 27px);
  letter-spacing: -0.035em;
  line-height: 1.25;
  font-weight: 800;
  margin-top: 0;
  margin-bottom: 20px;
}

.card h3 {
  font-size: 19px;
  letter-spacing: -0.025em;
  margin-top: 0;
  margin-bottom: 14px;
}

/* Formulários */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 14px;
}

.campo {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.campo.full {
  grid-column: 1 / -1;
}

label {
  font-size: 13.5px;
  font-weight: 750;
  color: #444b60;
  letter-spacing: 0.005em;
}

input, select, textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 52px;
  padding: 13px 15px;
  border: 1.5px solid #dce0e9;
  border-radius: 13px;
  font-size: 16px;
  background: #ffffff;
  color: var(--text);
  outline: none;
  transition: border-color 0.17s, box-shadow 0.17s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

input[readonly] {
  background: #f8f8fc;
  color: #485168;
}

textarea {
  min-height: 104px;
  resize: vertical;
}

select {
  cursor: pointer;
}

/* Botões */
.acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.btn {
  border: 0;
  border-radius: 13px;
  padding: 12px 18px;
  min-height: 49px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.17s, background 0.17s, box-shadow 0.17s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(118, 80, 212, 0.18);
}

.btn-primary:hover {
  background: var(--primary2);
}

.btn-light {
  background: #f1edfb;
  color: #503399;
}

.btn-light:hover {
  background: #e4dcfa;
}

.btn-danger {
  background: #fff0f3;
  color: #af2742;
}

.btn-danger:hover {
  background: #fde0e6;
}

/* Widgets e Estatísticas */
.resumo {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  border-radius: 18px;
  padding: 17px 16px;
  background: linear-gradient(160deg, #ffffff 60%, #faf8ff);
  border: 1px solid var(--line);
  min-width: 0;
}

.stat span {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stat strong {
  display: block;
  margin-top: 5px;
  font-size: clamp(21px, 2vw, 29px);
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

/* Lista de Agendamentos e Registros */
.lista {
  display: grid;
  gap: 12px;
}

.agendamento {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 18px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(110px, 130px) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  box-shadow: 0 3px 12px rgba(31, 31, 67, 0.03);
}

.hora {
  font-weight: 900;
  font-size: 20px;
  color: var(--primary2);
}

.detalhes {
  min-width: 0;
  overflow-wrap: anywhere;
}

.detalhes strong {
  font-size: 17px;
  display: block;
}

.detalhes small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

/* Badges de Status */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  background: #f1edf0;
  text-transform: uppercase;
  margin-top: 5px;
}

.status-AGENDADO   { background: #eef2ff; color: #3730a3; }
.status-CONFIRMADO { background: #eaf7ef; color: var(--ok); }
.status-CONCLUIDO  { background: #e8f2ff; color: #215a9b; }
.status-CANCELADO,
.status-FALTOU     { background: #fff0f2; color: var(--danger); }

/* Avisos */
.aviso {
  border: 1px solid #ead9b4;
  background: #fff9eb;
  color: #674b12;
  border-radius: 15px;
  padding: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.vazio {
  text-align: center;
  padding: 32px;
  color: var(--muted);
  font-size: 15px;
}

/* Responsividade Mobile e Tablet */
@media (max-width: 800px) {
  .col-8, .col-6, .col-4 {
    grid-column: span 12;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .campo.full {
    grid-column: auto;
  }
  .resumo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .agendamento {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .acoes {
    flex-direction: column;
  }
  .acoes .btn, .acoes button {
    width: 100%;
  }
}
