/* Fluxo de Vendas — tema claro, palco fixo 1920×1080 escalado para a TV. */
:root {
  --fundo: #eef2f7;
  --painel: #ffffff;
  --borda: #dbe2ec;
  --texto: #0f172a;
  --texto-2: #475569;
  --texto-3: #64748b;
  --fat: #257de0;      /* vendas faturadas */
  --col: #f47230;      /* pedidos colocados */
  --marca: #ff6a33;
  --erro: #b91c1c;
  --raio: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; background: var(--fundo); }
body { font-family: "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--texto); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
.oculto { display: none !important; }
body.pagina-tv { overflow: hidden; }

#palco {
  position: absolute; left: 50%; top: 50%; width: 1920px; height: 1080px; transform-origin: center center;
  display: flex; flex-direction: column; gap: 14px; padding: 16px 20px; background: var(--fundo);
}

/* ---------- topo ---------- */
.topo { display: flex; align-items: center; justify-content: space-between; height: 70px; flex: none; gap: 20px; }
.marca { display: flex; align-items: center; gap: 16px; }
.logo-box { background: #fff; border: 1px solid var(--borda); border-radius: 12px; padding: 6px 12px; height: 62px; display: flex; align-items: center; }
.logo-box img { height: 48px; width: auto; display: block; }
.marca-sub { font-size: 15px; color: var(--texto-3); line-height: 1.3; }
.marca-sub b { display: block; color: var(--texto); font-size: 28px; font-weight: 800; letter-spacing: .01em; }
.seletor-mes { display: flex; align-items: center; gap: 10px; background: var(--painel); border: 1px solid var(--borda); border-radius: 14px; padding: 6px 8px; }
.seletor-mes span { font-size: 24px; font-weight: 800; min-width: 230px; text-align: center; }
.seletor-mes button { font: inherit; font-size: 18px; border: 0; background: #f1f5f9; color: var(--texto-2); border-radius: 10px; padding: 8px 14px; cursor: pointer; }
.seletor-mes button:hover:not(:disabled) { background: #e2e8f0; color: var(--texto); }
.seletor-mes button:disabled { opacity: .35; cursor: default; }
#mes-atual { font-size: 15px; font-weight: 700; color: var(--fat); }
.topo-dir { text-align: right; line-height: 1.25; }
.relogio { font-size: 34px; font-weight: 800; }
.status { font-size: 15px; color: var(--texto-3); }
.status.erro { color: var(--erro); font-weight: 700; }
.links a { color: var(--texto-3); font-size: 13px; text-decoration: none; margin-left: 12px; }
.links a:hover { color: var(--texto); }

/* ---------- indicadores ---------- */
.kpis { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr 1fr; gap: 14px; flex: none; }
.kpi { background: var(--painel); border: 1px solid var(--borda); border-radius: var(--raio); padding: 16px 20px; position: relative; overflow: hidden; }
.kpi-rotulo { white-space: nowrap; font-size: 15px; font-weight: 700; color: var(--texto-3); text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: 8px; }
.kpi-valor { font-size: 37px; font-weight: 800; margin-top: 6px; letter-spacing: -.01em; white-space: nowrap; }
.kpi-sub { font-size: 15px; color: var(--texto-3); margin-top: 2px; }
.kpi.destaque-colocado { border: 2px solid var(--col); }
.kpi.destaque-colocado .kpi-valor { font-size: 48px; }
.kpi.total { background: #0f172a; border-color: #0f172a; }
.kpi.total .kpi-rotulo, .kpi.total .kpi-sub { color: #94a3b8; }
.kpi.total .kpi-valor { color: #fff; }
.faixa { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: #fde4d6; }
.faixa-barra { height: 100%; background: var(--col); transition: width .6s; }
.bola { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }
.bola.fat { background: var(--fat); }
.bola.col { background: var(--col); }

/* ---------- grade principal ---------- */
.grade { flex: 1; min-height: 0; display: grid; grid-template-columns: 800px 1fr; gap: 14px; }
.coluna-dir { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.painel { background: var(--painel); border: 1px solid var(--borda); border-radius: var(--raio); padding: 14px 18px; display: flex; flex-direction: column; min-height: 0; }
.painel-titulo { font-size: 17px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--texto-2); margin-bottom: 8px; display: flex; align-items: center; gap: 12px; flex: none; }
.painel-titulo small { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--texto-3); font-size: 15px; }
.legenda { margin-left: auto; display: flex; gap: 18px; font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--texto-2); }
.legenda span { display: flex; align-items: center; gap: 6px; }

.tabela { width: 100%; border-collapse: collapse; }
.tabela th { text-align: left; font-size: 13px; font-weight: 700; color: var(--texto-3); text-transform: uppercase; letter-spacing: .05em; padding: 6px 10px; border-bottom: 1px solid var(--borda); background: #fff; }
.tabela td { padding: 0 10px; border-bottom: 1px solid #eef2f7; white-space: nowrap; }
.tabela .num { text-align: right; }
.tabela td.forte { font-weight: 700; }
.tabela tfoot td { font-weight: 800; border-top: 2px solid var(--texto); border-bottom: 0; background: #f8fafc; }
.traco { color: #cbd5e1; }

.painel-dias { overflow: hidden; }
.tabela-dias { font-size: 17px; }
.tabela-dias td { height: 21px; }
.tabela-dias tfoot td { height: 32px; font-size: 18px; }
.tabela-dias td small { color: var(--texto-3); font-size: 13px; margin-left: 4px; }
.tabela-dias tr.fds td { background: #f8fafc; color: var(--texto-3); }
.tabela-dias tr.hoje td { background: #fff1e8; font-weight: 800; color: var(--texto); }
.tabela-dias tr.hoje td:first-child { box-shadow: inset 4px 0 0 var(--col); }
.tabela-dias td.acum { color: var(--texto-2); }
.tabela-dias tr.futuro td { color: #cbd5e1; }

.painel-vend { flex: none; }
.tabela-vend { font-size: 18px; }
.tabela-vend td { height: 30px; }
.tabela-vend tfoot td { height: 36px; }
.tabela-vend td.pct { position: relative; width: 150px; }
.tabela-vend td.pct b { position: relative; font-weight: 700; }
.pct-barra { position: absolute; left: 10px; top: 9px; bottom: 9px; background: #cfe0f6; border-radius: 4px; }
.tabela td.vazio { color: var(--texto-3); padding: 12px 10px; }

.painel-grafico { flex: 1; }
.grafico { flex: 1; min-height: 0; }
.grafico svg { display: block; }
.grafico .fat { fill: var(--fat); }
.grafico .col { fill: var(--col); }
.grade-linha { stroke: #eef2f7; stroke-width: 1; }
.eixo-linha { stroke: #cbd5e1; stroke-width: 1; }
.eixo { fill: var(--texto-3); font-size: 14px; }
.eixo-atual { fill: var(--texto); font-weight: 800; }
.rotulo-total { fill: var(--texto); font-size: 15px; font-weight: 700; }

.tooltip { position: fixed; z-index: 10; background: #fff; border: 1px solid var(--borda); border-radius: 10px; padding: 10px 12px; font-size: 14px; box-shadow: 0 10px 30px rgba(15,23,42,.15); pointer-events: none; min-width: 230px; }
.tooltip div { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.tooltip span { margin-left: auto; font-weight: 700; }
.tooltip .tt-total { border-top: 1px solid var(--borda); padding-top: 4px; font-weight: 700; }

/* ---------- login e admin ---------- */
body.pagina-form, body.pagina-admin { overflow: auto; }
body.pagina-form { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.cartao-form { background: #fff; border: 1px solid var(--borda); border-radius: 16px; padding: 28px; width: 420px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 50px rgba(15,23,42,.08); }
.cartao-form .marca-sub b { font-size: 20px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--texto-2); }
input, select { font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: var(--texto); }
input:focus, select:focus { outline: 2px solid #bfdbfe; border-color: var(--fat); }
.btn-primario, .btn-sec, .btn-perigo { font: inherit; font-size: 14px; font-weight: 700; border-radius: 10px; padding: 10px 16px; cursor: pointer; border: 1px solid transparent; text-decoration: none; display: inline-block; }
.btn-primario { background: var(--fat); color: #fff; }
.btn-primario:hover { background: #1b66bd; }
.btn-sec { background: #f1f5f9; color: var(--texto); border-color: #dbe2ec; }
.btn-sec:hover { background: #e2e8f0; }
.btn-perigo { background: #fff; color: var(--erro); border-color: #fecaca; }
button:disabled { opacity: .45; cursor: default; }
.msg-erro { color: var(--erro); font-size: 14px; min-height: 1em; }
.msg-ok { color: #166534; }
.dica { font-size: 13px; color: var(--texto-3); }

.admin-topo { display: flex; justify-content: space-between; align-items: center; padding: 18px 28px; background: #fff; border-bottom: 1px solid var(--borda); }
.admin-acoes { display: flex; gap: 10px; align-items: center; color: var(--texto-2); font-size: 14px; }
.admin-corpo { padding: 24px 28px; display: flex; flex-direction: column; gap: 20px; max-width: 1400px; }
.admin-corpo .painel { padding: 18px 20px; }
.form-linha { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr auto; gap: 12px; align-items: end; }
.admin-corpo .tabela { font-size: 14px; }
.admin-corpo .tabela td { padding: 8px; border-bottom: 1px solid var(--borda); }
.admin-corpo .tabela td input, .admin-corpo .tabela td select { padding: 7px 10px; font-size: 14px; }
.admin-corpo .tabela td.acoes { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-corpo .tabela td.acoes button { padding: 6px 10px; font-size: 12px; }
.admin-corpo .tabela tr.inativo td { opacity: .55; }
.tag { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.tag.ok { background: #dcfce7; color: #166534; }
.tag.off { background: #f1f5f9; color: var(--texto-3); }
.resumo-online { font-weight: 700; color: #15803d; font-size: 14px; text-transform: none; letter-spacing: 0; }
.celula-online { white-space: nowrap; }
.celula-online small { display: block; color: var(--texto-3); font-size: 12px; margin-top: 2px; }
.online-sim { color: #15803d; font-weight: 700; }
.online-visto { color: var(--texto-2); }
.online-nao { color: #94a3b8; }
.tg-linha { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 15px; }
.tg-hist { margin-top: 12px; font-size: 13px; }
.tg-hist td { white-space: normal !important; vertical-align: top; }
.tg-hist .erro { color: var(--erro); }
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: center; justify-content: center; z-index: 20; }
.linha-botoes { display: flex; gap: 10px; justify-content: flex-end; }
