:root {
  --azul: #2f5597;
  --borda: #8c8c8c;
  --fundo: #f5f5f5;
  --texto-ui: #242424;
}
body.tema-escuro { --fundo: #1f1f1f; --texto-ui: #e6e6e6; }

* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 12px 16px 24px;
  background: var(--fundo);
  color: var(--texto-ui);
  font-family: Calibri, "Segoe UI", Arial, sans-serif;
}
.hidden { display: none !important; }

.toolbar { text-align: center; }
.btn { padding: 6px 12px; border: 1px solid #c8c8c8; border-radius: 4px; background: #fff; color: #242424; font: inherit; cursor: pointer; }
.btn.primary { background: #5b5fc7; border-color: #5b5fc7; color: #fff; }
.status { text-align: center; padding: 24px; }

/* "Planilha" igual à imagem */
.planilha { max-width: 1100px; margin: 0 auto; background: #fff; color: #000; border: 1px solid var(--borda); font-size: 14px; }
.titulo { background: var(--azul); color: #fff; font-weight: bold; text-align: center; padding: 3px; font-size: 15px; }
.colunas { display: grid; grid-template-columns: 1fr 1fr; }
.colunas table { width: 100%; border-collapse: collapse; table-layout: fixed; }
#colEsq { border-right: 1px solid var(--borda); }
.c-setor { width: 44%; } .c-nome { width: 40%; } .c-ramal { width: 16%; }
td { border-bottom: 1px solid #d0d0d0; padding: 1px 4px; height: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td.nome, td.ramal { text-align: center; }
td.ramal { border-left: 1px solid #d0d0d0; }
td.setor { border-right: 1px solid #d0d0d0; }
tr.negrito td.setor, tr.negrito td.ramal { font-weight: bold; }
tr.vermelho td.setor, tr.vermelho td.ramal { font-weight: bold; color: #e00000; }
.rodape { border-top: 1px solid var(--borda); text-align: center; padding: 3px; font-size: 13px; }

/* Edição direto nas células (só para quem tem permissão) */
td[contenteditable] { cursor: text; outline: none; }
td[contenteditable]:hover { background: #f0f3fb; }
td[contenteditable]:focus { background: #fffbe6; box-shadow: inset 0 0 0 2px #5b5fc7; text-overflow: clip; }
td.salvando { background: #fff4ce !important; }
td.salvo { background: #dff6dd !important; transition: background .2s; }
.dica { max-width: 1100px; margin: 6px auto 0; font-size: 12px; opacity: .65; text-align: center; }

.menu { position: fixed; z-index: 10; min-width: 200px; padding: 4px; background: #fff; color: #242424; border: 1px solid #c8c8c8; border-radius: 6px; box-shadow: 0 4px 16px rgba(0, 0, 0, .18); font-size: 13px; }
.menu button { display: block; width: 100%; padding: 6px 10px; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; border-radius: 4px; }
.menu button:hover { background: #f0f0f0; }
.menu hr { border: 0; border-top: 1px solid #e6e6e6; margin: 4px 0; }
.menu .perigo, .menu .vermelho { color: #c4314b; }

@media (max-width: 820px) {
  .colunas { grid-template-columns: 1fr; }
  #colEsq { border-right: 0; }
}
