:root {
  /* Paleta Life & Cor */
  --navy:#0f2d4a;          /* azul escuro do header */
  --navy-700:#13395e;
  --gold:#d6b36a;          /* dourado principal */
  --gold-700:#b9934f;

  /* Base clara e tipografia */
  --bg:#f6f7fb;
  --ink:#0f172a;
  --muted:#6b748b;
  --card:#ffffff;
  --line:#e5e7eb;

  /* Feedback */
  --ok:#059669;
  --warn:#dc2626;
}

* { box-sizing:border-box; }
body {
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Arial,sans-serif;
  background:var(--bg);
  color:var(--ink);
}
a { color:var(--navy); text-decoration:none; }
.container { max-width:1100px; margin:16px auto; padding:0 16px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:16px; }
.grid { display:grid; gap:16px; }
.grid-2 { grid-template-columns:1fr 1fr; }
input,select,textarea {
  width:100%; padding:10px;
  border:1px solid var(--line); border-radius:10px;
  background:#fff;
}
label { font-size:.9rem; color:var(--muted); display:block; margin:.5rem 0 .25rem; }
.small { font-size:.85rem; color:var(--muted); }

/* ====================== HEADER ====================== */
header {
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 18px; background:var(--navy);
  border-bottom:1px solid rgba(255,255,255,.08);
  position:sticky; top:0; z-index:10; color:#fff;
}
.brand { display:flex; align-items:center; gap:10px; color:#fff; }
.brand img { height:28px; width:auto; display:block; }
.brand strong { font-weight:700; }
.nav-desktop ul { display:flex; gap:12px; list-style:none; padding:0; margin:0; }
.nav-desktop a {
  color:#fff; opacity:.9; padding:6px 8px; border-radius:8px;
}
.nav-desktop a:hover { opacity:1; background:rgba(255,255,255,.06); }
.nav-desktop a.active {
  background:rgba(214,179,106,.15);
  color:#fff; border:1px solid rgba(214,179,106,.45);
}

/* ====================== MENU MOBILE ====================== */
.hamburger { display:none; background:none; border:none; cursor:pointer; }
.hamburger span {
  display:block; width:24px; height:3px; margin:5px;
  background:#fff; border-radius:3px;
}
.mobile-menu, .mobile-overlay { display:none; }

@media (max-width:768px) {
  .nav-desktop { display:none; }
  .hamburger { display:block; }

  .mobile-menu {
    display:flex; flex-direction:column;
    background:var(--navy);
    position:fixed; top:0; right:-100%;
    width:240px; height:100%;
    padding:20px; transition:right .3s ease;
    z-index:20;
  }
  .mobile-menu.open { right:0; }
  .mobile-menu a {
    color:#fff; padding:10px; border-radius:6px;
  }
  .mobile-menu a:hover { background:rgba(255,255,255,0.1); }
  .mobile-overlay {
    display:none; position:fixed; top:0; left:0;
    width:100%; height:100%;
    background:rgba(0,0,0,0.5); z-index:15;
  }
  .mobile-overlay.show { display:block; }
}
.hamburger {
  display:none;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  width:40px;
  height:40px;
  border:none;
  background:none;
  cursor:pointer;
  padding:0;
}
.hamburger span {
  display:block;
  width:24px;
  height:3px;
  margin:4px 0;
  background:#fff;
  border-radius:3px;
  transition:0.3s;
}

@media (max-width:768px) {
  .nav-desktop { display:none !important; }   /* força esconder */
  .hamburger { display:flex; }                /* mostra botão */
}

.hamburger.open span:nth-child(1) {
  transform:rotate(45deg) translate(5px, 5px);
}
.hamburger.open span:nth-child(2) { opacity:0; }
.hamburger.open span:nth-child(3) {
  transform:rotate(-45deg) translate(6px, -6px);
}


/* ====================== BOTÕES ====================== */
.btn {
  display:inline-flex; align-items:center; gap:8px;
  padding:10px 14px; border-radius:10px;
  border:1px solid var(--line); background:#fff;
  cursor:pointer;
}
.btn.primary { background:var(--gold); border-color:var(--gold); color:#1f2937; }
.btn.primary:hover { background:var(--gold-700); border-color:var(--gold-700); }
.btn.success { background:var(--ok); border-color:var(--ok); color:#fff; }
.btn.danger { background:var(--warn); border-color:var(--warn); color:#fff; }

/* ====================== TABELAS ====================== */
.table { width:100%; border-collapse:collapse; }
.table th, .table td {
  padding:10px; border-bottom:1px solid var(--line); text-align:left;
}
.badge {
  padding:4px 8px; border-radius:999px;
  background:rgba(15,45,74,.06);
  border:1px solid var(--line); font-size:.8rem;
}

/* Pacientes → tabela desktop / cards mobile */
.table-patients { width:100%; border-collapse:collapse; }
.table-patients th, .table-patients td {
  padding:12px; border-bottom:1px solid var(--line);
}

@media (max-width:768px) {
  .table-patients, .table-patients thead, .table-patients tbody,
  .table-patients tr, .table-patients th, .table-patients td {
    display:block; width:100%;
  }
  .table-patients thead { display:none; }
  .table-patients tr {
    background:var(--card); margin-bottom:12px;
    border-radius:12px; padding:12px;
    box-shadow:0 1px 3px rgba(0,0,0,.05);
  }
  .table-patients td {
    padding:6px 0; border:none;
  }
  .table-patients td::before {
    content:attr(data-label);
    font-weight:600; color:var(--muted);
    display:block; margin-bottom:2px; font-size:.85rem;
  }
  .btn { width:100%; justify-content:center; margin-top:6px; }
}

/* ====================== RODAPÉ ====================== */
footer { padding:32px 16px; color:var(--muted); text-align:center; }





/* ====================== */
/* ESTILO DA AGENDA (sch) */
/* ====================== */

.sch-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.sch-tabs {
  display: inline-flex;
  gap: 4px;
}

.sch-tabs .tab {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: .9rem;
  color: var(--ink);
}

.sch-tabs .tab.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}

.sch-head {
  display: grid;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  overflow: hidden;
}

.sch-day-head {
  padding: 8px;
  text-align: center;
  border-left: 1px solid var(--line);
  background: #f9fafb;
  font-weight: 600;
  font-size: .9rem;
}

.sch-day-head.is-today {
  background: var(--gold);
  color: #fff;
}

.sch-grid {
  display: grid;
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 10px 10px;
  overflow-x: auto;
  min-height: 600px; /* 👈 garante altura boa */
}


.sch-timecol {
  position: relative;
  border-right: 1px solid var(--line);
}

.sch-time-label {
  position: absolute;
  left: 8px;
  font-size: .75rem;
  color: var(--muted);
}

.sch-line {
  position: absolute;
  left: 0; right: 0;
  border-top: 1px dashed #e5e7eb;
}

.sch-line.hour {
  border-top: 1px solid #d1d5db;
}

.sch-day {
  position: relative;
  border-left: 1px solid var(--line);
}

.sch-slot {
  position: absolute;
  left: 0; right: 0;
  background: transparent;
}

/* Eventos na agenda */
.sch-event {
  position: absolute;
  left: 4px; right: 4px;
  border-radius: 10px;
  background: var(--card); /* fundo neutro */
  color: var(--ink);
  padding: 6px 8px;
  font-size: .8rem;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: 0 2px 4px rgba(0,0,0,.08);
}

.sch-event .sch-ev-time {
  font-weight: 600;
  font-size: .75rem;
  margin-bottom: 2px;
}

.sch-event .sch-ev-title {
  font-size: .9rem;
  font-weight: bold;
}

.sch-event .sch-ev-sub {
  font-size: .75rem;
  opacity: .8;
}

/* Cores vindas do sistema */
.sch-event[style*="--ev"] {
  background: var(--ev, var(--card));
  color: #fff;
  border-color: rgba(0,0,0,.15);
}

/* Status padrão (fallback, se não tiver cor no DB) */
.sch-event.status-scheduled { background: #3b82f6; color:#fff; }
.sch-event.status-confirmed { background: #10b981; color:#fff; }
.sch-event.status-done      { background: #6366f1; color:#fff; }
.sch-event.status-cancelled { background: #ef4444; color:#fff; }


/* Modal */
.modal-wrap {
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.4);
  align-items:center;
  justify-content:center;
  z-index:100;
}
.modal-wrap.show { display:flex; }
.modal {
  background:#fff;
  border-radius:12px;
  max-width:600px;
  width:90%;
  padding:20px;
  box-shadow:0 6px 20px rgba(0,0,0,.25);
  position:relative;
}
.modal-close {
  position:absolute;
  top:10px;right:12px;
  font-size:1.5rem;
  background:none;border:none;
  cursor:pointer;color:var(--muted);
}
.appt-actions { margin-top:16px; display:flex; gap:12px; }
.appt-actions .btn { flex:1; text-align:center; justify-content:center; }


/* Agenda - cabeçalho */
.sch-head {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.sch-day-head {
  text-align: center;
  padding: 6px 0;
  border-left: 1px solid var(--line);
}
.sch-day-head.is-today {
  background: rgba(214,179,106,0.15);
  font-weight: 700;
  border-radius: 6px 6px 0 0;
}
.sch-day-name {
  font-size: .9rem;
  color: var(--muted);
}
.sch-day-date {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

/* Agenda - grade */
.sch-grid {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 12px 12px;
  overflow-y: auto;
}
.sch-timecol {
  position: relative;
  border-right: 1px solid var(--line);
}
.sch-time-label {
  position: absolute;
  left: 4px;
  font-size: .75rem;
  color: var(--muted);
}
.sch-line {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: #f1f1f1;
}
.sch-line.hour {
  background: #ddd;
}

/* Eventos (agendamentos) */
.sch-event {
  position: absolute;
  left: 4px; right: 4px;
  border-radius: 10px;
  padding: 4px 6px;
  font-size: .8rem;
  background: var(--gold);
  color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,.15);
  cursor: pointer;
  transition: transform .1s ease, box-shadow .1s ease;
}
.sch-event:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 8px rgba(0,0,0,.2);
  z-index: 10;
}
.sch-ev-time {
  font-weight: 700;
  font-size: .8rem;
}
.sch-ev-title {
  font-weight: 600;
  font-size: .9rem;
}
.sch-ev-sub {
  font-size: .75rem;
  color: var(--muted);
}

/* Status / cores personalizadas */
.sch-event[style*="--ev:"] {
  background: var(--ev);
  color: #fff;
}


/* Filtro de agendas */
.sch-filters {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  flex-wrap: wrap;
}
.sch-filters a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  transition: transform .1s ease, box-shadow .1s ease;
}
.sch-filters a:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

/* Cores fixas para cada agenda */
.sch-filters .all      { background: #6b7280; }   /* cinza */
.sch-filters .joao     { background: #2563eb; }   /* azul */
.sch-filters .carol    { background: #f97316; }   /* laranja */
.sch-filters .testes   { background: #16a34a; }   /* verde */
.sch-filters .triagem  { background: #dc2626; }   /* vermelho */
.sch-filters .injetaveis { background: #7c3aed; } /* roxo */

/* Agenda atual */
.sch-filters a.active {
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(0,0,0,.2);
}



/* ====== FILTRO DE SALAS ====== */
.sch-rooms {
  display: flex;
  gap: 8px;
  margin: 16px 0;
  flex-wrap: wrap;
}

.sch-rooms .tab {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: .9rem;
  font-weight: 600;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #374151;
  transition: all .2s;
}

.sch-rooms .tab:hover {
  background: #e5e7eb;
  text-decoration: none;
}

/* Cores fixas para cada sala */
.sch-rooms .tab[data-room="0"] { background:#f9fafb; border-color:#d1d5db; }
.sch-rooms .tab[data-room="1"] { background:#e0f2fe; border-color:#38bdf8; color:#075985; } /* Dr João Jackson */
.sch-rooms .tab[data-room="2"] { background:#fef9c3; border-color:#facc15; color:#713f12; } /* Dra Carol */
.sch-rooms .tab[data-room="3"] { background:#dcfce7; border-color:#22c55e; color:#14532d; } /* Sala de Testes */
.sch-rooms .tab[data-room="4"] { background:#fce7f3; border-color:#ec4899; color:#831843; } /* Sala de Triagem */
.sch-rooms .tab[data-room="5"] { background:#ede9fe; border-color:#8b5cf6; color:#312e81; } /* Sala de Injetáveis */

/* Aba ativa ganha destaque */
.sch-rooms .tab.active {
  box-shadow: 0 0 0 2px rgba(0,0,0,.1) inset;
  transform: scale(1.05);
}





/* Listagem de pacientes — Desktop padrão */
.patient-table { display: table; width: 100%; border-collapse: collapse; }
.patient-table thead { background: var(--bg); }
.patient-table th, .patient-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

/* Cards (mobile) */
.patient-card {
  display: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.patient-card strong { font-size: 1rem; }
.patient-card .small { font-size: .85rem; color: var(--muted); }

/* Responsividade */
@media (max-width: 768px) {
  .patient-table { display: none; }
  .patient-card { display: block; }
  .nav-desktop { display: none; }
  .hamburger { display: flex; }
}


/* 📌 Padrão: desktop mostra tabela, esconde cards */
.patients-table {
  display: table;
  width: 100%;
}
.patients-card {
  display: none;
}

/* 📱 Mobile: esconde tabela, mostra cards */
@media (max-width: 768px) {
  .patients-table {
    display: none;
  }
  .patients-card {
    display: block;
    margin-bottom: 16px;
  }
}


/* Desktop: tabela visível */
.patients-table { display: block; }
.patients-card { display: none; }

/* Mobile: cards visíveis */
@media (max-width: 768px) {
  .patients-table { display: none; }
  .patients-card { display: block; }
}



/* Ajuste da tabela de pacientes */
.table td {
  vertical-align: middle;
  font-size: 14px; /* fonte menor nas linhas */
  white-space: nowrap;
}

.table td:nth-child(4), /* CPF */
.table td:nth-child(5) { /* Cidade */
  font-size: 13px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Coluna de ações (botões) */
.table td:last-child {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Botões compactos */
.table td .btn {
  font-size: 13px;
  padding: 4px 10px;
  min-width: 70px;
  text-align: center;
}


/* Coluna SKU limitada */
.table td:nth-child(1), 
.table th:nth-child(1) {
  max-width: 150px;   /* largura máxima da célula */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Coluna SKU limitada */
.table td:nth-child(2), 
.table th:nth-child(2) {
  max-width: 100px;   /* largura máxima da célula */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}



.grid-4 {
  display: grid;
  grid-template-columns: 140px 140px 150px 1fr;
  gap: 8px;
}
.grid-4 select,
.grid-4 input {
  width: 100%;
  padding: 6px 8px;
  font-size: 0.9rem;
  border: 1px solid #ddd;
  border-radius: 6px;
}






