/* ---------------------------------------------------------------------------
   Sistema de design — RedeTech Gestão Cirúrgica
   Paleta baseada na identidade visual oficial: azul (#155DC2 como base,
   #1AA6FF como destaque vibrante) + prata metálico + navy quase preto,
   extraída da logo. Âmbar reservado só para o status "pendente/aguardando"
   (cor de alerta funcional, não faz parte da marca). Tipografia: Manrope
   (display), Inter (texto), JetBrains Mono (horários, protocolos, dados
   técnicos).
--------------------------------------------------------------------------- */

:root {
  --bg: #F5F8FC;
  --surface: #FFFFFF;
  --surface-2: #EBF1FA;
  --primary: #155DC2;
  --primary-light: #3B82E0;
  --primary-tint: #E4EDFC;
  --accent: #1AA6FF;
  --accent-tint: #DFF2FF;
  --warning: #B9761F;
  --warning-tint: #FBEEDC;
  --success: #2E7D5B;
  --success-tint: #E4F2EB;
  --danger: #C1443D;
  --danger-tint: #FBEAE9;
  --text: #141B29;
  --text-muted: #5A6779;
  --border: #DCE3F0;
  --primary-text: #0C3E86; /* cor de texto/títulos sobre o fundo da página */

  --font-display: 'Manrope', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(21, 93, 194, 0.06), 0 4px 16px rgba(21, 93, 194, 0.07);

  color-scheme: light;
}

/* --------------------------------- Tema escuro --------------------------- */
/* Ativado adicionando data-theme="dark" na tag <html> (ver /js/api.js). Tons
   de navy quase preto, iguais ao fundo da logo oficial — o tema escuro é,
   propositalmente, o que mais se parece com a identidade visual da marca. */
html[data-theme="dark"] {
  --bg: #060B16;
  --surface: #0E1728;
  --surface-2: #16213A;
  --primary-tint: #142A4D;
  --accent-tint: #142A4D;
  --warning-tint: #2E2211;
  --success-tint: #12281F;
  --danger-tint: #2E1917;
  --text: #E8EEF8;
  --text-muted: #8B9BB4;
  --border: #1F2C46;
  --primary-text: #4FB2FF;
  --primary-light: #3B82E0;
  --shadow: 0 1px 2px rgba(0,0,0,0.35), 0 8px 24px rgba(0,0,0,0.4);
  color-scheme: dark;
}
html[data-theme="dark"] .hero,
html[data-theme="dark"] .cta-final .cta-bg::after { background: none; }
html[data-theme="dark"] .hero { background: radial-gradient(1100px 480px at 12% -10%, var(--primary-tint) 0%, var(--surface) 60%); }
html[data-theme="dark"] .badge-pendente, html[data-theme="dark"] .badge-em_andamento, html[data-theme="dark"] .badge-em_analise { color: #E7B45C; }
html[data-theme="dark"] .badge-aguardando_pagamento { color: var(--primary-text); }

.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 16px; cursor: pointer;
  padding: 0; line-height: 1; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  flex-shrink: 0;
}
.theme-toggle:hover { transform: rotate(-14deg) scale(1.06); border-color: var(--primary-light); }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
  /* Trava contra qualquer elemento (atual ou futuro) que force a página a
     ficar mais larga que a tela — em vez de rolar a página inteira de
     lado (o que também distorce tudo o que está por cima, como modais),
     esse elemento específico é quem ganha o scroll próprio, se precisar. */
  overflow-x: hidden;
  max-width: 100vw;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  color: var(--primary-text);
}

a { color: var(--primary-text); }
small, .muted { color: var(--text-muted); }
.mono { font-family: var(--font-mono); }

/* ---------------------------------- Layout ------------------------------ */

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

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--primary);
  color: #F0F5F4;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  transition: width 0.2s ease, padding 0.2s ease;
}

.sidebar .brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar .brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); display: inline-block; }
.brand-icon { height: 26px; width: auto; display: inline-block; vertical-align: middle; flex-shrink: 0; }

.sidebar nav a, .sidebar nav button:not(.theme-toggle) {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 8px;
  color: #CFE1DD;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-body);
  white-space: nowrap;
}
.sidebar nav a:hover, .sidebar nav button:not(.theme-toggle):hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar nav a.active { background: rgba(255,255,255,0.14); color: #fff; }
.sidebar .theme-toggle { width: 36px; height: 36px; flex-shrink: 0; padding: 0; text-align: center; }
.nav-icon { flex-shrink: 0; opacity: 0.9; }
.nav-label { overflow: hidden; text-overflow: ellipsis; }
.nav-badge { margin-left: auto; flex-shrink: 0; }
.sidebar-acoes { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.sidebar-acoes #btn-sair { flex: 1; }

.sidebar .sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.12); font-size: 12px; color: #9FC0BA; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ------------------------------ Menu recolhido ----------------------------- */
/* Modo compacto (só ícones) para quem quer mais espaço de tela — alternado
   pelo botão de seta, com a preferência salva no navegador. Só se aplica em
   telas largas; no celular a sidebar já vira um menu deslizante à parte. */
.btn-recolher-menu {
  position: absolute; top: 26px; right: -13px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface); color: var(--primary); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15); transition: transform 0.2s ease;
}
.btn-recolher-menu:hover { background: var(--primary-tint); }

.sidebar.recolhida { width: 76px; padding-left: 14px; padding-right: 14px; }
.sidebar.recolhida .brand { justify-content: center; }
.sidebar.recolhida .brand-icon { margin: 0 auto; }
.sidebar.recolhida .brand-nome { display: none; }
.sidebar.recolhida .nav-label,
.sidebar.recolhida .nav-badge,
.sidebar.recolhida .sidebar-footer { display: none; }
.sidebar.recolhida nav a,
.sidebar.recolhida nav button:not(.theme-toggle) { justify-content: center; padding: 10px; }
.sidebar.recolhida .sidebar-acoes { flex-direction: column; }
.sidebar.recolhida .btn-recolher-menu svg { transform: rotate(180deg); }

.main { flex: 1; padding: 32px 40px; max-width: 1440px; min-width: 0; }
.main-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }

/* Barra superior e botão de menu — só aparecem em telas estreitas. */
.mobile-topbar { display: none; }
.menu-overlay { display: none; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }

  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: var(--primary); color: #fff;
    position: sticky; top: 0; z-index: 40;
  }
  .mobile-topbar .brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; font-size: 16px; }
  .btn-abrir-menu {
    width: 38px; height: 38px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.08); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer;
  }

  .sidebar {
    position: fixed; top: 0; left: 0; height: 100%; z-index: 60;
    width: 260px; max-width: 82vw;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 8px 0 24px rgba(0,0,0,0.25);
    overflow-y: auto;
  }
  .sidebar.aberta { transform: translateX(0); }
  .sidebar.recolhida { width: 260px; padding-left: 16px; padding-right: 16px; }
  .sidebar.recolhida .brand-nome { display: inline; }
  .sidebar.recolhida .nav-label { display: inline; }
  .sidebar.recolhida .nav-badge { display: inline-flex; }
  .sidebar.recolhida .sidebar-footer { display: block; }
  .sidebar.recolhida .brand { justify-content: flex-start; }
  .sidebar.recolhida nav a, .sidebar.recolhida nav button:not(.theme-toggle) { justify-content: flex-start; }
  .btn-recolher-menu { display: none; }

  .menu-overlay.ativo {
    display: block; position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(0,0,0,0.4); z-index: 50;
  }

  .main { padding: 20px 16px; max-width: 100%; }
}

.chats-grid { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }

@media (max-width: 760px) {
  .chats-grid { grid-template-columns: 1fr; }
  .chat-card { height: 60vh; }
}

@media (max-width: 560px) {
  .main-header h1 { font-size: 19px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
/* Layout simples para páginas públicas (login, solicitação) */
.center-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ---------------------------------- Componentes -------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; }
.stat-card .value { font-family: var(--font-display); font-size: 28px; font-weight: 800; color: var(--primary-text); }
.stat-card .label { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: filter 0.12s ease, transform 0.05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-accent { background: var(--accent); color: #06313B; font-weight: 800; }
.btn-accent:hover { filter: brightness(1.05); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--surface-2); }
.btn-danger { background: var(--danger-tint); color: var(--danger); }
.btn-danger:hover { filter: brightness(0.97); }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; justify-content: center; }

.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-ativo, .badge-confirmada, .badge-concluido, .badge-concluida { background: var(--success-tint); color: var(--success); }
.badge-inativo, .badge-recusada { background: var(--danger-tint); color: var(--danger); }
.badge-pendente, .badge-em_andamento, .badge-em_analise { background: var(--warning-tint); color: #8A5A15; }
.badge-aguardando_pagamento { background: var(--primary-tint); color: var(--primary); }

label { display: block; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
input, select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14.5px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-tint);
}
.field { margin-bottom: 16px; }

/* --------------------------------- Busca de hospital ------------------------ */
.hospital-busca-campo { position: relative; }
.hospital-sugestoes {
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; z-index: 20;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow); max-height: 280px; overflow-y: auto;
}
.hospital-sugestoes .item {
  padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border);
}
.hospital-sugestoes .item:last-child { border-bottom: none; }
.hospital-sugestoes .item:hover, .hospital-sugestoes .item.destacado { background: var(--surface-2); }
.hospital-sugestoes .item strong { display: block; font-size: 13.5px; }
.hospital-sugestoes .item span { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.hospital-sugestoes .vazio { padding: 12px 14px; font-size: 12.5px; color: var(--text-muted); }
.hospital-confirmado {
  display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 12px;
  background: var(--success-tint); color: var(--success); border-radius: 8px; font-size: 12.5px; font-weight: 600;
}
.hospital-confirmado button { margin-left: auto; background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 12px; text-decoration: underline; font-weight: 600; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }

/* Barras de filtro (busca + selects + botão) — em telas de celular, cada
   controle ocupa a linha inteira em vez de espremer tudo numa fileira só
   (o que fazia o botão ficar cortado ou vazar da tela). */
.barra-filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
@media (max-width: 560px) {
  .barra-filtros { flex-direction: column; align-items: stretch; }
  .barra-filtros .field { width: 100% !important; min-width: 0 !important; flex: none !important; }
  .barra-filtros > button { width: 100%; }
}

/* Tabelas rolam na horizontal em telas estreitas, em vez de espremer as
   colunas ou vazar da página — o wrapper é quem ganha o scroll, a tabela
   em si mantém sua largura natural. */
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); padding: 10px 12px; border-bottom: 2px solid var(--border); }
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:hover td { background: var(--surface-2); }

.toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 999;
  background: var(--text); color: #fff; padding: 12px 18px; border-radius: 10px;
  font-size: 13.5px; box-shadow: var(--shadow); max-width: 320px;
}
.toast.erro { background: var(--danger); }
.toast.sucesso { background: var(--success); }

.empty-state { text-align: center; padding: 48px 20px; color: var(--text-muted); }

/* ------------------------------- Linha do tempo (check-in) --------------- */
/* Elemento de assinatura do produto: mostra a sequência real do atendimento
   (chegada → conferência de caixas → cirurgia → saída), reforçando controle
   e rastreabilidade — o que é literalmente o diferencial vendido ao cliente. */

.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-step { display: flex; gap: 14px; position: relative; padding-bottom: 28px; }
.timeline-step:last-child { padding-bottom: 0; }
.timeline-step::before {
  content: '';
  position: absolute; left: 14px; top: 30px; bottom: 0; width: 2px;
  background: var(--border);
}
.timeline-step:last-child::before { display: none; }
.timeline-marker {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  background: var(--surface-2); color: var(--text-muted); border: 2px solid var(--border);
  z-index: 1;
}
.timeline-step.done .timeline-marker { background: var(--success); border-color: var(--success); color: #fff; }
.timeline-step.active .timeline-marker { background: var(--accent); border-color: var(--accent); color: #06313B; }
.timeline-title { font-weight: 700; font-size: 14.5px; }
.timeline-time { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.timeline-body { padding-top: 2px; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-top: 10px; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.tabs button { flex-shrink: 0; }
.tabs button { background: none; border: none; padding: 10px 16px; font-weight: 700; font-size: 14px; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.active { color: var(--primary-text); border-color: var(--primary-text); }

.modal-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(9,25,32,0.45); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; animation: fadeIn 0.18s ease; }
.modal { background: var(--surface); color: var(--text); border-radius: var(--radius-lg); padding: 24px; width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; overflow-x: hidden; animation: modalPop 0.22s cubic-bezier(.2,.8,.2,1); box-shadow: 0 20px 60px rgba(21,93,194,0.25); }

/* Em telas pequenas, o modal nunca deve passar da largura da tela — vence
   qualquer max-width maior definido no HTML (alguns modais usam 520–640px
   em telas largas), porque numa tela de celular isso vazaria da viewport. */
@media (max-width: 640px) {
  .modal-backdrop { padding: 12px; }
  .modal { max-width: calc(100vw - 24px) !important; padding: 18px; }
}

/* -------------------------------- Avatares --------------------------------- */
.avatar-iniciais { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 800; font-family: var(--font-display); flex-shrink: 0; letter-spacing: -0.02em; }
.estrelas { display: inline-flex; gap: 4px; font-size: 26px; line-height: 1; }
.estrelas button { background: none; border: none; cursor: pointer; padding: 2px; color: var(--border); transition: transform 0.12s ease, color 0.12s ease; }
.estrelas button:hover, .estrelas button:hover ~ button { color: var(--border); }
.estrelas.leitura button { cursor: default; }
.estrelas button.cheia { color: var(--accent); }
.estrelas:not(.leitura) button:hover { transform: scale(1.15); }

/* -------------------------------- Gráficos -------------------------------- */
.chart-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-card canvas { max-height: 240px; }

/* ------------------------------- Documentos -------------------------------- */
.doc-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); gap: 10px; }
.doc-row:last-child { border-bottom: none; }
.doc-alerta { color: var(--danger); font-weight: 700; }
.doc-atencao { color: #8A5A15; font-weight: 700; }

/* ---------------------------- Movimento e polish -------------------------- */
/* Camada de motion discreta aplicada a todo o sistema: entrada suave de
   cartões e conteúdo, elevação sutil em hover, transições consistentes.
   O objetivo é dar sensação de resposta viva sem distrair do trabalho. */

@media (prefers-reduced-motion: no-preference) {
  @keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  @keyframes modalPop { from { opacity: 0; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
  @keyframes floatSlow { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
  @keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }

  .card, .stat-card, .feature-card, .step, .timeline-step { animation: fadeInUp 0.5s cubic-bezier(.2,.7,.2,1) backwards; }
  .stat-grid .stat-card:nth-child(1) { animation-delay: 0.02s; }
  .stat-grid .stat-card:nth-child(2) { animation-delay: 0.07s; }
  .stat-grid .stat-card:nth-child(3) { animation-delay: 0.12s; }
  .stat-grid .stat-card:nth-child(4) { animation-delay: 0.17s; }
  .timeline-step:nth-child(1) { animation-delay: 0.05s; }
  .timeline-step:nth-child(2) { animation-delay: 0.15s; }
  .timeline-step:nth-child(3) { animation-delay: 0.25s; }
  .timeline-step:nth-child(4) { animation-delay: 0.35s; }

  .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s cubic-bezier(.2,.7,.2,1), transform 0.6s cubic-bezier(.2,.7,.2,1); }
  .reveal.in-view { opacity: 1; transform: translateY(0); }
  .reveal-stagger.in-view > * { animation: fadeInUp 0.55s cubic-bezier(.2,.7,.2,1) backwards; }
  .reveal-stagger.in-view > *:nth-child(1) { animation-delay: 0.03s; }
  .reveal-stagger.in-view > *:nth-child(2) { animation-delay: 0.09s; }
  .reveal-stagger.in-view > *:nth-child(3) { animation-delay: 0.15s; }
  .reveal-stagger.in-view > *:nth-child(4) { animation-delay: 0.21s; }
  .reveal-stagger.in-view > *:nth-child(5) { animation-delay: 0.27s; }
  .reveal-stagger.in-view > *:nth-child(6) { animation-delay: 0.33s; }
}

.card, .feature-card, .step, .stat-card { transition: transform 0.22s cubic-bezier(.2,.7,.2,1), box-shadow 0.22s ease, border-color 0.22s ease; }
.feature-card:hover, .step:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(21,93,194,0.1); border-color: var(--primary-light); }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(21,93,194,0.09); }

.btn { position: relative; overflow: hidden; transition: filter 0.15s ease, transform 0.15s cubic-bezier(.2,.7,.2,1), box-shadow 0.15s ease; }
.btn-primary:hover, .btn-accent:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(21,93,194,0.22); }
.btn-outline:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(21,93,194,0.08); }
.btn:active { transform: translateY(0) scale(0.97); transition-duration: 0.08s; }

/* ------------------------------- Profundidade ------------------------------ */
/* Sombras em duas camadas (uma rente, uma difusa) para dar sensação real de
   elevação — usado nos cards de destaque e no card do dashboard. */
.card, .stat-card, .feature-card, .modal, .hero-photo, .hero-card {
  box-shadow: 0 1px 2px rgba(21,93,194,0.06), 0 1px 1px rgba(21,93,194,0.05);
}
html[data-theme="dark"] .card, html[data-theme="dark"] .stat-card, html[data-theme="dark"] .feature-card, html[data-theme="dark"] .modal {
  box-shadow: 0 1px 2px rgba(0,0,0,0.35), 0 1px 1px rgba(0,0,0,0.25);
}
.feature-card:hover, .step:hover {
  box-shadow: 0 4px 10px rgba(21,93,194,0.07), 0 16px 34px -8px rgba(21,93,194,0.18);
}
[data-tilt] { transition: transform 0.35s cubic-bezier(.2,.8,.2,1); }
[data-tilt]:hover { transition: transform 0.05s linear; }

.sidebar nav a, .sidebar nav button:not(.theme-toggle) { transition: background 0.18s ease, color 0.18s ease, padding-left 0.18s ease; }
.sidebar nav a:hover, .sidebar nav button:not(.theme-toggle):hover { padding-left: 16px; }
.sidebar nav a.active { position: relative; }
.sidebar nav a.active::before { content: ''; position: absolute; left: -16px; top: 50%; transform: translateY(-50%); width: 3px; height: 60%; background: var(--accent); border-radius: 0 3px 3px 0; }

.toast { animation: toastIn 0.3s cubic-bezier(.2,.8,.2,1); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection { background: var(--primary-tint); color: var(--primary-text); }

a, button, .btn, .badge, input, select, textarea, tr, .chip { transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease; }

/* ---------------------------------- Chat ---------------------------------- */
.chat-card { display: flex; flex-direction: column; height: 66vh; padding: 0; overflow: hidden; }
.chat-mensagens { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.chat-linha { display: flex; gap: 7px; max-width: 62%; align-items: flex-end; }
.chat-linha.minhas { align-self: flex-end; flex-direction: row-reverse; }
.chat-linha.deles { align-self: flex-start; }
.chat-linha .avatar-iniciais { margin-bottom: 1px; }
.chat-bolha { padding: 7px 11px; border-radius: 12px; font-size: 13px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; min-width: 0; }
.chat-linha.deles .chat-bolha { background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 3px; }
.chat-linha.minhas .chat-bolha { background: var(--primary); color: #fff; border-bottom-right-radius: 3px; }
.chat-hora { display: inline; font-size: 9.5px; opacity: 0.6; margin-left: 7px; white-space: nowrap; }
.chat-anexo-imagem { display: block; max-width: 220px; max-height: 220px; border-radius: 10px; margin-top: 6px; cursor: zoom-in; }
.chat-anexo-arquivo { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,0.06); font-size: 12.5px; margin-top: 6px; text-decoration: none; color: inherit; }
.chat-linha.minhas .chat-anexo-arquivo { background: rgba(255,255,255,0.16); }
.chat-input-row { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--border); background: var(--surface); }
.chat-input-row input#chat-input, .chat-input-row input#chat-admin-input { flex: 1; }
.chat-btn-anexo { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: all 0.15s ease; }
.chat-btn-anexo:hover, .chat-btn-anexo.tem-arquivo { color: var(--primary); border-color: var(--primary-light); background: var(--primary-tint); }
.chat-preview-anexo { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12.5px; background: var(--surface-2); }
.chat-preview-anexo button { margin-left: auto; background: none; border: none; color: var(--danger); cursor: pointer; font-size: 12.5px; font-weight: 700; }
.chat-vazio { margin: auto; text-align: center; color: var(--text-muted); font-size: 13.5px; }
.chat-lista-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; cursor: pointer; transition: background 0.15s ease; }
.chat-lista-item:hover { background: var(--surface-2); }
.chat-lista-item.ativo { background: var(--primary-tint); }
.chat-lista-item .preview { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }

/* -------------------------------- Lightbox de fotos ------------------------ */
.lightbox-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(0,0,0,0.82); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; animation: fadeIn 0.15s ease; }
.lightbox-backdrop img { max-width: 92vw; max-height: 86vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.lightbox-fechar { position: absolute; top: 20px; right: 24px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.12); color: #fff; border: none; font-size: 20px; cursor: pointer; }
.lightbox-fechar:hover { background: rgba(255,255,255,0.22); }

/* --------------------------------- Câmera ---------------------------------- */
.camera-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: #000; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.camera-backdrop video { max-width: 100%; max-height: 78vh; }
.camera-controles { display: flex; gap: 16px; padding: 20px; }
.camera-btn-disparo { width: 64px; height: 64px; border-radius: 50%; background: #fff; border: 4px solid rgba(255,255,255,0.4); cursor: pointer; }
.camera-btn-disparo:hover { border-color: rgba(255,255,255,0.7); }
.upload-opcoes { display: flex; gap: 10px; flex-wrap: wrap; }

/* -------------------------------- Cards clicáveis (landing) ---------------- */
.feature-card.clicavel { cursor: pointer; }
.feature-card.clicavel:hover { border-color: var(--primary-light); }
.feature-card.clicavel .ver-mais { font-size: 12px; font-weight: 700; color: var(--primary-light); margin-top: 10px; display: inline-flex; align-items: center; gap: 4px; }

/* -------------------------------- Pagamento PIX ---------------------------- */
.pix-box { text-align: center; padding: 16px; background: var(--surface-2); border-radius: 12px; margin-top: 10px; }
.pix-box img { width: 200px; height: 200px; border-radius: 8px; background: #fff; padding: 8px; }
.pix-copia-cola { font-family: var(--font-mono); font-size: 11.5px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px; word-break: break-all; margin-top: 10px; text-align: left; max-height: 80px; overflow-y: auto; }
