/* ==========================================================================
   SALA.OPS — Design tokens
   Paleta: papel neutro + tinta grafite + sinal azul (ação) + sinais semânticos
   Tipografia: Space Grotesk (display) / Inter (corpo) / JetBrains Mono (dados)
   Assinatura visual: cada card carrega uma faixa de sinal (prioridade) no topo
   e uma etiqueta de ticket em monoespaçada — linguagem de "sala de imprensa".
   ========================================================================== */

:root {
  --bg: #f4f4f6;
  --surface: #ffffff;
  --surface-sunken: #eceef2;
  --border: #e2e3e8;
  --border-strong: #cfd1d9;

  --ink: #15161b;
  --ink-soft: #63656f;
  --ink-faint: #9799a3;

  /* "Chip invertido" (toast, aviso de atualização, filtro ativo) — sempre
     grafite escuro com texto branco, em QUALQUER tema. Não usa --ink
     porque --ink inverte no modo escuro (vira quase branco) — usar --ink
     aqui faria o texto branco cair em cima de um fundo quase branco. */
  --ink-invert-bg: #15161b;
  --ink-invert-text: #ffffff;

  --accent: #3350ff;
  --accent-ink: #ffffff;
  --accent-soft: #ebeeff;
  --accent-soft-border: #ccd4ff;

  --slate: #8b8d98;
  --amber: #f5a524;
  --amber-soft: #fef3dd;
  --orange: #ff7a3d;
  --orange-soft: #ffe9dc;
  --red: #e5484d;
  --red-soft: #fde2e2;
  --green: #12b76a;
  --green-soft: #dcf6e9;
  --violet: #7c5cff;
  --violet-soft: #ece6ff;
  --blue-soft: #e3e9ff;

  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(21, 22, 27, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(21, 22, 27, 0.18);
  --shadow-lg: 0 24px 48px -12px rgba(21, 22, 27, 0.28);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
/* Mesmo problema do .update-banner: [hidden] e "display: flex" têm a
   mesma especificidade — sem isto, a topbar podia aparecer por cima da
   tela de senha mesmo com "hidden" marcado (app.js usa topbar.hidden
   antes do acesso liberado). */
.topbar[hidden] { display: none; }
.topbar__brand { display: flex; align-items: center; gap: 8px; margin-right: 4px; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  flex-shrink: 0;
}
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.brand-name__accent { color: var(--accent); }

.nav-tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.nav-tab {
  border: none; background: transparent; color: var(--ink-soft);
  font-size: 13.5px; font-weight: 600; padding: 8px 12px; border-radius: var(--radius-sm);
  cursor: pointer; white-space: nowrap; transition: background .12s ease, color .12s ease;
}
.nav-tab:hover { background: var(--surface-sunken); color: var(--ink); }
.nav-tab.is-active { background: var(--accent-soft); color: var(--accent); }

.topbar__role { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.role-select { display: flex; flex-direction: column; gap: 2px; font-size: 10.5px; color: var(--ink-faint); }
.role-select__label { text-transform: uppercase; letter-spacing: .05em; font-weight: 600; padding-left: 2px; }
.role-select select {
  font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--ink);
  padding: 6px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); cursor: pointer;
}

/* ---------- Layout ---------- */
.app-main { max-width: 1320px; margin: 0 auto; padding: 24px 20px 80px; }
.page-head { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; margin-bottom: 24px; text-align: center; }
.page-head__content { max-width: 620px; }
.page-head h1 { font-size: 22px; font-weight: 700; }
.page-head__eyebrow { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; display: block; }
.page-head__sub { color: var(--ink-soft); font-size: 13.5px; margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer;
  font-weight: 600; font-size: 13.5px; padding: 9px 16px; transition: transform .08s ease, background .12s ease, box-shadow .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: #2743e0; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-sunken); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-sunken); color: var(--ink); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-danger:hover { background: #f9caca; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field__label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.field__hint { font-size: 11.5px; color: var(--ink-faint); }
.input, .textarea, .select {
  font-family: var(--font-body); font-size: 14px; color: var(--ink);
  padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); width: 100%; box-sizing: border-box; min-width: 0;
}
.textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .field--full { grid-column: 1 / -1; }
.form-grid .field { min-width: 0; }
input[type="date"] { width: 100%; max-width: 100%; box-sizing: border-box; -webkit-appearance: none; appearance: none; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
.painel-seletores-row { display: flex; flex-wrap: wrap; gap: 16px; }
.painel-seletores-row .field { flex: 1 1 320px; }
@media (max-width: 720px) { .painel-seletores-row { flex-direction: column; gap: 0; } .painel-seletores-row .field { flex: none; } }

.file-drop {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-md);
  padding: 18px; text-align: center; color: var(--ink-faint); font-size: 13px; cursor: pointer;
  background: var(--surface-sunken); transition: border-color .12s ease, background .12s ease;
}
.file-drop:hover, .file-drop.is-dragover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.file-chip-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.file-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-family: var(--font-mono);
  background: var(--surface-sunken); border: 1px solid var(--border); padding: 4px 8px; border-radius: 999px;
}
.file-chip button { border: none; background: none; cursor: pointer; color: var(--ink-faint); font-size: 13px; line-height: 1; }

/* ---------- Cards (demandas) ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.trash-item { display: flex; flex-direction: column; gap: 8px; }
.trash-item__info { font-size: 11.5px; }
.demand-card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 14px 12px; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: box-shadow .12s ease, transform .12s ease;
  overflow: hidden;
}
.demand-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.demand-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--signal, var(--slate));
}
.demand-card__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.demand-card__ticket { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }
.demand-card__title { font-weight: 700; font-size: 14.5px; margin: 2px 0 6px; line-height: 1.3; }
.demand-card__meta { font-size: 12px; color: var(--ink-soft); display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.demand-card__meta b { color: var(--ink); font-weight: 600; }
.demand-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em;
  white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--prio-baixa { background: #f1f1f4; color: var(--slate); }
.badge--prio-media { background: var(--amber-soft); color: #8a5a06; }
.badge--prio-alta { background: var(--orange-soft); color: #a1420a; }
.badge--prio-urgente { background: var(--red-soft); color: var(--red); }
.badge--prio-none { background: var(--surface-sunken); color: var(--ink-faint); }

.badge--status-recebido { background: var(--surface-sunken); color: var(--ink-soft); }
.badge--status-a_fazer { background: var(--blue-soft); color: var(--accent); }
.badge--status-em_producao { background: var(--violet-soft); color: var(--violet); }
.badge--status-revisao_material { background: var(--amber-soft); color: #8a5a06; }
.badge--status-aguardando_gestor { background: var(--orange-soft); color: #a1420a; }
.badge--status-validacao_gil { background: var(--violet-soft); color: var(--violet); }
.badge--status-concluido { background: var(--green-soft); color: #0a7a4c; }

.badge--tag-pendente { background: var(--amber-soft); color: #8a5a06; }
.badge--tag-falta_material { background: var(--red-soft); color: var(--red); }

.badge--atrasada { background: var(--red); color: #fff; }

.avatar-pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-soft);
}
.avatar-dot {
  width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700;
}

.empty-state {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 48px 20px;
  text-align: center; color: var(--ink-faint); background: var(--surface);
}
.empty-state h3 { font-size: 15px; color: var(--ink-soft); margin-bottom: 4px; }
.empty-state p { font-size: 13px; }

/* ---------- Toolbar / filtros ---------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.chip-filter {
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px;
  padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer;
}
.chip-filter.is-active { background: var(--ink-invert-bg); color: var(--ink-invert-text); border-color: var(--ink-invert-bg); }

/* ---------- Kanban ---------- */
.kanban-member-tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.kanban-board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; }
@media (max-width: 960px) { .kanban-board { grid-template-columns: 1fr; } }
.kanban-col { background: var(--surface-sunken); border-radius: var(--radius-lg); padding: 10px; min-height: 160px; }
.kanban-col.is-dragover { outline: 2px dashed var(--accent); outline-offset: -4px; background: var(--accent-soft); }
.kanban-col__head { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 10px; }
.kanban-col__title { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.kanban-col__count { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); background: var(--surface); border-radius: 999px; padding: 1px 7px; }
.kanban-col__list { display: flex; flex-direction: column; gap: 10px; min-height: 40px; }
.kanban-card { cursor: grab; }
.kanban-card.is-dragging { opacity: .4; }

/* ---------- Dashboard ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 24px; }
@media (max-width: 1080px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.stat-card__label { font-size: 11.5px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.stat-card__value { font-family: var(--font-display); font-size: 30px; font-weight: 700; margin-top: 4px; }
.stat-card--danger .stat-card__value { color: var(--red); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-sm); width: 100%; box-sizing: border-box; }
.panel + .panel { margin-top: 16px; }
.panel__title { font-size: 14px; font-weight: 700; margin-bottom: 14px; }

.workload-row {
  display: grid; grid-template-columns: 120px 1fr 40px; grid-template-areas: "nome barra conta" "monitor monitor monitor";
  align-items: center; column-gap: 12px; row-gap: 4px; margin-bottom: 12px; font-size: 13px;
  width: 100%; background: none; border: none; padding: 6px 8px; border-radius: var(--radius-sm);
  cursor: pointer; text-align: left; font-family: inherit; color: inherit;
  transition: background .1s ease;
}
.workload-row:hover { background: var(--surface-sunken); }
.workload-row:last-child { margin-bottom: 0; }
.workload-row__nome { grid-area: nome; font-weight: 600; }
.workload-bar-track { grid-area: barra; height: 8px; background: var(--surface-sunken); border-radius: 999px; overflow: hidden; }
.workload-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--violet)); border-radius: 999px; }
.workload-bar-fill--alerta { background: linear-gradient(90deg, var(--red), var(--orange)); }
.workload-count { grid-area: conta; font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); text-align: right; }
.workload-row__monitor { grid-area: monitor; font-size: 11.5px; color: var(--ink-faint); }
.workload-row__monitor .text-danger { color: var(--red); font-weight: 600; }
@media (max-width: 480px) {
  .workload-row { grid-template-columns: 96px 1fr 32px; }
}

/* ---------- Calendário ---------- */
.cal-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.cal-toolbar__title { font-weight: 700; font-size: 15px; min-width: 160px; }
.cal-view-switch { display: flex; gap: 2px; margin-left: auto; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { font-size: 11px; color: var(--ink-faint); text-transform: uppercase; text-align: center; font-weight: 700; padding-bottom: 4px; }
.cal-day {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  min-height: 92px; padding: 6px; font-size: 11.5px; display: flex; flex-direction: column; gap: 4px;
}
.cal-day.is-outside { opacity: .35; }
.cal-day.is-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cal-day__num { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }
.cal-chip {
  font-size: 10.5px; font-weight: 600; padding: 2px 6px; border-radius: 6px; cursor: pointer;
  background: var(--accent-soft); color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-week-row { display: flex; flex-direction: column; gap: 8px; }
.cal-week-item { display: flex; gap: 10px; align-items: center; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.cal-week-item__date { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); width: 90px; flex-shrink: 0; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 16, 20, 0.5); display: flex;
  align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 100;
}
.modal-box {
  background: var(--surface); border-radius: var(--radius-lg); width: 100%; max-width: 640px;
  box-shadow: var(--shadow-lg); animation: modal-in .14s ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); gap: 12px; }
.modal-head h2 { font-size: 17px; }
.modal-close { border: none; background: var(--surface-sunken); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 15px; color: var(--ink-soft); flex-shrink: 0; }
.modal-body { padding: 20px; max-height: 70vh; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }
.modal-sm { max-width: 420px; }

.tabs-inline { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab-inline { border: none; background: none; padding: 8px 4px; margin-right: 14px; font-size: 13px; font-weight: 600; color: var(--ink-faint); cursor: pointer; border-bottom: 2px solid transparent; }
.tab-inline.is-active { color: var(--ink); border-color: var(--accent); }

.briefing-box { background: var(--accent-soft); border: 1px solid var(--accent-soft-border); border-radius: var(--radius-md); padding: 14px; font-size: 13px; line-height: 1.55; margin-bottom: 16px; }
.briefing-box__label { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.briefing-box ul { margin: 6px 0 0; padding-left: 18px; }

.detail-row { display: flex; gap: 10px; font-size: 13px; margin-bottom: 10px; }
.detail-row__label { width: 110px; flex-shrink: 0; color: var(--ink-faint); font-weight: 600; }
.detail-row__value { color: var(--ink); }

.checklist { display: flex; flex-direction: column; gap: 8px; }
.checklist label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.checklist input { width: 16px; height: 16px; accent-color: var(--accent); }

.comment-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; max-height: 220px; overflow-y: auto; }
.comment-item { background: var(--surface-sunken); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; }
.comment-item__meta { font-size: 11px; color: var(--ink-faint); margin-bottom: 3px; font-family: var(--font-mono); }
.comment-item__texto { overflow-wrap: anywhere; }
.comment-item__texto a { color: var(--accent); text-decoration: underline; }
.comment-add { display: flex; gap: 8px; }
.comment-add textarea { flex: 1; min-height: 44px; }

.history-item { display: flex; gap: 10px; font-size: 12.5px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.history-item:last-child { border-bottom: none; }
.history-item__when { font-family: var(--font-mono); color: var(--ink-faint); width: 130px; flex-shrink: 0; }

/* ---------- Equipe ---------- */
.team-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.team-row { display: flex; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 14px; }
.team-row__name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.add-inline { display: flex; gap: 8px; }
.add-inline .input { flex: 1; }

/* ---------- Toast ---------- */
.toast-root { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--ink-invert-bg); color: var(--ink-invert-text); padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 13px; box-shadow: var(--shadow-md); animation: toast-in .15s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Aviso de nova versão disponível ---------- */
.update-banner {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  z-index: 500; display: flex; align-items: center; gap: 12px;
  background: var(--ink-invert-bg); color: var(--ink-invert-text); padding: 12px 16px; border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); font-size: 13.5px; animation: toast-in .2s ease-out;
  max-width: calc(100vw - 32px);
}
.update-banner .btn-primary { flex-shrink: 0; }
/* O atributo HTML "hidden" e ".update-banner { display: flex }" têm a
   MESMA especificidade CSS — sem isto, a regra flex sempre vencia e o
   aviso ficava visível na tela pra todo mundo, sempre, mesmo com
   "hidden" corretamente marcado (o bug real por trás do aviso que não
   saía da tela — não era cache). */
.update-banner[hidden] { display: none; }
@media (max-width: 480px) {
  .update-banner { flex-direction: column; align-items: stretch; text-align: center; bottom: 12px; left: 16px; right: 16px; transform: none; max-width: none; }
}

/* ---------- Utility ---------- */
.text-faint { color: var(--ink-faint); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.hidden { display: none !important; }

/* ==========================================================================
   VIA CAMPANHA 2026 — telas novas (gate, landing, acesso pessoal, áudio)
   ========================================================================== */

/* ---------- Portão de senha do site ---------- */
.gate-root { position: fixed; inset: 0; z-index: 500; }
.gate-overlay {
  position: fixed; inset: 0; background: linear-gradient(160deg, #12131a, #1c1f2e);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.gate-box {
  background: var(--surface); border-radius: var(--radius-lg); padding: 32px 28px;
  width: 100%; max-width: 360px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
}
.gate-box .brand-mark { width: 40px; height: 40px; border-radius: 12px; margin-bottom: 6px; }
.gate-box h1 { font-size: 18px; }
.gate-box p { color: var(--ink-soft); font-size: 13px; margin-bottom: 6px; }
.gate-box .input { text-align: center; }
.gate-box .btn { width: 100%; }
.gate-erro { color: var(--red); font-size: 12.5px; }

/* ---------- Landing "VIA COMUNIDADE" ---------- */
.landing {
  min-height: calc(100vh - 140px); display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 40px 16px;
}
.landing__mark {
  width: 64px; height: 64px; border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), var(--violet));
  box-shadow: var(--shadow-md); margin-bottom: 8px;
}
.landing__title { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.landing__sub { color: var(--ink-soft); font-size: 15px; margin-bottom: 18px; }
.landing__actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.btn-lg { padding: 14px 26px; font-size: 15px; border-radius: var(--radius-md); }

/* ---------- Acesso pessoal ---------- */
.access-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 28px; max-width: 640px; }
@media (max-width: 640px) { .access-grid { grid-template-columns: 1fr; } }
.access-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; cursor: pointer; transition: box-shadow .12s ease, transform .12s ease, border-color .12s ease;
  /* <button> não herda "color" do body por padrão (usa a cor padrão do
     navegador, geralmente preto) — sem isso, o título ficava preto em
     cima do fundo escuro do modo escuro. */
  color: var(--ink); font: inherit;
}
.access-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); border-color: var(--accent-soft-border); }
.access-card__icon { font-size: 26px; }
.access-card__title { font-weight: 700; font-size: 15.5px; }
.access-card__sub { font-size: 12px; color: var(--ink-faint); }

.quem-e-voce-list { display: flex; flex-direction: column; gap: 8px; }
.quem-e-voce-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; font-weight: 600;
}
.quem-e-voce-item:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.quem-e-voce-item input { accent-color: var(--accent); }

.identidade-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
  background: var(--surface-sunken); padding: 5px 10px 5px 5px; border-radius: 999px;
}

/* ---------- Nova demanda: foto + áudio ---------- */
.file-row { display: flex; gap: 8px; align-items: stretch; }
.file-row .file-drop { flex: 1; }
.btn-icon {
  width: 46px; flex-shrink: 0; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-md);
  background: var(--surface-sunken); cursor: pointer; font-size: 20px; display: flex; align-items: center; justify-content: center;
  transition: border-color .12s ease, background .12s ease;
}
.btn-icon:hover { border-color: var(--accent); background: var(--accent-soft); }

.audio-briefing { background: var(--violet-soft); border: 1px solid #d7cbff; border-radius: var(--radius-md); padding: 14px; margin-bottom: 20px; }
.audio-briefing__head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 13.5px; color: var(--violet); margin-bottom: 6px; }
.audio-briefing textarea { margin-top: 8px; }

.confirmacao-envio { text-align: center; padding: 30px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.confirmacao-envio__icone { font-size: 40px; }
.confirmacao-envio h2 { font-size: 19px; }
.confirmacao-envio p { color: var(--ink-soft); font-size: 13.5px; margin-bottom: 10px; }

/* ---------- Card: linha pequena + descrição em destaque ---------- */
.demand-card__small { font-size: 11px; color: var(--ink-faint); margin-bottom: 4px; }
.demand-card__desc { font-weight: 400; color: var(--ink-soft); }

/* ---------- Equipe: seções por time ---------- */
.team-section { margin-top: 18px; }
.team-section__title { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); margin-bottom: 8px; }

/* ==========================================================================
   Dashboard visual (Gil Matos) — números animados e gráficos
   ========================================================================== */
.bignum-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 720px) { .bignum-grid { grid-template-columns: repeat(2, 1fr); } }
.bignum-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 10px; cursor: pointer; text-align: center;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.bignum-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent-soft-border); }
.bignum-card__value { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--accent); line-height: 1; }
.bignum-card--danger .bignum-card__value { color: var(--red); }
.bignum-card__label { font-size: 12px; color: var(--ink-soft); font-weight: 600; }

.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; align-items: stretch; }
@media (max-width: 860px) { .charts-row { grid-template-columns: 1fr; } }
.chart-panel { display: flex; flex-direction: column; align-items: stretch; width: 100%; min-width: 0; box-sizing: border-box; }
.charts-row > .chart-panel { width: 100%; min-width: 0; }

.progress-ring-wrap { position: relative; width: 140px; height: 140px; margin: 8px auto 4px; }
.progress-ring { width: 140px; height: 140px; transform: rotate(-90deg); }
.progress-ring__bg { fill: none; stroke: var(--surface-sunken); stroke-width: 12; }
.progress-ring__fill { fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round; }
.progress-ring__num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 24px; font-weight: 700;
}

.donut-wrap { display: flex; justify-content: center; margin: 8px 0 12px; }
.donut { width: 130px; height: 130px; border-radius: 50%; position: relative; }
.donut::after { content: ""; position: absolute; inset: 20px; background: var(--surface); border-radius: 50%; }

.chart-legend { display: flex; flex-direction: column; gap: 4px; }
.legend-item {
  display: flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer;
  padding: 6px 8px; border-radius: var(--radius-sm); font-size: 12.5px; color: var(--ink-soft); text-align: left;
  transition: background .1s ease;
}
.legend-item:hover { background: var(--surface-sunken); color: var(--ink); }
.legend-item b { margin-left: auto; font-family: var(--font-mono); color: var(--ink); }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

.bar-chart { display: flex; flex-direction: column; gap: 10px; }
.bar-row {
  display: grid; grid-template-columns: 120px 1fr 32px; align-items: center; gap: 10px;
  background: none; border: none; cursor: pointer; padding: 4px; border-radius: var(--radius-sm); width: 100%;
  transition: background .1s ease;
}
.bar-row:hover { background: var(--surface-sunken); }
.bar-row__label { font-size: 12.5px; font-weight: 600; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row__track { height: 10px; background: var(--surface-sunken); border-radius: 999px; overflow: hidden; }
.bar-row__fill { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--violet)); border-radius: 999px; }
.bar-row__count { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); text-align: right; }

.estimate-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 720px) { .estimate-grid { grid-template-columns: 1fr; } }
.estimate-item { display: flex; flex-direction: column; gap: 4px; background: var(--surface-sunken); border-radius: var(--radius-md); padding: 12px 14px; }
.estimate-item__label { font-size: 11.5px; color: var(--ink-faint); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.estimate-item__value { font-size: 15px; font-weight: 700; }

/* ---------- Botão de voltar (fluxo de Nova Demanda) ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 4px; background: none; border: none; cursor: pointer;
  color: var(--ink-soft); font-size: 13px; font-weight: 600; padding: 4px 0; margin-bottom: 10px;
}
.back-link:hover { color: var(--accent); }

/* ==========================================================================
   Centralização geral + correções de UX/UI (desktop, tablet e mobile)
   ========================================================================== */

/* Painéis com largura própria (Nova demanda, Equipe, Acesso pessoal, login)
   ficavam grudados na esquerda em telas largas — agora centralizam. */
.panel { margin-left: auto; margin-right: auto; }
.landing, .access-grid, .charts-row, .bignum-grid { margin-left: auto; margin-right: auto; }

/* Container um pouco mais enxuto no desktop grande, pra não sobrar
   espaço em branco enorme nos formulários e telas de conteúdo único. */
.app-main { max-width: 1200px; }

/* ---------- Tablet (largura média) ---------- */
@media (max-width: 1024px) {
  .app-main { max-width: 100%; padding: 20px 24px 70px; }
  .kanban-board { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; justify-content: center; }
  .topbar__brand { justify-content: center; width: 100%; }
  .nav-tabs { order: 3; width: 100%; justify-content: center; }
  .topbar__role { width: 100%; justify-content: center; }
  .app-main { padding: 18px 16px 64px; }

  /* Cabeçalhos de página centralizados no mobile */
  .page-head { flex-direction: column; align-items: center; text-align: center; gap: 6px; }
  .page-head h1 { font-size: 19px; }
  .page-head__sub { max-width: 420px; }

  .landing__title { font-size: 26px; }
  .landing { text-align: center; }

  .panel { max-width: 100% !important; width: 100%; }
  .form-grid, .add-inline, .file-row { width: 100%; }

  .card-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .bignum-grid { grid-template-columns: repeat(2, 1fr); }
  .estimate-grid { grid-template-columns: 1fr; }

  .modal-box { max-width: 100%; }
  .modal-overlay { padding: 0; align-items: stretch; }
  .modal-box { border-radius: 0; min-height: 100vh; }

  /* Empilha os botões do rodapé do modal — a ação de avançar (primária)
     sempre acima da de voltar/devolver, na ordem em que aparecem no HTML. */
  .modal-foot { flex-direction: column; }
  .modal-foot .btn { width: 100%; }

  .add-inline { flex-direction: column; }
  .add-inline select { max-width: 100% !important; }
  .file-row { flex-direction: column; }
  .btn-icon { width: 100%; height: 44px; }

  .toolbar { justify-content: center; flex-direction: column; align-items: stretch; }
  .toolbar .field { max-width: 100% !important; width: 100%; }
  .toolbar .btn { width: 100%; }
  .cal-toolbar { flex-wrap: wrap; justify-content: center; }
  .cal-view-switch { margin-left: 0; width: 100%; justify-content: center; display: flex; }

  .detail-row { flex-direction: column; gap: 2px; }
  .detail-row__label { width: auto; }
  .history-item { flex-direction: column; gap: 2px; }
  .history-item__when { width: auto; }

  .tabs-inline { overflow-x: auto; -webkit-overflow-scrolling: touch; justify-content: flex-start; }
  .tab-inline { flex-shrink: 0; }

  .team-row { flex-wrap: wrap; gap: 8px; }
  .comment-add { flex-direction: column; }

  .access-grid { max-width: 100%; }
  .quem-e-voce-list { max-width: 100%; }

  .bar-row { grid-template-columns: 84px 1fr 28px; }
  .bar-row__label { font-size: 11.5px; }

  .empty-state { text-align: center; }

  /* botões que ficam sozinhos numa linha viram largura total no mobile,
     fica mais fácil de tocar */
  .confirmacao-envio .landing__actions { flex-direction: column; width: 100%; }
  .confirmacao-envio .landing__actions .btn { width: 100%; }
  .btn-lg { width: 100%; }
}

@media (max-width: 400px) {
  .bignum-grid, .stat-grid { grid-template-columns: 1fr; }
}

.form-actions-row { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.form-actions-row .btn { width: 100%; }
.form-actions-row .btn:first-child { padding: 14px 22px; font-size: 15.5px; font-weight: 700; border-radius: var(--radius-md); }
.form-actions-row .btn:last-child { padding: 12px 22px; font-size: 14px; border-radius: var(--radius-md); }

/* ---------- Popup pequeno (empilha por cima de um modal já aberto) ---------- */
.popup-overlay {
  position: fixed; inset: 0; background: rgba(10, 10, 14, 0.45); display: flex;
  align-items: center; justify-content: center; padding: 16px; z-index: 300;
}
.popup-box {
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 340px; max-height: 90vh; overflow-y: auto;
}
.popup-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.popup-head h3 { font-size: 15px; margin: 0; }
.popup-body { padding: 16px; }
.popup-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
@media (max-width: 480px) {
  .popup-foot { flex-direction: column; }
  .popup-foot .btn { width: 100%; }
}
.popup-box--lg { max-width: min(92vw, 880px); }

/* ---------- Arquivos anexados (miniatura + visualização grande + download) ---------- */
.detail-files__list { display: flex; flex-wrap: wrap; gap: 10px; }
.file-thumb { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 104px; }
.file-thumb__img {
  width: 104px; height: 104px; object-fit: cover; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); cursor: pointer; background: var(--surface-sunken);
}
.file-thumb__nome { font-size: 11px; color: var(--ink-soft); text-align: center; word-break: break-all; }
.file-thumb__baixar { font-size: 11px; }
.file-chip--arquivo { display: inline-flex; align-items: center; gap: 8px; }
.file-chip--arquivo a { font-size: 12.5px; }
.lightbox-img { display: block; width: 100%; height: auto; max-height: 78vh; object-fit: contain; border-radius: var(--radius-sm); background: var(--surface-sunken); }

/* ==========================================================================
   Dark mode
   ========================================================================== */
.dark-toggle {
  position: fixed; bottom: 18px; right: 18px; z-index: 600;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border-strong);
  background: var(--surface); font-size: 18px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; box-shadow: var(--shadow-md);
  transition: transform .12s ease, background .12s ease;
}
.dark-toggle:hover { transform: scale(1.08); }
@media (max-width: 720px) { .dark-toggle { bottom: 14px; right: 14px; width: 38px; height: 38px; font-size: 16px; } }

[data-theme="dark"] {
  --bg: #14151b;
  --surface: #1c1e27;
  --surface-sunken: #24262f;
  --border: #32343f;
  --border-strong: #40424e;

  --ink: #f2f2f5;
  --ink-soft: #b3b5c0;
  --ink-faint: #7a7c88;

  --accent: #6a84ff;
  --accent-ink: #0c0d12;
  --accent-soft: #232a4d;
  --accent-soft-border: #3a4380;

  --amber-soft: #3a2f10;
  --orange-soft: #3a2416;
  --red-soft: #3a1a1c;
  --green-soft: #113322;
  --violet-soft: #241f3d;
  --blue-soft: #1c2340;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.6);
}
[data-theme="dark"] .donut::after { background: var(--surface); }
[data-theme="dark"] .gate-overlay { background: linear-gradient(160deg, #08090c, #12131c); }
/* Badges de prioridade "Média"/"Alta": a cor do texto era fixa, escurecida
   de propósito pra ler bem no fundo pastel CLARO do modo claro — no modo
   escuro esse mesmo fundo vira escuro e o texto (também escuro) quase
   sumia. Troca pra um tom claro só no modo escuro. */
[data-theme="dark"] .badge--prio-media { color: var(--amber); }
[data-theme="dark"] .badge--prio-alta { color: var(--orange); }
[data-theme="dark"] .badge--tag-pendente { color: var(--amber); }

/* ---------- Sugestões rápidas de descrição ---------- */
.suggestion-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.suggestion-chip {
  background: none; border: 1px dashed var(--border-strong); color: var(--ink-faint);
  font-size: 11.5px; padding: 5px 10px; border-radius: 999px; cursor: pointer;
  transition: color .12s ease, border-color .12s ease, background .12s ease;
}
.suggestion-chip:hover { color: var(--accent); border-color: var(--accent-soft-border); background: var(--accent-soft); }

/* ---------- Dashboard elaborado do Gil Matos ---------- */
.gil-hero {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center;
  background: linear-gradient(120deg, #1c1e3d, #2a1f4d 45%, #3a1f45);
  color: #fff; border-radius: var(--radius-lg); padding: 24px; margin-bottom: 18px;
  box-shadow: var(--shadow-lg);
}
.gil-hero__ring { position: relative; }
.gil-hero__ring .progress-ring__bg { stroke: rgba(255,255,255,.15); }
.gil-hero__ring .progress-ring__fill { stroke: #7c9cff; }
.gil-hero__ring .progress-ring__num { color: #fff; }
.gil-hero__texto { text-align: center; }
.gil-hero__eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #b9c2ff; display: block; margin-bottom: 4px; }
.gil-hero__texto h2 { font-size: 22px; margin-bottom: 4px; }
.gil-hero__texto p { color: #d7d9ee; font-size: 13px; }
@media (min-width: 640px) { .gil-hero { justify-content: flex-start; } .gil-hero__texto { text-align: left; } }

.bignum-card { border-top: 3px solid var(--acc, var(--accent)); }
.bignum-card .bignum-card__value { color: var(--acc, var(--accent)); }

.tipo-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
@media (max-width: 960px) { .tipo-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .tipo-grid { grid-template-columns: repeat(2, 1fr); } }
.tipo-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  background: var(--tipo-cor-suave); border: 1px solid transparent; border-radius: var(--radius-md);
  padding: 14px 8px; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease;
}
.tipo-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.tipo-card__icone { font-size: 20px; }
.tipo-card__valor { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--tipo-cor); }
/* Cor fixa (não var(--ink-soft)): o fundo do card é sempre um pastel claro
   (--tipo-cor-suave, fixo, não muda com o tema) — no modo escuro,
   --ink-soft vira cinza claro e ficava ilegível em cima desse fundo. */
.tipo-card__label { font-size: 11px; font-weight: 600; color: #63656f; line-height: 1.2; }

.estimate-grid--stack { grid-template-columns: 1fr; }
.estimate-item--accent { background: var(--accent-soft); border: 1px solid var(--accent-soft-border); }

.bar-row__fill--green { background: linear-gradient(90deg, #12b76a, #14b8a6); }

[data-theme="dark"] .gil-hero { background: linear-gradient(120deg, #10111d, #1c1533 45%, #24132a); }
[data-theme="dark"] .bar-row__label { color: #ffffff; }

/* ==========================================================================
   Card de detalhe da demanda (novo formato unificado)
   ========================================================================== */
.modal-lg { max-width: 900px; }

.detail-block { margin-bottom: 18px; }
.detail-block__title {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-faint); font-weight: 700; margin-bottom: 10px;
}
.detail-row__label { width: 210px; }

.detail-desc { margin-bottom: 18px; }
.detail-desc__texto { font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.detail-desc__textarea { min-height: 140px; width: 100%; font-size: 14px; line-height: 1.55; }

.detail-files { margin-bottom: 18px; }
.detail-files__list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.file-drop--sm { padding: 10px; font-size: 12.5px; width: 100%; text-align: center; background: var(--surface-sunken); border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; color: var(--ink-soft); }
.file-drop--sm:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.comment-section { margin-top: 4px; }

.select--inline, .input--inline { max-width: 260px; padding: 6px 10px; font-size: 13px; }

@media (max-width: 720px) {
  .detail-row__label { width: auto; }
  .select--inline, .input--inline { max-width: 100%; width: 100%; }
}

/* ---------- Revisão da foto (X / ✓) ---------- */
.foto-review__img {
  width: 100%; max-height: 360px; object-fit: contain; background: var(--surface-sunken);
  border-radius: var(--radius-md); margin-bottom: 10px; display: block;
}
.btn-round {
  width: 46px; height: 46px; border-radius: 50%; border: none; font-size: 19px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform .1s ease;
}
.btn-round:hover { transform: scale(1.08); }
.btn-round--reject { background: var(--red-soft); color: var(--red); }
.btn-round--accept { background: var(--green-soft); color: #0a7a4c; }
[data-theme="dark"] .btn-round--accept { color: #4ade80; }

.page-head--lg h1 { font-size: 32px; }
@media (max-width: 720px) { .page-head--lg h1 { font-size: 27px; } }

/* ---------- Quem é você? (grid de pessoas, igual ao formato de tipo) ---------- */
.pessoa-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 480px) { .pessoa-grid { grid-template-columns: repeat(2, 1fr); } }
.pessoa-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  background: var(--accent-soft); border: 1px solid var(--accent-soft-border); border-radius: var(--radius-md);
  padding: 14px 8px; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease;
}
.pessoa-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.pessoa-card__avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.pessoa-card__nome { font-size: 12.5px; font-weight: 600; color: var(--ink); }

/* No celular, cards apertados em grade viram uma lista de linhas — mais
   fácil de ler o nome inteiro e de acertar o toque. */
@media (max-width: 520px) {
  .pessoa-grid { grid-template-columns: 1fr; gap: 8px; }
  .pessoa-card {
    flex-direction: row; align-items: center; justify-content: flex-start;
    text-align: left; gap: 12px; padding: 12px 14px;
  }
  .pessoa-card__avatar { width: 38px; height: 38px; font-size: 15px; flex-shrink: 0; }
  .pessoa-card__nome { font-size: 14px; }
  .pessoa-card::after { content: "›"; margin-left: auto; color: var(--accent); font-size: 18px; font-weight: 700; }
}

/* ---------- Lista operacional (substitui o Kanban por colunas de status) ---------- */
.op-lista { width: 100%; overflow-x: auto; }

.op-header, .op-row {
  display: grid;
  grid-template-columns: 78px 126px minmax(220px, 2fr) 128px 118px 116px 116px 82px 96px 104px 122px;
  gap: 10px;
  align-items: center;
}
.op-header {
  min-width: 1160px;
  padding: 0 14px 8px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-faint);
}

.op-section { margin-bottom: 10px; min-width: 1160px; }
.op-section__head {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 10px 14px; cursor: pointer; font: inherit; text-align: left;
}
.op-section__toggle { color: var(--ink-faint); font-size: 12px; width: 12px; }
.op-section__head--atrasada { border-left: 4px solid var(--red); background: var(--red-soft); }
.op-section__head--hoje { border-left: 4px solid var(--amber); background: var(--amber-soft); }
.op-section__head--amanha { border-left: 4px solid var(--green); background: var(--green-soft); }
.op-section__label { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.op-section__count {
  margin-left: auto; background: var(--surface-sunken); color: var(--ink-soft);
  font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
}
.op-section__body {
  border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden; min-width: 1160px;
}
.op-section__vazio { padding: 14px; margin: 0; }

.op-row {
  width: 100%; min-width: 1160px; background: var(--surface); border: none; border-top: 1px solid var(--border);
  padding: 10px 14px; cursor: pointer; font: inherit; text-align: left; color: var(--ink);
  transition: background .1s ease;
}
.op-section__body .op-row:first-child { border-top: none; }
.op-row:hover { background: var(--surface-sunken); }
.op-row--atrasada { box-shadow: inset 3px 0 0 var(--red); }
.op-row__cell { font-size: 12.5px; min-width: 0; }
.op-row__id { font-family: var(--font-mono); color: var(--ink-faint); }
.op-row__tarefa { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.op-row__tarefa-titulo { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-row__tarefa-sub { font-size: 11.5px; color: var(--ink-faint); }
.op-row__candidato, .op-row__executor { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-row--atrasada .op-row__prazo-etapa { color: var(--red); font-weight: 700; }
.op-row__tempo-previsto, .op-row__tempo-apontado { color: var(--ink-soft); font-family: var(--font-mono); font-size: 12px; }

@media (max-width: 880px) {
  .op-header { display: none; }
  .op-header, .op-section, .op-section__body { min-width: 0; }
  .op-row {
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "tarefa    tarefa"
      "candidato executor"
      "prazo     prioridade"
      "apontado  apontado";
    row-gap: 7px; column-gap: 10px;
    padding: 14px;
  }
  .op-row--atrasada { box-shadow: inset 4px 0 0 var(--red); }

  .op-row__id, .op-row__status, .op-row__prazo-final, .op-row__tempo-previsto, .op-row__origem { display: none; }

  .op-row__tarefa { grid-area: tarefa; }
  .op-row__tarefa-titulo { white-space: normal; font-size: 13.5px; }

  .op-row__candidato { grid-area: candidato; text-align: left; }
  .op-row__executor { grid-area: executor; text-align: right; }
  .op-row__candidato, .op-row__executor {
    white-space: normal; font-size: 12px; color: var(--ink-soft);
    overflow: hidden; text-overflow: ellipsis;
  }
  .op-row__candidato::before { content: "👤 "; }
  .op-row__executor::before { content: "🎯 "; }

  .op-row__prazo-etapa {
    grid-area: prazo; text-align: left; white-space: normal;
    font-size: 12.5px; font-weight: 700; color: var(--accent);
  }
  .op-row--atrasada .op-row__prazo-etapa { color: var(--red); }

  .op-row__prioridade { grid-area: prioridade; display: flex; justify-content: flex-end; }

  .op-row__tempo-apontado {
    grid-area: apontado; text-align: left; white-space: normal;
    font-size: 11.5px; padding-top: 6px; border-top: 1px dashed var(--border);
  }
  .op-row__tempo-apontado::before { content: "⏱ apontado: "; color: var(--ink-faint); font-family: var(--font-body); }
}

/* ---------- Alerta administrativo (demandas sem prazo de etapa) ---------- */
.panel--alerta { border-color: var(--orange-soft); background: var(--orange-soft); }
.alerta-linha { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.alerta-linha__ticket { flex: 1 1 260px; font-size: 12.5px; }
.alerta-linha .input--inline { max-width: 160px; }

/* ---------- Apontamento de horas (detalhe da demanda) ---------- */
.apontamentos-section { margin-bottom: 18px; }
.apontamentos-resumo { font-size: 13px; color: var(--ink); margin: 0 0 8px; }
.apontar-form {
  margin-top: 10px; padding: 10px; background: var(--surface-sunken);
  border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.apontar-form__campos { display: flex; gap: 12px; margin-bottom: 8px; }
.apontar-form__campos .field__label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.apontar-form__campos .input--inline { max-width: 90px; }
.apontamentos-lista { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.apontamento-item { background: var(--surface-sunken); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 12.5px; }
.apontamento-item__linha { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.apontamento-item__meta { color: var(--ink-faint); font-family: var(--font-mono); font-size: 11px; }
.apontamento-item__duracao { font-weight: 700; font-family: var(--font-mono); }
.apontamento-item__comentario { margin-top: 4px; }
.apontamento-item__correcao { margin-top: 4px; font-size: 11px; }
