/* Casca do sistema único, no MESMO padrão visual do Painel MSE / Painel STI: cabeçalho branco com logo, botões de canto
   assimétrico, seletor de obra escuro, faixa de abas numeradas em cartão e fundo cinza-claro. */
:root {
  --ink: #192231; --body: #4d5868; --mut: #66758a; --mut2: #768397; --line: #e4e7ec; --blue: #2563eb; --green: #4caf7f; --amber: #d4941e; --red: #c94444;
  --bg: #f0f2f6; --card: #fff; --radius: 14px; --teal: #233f44; --borda-cab: #c3c9c6;
  font-family: 'IBM Plex Sans', Inter, 'Segoe UI', Arial, sans-serif; color: var(--ink); background: var(--bg); font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; display: flex; flex-direction: column; background: var(--bg); -webkit-font-smoothing: antialiased; font-size: 14px; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #dfe3e8; border-radius: 8px; }
.mono { font-family: 'IBM Plex Mono', monospace; }

/* ---- Cabeçalho ---- */
.topbar { position: relative; flex: 0 0 auto; min-height: 86px; padding: 14px 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: #fff; border-bottom: 1px solid #dcded7; z-index: 5; }
.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.brand-logo { height: 34px; width: auto; display: block; flex: 0 0 auto; object-fit: contain; }
.brand-divider { width: 1px; height: 34px; background: var(--borda-cab); flex: 0 0 auto; }
.brand strong { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; color: #172b3a; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.portal-link, .obra-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; background: transparent; border: 1px solid var(--borda-cab); color: var(--teal);
  border-radius: 3px 14px 3px 14px; text-decoration: none; font-weight: 600; transition: background .18s ease, border-color .18s ease; }
.portal-link { padding: 8px 14px; font-size: 12.5px; }
.portal-link:hover { background: #e9ece5; border-color: var(--teal); }
.obra-selector { position: relative; flex-shrink: 0; }
.obra-btn { padding: 6px 16px; gap: 12px; background: var(--teal); border-color: var(--teal); color: #fff; }
.obra-btn:hover { background: #1c3337; border-color: #1c3337; }
.obra-label { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; text-align: left; }
.obra-label small { font: 500 .62rem 'IBM Plex Mono', monospace; letter-spacing: .12em; color: rgba(255, 255, 255, .6); }
.obra-label strong { font-size: .88rem; font-weight: 600; color: #fff; }
.obra-caret { font-size: .7rem; color: rgba(255, 255, 255, .75); }
.obra-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 260px; max-height: 70vh; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(21, 35, 55, .22); padding: 6px; z-index: 20; }
.obra-opcao { all: unset; box-sizing: border-box; display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; cursor: pointer; padding: 9px 12px; border-radius: 8px; font-size: .85rem; color: var(--ink); transition: background .15s ease; }
.obra-opcao:hover, .obra-opcao:focus-visible { background: #eef0f3; }
.obra-opcao.ativa { background: rgba(37, 99, 235, .08); font-weight: 600; }
.obra-opcao small { color: var(--mut); font: 500 .68rem 'IBM Plex Mono', monospace; }
.obra-opcao em { font-style: normal; font-size: .68rem; color: var(--amber); margin-left: 6px; }

/* ---- Faixa de telas (abas numeradas em cartão, como no painel) ---- */
.telas { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 14px 32px 0; }
.nav-arrow { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--body); font-size: 16px; flex-shrink: 0; display: grid; place-items: center; text-decoration: none; transition: background .18s ease, color .18s ease; }
.nav-arrow:hover { background: #e4e7ec; color: var(--ink); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 4px rgba(25, 34, 49, .025), 0 8px 24px rgba(25, 34, 49, .025); }
.tabs-scroll { display: flex; flex: 1; min-width: 0; padding: 4px; gap: 4px; overflow-x: auto; scrollbar-width: thin; }
.tab-btn { display: flex; align-items: center; gap: 8px; flex: 1 0 auto; min-width: 0; min-height: 44px; padding: 8px 12px; border-radius: 8px; border: 0; background: transparent; color: var(--body); text-decoration: none;
  transition: background .18s ease, color .18s ease; }
.tab-btn:not(.ativo):hover { background: #f0f4fa; }
.tab-btn.ativo { background: var(--blue); color: #fff; box-shadow: 0 3px 8px rgba(37, 99, 235, .2); }
.tab-num { width: 18px; height: 18px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font: 500 11px 'IBM Plex Mono', monospace; background: #eef0f3; color: var(--mut); flex-shrink: 0; }
.tab-btn.ativo .tab-num { background: rgba(255, 255, 255, .25); color: #fff; }
.tab-titulo { font-size: 13px; font-weight: 600; white-space: nowrap; line-height: 1.25; }
.tab-btn i { font-style: normal; opacity: .7; }

/* ---- Vista ---- */
.vista { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 16px 32px 24px; overflow: auto; }
.vista:has(> .quadro-cheio), .vista:has(> .ltv) { padding: 0; overflow: hidden; margin-top: 14px; }
.quadro { flex: 1 1 auto; width: 100%; min-height: 0; border: 0; background: transparent; }
.carregando { color: var(--mut); }
.cartao { max-width: 640px; margin: 24px auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; box-shadow: 0 2px 4px rgba(25, 34, 49, .025), 0 8px 24px rgba(25, 34, 49, .025); }
.cartao h2 { margin: 0 0 10px; font-size: 1.25rem; }
.cartao p { color: var(--body); line-height: 1.6; margin: 8px 0; }
.botao { display: inline-block; padding: 9px 18px; border-radius: 10px; background: var(--blue); color: #fff; font-weight: 600; text-decoration: none; }
.botao:hover { background: #1d4fc4; }
.aviso { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #172d46; color: #fff; padding: 11px 18px; border-radius: 8px; font-size: .85rem; z-index: 30; }

@media (max-width: 768px) {
  .topbar { flex-wrap: wrap; padding: 12px 14px; gap: 14px; min-height: 0; }
  .brand-logo { height: 28px; }
  .brand strong { font-size: 17px; }
  .top-actions { width: 100%; flex-wrap: wrap; }
  .top-actions .portal-link { flex: 1; }
  .obra-selector { flex-basis: 100%; }
  .obra-btn { width: 100%; justify-content: space-between; }
  .telas, .vista { padding-left: 12px; padding-right: 12px; }
  .tab-btn { flex: 0 0 auto; min-width: 120px; }
}

/* ---- Configurações (acessos) ---- */
.cfg-fundo { position: fixed; inset: 0; z-index: 40; background: rgba(25, 34, 49, .45); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; }
.cfg-janela { width: 100%; max-width: 940px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 18px 48px rgba(25, 34, 49, .25); }
.cfg-janela header { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.cfg-janela h2 { margin: 0; font-size: 1.15rem; }
.cfg-x { border: 0; background: transparent; font-size: 26px; line-height: 1; color: var(--mut); padding: 2px 8px; border-radius: 8px; }
.cfg-x:hover { background: #eef0f4; color: var(--ink); }
.cfg-corpo { padding: 18px 22px 24px; }
.cfg-intro { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cfg-intro p { margin: 0; color: var(--body); }
.cfg-btn { border: 1px solid var(--borda-cab); background: #fff; color: var(--teal); border-radius: 10px; padding: 9px 16px; font-weight: 600; font-size: 13px; }
.cfg-btn:hover { background: #e9ece5; border-color: var(--teal); }
.cfg-btn.primario { background: var(--teal); border-color: var(--teal); color: #fff; }
.cfg-btn.primario:hover { background: #1c3337; }
.cfg-btn.pequeno { padding: 5px 12px; font-size: 12px; }
.cfg-btn:disabled { opacity: .6; cursor: default; }
.cfg-busca, .cfg-campo input, .cfg-campo select { width: 100%; border: 1px solid #cfd5dd; border-radius: 9px; padding: 9px 12px; font: inherit; background: #fff; color: var(--ink); }
.cfg-busca { margin: 14px 0 10px; max-width: 360px; }
.cfg-scroll { overflow-x: auto; }
.cfg-tabela { width: 100%; border-collapse: collapse; font-size: 13px; }
.cfg-tabela th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.cfg-tabela td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cfg-email { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; overflow-wrap: anywhere; min-width: 230px; }
.cfg-email small { margin-left: 8px; color: var(--blue); font-family: inherit; font-weight: 600; }
.cfg-chip { display: inline-block; margin: 2px 6px 2px 0; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: #eef0f4; color: var(--body); }
.cfg-chip.cfg-editor { background: #fdf3df; color: #8a5d0a; }
.cfg-chip.cfg-admin { background: #e2efe9; color: #1f5c46; }
.cfg-vazio { color: var(--mut); font-size: 13px; }
.cfg-ok { margin: 12px 0 0; padding: 9px 12px; border-radius: 9px; background: #e2efe9; color: #1f5c46; font-size: 13px; }
.cfg-erro { margin: 10px 0 0; padding: 9px 12px; border-radius: 9px; background: #fbe8e8; color: #9c2b2b; font-size: 13px; }
.cfg-form { margin-top: 14px; display: grid; gap: 14px; }
.cfg-form h3 { margin: 0; font-size: 1rem; }
.cfg-campo { display: grid; gap: 5px; font-size: 12.5px; color: var(--body); }
.cfg-campo span { font-weight: 600; }
.cfg-bloco { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 10px; }
.cfg-ajuda { margin: 0; color: var(--mut); font-size: 12.5px; }
.cfg-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 14px; }
.cfg-niveis { margin: 0; padding-left: 18px; color: var(--mut); font-size: 12.5px; line-height: 1.5; }
.cfg-botoes { display: flex; justify-content: flex-end; gap: 10px; }
@media (max-width: 640px) {
  .cfg-fundo { padding: 0; } .cfg-janela { border-radius: 0; min-height: 100%; }
  .cfg-tabela thead { display: none; } .cfg-tabela, .cfg-tabela tbody, .cfg-tabela tr, .cfg-tabela td { display: block; width: 100%; }
  .cfg-tabela tr { border-bottom: 1px solid var(--line); padding: 8px 0; } .cfg-tabela td { border: 0; padding: 3px 4px; min-width: 0; }
}
