:root {
  /* Identidade Locagora: azul e verde do logo */
  --primaria: #2b4f9f;
  --secundaria: #68ac51;
  --lateral: color-mix(in srgb, var(--primaria) 72%, #020617);
  --fundo: #eef2f7;
  --painel: #ffffff;
  --texto: #1f2933;
  --suave: #6b7785;
  --borda: #e3e8ee;
  --grade: #e1e0d9;
  --verde: #16a34a;
  --verde-texto: #006300;
  --vermelho: #d03b3b;
  --amarelo: #fab219;
  --serie-1: #2a78d6;
  --serie-2: #eb6834;
  --raio: 10px;
  --sombra: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 15px; color: var(--texto); background: var(--fundo); }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.2; }
h1 { font-size: 21px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
a { color: var(--primaria); }
input, select, textarea, button { font: inherit; }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--borda); border-radius: 8px; background: #fff; color: var(--texto); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primaria); outline-offset: -1px; }
input[type="checkbox"], input[type="radio"] { width: auto; }
label { display: block; font-size: 13px; color: var(--suave); margin-bottom: 10px; }
label > input, label > select, label > textarea { margin-top: 4px; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--texto); font-size: 14px; }
.erro { color: var(--vermelho); min-height: 1em; font-size: 14px; }
.suave { color: var(--suave); }
.pequeno { font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.positivo { color: var(--verde-texto); }
.negativo { color: var(--vermelho); }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--borda);
  background: #fff; color: var(--texto); cursor: pointer; white-space: nowrap; text-decoration: none; font-weight: 500; }
.btn:hover { filter: brightness(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primario { background: var(--primaria); border-color: var(--primaria); color: #fff; }
.btn.perigo { background: var(--vermelho); border-color: var(--vermelho); color: #fff; }
.btn.sucesso { background: var(--verde); border-color: var(--verde); color: #fff; }
.btn.link { border: 0; background: none; color: var(--primaria); padding: 4px 6px; }
.btn.grande { padding: 12px 18px; font-size: 16px; width: 100%; }
.btn.mini { padding: 3px 9px; font-size: 13px; }
.btn svg { width: 16px; height: 16px; }

/* Login */
/* Mesmo padrão da plataforma da frota: degradê azul, título acima e quadro branco */
.login { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 44px; padding: 16px;
  background: linear-gradient(160deg, var(--primaria), #0b3b37); }
.login-caixa { background: #fff; padding: 32px 30px 26px; border-radius: 16px; width: 100%; max-width: 380px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.login-logo { width: 100%; max-width: 260px; height: 84px; object-fit: contain; display: block; margin: 0 auto 16px; }
.login-caixa form, .login-caixa [data-vista] { width: 100%; }
.titulo-central { display: flex; align-items: center; gap: 16px; width: 100%; max-width: 560px; }
.titulo-central::before, .titulo-central::after { content: ''; flex: 1; height: 1px; }
.titulo-central::before { background: linear-gradient(90deg, transparent, var(--secundaria)); }
.titulo-central::after { background: linear-gradient(90deg, var(--secundaria), transparent); }
.titulo-central span { font-family: 'Montserrat', system-ui, sans-serif; font-weight: 800; font-size: 14px; letter-spacing: 4px;
  text-transform: uppercase; color: #fff; white-space: nowrap; text-shadow: 0 1px 8px rgba(0,0,0,.25); }
.titulo-central span:empty { display: none; }
@media (max-width: 480px) { .titulo-central span { font-size: 11px; letter-spacing: 2.5px; } }
.cabeca-login { width: 100%; max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.slogan-login { margin: 0; text-align: center; font-size: 15px; color: rgba(255,255,255,.72); }
@media (max-width: 480px) { .slogan-login { font-size: 13px; } }
.link-discreto { font-size: 13px; color: var(--primaria); text-decoration: none; font-weight: 600; }
.link-discreto:hover, .rodape-login a:hover { text-decoration: underline; }
.esqueci-login { text-align: center; margin: 14px 0 0; }
.rodape-login { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--borda); text-align: center; font-size: 14px; color: var(--suave); }
.esqueci-login + .rodape-login { margin-top: 14px; }
.rodape-login a { color: var(--primaria); font-weight: 700; text-decoration: none; }
.titulo-login { font-size: 18px; margin: 0 0 6px; text-align: center; color: var(--texto); }
.texto-login { font-size: 14px; color: var(--suave); text-align: center; margin: 0 0 18px; line-height: 1.45; }
.confirmacao-login { text-align: center; }
.selo-ok { width: 56px; height: 56px; border-radius: 50%; margin: 4px auto 14px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--secundaria) 18%, white); color: color-mix(in srgb, var(--secundaria) 70%, black); }
.selo-ok svg { width: 28px; height: 28px; }

/* Estrutura */
.app { display: grid; grid-template-columns: 240px 1fr; height: 100%; }
.lateral { background: var(--lateral); color: #dbe4ff; display: flex; flex-direction: column; padding: 14px 12px; overflow: auto; }
.marca { padding: 14px 12px 10px; margin-bottom: 14px; background: #fff; border-radius: 12px; color: var(--lateral); text-align: center;
  font-family: 'Montserrat', system-ui, sans-serif; font-weight: 800; font-size: 15px; text-transform: uppercase; letter-spacing: .5px; }
.marca img { display: block; width: 100%; max-width: 180px; height: auto; margin: 0 auto; }
.marca small { display: block; color: var(--primaria); font-size: 10px; letter-spacing: 3px; margin-top: 6px; }
.so-leitor { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cabecalho-impressao { display: none; }
#menu { display: flex; flex-direction: column; gap: 3px; flex: 1; }
#menu a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: inherit; text-decoration: none; font-weight: 600; font-size: 15px; }
#menu a:hover { background: rgba(255,255,255,.08); }
#menu a.ativo { background: #fff; color: var(--lateral); box-shadow: inset 4px 0 0 var(--secundaria); }
#menu svg { width: 20px; height: 20px; flex: none; }
/* Menu em grupos (Locações, Atendimento, Oficina…) */
.menu-cabeca { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px; background: none;
  color: inherit; font: inherit; font-weight: 700; font-size: 15px; text-align: left; cursor: pointer; }
.menu-cabeca:hover { background: rgba(255,255,255,.08); }
.menu-cabeca svg { width: 20px; height: 20px; flex: none; }
.menu-cabeca i { margin-left: auto; font-style: normal; font-size: 11px; opacity: .7; transition: transform .15s; }
.menu-grupo.aberto > .menu-cabeca i { transform: rotate(90deg); }
.menu-itens { display: none; flex-direction: column; gap: 2px; margin: 2px 0 6px 22px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.15); }
.menu-grupo.aberto > .menu-itens { display: flex; }
#menu .menu-itens a { padding: 7px 10px; font-weight: 500; font-size: 14px; }
#menu .menu-itens a svg { width: 14px; height: 14px; margin-left: auto; opacity: .7; }
.em-construcao p { max-width: 720px; }
#menu .contador { margin-left: auto; background: var(--secundaria); color: #111; border-radius: 99px; font-size: 12px; padding: 0 7px; font-weight: 700; }
.usuario { border-top: 1px solid rgba(255,255,255,.12); padding: 12px 6px 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.usuario small { display: block; opacity: .7; }
.botao-sair { background: rgba(255,255,255,.1); border: 0; color: inherit; border-radius: 8px; padding: 7px; cursor: pointer; display: grid; }
.botao-sair svg { width: 20px; height: 20px; }
.principal { display: flex; flex-direction: column; min-width: 0; height: 100%; overflow: hidden; }
.barra-topo { display: flex; align-items: center; gap: 14px; padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--borda); }
.barra-topo h1 { margin: 0; flex: 1; }
.topo-direita { display: flex; gap: 10px; align-items: center; }
.topo-direita select { width: auto; min-width: 200px; }
.faixa-demo { background: var(--secundaria); color: #111; font-weight: 700; font-size: 12px; padding: 3px 10px; border-radius: 99px; text-transform: uppercase; }
main { flex: 1; overflow: auto; padding: 20px 24px 48px; }
.so-celular { display: none; }

/* Blocos */
.cartao { background: var(--painel); border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: var(--sombra); padding: 16px 18px; margin-bottom: 16px; min-width: 0; }
.cartao > h2 { display: flex; align-items: center; gap: 8px; }
.cartao > h2 .acoes { margin-left: auto; display: flex; gap: 6px; }
.grade { display: grid; gap: 16px; }
.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)); }
.g-painel { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); padding: 14px 16px; box-shadow: var(--sombra); text-decoration: none; color: inherit; display: block; }
.kpi span { font-size: 13px; color: var(--suave); }
.kpi strong { display: block; font-size: 23px; margin: 4px 0 2px; }
.kpi small { font-size: 12px; color: var(--suave); }
.kpi.alerta { border-left: 4px solid var(--vermelho); }
.kpi.aviso { border-left: 4px solid var(--amarelo); }
.barra-filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; }
.barra-filtros label { margin: 0; min-width: 130px; }
.barra-filtros .espaco { flex: 1; }
.abas { display: flex; gap: 4px; border-bottom: 1px solid var(--borda); margin-bottom: 14px; flex-wrap: wrap; }
.abas button { background: none; border: 0; padding: 9px 14px; cursor: pointer; color: var(--suave); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.abas button.ativa { color: var(--primaria); border-color: var(--primaria); }
.abas .contador { background: var(--secundaria); color: #111; border-radius: 99px; font-size: 11px; padding: 0 6px; margin-left: 4px; }
.vazio { text-align: center; color: var(--suave); padding: 30px 10px; }
.aviso-caixa { background: #fff8e6; border: 1px solid #f5d27a; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }
.info-caixa { background: #eef4ff; border: 1px solid #c7d7fb; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }

/* Tabelas */
.tabela-rolagem { overflow: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--borda); text-align: left; vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: var(--suave); font-weight: 600; background: #f8fafc; position: sticky; top: 0; z-index: 1; }
tbody tr:hover { background: #f8fafc; }
tfoot td { font-weight: 700; background: #f8fafc; }
td .sub { display: block; font-size: 12px; color: var(--suave); }
tr.clicavel { cursor: pointer; }
.selo { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: #eef2f7; color: var(--suave); white-space: nowrap; }
.selo.pago { background: #dcfce7; color: #166534; }
.selo.aberto { background: #e0ecff; color: #1e40af; }
.selo.vencido { background: #fee2e2; color: #991b1b; }
.selo.cancelado { background: #f1f5f9; color: #64748b; text-decoration: line-through; }
.selo.est { background: #fff3d6; color: #8a5a00; }
.tipo-r { color: var(--verde-texto); font-weight: 700; }
.tipo-d { color: var(--vermelho); font-weight: 700; }

/* DRE */
.dre td, .dre th { white-space: nowrap; }
.dre td:first-child, .dre th:first-child { position: sticky; left: 0; background: #fff; z-index: 2; min-width: 260px; }
.dre th:first-child { background: #f8fafc; z-index: 3; }
.dre tr.grupo td { font-weight: 700; cursor: pointer; }
.dre tr.grupo td:first-child::before { content: '▸ '; color: var(--suave); }
.dre tr.grupo.aberto td:first-child::before { content: '▾ '; }
.dre tr.conta td { font-size: 13px; color: #374151; }
.dre tr.conta td:first-child { padding-left: 30px; }
.dre tr.total td { font-weight: 800; background: #f1f5ff; }
.dre tr.total td:first-child { background: #f1f5ff; }
.dre tr.margem td { font-size: 12px; color: var(--suave); border-bottom-width: 2px; }
.dre th.proj, .dre td.proj { background: #fffbeb; }
.dre tr.total td.proj { background: #fdf3d3; }

/* Gráficos */
.grafico { width: 100%; position: relative; }
.grafico svg { width: 100%; height: auto; display: block; overflow: visible; }
.grafico .grade-linha { stroke: var(--grade); stroke-width: 1; }
.grafico .base { stroke: #c3c2b7; stroke-width: 1; }
.grafico text { font-size: 11px; fill: #898781; font-variant-numeric: tabular-nums; }
.legenda { display: flex; gap: 16px; font-size: 13px; color: var(--suave); margin-bottom: 8px; flex-wrap: wrap; }
.legenda i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.dica { position: absolute; pointer-events: none; background: #fff; border: 1px solid var(--borda); box-shadow: 0 8px 24px rgba(15,23,42,.15);
  border-radius: 8px; padding: 8px 10px; font-size: 13px; white-space: nowrap; z-index: 5; }
.dica b { display: block; margin-bottom: 4px; }
.dica i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }

/* Rateio */
.rateio-linha { display: grid; grid-template-columns: 1fr 1fr 90px 32px; gap: 8px; align-items: center; margin-bottom: 6px; }
.rateio-linha input, .rateio-linha select { margin: 0; }

/* Importação */
.soltar { border: 2px dashed #b8c4d6; border-radius: 12px; padding: 26px; text-align: center; color: var(--suave); cursor: pointer; background: #fafcff; }
.soltar.sobre { border-color: var(--primaria); background: #eef4ff; }
.soltar strong { color: var(--texto); display: block; margin-bottom: 4px; }

/* Modal e avisos */
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); display: grid; place-items: center; padding: 16px; z-index: 1000; }
.modal-caixa { background: #fff; border-radius: 14px; width: 100%; max-width: 640px; max-height: calc(100vh - 32px); overflow: auto; padding: 20px 22px; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.modal-caixa.largo { max-width: 920px; }
.modal-caixa h2 { display: flex; align-items: center; }
.modal-caixa h2 .fechar { margin-left: auto; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--suave); }
.modal-rodape { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.modal-rodape .esquerda { margin-right: auto; }
.campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.campos .todo { grid-column: 1 / -1; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 1100; }
.toast { background: #111827; color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: 380px; font-size: 14px; }
.toast.erro { background: var(--vermelho); }
.lista-simples { list-style: none; padding: 0; margin: 0; }
.lista-simples li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--borda); }
.lista-simples li:last-child { border-bottom: 0; }
.lista-simples .valor { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.barra-progresso { height: 8px; background: #eef2f7; border-radius: 99px; overflow: hidden; }
.barra-progresso span { display: block; height: 100%; background: var(--serie-1); border-radius: 99px; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: fixed; inset: 0 30% 0 0; z-index: 900; transform: translateX(-105%); transition: transform .2s; }
  .app.menu-aberto .lateral { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
  .so-celular { display: inline-flex; font-size: 22px; }
  .barra-topo { padding: 10px 16px; }
  .barra-topo h1 { font-size: 18px; }
  .topo-direita select { min-width: 0; max-width: 46vw; }
  main { padding: 16px 16px 40px; }
  .g2, .g3, .g4, .g-painel, .campos { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; }
  .kpi strong { font-size: 18px; }
  .rateio-linha { grid-template-columns: 1fr 1fr; }
}

@media print {
  .lateral, .barra-topo, .barra-filtros, .abas, .nao-imprimir { display: none !important; }
  .app { display: block; }
  main { overflow: visible; padding: 0; }
  .cartao { box-shadow: none; border: 0; padding: 0; }
  .dre td:first-child, .dre th:first-child, th { position: static; }
  body { background: #fff; font-size: 11px; }
  .principal { height: auto; overflow: visible; }
  .cabecalho-impressao { display: flex; align-items: center; gap: 16px; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 2px solid var(--secundaria); }
  .cabecalho-impressao img { width: 150px; height: auto; }
  .cabecalho-impressao div { margin-left: auto; text-align: right; }
  .cabecalho-impressao strong { display: block; font-size: 15px; color: var(--primaria); }
  .cabecalho-impressao span { color: var(--suave); }
}
