/* ============================================================
   GS Ouvidoria — estilos da interface.
   Recriam a aparência dos componentes do Golden UI a partir dos
   tokens (var(--*)). Os estilos reais do DS são injetados em runtime
   pelo bundle React; como servimos HTML server-side, reconstruímos
   aqui o necessário, sempre usando os tokens — nunca hex cru.
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-14);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }

.num { font-family: var(--font-num); }
.eyebrow {
  font-size: var(--fs-10); letter-spacing: var(--track-eyebrow);
  text-transform: uppercase; color: var(--gold); font-weight: 700;
}
.label-caps {
  font-size: var(--fs-10); letter-spacing: var(--track-label);
  text-transform: uppercase; color: var(--text-faint); font-weight: 700;
}
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }

/* ---- Logo GS ---- */
.gs-logo {
  border-radius: 11px; background: var(--gold-grad);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-ink); font-weight: 800;
}

/* ---- Botões ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--font-ui); font-weight: 700; font-size: var(--fs-12);
  padding: 0 16px; height: 44px; border-radius: var(--r-md);
  border: 1px solid transparent; cursor: pointer;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gold-grad); color: var(--gold-ink); box-shadow: var(--shadow-gold); }
.btn-primary:hover { box-shadow: var(--shadow-gold-hover); color: var(--gold-ink); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--gold-line); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-full { width: 100%; }
.btn-sm { height: 40px; }
.btn-link {
  background: none; border: none; color: var(--text-dim);
  font-family: var(--font-ui); font-size: var(--fs-12); padding: 10px; cursor: pointer;
}
.btn-link:hover { color: var(--text); }

/* ---- Inputs ---- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label {
  font-size: var(--fs-10); letter-spacing: var(--track-label);
  text-transform: uppercase; color: var(--text-faint); font-weight: 700;
}
.input, .textarea {
  width: 100%; background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); color: var(--text); font-family: var(--font-ui);
  font-size: var(--fs-14); padding: 12px 14px; outline: none;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .textarea:focus { border-color: var(--gold-line); box-shadow: 0 0 0 3px var(--gold-dim); }
.textarea { resize: none; line-height: 1.5; }
.field-hint { font-size: var(--fs-11); color: var(--text-faint); line-height: 1.45; }

/* olho para mostrar/ocultar senha (injetado por JS) */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap > .input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; padding: 6px; cursor: pointer;
  color: var(--text-faint); display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); transition: color var(--t-fast) var(--ease);
}
.pw-toggle:hover { color: var(--text); }
.pw-toggle:focus-visible { outline: 2px solid var(--gold-line); outline-offset: 1px; }

/* barra de força de senha */
.pw-bars { display: flex; gap: 5px; }
.pw-bars > i { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); }

/* ---- Cartões / painéis ---- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px;
}
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden;
}
.panel > .panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.panel > .panel-head h3 { margin: 0; font-size: var(--fs-14); font-weight: 700; color: var(--text); }
.panel > .panel-body { padding: 18px; }
.panel > .panel-body.no-pad { padding: 0; }

/* ---- StatusBadge ---- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px;
  padding: 0 10px; border-radius: var(--r-pill);
  font-size: var(--fs-10); font-weight: 700; letter-spacing: 0.02em;
  border: 1px solid transparent; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-pending  { color: var(--gold);  background: var(--gold-dim);  border-color: var(--gold-line); }
.badge-progress { color: var(--blue);  background: var(--blue-dim);  border-color: rgba(140,160,235,0.28); }
.badge-success  { color: var(--green); background: var(--green-dim); border-color: rgba(96,196,144,0.28); }
.badge-neutral  { color: var(--text-dim); background: var(--surface-2); border-color: var(--line-strong); }
.badge-warn     { color: var(--gold); background: var(--gold-dim); border-color: var(--gold-line); }
.badge-danger   { color: var(--red);  background: var(--red-dim);  border-color: rgba(235,109,102,0.30); }
/* Prazo: largura fixa + centralizado para a coluna ficar uniforme. */
.badge-prazo    { min-width: 124px; justify-content: center; }

/* ---- Chips ---- */
.chip {
  display: inline-flex; align-items: center; height: 30px; padding: 0 12px;
  border-radius: var(--r-pill); font-size: var(--fs-11); font-weight: 600;
  font-family: var(--font-ui); cursor: pointer;
  background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--line-strong);
  transition: all var(--t-fast) var(--ease);
}
.chip:hover { border-color: var(--gold-line); color: var(--text); }
.chip.active { background: var(--gold-dim); color: var(--gold); border-color: var(--gold-line); }

/* ---- Tabs ---- */
.tabs { display: inline-flex; gap: 4px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r-pill); padding: 4px; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px;
  border-radius: var(--r-pill); font-size: var(--fs-11); font-weight: 600;
  font-family: var(--font-ui); color: var(--text-dim); background: transparent;
  border: none; cursor: pointer; transition: all var(--t-fast) var(--ease);
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--gold-grad); color: var(--gold-ink); }
.tab .tab-count {
  font-family: var(--font-num); font-size: var(--fs-9); font-weight: 700;
  padding: 1px 6px; border-radius: var(--r-pill);
  background: rgba(0,0,0,0.18); color: inherit;
}
.tab:not(.active) .tab-count { background: var(--surface-3); }

/* ---- KPI ---- */
.kpi { background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px 18px; }
.kpi .kpi-label { font-size: var(--fs-11); color: var(--text-dim); }
.kpi .kpi-value { font-family: var(--font-num); font-size: var(--fs-24);
  font-weight: 700; color: var(--text); margin-top: 8px; }
.kpi .kpi-delta { font-size: var(--fs-11); margin-top: 6px; }
.delta-up { color: var(--green); }
.delta-warn { color: var(--gold); }
.delta-neutral { color: var(--text-faint); }

/* ---- DataTable ---- */
.dt { width: 100%; border-collapse: collapse; }
.dt th {
  text-align: left; padding: 12px 18px; font-size: var(--fs-9);
  letter-spacing: var(--track-label); text-transform: uppercase;
  color: var(--text-faint); font-weight: 700; border-bottom: 1px solid var(--line);
  background: var(--bg-raise);
}
.dt td { padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: var(--fs-12); color: var(--text); }
.dt tr:last-child td { border-bottom: none; }
.dt tbody tr { cursor: pointer; transition: background var(--t-fast) var(--ease); }
.dt tbody tr:hover { background: var(--surface-2); }
.dt td.num { font-family: var(--font-num); }
.dt th.dt-sortable { cursor: pointer; user-select: none; }
.dt th.dt-sortable:hover { color: var(--text-dim); }
.dt .dt-arrow { font-size: 9px; color: var(--gold-bright); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }

/* ---- BarChart (CSS puro) ---- */
.barchart { display: flex; align-items: flex-end; gap: 18px; height: 180px; padding-top: 8px; }
.barchart .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.barchart .bar-track { width: 100%; display: flex; align-items: flex-end; justify-content: center; flex: 1; }
.barchart .bar {
  width: 60%; max-width: 68px; border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: var(--surface-3); min-height: 4px;
}
.barchart .bar.hl { background: var(--gold-grad); }
.barchart .bar-value { font-family: var(--font-num); font-size: var(--fs-14); font-weight: 700; color: var(--text); }
.barchart .bar-label { font-size: var(--fs-11); color: var(--text-dim); }

/* ---- Toast (mensagens do Django) ---- */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 260px; max-width: 340px; background: var(--surface-2);
  border: 1px solid var(--line-strong); border-left-width: 3px; border-radius: var(--r-md);
  padding: 12px 14px; box-shadow: var(--shadow-toast); font-size: var(--fs-12);
}
.toast.success { border-left-color: var(--green); }
.toast.danger { border-left-color: var(--red); }
.toast.info { border-left-color: var(--blue); }
.toast.warning { border-left-color: var(--gold); }

/* ============================================================
   Colaborador — mobile-first
   ============================================================ */
.mobile-wrap {
  min-height: 100vh; display: flex; justify-content: center;
  background: radial-gradient(90% 55% at 50% 0%, rgba(239,196,99,0.06), transparent 60%);
}
.mobile-screen {
  width: 100%; max-width: 440px; min-height: 100vh;
  background: var(--bg); display: flex; flex-direction: column; position: relative;
}
@media (min-width: 520px) {
  .mobile-wrap { align-items: center; padding: 32px 16px; }
  .mobile-screen {
    min-height: auto; height: 812px; border-radius: 28px;
    border: 1px solid var(--line-strong); box-shadow: var(--shadow-modal); overflow: hidden;
  }
}
.m-scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column;
  /* padding inferior reserva a área segura (home indicator do iPhone) para o
     último botão/link não ficar escondido atrás da barra do sistema. */
  padding: 40px 24px calc(28px + env(safe-area-inset-bottom, 0px)); }
.m-topbar {
  flex: none; padding: 20px; border-bottom: 1px solid var(--line);
  background: var(--bg-raise); display: flex; align-items: center; gap: 12px;
}
.m-back { background: none; border: none; color: var(--text-dim); cursor: pointer; padding: 0; display: inline-flex; }
.m-back:hover { color: var(--text); }

.feature-row { display: flex; gap: 12px; align-items: flex-start; }
.feature-ico {
  flex: none; width: 32px; height: 32px; border-radius: 9px;
  background: var(--gold-dim); border: 1px solid var(--gold-line);
  display: flex; align-items: center; justify-content: center;
}

/* seletor de tipo de manifestação */
.tipo-grid { display: flex; gap: 8px; }
.tipo-opt {
  flex: 1; text-align: center; padding: 12px 4px; border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: var(--surface-2);
  color: var(--text-dim); cursor: pointer; transition: all var(--t-fast) var(--ease);
}
.tipo-opt:hover { border-color: var(--gold-line); }
.tipo-opt.active { border-color: var(--gold-line); background: var(--gold-dim); color: var(--gold); }
.tipo-opt .tipo-nome { margin-top: 6px; font-size: var(--fs-11); font-weight: 600; }

/* toggle */
.toggle { flex: none; width: 44px; height: 26px; border-radius: 13px; padding: 3px;
  background: var(--surface-3); border: none; cursor: pointer; transition: background var(--t-fast) var(--ease); }
.toggle .knob { width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform var(--t-fast) var(--ease); }
.toggle.on { background: var(--gold); }
.toggle.on .knob { transform: translateX(18px); }

/* abas Em andamento / Concluídas (colab) */
.colab-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.colab-tab {
  flex: 1; text-align: center; padding: 9px 8px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text-dim);
  font-size: var(--fs-12); font-weight: 600; text-decoration: none;
  transition: all var(--t-fast) var(--ease);
}
.colab-tab:hover { border-color: var(--gold-line); }
.colab-tab.active { border-color: var(--gold-line); background: var(--gold-dim); color: var(--gold); }

/* lista de manifestações (colab) */
.manif-item {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px; transition: border-color var(--t-fast) var(--ease);
}
.manif-item:hover { border-color: var(--line-strong); }
/* Selo de prazo de 48h no card do colaborador (aviso âmbar, atualiza via SSE) */
.prazo-selo { display: flex; align-items: center; gap: 7px; margin-top: 10px;
  padding: 7px 9px; border-radius: var(--r-sm, 8px); background: var(--warn-dim);
  border: 1px solid var(--gold-line); color: var(--gold-bright);
  font-size: var(--fs-11); line-height: 1.35; }
.prazo-selo svg { flex: none; }
.prazo-selo strong { font-weight: 700; }

/* cartão do usuário */
.user-card {
  border-radius: var(--r-xl); padding: 24px; position: relative; overflow: hidden;
  background: linear-gradient(150deg, #23242C, #17181E);
  border: 1px solid var(--gold-line); box-shadow: var(--shadow-gold);
}
.user-card::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 100% 0%, rgba(239,196,99,0.14), transparent 55%);
}
.user-card > * { position: relative; }

/* chat */
/* Casca do chat com ALTURA DEFINIDA para o composer colar no rodapé (RN-01/07).
   Só nesta tela (via .mobile-screen--chat) para não afetar as demais. */
.mobile-screen--chat { min-height: 0; height: 100vh; height: 100dvh; max-height: 100dvh; }
/* #chat-body preenche o espaço abaixo do topbar e é coluna flex (resolve H1/H2):
   a lista rola por dentro e o composer fica fixo embaixo. */
#chat-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
@media (min-width: 520px) {
  /* No desktop, o chat mantém a moldura de "telefone" (não vira tela cheia). */
  .mobile-screen--chat { height: 812px; max-height: 812px; }
}
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.bubble { max-width: 82%; }
.bubble .bubble-body { padding: 11px 13px; font-size: var(--fs-14); line-height: 1.5; color: var(--text); overflow-wrap: anywhere; }
.bubble .bubble-date { font-family: var(--font-num); font-size: var(--fs-10); color: var(--text-faint); margin-top: 4px; }
.bubble.them { align-self: flex-start; }
.bubble.them .bubble-body { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; }
.bubble.me { align-self: flex-end; }
.bubble.me .bubble-body { background: var(--gold-dim); border: 1px solid var(--gold-line); border-radius: 14px 4px 14px 14px; }
.bubble.me .bubble-date { text-align: right; }
.bubble .who { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: var(--fs-10); color: var(--text-faint); font-weight: 600; }
.who-avatar { width: 20px; height: 20px; border-radius: 6px; background: var(--gold-grad); color: var(--gold-ink); font-size: 9px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.chat-composer { flex: none; border-top: 1px solid var(--line); background: var(--bg-raise); padding: 12px 14px; display: flex; gap: 8px; align-items: flex-end; }
.chat-composer .textarea { max-height: 90px; min-height: 42px; }
.conv-bloqueio { align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; background: var(--gold-dim); }
.conv-bloqueio span { font-size: var(--fs-12); color: var(--gold-bright); line-height: 1.45; }
.conv-bloqueio .btn { flex: none; }
.send-btn { flex: none; width: 42px; height: 42px; border-radius: var(--r-md); border: none;
  background: var(--gold-grad); color: var(--gold-ink); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.attach-btn { flex: none; width: 42px; height: 42px; border-radius: var(--r-md); cursor: pointer;
  border: 1px dashed var(--line-strong); background: var(--surface-2); color: var(--text-dim);
  display: flex; align-items: center; justify-content: center; }
.attach-btn:hover { border-color: var(--gold-line); color: var(--gold); }

/* faixa de evidências internas na conversa */
.evid-strip { flex: none; border-top: 1px solid var(--line); background: var(--surface-2); padding: 10px 16px; }
.evid-strip__aviso { display: flex; align-items: center; gap: 8px; color: var(--text-faint); font-size: var(--fs-11); }
.evid-strip__chips { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.evid-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--gold-dim);
  border: 1px solid var(--gold-line); border-radius: var(--r-md); padding: 5px 8px 5px 10px; }
.evid-chip__nome { font-size: var(--fs-11); color: var(--text); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evid-chip__tam { font-size: var(--fs-10); color: var(--text-faint); }
.evid-chip__x { border: none; background: none; color: var(--text-faint); cursor: pointer; font-size: var(--fs-12); padding: 0 2px; line-height: 1; }
.evid-chip__x:hover { color: var(--red); }
.evid-strip__tools { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.evid-tool__rot { font-size: var(--fs-11); color: var(--text-faint); }
.chat-closed { flex: none; border-top: 1px solid var(--line); background: var(--bg-raise);
  padding: 14px; text-align: center; color: var(--text-faint); font-size: var(--fs-11); line-height: 1.45; }

/* banner de aviso (ex.: nova resposta) */
.notice { display: flex; gap: 10px; align-items: center; background: var(--gold-dim);
  border: 1px solid var(--gold-line); border-radius: var(--r-md); padding: 12px 14px; }
.notice span { font-size: var(--fs-12); color: var(--gold-bright); }

/* tela de boas-vindas (colab) */
.m-welcome { flex: 1; overflow-y: auto; position: relative; display: flex; flex-direction: column; }
.m-welcome-glow { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(90% 55% at 50% 0%, rgba(239,196,99,0.16), transparent 62%); }
.m-welcome-inner { flex: 1; display: flex; flex-direction: column; padding: 64px 26px 28px; position: relative; }
.welcome-card { display: flex; gap: 12px; align-items: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; }
.welcome-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--gold-dim);
  border: 1px solid var(--gold-line); display: flex; align-items: center; justify-content: center; color: var(--gold); }

/* cartão "Nova manifestação" na home */
.nova-card { display: flex; align-items: center; gap: 14px; border-radius: var(--r-lg); padding: 20px;
  background: linear-gradient(150deg, #23242C, #17181E); border: 1px solid var(--gold-line);
  box-shadow: var(--shadow-gold); position: relative; overflow: hidden;
  transition: transform var(--t-med) var(--ease); }
.nova-card:hover { transform: translateY(-2px); }
.nova-card::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 100% 0%, rgba(239,196,99,0.16), transparent 55%); }
.nova-card > * { position: relative; }
.nova-card-ico { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--gold-grad);
  display: flex; align-items: center; justify-content: center; color: var(--gold-ink); }

/* abas em pílula (colab) */
.m-pill-tabs { display: flex; gap: 8px; margin-top: 22px; }
.m-pill { flex: 1; text-align: center; padding: 10px 6px; border-radius: var(--r-pill);
  background: transparent; border: 1px solid var(--line); color: var(--text-dim);
  font-size: var(--fs-12); font-weight: 600; text-decoration: none; transition: all var(--t-fast) var(--ease); }
.m-pill:hover { border-color: var(--gold-line); color: var(--text); }
.m-pill.active { background: var(--gold-dim); border-color: var(--gold-line); color: var(--gold-bright); }

/* estado vazio (colab) */
.m-empty { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-lg);
  padding: 32px 20px; text-align: center; }

/* barra de rascunho salvo (nova manifestação) */
.rascunho-bar { display: flex; align-items: center; gap: 10px; margin-top: 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; }

/* linha do tempo do chat (Enviada → Em análise → Concluída) */
.m-timeline { display: flex; align-items: flex-start; padding: 16px; border-bottom: 1px solid var(--line); background: var(--bg); }
.m-tl-step { flex: 1; display: flex; flex-direction: column; align-items: center; }
.m-tl-line { display: flex; align-items: center; width: 100%; }
.m-tl-line::before { content: ""; flex: 1; }
.m-tl-dot { flex: none; width: 11px; height: 11px; border-radius: 50%; background: var(--surface-3); }
.m-tl-dot.done { background: var(--gold); }
.m-tl-dot.active { box-shadow: 0 0 0 4px var(--gold-dim); }
.m-tl-bar { flex: 1; height: 2px; background: var(--line-strong); }
.m-tl-bar.done { background: var(--gold); }
.m-tl-bar.hidden { background: transparent; }
.m-tl-label { margin-top: 8px; font-size: var(--fs-11); color: var(--text-faint); }
.m-tl-label.done { color: var(--text); }
.m-tl-label.active { font-weight: 700; }

/* ============================================================
   RH — AppShell desktop (sidebar + topbar)
   ============================================================ */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--bg-raise); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 12px; gap: 8px; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 8px 8px 16px; border-bottom: 1px solid var(--line); }
.sidebar .brand .gs-logo { width: 32px; height: 32px; font-size: 13px; }
.sidebar .brand .brand-logo { flex: none; height: 34px; width: auto; max-width: 120px; object-fit: contain; background: transparent; }
.nav-section { font-size: var(--fs-9); letter-spacing: var(--track-label); text-transform: uppercase;
  color: var(--text-faint); font-weight: 700; padding: 14px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-md);
  color: var(--text-dim); font-size: var(--fs-12); font-weight: 600; transition: all var(--t-fast) var(--ease); }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--gold-dim); color: var(--gold); }
.nav-item .badge-count { margin-left: auto; font-family: var(--font-num); font-size: var(--fs-9);
  background: var(--gold-grad); color: var(--gold-ink); border-radius: var(--r-pill); padding: 1px 7px; font-weight: 700; }
.nav-item .nav-dot { margin-left: auto; flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }

.content { display: flex; flex-direction: column; min-width: 0; }
.topbar { height: var(--topbar-h); border-bottom: 1px solid var(--line); background: var(--bg-raise);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 5; }
.topbar .t-title { font-size: var(--fs-16); font-weight: 700; }
.topbar .t-sub { font-size: var(--fs-11); color: var(--text-dim); }
.topbar .t-user { display: flex; align-items: center; gap: 8px; font-size: var(--fs-12); color: var(--text-dim); }
.avatar-sm { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3);
  border: 1px solid var(--line-strong); display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-11); font-weight: 700; color: var(--text); }
.page { padding: 24px; display: flex; flex-direction: column; gap: 16px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.detalhe-grid { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: stretch; }
/* A coluna da conversa (esquerda) acompanha a altura da lateral e termina na
   mesma linha do painel de Ações; o excedente de mensagens rola dentro dela.
   min-height:0 impede que uma conversa longa estique a linha do grid. */
.detalhe-grid > .panel { display: flex; flex-direction: column; min-height: 0; }
.detalhe-grid > .panel > .panel-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.info-block .info-label { font-size: var(--fs-10); letter-spacing: var(--track-label);
  text-transform: uppercase; color: var(--text-faint); font-weight: 700; }
.info-block .info-value { margin-top: 4px; font-size: var(--fs-14); color: var(--text); }

/* ---- Abas do detalhe (Manifestação / Auditoria) — puro CSS ---- */
.aba-radio { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }
.detalhe-abas { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.detalhe-aba { cursor: pointer; padding: 9px 16px; border-radius: var(--r-pill);
  background: transparent; border: 1px solid var(--line); color: var(--text-dim);
  font-size: var(--fs-12); font-weight: 600; transition: all .14s var(--ease, ease); }
.detalhe-aba:hover { border-color: var(--gold-line); color: var(--text); }
#aba-manifestacao:checked ~ .detalhe-abas label[for="aba-manifestacao"],
#aba-auditoria:checked ~ .detalhe-abas label[for="aba-auditoria"] {
  background: var(--gold-dim); border-color: var(--gold-line); color: var(--gold-bright); font-weight: 700; }
.aba-painel { display: none; }
#aba-manifestacao:checked ~ .aba-painel[data-aba="manifestacao"],
#aba-auditoria:checked ~ .aba-painel[data-aba="auditoria"] { display: block; }

/* ---- Aba Auditoria: dossiê + trilha ---- */
.aud-grid { display: grid; grid-template-columns: 1fr 380px; gap: 16px; align-items: start; }
.aud-alerta { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px;
  background: var(--red-dim); border: 1px solid rgba(235,109,102,.32); border-radius: var(--r-md); padding: 12px 14px; }
.aud-alerta svg { flex: none; margin-top: 1px; }
.aud-alerta__t { font-size: var(--fs-14); font-weight: 700; color: var(--red); }
.aud-alerta__s { margin-top: 4px; font-size: var(--fs-12); color: var(--text-dim); line-height: 1.5; }

.dossie-vazio { border: 1px dashed var(--line-strong); border-radius: var(--r-md); padding: 24px 18px; text-align: center; }
.dossie-vazio__t { font-size: var(--fs-14); font-weight: 600; }
.dossie-vazio__s { margin-top: 6px; font-size: var(--fs-12); color: var(--text-dim); }

.dossie-lista { display: flex; flex-direction: column; gap: 14px; margin-bottom: 4px; }
.dossie-nota { display: flex; gap: 14px; }
.dossie-nota__trilho { flex: none; display: flex; flex-direction: column; align-items: center; padding-top: 5px; }
.dossie-nota__ponto { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.dossie-nota__linha { flex: 1; width: 2px; background: var(--line); margin-top: 6px; min-height: 12px; }
.dossie-nota__card { flex: 1; min-width: 0; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 13px 15px; }
.dossie-nota__tipo { font-size: var(--fs-10); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--gold); font-weight: 700; }
.dossie-nota__quando { font-size: var(--fs-11); color: var(--text-faint); }
.dossie-nota__texto { margin-top: 8px; font-size: var(--fs-14); line-height: 1.55; white-space: pre-wrap; }
.dossie-nota__autor { margin-top: 10px; font-size: var(--fs-11); color: var(--text-faint); }

.anexos { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.anexo { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); padding: 6px 10px; color: var(--text); max-width: 260px; }
.anexo:hover { border-color: var(--gold-line); color: var(--text); }
.anexo__nome { font-size: var(--fs-11); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anexo__tam { flex: none; font-size: var(--fs-10); color: var(--text-faint); }

/* Chip de categoria do anexo (só o rótulo da extensão) */
.anexo-cat { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 34px;
  height: 18px; padding: 0 5px; border-radius: 5px; font-size: 9px; font-weight: 800; letter-spacing: .02em;
  color: var(--text-dim); background: var(--surface-3); border: 1px solid var(--line-strong); }
.anexo-cat--imagem   { color: var(--c-teal);   border-color: rgba(91,184,168,.4); }
.anexo-cat--video    { color: var(--red);      border-color: rgba(235,109,102,.4); }
.anexo-cat--pdf      { color: var(--gold);     border-color: var(--gold-line); }
.anexo-cat--email    { color: var(--blue);     border-color: rgba(140,160,235,.4); }
.anexo-cat--texto    { color: var(--green);    border-color: rgba(96,196,144,.4); }
.anexo-cat--documento{ color: var(--c-orange); border-color: rgba(232,154,107,.4); }

/* Barra de ações (criar pasta + upload) e grade de pastas */
.dossie-toolbar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center;
  padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.pastas { display: flex; flex-direction: column; gap: 12px; }
.pasta { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); padding: 12px 14px; }
.pasta__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pasta__nome { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-13); font-weight: 600; color: var(--gold-bright); }
.pasta__n { font-size: var(--fs-10); color: var(--text-faint); background: var(--surface-3);
  border-radius: var(--r-pill); padding: 1px 8px; }
.pasta__vazia { margin-top: 8px; font-size: var(--fs-11); }
.pasta__acoes { display: flex; align-items: center; gap: 8px; }
.pasta__mini { list-style: none; cursor: pointer; font-size: var(--fs-10); font-weight: 700;
  color: var(--text-dim); padding: 2px 7px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); }
.pasta__mini:hover { color: var(--gold); border-color: var(--gold-line); }
.subpastas { margin-top: 10px; margin-left: 14px; padding-left: 12px; border-left: 1px solid var(--line-strong);
  display: flex; flex-direction: column; gap: 10px; }

/* anexo com ações (baixar / excluir) */
.anexo-wrap { display: flex; align-items: center; gap: 4px; }
.anexo-acao { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 6px; color: var(--text-faint); border: 1px solid transparent; cursor: pointer; background: none; }
.anexo-acao:hover { color: var(--gold); border-color: var(--gold-line); }

/* mini-popover de confirmação (details) para criar subpasta / excluir com motivo */
.mini-del { position: relative; display: inline-block; }
.mini-del > summary { list-style: none; cursor: pointer; }
.mini-del > summary::-webkit-details-marker { display: none; }
.mini-del__form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; display: flex; gap: 6px;
  align-items: center; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  padding: 8px; box-shadow: var(--shadow-modal); white-space: nowrap; }
.mini-del__form .input { min-width: 210px; }

/* comentários com resposta */
.coment-lista { display: flex; flex-direction: column; gap: 14px; }
.coment-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 11px 13px; }
.coment-removido { background: transparent; border-style: dashed; }
.coment__autor { font-size: var(--fs-11); font-weight: 700; color: var(--gold-bright); }
.coment__quando { font-size: var(--fs-11); color: var(--text-faint); }
.coment__x { list-style: none; cursor: pointer; color: var(--text-faint); font-size: var(--fs-11); padding: 0 4px; }
.coment__x:hover { color: var(--red); }
.coment__texto { margin-top: 6px; font-size: var(--fs-13); line-height: 1.5; white-space: pre-wrap; }
.coment-resposta { margin-top: 10px; margin-left: 18px; padding-left: 12px; border-left: 2px solid var(--line-strong); }
.coment-reply { display: flex; gap: 8px; align-items: center; margin-top: 10px; margin-left: 18px; }

/* modal de pré-visualização */
.preview-modal { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center;
  background: rgba(8, 10, 14, 0.72); padding: 24px; }
.preview-modal[hidden] { display: none; }

/* Aparição suave dos modais (fade do fundo + leve escala/subida da caixa) */
@keyframes modal-bg-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-box-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.preview-modal:not([hidden]) { animation: modal-bg-in .22s ease both; }
.preview-modal:not([hidden]) .preview-box { animation: modal-box-in .32s cubic-bezier(.22,.61,.36,1) both; }
dialog[open] { animation: modal-box-in .3s cubic-bezier(.22,.61,.36,1) both; }
.preview-box { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  box-shadow: var(--shadow-modal); width: min(920px, 96vw); max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.preview-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.preview-head #preview-nome { flex: 1; }
.preview-corpo { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 12px; overflow: auto; }
.preview-corpo img { max-width: 100%; max-height: 78vh; object-fit: contain; }
.preview-corpo video { max-width: 100%; max-height: 78vh; }
.preview-corpo iframe { width: 100%; height: 78vh; border: none; background: #fff; }

.dossie-form { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }

.aud-trilha { display: flex; flex-direction: column; }
.aud-ev { display: flex; gap: 14px; }
.aud-ev__trilho { flex: none; display: flex; flex-direction: column; align-items: center; }
.aud-ev__ponto { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; }
.aud-ev__linha { flex: 1; width: 2px; background: var(--line); }
.aud-ev:last-child .aud-ev__linha { display: none; }
.aud-ev__corpo { flex: 1; min-width: 0; padding-bottom: 16px; }
.aud-ev__acao { font-size: var(--fs-14); font-weight: 600; }
.aud-ev__quando { font-size: var(--fs-11); color: var(--text-faint); }
.aud-ev__detalhe { margin-top: 3px; font-size: var(--fs-12); color: var(--text-dim); }
.aud-ev__quem { margin-top: 3px; font-size: var(--fs-11); color: var(--text-faint); }

/* ---- Alternador de tema (claro/escuro) ---- */
.theme-toggle { position: fixed; right: 18px; bottom: 18px; z-index: 1300; width: 42px; height: 42px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--text-dim);
  box-shadow: var(--shadow-modal); transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.theme-toggle:hover { color: var(--gold); border-color: var(--gold-line); }
/* Na tela de chat do mobile o composer fica fixo no rodapé e o botão "Enviar"
   ocupa o canto inferior direito — o mesmo lugar do alternador de tema. Esconde
   o alternador aqui para não cobrir o "Enviar"; o tema segue disponível nas
   demais telas. */
body:has(.mobile-screen--chat) .theme-toggle { display: none; }
.theme-toggle .ico-moon { display: none; }
:root[data-theme="light"] .theme-toggle .ico-sun { display: none; }
:root[data-theme="light"] .theme-toggle .ico-moon { display: block; }

/* Cards com gradiente escuro hardcoded → variante clara no tema light */
:root[data-theme="light"] .user-card,
:root[data-theme="light"] .nova-card { background: linear-gradient(150deg, #F6EDD3, #E4CB97); }
:root[data-theme="light"] .toggle .knob { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); }

/* ============================================================
   RESPONSIVIDADE — celulares (iOS Safari / Android Chrome) e tablets
   ============================================================ */
html, body { max-width: 100%; overflow-x: hidden; }
* { -webkit-tap-highlight-color: rgba(0, 0, 0, 0); }
img, video, iframe, canvas, svg { max-width: 100%; }
.theme-toggle { right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }

/* Hambúrguer (só no mobile) + fundo do menu-gaveta */
.topbar-burger { display: none; flex: none; width: 40px; height: 40px; border-radius: var(--r-md);
  align-items: center; justify-content: center; cursor: pointer; background: transparent;
  border: 1px solid var(--line-strong); color: var(--text-dim); margin-right: 12px; }
.topbar-burger:hover { color: var(--gold); border-color: var(--gold-line); }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 1190; background: rgba(0, 0, 0, .5);
  opacity: 0; visibility: hidden; transition: opacity .28s var(--ease); }
.sidebar-backdrop.open { opacity: 1; visibility: visible; }
.conv-back { display: none; flex: none; width: 36px; height: 36px; border-radius: var(--r-md);
  align-items: center; justify-content: center; cursor: pointer; border: 1px solid var(--line-strong);
  background: transparent; color: var(--text-dim); }
.conv-back:hover { color: var(--gold); border-color: var(--gold-line); }

@media (max-width: 860px) {
  .topbar-burger { display: inline-flex; }
  .topbar { padding: 0 14px; padding-left: calc(14px + env(safe-area-inset-left, 0px)); padding-right: calc(14px + env(safe-area-inset-right, 0px)); }
  .topbar .t-user span { display: none; }               /* só o avatar */
  .page { padding: 16px; padding-left: calc(16px + env(safe-area-inset-left, 0px)); padding-right: calc(16px + env(safe-area-inset-right, 0px)); }

  /* Menu lateral vira gaveta off-canvas (sobrepõe a regra antiga de linha) */
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: min(84vw, 300px);
    flex-direction: column; align-items: stretch; overflow-x: hidden; overflow-y: auto;
    transform: translateX(-100%); transition: transform .28s var(--ease); z-index: 1200;
    box-shadow: 0 0 40px rgba(0, 0, 0, .45); padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
  .sidebar.open { transform: none; }

  /* Não deixar campos com <16px (evita zoom automático no iOS ao focar) */
  .input, .textarea, input, select, textarea { font-size: 16px; }

  /* Conversas: alterna LISTA ↔ CHAT no celular */
  .conv-grid { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .conv-grid .conv-list { display: flex; }
  .conv-grid.conv-active .conv-list { display: none; }
  .conv-grid:not(.conv-active) .conv-main { display: none; }
  .conv-grid.conv-active { height: calc(100dvh - var(--topbar-h) - 40px); }
  .conv-grid.conv-active .conv-back { display: inline-flex; }

  /* Tabela da fila rola na horizontal dentro do painel */
  .dt-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .dt { min-width: 620px; }

  /* Grades stackam */
  .detalhe-grid, .aud-grid, .grid-2, .auda-grid2, .auda-cofres { grid-template-columns: 1fr; }
  .auda-grid2 > .panel { height: auto; max-height: 72vh; }
}

@media (max-width: 560px) {
  .inicio-saudacao { font-size: 28px; }
  .inicio-card { padding: 20px; }
  .inicio-card__valor { font-size: 36px; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .hist-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .hist-row > .row { align-self: flex-start; flex-wrap: wrap; }
  .aud-modal, .preview-modal { padding: 12px; }
  .aud-modal__box, .preview-box { max-height: 88dvh; }
}

/* Aparição suave das telas do RH: cada bloco entra em fade + slide, escalonado */
@keyframes page-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.page > *, .mobile-screen > * { animation: page-in .55s cubic-bezier(.22,.61,.36,1) both; }
.page > *:nth-child(2), .mobile-screen > *:nth-child(2) { animation-delay: .07s; }
.page > *:nth-child(3), .mobile-screen > *:nth-child(3) { animation-delay: .14s; }
.page > *:nth-child(4), .mobile-screen > *:nth-child(4) { animation-delay: .21s; }
.page > *:nth-child(n+5), .mobile-screen > *:nth-child(n+5) { animation-delay: .28s; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; align-items: center; overflow-x: auto; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .detalhe-grid { grid-template-columns: 1fr; }
  .aud-grid { grid-template-columns: 1fr; }
}

/* chat do RH (dentro do painel) */
/* Preenche a coluna da conversa (altura ditada pela lateral); rola por dentro. */
.rh-chat { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.rh-chat .rh-chat-scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding-right: 4px; }
.rh-chat .rh-composer { flex: none; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; display: flex; gap: 8px; align-items: flex-end; }
.rh-chat .rh-composer .textarea { max-height: 100px; min-height: 44px; }
/* Empilhado (estreito): sem lateral para ditar a altura, o chat tem altura própria.
   Depois das regras acima para vencer a cascata. */
@media (max-width: 860px) {
  .rh-chat { flex: none; height: 60vh; min-height: 360px; }
}

/* ---- RH Início — hero + cards + rodapé (redesenho) ---- */
.inicio-wrap { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 36px; }
.inicio-hero { width: 100%; max-width: 1400px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.inicio-data { font-family: var(--font-num); font-size: var(--fs-11); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--text-faint); font-weight: 600; }
.inicio-saudacao { margin: 0; font-size: 42px; line-height: 1.06; font-weight: 800; letter-spacing: -0.025em; }
.inicio-nome { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.inicio-resumo { margin: 0; color: var(--text-dim); font-size: var(--fs-16); line-height: 1.5; }
.inicio-rule { width: 56px; height: 2px; border-radius: 2px; background: var(--gold-grad); margin-top: 6px; }

.inicio-cards { width: 100%; max-width: 1400px; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.inicio-card { cursor: pointer; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; text-align: left; color: var(--text);
  transition: transform var(--t-med) var(--ease), border-color var(--t-med) var(--ease); }
.inicio-card:hover { transform: translateY(-2px); border-color: var(--line-strong); color: var(--text); }
.inicio-card--destaque { border-color: var(--gold-line); }
.inicio-card--destaque:hover { border-color: var(--gold); }
.inicio-card__top { display: flex; justify-content: space-between; align-items: center; }
.inicio-card__icone { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-strong); display: flex; align-items: center; justify-content: center; }
.inicio-card__icone--gold { background: var(--gold-dim); border-color: var(--gold-line); }
.inicio-card__icone--green { background: var(--green-dim); border-color: rgba(96,196,144,0.35); }
.inicio-card__rotulo { font-size: var(--fs-10); letter-spacing: var(--track-label); text-transform: uppercase; color: var(--text-faint); font-weight: 700; }
.inicio-card__rotulo--gold { color: var(--gold); }
.inicio-card__valor { margin-top: 18px; font-family: var(--font-num); font-size: 44px; font-weight: 700; line-height: 1; color: var(--text); }
.inicio-card__valor--gold { color: var(--gold-bright); }
.inicio-card__titulo { margin-top: 8px; font-size: var(--fs-14); font-weight: 600; }
.inicio-card__cta { margin-top: 14px; display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: var(--fs-12); font-weight: 600; }
.inicio-card__cta--gold { color: var(--gold); }

.inicio-espaco { flex: 1; min-height: 12px; }
.inicio-rodape { width: 100%; max-width: 1400px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; padding: 22px 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.inicio-rodape__selo { display: flex; align-items: center; gap: 14px; }
.inicio-rodape__escudo { flex: none; width: 38px; height: 38px; border-radius: 11px; background: var(--gold-dim); border: 1px solid var(--gold-line); display: flex; align-items: center; justify-content: center; color: var(--gold); }
.inicio-rodape__titulo { font-size: var(--fs-12); font-weight: 700; }
.inicio-rodape__sub { margin-top: 2px; font-size: var(--fs-12); color: var(--text-dim); }
.inicio-rodape__metricas { display: flex; align-items: center; gap: 36px; flex-wrap: wrap; }
.inicio-metrica__valor { font-family: var(--font-num); font-size: 18px; font-weight: 700; color: var(--text); }
.inicio-metrica__valor--gold { color: var(--gold-bright); }
.inicio-metrica__rotulo { margin-top: 2px; font-size: var(--fs-11); color: var(--text-faint); }
@media (max-width: 720px) {
  .inicio-saudacao { font-size: 32px; }
  .inicio-rodape { flex-direction: column; align-items: flex-start; }
}

/* ---- RH Início (home) ---- */
.home-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.home-card { display: flex; flex-direction: column; gap: 8px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px;
  transition: transform var(--t-med) var(--ease), border-color var(--t-med) var(--ease); }
.home-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.home-card.gold { border-color: var(--gold-line); }
.home-card.gold:hover { border-color: var(--gold); }
.home-ico { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--line-strong); display: flex; align-items: center; justify-content: center; color: var(--text-dim); }
.home-ico.gold { background: var(--gold-dim); border-color: var(--gold-line); color: var(--gold); }
.home-ico.green { background: var(--green-dim); border-color: rgba(96,196,144,0.35); color: var(--green); }
.home-num { font-family: var(--font-num); font-size: 44px; font-weight: 700; line-height: 1; color: var(--text); margin-top: 10px; }
.home-num.gold { color: var(--gold-bright); }
.home-cap { font-size: var(--fs-14); font-weight: 600; color: var(--text); }
.home-go { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px;
  color: var(--text-dim); font-size: var(--fs-12); font-weight: 600; }
.home-go.gold { color: var(--gold); }
.home-all { display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 16px 20px; color: var(--text-dim); transition: border-color var(--t-fast) var(--ease); }
.home-all:hover { border-color: var(--line-strong); }
.home-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; align-items: start; }
.recent-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  border-bottom: 1px solid var(--line); color: var(--text); transition: background var(--t-fast) var(--ease); }
.recent-row:last-child { border-bottom: none; }
.recent-row:hover { background: var(--surface-2); color: var(--text); }
.recent-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }

/* ---- RH Conversas (duas colunas) ---- */
.conv-grid { display: grid; grid-template-columns: 340px 1fr;
  height: calc(100vh - var(--topbar-h) - 90px); min-height: 480px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.conv-list { border-right: 1px solid var(--line); display: flex; flex-direction: column;
  min-height: 0; background: var(--bg-raise); }
.conv-list-head { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.conv-list-scroll { flex: 1; overflow-y: auto; }
.conv-row { display: flex; gap: 12px; align-items: center; padding: 14px 16px 14px 13px;
  border-bottom: 1px solid var(--line); border-left: 3px solid transparent;
  transition: background var(--t-fast) var(--ease); }
.conv-row:hover { background: var(--surface-2); }
.conv-row.active { background: var(--surface-2); border-left-color: var(--gold); }
.conv-avatar { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--surface-3);
  border: 1px solid var(--line-strong); display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-12); font-weight: 700; color: var(--text-dim); }
.conv-preview { font-size: var(--fs-11); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-main { display: flex; flex-direction: column; min-height: 0; }
.conv-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 14px 20px;
  border-bottom: 1px solid var(--line); background: var(--bg-raise); }
.conv-chat-scroll { flex: 1; overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; background: var(--bg); }
.conv-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 40px; text-align: center; }
.conv-empty-ico { width: 56px; height: 56px; border-radius: 16px; background: var(--surface-2);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--text-faint); }

/* ---- Grau de gravidade ---- */
.grav-opt { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line-strong);
  background: transparent; font-family: var(--font-ui); font-size: var(--fs-12); cursor: pointer;
  transition: all var(--t-fast) var(--ease); }
.grav-opt:hover:not(:disabled) { border-color: var(--grav-cor); }
.grav-opt.active { border-color: var(--grav-cor); background: var(--surface-3); }
.grav-opt:disabled { cursor: default; opacity: 0.7; }
.grav-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; }
/* Destaque momentâneo do painel de gravidade ao tentar responder sem classificar */
.grav-flash { animation: grav-flash 1.6s var(--ease); }
@keyframes grav-flash {
  0%, 100% { box-shadow: none; }
  15%, 55% { box-shadow: 0 0 0 2px var(--gold-line), var(--shadow-modal); }
}

/* ---- Histórico ---- */
.grav-tag { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 10px;
  border-radius: var(--r-pill); font-size: var(--fs-10); font-weight: 700; letter-spacing: 0.02em;
  color: var(--grav-cor); border: 1px solid var(--line-strong); background: var(--surface-2); white-space: nowrap; }

/* Grau editável na Conversa (etiqueta que abre um seletor — reclassificar sem sair) */
.conv-grav { position: relative; display: inline-flex; }
.grav-pop { position: relative; }
.grav-pop__tag { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px 0 10px;
  border-radius: var(--r-pill); font-size: var(--fs-10); font-weight: 700; letter-spacing: 0.02em;
  color: var(--grav-cor); border: 1px solid var(--line-strong); background: var(--surface-2);
  white-space: nowrap; cursor: pointer; list-style: none; user-select: none;
  transition: border-color var(--t-fast) var(--ease); }
.grav-pop__tag::-webkit-details-marker { display: none; }
.grav-pop__tag:hover { border-color: var(--grav-cor); }
.grav-pop__chev { color: var(--text-faint); transition: transform var(--t-fast) var(--ease); }
.grav-pop[open] .grav-pop__chev { transform: rotate(180deg); }
.grav-pop__menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 1200;
  min-width: 190px; padding: 6px; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); box-shadow: var(--shadow-modal); }
.grav-pop__menu form { margin: 0; }
.grav-pop__hd { padding: 4px 8px 6px; font-size: var(--fs-10); font-weight: 700;
  letter-spacing: var(--track-label); text-transform: uppercase; color: var(--text-faint); }
.grav-pop__opt { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 8px 9px; border-radius: var(--r-md); border: 1px solid transparent; background: transparent;
  font-family: var(--font-ui); font-size: var(--fs-12); color: var(--text); cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.grav-pop__opt:hover { background: var(--surface-2); border-color: var(--grav-cor); }
.grav-pop__opt.is-ativa { background: var(--surface-3); color: var(--grav-cor); font-weight: 700; }
.hist-row { display: flex; justify-content: space-between; align-items: center; gap: 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 20px; color: var(--text); transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.hist-row:hover { border-color: var(--line-strong); transform: translateY(-1px); color: var(--text); }

/* ---- Elogios (mural) ---- */
/* min(330px,100%) evita que a coluna estoure a largura em telas estreitas
   (sem rolagem horizontal). A grade nunca recalcula a coluna pelo conteúdo. */
.elogio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(264px, 100%), 1fr)); gap: 16px; align-items: stretch; }
/* min-width:0 impede que texto sem espaços force o card a crescer; min-height
   padroniza a altura; overflow:hidden garante que nada vaze da borda. */
.elogio-card { position: relative; display: flex; flex-direction: column; width: 100%; max-width: 100%; min-width: 0; min-height: 212px; overflow: hidden; text-align: left;
  font-family: var(--font-ui); cursor: pointer; background: var(--surface);
  border: 1px solid var(--gold-line); border-radius: var(--r-lg); padding: 20px;
  color: var(--text);
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease); }
.elogio-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-gold); color: var(--text); }
.elogio-card.unread { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold-line); background: linear-gradient(180deg, var(--gold-dim), var(--surface) 60%); }
.elogio-dot { position: absolute; top: 14px; right: 14px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px var(--gold-dim); }
/* Quebra qualquer palavra/sequência e limita a 4 linhas com reticências. */
.elogio-text { margin-top: 14px; font-size: var(--fs-16); line-height: 1.6; color: var(--text);
  min-width: 0; max-width: 100%;
  overflow-wrap: anywhere; word-break: break-word; white-space: normal; overflow: hidden;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; }
.elogio-more { margin-top: 8px; align-self: flex-start; font-size: var(--fs-13); font-weight: 600; color: var(--gold-bright); }
/* margin-top:auto fixa o rodapé na base — cards mantêm a mesma altura. */
.elogio-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; min-width: 0; }

@media (max-width: 860px) {
  .home-cards { grid-template-columns: 1fr; }
  .home-grid { grid-template-columns: 1fr; }
  .conv-grid { grid-template-columns: 1fr; }
  .conv-list { display: none; }
}

/* utilitários */
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-14 { gap: 14px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.grow { flex: 1; }
.wrap { flex-wrap: wrap; }
.center { align-items: center; }
.end { align-items: flex-end; }
