:root {
  --azul: #1a56db;
  --azul-escuro: #12409e;
  --verde: #16a34a;
  --amarelo: #d97706;
  --vermelho: #dc2626;
  --cinza-bg: #f4f6f9;
  --cinza-borda: #e2e8f0;
  --texto: #1e293b;
  --texto-suave: #64748b;
  font-size: 16px;
}
/* "hidden" sempre esconde, mesmo em blocos com display próprio (.grid, .card...) */
[hidden] { display: none !important; }
/* Logo Del Tecnologias no topo das telas e no login */
.topbar .marca { display: inline-flex; align-items: center; gap: 8px; }
.logo-marca { height: 30px; width: auto; }
.logo-login { display: block; width: 150px; max-width: 60%; height: auto; margin: 0 auto 6px; }
/* Nível de toner por cor (barrasToner em admin/modulos/impressoras.js) */
.toner-linha { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.toner-barra { flex: 1; height: 7px; min-width: 60px; background: var(--bd,#e5e7eb); border-radius: 4px; overflow: hidden; display: block; }
.toner-barra > span { display: block; height: 100%; }
.toner-linha small { font-size: 0.72rem; white-space: nowrap; min-width: 58px; }
/* Foto do funcionário (avatarHtml em shared/api.js) */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; object-fit: cover; color: #fff; font-weight: 700;
  vertical-align: middle; flex-shrink: 0; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--cinza-borda); }
.avatar-mini { width: 28px; height: 28px; font-size: 0.7rem; }
.avatar-media { width: 44px; height: 44px; font-size: 0.95rem; }
.avatar-grande { width: 110px; height: 110px; font-size: 2rem; }
.com-avatar { display: inline-flex; align-items: center; gap: 8px; }
/* Pagamento da fatura (shared/pagamento.js) */
.pg-bloco { border: 1px solid var(--cinza-borda); border-radius: 12px; padding: 14px; background: #fcfdff; margin-top: 12px; }
.pg-pix { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.pg-qr { width: 170px; height: 170px; background: var(--sf,#fff); border: 1px solid var(--cinza-borda); border-radius: 10px; padding: 6px; }
.pg-qr svg { width: 100%; height: 100%; }
.dialogo input[type="password"] { margin-bottom: 14px; }
/* Pergunta na tela (perguntarNaTela em shared/api.js) */
.dialogo-fundo { position: fixed; inset: 0; z-index: 1000; background: rgba(15, 23, 42, 0.55); display: grid; place-items: center; padding: 16px; }
.dialogo { background: var(--sf,#fff); border-radius: 14px; padding: 22px 24px; max-width: 460px; width: 100%;
  box-shadow: 0 20px 50px -12px rgba(15, 23, 42, 0.5); }
.dialogo h3 { margin: 0 0 8px; }
.dialogo p { margin: 0 0 18px; color: var(--texto); line-height: 1.5; white-space: pre-line; }
.dialogo-botoes { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
/* Campo de dinheiro: "R$" fixo na frente do número (pedido do usuário, 25/09) */
.campo-reais { position: relative; display: block; margin-bottom: 12px; }
.campo-reais > input { margin-bottom: 0 !important; padding-left: 36px !important; }
.campo-reais::before { content: "R$"; position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--texto-suave); font-size: 0.9rem; pointer-events: none; }
.campo-reais.mini { display: inline-block; margin: 0; }

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--cinza-bg);
  color: var(--texto);
}

.topbar {
  background: white;
  border-bottom: 1px solid var(--cinza-borda);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .marca { font-weight: 700; color: var(--azul); font-size: 1.1rem; }
.topbar .usuario { font-size: 0.9rem; color: var(--texto-suave); display: flex; gap: 10px; align-items: center; }
/* 1.46: no celular o nome da empresa encurta com "…" e o lado direito (nome do usuário + Sair) nunca é empurrado */
.topbar { gap: 10px; }
.topbar .marca { min-width: 0; flex: 1 1 auto; }
.topbar .marca-nome { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .usuario { flex: 0 0 auto; }
.topbar .usuario button { white-space: nowrap; }
@media (max-width: 640px) {
  .topbar { padding: 10px 12px; }
  .topbar .marca { font-size: 0.95rem; gap: 6px; }
  .topbar .usuario { gap: 6px; font-size: 0.8rem; }
  .topbar #nome-usuario { max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar button { padding: 6px 9px; }
  /* 1.81.3: com o seletor de unidade (filiais) o topo passava da tela; a parte do usuário desce e o seletor encolhe */
  .topbar:has(#unidade-atual) { flex-wrap: wrap; row-gap: 6px; }
  .topbar:has(#unidade-atual) .usuario { flex: 1 1 100%; min-width: 0; justify-content: flex-end; }
  .topbar #unidade-atual { flex: 1 1 auto; min-width: 0; max-width: 100%; }
  .topbar:has(#unidade-atual) #nome-usuario { flex-shrink: 0; }
}
/* HOMOLOGAÇÃO (1.48): faixa vermelha fixa em todas as páginas; o topo desce para ela não cobrir nada */
#faixa-homologacao { position: fixed; top: 0; left: 0; right: 0; height: 28px; line-height: 28px; z-index: 10000;
  background: var(--ba,#b91c1c); color: #fff; text-align: center; font-weight: 700; font-size: 0.8rem; letter-spacing: .3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
html.homologacao body { padding-top: 28px; }
html.homologacao .topbar { top: 28px; }
html.homologacao #faixa-como { top: 28px !important; }
/* 1.49.1: "Ativando…"/"Desativando…" da homologação piscando em amarelo (super-admin › Banco de dados) */
@keyframes piscar-amarelo { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.piscar-amarelo { animation: piscar-amarelo 1s ease-in-out infinite; }
.badge.aviso.piscar-amarelo { background: var(--soft-wa,#fde68a); color: var(--wa,#92400e); }
/* 1.99 (pedido do usuário): status da impressora como uma luz — "ativa" parada com brilho verde; "offline" piscando
   devagar com brilho vermelho */
.badge.luz-ativa { box-shadow: 0 0 6px 1px rgba(34, 197, 94, .55), 0 0 14px 2px rgba(34, 197, 94, .25); }
.badge.luz-offline { animation: luz-offline 2.4s ease-in-out infinite; }
@keyframes luz-offline { 0%, 100% { opacity: 1; box-shadow: 0 0 7px 2px rgba(239, 68, 68, .6), 0 0 16px 3px rgba(239, 68, 68, .3); }
  50% { opacity: .45; box-shadow: none; } }
/* barra de andamento em movimento (como a do Windows): listras correndo + brilho passando + círculo girando */
.barra-andamento { position: relative; height: 14px; background: var(--soft-wa,#fef3c7); border-radius: 8px; overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.08); }
.barra-andamento-cheia { position: relative; height: 100%; border-radius: 8px; transition: width .8s ease; overflow: hidden;
  background: repeating-linear-gradient(45deg, #f59e0b 0 12px, #fbbf24 12px 24px); background-size: 34px 34px;
  animation: listras-correndo .8s linear infinite; }
.barra-andamento-cheia::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); animation: brilho-passando 1.6s ease-in-out infinite; }
@keyframes listras-correndo { from { background-position: 0 0; } to { background-position: 34px 0; } }
@keyframes brilho-passando { from { left: -40%; } to { left: 100%; } }
.girando { width: 16px; height: 16px; border: 3px solid #fde68a; border-top-color: #d97706; border-radius: 50%;
  animation: girar .8s linear infinite; flex: 0 0 auto; }
@keyframes girar { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .barra-andamento-cheia, .barra-andamento-cheia::after, .girando, .piscar-amarelo, .badge.luz-offline { animation: none; }
}
/* versão do sistema/app no rodapé da página (antes ficava no topo) */
.versao-app { text-align: center; font-size: 0.72rem; color: var(--texto-suave); opacity: .7; padding: 8px 0 24px; }
.topbar button { background: none; border: 1px solid var(--cinza-borda); border-radius: 6px; padding: 6px 12px; cursor: pointer; }

.container { max-width: 1100px; margin: 0 auto; padding: 20px 16px 80px; }

.card {
  background: white;
  border: 1px solid var(--cinza-borda);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
}

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }   /* 1.41: números do "Meu dia" (2 por linha no celular) */

.stat { text-align: center; }
.stat .valor { font-size: 2rem; font-weight: 700; }
/* painel inicial (1.20): título de cada grupo de quadros */
.titulo-painel { margin: 18px 0 8px; font-size: 1.02rem; color: var(--texto-suave); }
.stat .rotulo { color: var(--texto-suave); font-size: 0.85rem; }

.barra-progresso {
  background: var(--bd,#e5e7eb);
  border-radius: 6px;
  height: 10px;
  overflow: hidden;
  margin-top: 6px;
}
.barra-progresso > div { height: 100%; background: var(--verde); }
.barra-progresso.aviso > div { background: var(--amarelo); }
.barra-progresso.critico > div { background: var(--vermelho); }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge.ok { background: var(--soft-ok,#dcfce7); color: var(--ok,#166534); }
.badge.aviso { background: var(--soft-wa,#fef3c7); color: var(--wa,#92400e); }
.badge.critico { background: var(--soft-ba,#fee2e2); color: var(--ba,#991b1b); }
/* DAS: pagamento conjunto confirmado = verde-água (não é alerta); no tema escuro o estilo acima troca a cor */
.badge.das-selo-junto { background: #ccfbf1; color: #0f766e; }
.badge.info { background: var(--soft-ac,#dbeafe); color: #1e40af; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--cinza-borda); font-size: 0.92rem; }
th { color: var(--texto-suave); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }

input, select, textarea, button {
  font-family: inherit;
  font-size: 1rem;
}
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--cinza-borda);
  border-radius: 8px;
  margin-bottom: 12px;
}
label { font-size: 0.85rem; color: var(--texto-suave); display: block; margin-bottom: 4px; }

.btn {
  display: inline-block;
  background: var(--azul);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  text-align: center;
  text-decoration: none;   /* link com cara de botão (ex.: 📲 WhatsApp) sem sublinhado */
}
.btn:hover { background: var(--azul-escuro); }
.btn.secundario { background: white; color: var(--texto); border: 1px solid var(--cinza-borda); }
.btn.perigo { background: var(--vermelho); }
.btn.grande { width: 100%; padding: 16px; font-size: 1.05rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-box { width: 100%; max-width: 380px; }
.login-box h1 { text-align: center; color: var(--azul); }
/* Login animado (1.42, shared/login-animado.js): fundo escuro com a rede de pontos; as cores seguem o logo exibido */
body.login-tech { min-height: 100vh;
  background: radial-gradient(1100px 700px at 15% 0%, #0f3a4d 0%, transparent 60%),
              radial-gradient(900px 600px at 100% 100%, #102a3f 0%, transparent 55%),
              linear-gradient(160deg, #040b12, #081a24 55%, #050f17); }
.login-tech .login-fundo, .login-tech .login-fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.login-tech .login-fx { z-index: 5; pointer-events: none; }
.login-tech .login-wrap { position: relative; z-index: 1; }
.login-tech .login-box { background: rgba(255, 255, 255, 0.94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6); border-radius: 20px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6), 0 0 70px -10px var(--marca-brilho, rgba(94, 200, 230, 0.35));
  transition: box-shadow 0.8s, transform 0.32s, opacity 0.32s, filter 0.32s; animation: login-chegar 0.7s ease-out backwards; }
.login-tech .logo-login { width: 100%; max-width: 240px; height: 130px; object-fit: contain; margin: 0 auto 8px; transition: opacity 0.35s ease; }
.login-tech .login-box h1 { color: var(--marca, var(--azul)); font-size: 1.45rem; margin: 4px 0 2px; transition: color 0.8s, opacity 0.22s, transform 0.22s; }
.login-tech .login-sub { text-align: center; color: var(--texto-suave); transition: opacity 0.22s, transform 0.22s; }
.login-tech .trocando { opacity: 0; transform: translateY(-4px); }
.login-tech .btn:not(.secundario) { background: var(--marca, var(--azul)); transition: background 0.8s; }
.login-tech .btn:not(.secundario):hover { background: var(--marca-escuro, var(--azul-escuro)); }
.login-tech .login-box input:focus { outline: none; border-color: var(--marca, var(--azul)); box-shadow: 0 0 0 3px var(--marca-brilho, rgba(26, 86, 219, 0.2)); }
.login-tech .login-box a { color: var(--marca, var(--azul)); }
.login-tech .login-box.saindo { opacity: 0; transform: scale(0.96); filter: blur(4px); }
.login-tech .login-box.tremer { animation: login-tremer 0.4s; }
@keyframes login-chegar { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
@keyframes login-tremer { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .login-tech .login-box, .login-tech .login-box.tremer { animation: none; } }

.erro { color: var(--vermelho); font-size: 0.9rem; margin: -6px 0 12px; }
.sucesso { color: var(--ok,#166534); font-size: 0.9rem; margin: 0 0 12px; }

.linha-timeline {
  border-left: 2px solid var(--cinza-borda);
  padding-left: 14px;
  margin-left: 6px;
  position: relative;
  padding-bottom: 16px;
}
.linha-timeline::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--azul);
}
.linha-timeline .quando { font-size: 0.8rem; color: var(--texto-suave); }

/* Menu de abas: faixa escura estilo painel, botões com ícone (ver shared/icones.js) */
.tabs {
  display: flex; gap: 10px; margin-bottom: 18px; padding: 10px;
  overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  background: linear-gradient(135deg, #0b1220 0%, #16213a 60%, #1b1740 100%);
  border-radius: 18px; border: 1px solid rgba(148, 163, 184, 0.15);
  box-shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}
.tabs button {
  position: relative; flex: 0 0 auto; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  min-width: 104px; padding: 13px 14px 11px;
  background: rgba(255, 255, 255, 0.035); color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.16); border-radius: 14px;
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.01em; white-space: nowrap; cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.tabs button .aba-icone {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  background: rgba(59, 130, 246, 0.12); color: #7cb4ff;
  box-shadow: inset 0 0 0 1px rgba(124, 180, 255, 0.18);
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.tabs button .aba-icone svg { width: 23px; height: 23px; }
.tabs button .aba-rotulo { text-align: center; line-height: 1.2; }
/* Menu organizável: lápis no canto e modo de edição (arrastar / setas) */
.tabs { position: relative; }
.menu-lapis-linha { display: flex; justify-content: flex-end; margin: -12px 6px 10px; }
.menu-lapis { background: none; border: 0; padding: 2px 6px; font-size: 0.8rem; color: var(--texto-suave); cursor: pointer; border-radius: 6px; }
.menu-lapis:hover { color: var(--azul); background: #e0e7ff; }
.tabs.editando button[data-tab] { cursor: grab; outline: 1px dashed rgba(167, 139, 250, 0.7); outline-offset: -3px;
  animation: menu-tremer 0.35s ease-in-out infinite alternate; }
.tabs.editando button[data-tab]:nth-child(even) { animation-delay: 0.15s; }
.tabs.editando button.arrastando { opacity: 0.35; animation: none; }
@keyframes menu-tremer { from { transform: rotate(-0.8deg); } to { transform: rotate(0.8deg); } }
.tabs .menu-seta { position: absolute; top: 24px; font-size: 0.65rem; color: #c4b5fd; padding: 2px 5px; border-radius: 6px;
  background: rgba(15, 23, 42, 0.6); cursor: pointer; }
.tabs .menu-seta.esq { left: 3px; }
.tabs .menu-seta.dir { right: 3px; }
.menu-barra-edicao { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: -8px 0 16px; padding: 10px 14px; border-radius: 12px; background: #ede9fe; color: #4c1d95; font-size: 0.9rem; }
.menu-barra-botoes { display: flex; gap: 6px; flex-wrap: wrap; }
.menu-barra-edicao .btn { padding: 7px 14px; }
@media (prefers-reduced-motion: reduce) { .tabs.editando button[data-tab] { animation: none; } }
.tabs button:hover {
  transform: translateY(-2px); color: #fff; border-color: rgba(124, 180, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(124, 180, 255, 0.2), 0 10px 24px -10px rgba(59, 130, 246, 0.75);
}
.tabs button:hover .aba-icone { background: rgba(59, 130, 246, 0.22); box-shadow: 0 0 14px rgba(96, 165, 250, 0.45); }
.tabs button:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.tabs button.ativo {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, #2563eb 0%, #6d28d9 100%);
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.45), 0 12px 28px -8px rgba(109, 40, 217, 0.8);
}
.tabs button.ativo .aba-icone {
  background: rgba(255, 255, 255, 0.18); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 0 16px rgba(196, 181, 253, 0.55);
}
.tabs button .aba-contador {
  position: absolute; top: 6px; right: 8px; min-width: 19px; height: 19px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 999px;
  background: #f43f5e; color: #fff; font-size: 0.68rem; font-weight: 700;
  box-shadow: 0 0 0 2px #0b1220, 0 0 12px rgba(244, 63, 94, 0.7);
}
.tabs button .aba-contador[hidden] { display: none; }
.tabs button[hidden] { display: none; }  /* botão sem permissão no perfil */
/* No máximo 2 linhas (shared/icones.js, ajustarMenu): colunas de largura igual, alinhadas e terminando juntas; se nem
   2 linhas bastarem, divide meio a meio e rola para o lado */
.tabs.duas-linhas { display: grid; grid-template-columns: repeat(var(--colunas, 6), minmax(0, 1fr)); }
html body .tabs.duas-linhas button[data-tab] { min-width: 0; padding-left: 4px; padding-right: 4px; white-space: normal; }
.tabs.uma-linha button[data-tab] { flex: 1 0 auto; }
/* Tamanho dos módulos: parâmetro "Aparência > Tamanho dos módulos" (médio = padrão acima) */
html[data-menu-tamanho="pequeno"] .tabs button { min-width: 88px; padding: 9px 10px 8px; font-size: 0.74rem; gap: 6px; }
html[data-menu-tamanho="pequeno"] .tabs button .aba-icone { width: 34px; height: 34px; border-radius: 10px; }
html[data-menu-tamanho="pequeno"] .tabs button .aba-icone svg { width: 19px; height: 19px; }
html[data-menu-tamanho="grande"] .tabs button { min-width: 120px; padding: 16px 16px 13px; font-size: 0.9rem; gap: 9px; }
html[data-menu-tamanho="grande"] .tabs button .aba-icone { width: 50px; height: 50px; border-radius: 14px; }
html[data-menu-tamanho="grande"] .tabs button .aba-icone svg { width: 27px; height: 27px; }
.tabs.rolagem {
  display: grid; grid-auto-flow: row;
  grid-template-columns: repeat(var(--colunas, 6), max-content);
  overflow-x: auto;
}
/* 1.81.3: setas laterais de rolagem (icones.js › setasRolagemMenu) */
.tabs .menu-rolar { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 34px; height: 64px;
  display: grid; place-items: center; font-size: 1.9rem; line-height: 1; color: #fff; cursor: pointer; user-select: none;
  background: rgba(37, 99, 235, 0.85); border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); }
.tabs .menu-rolar:hover { background: #6d28d9; }
.tabs .menu-rolar:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.tabs .menu-rolar[hidden] { display: none; }
.tabs.rolagem { padding-left: 14px; padding-right: 14px; }
.tabs::-webkit-scrollbar { height: 8px; }
.tabs::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.35); border-radius: 999px; }
.tabs::-webkit-scrollbar-track { background: transparent; }
@media (max-width: 640px) {
  .tabs { border-radius: 14px; padding: 8px; gap: 8px; }
  .tabs button { min-width: 80px; padding: 9px 8px 8px; font-size: 0.72rem; }
  .tabs button .aba-icone { width: 34px; height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .tabs button, .tabs button .aba-icone { transition: none; }
  .tabs button:hover { transform: none; }
}

.foto-preview { width: 100%; border-radius: 8px; margin-bottom: 10px; max-height: 240px; object-fit: cover; }

canvas#assinatura {
  border: 1px dashed var(--cinza-borda);
  border-radius: 8px;
  width: 100%;
  touch-action: none;
  background: white;
}

.rodape-fixo {
  position: sticky;
  bottom: 0;
  background: white;
  border-top: 1px solid var(--cinza-borda);
  padding: 12px 16px;
  margin: 0 -16px;
}

.aviso-assinatura {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 20px;
  font-size: 0.92rem;
}
.aviso-assinatura.info { background: var(--soft-ac,#dbeafe); color: var(--ac,#1e3a8a); }
.aviso-assinatura.aviso { background: var(--soft-wa,#fef3c7); color: var(--wa,#92400e); }
.aviso-assinatura.critico { background: var(--soft-ba,#fee2e2); color: var(--ba,#991b1b); }
.aviso-assinatura.apresentacao { background: #f3e8ff; color: #581c87; flex-wrap: wrap; gap: 8px; }   /* 1.40 */
.aviso-assinatura .btn { padding: 8px 14px; }

/* Ações da lista de OS numa linha só (técnico, Atribuir, Cancelar, imprimir...) */
.acoes-linha { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; }
.acoes-linha select { width: auto; max-width: 130px; margin: 0; padding: 6px 8px; font-size: 0.88rem; }
.acoes-linha .btn { padding: 6px 10px; white-space: nowrap; font-size: 0.88rem; }

/* Portal do cliente: abrir chamado por passos (1.21) */
.passo-chamado { font-weight: 600; margin: 16px 0 8px; }
.grade-escolha { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.cartao-escolha {
  display: flex; flex-direction: column; gap: 3px; text-align: left; cursor: pointer;
  background: var(--sf,#fff); border: 2px solid var(--cinza-borda); border-radius: 10px; padding: 12px 14px; color: var(--texto);
}
.cartao-escolha span { font-size: 0.82rem; color: var(--texto-suave); }
.cartao-escolha:hover { border-color: var(--azul); }
.cartao-escolha.marcado { border-color: var(--azul); background: var(--soft-ac,#eff6ff); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15); }
#form-chamado { margin-top: 16px; }
.linha-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.linha-check input { width: auto; margin: 0; }
.aviso-ok, .aviso-erro { padding: 10px 14px; border-radius: 8px; margin: 8px 0 4px; }
.aviso-ok { background: var(--soft-ok,#dcfce7); color: var(--ok,#166534); }
.aviso-erro { background: var(--soft-ba,#fee2e2); color: var(--ba,#991b1b); }
.tabela-rolavel { overflow-x: auto; }
/* Auto-completar do balcão (27/09) */
.lista-sugestoes { position: absolute; top: 100%; left: 0; right: 0; z-index: 60; background: var(--sf,#fff); border: 1px solid var(--cinza-borda);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15); max-height: 300px; overflow-y: auto; margin-top: 2px; }
.lista-sugestoes .sugestao { padding: 8px 12px; cursor: pointer; display: flex; flex-direction: column; border-bottom: 1px solid #f1f5f9; }
.lista-sugestoes .sugestao span { font-size: 0.8rem; color: var(--texto-suave); }
.lista-sugestoes .sugestao:hover, .lista-sugestoes .sugestao.marcada { background: var(--soft-ac,#eff6ff); }
/* Portal: composição do valor da fatura */
.fat-composicao { line-height: 1.5; }
.fat-resumo { width: 100%; border-collapse: collapse; }
.fat-resumo td { padding: 5px 4px; border-bottom: 1px solid var(--cinza-borda); vertical-align: top; }
.fat-resumo td.num { text-align: right; white-space: nowrap; }
.fat-resumo tr.fat-total td { font-weight: 700; font-size: 1.05rem; border-top: 2px solid #cbd5e1; border-bottom: 0; }
.fat-imp { border: 1px solid var(--cinza-borda); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; font-size: 0.92rem; }
.fat-imp-tit { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.fat-nota { font-size: 0.8rem; color: var(--texto-suave); }
/* Portal: nome da empresa do cliente no topo */
.cabecalho-cliente { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.cabecalho-cliente strong { font-size: 1.35rem; color: var(--texto); }
.cabecalho-cliente span { color: var(--texto-suave); font-size: 0.9rem; }
/* janela larga (cadastro de cliente por cima do contrato) */
.dialogo.dialogo-largo { max-width: 920px; max-height: calc(100vh - 32px); overflow-y: auto; }

/* Assinatura com o nome digitado em letra cursiva (fonte Great Vibes, licença OFL, em /vendor/fontes) */
@font-face { font-family: "Assinatura"; src: url("/vendor/fontes/GreatVibes-Regular.ttf") format("truetype"); font-display: swap; }
.assinatura-letra { font-family: "Assinatura", "Brush Script MT", cursive; word-spacing: 0.22em; font-size: 2.3rem; line-height: 1.15; color: var(--ac,#1e3a8a); }
.caixa-assinatura { border-bottom: 1.5px solid #334155; min-height: 62px; display: flex; align-items: flex-end; padding: 2px 10px;
  max-width: 460px; background: var(--sf,#fff); overflow: hidden; white-space: nowrap; }
.legenda-assinatura { font-size: 0.78rem; color: var(--texto-suave); max-width: 460px; text-align: center; margin: 3px 0 10px; }

/* Contrato e aditivos com aceite (1.22) */
.doc-contrato { border: 1px solid var(--cinza-borda); border-radius: 10px; padding: 12px 14px; margin: 10px 0; }
.caixa-aceite { background: var(--soft-ok,#f0fdf4); border: 1px solid #bbf7d0; border-radius: 8px; padding: 8px 10px; margin: 8px 0; font-size: 0.86rem; line-height: 1.5; }
.caixa-aceite code { font-size: 0.8rem; }
.texto-doc { white-space: pre-wrap; font-family: inherit; font-size: 0.9rem; line-height: 1.5; background: var(--s2,#f8fafc);
  border: 1px solid var(--cinza-borda); border-radius: 8px; padding: 12px; max-height: 420px; overflow: auto; }
.linha-doc { list-style: none; padding: 0; margin: 8px 0 0; font-size: 0.86rem; }
.linha-doc li { padding: 6px 0; border-bottom: 1px dashed var(--cinza-borda); }
.pedido-ajuste { background: var(--soft-ba,#fef2f2); color: var(--ba,#991b1b); border-radius: 6px; padding: 6px 8px; margin-top: 4px; white-space: pre-wrap; }
details summary { cursor: pointer; color: var(--azul); margin-top: 8px; }

.chave-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.chave-toggle input { width: auto; margin: 0; }

@media (max-width: 640px) {
  .container { padding: 14px 12px 90px; }
}

/* Relatorios (1.31): linha de totais */
.tabela-rel tfoot td { border-top: 2px solid var(--cinza-borda); background: var(--s2,#f8fafc); }

/* Barbearia / salão (1.32): agenda por profissional */
/* 1.38.1: o próprio quadro rola nas duas direções, então os NOMES dos profissionais ficam congelados no topo e as
   HORAS congeladas à esquerda (pedido do usuário: "como coluna congelada do Excel") */
.agenda-card { padding: 0 0 10px; overflow: auto; max-height: calc(100vh - 150px); }
.agenda-grade { display: flex; min-width: min-content; }
.agenda-horas { width: 52px; flex: 0 0 52px; position: sticky; left: 0; z-index: 9; background: var(--branco, #fff); }
.agenda-coluna { flex: 1 0 170px; min-width: 170px; border-left: 1px solid var(--cinza-borda); }
.agenda-cab { height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 8px; font-weight: 700; font-size: 0.9rem;
              position: sticky; top: 0; background: var(--branco, #fff); z-index: 8; border-bottom: 1px solid var(--cinza-borda);
              box-shadow: 0 2px 4px rgba(15, 23, 42, .06); }
.agenda-horas .agenda-cab { z-index: 10; }   /* o canto (horas × nomes) fica por cima dos dois */
/* 1.39: foto do profissional ao lado do nome; horário arrastável (segurar no celular) */
.avatar-agenda { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid; flex: 0 0 26px; vertical-align: middle; }
.agenda-item.arrastavel { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.agenda-corpo { position: relative; background: var(--s2,#f1f5f9); }
.agenda-horas .agenda-corpo { background: transparent; }
.agenda-hora { position: absolute; left: 0; right: 6px; font-size: 0.72rem; color: var(--texto-suave); text-align: right; transform: translateY(-6px); }
.agenda-hora:first-child { transform: none; }
.agenda-linha { position: absolute; left: 0; right: 0; border-top: 1px dashed #e2e8f0; z-index: 1; }
.agenda-linha.cheia { border-top: 1px solid #cbd5e1; }
.agenda-expediente { position: absolute; left: 0; right: 0; background: var(--sf,#fff); }
.agenda-bloqueio { position: absolute; left: 2px; right: 2px; z-index: 2; font-size: 0.72rem; color: var(--muted,#475569); padding: 2px 4px; overflow: hidden;
                   background: repeating-linear-gradient(45deg, #e2e8f0, #e2e8f0 6px, #f1f5f9 6px, #f1f5f9 12px); border-radius: 4px; }
.agenda-item { position: absolute; left: 3px; right: 3px; z-index: 4; border-left: 4px solid; border-radius: 6px; padding: 2px 6px;
               font-size: 0.78rem; line-height: 1.25; overflow: hidden; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.agenda-item strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-item > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
/* 1.59 (salão): pausa do serviço (química agindo) — a profissional fica livre nesse trecho */
.ag-pausa { position: absolute; left: 0; right: 0; font-style: normal; font-size: 0.7rem; text-align: center; color: var(--muted,#475569);
            background: repeating-linear-gradient(45deg, rgba(255,255,255,.85) 0 6px, rgba(226,232,240,.85) 6px 12px);
            display: flex; align-items: center; justify-content: center; pointer-events: none; }
/* fantasma do arraste (1.39.2): mostra o nome inteiro e o horário novo, mesmo num horário curto ou coluna estreita */
.agenda-fantasma { height: auto !important; min-width: 190px; padding: 6px 10px !important; font-size: 0.9rem !important; }
.agenda-fantasma strong, .agenda-fantasma > span { white-space: normal !important; }
.agenda-agora { position: absolute; left: 0; right: 0; border-top: 2px solid #dc2626; z-index: 5; pointer-events: none; }
.bolinha { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; }
.lista-servicos { max-height: 220px; overflow: auto; border: 1px solid var(--cinza-borda); border-radius: 8px; padding: 6px 10px; }
.campo-cliente .sugestoes { position: absolute; z-index: 20; left: 0; right: 0; background: var(--sf,#fff); border: 1px solid var(--cinza-borda);
                            border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.12); max-height: 240px; overflow: auto; }
.campo-cliente .sugestoes button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; cursor: pointer; font: inherit; }
.campo-cliente .sugestoes button:hover { background: var(--soft-ac,#eff6ff); }
.tabela-horarios input[type=time] { margin: 0; min-width: 110px; }

/* Logo da empresa no topo (1.33.2): pode ser retangular */
.logo-marca.logo-empresa { width: auto; max-width: 120px; height: 30px; object-fit: contain; border-radius: 4px; }

/* Lista de OS (1.46): a última OS acompanhada fica cinza; ao voltar do acompanhamento ela pisca */
#lista-os tr.os-destacada > td { background: var(--bd,#e5e7eb); }
#lista-os tr.os-destacada > td:first-child { box-shadow: inset 4px 0 0 #64748b; }
@keyframes os-piscar { 0%, 100% { background: var(--bd,#e5e7eb); } 50% { background: var(--soft-wa,#fde68a); } }
#lista-os tr.os-piscar > td { animation: os-piscar 0.8s ease-in-out 3; }

/* 1.225 (pedido do dono): criticidade alta/urgente e prazo acabando PISCAM DEVAGAR, só em OS ainda não encerrada */
@keyframes pisca-alta { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(202,138,4,.7); } 50% { opacity: .45; box-shadow: 0 0 0 6px rgba(202,138,4,0); } }
@keyframes pisca-urgente { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(220,38,38,.7); } 50% { opacity: .45; box-shadow: 0 0 0 6px rgba(220,38,38,0); } }
.pisca-alta { animation: pisca-alta 2.8s ease-in-out infinite; }
.pisca-urgente { animation: pisca-urgente 2.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .pisca-alta, .pisca-urgente { animation: none; } }

/* 1.225: atalhos da lista de OS, linha clicável e a ficha do chamado aberta abaixo da lista */
.os-atalhos { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.os-atalho { text-align: left; padding: 12px 18px; border-radius: 12px; border: 1px solid var(--cinza-borda); background: var(--sf,#fff); color: var(--texto); font: inherit; cursor: pointer; }
.os-atalho strong { display: block; font-size: 1.5rem; }
.os-atalho[data-atalho="vencidas"] { border-color: #dc2626; background: var(--soft-ba,#fef2f2); }
.os-atalho[data-atalho="logo"] { border-color: #ca8a04; background: var(--soft-wa,#fefce8); }
.os-atalho[data-atalho="atendimento"] { border-color: var(--azul); }
.os-atalho[aria-pressed="true"] { outline: 3px solid var(--azul); outline-offset: 1px; }
.equipe-pessoa { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.equipe-pessoa small { display: block; font-size: 0.75rem; font-weight: 400; color: var(--texto-suave); }
.equipe-ajudantes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 10px; max-width: 220px; margin-top: 4px; }
.equipe-ajudantes > small { grid-column: 1 / -1; font-size: 0.75rem; color: var(--texto-suave); }
.equipe-ajudante { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 0.8rem; font-weight: 400; }
.equipe-ajudante .avatar { width: 22px; height: 22px; font-size: 0.6rem; }
.equipe-ajudante > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.equipe-quantos { font-size: 0.8rem; color: var(--texto-suave); margin-top: 2px; }
.equipe-lado { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.equipe-lado .equipe-ajudantes { flex: 1 1 170px; margin-top: 0; padding-left: 14px; border-left: 1px solid var(--cinza-borda); }
.rastro-cards.ficha-cards { display: flex; flex-wrap: wrap; }
.ficha-cards > * { flex: 1 1 160px; min-width: 0; }
.ficha-cards > .rastro-card:has(.equipe-lado) { flex: 0 0 auto; max-width: 100%; }   /* Equipe do tamanho do conteúdo; o resto do espaço fica com os outros quadros */
.ficha-cards .equipe-lado { gap: 8px 16px; }
@media (min-width: 700px) { .ficha-cards .equipe-lado { flex-wrap: nowrap; } }   /* no computador: ajudantes sempre AO LADO do técnico */
.ficha-cards > .ficha-assinatura { flex: 1.25 1 220px; }   /* assinatura só um pouco maior que os outros quadros */
.ficha-cards > .ficha-assinatura img { height: 80px; width: 100%; max-width: 270px; }
.ficha-cards .equipe-lado .equipe-pessoa { margin: 0; }
.ficha-cards .equipe-lado .equipe-pessoa .avatar { width: 62px; height: 62px; font-size: 1.2rem; }
.ficha-cards .equipe-lado .equipe-ajudante .avatar { width: 30px; height: 30px; font-size: 0.75rem; }
.ficha-cards .equipe-lado .equipe-ajudantes { flex: 0 0 auto; grid-template-columns: repeat(2, max-content); gap: 5px 14px; max-width: 100%; }
.ficha-cards > .rastro-card:nth-child(2) .valor, .ficha-cards > .rastro-card:nth-child(3) .valor { font-size: 1.15rem; }   /* telefone/WhatsApp e Cliente com letra maior */
.ficha-cards .link-wa { font-size: 1.1rem; }
.texto-recolhido { max-height: 6.2em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.btn-ler-mais { background: none; border: 0; padding: 6px 0; min-height: 32px; color: var(--azul); font: inherit; font-weight: 700; cursor: pointer; }
#ficha-os .doc-destaques { align-items: start; }   /* a caixa curta não estica até a altura da longa */
/* 1.225 (dono: "o real está desorganizado"): a aba de OS usa a largura do desenho e os botões voltam a parecer botões em qualquer estilo */
.container:has(#tab-os[style*="block"]) { max-width: 1360px; }
#tab-os .btn.secundario, html[data-estilo] #tab-os .btn.secundario { background: var(--sf,#fff); border: 1px solid var(--bd, #cbd5e1); }
#tab-os .btn-abrir-os { white-space: nowrap; }
#lista-os td:first-child, #lista-os .badge { white-space: nowrap; }
#lista-os td { vertical-align: middle; }
#lista-os .equipe-pessoa > span { white-space: nowrap; }
.ficha-faixa .btn { margin: 0; }
.ficha-faixa { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 10px; border: 1px solid var(--cinza-borda); background: var(--s2,#f1f5f9); }
.ficha-faixa.concluida { background: var(--soft-ok,#dcfce7); border-color: #16a34a; }
.ficha-assinatura { border: 1px solid var(--cinza-borda); border-radius: 8px; padding: 10px 14px; text-align: center; }
.ficha-assinatura img { display: block; margin: 6px auto 0; max-width: 100%; height: 70px; object-fit: contain; background: #fff; cursor: zoom-in; }
.ficha-assinatura .linha { border-top: 1px solid #334155; padding-top: 4px; }
.ponto-mapa { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #1a56db; color: #fff; font-weight: 700; font-size: 0.8rem; border: 2px solid #fff; }
.ponto-mapa.anotacao { background: #c2410c; }
.ponto-mapa.conclusao { background: #15803d; }
.balao-ponto > div { box-sizing: border-box; height: 100%; overflow: hidden; background: #fff; color: #1e293b; border: 2px solid #1a56db; border-radius: 8px; padding: 3px 8px; font-size: 0.74rem; line-height: 1.25; box-shadow: 0 2px 6px rgba(15,23,42,.25); cursor: pointer; }
.balao-ponto strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.balao-ponto span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 1.164: botões do módulo DAS (tabela de guias e cartão do Coletor DAS) alinhados: todos com o MESMO traço (o azul tinha border:none e o branco 1px, então ficavam 2px
   de altura diferente) e o mesmo tamanho; campo de texto sem a margem de baixo dentro de linhas com botão (empurrava o botão para baixo). */
.das-escopo .btn, #tab-das td .btn { border: 1px solid var(--azul); padding: 8px 14px; font-size: 0.9rem; line-height: 1.25; white-space: nowrap; }
.das-escopo .btn.secundario, #tab-das td .btn.secundario { border-color: var(--cinza-borda); }
.das-escopo input { margin-bottom: 0; }

/* 1.164: "Atualizando pelo governo" PISCANDO no módulo DAS enquanto o Coletor DAS (ou o app) lê o site do governo */
@keyframes das-pisca { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.das-pisca { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--soft-ok,#dcfce7); color: var(--ok,#166534); font-size: 0.85rem; font-weight: 600; animation: das-pisca 1s ease-in-out infinite; }
.das-pisca::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ok,#16a34a); }
@media (prefers-reduced-motion: reduce) { .das-pisca { animation: none; } }
.das-ok { display: inline-flex; align-items: center; gap: 6px; color: var(--ok,#166534); font-size: 0.88rem; font-weight: 600; }
.das-erro { color: var(--ba,#b91c1c); font-size: 0.88rem; font-weight: 600; }
.das-escopo select { margin-bottom: 0; }
.das-cobertura { display: none; text-align: center; padding: 14px; margin-top: 12px; border: 1px dashed #86efac; border-radius: 10px; background: var(--soft-ok,#f0fdf4); }
.das-cobertura.ativa { display: block; }
.das-esmaecido { opacity: 0.35; pointer-events: none; transition: opacity 0.2s; }

/* 1.225 (dono: "prefiro a proposta"): a aba de Ordens de Serviço fica igual ao desenho aprovado, em qualquer estilo visual do painel */
#tab-os { font-size: 14px; }
#tab-os h2 { font-size: 24px; }
html body #tab-os .card { background: var(--sf,#fff); border: 1px solid var(--bd,#e2e8f0); border-radius: 12px; box-shadow: none; }
#tab-os .os-atalho { font-size: 14px; }
#tab-os .os-atalho strong { font-size: 26px; }
html body #tab-os .btn { min-height: 44px; margin: 0; padding: 0 16px; border-radius: 8px; font-size: 14px; font-weight: 500; box-shadow: none; }
html body #tab-os .btn.secundario { background: var(--sf,#fff); color: var(--text, #1e293b); border: 1px solid var(--bd,#cbd5e1); }
html body #tab-os #btn-nova-os { padding: 0 22px; font-size: 15px; font-weight: 600; }
html body #tab-os #lista-os .btn-abrir-os { color: var(--ac, #12409e); white-space: nowrap; }
html body #tab-os #lista-os .btn-abrir-os[aria-expanded="true"] { border-color: var(--ac, #1a56db); font-weight: 600; }
html body #tab-os .btn-ler-mais { min-height: 32px; }
/* barra de busca: campo largo; o Enter busca (o botão "Buscar" some, como no desenho) */
#tab-os #form-busca-os { flex: 1 1 320px !important; max-width: none !important; }
#tab-os #form-busca-os input { min-height: 44px; font-size: 14px; }
#tab-os #form-busca-os button { display: none; }
#tab-os #periodo-os { min-height: 44px; }
/* tabela da lista e do chamado aberto: cabeçalho leve, sem caixa alta, linhas arejadas */
#tab-os table { width: 100%; border-collapse: collapse; }
html body #tab-os table thead th { background: transparent; color: var(--texto-suave,#475569); text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 700; padding: 10px 8px; }
html body #tab-os table tbody td { padding: 12px 8px; font-size: 14px; border-top: 1px solid var(--bd,#e2e8f0); border-bottom: 0; vertical-align: middle; }
html body #tab-os #lista-os tr.os-destacada > td { background: var(--soft-in,#eff6ff); box-shadow: none; }
#tab-os #lista-os td:first-child { font-size: 14px; white-space: nowrap; }
html body #tab-os #lista-os .badge { display: inline-block; font-size: 13px; padding: 4px 10px; text-transform: none; letter-spacing: 0; white-space: nowrap; }
#tab-os #lista-os .badge::first-letter { text-transform: uppercase; }
/* criticidade sem piscar vira texto com a bolinha (a pílula fica para o que pede atenção) */
html body #tab-os #lista-os td:nth-child(3) > div:first-child > .badge:not(.pisca-alta):not(.pisca-urgente) { background: transparent !important; border-color: transparent !important; padding-left: 0; }
#tab-os #lista-os td:nth-child(3) > div + div { margin-top: 6px; }
#tab-os .equipe-pessoa > span { white-space: nowrap; }
/* chamado aberto */
html body #tab-os #ficha-os { border: 2px solid var(--ac,#1a56db); border-radius: 14px; padding: 20px 24px; }
#tab-os .ficha-faixa .badge { font-size: 13px; padding: 6px 14px; }
#tab-os .ficha-cards .rastro-card .rotulo { font-size: 12px; font-weight: 400; }
#tab-os .ficha-cards .rastro-card { border-radius: 10px; }

/* CELULAR: cada chamado vira um cartão (sem rolar a tabela para o lado) */
@media (max-width: 700px) {
  #tab-os .os-atalhos { grid-template-columns: 1fr 1fr; gap: 8px; }
  #tab-os #lista-os thead { display: none; }
  /* 1.230: os campos do botão "Filtros" moram no cabeçalho da tabela; no celular só a linha deles aparece, quando aberta, um campo embaixo do outro */
  #tab-os #lista-os thead:has(.linha-filtro:not([hidden])) { display: block; margin-bottom: 10px; }
  #tab-os #lista-os thead tr:not(.linha-filtro) { display: none; }
  #tab-os #lista-os thead tr.linha-filtro:not([hidden]) { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 12px; border: 1px solid var(--bd,#e2e8f0); border-radius: 12px; }
  html body #tab-os #lista-os thead tr.linha-filtro th { display: block; width: auto; padding: 0; border: 0; text-align: left; background: transparent; }
  html body #tab-os #lista-os thead tr.linha-filtro th:empty { display: none; }
  #tab-os #lista-os .linha-filtro th:nth-child(1)::before { content: "Número"; }
  #tab-os #lista-os .linha-filtro th:nth-child(2)::before { content: "Cliente e título"; }
  #tab-os #lista-os .linha-filtro th:nth-child(4)::before { content: "Técnico"; }
  #tab-os #lista-os .linha-filtro th:nth-child(5)::before { content: "Situação (para ver as canceladas, escolha aqui)"; }
  #tab-os #lista-os .linha-filtro th::before { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--texto-suave); }
  #tab-os #lista-os .linha-filtro th:nth-child(6)::before { content: none; }
  html body #tab-os #lista-os .linha-filtro :is(input, select, .btn) { width: 100%; min-width: 0; font-size: 16px; padding: 10px; }
  html body #tab-os #lista-os .linha-filtro th:nth-child(2) input { margin-top: 8px; }
  #tab-os #lista-os table, #tab-os #lista-os tbody { display: block; min-width: 0; }
  #tab-os #lista-os tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; padding: 12px; margin-bottom: 10px; border: 1px solid var(--bd,#e2e8f0); border-radius: 12px; }
  #tab-os #lista-os tbody tr[hidden] { display: none; }
  html body #tab-os #lista-os tbody td { display: block; padding: 0; border: 0; min-width: 0; background: transparent; box-shadow: none; }
  html body #tab-os #lista-os tr.os-destacada { background: var(--soft-in,#eff6ff); }
  #tab-os #lista-os td:nth-child(1), #tab-os #lista-os td:nth-child(2), #tab-os #lista-os td:nth-child(6) { grid-column: 1 / -1; }
  html body #tab-os #lista-os .btn-abrir-os { width: 100%; }
  #tab-os #lista-os .equipe-pessoa > span { white-space: normal; }
  #tab-os .acoes-linha { flex-wrap: wrap; }
  html body #tab-os #ficha-os { padding: 12px; }
  #tab-os .ficha-faixa > div:last-child { align-items: stretch !important; width: 100%; }
  .ficha-cards > * { flex-basis: 100% !important; }
  .ficha-cards .equipe-lado { flex-wrap: wrap; }
  #tab-os #ficha-os table thead { display: none; }
  #tab-os #ficha-os table, #tab-os #ficha-os tbody { display: block; }
  #tab-os #ficha-os tbody tr { display: grid; grid-template-columns: 34px 1fr; gap: 2px 8px; padding: 10px 0; border-top: 1px solid var(--bd,#e2e8f0); }
  html body #tab-os #ficha-os tbody td { display: block; padding: 0; border: 0; min-width: 0; grid-column: 2; }
  html body #tab-os #ficha-os tbody td:first-child { grid-column: 1; grid-row: 1 / span 4; }
  #tab-os .mapa-rastro { height: 320px; }
  #tab-os .balao-ponto, #tab-os .risco-balao { display: none; }   /* no celular a descrição aparece ao tocar no ponto (não cobre o mapa) */
}
html body #tab-os .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }   /* "Anexar imagem" (label) alinhado como os outros botões */

/* quadro de cima do chamado, igual à proposta (imagem do dono, 25/11): botões à direita, cada um com a sua borda */
html body #tab-os .ficha-faixa { padding: 14px 18px; border-radius: 10px; }
html body #tab-os .ficha-faixa.concluida { background: var(--soft-ok,#dcfce7); border: 1px solid #16a34a; color: var(--text,#14532d); }
#tab-os .ficha-faixa > div:first-child > div:first-child { font-size: 20px !important; }
#tab-os .ficha-faixa > div:last-child { margin-left: auto; }
html body #tab-os .ficha-faixa .btn.btn-imprimir-os { border-color: #166534; color: var(--text,#14532d); }
html body #tab-os .ficha-faixa .btn.btn-materiais { border-color: #b45309; color: var(--text,#854d0e); }
html body #tab-os .ficha-faixa .btn.btn-editar-os, html body #tab-os .ficha-faixa .btn.btn-classificar-os { border-color: var(--ac,#1a56db); color: var(--ac,#12409e); }
html body #tab-os .ficha-faixa .badge.info { background: #eff6ff; border: 1px solid #1a56db; color: #12409e; font-weight: 600; border-radius: 999px; }

/* comparação lado a lado com a proposta (25/11): mesmas larguras, cores dos atalhos, fotos e selos */
/* painel da empresa com a mesma largura em todas as abas: cabe o menu inteiro (22 itens = 1312px) sem barra de rolagem (pedido do dono, 25/11) */
.container:has(#tab-os), .container:has(#tab-os[style*="block"]) { max-width: 1360px; }
html:not([data-theme="dark"]) #tab-os .os-atalho[data-atalho="vencidas"] { background: #fef2f2; border-color: #dc2626; color: #991b1b; }
html:not([data-theme="dark"]) #tab-os .os-atalho[data-atalho="logo"] { background: #fefce8; border-color: #ca8a04; color: #854d0e; }
html:not([data-theme="dark"]) #tab-os .os-atalho[data-atalho="sem_tecnico"] { background: #ffffff; border-color: #cbd5e1; color: #334155; }
html:not([data-theme="dark"]) #tab-os .os-atalho[data-atalho="atendimento"] { background: #eff6ff; border-color: #1a56db; color: #12409e; }
#tab-os #lista-os .equipe-pessoa .avatar { width: 42px; height: 42px; flex: 0 0 42px; }
#tab-os #lista-os td:nth-child(5) > div { white-space: nowrap; }
html:not([data-theme="dark"]) body #tab-os #lista-os .badge.ok { background: #dcfce7; color: #166534; }
html:not([data-theme="dark"]) body #tab-os .ficha-faixa.concluida { background: #dcfce7; color: #14532d; }
html body #tab-os .ficha-cards .rastro-card { box-shadow: none; transform: none; }

/* 1.225: busca do Assunto (igual à busca de item do balcão): prováveis realçados, o marcado em destaque e o trecho digitado em negrito */
.os-busca-assunto { position: relative; margin-bottom: 8px; }
.os-busca-assunto > input { width: 100%; min-height: 44px; margin: 0; }
.os-busca-assunto .lista-sugestoes { max-height: 320px; overflow-y: auto; }
.os-busca-assunto .sugestao.provavel { background: var(--soft-wa,#fefce8); }
.os-busca-assunto .sugestao.fora strong { color: var(--wa,#92400e); }
.os-busca-assunto .sugestao.marcada { background: var(--soft-ac,#dbeafe); box-shadow: inset 4px 0 0 var(--ac,#1a56db); }
.os-busca-assunto mark { background: #fde68a; color: inherit; border-radius: 2px; padding: 0 1px; }
#tab-os #ficha-os .mapa-rastro { min-height: 460px; }   /* espaço para os balões ao redor dos pontos */
@media (max-width: 700px) { #tab-os #ficha-os .mapa-rastro { min-height: 320px; } }
.ficha-clicavel { cursor: pointer; }
.ficha-clicavel:hover { box-shadow: 0 0 0 2px var(--ac,#1a56db) inset !important; }
/* quadro de cima do mesmo tamanho da proposta: título à esquerda, botões numa linha à direita e, embaixo, atribuir + selos */
#tab-os .ficha-faixa { flex-wrap: nowrap; }
#tab-os .ficha-faixa > div:last-child { flex: 1 1 auto; min-width: 0; }
html body #tab-os .ficha-faixa .btn { padding: 0 12px; }
#tab-os .ficha-linha2 { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; }
#tab-os .ficha-linha2 > div { margin: 0; }
#tab-os .ficha-atribuir { display: inline-flex; align-items: center; gap: 6px; }
html body #tab-os .ficha-atribuir select.sel-tecnico { width: 165px !important; min-height: 36px; height: 36px; margin: 0; padding: 4px 8px; font-size: 14px; }
.ficha-selos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.ficha-selos > div { margin: 0; }
html body #tab-os .ficha-faixa .ficha-atribuir select.sel-tecnico { height: 44px; min-height: 44px; }
html body #tab-os .ficha-faixa .btn { font-size: 13.5px; }
@media (max-width: 900px) { #tab-os .ficha-faixa { flex-wrap: wrap; } #tab-os .ficha-faixa > div:last-child { flex-basis: 100%; } }
#tab-os #ficha-os td .com-avatar .avatar { width: 42px; height: 42px; flex: 0 0 42px; }   /* coluna "Quem" do histórico: foto do tamanho da proposta */
#tab-os .ficha-faixa > div:first-child { flex: 0 1 270px; min-width: 0; }
#tab-os .ficha-faixa.concluida > div:first-child { flex: 0 0 auto; max-width: 55%; }   /* concluída: poucos botões, a data cabe numa linha, como na proposta */

/* recolher so com a seta + botoes um pouco mais justos: o quadro de cima cabe numa linha (medido na tela do dono, 25/11) */
#tab-os .ficha-faixa:not(.concluida) > div:first-child { flex: 0 1 240px; }
html body #tab-os .ficha-faixa .btn { padding: 0 10px; }
html body #tab-os .ficha-faixa .ficha-atribuir select.sel-tecnico { width: 150px !important; }
html body #tab-os .ficha-faixa #btn-fechar-rastro { width: 40px; min-width: 40px; padding: 0; font-size: 18px; }

/* Equipe um pouco mais longe da Situacao (pedido do dono, 25/11): Criticidade fica no lugar original; so a Equipe comeca 30px antes; só no computador */
@media (min-width: 1360px) {
  #tab-os #lista-os thead th:nth-child(2) { width: 561px; }
  #tab-os #lista-os thead th:nth-child(3) { width: 148px; }
  #tab-os #lista-os thead th:nth-child(4) { width: 260px; }
  #tab-os #lista-os thead th:nth-child(5) { width: 99px; }
  html body #tab-os #lista-os tbody td:nth-child(3) .badge { white-space: normal; }
}

/* criticidade e prazo alinhados a esquerda (pedido do dono, 25/11): nenhuma caixinha sai da coluna; as linhas sem caixinha recuam o mesmo tanto, para bolinha, anel e texto começarem juntos */
@media (min-width: 901px) {
  html body #tab-os #lista-os tbody td:nth-child(3) > div:first-child > .badge:not(.pisca-alta):not(.pisca-urgente) { padding-left: 10px; }
  html body #tab-os #lista-os tbody td:nth-child(3) > div + div:not(:has(.badge)) { padding-left: 11px; }
  html body #tab-os #lista-os tbody td:nth-child(3) > div + div > .badge { padding-left: 11px; }
}

/* CELULAR 2: ajustes aprovados para mobile (25/11); padrão em docs/PADRAO-LAYOUT-PAINEL.md. Só vale em tela estreita */
@media (max-width: 480px) {
  /* topo: o nome da pessoa sai para a logo e o botão Sair caberem inteiros */
  body:has(#tab-os) .topbar:not(:has(#unidade-atual)) #nome-usuario { display: none; }
}
@media (max-width: 700px) {
  /* filtros em grade: busca na linha toda; Filtros + período; Ferramentas + Pendências lado a lado */
  html body #tab-os div:has(> #form-busca-os) { display: grid !important; grid-template-columns: max-content minmax(0, 1fr); gap: 8px; align-items: center; }
  #tab-os div:has(> #form-busca-os) > * { margin: 0 !important; min-width: 0 !important; max-width: none !important; width: auto !important; }
  #tab-os #form-busca-os, #tab-os div:has(> #btn-ferramentas-tecnicos) { grid-column: 1 / -1; width: 100% !important; }
  #tab-os #form-busca-os #busca-os { flex: 1 1 auto; width: 100%; min-width: 0; }
  html body #tab-os div:has(> #form-busca-os) > label { display: grid; grid-template-columns: minmax(0, 1fr) max-content; align-items: center; gap: 6px; font-size: 12px; line-height: 1.2; text-align: right; white-space: normal !important; }
  html body #tab-os #btn-filtros-os { min-width: max-content !important; padding: 0 12px; }
  html body #tab-os div:has(> #form-busca-os) > label > select { flex: 0 0 auto; margin: 0; }
  #tab-os div:has(> #btn-ferramentas-tecnicos) { display: flex; gap: 8px; }
  html body #tab-os div:has(> #btn-ferramentas-tecnicos) > .btn { flex: 1 1 auto; margin: 0; padding: 0 8px; font-size: 13.5px; }
  /* cartão da lista: situação e presencial/remoto na mesma linha */
  html body #tab-os #lista-os tbody td:nth-child(5) { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; grid-column: 1 / -1; }
  #tab-os #lista-os td:nth-child(5) > div:empty { display: none; }
  /* chamado aberto: botões em duas colunas iguais (sobrando um, ocupa a linha) */
  html body #tab-os .ficha-faixa > div:last-child > div:first-child { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
  #tab-os .ficha-faixa #ficha-acoes { display: contents; }
  #tab-os .ficha-faixa .ficha-atribuir { display: flex; flex: 1 1 100%; gap: 8px; }
  html body #tab-os .ficha-faixa .ficha-atribuir select.sel-tecnico { flex: 1 1 auto; min-width: 0; width: auto !important; }
  html body #tab-os .ficha-faixa .ficha-atribuir .btn { flex: 0 0 auto; }
  html body #tab-os .ficha-faixa > div:last-child > div:first-child > .btn,
  html body #tab-os .ficha-faixa #ficha-acoes > .btn { flex: 1 1 calc(50% - 8px); margin: 0; }
  html body #tab-os .ficha-faixa #btn-fechar-rastro { width: auto; font-size: 15px; }
  html body #tab-os .ficha-faixa #btn-fechar-rastro::after { content: "\00a0 Recolher"; font-size: 14px; }
  #tab-os .ficha-faixa .ficha-linha2 { justify-content: stretch; }
  html body #tab-os .ficha-faixa .ficha-linha2 > .badge { flex: 1 1 100%; text-align: center; }
}

/* vista de celular da empresa de apresentação (inicio.js › abrirVistaCelular) */
#vista-celular { position: fixed; inset: 0; z-index: 100000; background: #334155; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px; }
.vista-celular-barra { display: flex; gap: 4px; background: #1e293b; padding: 4px; border-radius: 999px; }
html body .vista-celular-barra button { border: 0; border-radius: 999px; padding: 9px 18px; min-height: 40px; font-weight: 700; cursor: pointer; background: transparent; color: #e2e8f0; }
html body .vista-celular-barra button.ativo { background: #ffffff; color: #0f172a; }
#vista-celular iframe { flex: 1 1 auto; width: 390px; max-width: 100%; max-height: 844px; border: 10px solid #0f172a; border-radius: 34px; background: #fff; box-sizing: content-box; }
@media (max-width: 700px) { #ap-celular { display: none; } }   /* quem já está no celular não precisa do botão */

/* 1.228: contrato em quatro quadros com nomes como no contrato (desenho aprovado pelo dono em 26/11) */
.quadro-contrato { border: 1px solid var(--cinza-borda); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.quadro-contrato[hidden] { display: none; }
.quadro-contrato > h4 { margin: 0; padding: 6px 14px; font-size: 13px; text-transform: uppercase; background: var(--s2, #eef2f7); }
.quadro-corpo { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 14px; padding: 10px 14px; align-items: end; }
.quadro-corpo > [hidden] { display: none !important; }
.quadro-corpo .campos-soltos { display: contents; }
.quadro-corpo .campo-largo { grid-column: span 2; }
.quadro-corpo .campo-cliente { grid-column: span 3; }
.quadro-corpo .campo-inteiro, .quadro-corpo > [style*="1/-1"], .quadro-corpo .campos-soltos > [style*="1/-1"] { grid-column: 1 / -1; }
.quadro-corpo .campo-marcar label { display: flex; gap: 8px; align-items: center; justify-content: flex-start; font-weight: 400; color: var(--texto); margin: 0; }
.quadro-corpo .campo-marcar input { width: auto; flex: none; margin: 0; }
.quadro-nota { margin: 0; font-size: 0.8rem; color: var(--texto-suave); }
@media (max-width: 900px) { .quadro-corpo { grid-template-columns: repeat(2, minmax(0, 1fr)); } .quadro-corpo .campo-cliente, .quadro-corpo .campo-largo { grid-column: 1 / -1; } }
@media (max-width: 560px) { .quadro-corpo { grid-template-columns: minmax(0, 1fr); } .quadro-corpo > *, .quadro-corpo .campos-soltos > * { grid-column: 1 / -1 !important; } }
