:root {
  --navy: #1e2a52;
  --navy-dark: #16203f;
  --blue: #2563eb;
  --blue-light: #eef2ff;
  --pink: #f43f5e;
  --pink-light: #fef1f2;
  --orange: #f97316;
  --orange-light: #fff7ed;
  --green: #16a34a;
  --green-light: #f0fdf4;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f8fafc;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: var(--navy);
  color: white;
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-size: 1.05rem;
}
.brand:hover { text-decoration: none; }
.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
}
.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.brand-text strong { font-weight: 700; }

.topnav { display: flex; align-items: center; gap: 18px; font-size: 0.92rem; flex-wrap: wrap; }
.topnav a { color: #cbd5e1; }
.topnav a:hover { color: white; }
.topnav-user { color: #94a3b8; }
.topnav-logout { color: #fca5a5 !important; }
/* "Sair" é um botão (POST com token), mas com cara de link do menu */
.form-sair { display: inline; margin: 0; padding: 0; }
button.topnav-logout {
  background: none; border: 0; padding: 0; margin: 0; font: inherit; cursor: pointer;
}
button.topnav-logout:hover { color: #fecaca !important; text-decoration: underline; }

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 60px;
  width: 100%;
  flex: 1 0 auto;
}

.footer {
  flex-shrink: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 24px;
  border-top: 1px solid var(--border);
  background: white;
}

h1 { font-size: 1.6rem; margin: 0 0 8px; }
h3 { font-size: 1.05rem; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.intro { margin-bottom: 28px; max-width: 720px; }

.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 16px; }

/* Auth */
.auth-wrap { display: flex; justify-content: center; padding-top: 40px; }
.auth-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.auth-card h1 { text-align: center; }
.auth-card .muted { text-align: center; margin-bottom: 20px; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { font-size: 0.88rem; font-weight: 600; display: flex; flex-direction: column; gap: 6px; color: #374151; }
.form input, .form textarea, .form select {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 400;
  color: var(--text);
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }

/* Form "solto" dentro de texto corrido (ex.: trocar categoria do chamado,
   ver n1_chamado_detalhe.html) — não quebra a linha como .form normal faz. */
.form-inline { display: inline-block; margin-left: 6px; }
.form-inline select {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: white;
}
.form-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 640px;
}

.btn {
  display: inline-block;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: #1d4ed8; text-decoration: none; }
.btn-secondary { background: var(--navy); color: white; }
.btn-secondary:hover { background: var(--navy-dark); text-decoration: none; }
.btn-block { width: 100%; }
.btn-small { padding: 6px 12px; font-size: 0.82rem; background: var(--blue-light); color: var(--blue); }
.btn-small:hover { text-decoration: none; background: #dbeafe; }
.btn-danger { background: var(--pink-light); color: var(--pink); }
.btn-danger:hover { text-decoration: none; background: #fde2e4; }
.btn-urgente-off { background: #f1f5f9; color: #475569; }
.btn-urgente-off:hover { text-decoration: none; background: #e2e8f0; }
.btn-urgente-on { background: #fee2e2; color: #b91c1c; font-weight: 700; }
.btn-urgente-on:hover { text-decoration: none; background: #fecaca; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { text-decoration: none; background: var(--bg); }

/* Category cards */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.cat-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  color: var(--text);
  transition: box-shadow 0.15s, transform 0.15s;
}
.cat-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); text-decoration: none; transform: translateY(-1px); }
.cat-icon { font-size: 1.6rem; }
.cat-title { font-weight: 700; font-size: 1.05rem; }
.cat-desc { color: var(--muted); font-size: 0.88rem; }
.cat-duvida .cat-title { color: var(--orange); }
.cat-solicitacao .cat-title { color: var(--blue); }
.cat-bug .cat-title { color: var(--pink); }
.cat-track .cat-title { color: var(--green); }

/* Tables */
/* overflow-x:auto (em vez de hidden) deixa a tabela rolar na horizontal em vez
   de espremer/cortar colunas em telas estreitas (celular) — overflow-y fica
   hidden só pra manter o cantinho arredondado do .table-wrap. */
.table-wrap { background: white; border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 16px; font-size: 0.9rem; border-bottom: 1px solid var(--border); }
.table th { background: #f9fafb; color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
.th-sort { color: inherit; text-decoration: none; cursor: pointer; white-space: nowrap; }
.th-sort:hover { text-decoration: underline; color: var(--text); }
.th-sort-active { color: var(--text); }
.th-sort-arrow { font-size: 0.7em; }
.table tr:last-child td { border-bottom: none; }

.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.pill-duvida { background: var(--orange-light); color: var(--orange); }
.pill-solicitacao { background: var(--blue-light); color: var(--blue); }
.pill-bug { background: var(--pink-light); color: var(--pink); }

.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: #f1f5f9; color: #475569; }
.status-novo { background: #f1f5f9; color: #475569; }
.status-em_analise { background: #fef9c3; color: #854d0e; }
.status-respondido { background: var(--blue-light); color: var(--blue); }
.status-escalado { background: #ede9fe; color: #6d28d9; }
.status-aguardando_solicitante { background: var(--orange-light); color: var(--orange); }
.status-resolvido { background: var(--green-light); color: var(--green); }
.status-trello-concluido { background: var(--green-light); color: #166534; border: 1px solid #86efac; }

/* Ticket detail */
.ticket-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
/* O atributo hidden precisa vencer regras de display (ex.: .form label { display: flex }) */
[hidden] { display: none !important; }
.panel-estreito { max-width: 560px; margin: 2rem auto; }
.panel { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-top: 16px; }
.panel-highlight { border-color: var(--blue); background: var(--blue-light); }
.panel-warning { border-color: #fbbf24; background: #fffbeb; color: #92400e; }
.panel-success { border-color: #86efac; background: var(--green-light); color: #166534; }
.trello-concluido-badge {
  display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; background: var(--green-light); color: #166534;
  border: 1px solid #86efac;
}
.pre { white-space: pre-wrap; word-break: break-word; line-height: 1.5; margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.88rem; }
.timeline-date { color: var(--muted); margin-right: 8px; }

.actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 16px; }

.search-bar { display: flex; gap: 8px; margin: 16px 0 0; flex-wrap: wrap; }
.search-bar input[type="text"] {
  flex: 1 1 auto;
  max-width: 420px;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.search-bar input[type="text"]:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }

.filter-tabs { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.filter-tabs a { padding: 6px 14px; border-radius: 999px; font-size: 0.85rem; color: var(--muted); background: white; border: 1px solid var(--border); }
.filter-tabs a.active { background: var(--navy); color: white; border-color: var(--navy); }
.filter-tabs a:hover { text-decoration: none; }

/* Exportação do painel do admin */
.exportar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 14px 0 18px; }
.exportar-titulo { font-size: 0.85rem; font-weight: 600; color: var(--navy); }

/* Paginação das listas de chamados */
.paginacao { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin: 14px 0 24px; }
.paginacao-resumo { margin: 0; }
.paginacao-paginas { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.paginacao-paginas a, .paginacao-atual { padding: 5px 12px; border-radius: 8px; font-size: 0.85rem; border: 1px solid var(--border); background: white; color: var(--muted); }
.paginacao-paginas a:hover { text-decoration: none; border-color: var(--navy); color: var(--navy); }
.paginacao-atual { background: var(--navy); color: white; border-color: var(--navy); }
.paginacao-gap { color: var(--muted); padding: 0 2px; }
.paginacao-tamanho { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); margin: 0; }
.paginacao-tamanho select { font-family: inherit; font-size: 0.85rem; padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; background: white; }

/* FAQ admin */
.faq-edit-item { margin-bottom: 8px; }
.faq-edit-item > summary { cursor: pointer; font-weight: 600; font-size: 0.94rem; }
.faq-edit-item[open] > summary { margin-bottom: 12px; }
.faq-edit-item > form + form { margin-top: 10px; }
.faq-etiqueta { display: inline-block; background: var(--blue-soft, #e8f0fe); color: var(--blue); border-radius: 10px; padding: 1px 8px; font-size: 0.74rem; font-weight: 600; margin-right: 6px; }
.faq-filtros { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.faq-filtros input[type="search"] { flex: 1 1 260px; }
.faq-importar-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.faq-novo > summary { cursor: pointer; }
.faq-novo[open] > summary { margin-bottom: 12px; }
.faq-busca input[type="search"], .faq-filtros input[type="search"], .faq-filtros select {
  font-family: inherit; font-size: 0.95rem; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: white;
}
.faq-busca input[type="search"]:focus, .faq-filtros input[type="search"]:focus, .faq-filtros select:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.faq-busca { margin: 0 0 14px; }
.faq-busca input[type="search"] { width: 100%; box-sizing: border-box; }
.faq-group > summary { cursor: pointer; list-style-position: inside; }
.faq-group-qtd { text-transform: none; letter-spacing: 0; font-weight: 400; }
.faq-group[open] > summary { margin-bottom: 8px; }
.faq-group[hidden], .faq-item[hidden] { display: none; }
.faq-edit-actions { display: flex; justify-content: flex-end; }

/* Usuários admin */
.user-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.user-row:last-child { border-bottom: none; }
/* min-width:0 deixa o nome/e-mail encolher (e quebrar linha) em vez de
   empurrar o botão "Desativar" pra fora do card em telas estreitas. */
.user-row-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 180px; word-break: break-word; }
.user-row-name { font-weight: 600; }
.user-row-email { color: var(--muted); font-size: 0.85rem; word-break: break-word; }
.user-status { font-size: 0.78rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.user-status-ativo { background: var(--green-light); color: var(--green); }
.user-status-inativo { background: var(--pink-light); color: var(--pink); }
.user-row-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }

/* Flash messages */
.flash-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.flash { padding: 12px 16px; border-radius: 8px; font-size: 0.9rem; }
.flash-success { background: var(--green-light); color: var(--green); border: 1px solid #bbf7d0; }
.flash-error { background: var(--pink-light); color: var(--pink); border: 1px solid #fecdd3; }
.flash-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 2.4rem; display: block; margin-bottom: 12px; }

/* Relatórios / admin */
.section-title { margin-top: 28px; }

.filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 24px;
}
.filter-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
}
.filter-form select, .filter-form input {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}
.kpi-grid-compact { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 18px 0 24px; }
.kpi-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-value { font-size: 1.7rem; font-weight: 700; color: var(--navy); }
.kpi-label { font-size: 0.8rem; color: var(--muted); }
.kpi-card-link { cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
/* Gráfico de volume (admin) — SVG puro, montado no servidor (ver
   montar_grafico_volume em app.py). Sem depender de JS/CDN externo pra
   aparecer; overflow-x:auto deixa rolar de lado se tiver muitos dias e a
   tela for estreita (celular), mesmo padrão das tabelas. */
.grafico-volume-wrap { overflow-x: auto; }
.grafico-volume { display: block; }
.grafico-volume-base { stroke: var(--border); stroke-width: 1; }
.grafico-volume-barra rect, .grafico-volume-barra path { transition: opacity 0.1s; }
.grafico-volume-barra:hover rect, .grafico-volume-barra:hover path { opacity: 0.8; }
/* Cores fixas por canal (paleta validada: contraste e daltonismo OK) — mesma cor no gráfico, legenda e tabela. */
.origem-cor-portal { fill: #2563eb; background: #2563eb; }
.origem-cor-whatsapp { fill: #16a34a; background: #16a34a; }
.origem-cor-email { fill: #9333ea; background: #9333ea; }
.grafico-legenda { list-style: none; display: flex; gap: 16px; flex-wrap: wrap; margin: 0 0 8px; padding: 0; font-size: 13px; color: var(--text); }
.grafico-legenda-marca { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; }
.tabela-origem .linha-faq td { font-size: 13px; }
.tabela-origem .linha-destaque td { background: #f8fafc; }
.nota-tabela { font-size: 12px; margin-top: 6px; }
.grafico-volume-valor { font-size: 11px; font-weight: 600; fill: var(--text); }
.grafico-volume-dia { font-size: 10px; fill: var(--muted); }

.kpi-card-link:hover {
  text-decoration: none;
  border-color: var(--blue);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.12);
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

/* Anexos */
.attachment-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.attachment-list li { display: flex; align-items: baseline; gap: 8px; }
.attachment-form { flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; }
.attachment-form input[type="file"] { font-size: 0.85rem; }

/* Dúvidas e Ajuda (FAQ + tour) */
.no-margin { margin: 0; }

.tour-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.faq-group { margin-bottom: 10px; }
.faq-group-title { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 8px; }
.faq-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
}
.faq-item summary { cursor: pointer; font-weight: 600; font-size: 0.94rem; }
.faq-item summary::marker { color: var(--blue); }
.faq-item p { margin: 10px 0 0; color: var(--text); line-height: 1.5; font-size: 0.92rem; }

.tour-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.tour-overlay[hidden] {
  display: none;
}
.tour-modal {
  background: white;
  border-radius: 14px;
  padding: 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.tour-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: none;
  background: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.tour-icon { font-size: 2.4rem; margin-bottom: 12px; }
.tour-modal h3 { font-size: 1.15rem; margin: 0 0 10px; }
.tour-modal p { color: var(--muted); line-height: 1.5; margin: 0 0 20px; min-height: 66px; }
.tour-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 20px; }
.tour-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.tour-dot.active { background: var(--blue); }
.tour-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* ---------------------------------------------------------------------
   Responsivo (celular) — nada abaixo disso muda o layout no desktop, só
   aperta espaçamentos e força 1 coluna onde fazia sentido 2-3 colunas,
   pra nada ficar cortado/espremido em tela de celular (~360-430px).
   --------------------------------------------------------------------- */
@media (max-width: 640px) {
  .page { padding: 20px 16px 40px; }
  .topbar-inner { padding: 12px 16px; }
  .brand-text strong { font-size: 0.95rem; }
  .brand { font-size: 0.95rem; }

  .auth-card { padding: 24px 20px; }
  .form-card { padding: 20px; }
  .panel { padding: 16px; }

  h1 { font-size: 1.35rem; }

  /* Colunas lado a lado (clínicas/N1/admin, cards de ação, KPIs) viram
     1 coluna só — min-width das grids em telas muito estreitas (<360px)
     podia estourar a largura da tela e criar scroll horizontal. */
  .report-grid,
  .actions-grid,
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .search-bar input[type="text"] { max-width: none; flex: 1 1 100%; }

  .ticket-header { gap: 8px; }

  /* Botão de nova pergunta/chamado etc — melhor ocupar a largura toda
     num form de celular do que ficar pequeno/apertado. */
  .form-card .btn-primary { width: 100%; }
}

/* ---- Descartado, parado, notas internas, respostas prontas, satisfação, backup ---- */
.status-descartado { background: #e2e8f0; color: #64748b; text-decoration: line-through; }
.badge-parado {
  display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 999px;
  background: #fff7ed; color: #c2410c; font-size: 0.75rem; font-weight: 600; white-space: nowrap;
}
.panel-nota { background: #fefce8; border-color: #fde68a; }
.notas-lista { list-style: none; margin: 0 0 12px; padding: 0; }
.notas-lista li { padding: 8px 0; border-bottom: 1px solid #fde68a; }
.notas-lista li:last-child { border-bottom: 0; }
.notas-lista .pre { margin-top: 2px; }
.resposta-pronta { display: block; margin-bottom: 6px; }
.resposta-pronta select { max-width: 100%; }
.estrelas { color: #f59e0b; font-size: 1.2rem; letter-spacing: 2px; margin-right: 6px; }
.kpi-de { font-size: 1rem; color: var(--muted); font-weight: 400; }

/* Página pública de avaliação */
.avaliar-box { max-width: 560px; margin: 24px auto; text-align: center; }
.avaliar-notas { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 18px 0; }
.avaliar-notas button {
  min-width: 96px; padding: 12px 14px; border: 1px solid var(--border, #cbd5e1); border-radius: 10px;
  background: #fff; cursor: pointer; font-size: 1rem; line-height: 1.3;
}
.avaliar-notas button:hover { border-color: var(--blue); background: var(--blue-light); }
.avaliar-notas .num { display: block; font-size: 1.6rem; font-weight: 700; color: var(--navy); }
.avaliar-grande { font-size: 3rem; color: #f59e0b; letter-spacing: 4px; margin: 6px 0; }

/* Histórico do chamado (visão do solicitante): conversa com a equipe */
.conversa { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.conversa-item { padding: 8px 12px; border-left: 3px solid var(--border, #d0d7e2); background: #f7f9fc; border-radius: 4px; }
.conversa-equipe { border-left-color: #2563eb; }
.conversa-voce { border-left-color: #94a3b8; }
.conversa-cabeca { font-size: 0.88rem; }
.conversa-texto { margin-top: 4px; }

/* aviso de cadastros aguardando aprovação (menu do administrador) */
.badge-pendentes {
  display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px;
  background: #dc2626; color: #fff; font-size: 0.75rem; font-weight: 700; text-align: center; line-height: 18px;
}
.pendente-card { border: 1px solid #fbbf24; background: #fffbeb; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.pendente-card .pendente-acoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.pendente-card select { max-width: 100%; }

/* Simulador do bot de WhatsApp (administrador) */
.simbot-log { height: 380px; overflow-y: auto; background: #efeae2; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.simbot-msg { max-width: 80%; padding: 8px 12px; border-radius: 10px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.4; }
.simbot-voce { align-self: flex-end; background: #d9fdd3; }
.simbot-bot { align-self: flex-start; background: white; }
.simbot-barra { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.simbot-barra input[type="text"] { flex: 1; min-width: 200px; }
.simbot-anexo { cursor: pointer; }

/* Selo de origem do chamado (WhatsApp / e-mail), ao lado da categoria */
.origem-badge {
  display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600; white-space: nowrap;
}
.origem-whatsapp { background: #dcfce7; color: #166534; }
.origem-email { background: #f3e8ff; color: #6b21a8; }
.origem-portal { background: #dbeafe; color: #1e40af; }

/* quadro que aparece no login logo depois do cadastro */
.cadastro-feito { background: var(--green-light); color: var(--green); border: 1px solid #bbf7d0; border-radius: 8px; padding: 14px 16px; margin-bottom: 20px; text-align: left; }
.cadastro-feito p { margin: 0 0 6px; }
.cadastro-feito p:last-child { margin-bottom: 0; }

/* Meus chamados: aviso de chamado esperando resposta, linha destacada e, no celular, cada chamado vira um cartão */
.aviso-resposta { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.aviso-resposta .btn { margin-left: auto; }
.table tr.linha-espera td { background: #fffbeb; }
@media (max-width: 640px) {
  .table-cartoes thead { display: none; }
  .table-cartoes, .table-cartoes tbody, .table-cartoes tr, .table-cartoes td { display: block; width: 100%; }
  .table-cartoes tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .table-cartoes tr:last-child { border-bottom: none; }
  .table-cartoes td { padding: 3px 0; border-bottom: none; font-size: 0.9rem; }
  .table-cartoes td.col-numero { color: var(--muted); font-size: 0.8rem; }
  .table-cartoes td.col-titulo { font-weight: 600; font-size: 1rem; padding: 2px 0 6px; }
  .table-cartoes td.col-data { color: var(--muted); font-size: 0.82rem; }
  .table-cartoes td.col-data::before { content: attr(data-rotulo) ": "; }
  .table-cartoes td.col-acao { padding-top: 8px; }
  .table-cartoes td.col-acao .btn { display: block; text-align: center; }
  .table-cartoes tr.linha-espera { background: #fffbeb; }
  .aviso-resposta .btn { margin-left: 0; width: 100%; text-align: center; }
}

.responsavel-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 14px; padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; font-size: 0.9rem; }
.responsavel-box .form-inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.sem-responsavel { color: #b45309; font-weight: 600; }
.col-responsavel { white-space: nowrap; }
.motivo-status { margin: 0 0 14px; padding: 8px 12px; border-left: 3px solid var(--blue); background: #f1f5ff; border-radius: 6px; font-size: 0.88rem; color: var(--text); }

/* Aviso fixo de conversas do WhatsApp esperando o N1 (topo de todas as páginas do N1) */
.aviso-conversas { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 14px; border: 1px solid #f59e0b; background: #fffbeb; border-radius: var(--radius); }
.aviso-conversas-texto { font-weight: 600; flex: 1; min-width: 200px; }
.aviso-conversas-vazio { display: none; }
.aviso-conversas-vazio:has(#aviso-ativar:not([hidden])) { display: flex; border-color: var(--border); background: #f9fafb; }

/* Conversa transferida (N1 conversando com a pessoa pelo portal) */
.conversa-log { height: 420px; }
.conversa-cliente { align-self: flex-start; background: white; }
.conversa-n1 { align-self: flex-end; background: #d9fdd3; }
.conversa-bot { align-self: center; background: #f1f5f9; color: var(--muted); font-size: 0.85rem; max-width: 90%; text-align: center; }
.conversa-quem { font-size: 0.75rem; color: var(--muted); margin-bottom: 2px; }
.conversa-resposta { margin-top: 12px; }
.form label.check { display: flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.form label.check input { width: auto; }
