/* ===== Contábil: área de trabalho com janelas flutuantes (estilo sistema desktop) ===== */
body.contab { background: var(--lateral); }
.area-trabalho { position: relative; flex: 1; min-height: 0; background: var(--lateral); overflow: hidden; }
html.lateral-aberta body:has(.lateral) .area-trabalho { margin-left: 240px; }
.trilho { position: absolute; right: 6px; top: 8px; display: flex; flex-direction: column; gap: 14px; color: #fff; opacity: .9; z-index: 2; }
.trilho a { color: #fff; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 3px; }
.trilho a:hover { background: rgba(255,255,255,.16); }
.trilho .ico { width: 20px; height: 20px; }

/* janela do Windows */
.win { position: absolute; background: #f0f0f0; border: 1px solid #6f8fb5; box-shadow: 0 0 0 4px #c9daf0, 0 10px 28px rgba(0,0,0,.4); display: flex; flex-direction: column; max-width: calc(100% - 20px); max-height: calc(100% - 10px); font: 11px Tahoma, "Segoe UI", Arial, sans-serif; color: #000; }
.win.max { inset: 0 !important; width: auto !important; height: auto !important; max-width: none; max-height: none; }
.win-t { display: flex; align-items: center; gap: 6px; background: linear-gradient(#eaf1f9, #d3e1f0); padding: 3px 3px 3px 6px; cursor: move; user-select: none; flex: none; }
.win:not(.foco) .win-t { background: linear-gradient(#f4f6f8, #e4e8ec); color: #555; }
.win-t .ico-win { width: 14px; height: 14px; background: #3a9a4a; border-radius: 2px; flex: none; }
.win-t b { font-weight: 400; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-t button { width: 26px; height: 17px; border: 1px solid #8f9bab; background: linear-gradient(#f7f9fb, #dde3ea); color: #333; font-size: 10px; line-height: 1; cursor: pointer; padding: 0; border-radius: 0; }
.win-t button.x { width: 42px; background: linear-gradient(#e8a493, #c75050); border-color: #8d3a3a; color: #fff; }
.win-t button.x:hover { background: linear-gradient(#f2b6a6, #e04343); }
.win-c { padding: 8px; overflow: auto; flex: 1; min-height: 0; }

/* campos e blocos de formulário */
.lin { display: flex; gap: 8px; align-items: flex-end; margin: 3px 0; flex-wrap: wrap; }
.cp { display: flex; flex-direction: column; gap: 1px; }
.cp.h { flex-direction: row; align-items: center; gap: 5px; }
.cp > span { white-space: nowrap; }
.cp input, .cp select { width: var(--w, 100px); }
.cp.f { flex: 1; } .cp.f input, .cp.f select { width: 100%; }
.cp input[readonly], .cp input:disabled { background: #f0f0f0; }
.ck { display: inline-flex; align-items: center; gap: 4px; margin: 2px 12px 2px 0; white-space: nowrap; }
.ck.off { color: #8a8a8a; }
fieldset { min-width: 0; }
fieldset.ln { margin: 6px 0; }
.col2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.col2 > * { min-width: 0; }

/* abas do Windows */
.abas { display: flex; gap: 0; border-bottom: 1px solid #adadad; padding-left: 2px; flex-wrap: wrap; }
.abas button { all: unset; box-sizing: border-box; padding: 2px 9px; margin: 2px -1px 0 0; background: #f0f0f0; border: 1px solid #adadad; border-bottom: 0; cursor: pointer; font: inherit; }
.abas button:hover { background: #e5f1fb; }
.abas button.on { background: #fff; margin-top: 0; padding: 3px 9px 4px; margin-bottom: -1px; position: relative; z-index: 1; }
.abas button[disabled] { color: #8a8a8a; cursor: default; background: #f0f0f0; }
.abas.sub { margin-top: 2px; position: static; display: flex; } /* .sub também é a classe dos submenus do topo */
.painel-aba { display: none; border: 1px solid #adadad; border-top: 0; padding: 8px; background: #f0f0f0; }
.painel-aba.on { display: block; }
.abas + .painel-aba { margin-top: 0; }

/* barra de botões (rodapé da janela) */
.barra-bt { display: flex; gap: 6px; justify-content: flex-end; padding: 8px 0 0; flex-wrap: wrap; }
.barra-bt.col { flex-direction: column; justify-content: flex-start; padding: 0; }
.btw { min-width: 74px; height: 23px; padding: 0 10px; font: inherit; color: #000; background: linear-gradient(#fdfdfd, #e1e1e1); border: 1px solid #adadad; cursor: pointer; white-space: nowrap; }
.btw:hover:not([disabled]) { background: linear-gradient(#f2f8fe, #dcecfc); border-color: #0078d7; }
.btw.pad { border-color: #0078d7; box-shadow: inset 0 0 0 1px #0078d7; }
.btw[disabled] { color: #a0a0a0; background: #f4f4f4; border-color: #d5d5d5; cursor: default; }
.btw.aj { min-width: 0; padding: 0 7px; }
.btw .q { display: inline-block; background: #0078d7; color: #fff; width: 13px; height: 13px; line-height: 13px; text-align: center; font-size: 10px; margin-left: 4px; font-weight: 700; }

/* grades */
.gd { background: #fff; border: 1px solid; border-color: #828790 #e3e3e3 #e3e3e3 #828790; overflow: auto; }
.gd table { border-collapse: collapse; width: 100%; }
.gd th { background: #fff; font-weight: 400; text-align: left; padding: 1px 5px; border: 1px solid #e5e5e5; border-top: 0; position: sticky; top: 0; white-space: nowrap; }
.gd td { padding: 1px 5px; border-bottom: 1px solid #f4f4f4; white-space: nowrap; }
.gd tr.sel td { background: #0078d7; color: #fff; }
.gd tbody tr:hover:not(.sel) td { background: #e5f3ff; }
.gd .dir { text-align: right; }
.vazio-msg { text-align: center; color: #333; padding: 60px 10px; }

/* árvore (permissões, importação, relatórios) */
.arv { background: #fff; border: 1px solid; border-color: #828790 #e3e3e3 #e3e3e3 #828790; padding: 3px 4px; overflow: auto; }
.arv ul { list-style: none; margin: 0; padding-left: 16px; }
.arv > ul { padding-left: 2px; }
.arv li { padding: 1px 0; white-space: nowrap; }
.arv li > span.n { cursor: default; padding: 0 2px; }
.arv li > span.n.sel { background: #0078d7; color: #fff; }
.arv li.cx > span.t::before { content: "⊞ "; color: #777; }
.arv li.cx.aberto > span.t::before { content: "⊟ "; }
.arv li.cx:not(.aberto) > ul { display: none; }

/* papel do relatório (pré-visualização) */
.papel { background: #fff; padding: 14px 22px; font: 10px/1.35 Arial, sans-serif; color: #000; min-height: 100%; }
.papel h4 { text-align: center; margin: 12px 0; font-size: 11px; }
.papel table { width: 100%; border-collapse: collapse; }
.papel td, .papel th { padding: 1px 4px; font-weight: 400; }
.papel th { border-bottom: 1px solid #000; border-top: 1px solid #000; text-align: left; font-weight: 700; }
.papel .d { text-align: right; }
.papel .cab { display: flex; justify-content: space-between; margin-bottom: 8px; }
.visor { display: flex; min-height: 0; flex: 1; }
.visor-lat { width: 34px; background: var(--lateral); display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 8px; color: #fff; flex: none; }
.visor-lat .ico { width: 16px; height: 16px; }
.visor .papel { flex: 1; overflow: auto; }

/* menu cascata (submenus de vários níveis) */
.sub .it { position: relative; }
.sub .it > a, .sub .it > .grp { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 3px 22px; color: var(--texto); text-decoration: none; white-space: nowrap; cursor: default; }
.sub .it > a:hover, .sub .it:hover > .grp, .sub .it > a:focus-visible { background: #e2e5e9; outline: none; }
.sub .it > a.off { color: #8a8a8a; pointer-events: none; }
.sub .it > .grp::after { content: "▸"; font-size: 10px; margin-left: 12px; }
.sub .it > a .k { color: #333; }
.sub .it > .sub { display: none; position: absolute; left: 100%; top: -4px; }
.sub .it:hover > .sub { display: block; }
.sub .it.dir > .sub { left: auto; right: 100%; }
.sub .it > a u, .sub .it > .grp u { text-underline-offset: 2px; }

/* login */
body.entrada { background: var(--lateral); display: flex; align-items: center; justify-content: center; min-height: 100vh; margin: 0; }
.entrada .win { position: static; width: 360px; }
.entrada .marca-grande { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 600; color: #fff; justify-content: center; margin-bottom: 16px; }
/* botões do rodapé da janela ficam sempre visíveis (a janela rola por trás) */
.win-c > .barra-bt:last-child { position: sticky; bottom: -8px; background: #f0f0f0; padding: 8px 0; margin-bottom: -8px; }

/* login no padrão do Data Center: cartão branco sobre fundo em diagonal */
body.entrada { background: linear-gradient(160deg, #234266 0%, #2c5282 45%, #dbe6f3 45.2%, #f3f4f6 100%); min-height: 100vh; }
.cartao-login { background: #fff; width: 400px; max-width: calc(100vw - 24px); border-radius: 10px; box-shadow: 0 20px 50px rgba(15,23,42,.28); padding: 28px 30px 24px; font: 13px/1.4 "Segoe UI", Arial, sans-serif; color: #1f2933; }
.cartao-login .topo-login { text-align: center; margin-bottom: 18px; }
.cartao-login .topo-login b { display: block; font-size: 20px; color: #1f3b5c; margin-top: 6px; }
.cartao-login .topo-login span { color: #5f6b77; font-size: 12px; }
.cartao-login label { display: block; margin: 12px 0 4px; color: #3c4650; }
html body .cartao-login input[type=email], html body .cartao-login input[type=password] { width: 100%; height: 38px; padding: 0 10px; border: 1px solid #cfd4da; border-radius: 6px; box-shadow: none; font: inherit; background: #fff; color: #1f2933; }
html body .cartao-login input:focus { outline: none; border-color: #2c5282; box-shadow: 0 0 0 3px #dbe6f3; }
.cartao-login .manter { display: flex; align-items: center; gap: 6px; margin: 12px 0 16px; }
.cartao-login button[type=submit] { width: 100%; height: 40px; border: 0; border-radius: 6px; background: #2c5282; color: #fff; font: 700 14px "Segoe UI", Arial, sans-serif; cursor: pointer; }
.cartao-login button[type=submit]:hover { background: #1f3b5c; }
.cartao-login .erro-login { margin-top: 12px; padding: 8px 10px; border: 1px solid #f0b8b3; border-left: 4px solid #b42318; background: #fff; color: #b42318; border-radius: 4px; }

/* ===== tela inicial como no print: barra de título, painel de módulos sempre aberto, rodapé, engrenagem de cores ===== */
.barra-titulo { height: 18px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 8px; background: linear-gradient(#e6eef8, #c9daf0); border-bottom: 1px solid #9db4d1; color: #1f2933; font: 11px Tahoma, "Segoe UI", Arial, sans-serif; z-index: 31; }
.barra-titulo .ico-win { width: 12px; height: 12px; background: #3a9a4a; border-radius: 2px; flex: none; }
.atalhos a.off { opacity: .35; pointer-events: none; }
/* a área de trabalho é um pouco mais escura que o painel de módulos, em cada tema */
.area-trabalho { background: var(--area, var(--lateral)); }
html[data-tema="azul"] { --area: #295bb4; --lateral: #336abc; }
html[data-tema="verde"] { --area: #105069; --lateral: #1b6078; }
body.contab .lateral { top: 114px; width: 188px; padding-top: 10px; background: var(--lateral); }
html.lateral-aberta body:has(.lateral) .area-trabalho { margin-left: 188px; }
body.contab .lateral-busca { margin: 0 14px 10px; }
body.contab .lateral a { font-size: 11px; padding: 5px 14px; gap: 9px; }
body.contab .lateral-ico { width: 18px; height: 18px; }
body.contab .lateral-ico .ico { width: 12px; height: 12px; }
@media (max-width: 1100px) { body.contab .lateral { top: 82px; } }
/* engrenagem do canto direito: abre a lista de temas */
.trilho { gap: 12px; right: 10px; bottom: 8px; }
.trilho .trilho-baixo { margin-top: auto; }
.trilho-tema { position: relative; }
.trilho .temas { top: calc(100% + 6px); bottom: auto; right: 0; padding: 4px; min-width: 120px; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.trilho .temas button { width: 100%; font-size: 10px; padding: 3px 6px; gap: 8px; }
.trilho .temas i { width: 16px; height: 16px; }
/* rodapé: grupos de rótulo + ícones pequenos (como no print) */
.status .mini { width: 12px; height: 12px; background: rgba(255,255,255,.28); border-radius: 2px; display: inline-block; margin-left: 3px; }
.status .grupo { gap: 2px; }
.status .fim { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* ===== medidas tiradas do print (tela inicial): cabeçalho 82px, marca 78px, botões 31x32 com 8px entre eles, painel 187px ===== */
body.contab .topo { min-height: 82px; height: 82px; }
body.contab .marca { width: 78px; padding: 0; justify-content: center; font-size: 11px; letter-spacing: 0; }
body.contab .marca svg { display: none; }
body.contab .topo-meio { padding: 10px 12px 11px 10px; gap: 3px; justify-content: flex-start; }
body.contab .m-titulo { font-size: 12px; }
body.contab .atalhos { gap: 8px; }
body.contab .atalhos a { width: 31px; height: 32px; }
body.contab .atalhos .ico { width: 17px; height: 17px; }
body.contab .direita { padding: 0 15px 0 0; gap: 0; justify-content: flex-start; padding-top: 13px; font-size: 10px; }
body.contab .direita .linha { height: 21px; font-size: 10px; }
body.contab .direita .bt { font-size: 10px; height: 18px; padding: 0 4px; }
body.contab .lateral { top: 100px; width: 187px; padding-top: 10px; }
html.lateral-aberta body:has(.lateral) .area-trabalho { margin-left: 187px; }
body.contab .lateral-busca { margin: 0 18px 12px 15px; background: #fff; border: 1px solid #fff; height: 17px; }
body.contab .lateral-busca input { height: 15px; font-size: 10px; padding: 0 5px; border: 0; box-shadow: none; }
body.contab .lateral-busca .ico { width: 17px; height: 15px; padding: 2px; background: var(--lateral); border: 1px solid #fff; color: #fff; align-self: stretch; }
body.contab .lateral a { height: 24px; padding: 0 14px; font-size: 11px; gap: 11px; font-weight: 400; }
body.contab .lateral a.ativo { background: none; font-weight: 400; }
body.contab .lateral-ico { width: 21px; height: 21px; background: rgba(0,0,0,.2); color: #fff; border-radius: 2px; }
body.contab .lateral-ico .ico { width: 13px; height: 13px; }
body.contab .lateral a.ativo .lateral-ico { background: #8b1a6b; }
body.contab .status { height: 24px; font-size: 11px; }
body:has(.status) { padding-bottom: 24px; }
.trilho { right: 24px; top: 20px; gap: 14px; }
@media (max-width: 1100px) { body.contab .lateral { top: 100px; } body.contab .atalhos { display: flex; } }

/* caixa de pesquisa do painel de módulos: campo branco liso + botão quadrado da lupa (como no print) */
body.contab .lateral-busca { display: flex; align-items: stretch; height: 18px; margin: 0 18px 12px 15px; background: #fff; border: 0; padding: 0; }
html body.contab .lateral-busca input:not([type=checkbox]):not([type=radio]):not([type=file]) { flex: 1; min-width: 0; height: 18px !important; margin: 0; padding: 0 6px !important; border: 0 !important; border-radius: 0; box-shadow: none !important; outline: none !important; background: #fff; color: #1f2933; font-size: 10px; -webkit-appearance: none; appearance: none; }
html body.contab .lateral-busca input::placeholder { color: #8a949e; }
html body.contab .lateral-busca input::-webkit-search-cancel-button { display: none; }
body.contab .lateral-busca .ico { flex: none; width: 18px; height: 18px; padding: 3px; margin: 0; box-sizing: border-box; background: var(--lateral); color: #fff; border: 1px solid #fff; }

/* acertos finos pela comparação lado a lado com o print */
body.contab .menu-topo { margin-left: -9px; }
body.contab .atalhos .ico { width: 20px; height: 20px; }
body.contab .lateral a { font-size: 10px; }
body.contab .lateral-busca .ico { padding: 0; }
.barra-titulo { font-size: 10px; }
body.contab .m-titulo { font-size: 11.5px; padding: 0 8px; }

/* letras um pouco maiores (pedido do Josiel) */
body.contab .m-titulo { font-size: 12.5px; }
body.contab .lateral a { font-size: 11.5px; }
html body.contab .lateral-busca input:not([type=checkbox]):not([type=radio]):not([type=file]) { font-size: 11px; }
.barra-titulo { font-size: 11px; }
body.contab .direita, body.contab .direita .linha, body.contab .direita .bt { font-size: 11px; }
body.contab .marca { font-size: 12px; }
body.contab .status { font-size: 12px; }

/* opções do painel de módulos mais espaçadas (pedido do Josiel) */
body.contab .lateral a { height: 30px; }

/* ícones maiores (pedido do Josiel): barra do topo e painel de módulos */
body.contab .atalhos .ico { width: 26px; height: 26px; }
body.contab .lateral-ico { width: 25px; height: 25px; }
body.contab .lateral-ico .ico { width: 19px; height: 19px; }
body.contab .lateral a { gap: 10px; padding-left: 12px; }

/* caixa de pesquisa maior (pedido do Josiel): campo mais alto e lupa maior */
body.contab .lateral-busca { height: 28px; margin: 0 15px 14px 15px; }
html body.contab .lateral-busca input:not([type=checkbox]):not([type=radio]):not([type=file]) { height: 28px !important; font-size: 12px; padding: 0 8px !important; }
body.contab .lateral-busca .ico { width: 28px; height: 28px; padding: 1px; }
/* caixa de confirmação / aviso (Sim-Não, OK) por cima de tudo */
.caixa-fundo { position: fixed; inset: 0; background: rgba(0,0,0,.25); display: grid; place-items: center; z-index: 99999; }
.caixa-fundo .win { position: relative; width: 400px; }
.caixa-fundo .win-t { cursor: default; }
.caixa-fundo .win-c p { margin: 14px 6px 10px 40px; white-space: pre-line; position: relative; min-height: 24px; }
.caixa-fundo .win-c p::before { position: absolute; left: -32px; top: -2px; width: 24px; height: 24px; border-radius: 50%; color: #fff; font: bold 15px/24px Tahoma, sans-serif; text-align: center; }
.caixa-fundo .confirma p::before { content: "?"; background: #2f6fbf; }
.caixa-fundo .sucesso p::before { content: "✓"; background: #3a9a4a; }
.caixa-fundo .erro p::before { content: "!"; background: #c75050; }
/* véu atrás de janela modal (busca, definições): bloqueia cliques nas outras janelas */
.veu { position: absolute; inset: 0; background: rgba(0,0,0,.15); }
.gd td[contenteditable] { background: #fff; outline: none; cursor: text; }
/* rótulos de largura fixa: campos alinhados na mesma coluna (ex.: Configuração de Importação › Clientes e fornecedores) */
.rot150 .cp.h > span { width: 150px; flex: none; }
.rot150 .lin > span + input + input[readonly] { flex: none; width: 152px; } /* descrição da conta termina na mesma coluna das listas */
