:root {
  --navy: #0f1f3d; --navy2: #182c52; --acento: #f26a21; --acento-esc: #d4560f; --fundo: #f3f5f9; --cartao: #fff;
  --texto: #1b2433; --suave: #64708a; --borda: #e2e7ef; --verde: #15803d; --vermelho: #c62828; --amarelo: #b7791f; --azul: #1d4ed8;
  --raio: 10px; --sombra: 0 1px 2px rgba(15, 31, 61, .06), 0 4px 14px rgba(15, 31, 61, .05);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body, #app { margin: 0; height: 100%; }
body { font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; color: var(--texto); background: var(--fundo); }
h1 { font-size: 22px; margin: 0; } h2 { font-size: 16px; margin: 0 0 10px; } h3 { font-size: 14px; margin: 0 0 6px; }
a { color: var(--azul); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.suave { color: var(--suave); } .pequeno { font-size: 12px; } .direita { text-align: right; } .centro { text-align: center; }
.num { font-variant-numeric: tabular-nums; }

/* ----- botões e campos ----- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--borda); background: #fff; padding: 7px 13px; border-radius: 8px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { background: #f6f8fb; }
.btn.pri { background: var(--acento); border-color: var(--acento); color: #fff; } .btn.pri:hover { background: var(--acento-esc); }
.btn.perigo { color: var(--vermelho); } .btn.mini { padding: 3px 9px; font-size: 12px; } .btn:disabled { opacity: .55; cursor: default; }
.btn.ok { background: var(--verde); border-color: var(--verde); color: #fff; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=email], input[type=tel], select, textarea {
  width: 100%; border: 1px solid #cfd6e2; border-radius: 8px; padding: 8px 10px; background: #fff; min-height: 36px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid rgba(242, 106, 33, .45); outline-offset: 1px; border-color: var(--acento); }
textarea { resize: vertical; }

/* ----- acesso ----- */
.acesso { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(135deg, var(--navy) 0%, #1b3a73 60%, #23498f 100%); }
.acesso-cx { width: 100%; max-width: 400px; background: #fff; border-radius: 16px; padding: 34px 30px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.marca { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.3px; }
.marca i { width: 34px; height: 34px; border-radius: 9px; background: var(--acento); color: #fff; display: grid; place-items: center; font-style: normal; font-size: 18px; }
.acesso-cx p { color: var(--suave); margin: 8px 0 20px; }
.acesso-cx .campo { margin-bottom: 14px; } .acesso-cx .btn { width: 100%; justify-content: center; padding: 10px; margin-top: 6px; }
.erro-form { color: var(--vermelho); font-size: 13px; min-height: 18px; margin-top: 8px; }

/* ----- estrutura ----- */
.casca { display: grid; grid-template-columns: 232px 1fr; height: 100%; }
.lateral { background: var(--navy); color: #c9d3e6; display: flex; flex-direction: column; overflow-y: auto; }
.lateral .marca { color: #fff; padding: 18px 18px 14px; }
.menu { padding: 4px 10px; flex: 1; }
.menu a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: inherit; margin-bottom: 2px; font-weight: 500; }
.menu a:hover { background: var(--navy2); text-decoration: none; color: #fff; }
.menu a.ativo { background: var(--acento); color: #fff; }
.menu svg { width: 18px; height: 18px; flex: none; }
.menu .selo { margin-left: auto; }
.menu-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: #7f8db0; padding: 14px 10px 6px; }
.lateral-pe { padding: 12px 14px; border-top: 1px solid #22355f; font-size: 12px; }
.principal { display: flex; flex-direction: column; min-width: 0; height: 100%; overflow: hidden; }
.topo { display: flex; align-items: center; gap: 12px; padding: 10px 22px; background: #fff; border-bottom: 1px solid var(--borda); min-height: 56px; }
.topo h1 { flex: 1; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-menu { display: none; border: 0; background: none; cursor: pointer; padding: 6px; }
.btn-menu svg { width: 22px; height: 22px; display: block; }
.conteudo { flex: 1; overflow: auto; padding: 20px 22px 40px; }
.usuario-topo { display: flex; align-items: center; gap: 8px; cursor: pointer; border: 0; background: none; padding: 4px 6px; border-radius: 8px; }
.usuario-topo:hover { background: var(--fundo); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--navy2); color: #fff; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.avatar.p { width: 22px; height: 22px; font-size: 10px; }
.sino { position: relative; border: 0; background: none; cursor: pointer; padding: 6px; border-radius: 8px; } .sino:hover { background: var(--fundo); }
.sino svg { width: 20px; height: 20px; display: block; }
.selo { background: var(--vermelho); color: #fff; border-radius: 10px; font-size: 11px; font-weight: 700; padding: 0 6px; min-width: 18px; text-align: center; line-height: 18px; display: inline-block; }
.sino .selo { position: absolute; top: -2px; right: -4px; }
.suspenso { position: absolute; right: 16px; top: 54px; width: 340px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--borda); border-radius: 12px; box-shadow: 0 12px 40px rgba(15, 31, 61, .18); z-index: 900; max-height: 70vh; overflow: auto; }
.suspenso .item { padding: 10px 14px; border-bottom: 1px solid var(--borda); display: block; color: inherit; cursor: pointer; }
.suspenso .item:hover { background: var(--fundo); text-decoration: none; } .suspenso .item.nova { background: #fff7f1; }

/* ----- componentes ----- */
.barra { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.barra > input, .barra > select { width: auto; min-width: 140px; max-width: 220px; flex: 0 1 auto; }
.barra .espaco { flex: 1; }
.cartao { background: var(--cartao); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra); padding: 16px; }
.grade { display: grid; gap: 14px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.mt { margin-top: 16px; }
.kpi { display: flex; flex-direction: column; gap: 2px; } .kpi b { font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; } .kpi span { color: var(--suave); font-size: 12px; }
.proj { border-top: 4px solid var(--cor, var(--acento)); cursor: pointer; display: flex; flex-direction: column; gap: 10px; color: inherit; }
.proj:hover { transform: translateY(-1px); text-decoration: none; box-shadow: 0 6px 22px rgba(15, 31, 61, .12); }
.proj .nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.proj .rod { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--suave); }
.etq { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; background: #eef1f6; color: #475069; white-space: nowrap; }
.etq.verde { background: #dcfce7; color: #166534; } .etq.vermelho { background: #fee2e2; color: #991b1b; } .etq.amarelo { background: #fef3c7; color: #92400e; }
.etq.azul { background: #dbeafe; color: #1e40af; } .etq.roxo { background: #ede9fe; color: #5b21b6; } .etq.laranja { background: #ffedd5; color: #9a3412; }
.ponto { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--cor, #999); margin-right: 5px; }
.vazio { text-align: center; color: var(--suave); padding: 26px 10px; }
.progresso { height: 7px; background: #e8ecf3; border-radius: 6px; overflow: hidden; } .progresso i { display: block; height: 100%; background: var(--cor, var(--acento)); }
.abas { display: flex; gap: 4px; border-bottom: 1px solid var(--borda); margin-bottom: 16px; overflow-x: auto; }
.abas button { border: 0; background: none; padding: 9px 14px; cursor: pointer; font-weight: 600; color: var(--suave); border-bottom: 2px solid transparent; white-space: nowrap; }
.abas button.ativo { color: var(--acento-esc); border-color: var(--acento); }
.lista .linha { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--borda); } .lista .linha:last-child { border: 0; }
.lista .linha > .cresce { flex: 1; min-width: 0; } .clicavel { cursor: pointer; }
.corta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

table.tb { width: 100%; border-collapse: collapse; }
.tb th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--suave); padding: 8px 10px; border-bottom: 1px solid var(--borda); white-space: nowrap; background: #fafbfd; position: sticky; top: 0; }
.tb td { padding: 9px 10px; border-bottom: 1px solid var(--borda); vertical-align: middle; }
.tb tbody tr:hover { background: #f8fafc; } .tb tr.clicavel td { cursor: pointer; }
.rolagem { overflow: auto; } .cartao.sem-pad { padding: 0; overflow: hidden; }

/* ----- quadro kanban ----- */
.quadro { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding-bottom: 10px; }
.coluna { flex: 1 0 250px; max-width: 330px; background: #e9edf4; border-radius: var(--raio); padding: 10px; min-height: 140px; }
.coluna.sobre { outline: 2px dashed var(--acento); }
.coluna > header { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 13px; margin-bottom: 8px; padding: 0 2px; }
.cartaok { background: #fff; border-radius: 8px; padding: 10px 11px; margin-bottom: 8px; box-shadow: 0 1px 2px rgba(15, 31, 61, .1); cursor: pointer; border-left: 3px solid var(--cor, transparent); }
.cartaok:hover { box-shadow: 0 3px 10px rgba(15, 31, 61, .15); } .cartaok.arrastando { opacity: .4; }
.cartaok .tit { font-weight: 600; margin-bottom: 6px; word-break: break-word; }
.cartaok .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--suave); }
.cartaok .acoes { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ----- janelas ----- */
.fundo-modal { position: fixed; inset: 0; background: rgba(15, 31, 61, .5); display: grid; place-items: start center; padding: 5vh 14px; overflow: auto; z-index: 1000; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 640px; box-shadow: 0 24px 70px rgba(0, 0, 0, .3); }
.modal.larga { max-width: 860px; } .modal.estreita { max-width: 420px; }
.modal > header { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--borda); } .modal > header h2 { flex: 1; margin: 0; }
.modal .corpo { padding: 18px 20px; } .modal > footer, .modal form > footer { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--borda); justify-content: flex-end; }
.fechar { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--suave); padding: 2px 8px; border-radius: 6px; } .fechar:hover { background: var(--fundo); }
.campos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; } .campo.toda { grid-column: 1 / -1; }
.campo label { display: block; font-size: 12px; font-weight: 600; color: #475069; margin-bottom: 4px; }
.campo small { color: var(--suave); font-size: 11px; }
.multi { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 10px; max-height: 180px; overflow: auto; border: 1px solid #cfd6e2; border-radius: 8px; padding: 8px 10px; }
.multi label, .campo label.marca-cx { font-weight: 400; font-size: 13px; display: flex; gap: 6px; align-items: center; margin: 0; color: var(--texto); }
#avisos { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 2000; max-width: min(380px, calc(100vw - 36px)); }
.aviso { background: var(--navy); color: #fff; padding: 11px 15px; border-radius: 10px; box-shadow: 0 8px 26px rgba(0, 0, 0, .25); }
.aviso.erro { background: var(--vermelho); } .aviso.ok { background: var(--verde); }

/* ----- agenda ----- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--borda); border-left: 1px solid var(--borda); }
.cal .dsem { padding: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--suave); border-right: 1px solid var(--borda); border-bottom: 1px solid var(--borda); background: #fafbfd; text-align: center; }
.cal .dia { min-height: 96px; padding: 4px; border-right: 1px solid var(--borda); border-bottom: 1px solid var(--borda); cursor: pointer; overflow: hidden; }
.cal .dia:hover { background: #fafbfd; } .cal .dia.fora { background: #f6f7fa; color: #a3acbf; } .cal .dia.hoje .n { background: var(--acento); color: #fff; }
.cal .n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 600; }
.cal .ev { display: block; font-size: 11px; background: #dbeafe; color: #1e3a8a; border-radius: 4px; padding: 1px 5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--cor, var(--azul)); }

/* ----- bate-papo ----- */
.chat { display: grid; grid-template-columns: 270px 1fr; height: calc(100vh - 56px - 60px); min-height: 380px; padding: 0; overflow: hidden; }
.chat-lista { border-right: 1px solid var(--borda); overflow: auto; }
.chat-lista h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--suave); padding: 12px 14px 4px; margin: 0; display: flex; justify-content: space-between; align-items: center; }
.chat-item { display: flex; gap: 8px; align-items: center; padding: 8px 14px; cursor: pointer; } .chat-item:hover { background: var(--fundo); } .chat-item.ativo { background: #fff3ea; }
.chat-item .cresce { flex: 1; min-width: 0; } .on { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; flex: none; } .on.off { background: #cbd5e1; }
.chat-conv { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-topo { padding: 12px 16px; border-bottom: 1px solid var(--borda); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.chat-msgs { flex: 1; overflow: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; background: #f8fafc; }
.msg { max-width: min(560px, 82%); background: #fff; border: 1px solid var(--borda); border-radius: 12px; padding: 7px 11px; align-self: flex-start; white-space: pre-wrap; word-break: break-word; }
.msg.minha { align-self: flex-end; background: #ffe9db; border-color: #fbd1b5; } .msg b { display: block; font-size: 12px; color: var(--acento-esc); } .msg time { font-size: 10px; color: var(--suave); float: right; margin: 6px 0 0 10px; }
.chat-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--borda); } .chat-form textarea { resize: none; height: 40px; }

/* ----- mapas e eleições ----- */
.mapa { height: 430px; border-radius: var(--raio); z-index: 1; }
.elei { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 14px; align-items: start; }
.elei .mapa { height: 600px; }
.filtros-elei { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; margin-bottom: 14px; }
.filtros-elei .campo.dupla { grid-column: span 2; }
.legenda { background: #fff; padding: 8px 10px; border-radius: 8px; box-shadow: 0 1px 6px rgba(0, 0, 0, .3); font-size: 12px; line-height: 1.7; }
.legenda i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.barra-voto { display: grid; grid-template-columns: minmax(0, 1fr) 70px; gap: 2px 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--borda); }
.barra-voto .progresso { grid-column: 1 / -1; height: 5px; }
.destaque-linha { background: #fff3ea; }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr 1fr; } .elei { grid-template-columns: 1fr; } .elei .mapa { height: 460px; } }
@media (max-width: 900px) {
  .casca { grid-template-columns: 1fr; }
  .lateral { position: fixed; inset: 0 auto 0 0; width: 240px; z-index: 950; transform: translateX(-100%); transition: transform .2s; }
  .casca.menu-aberto .lateral { transform: none; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .4); }
  .btn-menu { display: block; }
  .conteudo { padding: 14px 12px 40px; } .topo { padding: 8px 12px; }
  .g2, .g3 { grid-template-columns: 1fr; } .campos { grid-template-columns: 1fr; }
  .usuario-topo .nome { display: none; }
  .chat { grid-template-columns: 1fr; height: auto; } .chat-lista { max-height: 230px; border-right: 0; border-bottom: 1px solid var(--borda); } .chat-conv { height: 60vh; }
  .cal .dia { min-height: 64px; } .filtros-elei .campo.dupla { grid-column: auto; }
}
@media (max-width: 560px) { .g4 { grid-template-columns: 1fr 1fr; } .barra > input, .barra > select { max-width: none; flex: 1 1 140px; } }
