/* ============================================================================
   RAFF — estilos específicos do DMS (complementam styles.css do portal).
   Reutiliza as variáveis de tema (--primary, --accent, --navy, etc.).
   ============================================================================ */

/* ===== Login ===== */
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
}
.login-brand .login-logo { height: 46px; width: auto; max-width: 100%; display: block; }
.login-brand h1 { margin: 0; font-size: 1.4rem; color: var(--navy); }
.login-brand .subtitle { margin: 0; }
.login-hint { margin-top: 1rem; font-size: 0.78rem; color: var(--text-muted); text-align: center; }

/* ===== Busca na topbar ===== */
.search-form { display: flex; align-items: center; gap: 0.4rem; }
.search-form input[type='search'] {
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  outline: none;
  min-width: 200px;
  font-family: inherit;
}
.search-form input[type='search']:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 150, 178, 0.15);
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--border); }
.breadcrumb .current { color: var(--text); font-weight: 600; }

/* ===== Cabeçalho de página com ações ===== */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-head-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.toolbar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1.25rem 0; }

.section-title {
  font-size: 1rem;
  color: var(--navy);
  margin: 1.75rem 0 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--surface-tint);
}

/* ===== Cartões de pasta (home) ===== */
.folder-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-decoration: none;
  color: inherit;
}
.folder-card-icon { font-size: 1.8rem; line-height: 1; }
.folder-card h3 { margin: 0.25rem 0 0; }

/* Gráfico de pizza de ocupação de espaço (raiz RAFF / pastas pessoais) */
.folder-card-quota { position: absolute; top: 0.9rem; right: 0.9rem; line-height: 0; }
.quota-pie { display: block; }
.folder-card-quota-label {
  margin: 0.15rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.quota-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}
.quota-summary .quota-summary-text { display: flex; flex-direction: column; gap: 0.1rem; }
.quota-summary .quota-summary-title { font-size: 0.8rem; font-weight: 700; color: var(--navy); }
.quota-summary .quota-summary-detail { font-size: 0.78rem; color: var(--text-muted); }
.folder-chip-quota { display: inline-flex; line-height: 0; }

/* ===== Chips de subpasta ===== */
.folder-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.folder-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.folder-chip:hover { border-color: var(--primary); background: #e3f2f5; transform: translateY(-1px); }

/* ===== Nomes de documento em tabelas ===== */
.doc-name { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; white-space: normal; }
.doc-name a { color: var(--primary); font-weight: 600; text-decoration: none; }
.doc-name a:hover { text-decoration: underline; }
.fic { font-size: 1.1rem; }
.doc-orig { color: var(--text-muted); font-size: 0.78rem; width: 100%; }
.row-actions { display: flex; gap: 0.4rem; justify-content: flex-end; }
.row-current { background: var(--surface-tint); }

/* ===== Detalhe do documento ===== */
.doc-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 1.25rem;
  margin-top: 1rem;
}
.doc-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  min-height: 420px;
  display: flex;
}
.preview-frame { width: 100%; height: 70vh; min-height: 420px; border: 0; background: #fff; }
.preview-text { background: #fff; }
.preview-image { width: 100%; height: auto; object-fit: contain; margin: auto; }
.preview-none { margin: auto; text-align: center; }

.doc-meta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  align-self: start;
}
.doc-meta h3 { color: var(--navy); font-size: 0.95rem; margin-bottom: 0.75rem; }
.doc-meta .info-list dd { margin: 0; word-break: break-word; }

/* ===== Tags ===== */
.tag-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
.tag-chip {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  background: var(--surface-tint);
  color: var(--accent-dark);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ===== Formulários inline (<details>) ===== */
.inline-form { display: inline-block; }
.inline-form.align-right { }
.inline-form > summary { list-style: none; cursor: pointer; display: inline-block; }
.inline-form > summary::-webkit-details-marker { display: none; }
.inline-form[open] > summary { margin-bottom: 0.6rem; }
.inline-form .stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  max-width: 420px;
  box-shadow: 0 8px 24px rgba(8, 57, 68, 0.08);
}
.stack label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; font-weight: 600; color: var(--text); }
.stack input[type='text'],
.stack input[type='search'],
.stack input[type='file'],
.stack select {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  font-weight: 400;
}
.stack input:focus, .stack select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 150, 178, 0.15);
}
.stack .btn { align-self: flex-start; }

/* ===== Diversos ===== */
.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 1rem;
}
.hint { color: var(--text-muted); font-size: 0.8rem; }
.stat { font-size: 1.8rem; font-weight: 800; color: var(--navy); margin: 0; }

.alert-info {
  background: #e6f4f8;
  color: var(--accent-dark);
  border: 1px solid #bfe0ea;
}

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b52a37; }

/* Botões dentro de formulários inline lado a lado */
form { margin: 0; }

/* ===== Uploader (vários / pasta) ===== */
.uploader .up-bar { width: 100%; height: 10px; }
.uploader .up-log {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  font-size: 0.8rem;
}
.uploader .up-log li { padding: 0.15rem 0; color: var(--success); border-bottom: 1px solid var(--surface-tint); }
.uploader .up-log li.up-fail { color: var(--danger); }
.uploader .up-status { font-weight: 600; }
.uploader .up-sep { border: 0; border-top: 1px solid var(--border); margin: 0.5rem 0; }
.uploader .dest-folder, .uploader .dest-newroot { width: 100%; }

/* ===== Popup de progresso do envio (OK em verde / X em vermelho) ===== */
.upload-modal-card { max-width: 620px; }
.up-modal-status { margin: 0.5rem 0 0.4rem; font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }
.up-modal-bar { width: 100%; height: 10px; margin-bottom: 0.75rem; }
.up-modal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 46vh;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.up-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--surface-tint);
}
.up-row:last-child { border-bottom: 0; }
.up-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-row-error { display: block; width: 100%; margin-top: 0.15rem; font-size: 0.74rem; color: var(--danger); }
.up-row-fail { flex-wrap: wrap; background: var(--danger-bg); }
.up-row-ok { background: var(--success-bg); }
.up-row-active .up-row-name { color: var(--primary); font-weight: 600; }

/* Selo por arquivo: pendente (giro), OK (verde) e X (vermelho) */
.up-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 22px;
  padding: 0 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.up-badge-pending {
  width: 14px;
  min-width: 14px;
  height: 14px;
  margin: 4px;
  border-radius: 50%;
  border: 2px solid var(--surface-tint);
  border-top-color: var(--primary);
  animation: up-spin 0.8s linear infinite;
}
.up-badge-ok { background: var(--success); color: #fff; }
.up-badge-fail { background: var(--danger); color: #fff; }
@keyframes up-spin { to { transform: rotate(360deg); } }

/* ===== Busca com filtros ===== */
.search-filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}
.search-filters .sf-main { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.search-filters .sf-main input[type='search'] {
  flex: 1;
  min-width: 220px;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
}
.search-filters .sf-main input[type='search']:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--surface-tint);
}
.sf-advanced { margin-top: 0.75rem; }
.sf-advanced > summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  user-select: none;
  list-style: none;
}
.sf-advanced > summary::before { content: '▸ '; }
.sf-advanced[open] > summary::before { content: '▾ '; }
.sf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem 1rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--surface-tint);
}
.sf-grid label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.78rem; font-weight: 600; color: var(--text); }
.sf-grid input, .sf-grid select {
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 400;
}
.sf-grid input:focus, .sf-grid select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--surface-tint); }
.chip {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  background: var(--surface-tint);
  color: var(--accent-dark);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ===== Home: favoritos e recentes ===== */
.home-section { margin: 1.25rem 0; }
.home-section-title { font-size: 0.95rem; color: var(--navy); margin: 0 0 0.6rem; }
.doc-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.6rem;
}
.doc-strip-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  transition: border-color 0.15s, transform 0.15s;
}
.doc-strip-item:hover { border-color: var(--primary); transform: translateY(-1px); }
.doc-strip-link { display: flex; align-items: center; gap: 0.55rem; flex: 1; min-width: 0; text-decoration: none; }
.doc-strip-body { display: flex; flex-direction: column; min-width: 0; }
.doc-strip-title {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-strip-meta { color: var(--text-muted); font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-strip-fav { display: flex; }

/* Estrela de favorito (faixas da home) */
.star-btn {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--border);
  padding: 0 0.15rem;
}
.star-btn:hover { color: var(--seg-guindaste); }
.star-btn.is-fav { color: var(--seg-guindaste); }

/* Coluna de estrela nas tabelas (busca / pasta) */
.col-fav { width: 1%; white-space: nowrap; text-align: center; padding-right: 0; }

/* Dica curta abaixo de um campo de formulário */
.field-hint { color: var(--text-muted); font-size: 0.72rem; font-weight: 400; }

/* ===== Central de downloads ===== */
.dl-list { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1rem; }
.dl-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}
.dl-item:hover { border-color: var(--primary); }
.dl-icon { font-size: 1.6rem; flex: none; }
.dl-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dl-label { font-weight: 600; color: var(--navy); font-size: 0.9rem; }
.dl-desc { color: var(--text-muted); font-size: 0.78rem; margin-top: 2px; }

/* Callout genérico (aviso/nota) para páginas do layout padrão */
.callout {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  background: var(--surface-tint);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  color: var(--text);
}
.callout svg { flex: none; color: var(--primary); margin-top: 1px; }
.callout .t { display: block; font-weight: 700; font-size: 0.82rem; color: var(--navy); }
.callout p { margin: 0.2rem 0 0; font-size: 0.82rem; }
.callout.info { background: #eef6f9; }

@media (max-width: 560px) {
  .dl-item { flex-wrap: wrap; }
  .dl-item .btn { width: 100%; text-align: center; }
}

/* ===== Visualizador blindado (só-visualização) ===== */
.hardened-viewer {
  max-height: 78vh;
  overflow: auto;
  background: #33414a;
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  user-select: none;
  -webkit-user-select: none;
}
.hardened-viewer .hv-loading { color: #cfe0e6; text-align: center; padding: 2rem; font-size: 0.85rem; }
.hardened-viewer .hv-page {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
  pointer-events: none;      /* sem clique-direito/arrastar na imagem */
  -webkit-user-drag: none;
  user-select: none;
}
.hardened-viewer.hv-text {
  background: var(--surface);
  position: relative;
  color: var(--text);
}
.hardened-viewer .hv-pre {
  white-space: pre-wrap;
  word-break: break-word;
  font: 0.82rem/1.5 "DejaVu Sans Mono", ui-monospace, monospace;
  margin: 0;
}
.hardened-viewer.hv-text::after {
  content: attr(data-watermark);
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%,-50%) rotate(-30deg);
  font-size: 1.4rem;
  font-weight: 700;
  color: rgba(110,110,110,.22);
  pointer-events: none;
  white-space: nowrap;
}
/* Bloqueia impressão quando há visualizador blindado na página. */
@media print {
  html.hv-lock body { display: none !important; }
  html.hv-lock::after {
    content: "Impressão desativada para documentos de só visualização.";
    display: block;
    padding: 2cm;
    font: 16px system-ui, sans-serif;
  }
}

/* Checkbox de "buscar no conteúdo" (ocupa a linha toda no grid de filtros) */
.sf-check {
  grid-column: 1 / -1;
  flex-direction: row !important;
  align-items: center;
  gap: 0.45rem !important;
  font-weight: 400 !important;
}
.sf-check input { width: auto; }

/* Paginador */
.pager { display: flex; align-items: center; gap: 0.75rem; justify-content: center; margin: 1rem 0 0.25rem; }
.pager-info { color: var(--text-muted); font-size: 0.8rem; }
.btn.is-disabled { opacity: 0.45; cursor: default; pointer-events: none; }

/* Badge de contagem ao lado de um título de seção */
.count-badge {
  display: inline-block;
  min-width: 1.4em;
  padding: 0.05rem 0.45rem;
  background: var(--surface-tint);
  color: var(--accent-dark);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: middle;
}

/* Botão favoritar (página do documento) */
.btn-fav { background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); }
.btn-fav:hover { border-color: var(--seg-guindaste); color: var(--seg-guindaste); }
.btn-fav.is-fav { background: #fff6e8; border-color: var(--seg-guindaste); color: #b5670a; }

/* ===== Responsivo ===== */
@media (max-width: 760px) {
  .doc-grid { grid-template-columns: 1fr; }
  .search-form input[type='search'] { min-width: 130px; }
  .sf-grid { grid-template-columns: 1fr 1fr; }
  .doc-strip { grid-template-columns: 1fr; }
  .preview-frame { height: 55vh; }
}

/* ===== Painel/Relatório ===== */
.page-narrow { max-width: 460px; }
.form-card { padding: 1.25rem; margin-top: 1rem; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
  margin: 0.5rem 0 0.5rem;
}
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.stat-tile .stat-num { font-size: 1.6rem; font-weight: 800; color: var(--navy); line-height: 1.1; }
.stat-tile .stat-lbl { font-size: 0.78rem; color: var(--text-muted); }

.dash-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.minichart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  padding: 0.5rem 0.25rem 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.mc-col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 26px; }
.mc-bar { width: 18px; background: var(--primary); border-radius: 4px 4px 0 0; }
.mc-x { font-size: 0.62rem; color: var(--text-muted); white-space: nowrap; }

.barlist { display: flex; flex-direction: column; gap: 0.5rem; }
.barlist-row { display: grid; grid-template-columns: 40% 1fr auto; align-items: center; gap: 0.5rem; }
.barlist-lbl { font-size: 0.82rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barlist-track { height: 10px; background: var(--surface-tint); border-radius: 999px; overflow: hidden; }
.barlist-fill { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.barlist-num { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); min-width: 2ch; text-align: right; }

/* Chip de usuário como link (mantém a aparência) + link Ajuda no menu */
.topbar .user-chip{ text-decoration:none; cursor:pointer; }
.topbar .user-chip:hover{ text-decoration:none; opacity:.9; }

/* ====================================================================
   Componentes de comunicação (e-mail/mensagens/mural/conta/sistema)
   ==================================================================== */
/* ===== Conta / Alterar senha ===== */
.account-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 320px);
  padding: 1.5rem 0.5rem;
}
.account-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2.25rem 2rem;
  box-shadow: 0 18px 45px rgba(8, 57, 68, 0.14);
}
.account-head {
  text-align: center;
  margin-bottom: 1.5rem;
}
.account-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  margin-bottom: 0.85rem;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 8px 18px rgba(26, 150, 178, 0.35);
}
.account-head h1 {
  font-size: 1.35rem;
  color: var(--navy);
  margin: 0 0 0.3rem;
}
/* remove o traço de acento herdado dos títulos de página */
.account-head h1::after { content: none; }
.account-sub {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0;
  line-height: 1.4;
}
.account-form { display: flex; flex-direction: column; gap: 1rem; }
.account-field { display: flex; flex-direction: column; gap: 0.35rem; }
.account-field > span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}
.account-field input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.account-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 150, 178, 0.15);
}
.account-policy {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0;
  padding: 0.7rem 0.85rem;
  background: var(--surface-tint);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}
.account-policy svg { flex: 0 0 auto; margin-top: 1px; color: var(--primary); }
.account-submit {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  margin-top: 0.25rem;
}
.account-cancel {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
}
.account-cancel:hover { color: var(--primary); text-decoration: underline; }
.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--text);
}
.pref-row input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--primary); }

@media (max-width: 520px) {
  .account-card { padding: 1.75rem 1.25rem; border-radius: 16px; }
  .account-screen { min-height: auto; }
}

/* ===== Painel de sistema (superadmin) ===== */
.sys-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  margin-top: 0.5rem;
  align-items: start;
}
.sys-card { padding: 1.25rem 1.35rem; }
.sys-card h3 { color: var(--navy); font-size: 1rem; margin: 0 0 0.9rem; }
@media (max-width: 820px) {
  .sys-grid { grid-template-columns: 1fr; }
}

/* ===== Mensagens ===== */
.nav-badge, .msg-badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  vertical-align: middle;
}
.msg-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin: 0.5rem 0 1rem;
}
.msg-tabs a {
  padding: 0.55rem 0.9rem;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.msg-tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }
.msg-tabs a:hover { color: var(--primary); }
tr.msg-unread td { background: #f0fafb; font-weight: 600; }
.msg-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
  margin-right: 6px;
  vertical-align: middle;
}
.msg-view h1 { margin-bottom: 0.75rem; }
.msg-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 0;
  margin-bottom: 0.75rem;
  border-top: 1px solid var(--surface-tint);
  border-bottom: 1px solid var(--surface-tint);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.msg-body { font-size: 0.95rem; line-height: 1.6; color: var(--text); white-space: normal; }
.form-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 1rem; }
.stack textarea {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
}
.stack textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--surface-tint); }
.stack select[multiple] {
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
}

/* ===== Mural ===== */
.mural-list { display: flex; flex-direction: column; gap: 0.9rem; }
.mural-item { padding: 1.1rem 1.25rem; }
.mural-item.is-inactive { opacity: 0.6; }
.mural-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.mural-head h3 { color: var(--navy); font-size: 1.05rem; margin: 0; }
.mural-pin { margin-right: 0.25rem; }
.mural-meta { color: var(--text-muted); font-size: 0.78rem; white-space: nowrap; }
.mural-body { margin-top: 0.6rem; font-size: 0.92rem; line-height: 1.6; color: var(--text); }
.mural-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.9rem; padding-top: 0.75rem; border-top: 1px solid var(--surface-tint); }

/* ===== Dashboard ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
  margin: 0.5rem 0 0.5rem;
}
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.stat-tile .stat-num { font-size: 1.6rem; font-weight: 800; color: var(--navy); line-height: 1.1; }
.stat-tile .stat-lbl { font-size: 0.78rem; color: var(--text-muted); }

.dash-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 0.5rem;
}

/* Mini gráfico de barras (14 dias) */
.minichart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  padding: 0.5rem 0.25rem 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.mc-col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 26px; }
.mc-bar { width: 18px; background: var(--primary); border-radius: 4px 4px 0 0; }
.mc-x { font-size: 0.62rem; color: var(--text-muted); white-space: nowrap; }

/* Lista com barrinhas proporcionais */
.barlist { display: flex; flex-direction: column; gap: 0.5rem; }
.barlist-row { display: grid; grid-template-columns: 40% 1fr auto; align-items: center; gap: 0.5rem; }
.barlist-lbl { font-size: 0.82rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barlist-track { height: 10px; background: var(--surface-tint); border-radius: 999px; overflow: hidden; }
.barlist-fill { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.barlist-num { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); min-width: 2ch; text-align: right; }

/* ===== Cadastro de usuário (/admin/users/new) — mesmo visual da troca de senha ===== */
.uc-screen { min-height: auto; padding-top: 0.5rem; }
.uc-card { max-width: 580px; }
.uc-form { gap: 1.35rem; }
.uc-section { display: flex; flex-direction: column; gap: 0.85rem; }
.uc-section + .uc-section { padding-top: 1.25rem; border-top: 1px solid var(--border); }
.uc-step {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-size: 0.95rem;
  color: var(--navy);
}
.uc-step::after { content: none; }
.uc-step > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.75rem;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
}
.uc-opt { font-style: normal; font-weight: 400; color: var(--text-muted); }
.uc-hint { font-size: 0.75rem; color: var(--text-muted); line-height: 1.35; }
.uc-hint.is-ok { color: #0a8a31; }
.uc-hint.is-bad { color: var(--danger); }
.account-field input.is-bad { border-color: var(--danger); }

/* Cartões de escolha (papel / método de acesso) */
.uc-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.uc-choice { position: relative; cursor: pointer; display: flex; }
.uc-choice > input { position: absolute; opacity: 0; pointer-events: none; }
.uc-choice-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.9rem 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.uc-choice-body svg { color: var(--text-muted); }
.uc-choice-body strong { font-size: 0.9rem; color: var(--text); }
.uc-choice-body small { font-size: 0.76rem; color: var(--text-muted); line-height: 1.35; }
.uc-choice:hover .uc-choice-body { border-color: var(--primary); }
.uc-choice > input:checked + .uc-choice-body {
  border-color: var(--primary);
  background: var(--surface-tint);
  box-shadow: 0 0 0 3px rgba(26, 150, 178, 0.15);
}
.uc-choice > input:checked + .uc-choice-body svg { color: var(--primary); }
.uc-choice-body { position: relative; }
.uc-choice > input:checked + .uc-choice-body::after {
  content: "✓";
  position: absolute;
  top: 0.65rem;
  right: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
}
.uc-choice > input:focus-visible + .uc-choice-body { outline: 2px solid var(--primary); outline-offset: 2px; }
.uc-tag {
  display: inline-block;
  margin-left: 0.2rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  vertical-align: 1px;
}

/* Avisos contextuais */
.uc-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #7a5200;
  background: #fff6e0;
}
.uc-note svg { flex: 0 0 auto; margin-top: 1px; color: #d18b00; }
.uc-admin-note { display: none; }
.uc-form:has(input[name="role"][value="admin"]:checked) .uc-admin-note { display: flex; }
.uc-form:has(input[name="create_method"][value="password"]:checked) .uc-invite-note { display: none; }

/* Bloco de senha: só aparece quando "Definir senha agora" está marcado */
.uc-pass-block {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 14px;
}
.uc-form:has(input[name="create_method"][value="invite"]:checked) .uc-pass-block { display: none; }
.uc-pass-wrap { position: relative; display: block; }
.uc-pass-wrap input { padding-right: 2.75rem; }
.uc-icon-btn {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  display: inline-flex;
  padding: 0.35rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.uc-icon-btn:hover, .uc-icon-btn.is-on { color: var(--primary); background: var(--surface-tint); }
.uc-pass-tools { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: -0.35rem; }
.uc-rules {
  list-style: none;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  background: var(--surface-tint);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.uc-rules li { position: relative; padding-left: 1.4rem; }
.uc-rules li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.38em;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  border: 1.5px solid currentColor;
}
.uc-rules li.is-ok { color: #0a8a31; }
.uc-rules li.is-ok::before { background: #0ec143; border-color: #0ec143; }
.uc-rules span.is-ok { color: #0a8a31; font-weight: 600; }

@media (max-width: 520px) {
  .uc-choices { grid-template-columns: 1fr; }
}

/* ===== Sessão expirada: tela em "balão" (app/views/session_expired.php) ===== */
.xp-screen { flex-direction: column; gap: 0; }
.xp-balloon {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  padding: 2.25rem 2rem 1.75rem;
  border-radius: 26px;
  background: var(--surface);
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  animation: xp-pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
}
/* rabinho do balão, apontando para o ícone do sistema logo abaixo */
.xp-balloon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -11px;
  width: 24px;
  height: 24px;
  background: var(--surface);
  border-radius: 0 0 6px 0;
  transform: translateX(-50%) rotate(45deg);
}
.xp-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  margin-bottom: 0.9rem;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 8px 18px rgba(26, 150, 178, 0.35);
}
.xp-hand-m { transform-origin: 12px 12px; animation: xp-tick 3s linear infinite; }
.xp-hand-h { transform-origin: 12px 12px; animation: xp-tick 36s linear infinite; }
.xp-spin { transform-origin: 12px 12px; animation: xp-tick 2.8s ease-in-out infinite; }
.xp-balloon h1 { margin: 0 0 0.45rem; font-size: 1.35rem; color: var(--navy); }
.xp-balloon h1::after { content: none; }
.xp-text { margin: 0 0 1rem; color: var(--text-muted); font-size: 0.9rem; line-height: 1.45; }
.xp-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 1.35rem;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  background: #fff6e0;
  color: #7a5200;
  font-size: 0.82rem;
  line-height: 1.4;
  text-align: left;
}
.xp-note svg { flex: 0 0 auto; margin-top: 1px; color: #d18b00; }
.xp-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  text-decoration: none;
}
.xp-link {
  display: inline-block;
  margin-top: 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
}
.xp-link:hover { color: var(--primary); text-decoration: underline; }
.xp-speaker {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.4rem;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.8rem;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  animation: xp-fade 0.6s 0.15s ease-out both;
}
.xp-speaker img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Aviso em balão na tela de login (sessão expirada) */
.login-notice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  background: #fff6e0;
  color: #7a5200;
  font-size: 0.82rem;
  line-height: 1.4;
  animation: xp-pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
}
.login-notice::after {
  content: "";
  position: absolute;
  left: 1.6rem;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: #fff6e0;
  transform: rotate(45deg);
}
.login-notice svg { flex: 0 0 auto; margin-top: 1px; color: #d18b00; }

@keyframes xp-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.94); }
  to   { opacity: 1; transform: none; }
}
@keyframes xp-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes xp-tick { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .xp-balloon, .xp-speaker, .login-notice, .xp-hand-m, .xp-hand-h, .xp-spin { animation: none; }
}
@media (max-width: 520px) {
  .xp-balloon { padding: 1.9rem 1.3rem 1.5rem; border-radius: 22px; }
}

/* Direcionar acesso: seletor de nível + botão OK na mesma linha */
.inline-change { display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.inline-change .btn[disabled] { opacity: 0.4; cursor: not-allowed; }

/* ===== Links em forma de botão (a.btn) =====
   O .btn não zera o sublinhado de <a>, e o .btn-outline tinha fundo transparente + borda quase
   invisível: os atalhos do painel (Usuários, Relatório, Importar, Lixeira, Gerenciar acesso,
   Ver tudo) pareciam texto. Aqui viram botões de verdade, no teal da identidade. */
/* <button> não herda a fonte por padrão (ficava em Arial ao lado de <a class="btn"> em Red Hat Display) */
.btn { font-family: inherit; }
a.btn { display: inline-block; text-decoration: none; text-align: center; line-height: 1.3; }
.btn-outline {
  background: #fff;
  border: 1px solid var(--primary);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(13, 91, 109, 0.12);
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn-outline:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
  box-shadow: 0 3px 10px rgba(26, 150, 178, 0.28);
}
.btn-outline:active:not(:disabled) { transform: translateY(1px); }
.btn-outline:focus-visible { outline: 3px solid rgba(26, 150, 178, 0.35); outline-offset: 2px; }

/* ===== Visualização ampla do documento (2026-09-27) =====
   A página do documento usava o container de 1100px e grade 2fr/1fr, deixando
   a pré-visualização pequena. Aqui: página mais larga, coluna de dados fixa e
   visualizador ocupando quase toda a altura da tela. */
@media (min-width: 981px) {
  .content:has(.doc-grid) { max-width: min(1800px, 96vw); }
  .doc-grid { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
  .doc-preview { min-height: 0; }
  .preview-frame { height: calc(100vh - 200px); min-height: 640px; }
  .preview-image { max-height: calc(100vh - 200px); }
}
@media (max-width: 980px) {
  .doc-grid { grid-template-columns: 1fr; }
  .preview-frame { height: 75vh; min-height: 480px; }
}
@media (min-width: 981px) {
  .hardened-viewer { max-height: calc(100vh - 200px); min-height: 640px; }
}
@media (max-width: 980px) {
  .hardened-viewer { max-height: 75vh; }
}

/* ===== Tema escuro (identidade visual da Intranet, 08/11/2026) =====
   As variáveis do tema escuro vêm de styles.css (:root[data-theme='dark']); aqui só as cores
   que este arquivo fixou para o tema claro. */
:root[data-theme='dark'] .folder-chip:hover { background: var(--soft-hover); }
:root[data-theme='dark'] .preview-text { background: var(--surface-2); color: var(--text); }
:root[data-theme='dark'] .alert-info,
:root[data-theme='dark'] .callout.info { background: var(--info-bg); border-color: var(--border); color: var(--text); }
:root[data-theme='dark'] .btn-fav.is-fav { background: var(--warn-bg); }
:root[data-theme='dark'] tr.msg-unread td { background: var(--info-bg); }
:root[data-theme='dark'] .uc-note,
:root[data-theme='dark'] .xp-note,
:root[data-theme='dark'] .login-notice,
:root[data-theme='dark'] .login-notice::after { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-line); }
:root[data-theme='dark'] .btn-outline { background: var(--surface); color: var(--primary); border-color: var(--primary); }
:root[data-theme='dark'] .import-staging-note { background: var(--warn-bg) !important; color: var(--warn-text); }
