/* ============================================================
   painel.css — SOMENTE o que o modelo System UI não tem.
   Carregado DEPOIS de styles.css.

   Não redefine nenhuma classe do modelo (topbar, sidebar, panel,
   cards, table, btn, badge, form-grid...) — essas pertencem ao
   styles.css e podem ser trocadas sem tocar neste arquivo.

   Aqui ficam só as peças que o modelo não previa:
   tela de login, mensagens de aviso, modal de busca, rodapé,
   e os modificadores de cor de status (ok / warn / danger).

   Todas as variáveis têm valor de reserva, então este arquivo
   funciona mesmo com um styles.css que não declare as mesmas cores.
   ============================================================ */

/* ---------------- Modificadores de status ----------------
   Sempre usados junto da classe base do modelo:
   class="btn ok"  ·  class="badge danger"
   Se o styles.css não conhecer o modificador, o elemento
   continua valendo como .btn / .badge normal. */
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.ok { border-color: rgba(53,196,106,.45); color: #6fe09a; }
.btn.danger { border-color: rgba(229,72,77,.45); color: #ff8f92; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.badge.ok { background: rgba(53,196,106,.14); color: #6fe09a; }
.badge.warn { background: rgba(232,161,58,.14); color: #f0bd6d; }
.badge.danger { background: rgba(229,72,77,.14); color: #ff8f92; }

/* ---------------- Célula de militar (avatar + nome) ---------------- */
.cell-user { display: flex; align-items: center; gap: 8px; }
.cell-user .avatar { width: 26px; height: 26px; border-radius: 6px; }
td.wrap { white-space: normal; min-width: 220px; }

/* ---------------- Contador de pendências na sidebar ---------------- */
.side-link .count {
  margin-left: auto; background: var(--danger, #e5484d); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 6px;
}

/* ---------------- Campo que ocupa a linha inteira ---------------- */
.field.full { grid-column: 1 / -1; }

/* ---------------- Mensagens de aviso ---------------- */
.flash {
  padding: 11px 15px; border-radius: var(--radius-sm, 7px); margin-bottom: 16px;
  font-size: 13.5px; border: 1px solid;
}
.flash a { text-decoration: underline; }
.flash-ok { background: rgba(53,196,106,.1); border-color: rgba(53,196,106,.4); color: #6fe09a; }
.flash-erro { background: rgba(229,72,77,.1); border-color: rgba(229,72,77,.4); color: #ff8f92; }
.flash-info { background: rgba(90,160,255,.1); border-color: rgba(90,160,255,.4); color: #9cc4ff; }

/* ---------------- Telas de acesso (o modelo não tem login) ---------------- */
.auth-wrap { max-width: 400px; margin: 60px auto; padding: 0 20px; }
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo .brandmark {
  width: 52px; height: 52px; font-size: 24px; border-radius: 14px; margin: 0 auto 12px;
}
.auth-title { font-size: 21px; letter-spacing: .04em; }
.auth-title .accent { color: var(--accent, #4f8cff); }
.auth-card {
  background: var(--surface, #12151d); border: 1px solid var(--line, #242a38);
  border-radius: var(--radius, 10px); padding: 22px; margin-bottom: 12px;
}
.auth-card .field + .field { margin-top: 12px; }
.auth-card .btn.primary { width: 100%; justify-content: center; margin-top: 16px; }
.auth-secondary, .auth-disclaimer {
  text-align: center; font-size: 12.5px; color: var(--muted, #8c96ab);
}
.auth-secondary a { color: var(--accent, #4f8cff); }
.auth-links { text-align: right; font-size: 12.5px; margin-top: 8px; }
.auth-links a { color: var(--accent, #4f8cff); }
.switch-row, .check-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; margin-top: 14px; cursor: pointer;
}
.switch-row input, .check-row input { width: auto; min-height: 0; }
.hint { font-size: 12.5px; color: var(--muted, #8c96ab); margin-top: 10px; text-align: center; }
.motto-code strong { font-family: ui-monospace, Menlo, monospace; color: var(--text, #e8ecf4); }

/* ---------------- Rodapé ---------------- */
.footer {
  text-align: center; padding: 20px; margin-top: auto;
  color: var(--muted, #8c96ab); font-size: 11.5px;
  border-top: 1px solid var(--line-soft, #1c2130);
}

/* ---------------- Modal do card de militar ---------------- */
.member-modal-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.65);
  z-index: 100; align-items: center; justify-content: center; padding: 20px;
}
.member-modal-backdrop.open { display: flex; }
.member-modal {
  background: var(--surface, #12151d); border: 1px solid var(--line, #242a38);
  border-radius: var(--radius, 10px); padding: 22px; width: 380px; max-width: 100%;
  position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.modal-close {
  position: absolute; top: 10px; right: 12px; border: none; background: none;
  font-size: 20px; cursor: pointer; color: var(--muted, #8c96ab); line-height: 1;
}
.member-modal .member { min-width: 0; }
.member-modal .avatar { width: 44px; height: 44px; }

/* ---------------- Relógio duplo (Brasília / Lisboa) ---------------- */
.clocks { display: flex; gap: 14px; margin-left: auto; }
.clocks + .top-actions { margin-left: 0; }
.clock { display: flex; flex-direction: column; align-items: center; line-height: 1.2; }
.clock b {
  font-family: ui-monospace, Menlo, monospace; font-size: 13px;
  color: var(--text, #e8ecf4); font-weight: 600;
}
.clock span {
  font-size: 9px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted, #8c96ab);
}
@media (max-width: 700px) { .clocks { display: none; } }

/* ---------------- Logo oficial (emblema da unidade) ---------------- */
.brandlogo {
  width: 32px; height: 32px; object-fit: contain;
  image-rendering: pixelated; flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.5));
}
.brandlogo-grande {
  width: 72px; height: 72px; margin: 0 auto 12px; display: block;
}
.footer-brand .brandlogo { width: 40px; height: 40px; }

/* ============================================================
   Mobile v2 — menu de gaveta (drawer) com o emblema no topo
   ============================================================ */
.menu-toggle { display: none; }
.menu-backdrop { display: none; }

@media (max-width: 900px), (pointer: coarse) and (max-width: 1080px) {
  .menu-toggle { display: grid; }

  /* A sidebar vira uma gaveta fixa que desliza da esquerda */
  .sidebar {
    position: fixed !important;
    top: 0; left: 0; bottom: 0;
    height: 100vh !important;
    width: 272px !important;
    display: block !important;
    padding: 16px 12px 40px !important;
    border-right: 1px solid var(--line, #3b3f45) !important;
    border-bottom: none !important;
    transform: translateX(-105%);
    transition: transform .25s ease;
    z-index: 70;
    overflow-y: auto;
    box-shadow: 12px 0 40px rgba(0,0,0,.5);
  }
  body.menu-aberto .sidebar { transform: translateX(0); }
  .side-label { width: auto !important; }

  body.menu-aberto .menu-backdrop {
    display: block; position: fixed; inset: 0;
    background: rgba(0,0,0,.55); z-index: 60;
    backdrop-filter: blur(2px);
  }
  body.menu-aberto { overflow: hidden; }

  /* Topbar compacta: gaveta + logo + ações + conta */
  .topbar { position: sticky !important; top: 0 !important; height: 56px !important; flex-wrap: nowrap !important; padding: 0 12px !important; gap: 10px !important; }
  .search { order: 0 !important; flex-basis: auto !important; flex: 1 !important; min-width: 0; }
  .acct-lines { display: none !important; }
  .brand span:not(.brandmark) { display: none; }

  /* Conteúdo respirável no telemóvel */
  .main { padding: 14px 14px 50px !important; }
  .chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .chip { flex-shrink: 0; }
  .pagehead { flex-direction: column; align-items: stretch; }
  .pagehead .btn { align-self: flex-start; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bar { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* ---------------- Registro de alistamento copiável ---------------- */
.registro-copy {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.registro-copy code {
  font-family: ui-monospace, Menlo, monospace; font-size: 12.5px;
  background: var(--bg, #191b1f); border: 1px solid var(--line, #3b3f45);
  border-radius: 999px; padding: 5px 12px; color: var(--accent, #eaa506);
}

/* ============================================================
   Correio · Feed · Academia (v1.4)
   ============================================================ */

/* ---- BBCode render ---- */
.bb { line-height: 1.6; }
.bb strong { color: var(--text); }
.bb .bb-quote {
  border-left: 3px solid var(--accent); background: var(--surface-2);
  margin: 12px 0; padding: 10px 14px; border-radius: 0 8px 8px 0; color: var(--muted); font-style: italic;
}
.bb .bb-hr { border: none; border-top: 1px solid var(--line); margin: 14px 0; }
.bb .bb-list { margin: 8px 0 8px 4px; padding-left: 20px; }
.bb .bb-list li { margin: 4px 0; }
.bb a { color: var(--accent); }

/* ---- Correio (caixa de 2 colunas) ---- */
.correio { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.correio-lista { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.correio-busca { padding: 12px; border-bottom: 1px solid var(--line); }
.correio-busca input {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; color: var(--text); font-size: 13px;
}
.correio-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.correio-tabs .ctab {
  font-size: 12px; padding: 5px 10px; border-radius: 999px; color: var(--muted); white-space: nowrap;
}
.correio-tabs .ctab:hover { background: var(--surface-2); color: var(--text); }
.correio-tabs .ctab.active { background: var(--accent); color: #1a1400; font-weight: 600; }
.correio-tabs .count {
  display: inline-block; min-width: 16px; text-align: center; background: var(--danger); color: #fff;
  border-radius: 999px; font-size: 10px; padding: 0 5px; margin-left: 4px;
}
.correio-itens { max-height: 70vh; overflow-y: auto; }
.cmail { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.cmail:hover { background: var(--surface-2); }
.cmail.active { background: var(--surface-3); border-left: 3px solid var(--accent); }
.cmail.novo .cmail-assunto { color: var(--text); font-weight: 700; }
.cmail.novo .cmail-de::before { content: "● "; color: var(--accent); font-size: 10px; }
.cmail-top { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.cmail-de { font-weight: 600; color: var(--text); }
.cmail-assunto { font-size: 13.5px; color: var(--muted); margin-bottom: 2px; }
.cmail-previa { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.correio-leitura { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-height: 60vh; }
.correio-vazio { text-align: center; padding: 70px 20px; color: var(--muted); }
.correio-vazio .cv-icone { font-size: 48px; opacity: .35; }
.correio-cabec { padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.correio-cabec h2 { margin: 0 0 12px; }
.correio-meta { display: flex; gap: 10px; align-items: center; }
.correio-meta .avatar { width: 38px; height: 38px; border-radius: 8px; }
.correio-acoes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.correio-acoes form { margin: 0; }
.correio-corpo { padding: 20px 22px; color: var(--text); }

/* ---- Compositor + toolbar BBCode ---- */
.bb-editor { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 8px; }
.bb-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.bb-toolbar .bbt {
  min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); border-radius: 6px; cursor: pointer; font-size: 13px;
}
.bb-toolbar .bbt:hover { background: var(--accent); color: #1a1400; border-color: var(--accent); }
.bb-toolbar .bb-sep { width: 1px; background: var(--line); margin: 0 4px; }
.bb-toolbar .bb-toggle-prev { margin-left: auto; font-size: 12px; }
.bb-editor textarea {
  width: 100%; border: none; background: var(--bg); color: var(--text); padding: 14px;
  font-size: 14px; line-height: 1.6; resize: vertical; font-family: inherit; box-sizing: border-box;
}
.bb-preview { min-height: 200px; background: var(--bg); }

/* ---- Feed ---- */
.feed-layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
.feed-compor { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
.feed-compor .avatar { width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0; }
.feed-compor-corpo { flex: 1; }
.feed-compor textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); padding: 10px 12px; font-size: 14px; resize: vertical; font-family: inherit; box-sizing: border-box;
}
.feed-post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.feed-post-cab { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.feed-post-cab .avatar { width: 40px; height: 40px; border-radius: 8px; }
.feed-post-quem b { display: block; }
.feed-post-texto { color: var(--text); line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.feed-post-texto .mencao { color: var(--accent); font-weight: 600; }
.feed-post-acoes { display: flex; gap: 8px; margin-top: 12px; }
.feed-btn {
  display: inline-flex; align-items: center; gap: 5px; background: var(--surface-2); border: 1px solid var(--line);
  color: var(--muted); border-radius: 999px; padding: 5px 14px; font-size: 13px; cursor: pointer;
}
.feed-btn:hover { border-color: var(--accent); color: var(--text); }
.feed-btn.curtido { color: #ff5b6e; border-color: #ff5b6e55; }
.feed-coments { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.feed-coments.aberto { display: block; }
.feed-coment { display: flex; gap: 8px; margin-bottom: 10px; }
.feed-coment .avatar { width: 28px; height: 28px; border-radius: 6px; }
.feed-coment-novo { display: flex; gap: 8px; margin-top: 8px; }
.feed-coment-novo input {
  flex: 1; background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; color: var(--text); font-size: 13px;
}
.rank-linha { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.rank-linha .avatar { width: 28px; height: 28px; border-radius: 6px; }
.rank-num { width: 20px; text-align: center; color: var(--accent); font-weight: 700; }

/* ---- Academia ---- */
.hero-emblema { font-size: 46px; width: 74px; text-align: center; }
.curso-card { display: block; transition: transform .12s, border-color .12s; }
.curso-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.curso-card h3 { margin: 0 0 10px; }
.curso-barra { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.curso-barra.grande { height: 12px; margin-top: 6px; }
.curso-barra span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #ffcf5c); border-radius: 999px; }
.aula-lista { display: flex; flex-direction: column; }
.aula-item { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--line-soft); }
.aula-item:hover { background: var(--surface-2); }
.aula-item:last-child { border-bottom: none; }
.aula-check { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 999px; background: var(--surface-3); color: var(--muted); flex-shrink: 0; font-size: 13px; }
.aula-item.feita .aula-check { background: var(--ok); color: #06210f; }
.aula-info { flex: 1; display: flex; flex-direction: column; }
.aula-info .muted { margin-top: 2px; }
.aula-item .chev { color: var(--muted); font-size: 18px; }
.aula-leitura .correio-corpo { padding: 8px 4px; }
.aula-rodape { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.aula-nav { display: flex; gap: 8px; }
.mat-lista { display: flex; flex-direction: column; gap: 6px; }
.mat-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mat-item a { color: var(--text); }
.mat-item a:hover { color: var(--accent); }
.admin-add summary, .admin-edit summary { list-style: none; }
.admin-add[open] summary { margin-bottom: 8px; }
.admin-add input, .admin-add textarea, .admin-add select {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; color: var(--text); margin-bottom: 6px; font-family: inherit; box-sizing: border-box;
}

/* ---- Badge de correio no topbar ---- */
.correio-icone { position: relative; }
.correio-badge {
  position: absolute; top: -4px; right: -4px; background: var(--danger); color: #fff;
  border-radius: 999px; font-size: 9px; min-width: 15px; height: 15px; padding: 0 4px;
  display: grid; place-items: center; font-weight: 700;
}

/* ---- Responsivo ---- */
@media (max-width: 860px), (pointer: coarse) and (max-width: 1080px) {
  .correio { grid-template-columns: 1fr; }
  .feed-layout { grid-template-columns: 1fr; }
  .feed-aside { display: none; }
}

/* ============================================================
   Chat estilo WhatsApp (v1.5) — individuais e grupos
   ============================================================ */
.chat-wrap {
  display: grid; grid-template-columns: 320px 1fr; gap: 0;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  height: calc(100vh - 150px); height: calc(100dvh - 150px);
  min-height: 460px; background: var(--surface);
}
/* min-height: 0 é obrigatório nos filhos do grid/flex: sem ele o conteúdo alto
   estica a coluna em vez de rolar dentro dela (o scroll do chat "não funciona"). */
.chat-lista { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-lista-topo { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.chat-lista-acoes { display: flex; gap: 6px; }
.chat-lista-acoes .btn { flex: 1; }
.chat-conversas { overflow-y: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
.chat-conv { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); align-items: center; }
.chat-conv:hover { background: var(--surface-2); }
.chat-conv.active { background: var(--surface-3); }
.chat-conv-av { flex-shrink: 0; }
.chat-conv-av .avatar { width: 40px; height: 40px; border-radius: 50%; }
.chat-grupo-ico { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft, #3a2f10); display: grid; place-items: center; font-size: 20px; }
.chat-conv-info { flex: 1; min-width: 0; }
.chat-conv-topo { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.chat-conv-topo b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-conv-hora { color: var(--muted); font-size: 10.5px; flex-shrink: 0; }
.chat-conv-previa { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Janela da conversa */
.chat-janela { display: flex; flex-direction: column; min-width: 0; min-height: 0; background:
  linear-gradient(var(--bg), var(--bg)); }
.chat-vazio { margin: auto; text-align: center; color: var(--muted); padding: 40px; }
.chat-vazio .cv-icone { font-size: 46px; opacity: .35; }
.chat-cabec { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-cabec .avatar { width: 38px; height: 38px; border-radius: 50%; }
.chat-cabec-info { min-width: 0; display: flex; flex-direction: column; }
.chat-cabec-info .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52ch; }
.chat-mensagens { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 4px; overscroll-behavior: contain; }
/* Badge de não lidas na lista de conversas */
.chat-conv-badge { background: var(--accent); color: #1a1400; font-size: 10.5px; font-weight: 800; border-radius: 999px; min-width: 18px; height: 18px; display: inline-grid; place-items: center; padding: 0 5px; flex-shrink: 0; }
.chat-conv.nao-lida .chat-conv-previa, .chat-conv.nao-lida .chat-conv-topo b { color: var(--text); font-weight: 700; }
.chat-inicio, .chat-fim { text-align: center; color: var(--muted); font-size: 12.5px; margin: 10px auto; background: var(--surface-2); padding: 6px 14px; border-radius: 999px; }
.chat-bolha-linha { display: flex; margin: 2px 0; }
.chat-bolha-linha.minha { justify-content: flex-end; }
.chat-bolha { max-width: 74%; padding: 8px 12px; border-radius: 12px; font-size: 14px; line-height: 1.45; word-break: break-word; }
.chat-bolha-linha.dele .chat-bolha { background: var(--surface-2); border-bottom-left-radius: 3px; }
.chat-bolha-linha.minha .chat-bolha { background: var(--accent); color: #1a1400; border-bottom-right-radius: 3px; }
.chat-autor { font-size: 11.5px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.chat-hora { font-size: 10px; opacity: .7; text-align: right; margin-top: 3px; }
.chat-enviar { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-enviar input { flex: 1; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; color: var(--text); font-size: 14px; }
.chat-enviar button { border-radius: 50%; width: 42px; height: 42px; padding: 0; font-size: 16px; }

/* Modais */
.chat-modal { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 22px; max-width: 460px; width: 92%; }
.chat-modal::backdrop { background: rgba(0,0,0,.6); }
.chat-modal h3 { margin: 0 0 4px; }
.chat-filtro-membros { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; color: var(--text); margin-bottom: 8px; box-sizing: border-box; }
.chat-membros { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.chat-membro { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.chat-membro:hover { background: var(--surface-2); }
.chat-membro .avatar { width: 28px; height: 28px; border-radius: 50%; }
.chat-membro input { width: auto; margin: 0; }

@media (max-width: 860px), (pointer: coarse) and (max-width: 1080px) {
  /* Altura real também no telemóvel: a conversa rola por dentro, como numa app,
     em vez de esticar a página. 56px topbar + ~76px do bottom-nav + margens. */
  .chat-wrap { grid-template-columns: 1fr; grid-template-rows: minmax(0, 34%) minmax(0, 1fr); height: calc(100vh - 150px); height: calc(100dvh - 150px); min-height: 320px; }
  .chat-lista { border-right: 0; border-bottom: 1px solid var(--line); }
}

/* ---- Avatar do topo clicável -> abre o perfil ---- */
a.account { color: inherit; text-decoration: none; cursor: pointer; border-radius: 10px; padding: 4px 6px; }
a.account:hover { background: var(--surface-2); }
a.account:hover .avatar { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ============================================================
   Proteção anti-print e marca de água (v1.8)
   ============================================================ */
/* Marca de água com o nick do utilizador — quase invisível no uso normal,
   mas presente em qualquer print/screenshot para identificar fugas */
.marca-agua {
  position: fixed; inset: 0; z-index: 2147483000;
  pointer-events: none; background-repeat: repeat;
}

/* Aviso quando alguém tenta Ctrl+P */
.aviso-protecao {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: var(--danger); color: #fff; font-size: 13.5px; font-weight: 600;
  padding: 11px 20px; border-radius: 999px; z-index: 2147483647;
  box-shadow: 0 8px 30px rgba(0,0,0,.5); animation: aviso-sobe .25s ease;
}
@keyframes aviso-sobe { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Impressão: esconde TODO o conteúdo e mostra só o aviso institucional */
@media print {
  body * { display: none !important; }
  body::after {
    content: "🛡 IMPRESSÃO BLOQUEADA — Sistema UECCO. As informações deste painel são de uso interno da corporação. A tentativa de impressão foi registada.";
    display: block !important; padding: 60px 40px; font-size: 20px; font-weight: 700;
    font-family: ui-monospace, Menlo, monospace; color: #000;
  }
}
/* Impressão forçada pelo menu do navegador: mesmo efeito via classe */
body.print-bloqueado .app, body.print-bloqueado .marca-agua { visibility: hidden !important; }

/* ============================================================
   Teste da aula (quiz) — v2.1
   ============================================================ */
.teste-aula .questao {
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px;
}
.teste-aula .questao legend { padding: 0 8px; font-size: 14.5px; }
.teste-aula .questao.certa { border-color: var(--ok); }
.teste-aula .questao.errada { border-color: var(--danger); }
.q-resultado { margin-left: 8px; font-size: 12px; font-weight: 700; }
.questao.certa .q-resultado { color: var(--ok); }
.questao.errada .q-resultado { color: var(--danger); }
.q-opcao {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  cursor: pointer; margin: 4px 0;
}
.q-opcao:hover { background: var(--surface-2); }
.q-opcao input { width: auto; margin: 0; accent-color: var(--accent); }
.q-letra {
  width: 24px; height: 24px; border-radius: 6px; background: var(--surface-3);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.q-opcao.q-correta { background: rgba(46,125,50,.14); }
.q-opcao.q-correta .q-letra { background: var(--ok); color: #06210f; }
.q-opcao.q-marcada-errada { background: rgba(184,31,38,.12); }
.q-opcao.q-marcada-errada .q-letra { background: var(--danger); color: #fff; }

/* ---- Aplicar aula no jogo (instrutores) ---- */
.aplicar-jogo .aj-questao {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap;
}
.aplicar-jogo .aj-questao:last-of-type { border-bottom: none; }
.aj-texto { flex: 1; min-width: 220px; font-size: 13.5px; }
.aj-botoes { display: flex; gap: 6px; flex-shrink: 0; }
.aj-rodape { display: flex; gap: 8px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.aj-gabarito {
  font-family: ui-monospace, Menlo, monospace; font-size: 12px;
  background: var(--bg); border: 1px dashed var(--line); border-radius: 8px;
  padding: 6px 12px; color: var(--accent);
}

/* ---- Documentos bloqueados (acesso por mérito) ---- */
.doc-requisitos { display: flex; flex-direction: column; gap: 8px; max-width: 420px; margin: 0 auto; text-align: left; }
.doc-req {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 14px;
}
.doc-req.ok { border-color: var(--ok); color: var(--text); }
.doc-req.ok span { color: var(--ok); }

/* Botão de trocar setor com aspeto de aba */
.tab-btn { cursor: pointer; border: 1px solid var(--line); background: var(--surface-2); font: inherit; }
.tab-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   TEMA PIXEL HABBO (v3.3) - camada visual por cima do tema UECCO
   Fontes pixel nos títulos, bordas duras, sombras rígidas 8-bit.
   O corpo do texto continua legível (DM Sans).
   ============================================================ */

/* Títulos e marca em fonte pixel */
.pagehead h1, .hero h2, .brand span, .panel-head > span:first-child,
.metric, .chat-lista-topo b, .correio-cabec h2, .side-label {
  font-family: 'Silkscreen', ui-monospace, monospace;
  letter-spacing: .5px;
  font-weight: 400;
}
.pagehead h1 { font-size: 22px; }
.metric { font-size: 22px; }
.side-label { font-size: 9px; }

/* Avatares e imagens do Habbo sempre em pixel nítido */
.avatar, .brandlogo, img[src*="habbo-imaging"] {
  image-rendering: pixelated;
}

/* Janelas estilo diálogo do Habbo: borda dura + sombra rígida deslocada */
.panel, .card, .hero, .chat-wrap, .correio-lista, .correio-leitura, .feed-post, .feed-compor {
  border-radius: 6px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .45);
}
.panel-head {
  border-bottom: 2px solid var(--line);
}

/* Botões 8-bit: sombra rígida que "afunda" ao clicar */
.btn {
  border-radius: 4px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .5);
  transition: transform .05s, box-shadow .05s;
}
.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 rgba(0, 0, 0, .5);
}
.btn.primary { border: 2px solid #7a5502; }

/* Chips e badges com contorno pixel */
.chip, .badge, .tab {
  border-radius: 4px;
}
.chip { box-shadow: 2px 2px 0 rgba(0, 0, 0, .4); }

/* Bolhas do chat estilo balão de fala do Habbo */
.chat-bolha {
  border-radius: 8px;
  border: 2px solid rgba(0, 0, 0, .5);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .35);
  position: relative;
}
.chat-bolha-linha.dele .chat-bolha { border-color: var(--line); }
.chat-bolha-linha.minha .chat-bolha { border-color: #7a5502; }

/* Cards de curso/tutorial: salto pixel no hover */
.curso-card { transition: transform .08s, box-shadow .08s; }
.curso-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, .5);
  border-color: var(--accent);
}

/* Topo: marca UECCO em pixel com brilho dourado */
.brand span {
  font-size: 15px;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, .6);
}

/* Relógios do topo em fonte pixel */
.clock b { font-family: 'Silkscreen', ui-monospace, monospace; font-size: 11px; }

/* Barras de progresso segmentadas (efeito 8-bit) */
.curso-barra span {
  background-image: repeating-linear-gradient(90deg,
    var(--accent) 0 8px, #c98f04 8px 10px);
  border-radius: 0;
}
.curso-barra { border-radius: 0; border: 1px solid rgba(0,0,0,.4); }

/* Aviso de proteção e flashes com borda pixel */
.flash { border-radius: 4px; box-shadow: 2px 2px 0 rgba(0,0,0,.4); border-width: 2px; }

/* ============================================================
   TEMA PIXEL - COBERTURA TOTAL (v3.4)
   Estende o visual 8-bit a cada componente do painel.
   ============================================================ */

/* Fundo com trama pixel subtil (quase invisível, dá textura de jogo) */
body {
  background-image:
    linear-gradient(45deg, rgba(255,255,255,.012) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.012) 75%),
    linear-gradient(45deg, rgba(255,255,255,.012) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.012) 75%);
  background-size: 12px 12px;
  background-position: 0 0, 6px 6px;
}

/* Seleção de texto dourada */
::selection { background: var(--accent); color: #1a1400; }

/* Foco por teclado com contorno pixel */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 2px; }

/* Formulários: campos com borda dura */
input[type="text"], input[type="password"], input[type="email"],
input[type="number"], input[type="url"], select, textarea {
  border-width: 2px !important;
  border-radius: 4px !important;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .35);
}

/* Tabelas: cabeçalho em fonte pixel */
.table thead th {
  font-family: 'Silkscreen', ui-monospace, monospace;
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: .5px;
  text-transform: uppercase;
  border-bottom: 2px solid var(--line);
}
.table tbody tr:hover { background: var(--surface-2); }

/* Topbar: barra com borda dura e busca pixel */
.topbar { border-bottom: 2px solid var(--line); }
.search input { border-width: 2px; border-radius: 6px; }
.iconbtn { border-radius: 4px; box-shadow: 2px 2px 0 rgba(0, 0, 0, .35); }
.iconbtn:active { transform: translate(1px, 1px); box-shadow: none; }

/* Sidebar: marcador ativo em bloco pixel, pontos quadrados */
.side-dot { border-radius: 1px; }
.side-link.active { border-left: 3px solid var(--accent); }
.sidebar { border-right: 2px solid var(--line); }

/* Modais (chat) como janelas de diálogo do Habbo */
.chat-modal {
  border: 2px solid var(--accent);
  border-radius: 6px;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, .55);
}
.chat-modal h3 {
  font-family: 'Silkscreen', ui-monospace, monospace;
  font-weight: 400;
  font-size: 13px;
  background: var(--accent);
  color: #1a1400;
  margin: -22px -22px 12px;
  padding: 10px 16px;
  border-radius: 4px 4px 0 0;
}

/* Login / cadastro: janela pixel de boas-vindas */
.auth-title, .auth-wrap h1 {
  font-family: 'Silkscreen', ui-monospace, monospace;
  font-weight: 400;
  letter-spacing: 1px;
}
.auth-wrap .panel, .auth-wrap .card, .auth-box {
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .5);
}

/* Footer com risca dupla pixel */
.site-footer { border-top: 2px solid var(--line); }

/* Abas com bloco ativo pixel */
.tab { border-width: 2px; }
.tab.active { box-shadow: 2px 2px 0 rgba(0, 0, 0, .4); }

/* Quiz: perguntas como cartões pixel, letras quadradas */
.teste-aula .questao { border-width: 2px; border-radius: 6px; box-shadow: 2px 2px 0 rgba(0, 0, 0, .3); }
.q-letra { border-radius: 2px; font-family: 'Silkscreen', ui-monospace, monospace; font-size: 9px; }
.aula-check { border-radius: 3px; }

/* Correio: caixa com contornos duros */
.correio-tabs .ctab.active { box-shadow: 2px 2px 0 rgba(0, 0, 0, .4); border-radius: 4px; }
.cmail.active { border-left-width: 3px; }
.bb-toolbar .bbt { box-shadow: 1px 1px 0 rgba(0, 0, 0, .4); }
.bb-toolbar .bbt:active { transform: translate(1px, 1px); box-shadow: none; }

/* Loja: preço em pixel */
.loja-preco, .card .metric { font-family: 'Silkscreen', ui-monospace, monospace; }

/* Contadores (badges numéricos) quadrados */
.count { border-radius: 3px; font-family: 'Silkscreen', ui-monospace, monospace; font-size: 8px; }
.correio-badge { border-radius: 3px; font-family: 'Silkscreen', ui-monospace, monospace; }

/* Scrollbar pixel (WebKit) */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border: 2px solid var(--bg);
  border-radius: 0;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Drawer mobile com borda pixel */
@media (max-width: 900px), (pointer: coarse) and (max-width: 1080px) {
  .sidebar { border-right: 2px solid var(--accent); }
}

/* Hero com moldura */
.hero { border: 2px solid var(--line); }

/* Registro copiável e gabaritos em pixel */
.registro-copy code, .aj-gabarito { border-width: 2px; border-radius: 4px; }

/* ============================================================
   ACABAMENTO PIXEL (v3.4.1) - correções dos 6 revisores de design
   ============================================================ */

/* Login/cadastro: o cartão real chama-se .auth-card */
.auth-card {
  border: 2px solid var(--line);
  border-radius: 6px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .5);
}
.auth-card h2 { font-family: 'Silkscreen', ui-monospace, monospace; font-weight: 400; font-size: 14px; }
.greeting h1 { font-family: 'Silkscreen', ui-monospace, monospace; font-weight: 400; font-size: 20px; }

/* Cards do dashboard e afins que ficaram com sombra suave */
.id-card, .cta-card, .news-card, .promo-card, .member, .admin-menu {
  border-radius: 6px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .45);
}
.news-card:hover, .cta-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, .5);
}

/* Modal de busca de militar igual ao modal pixel do chat */
.member-modal {
  border: 2px solid var(--accent) !important;
  border-radius: 6px !important;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, .55) !important;
}

/* Badges nunca herdam a fonte pixel (ilegível em tamanho pequeno) */
.badge { font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif; }

/* Classe .sm usada nos textos auxiliares (nunca existiu no CSS) */
.sm { font-size: 12px; }
.badge.sm { font-size: 10px; }

/* Campos read-only (.input/.select/.textarea como divs) iguais aos inputs pixel */
.input, .select, .textarea {
  border-width: 2px !important;
  border-radius: 4px !important;
}

/* <code> nu com visual de etiqueta pixel */
.pagehead code, .panel-body code, .table code {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 6px;
  color: var(--accent);
  font-size: 12px;
}

/* Fórum: balões antigos alinhados com os do chat */
.bubble {
  border: 2px solid var(--line);
  border-radius: 8px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .35);
}

/* Botões do feed (curtir/comentar) quadrados com sombra que afunda */
.feed-btn {
  border-radius: 4px;
  border-width: 2px;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .4);
}
.feed-btn:active { transform: translate(1px, 1px); box-shadow: none; }

/* Imagens de itens da loja em pixel nítido */
.placeholder { border-radius: 4px; }
.placeholder img, .grid3 .card .placeholder img { image-rendering: pixelated; }

/* .btn.primary: vencer a sombra suave do styles.css (especificidade) */
.btn.primary, .btn.primary:hover {
  box-shadow: 2px 2px 0 rgba(0, 0, 0, .5) !important;
}
.btn.primary:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0) !important;
}

/* Cards-link: salto pixel também no hover herdado do styles.css */
a.card:hover {
  transform: translate(-2px, -2px) !important;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, .5) !important;
}

/* Página de documentos bloqueados */
.doc-bloqueado h2 { font-family: 'Silkscreen', ui-monospace, monospace; font-weight: 400; font-size: 15px; }
.doc-req { border-radius: 6px; border-width: 2px; }

/* Métricas com estilo inline de 18px (nomes longos) voltam a DM Sans */
.card .metric[style*="font-size:18px"], .card .metric[style*="font-size: 18px"] {
  font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
}

/* Títulos de nível (estrutura/hierarquia) em pixel */
.tier-title { font-family: 'Silkscreen', ui-monospace, monospace; font-weight: 400; }

/* Composer reutilizado dentro de painéis sem a borda de rodapé do chat */
.panel-body > .composer { border-top: none; padding-left: 0; padding-right: 0; }

/* ============================================================
   v3.6.0 - Melhorias de organização e gamificação
   ============================================================ */

/* Sino de pendências no topbar */
.sino { position: relative; }
.sino summary { list-style: none; cursor: pointer; position: relative; }
.sino summary::-webkit-details-marker { display: none; }
.sino-drop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  width: 300px; max-height: 380px; overflow-y: auto;
  background: var(--surface); border: 2px solid var(--line);
  border-radius: 8px; box-shadow: 3px 3px 0 rgba(0,0,0,.35);
}
.sino-titulo {
  font-family: 'Silkscreen', ui-monospace, monospace; font-size: 11px;
  padding: 8px 12px; background: var(--accent); color: #1c1c1c;
}
.sino-vazio { padding: 16px 12px; color: var(--muted); font-size: 13px; text-align: center; }
.sino-item {
  display: flex; gap: 10px; align-items: center; padding: 10px 12px;
  border-top: 1px solid var(--line); color: var(--text); font-size: 13px;
}
.sino-item:hover { background: var(--surface-2); text-decoration: none; }

/* Pesquisa global com sugestões */
.search { position: relative; }
.busca-sugestoes {
  display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60;
  background: var(--surface); border: 2px solid var(--line); border-radius: 8px;
  box-shadow: 3px 3px 0 rgba(0,0,0,.35); max-height: 420px; overflow-y: auto;
}
.busca-sugestoes.aberta { display: block; }
.busca-grupo {
  font-family: 'Silkscreen', ui-monospace, monospace; font-size: 9px;
  color: var(--muted); padding: 8px 12px 2px; text-transform: uppercase;
}
.busca-item { display: block; padding: 7px 12px; color: var(--text); font-size: 13px; }
.busca-item b { display: block; }
.busca-item span { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.busca-item:hover { background: var(--surface-2); text-decoration: none; }

/* Barra inferior mobile */
.barra-mobile { display: none; }
@media (max-width: 767px) {
  .so-desktop { display: none !important; }
  .barra-mobile {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    background: var(--surface); border-top: 2px solid var(--line);
    box-shadow: 0 -3px 0 rgba(0,0,0,.25);
    padding: 4px 0 max(4px, env(safe-area-inset-bottom));
  }
  .barra-mobile a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
    color: var(--muted); font-size: 10px; font-family: 'Silkscreen', ui-monospace, monospace;
    position: relative; padding: 4px 0;
  }
  .barra-mobile a span { font-size: 17px; font-family: initial; }
  .barra-mobile a.ativa { color: var(--accent); }
  .barra-mobile .pontinho {
    position: absolute; top: 2px; right: calc(50% - 14px);
    width: 8px; height: 8px; border-radius: 50%; background: #d02a2a;
  }
  .main { padding-bottom: 72px; }
  .site-footer { margin-bottom: 56px; }
}

/* Barras de progresso (Academia, dashboard) */
.progresso-barra {
  height: 14px; background: var(--bg); border: 2px solid var(--line);
  border-radius: 4px; overflow: hidden;
}
.progresso-cheio {
  height: 100%; background: var(--accent);
  background-image: repeating-linear-gradient(45deg, rgba(0,0,0,.12) 0 6px, transparent 6px 12px);
}

/* Checklist de integração do recruta */
.checklist { display: flex; flex-direction: column; gap: 6px; }
.check-item {
  display: flex; gap: 10px; align-items: center; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 6px; color: var(--text); font-size: 13px;
}
.check-item:hover { border-color: var(--accent); text-decoration: none; }
.check-item.feito { opacity: .55; text-decoration: line-through; }
.check-marca { font-family: 'Silkscreen', ui-monospace, monospace; color: var(--accent); }

/* Gráficos de barras em CSS puro (estatísticas) */
.grafico-barras { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 18px; }
.grafico-barras.alto { height: 160px; }
.gb-coluna { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.gb-valor { font-size: 11px; color: var(--muted); margin-bottom: 2px; font-family: 'Silkscreen', ui-monospace, monospace; }
.gb-barra {
  width: 70%; min-height: 3px; background: var(--accent);
  border: 1px solid rgba(0,0,0,.3); box-shadow: 2px 2px 0 rgba(0,0,0,.25);
  image-rendering: pixelated;
}
.gb-rotulo { font-size: 10px; color: var(--muted); margin-top: 4px; white-space: nowrap; }

/* Mini-ficha nas filas do admin */
.mini-ficha { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 11px; color: var(--muted); }
.mini-ficha .mini-alerta { color: #e05555; }

/* Filas e linhas destacadas */
.linha-nova { outline: 2px solid var(--accent); outline-offset: -2px; }
.lista-toolbar { margin-bottom: 12px; }
.filtros-lista { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Turma de instrução: grelha de presenças */
.turma-presencas {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 6px; margin-top: 8px; max-height: 240px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 6px; padding: 8px;
}
.turma-membro { display: flex; gap: 6px; align-items: center; font-size: 13px; cursor: pointer; }
.turma-membro input { width: auto; }

/* Feed: posts do sistema e em destaque */
.feed-post.post-sistema { border-color: var(--accent); }
.feed-post.post-destacado { position: relative; border-color: var(--accent); box-shadow: 3px 3px 0 rgba(234,165,6,.35); }
.post-fita {
  font-family: 'Silkscreen', ui-monospace, monospace; font-size: 10px;
  color: #1c1c1c; background: var(--accent); display: inline-block;
  padding: 2px 8px; border-radius: 4px; margin-bottom: 8px;
}

/* Diploma da Academia */
.diploma-moldura { display: flex; justify-content: center; padding: 8px; }
.diploma {
  max-width: 640px; width: 100%; text-align: center;
  background: var(--surface); border: 4px double var(--accent); border-radius: 6px;
  box-shadow: 6px 6px 0 rgba(0,0,0,.35); padding: 34px 30px; position: relative;
}
.diploma-brasao { width: 64px; image-rendering: pixelated; margin-bottom: 8px; }
.diploma-topo { font-family: 'Silkscreen', ui-monospace, monospace; font-size: 11px; color: var(--muted); }
.diploma-sub { font-family: 'Silkscreen', ui-monospace, monospace; font-size: 13px; color: var(--accent); margin: 6px 0 18px; }
.diploma-corpo { font-size: 14px; color: var(--text); line-height: 1.7; }
.diploma-nome { font-family: 'Silkscreen', ui-monospace, monospace; font-size: 22px; color: var(--accent); margin: 10px 0 2px; }
.diploma-patente { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.diploma-curso { font-family: 'Silkscreen', ui-monospace, monospace; font-size: 15px; margin-top: 10px; }
.diploma-rodape {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--muted);
}
.diploma-serie { font-family: ui-monospace, Menlo, monospace; color: var(--accent); }

/* Dossiê */
.dossie { border-color: #8a5cd6; }
.dossie .panel-head { background: linear-gradient(0deg, rgba(138,92,214,.12), rgba(138,92,214,.12)); }
/* ============================================================
   v3.7.4 - Credencial de identificação (estilo crachá militar RCC)
   Cartão verde-militar texturado com estrelas, clip metálico,
   foto em fundo claro, tiras douradas e brancas, impressão digital.
   ============================================================ */
.idc { position: relative; padding-top: 14px; }
/* clip metálico do crachá */
.idc-clip {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 34px; height: 26px; z-index: 2;
  background: linear-gradient(180deg, #b9bec4, #8a9096 60%, #6f757b);
  border: 2px solid #3a3f45;
  border-radius: 5px 5px 3px 3px;
  box-shadow: 2px 2px 0 rgba(0,0,0,.45);
}
.idc-clip span {
  display: block; width: 16px; height: 6px; margin: 6px auto 0;
  background: #2b2f34; border-radius: 3px;
  box-shadow: inset 1px 1px 0 rgba(0,0,0,.6);
}
.idc-cartao {
  position: relative;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='22'%3E%3Ctext x='4' y='15' font-size='11' fill='%233b452f'%3E%E2%98%85%3C/text%3E%3C/svg%3E") 0 0 / 36px 22px,
    linear-gradient(180deg, #4b553d, #414a35);
  border: 3px solid #262d1e;
  border-radius: 10px;
  box-shadow: 4px 4px 0 rgba(0,0,0,.5), inset 0 0 0 2px rgba(255,255,255,.06);
  overflow: hidden;
  image-rendering: pixelated;
}
.idc-topo {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px 6px;
}
.idc-linha1 {
  font-family: 'Silkscreen', ui-monospace, monospace;
  font-size: 11px; color: #f2f2ea; line-height: 1.1;
  text-shadow: 2px 2px 0 rgba(0,0,0,.6);
}
.idc-linha2 {
  font-family: 'Silkscreen', ui-monospace, monospace;
  font-size: 10px; color: var(--accent); line-height: 1.2; margin-top: 2px;
  text-shadow: 2px 2px 0 rgba(0,0,0,.65);
}
.idc-brasao { width: 38px; height: 38px; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(2px 2px 0 rgba(0,0,0,.5)); }
.idc-corpo { display: flex; gap: 8px; padding: 4px 12px 8px; align-items: stretch; }
/* foto tipo passe: fundo claro de estúdio */
.idc-foto-wrap {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #dde0d6 0%, #cdd1c4 70%, #bfc4b4 100%);
  border: 2px solid #262d1e;
  border-radius: 4px;
  width: 108px; overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.18);
}
.idc-foto {
  display: block;
  width: 96px; height: auto;         /* 64px nativos ampliados em pixel nítido */
  image-rendering: pixelated;
  /* Figura centrada na moldura; o PNG do Habbo traz margem transparente em
     baixo, por isso sobe-se um pouco para o boneco ficar oticamente ao centro */
  transform: translateY(-10px);
}
.idc-dados { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.idc-tira {
  border: 2px solid #262d1e; border-radius: 4px;
  padding: 3px 7px;
  font-size: 11.5px; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.idc-tira b { font-weight: 800; }
.idc-tira.ouro { background: var(--accent); color: #1c1c1c; box-shadow: inset 0 -2px 0 rgba(0,0,0,.18); }
.idc-tira.branca { background: #e9e9e0; color: #23261f; box-shadow: inset 0 -2px 0 rgba(0,0,0,.1); }
.idc-titulo-tira {
  font-family: 'Silkscreen', ui-monospace, monospace;
  font-size: 10px; letter-spacing: 1px; text-align: center;
}
.idc-registo-tira {
  display: flex; align-items: center; gap: 6px;
  font-family: ui-monospace, Menlo, monospace; font-size: 10px; font-weight: 700;
}
.idc-registo-tira span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.idc-copiar {
  flex: 0 0 auto; cursor: pointer;
  background: #1c1c1c; color: var(--accent);
  border: none; border-radius: 3px;
  font-size: 11px; line-height: 1; padding: 2px 5px;
}
.idc-copiar:hover { background: #333; }
.idc-rodape {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 12px 10px;
}
/* impressão digital em pixel (SVG embutido) */
.idc-digital {
  width: 32px; height: 32px; display: inline-block;
  background:
    url('data:image/svg+xml,%3Csvg%20fill%3D%22%231d2019%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M17.81%204.47c-.08%200-.16-.02-.23-.06C15.66%203.42%2014%203%2012.01%203c-1.98%200-3.86.47-5.57%201.41-.24.13-.54.04-.68-.2a.506.506%200%200%201%20.2-.68C7.82%202.52%209.86%202%2012.01%202c2.13%200%203.99.47%206.03%201.52.25.13.34.43.21.67a.49.49%200%200%201-.44.28zM3.5%209.72a.499.499%200%200%201-.41-.79c.99-1.4%202.25-2.5%203.75-3.27C9.98%204.04%2014%204.03%2017.15%205.65c1.5.77%202.76%201.86%203.75%203.25a.5.5%200%200%201-.12.7c-.23.16-.54.11-.7-.12a9.388%209.388%200%200%200-3.39-2.94c-2.87-1.47-6.54-1.47-9.4.01-1.36.7-2.5%201.7-3.4%202.96-.08.14-.23.21-.39.21zm6.25%2012.07a.47.47%200%200%201-.35-.15c-.87-.87-1.34-1.43-2.01-2.64-.69-1.23-1.05-2.73-1.05-4.34%200-2.97%202.54-5.39%205.66-5.39s5.66%202.42%205.66%205.39c0%20.28-.22.5-.5.5s-.5-.22-.5-.5c0-2.42-2.09-4.39-4.66-4.39-2.57%200-4.66%201.97-4.66%204.39%200%201.44.32%202.77.93%203.85.64%201.15%201.08%201.64%201.85%202.42.19.2.19.51%200%20.71-.11.1-.24.15-.37.15zm7.17-1.85c-1.19%200-2.24-.3-3.1-.89-1.49-1.01-2.38-2.65-2.38-4.39%200-.28.22-.5.5-.5s.5.22.5.5c0%201.41.72%202.74%201.94%203.56.71.48%201.54.71%202.54.71.24%200%20.64-.03%201.04-.1.27-.05.53.13.58.41.05.27-.13.53-.41.58-.57.11-1.07.12-1.21.12zM14.91%2022c-.04%200-.09-.01-.13-.02-1.59-.44-2.63-1.03-3.72-2.1a7.297%207.297%200%200%201-2.17-5.22c0-1.62%201.38-2.94%203.08-2.94%201.7%200%203.08%201.32%203.08%202.94%200%201.07.93%201.94%202.08%201.94s2.08-.87%202.08-1.94c0-3.77-3.25-6.83-7.25-6.83-2.84%200-5.44%201.58-6.61%204.03-.39.81-.59%201.76-.59%202.8%200%20.78.07%202.01.67%203.61.1.26-.03.55-.29.64-.26.1-.55-.04-.64-.29a11.14%2011.14%200%200%201-.73-3.96c0-1.2.23-2.29.68-3.24%201.33-2.79%204.28-4.6%207.51-4.6%204.55%200%208.25%203.51%208.25%207.83%200%201.62-1.38%202.94-3.08%202.94s-3.08-1.32-3.08-2.94c0-1.07-.93-1.94-2.08-1.94s-2.08.87-2.08%201.94c0%201.71.66%203.31%201.87%204.51.95.94%201.86%201.46%203.27%201.85.27.07.42.35.35.61-.05.23-.26.38-.47.38z%22%2F%3E%3C%2Fsvg%3E') center / 26px 26px no-repeat,
    #eceee4;
  border: 2px solid #262d1e; border-radius: 4px;
}
.idc-status {
  font-family: 'Silkscreen', ui-monospace, monospace;
  font-size: 9px; letter-spacing: 1px;
  padding: 3px 8px; border-radius: 3px;
  border: 2px solid #262d1e;
}
.idc-status.ok { background: #38c463; color: #10240f; }
.idc-status.off { background: #e05555; color: #2b0d0d; }

/* ============================================================
   v3.7.5 - Painel inicial: Online agora, atividade estilo RCC,
   faixa de data com avatar a acenar
   ============================================================ */
.data-strip {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin-top: 12px; padding: 0 14px;
  background: var(--surface);
  border: 2px solid var(--line); border-radius: 8px;
  box-shadow: 3px 3px 0 rgba(0,0,0,.4);
  min-height: 44px;
}
.data-strip-texto { font-size: 13px; color: var(--muted); padding: 12px 0; }
.data-strip-texto b { color: var(--text); font-family: 'Silkscreen', ui-monospace, monospace; font-size: 13px; }
.data-strip-avatar {
  height: 86px; margin-top: -34px;
  image-rendering: pixelated;
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,.4));
}

/* Grelha "Online agora" (2 colunas com separadores, como o painel de referência) */
.online-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
}
.online-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.online-item:nth-child(odd) { border-right: 1px solid var(--line); }
.online-item:nth-last-child(1), .online-item:nth-last-child(2):nth-child(odd) { border-bottom: none; }
.online-item span { overflow: hidden; text-overflow: ellipsis; }

/* Atividade recente estilo RCC: seta verde de promoção */
.ativ-seta {
  color: #38c463;
  background: rgba(56,196,99,.12);
  border: 1px solid rgba(56,196,99,.4);
  border-radius: 5px;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; flex: 0 0 auto;
}
.ativ-promo .quando { font-size: 11px; }

/* ---- Afinações mobile v3.7.5 (verificação em ecrã 375px) ---- */
@media (max-width: 767px) {
  /* o dropdown do sino ocupava 300px ancorado à direita e saía do ecrã:
     em mobile passa a faixa fixa a toda a largura, por baixo do topbar */
  .sino-drop {
    position: fixed;
    left: 8px; right: 8px; top: 64px;
    width: auto;
    max-height: 60vh;
  }
  /* avatar da faixa de data mais discreto (deixava de sobrepor os atalhos) */
  .data-strip-avatar { height: 60px; margin-top: -14px; }
  /* título de boas-vindas não parte o nick a meio */
  .greeting h1 { font-size: 16px; }
}

/* ============================================================
   v3.7.7 - Barra de pesquisa melhorada + sugestões com avatares
   ============================================================ */
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  transition: border-color .12s;
}
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 2px 2px 0 rgba(234,165,6,.25);
}
.busca-lupa { color: var(--muted); font-size: 15px; flex: 0 0 auto; }
.search:focus-within .busca-lupa { color: var(--accent); }
.search input {
  flex: 1; background: transparent !important;
  border: none !important; box-shadow: none !important;
  padding: 9px 0 !important; min-width: 0;
}
.search input:focus { outline: none !important; }
.busca-atalho {
  flex: 0 0 auto;
  font-family: 'Silkscreen', ui-monospace, monospace;
  font-size: 10px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 2px 7px; background: var(--surface);
}

/* Itens de sugestão com avatar/ícone à esquerda */
.busca-item { display: flex; align-items: center; gap: 10px; }
.busca-avatar {
  width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 6px; background: var(--surface-2);
  border: 1px solid var(--line);
  image-rendering: pixelated; object-fit: cover;
}
.busca-icone {
  width: 34px; height: 34px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px;
  background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 6px;
}
.busca-textos { flex: 1; min-width: 0; }
.busca-textos b, .busca-textos span { display: block; }
.busca-item.ativa, .busca-item:hover { background: var(--surface-2); }
.busca-item.ativa { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }

/* Correio em conversa: mensagens do fio empilhadas cronologicamente */
.conversa { display: flex; flex-direction: column; gap: 12px; }
.conv-msg {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface);
}
.conv-msg.minha { border-left: 3px solid var(--accent); }
.conv-msg.atual { border-color: var(--accent); box-shadow: 3px 3px 0 rgba(0,0,0,.35); }
.conv-msg .correio-meta { margin-bottom: 10px; }
.conv-msg .correio-corpo { padding: 0; }
@media (max-width: 767px) {
  /* sugestões da pesquisa a toda a largura em mobile (o input é estreito) */
  .busca-sugestoes {
    position: fixed;
    left: 8px; right: 8px; top: 64px;
    max-height: 65vh;
  }
}

/* ============================================================
   v3.8.1 - Ícones no menu lateral + promovidos de corpo inteiro
   ============================================================ */
.side-ico {
  display: inline-block; width: 22px; text-align: center;
  font-size: 14px; margin-right: 8px; flex: 0 0 auto;
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,.5));
}

/* Últimos Promovidos: fila horizontal de cartões com avatar de corpo inteiro */
.promo-fila {
  display: flex; gap: 12px;
  overflow-x: auto; padding: 4px 2px 10px;
  scrollbar-width: thin;
}
.promo-full {
  flex: 0 0 148px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(234,165,6,.08), transparent 60%),
    url('/images/uecco-badge.png') no-repeat center 26px / 84px,
    var(--surface-2);
  border: 2px solid var(--line);
  border-radius: 8px;
  box-shadow: 3px 3px 0 rgba(0,0,0,.4);
  padding: 12px 8px;
  position: relative;
  overflow: hidden;
}
.promo-full::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,22,26,.55), rgba(20,22,26,.15) 40%, rgba(20,22,26,.75));
  pointer-events: none;
}
.promo-full > * { position: relative; }
.promo-full-avatar {
  height: 132px; width: auto;
  image-rendering: pixelated;
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,.45));
}
.promo-full-nick {
  font-family: 'Silkscreen', ui-monospace, monospace;
  font-size: 10px; color: var(--text);
  margin-top: 6px; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.promo-full-texto { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.promo-full-texto .para { color: var(--accent); }

/* ============================================================
   v3.9.0 - Desenhos do painel de referência: fonte Volter,
   caderno de espiral (checklist do aluno), post-its de dicas
   e quadro de giz na legislação
   ============================================================ */

/* Fonte pixel Volter: nítida apenas em múltiplos de 9px (9/18/27) */
.vt {
  font-family: 'Volter', 'Silkscreen', ui-monospace, monospace;
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: none;
  font-smooth: never;
  letter-spacing: 0;
}
/* negrito pixel: a Volter não tem bold - duplica o traço com sombra dura */
.vt-bold { text-shadow: 1px 0 0 currentColor; }

/* ---------------- Caderno de espiral (checklist do aluno) ---------------- */
.caderno {
  background: #17181c;
  border: 2px solid #000;
  border-radius: 14px;
  padding: 8px 10px 12px;
  box-shadow: 4px 4px 0 rgba(0,0,0,.45);
}
/* argolas da espiral: barras metálicas repetidas */
.caderno-espiral {
  height: 22px;
  margin: 2px 6px -4px;
  background: repeating-linear-gradient(90deg,
    transparent 0 7px,
    #82888f 7px 10px, #c9ced3 10px 13px, #82888f 13px 16px,
    transparent 16px 26px);
  border-radius: 6px 6px 0 0;
  position: relative;
  z-index: 2;
}
.caderno-papel {
  background:
    /* furos por baixo de cada argola */
    radial-gradient(circle 4px at 13px 9px, #17181c 4px, transparent 5px) 0 0 / 26px 100vh no-repeat space,
    #ecebe3;
  background-repeat: repeat-x, no-repeat;
  background-size: 26px 22px, auto;
  color: #33322b;
  border-radius: 6px;
  padding: 26px 20px 18px;
}
.caderno-titulo { font-size: 18px; margin-bottom: 10px; }
.caderno-intro { margin: 0 0 12px; }
.caderno-progresso { color: #8a7f4e; }
.caderno-linha { border: none; border-top: 2px solid #d8d5c8; margin: 12px 0; }
.caderno-modulo { color: #4a4438; margin: 14px 0 6px; }
.caderno-item {
  display: flex; gap: 10px; align-items: flex-start;
  color: #33322b; padding: 5px 0;
}
.caderno-item:hover { color: #000; text-decoration: none; }
.caderno-item:hover .caderno-cx { border-color: #000; }
.caderno-cx {
  flex: 0 0 auto;
  width: 16px; height: 16px; margin-top: 3px;
  border: 2px solid #55503f;
  background: #f6f5ee;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; color: #2e7d32;
}
.caderno-cx.feita { background: #dff0dc; border-color: #2e7d32; }

/* ---------------- Post-its de dicas de estudo ---------------- */
.postit-grelha {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.postit {
  position: relative;
  background: linear-gradient(180deg, #f6ad0a 0, #f6ad0a 46px, #ffd94b 46px);
  border: 2px solid #17130a;
  color: #2a2018;
  padding: 12px 14px 16px;
  box-shadow: 5px 5px 0 rgba(0,0,0,.4);
}
/* clip de papel agarrado à borda direita */
.postit-clip {
  position: absolute; right: -14px; top: 44%;
  width: 26px; height: 13px;
  border: 3px solid #aeb4ba;
  border-radius: 7px;
  box-shadow: inset 0 0 0 2px #5d646b, 2px 2px 0 rgba(0,0,0,.35);
  background: transparent;
}
.postit-titulo { font-size: 18px; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.postit-icone {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border: 2px solid #2a2018; border-radius: 4px;
  font-size: 13px; text-shadow: none;
}
.postit-texto { margin: 0; }

/* ---------------- Quadro de giz (legislação) ---------------- */
.quadro {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.05), transparent 55%),
    repeating-linear-gradient(115deg, rgba(255,255,255,.022) 0 3px, transparent 3px 9px),
    #44603c;
  border: 10px solid #6d5a33;
  outline: 3px solid #191b1f;
  box-shadow:
    inset 0 0 0 3px #2c2517,
    inset 0 0 46px rgba(0,0,0,.4),
    5px 5px 0 rgba(0,0,0,.45);
  border-radius: 6px;
  padding: 20px 24px 30px;
  position: relative;
}
.quadro-titulo {
  display: flex; align-items: center; gap: 12px;
  color: #f3f6ee;
  font-size: 18px;
  margin-bottom: 16px;
}
.quadro-titulo img { width: 34px; height: 34px; image-rendering: pixelated; filter: drop-shadow(1px 1px 0 rgba(0,0,0,.5)); }
.quadro-corpo {
  font-family: 'Ubuntu Condensed', 'DM Sans', sans-serif;
  font-size: 15.5px; line-height: 1.75;
  color: #e4ecdd;
}
/* tabuleiro do giz no fundo da moldura */
.quadro-tabuleiro {
  position: absolute; left: 12px; right: 12px; bottom: -6px;
  height: 8px;
  background: linear-gradient(180deg, #7d6a41, #59492a);
  border: 2px solid #2c2517;
  border-radius: 2px;
}
.quadro-giz {
  position: absolute; right: 26px; top: -5px;
  width: 22px; height: 5px;
  background: #eaa506;
  border: 1px solid rgba(0,0,0,.45);
  border-radius: 2px;
}
@media (max-width: 767px) {
  .quadro { padding: 14px 12px 24px; border-width: 8px; }
}

/* ============================================================
   v3.9.2 - Escala adaptada: ecrãs grandes e portáteis pequenos
   ============================================================ */

/* Escala consoante o ecrã, SEM ampliar os elementos (nada de zoom):
   o layout centra-se e aproveita a largura real do ecrã. Em ecrãs largos
   e ultrawide usa quase toda a largura (min(Nvw, teto)) para não deixar um
   bloco pequeno com faixas pretas enormes dos lados; as grelhas internas
   quebram em mais colunas para o conteúdo encher sem esticar cada item. */
@media (min-width: 1400px) {
  .layout { width: min(95vw, 1800px); margin-left: auto; margin-right: auto; }
}
@media (min-width: 1750px) {
  .layout { width: min(95vw, 2200px); }
  .home-grid { grid-template-columns: 1fr 380px; gap: 22px; }
  .main { padding: 26px 40px 60px; }
}
/* Ecrãs muito largos / ultrawide: enche o ecrã de verdade */
@media (min-width: 2200px) {
  .layout { width: min(94vw, 3000px); }
  .home-grid { grid-template-columns: 1fr 440px; gap: 26px; }
  .main { padding: 28px 52px 60px; }
  /* cartões e notícias aproveitam a largura extra com mais colunas */
  .cards { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .news-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .grid3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}
@media (min-width: 3000px) {
  .layout { width: min(92vw, 3600px); }
  .home-grid { grid-template-columns: 1fr 520px; }
}

/* Portáteis pequenos (13" / ecrãs 1280x720): tudo mais compacto
   para caber sem apertos - menu mais estreito e menos respiro */
@media (min-width: 768px) and (max-width: 1240px) {
  .sidebar { width: 200px; }
  .main { padding: 16px 16px 48px; }
  .home-grid { gap: 12px; }
  .cards { gap: 10px; }
  .promo-full { flex-basis: 132px; }
  .promo-full-avatar { height: 118px; }
}

/* Colunas da grelha do início nunca forçam a página a alargar:
   a fila dos promovidos (scroll horizontal) fica contida na sua coluna */
.home-grid > * { min-width: 0; }
.promo-fila, .news-grid, .table-wrap { max-width: 100%; }

/* Chips de escalão hierárquico na Listagem do efetivo */
.escalao-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.escalao-chip {
  font-size: 12.5px; padding: 6px 12px;
  border: 2px solid var(--line); border-radius: 6px;
  background: var(--surface-2); color: var(--muted);
}
.escalao-chip:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
.escalao-chip.ativo { background: var(--accent); color: #1c1c1c; border-color: var(--accent); font-weight: 700; }

/* ===== BBCode UECCO v2 - elementos do catálogo oficial ===== */
.bb .bb-h1 { font-size: 22px; font-weight: 800; margin: 18px 0 8px; color: var(--text); }
.bb .bb-h2 { font-size: 18px; font-weight: 700; margin: 16px 0 6px; color: var(--text); }
.bb .bb-h3 { font-size: 15.5px; font-weight: 700; margin: 14px 0 4px; color: var(--text); }
.bb .bb-indent { margin-left: 22px; }
.bb .bb-p { margin: 8px 0; }
.bb .bb-quote-autor { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.bb .bb-code { background: #14161a; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-family: ui-monospace, monospace; font-size: 12.5px; overflow-x: auto; white-space: pre; margin: 8px 0; }
.bb .bb-code-rotulo { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 8px 0 2px; }
.bb .bb-spoiler { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; background: var(--surface-2); }
.bb .bb-spoiler summary { cursor: pointer; padding: 8px 12px; font-weight: 600; color: var(--accent); }
.bb .bb-spoiler-corpo { padding: 4px 12px 10px; }
.bb .bb-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.bb .bb-table th, .bb .bb-table td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; font-size: 13px; }
.bb .bb-table th { background: var(--surface-2); color: var(--accent); font-weight: 700; }
.bb .bb-img { max-width: 100%; height: auto; border-radius: 8px; display: inline-block; }
.bb .bb-img-invalida { color: var(--muted); font-size: 12px; font-style: italic; }
.bb .bb-video { position: relative; width: 100%; max-width: 720px; aspect-ratio: 16/9; margin: 10px 0; }
.bb .bb-video iframe { width: 100%; height: 100%; border: 0; border-radius: 10px; }
.bb .bb-media { width: 100%; max-width: 720px; margin: 8px 0; border-radius: 8px; }
.bb .bb-documento { background: #f4f4ee; color: #23261e; border-radius: 10px; padding: 22px 26px; margin: 8px 0; border: 1px solid #cfd2c2; }
.bb .bb-documento .bb-topico, .bb .bb-documento .bb-h1, .bb .bb-documento .bb-h2, .bb .bb-documento .bb-h3 { color: #1d2530; }
.bb .bb-logo { display: block; margin: 4px auto 10px; width: 64px; image-rendering: pixelated; }
.bb .bb-topico { font-weight: 800; color: #00bfd8; text-transform: uppercase; letter-spacing: .04em; margin: 16px 0 6px; font-size: 15px; }
.bb .bb-aviso { border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; padding: 10px 12px; margin: 8px 0; }
.bb .bb-aprovados { border-left: 3px solid #1ea84a; background: rgba(30,168,74,.12); color: inherit; border-radius: 0 8px 8px 0; padding: 10px 12px; margin: 8px 0; }
.bb .bb-reprovados { border-left: 3px solid #d93025; background: rgba(217,48,37,.12); border-radius: 0 8px 8px 0; padding: 10px 12px; margin: 8px 0; }
.bb .bb-assinatura { margin-top: 18px; padding-top: 10px; border-top: 1px dashed var(--line); font-style: italic; color: var(--muted); }
.bb .bb-botao { margin: 6px 4px 6px 0; }
.bb sup, .bb sub { font-size: 11px; }
/* Editor BBCode: pré-visualização e ajuda */
.bb-previa { border: 1px dashed var(--line); border-radius: 10px; padding: 14px 16px; margin-top: 10px; background: var(--surface); }
.bb-ajuda code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.bb-ajuda li { margin: 3px 0; }
