/* Portal de Chamados — identidade visual Prefeitura de Ibiraçu (complementa o Tailwind CDN) */

:root {
  /* >>> CORES DA MARCA — troque os 2 valores abaixo se tiver o hex oficial <<< */
  --brand:       #266b3f;   /* verde institucional (cor principal) */
  --accent:      #b89776;   /* bronze (detalhes/realce) */

  /* derivadas (normalmente não precisa mexer) */
  --brand-dark:  #1b452c;
  --brand-soft:  #f0f9f3;
  --accent-dark: #9b7d5f;
  --ink:         #14241b;
  --paper:       #f5f8f6;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Libre Franklin', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

/* fundo com leve profundidade */
.bg-portal {
  background:
    radial-gradient(1200px 480px at 100% -10%, rgba(38,107,63,.08), transparent 60%),
    radial-gradient(900px 420px at -10% 110%, rgba(38,107,63,.05), transparent 60%),
    var(--paper);
}

/* ---- Barra de cabeçalho (verde institucional) ---- */
.brand-bar {
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
  border-bottom: 3px solid var(--accent);
}
.brand-logo { height: 56px; width: auto; display: block; flex-shrink: 0; }
/* o logo tem texto escuro: sobre o verde (cabeçalho, rodapé, login) vai numa "placa" branca */
.brand-logo { background: #fff; padding: 4px 10px; border-radius: 10px; }
/* o logo é largo (brasão + nome): no celular diminui para não empurrar o menu */
@media (max-width: 640px) {
  .brand-bar .brand-logo { height: 42px; padding: 3px 6px; }
}
/* em telas bem estreitas o próprio logo já diz "Prefeitura de Ibiraçu":
   esconde o texto ao lado dele para o menu não estourar a largura */
@media (max-width: 480px) {
  .brand-bar a > span { display: none; }
}
.brand-link { color: rgba(255,255,255,.92); }
.brand-link:hover { color: #fff; }

/* ---- Botões ---- */
.btn-brand {
  background: var(--brand);
  transition: background .15s ease, transform .05s ease;
}
.btn-brand:hover  { background: var(--brand-dark); }
.btn-brand:active { transform: translateY(1px); }

/* faixa/acentos bronze */
.accent-bar { background: var(--accent); }
.text-accent { color: var(--accent); }

/* foco acessível */
.focus-ring:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(38,107,63,.18);
}

/* cards da home */
.card-tile {
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.card-tile:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  box-shadow: 0 12px 28px -12px rgba(38,107,63,.40);
}

/* rodapé institucional */
.brand-footer {
  background: var(--brand-dark);
  color: rgba(255,255,255,.85);
}
.brand-footer a { color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .card-tile, .btn-brand { transition: none; }
  .card-tile:hover { transform: none; }
}

/* ---- Avisos de resposta da TI (canto da tela) ---- */
.toast-wrap {
  position: fixed;
  top: 96px;            /* abaixo da barra verde do cabeçalho */
  right: 16px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;  /* só os cartões recebem clique */
}
.toast {
  pointer-events: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--accent);
  border-radius: 14px;
  box-shadow: 0 14px 34px -14px rgba(16, 24, 40, .45);
  padding: 14px;
  animation: toast-in .25s ease-out;
}
.toast.out { animation: toast-out .2s ease-in forwards; }
.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 999px;
  flex-shrink: 0;
  background: var(--brand-soft);
  color: var(--brand);
}
.toast-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: underline;
}
.toast-link:hover { color: var(--brand-dark); }
.toast-close {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 999px;
  line-height: 1;
  font-size: 18px;
  color: #94a3b8;
}
.toast-close:hover { background: #f1f5f9; color: #475569; }

/* no celular os avisos ficam no rodapé, onde não cobrem o conteúdo */
@media (max-width: 640px) {
  .toast-wrap { top: auto; bottom: 16px; left: 16px; right: 16px; width: auto; }
}

@keyframes toast-in  { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(14px); } }

@media (prefers-reduced-motion: reduce) {
  .toast, .toast.out { animation: none; }
}

/* conteúdo HTML vindo do GLPI (descrição/atualizações) */
.rich-content img { max-width: 100%; height: auto; border-radius: 6px; }
.rich-content table { max-width: 100%; }
.rich-content a { color: var(--brand); text-decoration: underline; }
.rich-content p { margin: 0 0 8px; }
.rich-content p:last-child { margin-bottom: 0; }

/* ---- Contador de respostas da TI em "Meus chamados" ---- */
.reply-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
}

/* chamado com resposta ainda não lida na lista */
.ticket-unread { border-color: var(--accent) !important; box-shadow: 0 0 0 1px var(--accent); }
.unread-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}
