/* =========================================================
   STYLE.CSS - MESCLADO E TOTALMENTE RESPONSIVO
   ========================================================= */

:root {
  --primary-color: #003366;    
  --secondary-color: #28a745;  
  --accent-color: #007bff;     
  --danger-color: #E53935;     
  --bg-color: #f4f6f9;         
}

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: var(--bg-color);
  box-sizing: border-box;
}

.layout {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 240px;
  background: #1e1e2f;
  color: white;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  z-index: 100;
}
.sidebar h2 { margin-bottom: 30px; font-size: 20px; }
.sidebar nav button {
  width: 100%; padding: 12px; margin-bottom: 10px; border: none;
  background: transparent; color: white; text-align: left;
  cursor: pointer; border-radius: 6px; transition: 0.2s;
}
.sidebar nav button:hover { background: #34344a; }
.logout {
  margin-top: auto; background: #e74c3c; border: none; padding: 12px;
  color: white; cursor: pointer; border-radius: 6px;
}

/* ===== MAIN & TOPBAR ===== */
.main { flex: 1; box-sizing: border-box; }
.topbar {
  background: white; padding: 15px 25px; display: flex;
  justify-content: space-between; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  box-sizing: border-box;
}

/* ===== CARDS DASHBOARD ===== */
.cards { display: flex; gap: 20px; padding: 20px; box-sizing: border-box; flex-wrap: wrap; }
.card {
  background: white; padding: 20px; flex: 1; border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08); box-sizing: border-box;
  min-width: 200px;
}
.card h3 { margin: 0; color: #555; }
.card p { font-size: 24px; margin-top: 10px; font-weight: bold; }

/* ===== CONTEÚDO ===== */
.conteudo { padding: 20px; width: 100%; box-sizing: border-box; }

/* ===== AGENDA PROFISSIONAL ===== */
.card-agenda {
  background: #ffffff; border-radius: 14px; padding: 16px; margin: 14px 0;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08); transition: 0.2s;
  border-left: 6px solid #ccc;
  box-sizing: border-box;
}
.card-agenda:hover { transform: translateY(-2px); }

.card-agenda.pago { border-left-color: var(--secondary-color); background: #e8f5e9; }
.card-agenda.pendente { border-left-color: #ffc107; background: #fffde7; }
.card-agenda.falta { border-left-color: var(--danger-color); background: #ffebee; }

.topo { display: flex; justify-content: space-between; font-size: 16px; margin-bottom: 6px; }
.servicos { margin: 10px 0; color: #666; font-size: 14px; }
.rodape { font-weight: bold; margin-bottom: 10px; }

/* ===== AÇÕES E BOTÕES ===== */
.acoes { display: flex; flex-wrap: wrap; gap: 6px; }
.acoes button {
  padding: 6px 10px; border: none; border-radius: 8px; cursor: pointer;
  background: #f1f1f1; font-size: 13px; transition: 0.2s;
}
.acoes button:hover { background: #ddd; }
button[disabled] { opacity: 0.7; cursor: not-allowed; }

/* ===== FORMULÁRIOS PADRONIZADOS ===== */
label { font-size: 0.9rem; font-weight: 600; color: #444; margin-top: 12px; display: block; }
input, select, textarea {
  width: 100%; padding: 10px 12px; margin-top: 5px; border: 1px solid #ccc;
  border-radius: 6px; font-size: 0.95rem; transition: border-color 0.2s; box-sizing: border-box;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-color); }

.btn-primary { 
  background: var(--primary-color); color: #fff; padding: 10px 18px; 
  border: none; border-radius: 6px; cursor: pointer; font-weight: bold; 
}
.btn-primary:hover { background: #002244; }

/* GRID CALENDÁRIO */
.grid-mensal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  box-sizing: border-box;
}

.dia-calendario {
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  min-height: 120px;
  padding: 5px;
  background: #fafafa;
  box-sizing: border-box;
}

.dia-calendario h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  text-align: right;
  color: #666;
}

.paciente-badge {
  font-size: 11px;
  padding: 4px;
  margin-bottom: 4px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: white;
  font-weight: bold;
}
.paciente-badge.doc-ok { background: var(--secondary-color); } 
.paciente-badge.doc-pendente { background: var(--danger-color); } 

.alerta-doc {
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 15px;
  font-weight: bold;
  text-align: center;
  box-sizing: border-box;
}
.alerta-doc.ok { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.alerta-doc.pendente { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }

input[type="text"], input:not([type="date"]):not([type="number"]):not([type="checkbox"]), select, textarea {
  text-transform: uppercase;
}

.titulo-agenda { margin: 0; }
.controles-mes { display: flex; align-items: center; gap: 10px; margin-top: 8px; margin-bottom: 10px; }
.botoes-alternancia { display: flex; gap: 8px; }
.btn-imprimir { background-color: #17a2b8; color: white; border: none; padding: 8px 14px; border-radius: 4px; cursor: pointer; font-weight: bold; }
.lista-diaria { background: #fff; padding: 15px; border-radius: 8px; border: 1px solid #ddd; box-sizing: border-box; }

.agenda-wrapper { background: #f9f9f9; padding: 20px; border-radius: 8px; box-sizing: border-box; }
.painel-detalhes-paciente { background: #fff; padding: 15px; border-radius: 6px; border: 1px solid #ddd; margin-bottom: 15px; box-sizing: border-box; }
.painel-detalhes-paciente h4 { margin-top: 0; color: var(--primary-color); }
.status-badge { padding: 3px 8px; border-radius: 4px; font-weight: bold; }
.status-badge.pago { background: #d4edda; color: #155724; }
.status-badge.pendente { background: #f8d7da; color: #721c24; }
.btn-cancelar-form { background-color: var(--danger-color); color: white; border: none; padding: 10px; border-radius: 4px; cursor: pointer; font-weight: bold; width: 100%; margin-top: 10px; }
.btn-cancelar-form:hover { background-color: #c62828; }
.btn-fechar-modal { width: 100%; margin-top: 8px; padding: 6px; cursor: pointer; border: 1px solid #ccc; background: #fff; border-radius: 4px; }

.form-label { display: block; margin-top: 8px; }
.form-label.destaque { font-weight: bold; font-size: 13px; }
.form-control { width: 100%; padding: 8px; box-sizing: border-box; background: #ffffff; border: 1px solid #ccc; border-radius: 4px; margin-top: 5px; }
.form-control[readonly] { background: #e9ecef; }
.caixa-sugestoes { background: white; border: 1px solid #ccc; position: absolute; width: calc(100% - 40px); z-index: 10; max-height: 200px; overflow-y: auto; box-sizing: border-box; }
.sugestao-item { padding: 8px; cursor: pointer; border-bottom: 1px solid #eee; }
.sugestao-item:hover { background: #f1f1f1; }

.text-area-resumo { height: 60px; font-family: sans-serif; resize: none; font-size: 12px; }
.valor-total { font-weight: bold; font-size: 15px; color: #155724; }
.btn-salvar { width: 100%; padding: 12px; font-weight: bold; font-size: 15px; }

.tag-paciente { padding: 4px 6px; border-radius: 4px; font-size: 11px; font-weight: bold; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; display: block; transition: transform 0.1s ease; }
.tag-paciente:hover { transform: scale(1.02); }
.tag-pago { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.tag-pendente { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 9999; box-sizing: border-box; }
.modal-box { background: #fff; padding: 25px; border-radius: 8px; text-align: center; max-width: 420px; width: 90%; box-shadow: 0 4px 15px rgba(0,0,0,0.2); box-sizing: border-box; }
.modal-titulo-alerta { margin-top: 0; color: var(--primary-color); }
.modal-titulo-sucesso { margin-top: 0; color: var(--secondary-color); }
.modal-texto { font-size: 15px; color: #333; margin: 15px 0; }
.modal-botoes { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.btn-sim { background: var(--secondary-color); color: white; border: none; padding: 10px 22px; border-radius: 5px; cursor: pointer; font-weight: bold; }
.btn-nao { background: var(--danger-color); color: white; border: none; padding: 10px 22px; border-radius: 5px; cursor: pointer; font-weight: bold; }

/* MEDIA QUERY GLOBAL PARA DISPOSITIVOS MÓVEIS / TABLETS */
@media(max-width: 900px) {
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    padding: 10px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }
  .sidebar h2 { margin: 0; font-size: 16px; }
  .sidebar nav { display: flex; gap: 5px; flex-wrap: wrap; width: 100%; }
  .sidebar nav button { width: auto; margin-bottom: 0; padding: 8px 10px; font-size: 12px; }
  .logout { margin-top: 0; padding: 8px 12px; font-size: 12px; }
  .main { margin-left: 0 !important; }
  .cards { flex-direction: column; padding: 10px; }
  .grid-mensal { grid-template-columns: repeat(1, 1fr); }
}