/* Grade no jeito do Excel: fundo branco, linhas de grade, letras das colunas e números das linhas.
   Fica clara mesmo no tema escuro, para a Amanda reconhecer a planilha dela. */
.xl-wrap {
  --xl-grade: #d4d4d4;
  --xl-cab: #f3f3f3;
  --xl-cab-borda: #c6c6c6;
  --xl-sel: #217346;
  --xl-sel-fundo: #e6f2ea;
  --xl-titulo: #002060;
  background: #fff;
  color: #000;
  border: 1px solid var(--xl-cab-borda);
  border-radius: 10px;
  overflow: hidden;
  font-family: Calibri, 'Segoe UI', Carlito, Arial, sans-serif;
  font-size: 13px;
}
.xl-barra {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--xl-cab-borda);
  background: #fff;
  height: 30px;
}
.xl-ref {
  width: 84px;
  padding: 0 8px;
  border-right: 1px solid var(--xl-cab-borda);
  height: 100%;
  display: flex;
  align-items: center;
  color: #333;
}
.xl-fx {
  font-style: italic;
  font-family: Cambria, Georgia, serif;
  color: #666;
  padding: 0 10px;
  border-right: 1px solid var(--xl-cab-borda);
  height: 100%;
  display: flex;
  align-items: center;
}
.xl-form {
  flex: 1;
  padding: 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #000;
}
input.xl-form {
  border: 0;
  outline: 0;
  height: 100%;
  font: inherit;
  background: #fff;
}
.xl-tipo {
  border: 0;
  border-left: 1px solid var(--xl-cab-borda);
  height: 100%;
  font: inherit;
  background: #fff;
  color: #000;
  padding: 0 6px;
}
.xl-rolo {
  overflow: auto;
  max-height: calc(100vh - 260px);
}
#xl-rolo { min-height: 240px; }
table.xl {
  border-collapse: separate;
  border-spacing: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
table.xl th,
table.xl td {
  border-right: 1px solid var(--xl-grade);
  border-bottom: 1px solid var(--xl-grade);
  padding: 0 6px;
  height: 22px;
  line-height: 21px;
  font-weight: 400;
}
table.xl thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--xl-cab);
  color: #444;
  text-align: center;
  border-color: var(--xl-cab-borda);
  font-size: 12px;
}
table.xl th.lin {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--xl-cab);
  color: #444;
  text-align: center;
  min-width: 38px;
  border-color: var(--xl-cab-borda);
  font-size: 12px;
}
table.xl .xl-canto {
  left: 0;
  z-index: 3 !important;
  min-width: 38px;
}
table.xl th.col.ativa,
table.xl th.lin.ativa {
  background: #d2d2d2;
  color: var(--xl-sel);
  border-bottom: 2px solid var(--xl-sel);
}
table.xl td {
  background: #fff;
  cursor: cell;
  max-width: 520px;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.xl td.dir { text-align: right; }
table.xl td.txt small { color: #666; }
table.xl td.xl-cab {
  background: var(--xl-titulo);
  color: #fff;
  font-weight: 700;
  text-align: center;
}
table.xl td.xl-titulo { font-weight: 700; font-size: 15px; }
table.xl td.xl-pct { color: #000; text-align: right; }
table.xl tr.xl-grupo td { font-weight: 700; background: #f2f2f2; }
table.xl tr.xl-tot td { font-weight: 700; border-top: 2px solid #000; background: #fff; }
table.xl td.calc { color: #000; }
table.xl td.neg { color: #c00000; }
table.xl td.xl-mudou { background: #fff2cc; }
table.xl td.sel {
  outline: 2px solid var(--xl-sel);
  outline-offset: -2px;
  background: var(--xl-sel-fundo);
}
table.xl td.xl-mudou.sel { background: #ffe699; }
table.xl tr.xl-apagar td { text-decoration: line-through; color: #999; background: #fbe5e5; }
table.xl td.ed input,
table.xl td input.xl-edit {
  width: 100%;
  min-width: 70px;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  color: #000;
  text-align: inherit;
  padding: 0;
  height: 20px;
}
table.xl td.ed { cursor: text; }
.xl-rodape {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--xl-cab);
  border-top: 1px solid var(--xl-cab-borda);
  color: #444;
  font-size: 12px;
}
.xl-aba {
  background: #fff;
  border: 1px solid var(--xl-cab-borda);
  border-top: 0;
  padding: 2px 14px;
  color: var(--xl-sel);
  font-weight: 700;
  border-bottom: 2px solid var(--xl-sel);
}
.xl-rodape .xl-soma { margin-left: auto; white-space: pre; }

/* clicar e arrastar seleciona células, não o texto da página */
table.xl { user-select: none; -webkit-user-select: none; }
table.xl td input { user-select: text; -webkit-user-select: text; }

/* cores da planilha importada (vêm por célula em --f / --t); "mudou", "apagar" e seleção ficam por cima */
table.xl tr td.xl-cor { background: var(--f); color: var(--t); }
table.xl tr td.xl-cor.neg { color: #c00000; }
table.xl tr td.xl-cab-cor { font-weight: 700; text-align: center; white-space: normal; line-height: 1.15; }
table.xl tr td.xl-mudou { background: #fff2cc; color: #000; }
table.xl tr td.xl-mudou.sel { background: #ffe699; }
table.xl tr.xl-apagar td { text-decoration: line-through; color: #999; background: #fbe5e5; }
table.xl tr td.sel { outline: 2px solid var(--xl-sel); outline-offset: -2px; }
table.xl td.xl-faixa { box-shadow: inset 0 0 0 999px rgba(33, 115, 70, 0.16); }

/* conta da gerente: células digitáveis num verde claro, opcionais recuados sob o produto */
table.xl tr td.ed:not(.xl-mudou) { background: #eef6e8; }
table.xl tr.xl-opc td.txt { padding-left: 20px; color: #444; }

.xl-zoom { display: inline-flex; align-items: center; gap: 2px; }
.xl-zoom button {
  font: inherit;
  min-width: 26px;
  height: 22px;
  border: 1px solid var(--xl-cab-borda);
  background: #fff;
  color: #333;
  border-radius: 4px;
  cursor: pointer;
}
.xl-zoom #xl-zoom { min-width: 50px; }

@media (max-width: 760px) {
  .xl-rolo { max-height: calc(100vh - 230px); }
  .xl-ref { width: 56px; }
}
