:root{
  --sv-red:#b62b2b;
  --sv-red-dark:#8f1f1f;
  --sv-border:#d1d5db;
  --sv-text:#111827;
  --sv-muted:#6b7280;
  --sv-bg:#ffffff;
}

*{ box-sizing:border-box; }

html, body{
  margin:0;
  padding:0;
  background:var(--sv-bg);
  color:var(--sv-text);
  font-family: Helvetica, Arial, sans-serif;
  font-weight:400;
}

a{ color:inherit; }

th{
  background:#4a4a4a;
  font-size:12px;
  text-transform:uppercase;
  color:#ffffff;
}

.sv-topbar{
  background:var(--sv-red);
  border-bottom:2px solid var(--sv-red-dark);
  height:92px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.sv-topbar img{
  height:42px;
  width:auto;
  display:block;
}

/* Padrão de topo para painéis (desktop e mobile) */
.sv-topbar--painel{
  height:auto;
  min-height:83px;
  justify-content:stretch;
  background:var(--sv-red) url('/assets/laboratorios-topbar-texture.jpg') center center / cover no-repeat;
}

.sv-topbar-inner{
  width:100%;
  max-width:1200px;
  margin:0 auto;
  padding:12px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.sv-topbar-meta{
  color:#fff;
  font-size:13px;
}

/* Em painéis: logo e usuário alinhados no centro vertical do topo */
.sv-topbar--painel .sv-topbar-inner{
  max-width:1100px;
  margin:0 auto;
  width:100%;
  min-height:64px;
  padding:0 clamp(14px, 2.2vw, 28px);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.sv-topbar--painel .sv-topbar-inner img{
  margin:0;
  max-width:min(230px, 42vw);
  height:auto;
}

.sv-topbar--painel .sv-topbar-meta{
  margin:0;
  white-space:nowrap;
}

.sv-topbar--painel .sv-topbar-meta a{
  font-weight:700;
}

/* Desktop: logo alinhado à coluna do menu lateral (270px) */
@media (min-width:992px){
  .sv-topbar--painel .sv-topbar-inner{
    max-width:none;
    width:100%;
    padding:0;
    display:grid;
    grid-template-columns:270px 1fr;
    align-items:center;
    min-height:64px;
  }
  .sv-topbar--painel .sv-topbar-inner img{
    justify-self:start;
    margin-left:36px;
    max-width:210px;
  }
  .sv-topbar--painel .sv-topbar-meta{
    justify-self:end;
    margin-right:clamp(18px, calc((100vw - 1370px) / 2 + 18px), 260px);
  }
}

/* Bloco do usuário separado do logo (ajuste independente) */
.sv-topbar-meta{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:12px 17px;
  border:1px solid rgba(255,255,255,.28);
  background:rgba(0,0,0,.12);
  border-radius:4px;
  line-height:1;
}

.sv-topbar-meta a{
  color:#fff;
  text-decoration:none;
}

.sv-topbar-meta a:hover{
  text-decoration:underline;
}

.sv-container{
  max-width:420px;
  margin:0 auto;
  padding:24px 14px;
}

.sv-title{
  margin:0 0 14px 0;
  font-size:18px;
  font-weight:400;
}

.sv-box{
  border:1px solid var(--sv-border);
  padding:16px;
  background:#fff;
}

.sv-label{
  display:block;
  margin:0 0 6px 0;
  font-size:14px;
  font-weight:400;
}

.sv-input{
  width:100%;
  border:1px solid var(--sv-border);
  padding:11px 10px;
  outline:none;
  border-radius:0;
  font-weight:400;
  font-size:14px;
}

.sv-input:focus{
  border-color:#9ca3af;
}

.sv-field{
  margin-bottom:12px;
}

.sv-btn{
  width:100%;
  background:var(--sv-red);
  border:2px solid var(--sv-red-dark);
  color:#fff;
  padding:11px 10px;
  cursor:pointer;
  border-radius:0;
  font-weight:400;
  font-size:14px;
}

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

.sv-alert{
  border:1px solid #fecaca;
  background:#fff5f5;
  color:#7f1d1d;
  padding:10px;
  margin-bottom:12px;
  font-size:13px;
}

.filtros{
  border:1px solid var(--line, #e5e7eb);
  background:#fbfbfb;
  border-radius:10px;
  padding:12px;
  margin-bottom:12px;
}

.sv-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}

.sv-mini{
  font-size:12px;
  color:var(--sv-muted);
}

.sv-paciente-stack{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:4px;
  min-width:0;
}

.sv-paciente-doc{
  display:block;
  max-width:100%;
  font-size:12px;
  font-weight:400;
  line-height:1.2;
  color:var(--sv-muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* senha com olho DENTRO do input */
.sv-pass-wrap{
  position:relative;
}

.sv-pass-wrap .sv-input{
  padding-right:42px;
}

.sv-eye{
  position:absolute;
  right:10px;
  top:50%;
  transform:translateY(-50%);
  width:28px;
  height:28px;
  border:1px solid var(--sv-border);
  background:#fff;
  cursor:pointer;
  border-radius:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
}

.sv-eye svg{
  width:16px;
  height:16px;
  display:block;
}

/* Ícones padrão do menu lateral por rota */
.side a::before{
  display:inline-block;
  width:28px;
  margin-right:8px;
  text-align:center;
  color:currentColor;
  opacity:.95;
  font-size:12px;
}

.side a[href="/admin.php"]::before{ content:"◦⌂"; }
.side a[href="/permissoes.php"]::before{ content:"◦⚙"; }
.side a[href="/criar_usuarios.php"]::before{ content:"◦◉"; }
.side a[href="/auditoria.php"]::before{ content:"◦☰"; }
.side a[href="/admin_qrcodes.php"]::before{ content:"◦⌗"; }
.side a[href="/admin_cartoes.php"]::before{ content:"◦▭"; }
.side a[href="/admin_doencas.php"]::before{ content:"◦✚"; }
.side a[href="/portaria.php"]::before{ content:"◦⌖"; }
.side a[href="/cadastro_paciente.php"]::before{ content:"◦✍"; }
.side a[href="/pacientes.php"]::before{ content:"◦◍"; }
.side a[href="/atendimentos.php"]::before{ content:"◦✢"; }
.side a[href="/fila.php"]::before{ content:"◦⏱"; }
.side a[href="/triagem.php"]::before{ content:"◦⊕"; }
.side a[href="/triagens_realizadas.php"]::before{ content:"◦☷"; }
.side a[href="/sala_de_observacao.php"]::before{ content:"◦▣"; }
.side a[href="/internacao.php"]::before{ content:"◦▥"; }
.side a[href="/ambulatorio.php"]::before{ content:"◦◧"; }
.side a[href="/eletro_emergencia.php"]::before{ content:"◦∿"; }
.side a[href="/consulta_emergencia.php"]::before{ content:"◦◈"; }
.side a[href="/consultas_realizadas_emergencia.php"]::before{ content:"◦▤"; }
.side a[href="/anamnese.php"]::before{ content:"◦✎"; }
.side a[href="/alta_hospitalar.php"]::before{ content:"◦↗"; }
.side a[href="/dados_de_saude.php"]::before{ content:"◦❤"; }
.side a[href="/exames.php"]::before{ content:"◦⌬"; }
.side a[href="/formulario.php"]::before{ content:"◦☑"; }
.side a[href="/enfermagem.php"]::before{ content:"◦⚕"; }
.side a[href="/enfermagem_atendimento.php"]::before{ content:"◦⚕"; }
.side a[href="/medico.php"]::before{ content:"◦⚕"; }
.side a[href="/radiologia.php"]::before{ content:"◦☢"; }
.side a[href="/laboratorios.php"]::before{ content:"◦⚗"; }
.side a[href="/prefeito.php"]::before{ content:"◦⌘"; }

.side{
  width:270px;
  border-right:1px solid var(--line);
  padding:16px 0;
  background:#fbfbfb;
}

.side a:hover{
  background:#f6f6f6;
}

.side a.active{
  background:linear-gradient(180deg, #ea575d 0%, #cb2f35 52%, #a1181d 100%) !important;
  color:#ffffff !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.18),
    inset 0 -2px 0 rgba(0,0,0,.18),
    0 0 0 1px rgba(122,26,32,.14);
  text-shadow:0 1px 2px rgba(0,0,0,.24);
}

.side a.active:hover{
  background:linear-gradient(180deg, #f06368 0%, #d7383f 52%, #ad1f25 100%) !important;
  color:#ffffff !important;
}

.box{
  border:1px solid var(--line);
  padding:14px;
  margin-bottom:14px;
  background:#fbfbfb;
}

.btn{
  border:1px solid #8f1f1f;
  background:#b62b2b;
  color:#fff;
  padding:8px 13px;
  cursor:pointer;
}

.btn:hover{
  background:#ce3838;
  border-color:#7a1a1a;
}

.btn-edit{
  border:1px solid #b62b2b;
  background:#b62b2b;
  color:#ffffff;
  text-decoration:none;
  padding:8px 13px;
  display:inline-block;
  font-size:13px;
  white-space:nowrap;
}

.btn-edit:hover{
  background:#ce3838;
  border-color:#7a1a1a;
}

.btn-light{
  border:1px solid #b62b2b;
  background:#b62b2b;
  color:#ffffff;
  text-decoration:none;
  padding:7px 13px;
  display:inline-block;
  font-size:13px;
  white-space:nowrap;
  cursor:pointer;
}

.btn-light:hover{
  background:#ce3838;
  border-color:#7a1a1a;
}

.input, .select{
  width:100%;
  border:1px solid #dbdbdb;
  padding:10px;
  outline:none;
  background:#f4f4f4;
}

.card{
  border:1px solid var(--line);
  background:#fbfbfb;
  border-radius:10px;
  padding:14px;
}

.table th, .table td{
  border-bottom:1px solid #c5c5c5;
  padding:9px;
  text-align:left;
  font-size:13px;
  background:#f6f6f6;
}

.table th{
  border-bottom:1px solid #eaeaea !important;
  padding:9px !important;
  text-align:left !important;
  font-size:13px !important;
  text-transform:uppercase !important;
  letter-spacing:.4px !important;
  background:#3e3e3e !important;
  color:#ffffff !important;
  border-left:solid 1px #6a6666 !important;
}

.textarea{
  min-height:86px;
  resize:vertical;
  background:#f8f8f8;
}

.side .logout{
  margin:16px 16px 0;
  width:calc(100% - 36px);
  border:1px solid #8f1f1f;
  background:#b62b2b;
  padding:10px;
  cursor:pointer;
}

.side .logout:hover{
  background:#8f1f1f;
  border-color:#7a1a1a;
}
