/* FariaPhoto CRM · escuro principal, dourado #D4A24C só em ações e estados,
   títulos e números em Inter (algarismos tabulares); Montserrat itálico só no logótipo e no título do PDF. */

:root,
[data-tema='escuro'] {
  --fundo: #121214;
  --superficie: #1b1b1e;
  --superficie-2: #232327;
  --superficie-3: #2c2c31;
  --borda: #2f2f35;
  --texto: #f1f1f3;
  --muted: #9b9ba4;
  --accent: #d4a24c;
  --accent-tinta: #1b1407;
  --accent-texto: #e3bc72;
  --accent-suave: rgba(212, 162, 76, 0.15);
  --ok: #2bb673;
  --ok-suave: rgba(43, 182, 115, 0.15);
  --aviso: #f5b800;
  --aviso-suave: rgba(245, 184, 0, 0.14);
  --erro: #f0443a;
  --erro-suave: rgba(240, 68, 58, 0.14);
  --azul: #5b8cff;
  --violeta: #a37bff;
  --sombra: 0 8px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

[data-tema='claro'] {
  --fundo: #f4f4f6;
  --superficie: #ffffff;
  --superficie-2: #f6f6f8;
  --superficie-3: #ececf0;
  --borda: #e2e2e7;
  --texto: #16161a;
  --muted: #6b6b75;
  --accent-texto: #8f6416;
  --accent-suave: rgba(212, 162, 76, 0.16);
  --sombra: 0 8px 30px rgba(20, 20, 30, 0.1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--fundo);
  color: var(--texto);
  font: 15px/1.5 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'cv11', 'ss01';
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-texto); }
h1, h2, h3 { font-family: Inter, system-ui, sans-serif; margin: 0; letter-spacing: -0.015em; }
h1 { font-weight: 700; font-size: 1.7rem; line-height: 1.2; letter-spacing: -0.025em; }
h2 { font-weight: 650; font-size: 1.02rem; }
h3 { font-weight: 650; font-size: 0.95rem; }
p { margin: 0 0 0.6em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.pequeno { font-size: 0.82rem; }
.escondido { display: none; }
.texto-ok { color: var(--ok); }
.texto-aviso { color: var(--aviso); }
.texto-erro { color: var(--erro); }
.arranque { display: grid; place-items: center; height: 100vh; color: var(--muted); }

/* ───────── Marca ───────── */
.marca { display: inline-flex; color: var(--texto); }
.marca .logo { height: 44px; width: auto; overflow: visible; }
.marca.pequeno .logo { height: 30px; }
.login-logo .logo { height: 96px; }

/* ───────── Login ───────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(600px 400px at 70% 20%, rgba(212, 162, 76, 0.12), transparent 70%), var(--fundo); }
.login-form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; text-align: center;
  background: var(--superficie); border: 1px solid var(--borda); border-radius: 22px; padding: 36px 28px; box-shadow: var(--sombra); }
.login-form .marca { justify-content: center; margin-bottom: 4px; }
.login-form h1 { font-size: 1rem; letter-spacing: 0.3em; color: var(--accent-texto); font-style: normal; }
.login-form .campo { text-align: left; }
.aviso-inline { background: var(--aviso-suave); color: var(--aviso); padding: 8px 12px; border-radius: 10px; }

/* ───────── Estrutura ───────── */
.estrutura { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.lateral { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  background: var(--superficie); border-right: 1px solid var(--borda); padding: 20px 14px; overflow-y: auto; }
.lateral-topo { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.crm-tag { font: 600 0.7rem Inter, system-ui, sans-serif; letter-spacing: 0.2em; color: var(--accent-texto);
  border: 1px solid var(--accent); border-radius: 6px; padding: 2px 6px; }
.menu { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.menu a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.menu a:hover { background: var(--superficie-2); color: var(--texto); }
.menu a.ativo { background: var(--accent-suave); color: var(--texto); }
.menu a.ativo svg:first-child { color: var(--accent); }
.menu-cadeado { margin-left: auto; display: inline-flex; opacity: 0.6; }
.lateral-fundo { display: flex; flex-direction: column; gap: 10px; }
.pin-estado { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 12px; border-radius: 10px; cursor: pointer;
  background: var(--superficie-2); border: 1px solid var(--borda); color: var(--muted); font-size: 0.85rem; text-align: left; }
.pin-estado:hover { border-color: var(--accent); }
.pin-estado.aberto { color: var(--ok); border-color: rgba(43, 182, 115, 0.4); background: var(--ok-suave); }
.quem { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 4px; font-size: 0.8rem; overflow: hidden; }
.quem span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topo-movel, .veu { display: none; }
main#conteudo { min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 80px; outline: none; }
.pagina { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }

/* ───────── Cabeçalhos ───────── */
.cabecalho { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cabecalho-acoes { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.titulo-solto { margin-bottom: 4px; }
.voltar { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 0.88rem; margin-bottom: -8px; }
.boas-vindas { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.boas-vindas p { margin: 0; text-transform: capitalize; }

/* ───────── Botões ───────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--borda); background: var(--superficie-2); color: var(--texto); font-weight: 600; font-size: 0.9rem;
  cursor: pointer; white-space: nowrap; transition: background 0.15s, border-color 0.15s; }
.btn:hover { border-color: var(--muted); color: var(--texto); }
.btn.primario { background: var(--accent); border-color: var(--accent); color: var(--accent-tinta); }
.btn.primario:hover { filter: brightness(1.08); }
.btn.perigo { background: var(--erro); border-color: var(--erro); color: #fff; }
.btn.perigo-texto { background: transparent; border-color: transparent; color: var(--erro); margin-right: auto; }
.btn.pequeno { padding: 5px 10px; font-size: 0.82rem; border-radius: 8px; }
.btn.largo { width: 100%; padding: 11px; }
.btn:disabled { opacity: 0.6; cursor: default; }
.icone-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.icone-btn:hover { background: var(--superficie-2); color: var(--texto); }
.icone-btn.mini { width: 26px; height: 26px; border-radius: 7px; }
.acoes { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.acoes-esq { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.barra-acoes { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--borda); }
.segmentos { display: flex; gap: 6px; }

/* ───────── Cartões e grelhas ───────── */
.cartao { background: var(--superficie); border: 1px solid var(--borda); border-radius: 18px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.cartao-topo { display: flex; align-items: center; gap: 10px; }
.cartao-topo h2 { margin-right: auto; }
.cartao.bloqueado { border-style: dashed; }
.grelha-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.coluna { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.vazio { text-align: center; color: var(--muted); padding: 22px 10px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.vazio p { margin: 0; }
.notas { white-space: pre-wrap; background: var(--superficie-2); border-radius: 12px; padding: 12px 14px; color: var(--muted); font-size: 0.92rem; }
.sub { margin-top: 8px; }

/* ───────── Números ───────── */
.numeros { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.numero { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--superficie-2); border: 1px solid var(--borda);
  border-radius: 14px; text-align: left; cursor: default; }
button.numero, a.numero { cursor: pointer; }
button.numero:hover, a.numero:hover { border-color: var(--accent); }
.numero span { font-size: 0.78rem; }
.numero strong { letter-spacing: -0.02em; font: 650 1.2rem Inter, system-ui, sans-serif; }
.numeros.grandes .numero strong { font-size: 1.6rem; }
.destaque-fin { padding: 14px; }
.fin-bloqueado { display: flex; align-items: center; gap: 12px; color: var(--muted); flex-wrap: wrap; padding: 4px 6px; }
.fin-bloqueado span { flex: 1; }
.progresso { height: 6px; background: var(--superficie-3); border-radius: 99px; overflow: hidden; }
.progresso i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }

/* ───────── Pílulas ───────── */
.pilula { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font-size: 0.74rem; font-weight: 600;
  background: var(--superficie-3); color: var(--muted); white-space: nowrap; margin-left: 6px; }
.pilula.ok, .fase-entregue, .orc-aceite, .lead-ganho { background: var(--ok-suave); color: var(--ok); }
.pilula.aviso, .orc-enviado, .lead-orcamentado { background: var(--aviso-suave); color: var(--aviso); }
.fase-pedido, .lead-novo { background: rgba(91, 140, 255, 0.15); color: var(--azul); }
.fase-confirmado, .lead-contactado { background: var(--accent-suave); color: var(--accent-texto); }
.fase-captado { background: rgba(163, 123, 255, 0.15); color: var(--violeta); }
.fase-edicao { background: var(--aviso-suave); color: var(--aviso); }
.orc-recusado, .lead-perdido { background: var(--erro-suave); color: var(--erro); }
.pilula.subtil { font-weight: 500; }
.contador { font: 500 0.72rem Inter, system-ui, sans-serif; color: var(--muted); background: var(--superficie-3); border-radius: 99px; padding: 1px 7px; margin-left: 6px; }

/* ───────── Formulários ───────── */
.form { display: flex; flex-wrap: wrap; gap: 12px; }
.form-secao { width: 100%; margin-top: 6px; }
.campo { display: flex; flex-direction: column; gap: 5px; width: 100%; }
.campo.meia { width: calc(50% - 6px); }
.campo.terco { width: calc(33.33% - 8px); }
.campo label { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.obrig { color: var(--accent-texto); }
input:not([type='checkbox']):not([type='file']), select, textarea {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--borda); background: var(--superficie-2); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 42px; }
input[type='checkbox'] { accent-color: var(--accent); width: 17px; height: 17px; flex: none; }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--borda); border-radius: 99px; cursor: pointer; background: var(--superficie-2); font-size: 0.88rem; }
.chip-check:has(input:checked) { border-color: var(--accent); background: var(--accent-suave); }
.check-linha { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 8px 0; font-size: 0.9rem; }
.procura { max-width: 240px; }

/* ───────── Janela ───────── */
.janela-fundo { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.55); display: grid; place-items: center; padding: 16px; animation: aparecer 0.15s; }
.janela { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; background: var(--superficie);
  border: 1px solid var(--borda); border-radius: 20px; box-shadow: var(--sombra); }
.janela header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 0 22px; position: sticky; top: 0; background: var(--superficie); z-index: 1; }
.janela-corpo { padding: 14px 22px 22px; }
@keyframes aparecer { from { opacity: 0; } }

/* ───────── Avisos ───────── */
#avisos { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.aviso { background: var(--superficie-3); border: 1px solid var(--borda); padding: 10px 16px; border-radius: 12px; box-shadow: var(--sombra);
  font-weight: 500; transition: opacity 0.3s, transform 0.3s; max-width: 90vw; }
.aviso.ok { border-color: rgba(43, 182, 115, 0.5); }
.aviso.erro { border-color: var(--erro); color: #fff; background: #5a1f1c; }
[data-tema='claro'] .aviso.erro { background: #fde7e6; color: #8a1d17; }
.aviso.sai { opacity: 0; transform: translateY(6px); }

/* ───────── Tabelas ───────── */
.tabela { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tabela th { text-align: left; font-weight: 500; color: var(--muted); font-size: 0.78rem; padding: 8px 10px; border-bottom: 1px solid var(--borda); }
.tabela td { padding: 10px; border-bottom: 1px solid var(--borda); vertical-align: top; }
.tabela tr:last-child td { border-bottom: 0; }
.tabela .num { text-align: right; font-family: Inter, system-ui, sans-serif; white-space: nowrap; }
.tabela tr.clicavel { cursor: pointer; }
.tabela tr.clicavel:hover td { background: var(--superficie-2); }
.tabela tr.inativo { opacity: 0.55; }
.tabela-rolar { overflow-x: auto; }
.lista-clientes { padding: 6px 10px; }

/* ───────── Abas ───────── */
.abas { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.aba { padding: 7px 12px; border-radius: 99px; border: 1px solid var(--borda); background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; font-weight: 500; font-size: 0.88rem; }
.aba.ativa { background: var(--accent-suave); border-color: var(--accent); color: var(--texto); }

/* ───────── Trabalhos ───────── */
.lista-trabalhos { display: flex; flex-direction: column; gap: 8px; }
.linha-trabalho { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--superficie); border: 1px solid var(--borda); border-radius: 14px; }
.linha-trabalho:hover { border-color: var(--accent); color: inherit; }
.lista-trabalhos.compacta .linha-trabalho { background: var(--superficie-2); }
.bloco-data { width: 52px; flex: none; text-align: center; display: flex; flex-direction: column; line-height: 1.1; padding: 6px 0; border-radius: 10px; background: var(--superficie-2); }
.bloco-data strong { font: 600 1.3rem Inter, system-ui, sans-serif; }
.bloco-data span, .bloco-data small { font: 500 0.66rem Inter, system-ui, sans-serif; color: var(--accent-texto); letter-spacing: 0.08em; }
.bloco-data small { color: var(--muted); }
.vazio-data span { color: var(--muted); padding: 8px 0; }
.lt-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lt-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-info span { font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-estado { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-family: Inter, system-ui, sans-serif; }
.lt-estado small { font-size: 0.74rem; }

.fases { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.fase { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--borda); background: var(--superficie); color: var(--muted); cursor: pointer; font-weight: 600; font-size: 0.86rem; }
.fase:hover { border-color: var(--muted); }
.fase-num { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--superficie-3); font: 600 0.72rem Inter, system-ui, sans-serif; flex: none; }
.fase.passada { color: var(--texto); }
.fase.passada .fase-num { background: var(--ok); color: #fff; }
.fase.atual { border-color: var(--accent); background: var(--accent-suave); color: var(--texto); }
.fase.atual .fase-num { background: var(--accent); color: var(--accent-tinta); }

.detalhes { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 0.92rem; }
.detalhes dt { color: var(--muted); }
.detalhes dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.detalhes a { color: var(--accent-texto); display: inline-flex; align-items: center; gap: 4px; }

/* ───────── Tarefas ───────── */
.tarefas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tarefas.cartao { padding: 6px 14px; gap: 0; }
.tarefa { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--borda); }
.tarefa:last-child { border-bottom: 0; }
.tarefa-check { display: flex; align-items: center; gap: 10px; flex: 1; cursor: pointer; min-width: 0; }
.tarefa.feita .tarefa-titulo { text-decoration: line-through; color: var(--muted); }
.tarefa-meta { display: flex; align-items: center; gap: 10px; font-size: 0.8rem; flex: none; }
.tarefa-meta a { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tarefa-prazo { font-family: Inter, system-ui, sans-serif; color: var(--muted); }
.tarefa.atrasada .tarefa-prazo { color: var(--erro); }
.tarefa.hoje .tarefa-prazo { color: var(--accent-texto); }
.vazio-li { color: var(--muted); padding: 10px 0; list-style: none; }
.grupo { display: flex; flex-direction: column; gap: 8px; }
.grupo-titulo { font-size: 0.95rem; display: flex; align-items: center; }

/* ───────── Listas simples ───────── */
.lista-simples { list-style: none; margin: 0; padding: 0; }
.lista-simples li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--borda); }
.lista-simples li:last-child { border-bottom: 0; }
.lista-simples li > a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lista-proximos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lista-proximos a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--superficie-2); color: inherit; }
.lista-proximos a:hover { outline: 1px solid var(--accent); }
.px-quando { width: 92px; flex: none; display: flex; flex-direction: column; font: 500 0.8rem Inter, system-ui, sans-serif; color: var(--muted); }
.px-quando.hoje { color: var(--accent-texto); }
.px-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.px-info strong, .px-info small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ───────── Pagamentos ───────── */
.pagamentos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pagamento-btn { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--borda);
  background: var(--superficie-2); cursor: pointer; text-align: left; }
.pagamento-btn:hover { border-color: var(--accent); }
.pg-data { font: 500 0.8rem Inter, system-ui, sans-serif; color: var(--muted); width: 82px; flex: none; }
.pg-desc { flex: 1; min-width: 0; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg-valor { font-family: Inter, system-ui, sans-serif; }
.pagamento.previsto .pagamento-btn { border-style: dashed; }
.pagamento.atrasado .pg-data, .pagamento.atrasado .pg-desc { color: var(--erro); }

/* ───────── Pedidos (quadro) ───────── */
.quadro { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.coluna-quadro { background: var(--superficie); border: 1px solid var(--borda); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.coluna-quadro h2 { font-size: 0.92rem; display: flex; align-items: center; padding: 2px 4px; }
.coluna-quadro.estado-novo h2 { color: var(--azul); }
.coluna-quadro.estado-ganho h2 { color: var(--ok); }
.cartoes { display: flex; flex-direction: column; gap: 8px; }
.cartao-lead { background: var(--superficie-2); border: 1px solid var(--borda); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.cartao-lead:hover { border-color: var(--accent); }
.cartao-lead .resumo { font-size: 0.84rem; color: var(--muted); margin: 2px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cartao-lead-fundo { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.mover { display: inline-flex; gap: 2px; }

/* ───────── Agenda ───────── */
.mes-nav { display: flex; align-items: center; gap: 8px; }
.mes-titulo { min-width: 180px; text-align: center; font-size: 1.15rem; }
.agenda-legenda { display: flex; gap: 16px; }
.agenda-legenda span { display: inline-flex; align-items: center; gap: 6px; }
.agenda-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.calendario { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-cab { text-align: center; font-size: 0.75rem; color: var(--muted); padding: 4px 0; }
.cal-dia { min-height: 96px; display: flex; flex-direction: column; gap: 3px; padding: 6px; border-radius: 10px; border: 1px solid var(--borda);
  background: var(--superficie); cursor: pointer; text-align: left; overflow: hidden; }
.cal-dia:hover { border-color: var(--muted); }
.cal-dia.fora { opacity: 0.4; }
.cal-dia.hoje .cal-num { background: var(--accent); color: var(--accent-tinta); }
.cal-dia.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-num { font: 600 0.78rem Inter, system-ui, sans-serif; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-evs { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-ev { font-size: 0.72rem; padding: 2px 5px; border-radius: 5px; background: var(--accent-suave); color: var(--texto); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-mais { font-size: 0.7rem; color: var(--muted); }
.cal-pontos { display: flex; gap: 3px; margin-top: auto; }
.ponto { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.ponto.p-trabalho { background: var(--accent); }
.ponto.p-entrega { background: var(--violeta); }
.ponto.p-tarefa { background: var(--azul); }
.lista-dia { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lista-dia li { display: flex; flex-direction: column; padding: 8px 10px 8px 12px; border-left: 3px solid var(--accent); background: var(--superficie-2); border-radius: 0 10px 10px 0; }
.lista-dia li.ev-entrega { border-color: var(--violeta); }
.lista-dia li.ev-tarefa { border-color: var(--azul); }
.dia-detalhe { position: sticky; top: 20px; }
.dia-detalhe h2 { text-transform: capitalize; }

/* ───────── Finanças ───────── */
.barras { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; height: 200px; align-items: end; padding-top: 18px; }
.barra { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; position: relative; }
.barra i { display: block; width: 70%; max-width: 38px; background: var(--superficie-3); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.barra.atual i { background: var(--accent); }
.barra:not(.atual) i { background: color-mix(in srgb, var(--accent) 45%, var(--superficie-3)); }
.barra-valor { font: 500 0.62rem Inter, system-ui, sans-serif; color: var(--muted); white-space: nowrap; }
.barra-mes { font-size: 0.72rem; color: var(--muted); }

/* ───────── Orçamentos ───────── */
.estado-orc { display: flex; gap: 6px; flex-wrap: wrap; }
.linhas-orc td { vertical-align: middle; }
.linhas-orc .estreito { width: 80px; }
.celula { background: transparent !important; border-color: transparent !important; padding: 6px 8px !important; }
.celula:hover { border-color: var(--borda) !important; }
.celula:focus { border-color: var(--accent) !important; background: var(--superficie-2) !important; }
input.celula.num { text-align: right; font-family: Inter, system-ui, sans-serif; max-width: 110px; }
textarea.celula { min-height: 34px; field-sizing: content; }
.linhas-acoes { display: flex; gap: 8px; flex-wrap: wrap; }
.linhas-acoes select { max-width: 320px; }
.totais { align-self: flex-end; min-width: 260px; display: flex; flex-direction: column; gap: 4px; font-family: Inter, system-ui, sans-serif; }
.totais div { display: flex; justify-content: space-between; gap: 20px; }
.totais .total { font-size: 1.2rem; border-top: 1px solid var(--borda); padding-top: 6px; }
.totais .total strong { color: var(--accent-texto); }

/* ───────── Serviços (por grupos) ───────── */
.grupos-servicos { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 18px; align-items: start; }
.grupo-servicos { gap: 8px; }
.lista-servicos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.servico { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--borda);
  background: var(--superficie-2); cursor: pointer; text-align: left; }
.servico:hover { border-color: var(--accent); }
.servico.inativo { opacity: 0.55; }
.servico-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.servico-preco { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.servico-preco strong { font-size: 1.02rem; }
@media (max-width: 820px) { .grupos-servicos { grid-template-columns: 1fr; } }

/* ───────── PIN ───────── */
.pin-portao { max-width: 420px; margin: 20px auto; padding: 28px; }
.janela .pin-portao { margin: 0; padding: 4px; border: 0; }
.pin-form { display: flex; flex-direction: column; gap: 12px; text-align: center; align-items: center; }
.pin-form .campo { max-width: 240px; }
.pin-icone { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-suave); color: var(--accent); }
.pin-input { text-align: center; font: 600 1.4rem Inter, system-ui, sans-serif !important; letter-spacing: 0.4em; }

/* ───────── Móvel ───────── */
@media (max-width: 1000px) {
  .grelha-2, .agenda-layout { grid-template-columns: 1fr; }
  .dia-detalhe { position: static; }
}
@media (max-width: 820px) {
  .estrutura { display: block; }
  .topo-movel { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; padding: 8px 12px;
    padding-top: max(8px, env(safe-area-inset-top)); background: var(--superficie); border-bottom: 1px solid var(--borda); }
  .hamburguer { display: flex; flex-direction: column; gap: 4px; width: 18px; }
  .hamburguer i { display: block; height: 2px; background: currentColor; border-radius: 2px; }
  .lateral { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 40; transform: translateX(-100%); transition: transform 0.2s; height: 100%; }
  body.menu-aberto .lateral { transform: none; box-shadow: var(--sombra); }
  body.menu-aberto .veu { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, 0.5); }
  main#conteudo { padding: 18px 14px 80px; }
  h1 { font-size: 1.4rem; }
  .campo.meia, .campo.terco { width: 100%; }
  .so-largo { display: none; }
  .fases { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .fase { flex-direction: column; gap: 4px; padding: 8px 4px; font-size: 0.7rem; text-align: center; }
  .cal-dia { min-height: 54px; padding: 4px; }
  .cal-evs { display: none; }
  .procura { max-width: none; flex: 1; }
  .cabecalho-acoes { width: 100%; }
  .boas-vindas .cabecalho-acoes { width: auto; }
  .tarefa { flex-wrap: wrap; }
  .tarefa-meta { width: 100%; padding-left: 27px; }
  .lt-estado small { display: none; }
  .barra-valor { display: none; }
  .janela-fundo { align-items: end; padding: 0; }
  .janela { border-radius: 20px 20px 0 0; max-height: 92vh; }
}

/* ───────── Impressão do orçamento ───────── */
#impressao { display: none; }
@media print {
  @page { size: A4; margin: 16mm 16mm 18mm; }
  body.a-imprimir > *:not(#impressao) { display: none !important; }
  body.a-imprimir { background: #fff; color: #111; }
  body.a-imprimir #impressao { display: block; font: 10.5pt/1.5 Inter, sans-serif; color: #111; }
  .doc-topo { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #d4a24c; padding-bottom: 12px; }
  .doc-logo .logo { height: 70px; width: auto; color: #111; overflow: visible; }
  .doc-emissor { text-align: right; font-size: 9pt; color: #444; }
  .doc-emissor strong { color: #111; font-size: 10.5pt; }
  .doc-titulo { display: flex; justify-content: space-between; align-items: flex-end; margin: 22px 0 14px; }
  .doc-titulo h1 { font-size: 22pt; color: #111; font-family: Montserrat, sans-serif; font-style: italic; font-weight: 800; }
  .doc-num { font: 600 11pt Inter, system-ui, sans-serif; color: #8f6416; }
  .doc-datas { text-align: right; font-size: 9.5pt; color: #444; }
  .doc-cliente { background: #f5f5f5; border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; }
  .doc-rotulo { display: block; font-size: 8pt; text-transform: uppercase; letter-spacing: 0.12em; color: #777; }
  .doc-linhas { width: 100%; border-collapse: collapse; }
  .doc-linhas th { text-align: left; font-size: 8.5pt; text-transform: uppercase; letter-spacing: 0.08em; color: #777; border-bottom: 1px solid #ccc; padding: 6px 4px; }
  .doc-linhas td { padding: 8px 4px; border-bottom: 1px solid #eee; vertical-align: top; }
  .doc-linhas th:not(:first-child), .doc-linhas td:not(:first-child) { text-align: right; white-space: nowrap; font-family: Inter, system-ui, sans-serif; }
  .doc-totais { margin: 12px 0 0 auto; width: 240px; font-family: Inter, system-ui, sans-serif; }
  .doc-totais div { display: flex; justify-content: space-between; padding: 3px 0; }
  .doc-total { border-top: 2px solid #111; margin-top: 4px; padding-top: 6px !important; font-size: 13pt; font-weight: 600; }
  .doc-sec { margin-top: 18px; break-inside: avoid; }
  .doc-sec h3 { font-size: 10pt; color: #111; margin-bottom: 4px; }
  .doc-sec p { color: #333; }
  .doc-rodape { margin-top: 28px; font-size: 8pt; color: #888; text-align: center; }
}
