/* Razão — identidade: Numbers + Ajustes do macOS. Claro, neutro, tabular.
   Acento único: verde #1d8a45. Status só em pontos pequenos. */
:root {
  --acento: #1d8a45;
  --acento-forte: #176f38;
  --acento-suave: rgba(29, 138, 69, 0.09);
  --acento-anel: rgba(29, 138, 69, 0.55);
  --canvas: #f5f5f7;
  --folha: #ffffff;
  --linha: #e3e3e8;
  --linha-suave: #eeeef1;
  --hair: rgba(0, 0, 0, 0.08);
  --zebra: #fafafb;
  --cab: #f8f8fa;
  --tinta: #1d1d1f;
  --tinta-2: #3a3a3c;
  --mudo: #6b6b70;
  --mudo-2: #8a8a8f;
  --st-afazer: #a1a1a6;
  --st-andamento: #0a72e8;
  --st-entregue: #2f9e50;
  --st-atrasada: #e0443e;
  --st-aviso: #d98a00;
  --raio-card: 18px;
  --raio-util: 8px;
  --fonte: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --fonte-tit: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --fonte-num: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --vidro: saturate(180%) blur(20px);
  --sombra-objeto: 0 1px 2px rgba(0, 0, 0, 0.05), 0 18px 48px rgba(0, 0, 0, 0.16);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--tinta);
  font: 400 15px/1.45 var(--fonte); letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { font-family: var(--fonte-tit); font-weight: 600; margin: 0; text-wrap: balance; letter-spacing: -0.02em; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--acento); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
.ic { width: 20px; height: 20px; flex: none; }
.sr, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mudo { color: var(--mudo); }
.num, .n-tab { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.so-cel { display: none; }

/* ---------- botões ---------- */
.btn, .btn-2, .btn-t, .btn-ic, .tb-aba, .aba-pl, .seg button, .ctx-campo, .ctx-seta, .tb-busca, .tb-user, .cel-st, .chip-cal, .pu-item {
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 6px 16px; border-radius: 999px;
  background: var(--acento); color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap;
}
.btn:hover { background: var(--acento-forte); }
.btn .ic { width: 17px; height: 17px; }
.btn-2 {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 6px 14px; border-radius: 999px; white-space: nowrap;
  background: #fff; color: var(--tinta); border: 1px solid var(--linha); font-size: 14px;
}
.btn-2:hover { background: #f6f6f8; }
.btn-2 .ic { width: 17px; height: 17px; color: var(--mudo); }
.btn-t { color: var(--acento); font-size: 14px; font-weight: 600; padding: 4px 6px; border-radius: 6px; display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.btn-t:hover { background: var(--acento-suave); }
.btn-t .ic { width: 16px; height: 16px; }
.btn-ic { width: 34px; height: 34px; border-radius: 999px; display: inline-grid; place-items: center; color: var(--tinta-2); flex: none; }
.btn-ic:hover { background: rgba(0, 0, 0, 0.05); }
.btn-perigo { background: #c9302c; }
.btn-perigo:hover { background: #a92622; }
.btn-g { width: 100%; min-height: 46px; font-size: 16px; }
.btn:active, .btn-2:active, .btn-t:active, .btn-ic:active, .tb-aba:active, .seg button:active, .ctx-campo:active, .ctx-seta:active, .cel-st:active, .chip-cal:active, .tb-busca:active, .pu-item:active { transform: scale(0.97); }
.btn[disabled], .btn-2[disabled] { opacity: 0.45; pointer-events: none; }
.acoes-linha { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- casca ---------- */
.casca { display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); height: 100vh; height: 100dvh; }
.topo { position: relative; z-index: 20; }
.toolbar {
  display: flex; align-items: center; gap: 14px; padding: 6px 14px 4px;
  background: rgba(246, 246, 248, 0.86); backdrop-filter: var(--vidro); -webkit-backdrop-filter: var(--vidro);
  border-bottom: 1px solid var(--hair);
}
.tb-marca { display: flex; align-items: center; gap: 10px; color: var(--tinta); flex: none; min-width: 178px; }
.tb-nome { display: flex; flex-direction: column; line-height: 1.1; }
.tb-nome b { font: 600 17px/1.1 var(--fonte-tit); letter-spacing: -0.02em; }
.tb-nome small { font-size: 11.5px; color: var(--mudo); }
.tb-abas { display: flex; gap: 2px; overflow-x: auto; flex: 1 1 auto; min-width: 0; scrollbar-width: none; justify-content: safe center; padding: 2px; }
.tb-abas::-webkit-scrollbar { display: none; }
.tb-aba {
  display: flex; flex-direction: column; align-items: center; gap: 3px; flex: none;
  min-width: 66px; padding: 6px 7px 5px; border-radius: 9px; color: var(--tinta-2);
  font-size: 11.5px; line-height: 1.1; letter-spacing: 0;
}
.tb-aba .ic { width: 25px; height: 25px; stroke-width: 1.45; }
.tb-aba:hover { background: rgba(0, 0, 0, 0.045); }
.tb-aba[aria-current] { background: rgba(0, 0, 0, 0.065); color: var(--acento); font-weight: 600; }
.tb-dir { display: flex; align-items: center; gap: 6px; flex: none; }
.tb-busca {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 12px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.05); color: var(--mudo); font-size: 14px; min-width: 150px;
}
.tb-busca .ic { width: 16px; height: 16px; }
.tb-busca kbd, .bc-campo kbd { margin-left: auto; font: 500 11px var(--fonte); color: var(--mudo-2); border: 1px solid var(--linha); background: #fff; border-radius: 5px; padding: 1px 5px; }
.tb-busca:hover { background: rgba(0, 0, 0, 0.075); }
.tb-sino { position: relative; }
.badge { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--st-atrasada); color: #fff; font: 600 10.5px/17px var(--fonte); text-align: center; }
.tb-user { display: flex; align-items: center; gap: 8px; padding: 3px 8px 3px 3px; border-radius: 999px; }
.tb-user:hover { background: rgba(0, 0, 0, 0.05); }
.tb-un { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.tb-un b { font-size: 13px; font-weight: 600; }
.tb-un small { font-size: 11px; color: var(--mudo); }
.av { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; background: #e6e6eb; color: var(--tinta-2); font: 600 11.5px var(--fonte); flex: none; letter-spacing: 0; }
.av-eu { background: var(--acento); color: #fff; }
.av-g { width: 44px; height: 44px; font-size: 15px; }
.pes { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.pes .av { width: 22px; height: 22px; font-size: 9.5px; }

/* faixa de contexto */
.contexto {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 7px 20px; background: rgba(245, 245, 247, 0.9); backdrop-filter: var(--vidro); -webkit-backdrop-filter: var(--vidro);
  border-bottom: 1px solid var(--hair);
}
.ctx-grupo { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ctx-comp { display: flex; align-items: center; background: #fff; border: 1px solid var(--linha); border-radius: 10px; }
.ctx-seta { width: 30px; height: 38px; display: grid; place-items: center; color: var(--mudo); border-radius: 9px; }
.ctx-seta .ic { width: 16px; height: 16px; }
.ctx-seta:hover { background: #f3f3f5; color: var(--tinta); }
.ctx-campo { display: flex; flex-direction: column; align-items: flex-start; padding: 3px 10px; line-height: 1.15; border-radius: 9px; text-align: left; }
.ctx-campo small { font-size: 10.5px; color: var(--mudo); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.ctx-campo b { font-size: 14px; font-weight: 600; white-space: nowrap; }
.ctx-campo:hover { background: #f6f6f8; }
.ctx-comp .ctx-campo b { min-width: 128px; }
.ctx-emp { position: relative; flex-direction: row; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--linha); border-radius: 10px; padding: 3px 10px; min-height: 40px; max-width: 320px; }
.ctx-emp > small { position: absolute; top: 3px; left: 10px; }
.ctx-emp b { padding-top: 12px; overflow: hidden; text-overflow: ellipsis; min-width: 150px; }
.ctx-emp .ic { width: 15px; height: 15px; color: var(--mudo); }
.ctx-limpa { width: 28px; height: 28px; margin-left: -6px; }
.ctx-limpa .ic { width: 15px; height: 15px; }
.ctx-st { font-size: 13px; color: var(--mudo); white-space: nowrap; }
.selo-demo { font-size: 12px; color: var(--mudo); border: 1px dashed #cfcfd6; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.ctx-dir { margin-left: auto; }

/* palco e folha */
.palco { min-height: 0; min-width: 0; padding: 16px 20px 18px; overflow: hidden; outline: none; }
.folha {
  height: 100%; display: flex; flex-direction: column; min-height: 0;
  background: var(--folha); border: 1px solid var(--linha); border-radius: var(--raio-card); overflow: hidden;
}
.folha-topo { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 18px 24px 12px; flex-wrap: wrap; }
.folha-tit { min-width: 0; }
.folha-tit h1 { font-size: 24px; line-height: 1.15; }
.folha-tit .sub { color: var(--mudo); font-size: 14px; margin-top: 3px; }
.folha-tit .voltar { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.folha-tit .voltar .ic { width: 15px; height: 15px; }
.folha-acoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.folha-ferr { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 24px 12px; border-bottom: 1px solid var(--linha); }
.folha-ferr .espaco { flex: 1; }
.folha-corpo { flex: 1; min-height: 0; overflow: auto; position: relative; }
.folha-corpo.pad, .pad { padding: 20px 24px; }
.abas-pl { display: flex; gap: 2px; padding: 0 14px 8px; background: #f1f1f4; border-top: 1px solid var(--linha); overflow-x: auto; scrollbar-width: none; flex: none; }
.abas-pl::-webkit-scrollbar { display: none; }
.aba-pl {
  margin-top: -1px; padding: 7px 16px 8px; border: 1px solid transparent; border-top: 0; border-radius: 0 0 9px 9px;
  font-size: 13px; color: var(--mudo); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.aba-pl:hover { color: var(--tinta); background: rgba(0, 0, 0, 0.035); }
.aba-pl[aria-current] { background: #fff; border-color: var(--linha); color: var(--tinta); font-weight: 600; }
.aba-pl .n { font-size: 11.5px; color: var(--mudo); background: rgba(0, 0, 0, 0.055); border-radius: 999px; padding: 0 6px; font-weight: 500; }

/* filtros */
.busca-campo { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 999px; background: #f2f2f5; border: 1px solid transparent; min-width: 250px; }
.busca-campo:focus-within { background: #fff; border-color: var(--acento); box-shadow: 0 0 0 3px var(--acento-suave); }
.busca-campo .ic { width: 16px; height: 16px; color: var(--mudo); }
.busca-campo input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: 14px; }
.filtro { position: relative; display: inline-flex; align-items: center; }
.filtro select { appearance: none; -webkit-appearance: none; height: 34px; padding: 0 30px 0 12px; border-radius: 999px; border: 1px solid var(--linha); background: #fff; font-size: 13.5px; cursor: pointer; max-width: 230px; }
.filtro select:focus-visible { outline: 2px solid var(--acento); outline-offset: 1px; }
.filtro .ic { position: absolute; right: 10px; width: 14px; height: 14px; color: var(--mudo); pointer-events: none; }
.seg { display: inline-flex; background: #ececf0; border-radius: 9px; padding: 2px; }
.seg button { padding: 5px 12px; border-radius: 7px; font-size: 13px; color: var(--tinta-2); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--tinta); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }

/* ---------- tabela "planilha bonita" ---------- */
.tabela-env { min-width: 0; }
.tabela { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tabela th {
  position: sticky; top: 0; z-index: 2; background: var(--cab); text-align: left; font-weight: 600; font-size: 12px;
  color: var(--mudo); padding: 8px 12px; border-bottom: 1px solid var(--linha); white-space: nowrap; letter-spacing: 0;
}
.tabela td { padding: 8px 12px; border-bottom: 1px solid var(--linha-suave); vertical-align: middle; }
.tabela tbody tr:nth-child(even) td { background: var(--zebra); }
.tabela .num { text-align: right; white-space: nowrap; }
.tabela tfoot td { position: sticky; bottom: 0; background: #f4f4f7; font-weight: 600; border-top: 1px solid var(--linha); border-bottom: 0; z-index: 1; }
.tabela .lin-n { width: 38px; padding: 8px 4px 8px 10px; text-align: right; color: #b3b3b8; font-size: 11.5px; background: var(--cab) !important; border-right: 1px solid var(--linha-suave); }
.tabela th.lin-n { z-index: 3; }
.tabela tr.clic { cursor: pointer; }
.tabela tr.clic:hover td { background: #f0f7f2; }
.tabela tr.clic:focus-visible { outline: 2px solid var(--acento); outline-offset: -2px; }
.tabela tr.realce td { background: #fff8f7; }
.tabela td .tag + .tag { margin-left: 4px; }
.tabela td b { font-weight: 600; }
.tabela td small { display: block; color: var(--mudo); font-size: 12.5px; }
.tabela .t-nome { min-width: 180px; }
.tabela .nowrap { white-space: nowrap; }
.prog-mini { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.prog-mini i { display: block; width: 54px; height: 5px; border-radius: 3px; background: #ebebef; overflow: hidden; }
.prog-mini i b { display: block; height: 100%; background: var(--acento); }
.prog-mini span { font-size: 12.5px; color: var(--mudo); }

/* status com pontinho */
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; color: var(--tinta-2); }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--st-afazer); flex: none; }
.st-andamento::before { background: var(--st-andamento); }
.st-entregue::before, .st-verde::before { background: var(--st-entregue); }
.st-atrasada::before, .st-vermelho::before { background: var(--st-atrasada); }
.st-atrasada { color: #b42318; }
.st-aviso::before { background: var(--st-aviso); }
.st-azul::before { background: var(--st-andamento); }
.st-cinza::before { background: var(--st-afazer); }
.tag { display: inline-flex; align-items: center; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: #f0f0f3; color: var(--tinta-2); white-space: nowrap; line-height: 1.6; }
.tag-reg { font-weight: 600; font-size: 11.5px; }
.tag-ac { background: var(--acento-suave); color: var(--acento-forte); }

/* ---------- vazio ---------- */
.vazio { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 56px 24px; color: var(--mudo); max-width: 460px; margin: 0 auto; }
.vazio .ic { width: 38px; height: 38px; color: #c4c4ca; stroke-width: 1.3; margin-bottom: 4px; }
.vazio h3 { color: var(--tinta); font-size: 18px; }
.vazio p { font-size: 14.5px; }
.vazio .btn, .vazio .btn-2 { margin-top: 8px; }

/* ---------- formulários ---------- */
.campos { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px 14px; }
.campo { grid-column: span 6; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.campo.meia { grid-column: span 3; }
.campo.terco { grid-column: span 2; }
.campos-secao { grid-column: span 6; font-size: 13px; color: var(--mudo); text-transform: uppercase; letter-spacing: 0.05em; padding-top: 8px; border-top: 1px solid var(--linha-suave); display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.campos-secao:first-child { border-top: 0; padding-top: 0; }
.campos-secao small { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 12.5px; }
.rot { font-size: 13px; font-weight: 600; color: var(--tinta-2); }
.rot i { color: var(--st-atrasada); font-style: normal; }
.campo input:not([type=checkbox]):not([type=radio]):not([type=file]), .campo select, .campo textarea, .moeda {
  width: 100%; min-height: 38px; padding: 7px 11px; border: 1px solid #d9d9df; border-radius: var(--raio-util); background: #fff; font-size: 15px; outline: none;
}
.campo textarea { resize: vertical; line-height: 1.45; }
.campo select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6b70' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; padding-right: 30px; }
.campo input:focus, .campo select:focus, .campo textarea:focus, .moeda:focus-within { border-color: var(--acento); box-shadow: 0 0 0 3px var(--acento-suave); }
.campo input[readonly] { background: #f7f7f9; color: var(--tinta-2); }
.moeda { display: flex; align-items: center; gap: 6px; padding: 0 0 0 11px; }
.moeda span { color: var(--mudo); font-size: 14px; }
.moeda input { border: 0 !important; box-shadow: none !important; padding-left: 0 !important; min-height: 36px !important; }
.ajuda { color: var(--mudo); font-size: 12.5px; }
.erro { color: #b42318; font-size: 12.5px; display: none; }
.com-erro .erro { display: block; }
.com-erro input, .com-erro select, .com-erro textarea { border-color: #e0443e !important; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 1px solid var(--linha); border-radius: 999px; font-size: 14px; cursor: pointer; background: #fff; }
.check:has(input:checked) { border-color: var(--acento); background: var(--acento-suave); color: var(--acento-forte); font-weight: 600; }
.check input, .ck input, .toggle input { accent-color: var(--acento); width: 16px; height: 16px; margin: 0; }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; min-height: 30px; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .trilho { width: 38px; height: 23px; border-radius: 999px; background: #dcdce1; position: relative; transition: background 0.2s; flex: none; }
.toggle .trilho::after { content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.toggle input:checked + .trilho { background: var(--acento); }
.toggle input:checked + .trilho::after { transform: translateX(15px); }
.toggle input:focus-visible + .trilho { outline: 2px solid var(--acento); outline-offset: 2px; }
.info-campo { padding: 8px 0; font-size: 14.5px; color: var(--tinta-2); }
.nota { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: #f6f6f8; border: 1px solid var(--linha-suave); font-size: 13.5px; color: var(--tinta-2); }
.nota .ic { width: 18px; height: 18px; color: var(--mudo); margin-top: 1px; }
.nota b { color: var(--tinta); }
.nota-aviso { background: #fffaf0; border-color: #f3e3bd; }
.nota-aviso .ic { color: var(--st-aviso); }

/* ---------- sheet ---------- */
.sheet-fundo { position: fixed; inset: 0; z-index: 60; background: rgba(20, 20, 24, 0); transition: background 0.2s ease; }
.sheet-fundo.aberto { background: rgba(20, 20, 24, 0.18); }
.sheet {
  position: absolute; top: 10px; right: 10px; bottom: 10px; width: min(560px, calc(100% - 20px));
  background: rgba(255, 255, 255, 0.97); backdrop-filter: var(--vidro); -webkit-backdrop-filter: var(--vidro);
  border-radius: var(--raio-card); box-shadow: var(--sombra-objeto); display: flex; flex-direction: column;
  transform: translateX(calc(100% + 20px)); transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); outline: none; overflow: hidden;
}
.sheet.larga { width: min(760px, calc(100% - 20px)); }
.sheet-fundo.aberto .sheet { transform: none; }
.sheet-fundo.sem-anim, .sheet-fundo.sem-anim .sheet { transition: none; }
.sheet-topo { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 18px 12px 24px; border-bottom: 1px solid var(--linha-suave); }
.sheet-tit h2 { font-size: 20px; line-height: 1.2; }
.sheet-tit .sub { color: var(--mudo); font-size: 13.5px; margin-top: 3px; }
.sheet-corpo { flex: 1; overflow: auto; padding: 18px 24px 24px; }
.sheet-rodape { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--linha-suave); background: rgba(250, 250, 252, 0.9); }
.sheet-rodape .esq { margin-right: auto; }
.det { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--linha); border-radius: 12px; overflow: hidden; margin-bottom: 18px; }
.det > div { padding: 9px 14px; border-bottom: 1px solid var(--linha-suave); min-width: 0; }
.det > div:nth-child(odd) { border-right: 1px solid var(--linha-suave); }
.det dt, .det .k { font-size: 11.5px; color: var(--mudo); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.det dd, .det .v { margin: 2px 0 0; font-size: 14.5px; overflow-wrap: anywhere; }
.det .inteira { grid-column: span 2; border-right: 0 !important; }
.sec-tit { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mudo); margin: 18px 0 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sec-tit:first-child { margin-top: 0; }
.checklist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--linha); border-radius: 12px; overflow: hidden; }
.checklist li { border-bottom: 1px solid var(--linha-suave); }
.checklist li:last-child { border-bottom: 0; }
.ck { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; font-size: 14.5px; min-height: 44px; }
.ck input { width: 18px; height: 18px; }
.ck:has(input:checked) span { color: var(--mudo); text-decoration: line-through; text-decoration-color: #c4c4ca; }
.ck:hover { background: #fafafb; }

/* ---------- diálogo, toast, popover ---------- */
.dlg-fundo { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(20, 20, 24, 0); transition: background 0.18s; }
.dlg-fundo.aberto { background: rgba(20, 20, 24, 0.24); }
.dlg { width: min(440px, 100%); background: #fff; border-radius: var(--raio-card); box-shadow: var(--sombra-objeto); padding: 22px 22px 16px; transform: scale(0.96); opacity: 0; transition: transform 0.18s, opacity 0.18s; max-height: calc(100dvh - 32px); overflow: auto; outline: none; }
.dlg.dlg-l { width: min(620px, 100%); }
.dlg-fundo.aberto .dlg { transform: none; opacity: 1; }
.dlg h2 { font-size: 19px; margin-bottom: 8px; }
.dlg-corpo { color: var(--tinta-2); font-size: 14.5px; }
.dlg-corpo h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mudo); margin: 14px 0 6px; }
.dlg-botoes { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dlg-destaque { font-size: 15px; }
.kpi-num { font: 600 30px/1 var(--fonte-num); color: var(--acento); letter-spacing: -0.02em; margin-right: 2px; }
.resumo-grade { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.linha-res { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--linha-suave); font-size: 14px; }
.chips-res { display: flex; flex-wrap: wrap; gap: 6px; }
#toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100% - 24px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; background: rgba(29, 29, 31, 0.94); color: #fff; padding: 10px 12px 10px 14px; border-radius: 14px; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22); transform: translateY(12px); opacity: 0; transition: transform 0.2s, opacity 0.2s; max-width: 560px; }
.toast.vis { transform: none; opacity: 1; }
.toast .ic { width: 17px; height: 17px; color: #7fd69a; }
.toast-btn { color: #7fd69a; font-weight: 600; padding: 3px 6px; border-radius: 6px; }
.pop { position: fixed; z-index: 70; background: rgba(255, 255, 255, 0.96); backdrop-filter: var(--vidro); -webkit-backdrop-filter: var(--vidro); border: 1px solid var(--hair); border-radius: 14px; box-shadow: var(--sombra-objeto); opacity: 0; transform: translateY(-4px); transition: opacity 0.15s, transform 0.15s; max-height: calc(100dvh - 90px); overflow: auto; }
.pop.aberto { opacity: 1; transform: none; }
.pop-p { padding: 10px; }
.pop-larga { width: min(380px, calc(100vw - 16px)); }
.pop-comp { width: 268px; }
.pop-cab { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 6px; }
.pop-meses { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pop-meses button { position: relative; padding: 9px 0; border-radius: 8px; font-size: 14px; text-transform: capitalize; }
.pop-meses button:hover { background: #f2f2f5; }
.pop-meses button.sel { background: var(--acento); color: #fff; font-weight: 600; }
.pop-meses button i, .pop-nota i { position: absolute; bottom: 4px; left: 50%; margin-left: -2px; width: 4px; height: 4px; border-radius: 50%; background: var(--acento); }
.pop-meses button.sel i { background: #fff; }
.pop-nota { position: relative; font-size: 12px; color: var(--mudo); padding: 8px 4px 0 14px; }
.pop-nota i { left: 4px; top: 14px; bottom: auto; margin: 0; }
.pop-emp .busca-campo { min-width: 0; margin-bottom: 6px; }
.pop-lista { display: flex; flex-direction: column; max-height: 360px; overflow: auto; }
.pop-lista button { text-align: left; padding: 8px 10px; border-radius: 8px; display: flex; flex-direction: column; }
.pop-lista button small { color: var(--mudo); font-size: 12px; }
.pop-lista button:hover { background: #f2f2f5; }
.pop-lista button.sel { background: var(--acento-suave); }
.pop-lista button.sel b { color: var(--acento-forte); }
.pop-user { width: 280px; }
.pu-cab { display: flex; gap: 12px; padding: 6px 6px 12px; border-bottom: 1px solid var(--linha-suave); margin-bottom: 6px; }
.pu-cab div { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.pu-cab small { color: var(--mudo); font-size: 12.5px; }
.pu-nota { font-size: 12.5px; color: var(--mudo); padding: 4px 8px 8px; }
.pu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 8px; border-radius: 8px; font-size: 14px; }
.pu-item:hover { background: #f2f2f5; }
.pu-item .ic { width: 18px; height: 18px; color: var(--mudo); }
.pop-notif .pn-cab { display: flex; justify-content: space-between; align-items: center; padding: 2px 6px 8px; }
.pop-notif ul { list-style: none; margin: 0; padding: 0; }
.pop-notif li a { display: flex; gap: 10px; padding: 9px 8px; border-radius: 10px; color: var(--tinta); }
.pop-notif li a:hover { background: #f4f4f6; }
.pop-notif li a .ic { width: 18px; height: 18px; color: var(--mudo); margin-top: 2px; }
.pop-notif li.nv-alto a .ic { color: var(--st-atrasada); }
.pop-notif li.nv-medio a .ic { color: var(--st-aviso); }
.pop-notif li a span { display: flex; flex-direction: column; min-width: 0; }
.pop-notif li a b { font-size: 14px; font-weight: 600; }
.pop-notif li a small { color: var(--mudo); font-size: 12.5px; }
.pop-notif li.lida { opacity: 0.6; }
.pop-notif .vazio { padding: 24px 12px; }

/* busca global */
.busca-fundo { position: fixed; inset: 0; z-index: 85; background: rgba(20, 20, 24, 0); display: flex; justify-content: center; padding: 12vh 16px 16px; transition: background 0.15s; }
.busca-fundo.aberto { background: rgba(20, 20, 24, 0.22); }
.busca-caixa { width: min(640px, 100%); align-self: flex-start; background: rgba(255, 255, 255, 0.97); backdrop-filter: var(--vidro); -webkit-backdrop-filter: var(--vidro); border-radius: var(--raio-card); box-shadow: var(--sombra-objeto); overflow: hidden; opacity: 0; transform: scale(0.98); transition: opacity 0.15s, transform 0.15s; }
.busca-fundo.aberto .busca-caixa { opacity: 1; transform: none; }
.bc-campo { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--linha-suave); }
.bc-campo .ic { width: 20px; height: 20px; color: var(--mudo); }
.bc-campo input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 18px; min-width: 0; }
.bc-res { max-height: 56vh; overflow: auto; padding: 6px 8px 10px; }
.bc-res h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mudo); padding: 10px 8px 4px; }
.bc-item { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 10px; color: var(--tinta); }
.bc-item .ic { width: 18px; height: 18px; color: var(--mudo); }
.bc-item span { display: flex; flex-direction: column; min-width: 0; }
.bc-item b { font-weight: 600; font-size: 14.5px; }
.bc-item small { color: var(--mudo); font-size: 12.5px; }
.bc-item.sel, .bc-item:hover { background: var(--acento-suave); }
.bc-dica { color: var(--mudo); padding: 14px 10px; font-size: 14px; }

/* ---------- dashboard ---------- */
.painel { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.celula { padding: 18px 22px; border-bottom: 1px solid var(--linha); border-right: 1px solid var(--linha); min-width: 0; }
.celula h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mudo); margin-bottom: 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.celula h3 a { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; }
.c-3 { grid-column: span 3; } .c-4 { grid-column: span 4; } .c-5 { grid-column: span 5; } .c-6 { grid-column: span 6; } .c-7 { grid-column: span 7; } .c-8 { grid-column: span 8; } .c-12 { grid-column: span 12; }
.kpis { grid-column: span 12; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; background: var(--linha); border-bottom: 1px solid var(--linha); }
.kpis.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { padding: 16px 20px 18px; min-width: 0; color: var(--tinta); display: block; background: #fff; }
a.kpi:hover { background: #fafafb; }
.kpi .k { font-size: 12.5px; color: var(--mudo); display: flex; align-items: center; gap: 6px; }
.kpi .v { font: 600 36px/1.05 var(--fonte-num); letter-spacing: -0.03em; margin-top: 6px; white-space: nowrap; }
.kpi .v small { font-size: 18px; color: var(--mudo); font-weight: 600; letter-spacing: -0.01em; }
.kpi .s { font-size: 12.5px; color: var(--mudo); margin-top: 4px; }
.kpi.alerta .v { color: #c22f29; }
.prog-comp .frase { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 12px; text-wrap: balance; }
.prog-comp .frase b { font: 600 34px/1 var(--fonte-num); color: var(--acento); letter-spacing: -0.03em; margin-right: 2px; }
.barra { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: #ececf0; gap: 2px; }
.barra span { display: block; height: 100%; }
.barra.fina { height: 6px; border-radius: 3px; gap: 1px; }
.b-entregue { background: var(--acento); }
.b-andamento { background: var(--st-andamento); }
.b-afazer { background: #cfcfd5; }
.b-atrasada { background: var(--st-atrasada); }
.b-vazio { background: transparent; }
.legenda { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13px; color: var(--mudo); }
.legenda b { color: var(--tinta); font-weight: 600; margin-left: 2px; }
.setores { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 22px; }
.setor-l { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 13.5px; align-items: center; }
.setor-l .barra { grid-column: span 2; }
.setor-l span:last-of-type { color: var(--mudo); font-size: 12.5px; }
.ranking { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.ranking li { display: grid; grid-template-columns: 22px 1fr auto; gap: 4px 10px; align-items: center; }
.ranking .pos { font: 600 13px var(--fonte-num); color: var(--mudo); }
.ranking .nm { font-size: 14px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.ranking .qt { font: 600 18px var(--fonte-num); }
.ranking .barra { grid-column: 2 / span 2; height: 7px; }
.lista-mini { list-style: none; margin: 0; padding: 0; }
.lista-mini li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--linha-suave); font-size: 14px; }
.lista-mini li:last-child { border-bottom: 0; }
.lista-mini .q { display: flex; flex-direction: column; min-width: 0; }
.lista-mini .q small { color: var(--mudo); font-size: 12.5px; }
.lista-mini .d { text-align: right; white-space: nowrap; font-size: 13px; color: var(--mudo); }
.lista-mini a { color: var(--tinta); }
.data-dia { display: inline-grid; place-items: center; width: 40px; flex: none; text-align: center; line-height: 1.05; }
.data-dia b { font: 600 18px var(--fonte-num); }
.data-dia small { font-size: 10.5px; text-transform: uppercase; color: var(--mudo); }
.ola { font-size: 14px; color: var(--mudo); }

/* gráficos */
.grafico { margin: 0; }
.grafico figcaption { font-size: 13px; color: var(--mudo); margin-bottom: 6px; }
.grafico svg { width: 100%; height: auto; max-height: 340px; display: block; overflow: visible; }
.g-grade { stroke: #ededf0; stroke-width: 1; }
.g-eixo { fill: var(--mudo); font: 11px var(--fonte); font-variant-numeric: tabular-nums; }
.g-a { fill: var(--acento); }
.g-b { fill: #c9e6d2; }
.g-c { fill: #b9b9c0; }
.g-azul { fill: var(--st-andamento); }
.g-verm { fill: var(--st-atrasada); }
.g-ok { fill: var(--acento); fill-opacity: 0.85; }
.g-mal { fill: var(--st-atrasada); fill-opacity: 0.85; }
.g-meio { fill: var(--st-aviso); fill-opacity: 0.85; }
.g-leg { display: flex; gap: 16px; font-size: 12.5px; color: var(--mudo); margin-top: 6px; flex-wrap: wrap; }
.g-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.g-leg i.g-a { background: var(--acento); } .g-leg i.g-b { background: #c9e6d2; } .g-leg i.g-c { background: #b9b9c0; } .g-leg i.g-verm { background: var(--st-atrasada); } .g-leg i.g-azul { background: var(--st-andamento); }
.rosca { display: block; }
.rosca-v { font: 600 22px var(--fonte-num); fill: var(--tinta); }
.rosca-s { font: 11px var(--fonte); fill: var(--mudo); }
.gs-entregue { stroke: var(--acento); } .gs-andamento { stroke: var(--st-andamento); } .gs-afazer { stroke: #cfcfd5; } .gs-atrasada { stroke: var(--st-atrasada); }

/* ---------- calendário de obrigações ---------- */
.cal-topo { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 24px 10px; flex-wrap: wrap; }
.cal-topo h2 { font-size: 18px; }
.cal-topo h2 small { font: 400 13.5px var(--fonte); color: var(--mudo); text-transform: none; margin-left: 6px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--linha); }
.cal-dsem { padding: 6px 10px; font-size: 11.5px; color: var(--mudo); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; background: var(--cab); border-bottom: 1px solid var(--linha); border-right: 1px solid var(--linha-suave); }
.cal-dia { min-height: 112px; padding: 6px 6px 8px; border-right: 1px solid var(--linha-suave); border-bottom: 1px solid var(--linha-suave); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-dia:nth-child(7n) { border-right: 0; }
.cal-dia.fora { background: #fbfbfc; }
.cal-dia.fora .cal-n { color: #c7c7cc; }
.cal-dia.fds { background: #fafafb; }
.cal-n { font: 600 13px var(--fonte-num); color: var(--tinta-2); display: flex; align-items: center; gap: 6px; padding: 2px 4px 4px; }
.cal-n .hoje { background: var(--acento); color: #fff; border-radius: 999px; min-width: 22px; height: 22px; display: inline-grid; place-items: center; padding: 0 5px; }
.cal-n small { font: 400 10.5px var(--fonte); color: var(--mudo); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-cal { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; padding: 3px 7px; border-radius: 6px; font-size: 12px; line-height: 1.35; background: #f3f3f6; color: var(--tinta); min-width: 0; }
.chip-cal::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--st-afazer); }
.chip-cal span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-cal em { font-style: normal; color: var(--mudo); font-size: 11px; }
.chip-cal:hover { background: #e9e9ee; }
.chip-cal.cs-andamento { background: #eef5ff; } .chip-cal.cs-andamento::before { background: var(--st-andamento); }
.chip-cal.cs-entregue { background: #eef8f1; color: #2a5f3b; } .chip-cal.cs-entregue::before { background: var(--st-entregue); }
.chip-cal.cs-atrasada { background: #fdf0ef; color: #9b1c16; } .chip-cal.cs-atrasada::before { background: var(--st-atrasada); }
.cal-mais { font-size: 11.5px; color: var(--mudo); padding: 0 7px; }
.cal-leg { display: flex; gap: 14px; flex-wrap: wrap; }
.agenda-cel { display: none; }

/* ---------- matriz empresas × obrigações ---------- */
.matriz-env { overflow: auto; }
.matriz { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
.matriz th, .matriz td { border-bottom: 1px solid var(--linha-suave); border-right: 1px solid var(--linha-suave); padding: 0; }
.matriz thead th { position: sticky; top: 0; z-index: 3; background: var(--cab); font-size: 11.5px; font-weight: 600; color: var(--mudo); padding: 8px 6px; white-space: nowrap; text-align: center; border-bottom: 1px solid var(--linha); }
.matriz th.m-emp, .matriz td.m-emp { position: sticky; left: 0; z-index: 2; background: #fff; text-align: left; min-width: 210px; max-width: 240px; padding: 6px 12px; border-right: 1px solid var(--linha); }
.matriz thead th.m-emp { z-index: 4; background: var(--cab); }
.matriz tbody tr:nth-child(even) td, .matriz tbody tr:nth-child(even) td.m-emp { background: var(--zebra); }
.matriz td.m-emp b { display: block; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.matriz td.m-emp small { color: var(--mudo); font-size: 11.5px; }
.matriz td.m-prog { padding: 6px 12px; white-space: nowrap; text-align: right; font-size: 12.5px; color: var(--mudo); }
.matriz tfoot td { position: sticky; bottom: 0; background: #f4f4f7 !important; font-weight: 600; font-size: 12px; text-align: center; padding: 7px 6px; border-top: 1px solid var(--linha); z-index: 2; }
.matriz tfoot td.m-emp { z-index: 3; }
.cel-st { width: 100%; min-width: 74px; height: 40px; display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 12px; color: var(--tinta-2); }
.cel-st::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--st-afazer); }
.cel-st:hover { background: #eef7f1; }
.cel-st.cs-andamento::before { background: var(--st-andamento); }
.cel-st.cs-entregue { color: #2a5f3b; } .cel-st.cs-entregue::before { background: var(--st-entregue); }
.cel-st.cs-atrasada { color: #9b1c16; background: #fff6f5; } .cel-st.cs-atrasada::before { background: var(--st-atrasada); }
.cel-na { display: block; height: 40px; background: repeating-linear-gradient(135deg, transparent 0 5px, #f2f2f5 5px 6px); }

/* ---------- demonstrativo impresso (balancete, DRE, guia) ---------- */
.papel-env { padding: 24px; background: #f1f1f4; min-height: 100%; }
.papel { max-width: 860px; margin: 0 auto; background: #fff; border: 1px solid #dcdce2; padding: 40px 48px 36px; color: #111; font-size: 13.5px; }
.papel-cab { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #111; padding-bottom: 12px; margin-bottom: 4px; }
.papel-cab h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.papel-cab p { font-size: 12.5px; color: #444; }
.papel-cab .dir { text-align: right; }
.papel-tit { text-align: center; margin: 18px 0 14px; }
.papel-tit h3 { font-size: 17px; text-transform: uppercase; letter-spacing: 0.1em; }
.papel-tit p { font-size: 12.5px; color: #444; margin-top: 3px; }
.dem { width: 100%; border-collapse: collapse; font-size: 13px; }
.dem th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: #333; border-bottom: 1px solid #111; padding: 6px 6px; font-weight: 600; }
.dem td { padding: 4px 6px; border-bottom: 1px dotted #c8c8ce; }
.dem .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dem .cod { color: #555; width: 70px; white-space: nowrap; }
.dem tr.g1 td { font-weight: 700; text-transform: uppercase; font-size: 12px; letter-spacing: 0.03em; border-bottom: 1px solid #999; padding-top: 10px; }
.dem tr.g2 td { font-weight: 600; }
.dem tr.tot td { font-weight: 700; border-top: 1px solid #111; border-bottom: 3px double #111; }
.dem tr.sub td { font-weight: 600; border-bottom: 1px solid #999; }
.dem tr.res td { font-weight: 700; font-size: 14px; border-top: 1px solid #111; border-bottom: 3px double #111; padding: 7px 6px; }
.dem .ind { padding-left: 22px; }
.papel-obs { font-size: 11.5px; color: #555; margin-top: 14px; }
.assinaturas { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 54px; }
.assinaturas div { border-top: 1px solid #111; padding-top: 6px; text-align: center; font-size: 12px; }
.assinaturas small { display: block; color: #555; }
.selo-ok { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #2a5f3b; }
.selo-ok .ic { width: 15px; height: 15px; }
.guia { border: 1.5px solid #111; }
.guia-lin { display: grid; grid-template-columns: 1.4fr 1fr; border-bottom: 1px solid #111; }
.guia-lin > div { padding: 8px 10px; border-right: 1px solid #111; min-height: 46px; }
.guia-lin > div:last-child { border-right: 0; }
.guia-lin small { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.05em; color: #444; }
.guia-lin b { font-size: 14px; }
.guia-cod { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.08em; font-size: 13px; padding: 12px 10px; text-align: center; }
.marca-demo { margin-top: 10px; font-size: 11px; color: #a11; text-align: center; text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- empresa (ficha) ---------- */
.ficha { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0; }
.ficha > section { padding: 20px 24px; border-right: 1px solid var(--linha); border-bottom: 1px solid var(--linha); min-width: 0; }
.ficha > section:nth-child(2n) { border-right: 0; }
.ficha h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mudo); margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.cartoes-reg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-bottom: 1px solid var(--linha); }
.cartao-reg { padding: 18px 22px; border-right: 1px solid var(--linha); min-width: 0; }
.cartao-reg:last-child { border-right: 0; }
.cartao-reg .v { font: 600 34px/1 var(--fonte-num); letter-spacing: -0.03em; margin: 6px 0 2px; }
.cartao-reg h3 { font-size: 15px; }
.cartao-reg p { font-size: 12.5px; color: var(--mudo); }
.sel-inline { appearance: none; -webkit-appearance: none; border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 4px 22px 4px 6px; font-size: 13.5px; cursor: pointer; max-width: 170px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6b70' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 4px center; background-size: 12px; }
.sel-inline:hover { border-color: var(--linha); background-color: #fff; }

/* ---------- regras do motor ---------- */
.motor-topo { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 0; border-bottom: 1px solid var(--linha); }
.motor-topo > div { padding: 18px 24px; min-width: 0; }
.motor-topo > div + div { border-left: 1px solid var(--linha); }
.motor-gerar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.hist { list-style: none; margin: 0; padding: 0; font-size: 13px; max-height: 150px; overflow: auto; }
.hist li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--linha-suave); }
.hist li span:last-child { color: var(--mudo); text-align: right; }
.regra-frase { font-size: 14px; line-height: 1.5; }
.regra-frase b { font-weight: 600; }
.ck-editor textarea { font-size: 14px; }
.previa { border: 1px solid var(--linha); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; background: #fafafb; }
.previa .chips-res { margin-top: 8px; }

/* ---------- entrada ---------- */
body.na-entrada { background: var(--canvas); }
.entrada { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.ent-apres { padding: 56px 64px; display: flex; flex-direction: column; justify-content: center; gap: 22px; max-width: 760px; justify-self: end; width: 100%; }
.ent-marca { display: flex; align-items: center; gap: 12px; font: 600 26px var(--fonte-tit); letter-spacing: -0.02em; }
.ent-apres h1 { font-size: 40px; line-height: 1.1; letter-spacing: -0.03em; max-width: 620px; }
.ent-lead { font-size: 17px; color: var(--tinta-2); line-height: 1.47; max-width: 560px; }
.ent-dest { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; max-width: 560px; }
.ent-dest li { display: flex; gap: 14px; align-items: flex-start; }
.ent-dest .ic { width: 22px; height: 22px; color: var(--acento); margin-top: 1px; }
.ent-dest b { display: block; font-weight: 600; font-size: 15.5px; }
.ent-dest span { color: var(--mudo); font-size: 14.5px; }
.ent-matriz { margin: 6px 0 0; background: #fff; border: 1px solid var(--linha); border-radius: 14px; overflow: hidden; max-width: 560px; font-size: 12.5px; }
.mm-cab, .mm-lin { display: grid; grid-template-columns: 1.6fr repeat(5, 1fr); align-items: center; }
.mm-cab { background: var(--cab); color: var(--mudo); font-weight: 600; font-size: 11px; border-bottom: 1px solid var(--linha); }
.mm-cab span, .mm-lin span { padding: 7px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-cab span:not(:first-child) { text-align: center; padding: 7px 4px; }
.mm-lin { border-bottom: 1px solid var(--linha-suave); }
.mm-lin:nth-child(odd) { background: var(--zebra); }
.mm-lin:last-child { border-bottom: 0; }
.mm { justify-self: center; width: 9px; height: 9px; border-radius: 50%; background: var(--st-afazer); }
.mm-entregue { background: var(--st-entregue); } .mm-andamento { background: var(--st-andamento); } .mm-atrasada { background: var(--st-atrasada); }
.mm-na { width: 14px; height: 2px; border-radius: 1px; background: #dedee3; }
.ent-login { display: flex; align-items: center; justify-content: flex-start; padding: 40px 64px 40px 24px; }
.ent-cartao { width: min(430px, 100%); background: #fff; border: 1px solid var(--linha); border-radius: 22px; padding: 30px 28px 24px; display: flex; flex-direction: column; gap: 14px; }
.ent-cartao h2 { font-size: 24px; }
.ent-cartao .sub { color: var(--mudo); margin-top: -8px; }
.ent-perfis { border: 0; padding: 0; margin: 4px 0 0; display: flex; flex-direction: column; gap: 8px; }
.ent-perfis legend { font-size: 13px; font-weight: 600; color: var(--tinta-2); margin-bottom: 8px; padding: 0; }
.ent-perfil { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--linha); border-radius: 12px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.ent-perfil input { position: absolute; opacity: 0; }
.ent-perfil:has(input:checked) { border-color: var(--acento); background: var(--acento-suave); }
.ent-perfil:has(input:checked) .av { background: var(--acento); color: #fff; }
.ent-perfil:has(input:focus-visible) { outline: 2px solid var(--acento); outline-offset: 2px; }
.ent-pt { display: flex; flex-direction: column; min-width: 0; }
.ent-pt b { font-weight: 600; font-size: 14.5px; }
.ent-pt small { color: var(--mudo); font-size: 12.5px; line-height: 1.35; }
.ent-selo { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--mudo); }
.ent-selo .ic { width: 16px; height: 16px; margin-top: 1px; }

/* ---------- miscelânea ---------- */
.grade-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.grade-2 > * { min-width: 0; }
.bloco { padding: 18px 24px; border-bottom: 1px solid var(--linha); }
.bloco + .bloco-lado { border-left: 1px solid var(--linha); }
.bloco h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mudo); margin-bottom: 12px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--linha-suave); font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--mudo); }
.kv b { font-weight: 600; text-align: right; }
.escolha-emp { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; padding: 0 24px 24px; }
.escolha-emp button { text-align: left; border: 1px solid var(--linha); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; background: #fff; }
.escolha-emp button:hover { border-color: var(--acento); background: #fbfdfb; }
.escolha-emp small { color: var(--mudo); font-size: 12.5px; }
.perm-tab td, .perm-tab th { text-align: center; }
.perm-tab td:first-child, .perm-tab th:first-child { text-align: left; }
.arq { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.arq .ic { width: 20px; height: 20px; color: var(--mudo); }
.arq span { overflow: hidden; text-overflow: ellipsis; }
.msg-prev { white-space: pre-wrap; background: #f6f6f8; border-radius: 12px; padding: 12px 14px; font-size: 14px; border: 1px solid var(--linha-suave); }
.itens-sol { list-style: none; margin: 0; padding: 0; }

/* ---------- telas médias ---------- */
@media (max-width: 1580px) {
  .tb-nome small, .tb-un { display: none; }
  .tb-marca { min-width: 0; }
  .tb-aba { min-width: 64px; padding: 6px 5px 5px; }
  .tb-busca { min-width: 120px; }
}
/* ---------- 1024 ---------- */
@media (max-width: 1240px) {
  .tb-nome small, .tb-un { display: none; }
  .tb-marca { min-width: 0; }
  .tb-busca { min-width: 0; }
  .tb-busca span, .tb-busca kbd { display: none; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.k5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .c-3, .c-4, .c-5 { grid-column: span 6; }
  .c-7, .c-8 { grid-column: span 12; }
  .ent-apres { padding: 48px 40px; }
  .ent-apres h1 { font-size: 34px; }
  .ent-login { padding: 40px 32px 40px 8px; }
  .cartoes-reg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cartao-reg:nth-child(2) { border-right: 0; }
  .cartao-reg:nth-child(-n+2) { border-bottom: 1px solid var(--linha); }
}
@media (max-width: 1100px) {
  .tb-nome { display: none; }
  .tb-aba { min-width: 56px; padding: 6px 3px 5px; font-size: 10.5px; letter-spacing: -0.01em; }
  .toolbar { gap: 10px; }
  .selo-demo { display: none; }
}

/* ---------- celular ---------- */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .so-desk { display: none; }
  .so-cel { display: inline; }
  .casca { display: block; height: auto; }
  .topo { position: sticky; top: 0; }
  .toolbar { flex-wrap: wrap; gap: 0; padding: 6px 8px 0; padding-top: max(6px, env(safe-area-inset-top)); }
  .tb-marca { order: 1; padding: 2px 4px; }
  .tb-nome { display: flex; }
  .tb-nome small { display: none; }
  .tb-dir { order: 2; margin-left: auto; gap: 2px; }
  .tb-busca { width: 40px; height: 40px; padding: 0; justify-content: center; background: transparent; }
  .tb-busca .ic { width: 21px; height: 21px; color: var(--tinta-2); }
  .tb-sino { width: 40px; height: 40px; }
  .tb-user { padding: 2px; }
  .tb-abas { order: 3; flex-basis: 100%; justify-content: flex-start; padding: 4px 0 4px; gap: 0; scroll-snap-type: x proximity; }
  .tb-aba { min-width: 68px; font-size: 10.5px; padding: 6px 4px 5px; scroll-snap-align: start; }
  .tb-aba .ic { width: 23px; height: 23px; }
  .contexto { padding: 6px 8px; gap: 6px; flex-wrap: nowrap; }
  .ctx-grupo { gap: 6px; flex: 1; min-width: 0; }
  .ctx-dir { flex: none; }
  .ctx-st, .selo-demo { display: none; }
  .ctx-comp .ctx-campo b { min-width: 0; }
  .ctx-campo small { font-size: 9.5px; }
  .ctx-campo b { font-size: 13.5px; }
  .ctx-seta { width: 28px; height: 40px; }
  .ctx-emp { flex: 1; min-width: 0; max-width: none; }
  .ctx-emp b { min-width: 0; font-size: 13.5px; }
  .btn-p span { display: none; }
  .btn-p { width: 40px; height: 40px; padding: 0; }
  .btn-p .ic { width: 19px; height: 19px; }
  .palco { padding: 8px 8px 0; overflow: visible; }
  .folha { height: auto; overflow: visible; border-radius: 16px; }
  .folha-topo { padding: 16px 16px 10px; align-items: flex-start; flex-direction: column; gap: 10px; }
  .folha-tit h1 { font-size: 22px; }
  .folha-acoes { width: 100%; }
  .folha-ferr { padding: 0 16px 10px; }
  .busca-campo { min-width: 0; flex: 1 1 100%; height: 40px; }
  .folha-ferr .filtro { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .folha-ferr .filtro select { width: 100%; }
  .folha-ferr .seg { flex: 1 1 100%; }
  .folha-ferr .seg button { flex: 1; }
  .folha-ferr > .mudo { flex-basis: 100%; }
  .filtro select { height: 38px; max-width: 100%; }
  .folha-corpo { overflow: visible; }
  .abas-pl { position: sticky; bottom: 0; z-index: 10; padding: 0 8px max(8px, env(safe-area-inset-bottom)); border-radius: 0 0 16px 16px; background: rgba(241, 241, 244, 0.94); backdrop-filter: var(--vidro); -webkit-backdrop-filter: var(--vidro); }
  .aba-pl { padding: 10px 14px 11px; font-size: 13.5px; }
  .btn, .btn-2 { min-height: 40px; }
  .btn-ic { width: 40px; height: 40px; }
  .pad, .folha-corpo.pad { padding: 16px; }

  /* tabelas viram cartões */
  .tabela, .tabela tbody, .tabela tfoot { display: block; }
  .tabela thead { display: none; }
  .tabela tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 12px 16px; border-bottom: 1px solid var(--linha-suave); }
  .tabela tbody tr:nth-child(even) td { background: transparent; }
  .tabela tbody tr:nth-child(even) { background: var(--zebra); }
  .tabela td { display: block; padding: 0; border: 0; background: transparent !important; min-width: 0; }
  .tabela td.m-x { display: none; }
  .tabela td.m-t { order: 0; flex: 1 1 55%; font-weight: 600; font-size: 15px; }
  .tabela td.m-t small { font-weight: 400; }
  .tabela td.m-d { order: 1; margin-left: auto; text-align: right; }
  .tabela tbody td.m-d::before { content: attr(data-label); display: block; font-size: 10.5px; color: var(--mudo); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
  .tabela td.m-s { order: 2; flex-basis: 100%; color: var(--mudo); font-size: 13.5px; }
  .tabela td.m-k { order: 3; flex-basis: 100%; display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; text-align: right; padding: 2px 0; }
  .tabela td.m-k::before { content: attr(data-label); color: var(--mudo); text-align: left; flex: none; }
  .tabela td.m-k:empty { display: none; }
  .tabela td.m-k small { display: none; }
  .tabela .num { white-space: normal; }
  .tabela tfoot tr { background: #f4f4f7; position: static; }
  .tabela tfoot td { position: static; }
  .tabela tr.clic:hover td { background: transparent !important; }
  .tabela td .acoes-linha { justify-content: flex-end; }
  .t-nome { min-width: 0 !important; }

  .campos { grid-template-columns: 1fr; }
  .campo, .campo.meia, .campo.terco, .campos-secao { grid-column: span 1; }
  .campo input:not([type=checkbox]):not([type=radio]):not([type=file]), .campo select, .campo textarea, .moeda { min-height: 44px; font-size: 16px; }
  .sheet { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 92dvh; border-radius: 18px 18px 0 0; transform: translateY(100%); }
  .sheet.larga { width: 100%; }
  .sheet-topo { padding: 14px 12px 10px 18px; }
  .sheet-corpo { padding: 14px 16px 20px; }
  .sheet-rodape { padding: 10px 12px max(10px, env(safe-area-inset-bottom)); }
  .sheet-rodape .btn, .sheet-rodape .btn-2 { flex: 1; }
  .sheet-rodape .esq { flex: 0 0 auto; }
  .sheet-rodape > [data-acao=fechar-sheet]:not(:only-child) { display: none; }
  .det { grid-template-columns: 1fr; }
  .det > div { border-right: 0 !important; }
  .det .inteira { grid-column: span 1; }
  .resumo-grade { grid-template-columns: 1fr; }

  .painel { display: block; }
  .kpis, .kpis.k5, .kpis.k4 { grid-template-columns: 1fr 1fr; }
  .kpis.k5 .kpi:last-child { grid-column: span 2; }
  .kpi { padding: 14px 16px; }
  .kpi .v { font-size: 30px; }
  .celula { border-right: 0; padding: 16px; }
  .setores { grid-template-columns: 1fr; }
  .prog-comp .frase { font-size: 17px; }

  .cal-topo { padding: 12px 16px 8px; }
  .cal { display: none; }
  .agenda-cel { display: block; }
  .ag-dia { display: flex; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--linha-suave); }
  .ag-dia.hoje-d .data-dia b { color: var(--acento); }
  .ag-dia .data-dia { align-self: flex-start; padding-top: 4px; }
  .matriz-env { max-height: calc(100dvh - 230px); }
  .ag-chips { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
  .ag-chips .chip-cal { font-size: 13.5px; padding: 8px 10px; border-radius: 9px; }
  .matriz th.m-emp, .matriz td.m-emp { min-width: 140px; max-width: 150px; padding: 6px 10px; }
  .cel-st { min-width: 58px; height: 44px; }
  .cel-st span { display: none; }

  .papel-env { padding: 10px; }
  .papel { padding: 20px 16px; font-size: 12.5px; }
  .papel-cab { flex-direction: column; gap: 6px; }
  .papel-cab .dir { text-align: left; }
  .dem { font-size: 11.5px; }
  .dem th, .dem td { padding: 4px 3px; }
  .dem .cod { width: auto; }
  .tbl-scroll { overflow-x: auto; }
  .assinaturas { grid-template-columns: 1fr; gap: 30px; }

  .ficha { grid-template-columns: 1fr; }
  .ficha > section { border-right: 0; padding: 16px; }
  .cartoes-reg { grid-template-columns: 1fr 1fr; }
  .cartao-reg { padding: 14px 16px; }
  .motor-topo { grid-template-columns: 1fr; }
  .motor-topo > div + div { border-left: 0; border-top: 1px solid var(--linha); }
  .motor-topo > div { padding: 16px; }
  .grade-2 { grid-template-columns: 1fr; }
  .bloco { padding: 16px; }
  .bloco + .bloco-lado { border-left: 0; }
  .escolha-emp { padding: 0 16px 16px; }

  .entrada { grid-template-columns: 1fr; }
  .ent-apres { padding: 28px 20px 8px; gap: 16px; justify-self: stretch; }
  .ent-apres h1 { font-size: 27px; }
  .ent-lead { font-size: 15.5px; }
  .ent-matriz { display: none; }
  .ent-login { padding: 8px 12px 28px; justify-content: center; }
  .ent-cartao { padding: 22px 18px 18px; border-radius: 18px; }
  #toasts { bottom: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- impressão ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; }
  .topo, .abas-pl, .folha-topo, .folha-ferr, #toasts, .sheet-fundo, .dlg-fundo, .pop, .nao-imprime { display: none !important; }
  .casca, .palco, .folha, .folha-corpo { display: block; height: auto; overflow: visible; border: 0; padding: 0; background: #fff; }
  .papel-env { padding: 0; background: #fff; }
  .papel { border: 0; padding: 0; max-width: none; }
  .imprime-tabela .tabela th { position: static; }
  body.imprimindo-sheet .casca { display: none !important; }
  body.imprimindo-sheet .sheet-fundo { display: block !important; position: static; background: none; }
  body.imprimindo-sheet .sheet { position: static; transform: none; box-shadow: none; width: auto; border-radius: 0; }
  body.imprimindo-sheet .sheet-topo, body.imprimindo-sheet .sheet-rodape { display: none; }
}
