:root {
  --green: #73ce00; --green-shade: #62af00; --green-glow: #9bff30;
  --forest: #03321f; --pine: #286c4e;
  --lime-100: #f3f8e8; --lime-200: #ddebbd; --lime-300: #d7e4b9;
  --ink: #383838; --muted: #5d6460; --white: #fff;
  --gray-100: #f2f4f8; --gray-200: #e7ecf2; --gray-300: #cfd6de;
  --red: #b42318; --red-bg: #fdecea; --amber: #8a5a00; --amber-bg: #fff6e0; --amber-line: #f2c14e;
  --r10: 10px; --r20: 20px; --r30: 30px;
  --display: "Poppins", system-ui, sans-serif;
  --sans: "Nunito Sans", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--ink); font: 400 16px/1.5 var(--sans); }
h1, h2, h3 { font-family: var(--display); color: var(--forest); margin: 0; font-weight: 400; text-wrap: balance; }
h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.15; }
h1 b { font-weight: 600; }
h2 { font-size: clamp(22px, 3vw, 28px); line-height: 1.25; }
h3 { font-size: 18px; font-weight: 600; }
p { margin: 0; }
a { color: var(--pine); }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }

/* Cabeçalho */
.top { border-bottom: 1px solid var(--gray-200); background: var(--white); position: sticky; top: 0; z-index: 20; }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--forest); }
.brand img { height: 30px; width: auto; display: block; }
.brand span { font: 600 15px/1.2 var(--display); border-left: 1px solid var(--gray-300); padding-left: 12px; }
.steps { margin-left: auto; display: flex; gap: 4px; list-style: none; padding: 0; margin-top: 0; margin-bottom: 0; flex-wrap: wrap; }
.steps li { font-size: 13px; font-weight: 700; color: var(--muted); padding: 6px 10px; border-radius: 50px; }
.steps li.on { background: var(--forest); color: var(--white); }
.steps li.done { color: var(--pine); }
.steps button { all: unset; cursor: pointer; }
.steps button:focus-visible { outline: 2px solid var(--green-shade); outline-offset: 3px; border-radius: 4px; }

main { padding: 32px 0 80px; }
.page-head { display: grid; gap: 8px; margin-bottom: 24px; }
.page-head p { color: var(--muted); max-width: 70ch; }
.kicker { font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--pine); }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; text-transform: uppercase; font: 700 15px/20px var(--sans); letter-spacing: .02em; padding: 14px 28px; border-radius: var(--r10); text-decoration: none; }
.btn-primary { background: linear-gradient(180deg, var(--green-glow), var(--green)); color: var(--forest); }
.btn-primary:hover { background: linear-gradient(180deg, var(--green), var(--green-shade)); }
.btn-outline { background: transparent; color: var(--forest); box-shadow: inset 0 0 0 2px var(--forest); }
.btn-outline:hover { background: var(--forest); color: var(--white); }
.btn-ghost { background: transparent; color: var(--pine); padding: 8px 10px; text-transform: none; font-weight: 700; }
.btn-ghost:hover { background: var(--lime-100); }
.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .cel:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--green-shade); outline-offset: 2px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-top: 32px; }

/* Cards e formulários */
.card { background: var(--lime-100); border-radius: var(--r20); padding: 24px; }
.card-white { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--r20); padding: 24px; }
.grid2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 14px; font-weight: 700; color: var(--forest); }
.field small, .hint { font-size: 13px; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=time], input[type=number], select {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--gray-300); border-radius: var(--r10); background: var(--white);
}
input[type=time] { min-width: 0; }
.radios { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-block; padding: 8px 14px; border-radius: 50px; border: 1px solid var(--gray-300); background: var(--white); font-size: 14px; font-weight: 600; }
.chip input:checked + span { background: var(--forest); border-color: var(--forest); color: var(--white); }
.chip input:focus-visible + span { outline: 3px solid var(--green-shade); outline-offset: 2px; }
.q { display: grid; gap: 10px; padding: 18px 0; border-top: 1px solid var(--lime-300); }
.q:first-child { border-top: 0; padding-top: 0; }

.setores { display: grid; gap: 12px; margin-top: 16px; }
.setor { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--r20); padding: 16px 20px; }
.setor.off { background: var(--gray-100); }
.setor-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.switch { display: flex; align-items: center; gap: 10px; font: 600 17px/1.2 var(--display); color: var(--forest); cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--pine); }
.setor-body { display: grid; gap: 14px; margin-top: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: start; }
.dias { display: flex; gap: 4px; flex-wrap: wrap; }
.dias .chip span { padding: 6px 10px; font-size: 13px; }
.horario { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.horario input[type=time] { width: 120px; }

/* Equipe */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { border: 1px solid var(--gray-300); background: var(--white); padding: 8px 16px; border-radius: 50px; cursor: pointer; font-weight: 700; font-size: 14px; }
.tab[aria-selected=true] { background: var(--forest); color: var(--white); border-color: var(--forest); }
.tab .n { display: inline-block; min-width: 20px; margin-left: 6px; padding: 0 6px; border-radius: 50px; background: var(--lime-200); color: var(--forest); font-size: 12px; }
.pessoas { display: grid; gap: 10px; }
.pessoa { display: grid; grid-template-columns: minmax(140px, 1.3fr) minmax(140px, 1fr) minmax(120px, .8fr) 44px; gap: 10px; align-items: end; background: var(--white); border-radius: var(--r10); padding: 12px; border: 1px solid var(--gray-200); }
.pessoa .rm { width: 44px; height: 44px; border: 0; border-radius: var(--r10); background: var(--gray-100); cursor: pointer; font-size: 20px; color: var(--muted); }
.pessoa .rm:hover { background: var(--red-bg); color: var(--red); }
.empty { padding: 24px; text-align: center; color: var(--muted); border: 1px dashed var(--gray-300); border-radius: var(--r10); background: var(--white); }
.add-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.lgpd { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; font-size: 14px; color: var(--muted); }

/* Escala */
.week-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 18px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; }
.lg-turno { background: var(--lime-200); }
.lg-folga { background: var(--white); border: 1px dashed var(--gray-300); }
.lg-sug { background: var(--white); border: 2px dashed var(--pine); }
.lg-erro { background: var(--red-bg); border: 1px solid var(--red); }
.table-scroll { overflow-x: auto; border: 1px solid var(--gray-200); border-radius: var(--r20); background: var(--white); }
table.escala { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 860px; }
.escala th, .escala td { padding: 6px; text-align: center; border-bottom: 1px solid var(--gray-200); }
.escala thead th { font-size: 13px; color: var(--muted); font-weight: 700; background: var(--white); position: sticky; top: 0; }
.escala thead th b { display: block; color: var(--forest); font-size: 14px; }
.escala th.nome, .escala td.nome { text-align: left; padding-left: 16px; min-width: 190px; position: sticky; left: 0; background: var(--white); z-index: 1; }
.escala thead th.nome { z-index: 2; }
.escala tr.sec td { background: var(--lime-100); text-align: left; padding: 10px 16px; font: 600 14px/1.2 var(--display); color: var(--forest); letter-spacing: .03em; text-transform: uppercase; }
.escala tr.sec td span { font: 400 13px var(--sans); text-transform: none; color: var(--muted); letter-spacing: 0; margin-left: 8px; }
.pnome { font-weight: 700; color: var(--forest); display: block; }
.pfun { font-size: 13px; color: var(--muted); }
.tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 50px; background: var(--gray-100); color: var(--muted); margin-left: 4px; vertical-align: 1px; }
.tag.sug { background: var(--forest); color: var(--white); }
.cel { width: 100%; min-height: 50px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; padding: 4px; display: grid; place-content: center; line-height: 1.2; background: var(--lime-200); color: var(--forest); }
.cel .hr { font-weight: 700; font-size: 13px; white-space: nowrap; }
.cel .tn { font-size: 11px; color: var(--pine); }
.cel.folga { background: var(--white); border: 1px dashed var(--gray-300); color: var(--muted); font-size: 13px; }
.cel.sug { background: var(--white); border: 2px dashed var(--pine); }
.cel.erro { background: var(--red-bg); border: 1px solid var(--red); color: var(--red); }
.cel.erro .tn { color: var(--red); }
.cel:hover { filter: brightness(.96); }
td.horas { font-weight: 800; color: var(--forest); white-space: nowrap; font-size: 15px; min-width: 76px; }
td.horas.erro span { background: var(--red-bg); color: var(--red); border: 1px solid var(--red); padding: 4px 8px; border-radius: 8px; }
td.horas small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
tr.cov td { font-size: 12px; padding: 6px 4px 10px; border-bottom: 2px solid var(--gray-200); }
tr.cov td.nome { font-size: 12px; color: var(--muted); font-weight: 700; }
.cov-ok { color: var(--pine); font-weight: 700; }
.cov-gap { color: var(--red); font-weight: 700; }
.rm-sug { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 12px; text-decoration: underline; padding: 0; margin-top: 2px; }

.alertas { margin-top: 20px; display: grid; gap: 10px; }
.alerta { border-radius: var(--r10); padding: 12px 16px; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-size: 15px; }
.alerta .ic { font-weight: 800; font-size: 12px; text-transform: uppercase; padding: 2px 8px; border-radius: 50px; white-space: nowrap; margin-top: 2px; }
.alerta.erro { background: var(--red-bg); color: #5c120c; }
.alerta.erro .ic { background: var(--red); color: var(--white); }
.alerta.gente { background: var(--forest); color: var(--white); }
.alerta.gente .ic { background: var(--green); color: var(--forest); }
.alerta.aviso { background: var(--amber-bg); color: #4a3200; border: 1px solid var(--amber-line); }
.alerta.aviso .ic { background: var(--amber-line); color: #3d2900; }
.alerta.info { background: var(--lime-100); color: var(--forest); }
.alerta.info .ic { background: var(--lime-200); color: var(--forest); }
.ok-box { background: var(--lime-100); color: var(--forest); padding: 14px 16px; border-radius: var(--r10); font-weight: 700; }

.juridico { margin-top: 24px; border: 2px solid var(--forest); border-radius: var(--r20); padding: 18px 20px; display: grid; gap: 6px; }
.juridico strong { font: 600 16px var(--display); color: var(--forest); }
.juridico p { font-size: 15px; }

.custo { margin-top: 24px; }
.custo-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-top: 14px; }
.cen { background: var(--white); border-radius: var(--r10); padding: 16px; display: grid; gap: 4px; align-content: start; }
.cen .v { font: 600 28px/1.2 var(--sans); color: var(--forest); }
.cen .t { font-weight: 800; color: var(--forest); }
.cen p { font-size: 14px; color: var(--muted); }

/* Hero */
.hero { display: grid; gap: 32px; grid-template-columns: 1.15fr .85fr; align-items: center; padding: 16px 0 40px; }
.hero p.lead { font-size: 19px; margin-top: 16px; max-width: 52ch; }
.hero-art { background: var(--lime-200); border-radius: var(--r30); padding: 32px; display: grid; place-items: center; }
.hero-art img { width: 100%; height: auto; max-width: 420px; }
.hero .actions { justify-content: flex-start; }
.feat { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 24px; }
.feat .card h3 { margin-bottom: 6px; }
.feat .num { font: 600 42px/1 var(--sans); color: var(--forest); display: block; margin-bottom: 8px; }
.fine { font-size: 13px; color: var(--muted); margin-top: 32px; }

/* Emitir */
.emit { display: grid; gap: 24px; grid-template-columns: 1fr 1fr; align-items: start; }
.video-box { aspect-ratio: 16/9; background: var(--forest); border-radius: var(--r20); overflow: hidden; display: grid; place-items: center; color: var(--white); position: relative; }
.video-box iframe { width: 100%; height: 100%; border: 0; }
.video-prov { padding: 28px; display: grid; gap: 12px; text-align: center; max-width: 520px; }
.video-prov h3 { color: var(--green); font-size: 24px; }
.progress { height: 8px; background: var(--gray-200); border-radius: 8px; overflow: hidden; margin-top: 12px; }
.progress div { height: 100%; background: var(--green); width: 0; transition: width .3s linear; }
.downloads { display: grid; gap: 12px; }
.dl { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--white); border-radius: var(--r10); padding: 16px; }
.dl p { font-size: 14px; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--pine); flex: none; }
.err { color: var(--red); font-size: 13px; font-weight: 700; }

/* Popover */
.pop[hidden] { display: none; }
.pop { position: fixed; z-index: 50; background: var(--white); border-radius: var(--r20); box-shadow: 0 12px 40px rgba(3,50,31,.22); padding: 18px; width: min(340px, calc(100vw - 32px)); display: grid; gap: 12px; }
.pop h3 { font-size: 16px; }
.pop .sub { font-size: 13px; color: var(--muted); margin-top: -8px; }
.pop .opts { display: grid; gap: 6px; }
.pop label.opt { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--r10); border: 1px solid var(--gray-200); cursor: pointer; font-size: 14px; }
.pop label.opt:has(input:checked) { border-color: var(--forest); background: var(--lime-100); }
.pop .custom { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.pop .custom label { font-size: 12px; font-weight: 700; color: var(--forest); display: grid; gap: 2px; }
.pop .custom input { min-height: 38px; padding: 6px; }
.pop .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(3,50,31,.18); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--forest); color: var(--white); padding: 12px 20px; border-radius: var(--r10); z-index: 60; font-weight: 700; max-width: calc(100vw - 32px); }

footer.site { border-top: 1px solid var(--gray-200); padding: 24px 0; font-size: 13px; color: var(--muted); }
footer.site .wrap { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; }

@media (max-width: 820px) {
  .hero, .emit { grid-template-columns: 1fr; }
  .hero-art { order: -1; padding: 20px; }
  .steps { margin-left: 0; width: 100%; }
  .brand span { display: none; }
  .pessoa { grid-template-columns: 1fr 1fr; }
  .pessoa .rm { grid-column: 2; justify-self: end; }
  .pessoa .f-nome { grid-column: 1 / -1; }
  main { padding-top: 20px; }
  .actions .btn { flex: 1 1 auto; }
  .week-bar .tabs { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 4px; }
  .week-bar .tab { white-space: nowrap; }
  .escala th.nome, .escala td.nome { min-width: 118px; max-width: 130px; padding-left: 10px; }
  .pnome { font-size: 14px; }
  .escala tr.sec td span { display: block; margin: 2px 0 0; }
  table.escala { min-width: 760px; }
}

/* Impressão: só o documento */
#doc-print { display: none; }
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; }
  #app, #pop, .backdrop, .toast { display: none !important; }
  #doc-print { display: block; font: 10px/1.35 var(--sans); color: #222; }
  #doc-print .dh { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid var(--forest); padding-bottom: 6px; margin-bottom: 8px; }
  #doc-print .dh img { height: 26px; }
  #doc-print h1 { font-size: 17px; font-weight: 600; }
  #doc-print h2 { font-size: 12px; font-weight: 600; margin: 10px 0 4px; }
  #doc-print table { width: 100%; border-collapse: collapse; page-break-inside: auto; }
  #doc-print th, #doc-print td { border: 1px solid #bbb; padding: 3px 4px; text-align: center; }
  #doc-print td:first-child, #doc-print th:first-child { text-align: left; }
  #doc-print th { background: var(--forest); color: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #doc-print tr.s td { background: var(--lime-200); font-weight: 700; text-align: left; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #doc-print td.f { color: #888; }
  #doc-print .wk { page-break-after: always; }
  #doc-print .wk:last-of-type { page-break-after: auto; }
  #doc-print .sign { display: flex; gap: 40px; margin-top: 28px; }
  #doc-print .sign div { flex: 1; border-top: 1px solid #333; padding-top: 4px; text-align: center; }
  #doc-print .aviso { margin-top: 12px; border: 1.5px solid var(--forest); padding: 6px 8px; font-size: 10px; }
}
