:root {
  --navy: #0f3d4c;
  --gold: #7ccfb8;
  --gold-forte: #2f8f7a;
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-2: #f7f9f8;
  --border: #dde4e1;
  --text: #0f1f26;
  --text-2: #475a61;
  --muted: #84949a;
  --venda: #2a78d6;
  --ok: #0a7d4b;
  --warn: #9a6400;
  --warn-bg: #fff4dc;
  --err: #b3261e;
  --err-bg: #fdecea;
  --grid: #e6ecea;
  --shadow: 0 1px 2px rgba(0, 40, 50, .06), 0 4px 16px rgba(0, 40, 50, .05);
  --sit-quase: #c98500; --sit-atrasado: #b3261e; --livre: #c3cdc9;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a171c; --surface: #102229; --surface-2: #0d1d23; --border: #1e3640;
    --text: #edf3f2; --text-2: #b2c3c3; --muted: #7c9093;
    --venda: #3987e5; --ok: #4cc38a; --warn: #f0b64d; --warn-bg: #2d2412; --err: #ff8a80; --err-bg: #331513;
    --grid: #1a2f37; --shadow: none; --sit-quase: #f0b64d; --sit-atrasado: #ff8a80; --livre: #34505a;
    --gold-forte: #7ccfb8; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
a { color: inherit; }
h1, h2, .marca { font-weight: 700; letter-spacing: -.2px; }
h1 { font-size: 28px; margin: 0; }
h2 { font-size: 18px; margin: 0 0 14px; }
.num { font-variant-numeric: tabular-nums; }
.dim { color: var(--muted); font-size: 12.5px; }
.sub { color: var(--text-2); margin: 4px 0 0; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- topo */
header.topo { background: var(--navy); color: #fff; padding-top: env(safe-area-inset-top); }
.topo-in { max-width: 1240px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 18px; height: 60px; }
.marca { font-size: 19px; color: #fff; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.marca .sub-marca { color: var(--gold); font-weight: 600; }
nav.menu { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
nav.menu a { color: rgba(255,255,255,.8); text-decoration: none; padding: 8px 11px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
nav.menu a:hover { color: #fff; background: rgba(255,255,255,.08); }
nav.menu a.ativo { color: var(--navy); background: var(--gold); font-weight: 600; }
.menu-conta { position: relative; }
.conta-btn { background: transparent; border: 1px solid rgba(124,207,184,.55); color: var(--gold); border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; }
.conta-btn:hover { background: rgba(124,207,184,.12); }
.popover { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.18); padding: 6px; display: none; z-index: 40; min-width: 200px; }
.popover.aberto { display: block; }
.popover form { margin: 0; }
.popover a, .popover button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: 7px; font: inherit; font-size: 14px; color: var(--text); cursor: pointer; text-decoration: none; }
.popover a:hover, .popover button:hover { background: var(--surface-2); }
.popover button.atual { font-weight: 700; }
.pop-tit { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 6px 12px 2px; }
.pop-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.aovivo { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: rgba(255,255,255,.78); white-space: nowrap; }
.aovivo i { width: 8px; height: 8px; border-radius: 50%; background: #4cc38a; animation: respira 2.4s infinite; }
.aovivo.off i { background: #8a93a0; animation: none; }
.aovivo.off span::after { content: " (sem ligação)"; }
.aovivo.pulso i { background: var(--gold); }
@keyframes respira { 0% { box-shadow: 0 0 0 0 rgba(76,195,138,.55); } 70% { box-shadow: 0 0 0 7px rgba(76,195,138,0); } 100% { box-shadow: 0 0 0 0 rgba(76,195,138,0); } }
@keyframes chegou { from { background: color-mix(in srgb, var(--gold) 38%, transparent); } to { background: transparent; } }
tr.novo td, li.novo { animation: chegou 3.5s ease-out; }
@media (prefers-reduced-motion: reduce) { .aovivo i, tr.novo td, li.novo { animation: none; } }
@media (max-width: 1100px) { .aovivo span { display: none; } }

main { max-width: 1240px; margin: 0 auto; padding: 28px 24px 60px; }
main.estreito { max-width: 520px; }
.cabecalho { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }

@media (max-width: 760px) {
  .topo-in { flex-wrap: wrap; height: auto; padding: 10px 16px 0; gap: 10px; }
  .marca { flex: 1; }
  nav.menu { order: 3; flex-basis: 100%; padding-bottom: 8px; }
  .aovivo { display: none; }
  main { padding: 20px 16px 48px; }
  h1 { font-size: 24px; }
}

/* ---------------------------------------------------------------- cartões, listas, formulários */
.cartao { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; box-shadow: var(--shadow); }
.grelha { display: grid; gap: 16px; }
.grelha > * { min-width: 0; }
.kpis { grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; }
.duas { grid-template-columns: 1.4fr 1fr; align-items: start; }
@media (max-width: 960px) { .kpis { grid-template-columns: 1fr 1fr; } .duas { grid-template-columns: 1fr; } }
.kpi .rotulo { color: var(--text-2); font-size: 13px; }
.kpi .valor { font-size: 28px; font-weight: 650; margin-top: 4px; letter-spacing: -.5px; }
.kpi .valor small.de { font-size: 16px; color: var(--muted); font-weight: 500; }
.kpi .nota { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.kpi.destaque { background: var(--navy); border-color: var(--navy); color: #fff; }
.kpi.destaque .rotulo, .kpi.destaque .nota { color: rgba(255,255,255,.72); }
.kpi.destaque .valor { color: var(--gold); }
@media (max-width: 760px) { .kpi { padding: 14px 16px; } .kpi .valor { font-size: 22px; } }

.lista { list-style: none; margin: 0; padding: 0; }
.lista li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.lista li:last-child { border-bottom: 0; }
.lista .num { white-space: nowrap; }
.vazio { color: var(--muted); font-size: 14px; padding: 18px 0; text-align: center; }
.lista li.vazio { display: block; text-align: center; }
.lista li.vazio a { color: var(--gold-forte); font-weight: 600; }

input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 4px; font-weight: 600; }
label .dim { font-weight: 400; }
.btn { display: inline-block; font: inherit; font-size: 14px; font-weight: 600; border-radius: 8px; padding: 8px 14px; border: 1px solid var(--navy); background: var(--navy); color: #fff; cursor: pointer; text-decoration: none; text-align: center; }
.btn.sec { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ouro { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn.perigo { background: transparent; color: var(--err); border-color: var(--err); }
.btn.mini { padding: 5px 10px; font-size: 12.5px; }
.btn.largo { display: block; width: 100%; margin-top: 16px; padding: 10px 14px; }
.btn:hover { filter: brightness(1.06); }
.btn:disabled, .btn-x:disabled { opacity: .4; cursor: default; filter: none; }
.form-grelha { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grelha .inteiro { grid-column: 1 / -1; }
.form-grelha input, .form-grelha select, .form-grelha textarea { width: 100%; }
.form-grelha.tres { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .form-grelha, .form-grelha.tres { grid-template-columns: 1fr; } }
.acoes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); font-weight: 500; }
.check input { width: auto; }
.filtros { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; padding: 10px; border-bottom: 1px solid var(--border); }
td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th.num, td.num { text-align: right; }
tr:hover td { background: var(--surface-2); }
tr.passado td { opacity: .65; }
.tabela-envolve { overflow-x: auto; }
.res-topo { display: flex; align-items: center; justify-content: space-between; padding: 0 0 10px; gap: 12px; flex-wrap: wrap; }
.res-topo h2 { margin: 0; }
.etq { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.etq.rever { background: var(--warn-bg); color: var(--warn); }
.etq.cinza { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.etq.ouro { background: color-mix(in srgb, var(--gold) 40%, transparent); color: var(--text); }
.aviso { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }
.aviso.demo { background: color-mix(in srgb, var(--gold) 18%, var(--surface)); color: var(--text); border: 1px dashed var(--gold-forte); }
.flash { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); color: var(--text); border-radius: 10px; padding: 10px 16px; margin-bottom: 16px; font-size: 14px; word-break: break-word; }
#toast { position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); right: 24px; left: auto; max-width: calc(100vw - 32px); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.2); display: none; z-index: 60; }
#toast.ver { display: block; }
@media (max-width: 760px) { #toast { right: 16px; left: 16px; } }
.btn-x { font: inherit; font-size: 13px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--text-2); cursor: pointer; flex: none; }
.btn-x:hover:not(:disabled) { color: var(--err); border-color: var(--err); }
.chip-btn { font: inherit; font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; }
.chip-btn:hover { border-color: var(--gold-forte); }
.pt { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: 0; }

/* ---------------------------------------------------------------- contas */
.boas-vindas { margin: 8px 0 20px; }
.boas-vindas h1 { font-size: 26px; line-height: 1.2; }
.caixa input { width: 100%; margin-bottom: 12px; }
.caixa label { margin-top: 2px; }
.caixa h2 { margin-bottom: 16px; }
.caixa-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: 14px; }
.caixa-links a { color: var(--gold-forte); text-decoration: none; font-weight: 600; }
.caixa-links a:hover { text-decoration: underline; }
.caixa .btn.largo + .btn.largo { margin-top: 8px; }
.demo-caixa { margin-top: 16px; text-align: center; }
.demo-caixa .btn.largo { margin-top: 0; }
.demo-caixa .dim { margin: 8px 0 0; }
.membros li { align-items: center; }
.m-acoes { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.m-acoes form { display: flex; gap: 6px; align-items: center; margin: 0; }
.convite-novo { margin-bottom: 16px; border-left: 4px solid var(--gold); }
.copiar { display: flex; gap: 8px; margin-top: 12px; }
.copiar input { flex: 1; min-width: 0; font-size: 13px; }
.sub-tit { font-size: 13px; color: var(--text-2); margin: 20px 0 4px; }
.texto-legal h2 { font-size: 16px; margin: 20px 0 6px; }
.texto-legal p { margin: 0 0 8px; color: var(--text-2); }

/* ---------------------------------------------------------------- editor do viveiro */
.com-sufixo { display: flex; align-items: center; gap: 8px; }
.com-sufixo input { width: 90px !important; margin-bottom: 0 !important; }
.ajuda { margin: 8px 0 12px; line-height: 1.45; }
.linhas-ed { display: grid; gap: 8px; margin-bottom: 10px; }
.linha-ed { display: flex; align-items: center; gap: 8px; }
.linha-ed input[name=parte_nome] { flex: 1; min-width: 0; max-width: 220px; }
.linha-ed .frase { display: none; font-size: 15px; font-weight: 600; white-space: nowrap; }
.linhas-ed.uma .frase { display: inline; }
.linhas-ed.uma input[name=parte_nome], .linhas-ed.uma [data-tirar-parte] { display: none; }
.partes-tit { margin: 0 0 8px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.linha-ed input.num { width: 80px; }
.s-rot { width: 70px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.previa-caixa { margin-top: 18px; border: 1px dashed var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.previa-tit { font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-bottom: 10px; }
.previa { display: flex; gap: 3px; overflow-x: auto; padding-bottom: 4px; min-height: 40px; }
.previa.com-partes { padding-top: 0; }
.pv-fila { display: flex; flex-direction: column; gap: 2px; flex: 1 1 0; min-width: 9px; max-width: 34px; }
.pv-n { font-size: 10px; font-weight: 700; color: var(--muted); text-align: center; height: 14px; }
.pv-grupo { display: flex; flex-direction: column; gap: 2px; position: relative; }
.pv-grupo + .pv-grupo { margin-top: 6px; }
.pv-grupo i { display: block; height: 7px; border-radius: 2px; background: color-mix(in srgb, var(--gold) 55%, var(--surface)); }
.previa.flutuacao { align-items: flex-end; gap: 8px; }
.pv-setor { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 46px; flex: none; }
.pv-setor i { display: block; width: 100%; border-radius: 6px; background: color-mix(in srgb, var(--gold) 45%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold-forte) 40%, transparent); }
.pv-q { font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.zonas-lista li.a-editar { background: color-mix(in srgb, var(--gold) 12%, transparent); border-radius: 8px; padding-left: 8px; padding-right: 8px; }
.z-info { min-width: 0; }
.z-acoes { display: flex; align-items: center; gap: 8px; flex: none; }
.z-acoes form { display: flex; gap: 4px; margin: 0; }
.comecar { margin-bottom: 16px; }
.comecar-opcoes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
@media (max-width: 700px) { .comecar-opcoes { grid-template-columns: 1fr; } }
.opcao { display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; background: var(--surface-2); }
.opcao:hover { border-color: var(--gold-forte); background: color-mix(in srgb, var(--gold) 10%, var(--surface)); }
.opcao strong { font-size: 16px; }
.op-desenho { display: flex; gap: 4px; height: 52px; align-items: stretch; margin-bottom: 6px; }
.op-desenho i { display: block; width: 14px; border-radius: 4px; background: repeating-linear-gradient(to bottom, color-mix(in srgb, var(--gold) 60%, var(--surface)) 0 7px, transparent 7px 9px); }
.op-desenho.flut i { width: 34px; background: color-mix(in srgb, var(--gold) 45%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold-forte) 40%, transparent); }

/* ---------------------------------------------------------------- barra do viveiro */
.barra-viveiro { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--gold-forte);
  border-radius: 12px; padding: 10px 14px; margin-bottom: 20px; }
.bv-nome { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.bv-rot { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.bv-form { display: flex; gap: 6px; margin: 0; min-width: 0; flex: 1; }
.bv-form select { font-size: 16px; font-weight: 700; min-width: 0; max-width: 360px; width: 100%; padding: 6px 10px; }
.bv-unico { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) {
  .bv-nome { flex-basis: 100%; }
  .bv-form select { max-width: none; }
  .barra-viveiro > .btn { width: 100%; }
}

/* ---------------------------------------------------------------- produção */
.prod-grelha { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
@media (max-width: 1100px) { .prod-grelha { grid-template-columns: 1fr; } }
.lado { display: grid; gap: 16px; }
.lado > * { min-width: 0; }
.mapa-topo { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.mapa-topo h2 { margin: 0; }
.mapa-legenda { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--text-2); }
.mapa-legenda span { display: inline-flex; align-items: center; gap: 6px; }
.mapa-legenda i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.mapa-legenda i.livre { border: 1.5px dashed var(--livre); }
.mapa-legenda .sep-leg { width: 1px; height: 14px; background: var(--border); }
.sit { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.sit.quase { background: var(--sit-quase); } .sit.atrasado { background: var(--sit-atrasado); }
.mapa-atalhos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 14px; }

.mapa { display: flex; gap: 14px; }
.zona-mapa { min-width: 0; display: flex; flex-direction: column; }
.zona-mapa + .zona-mapa { padding-left: 14px; border-left: 2px dashed var(--border); }
.zona-tit { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mesas { flex: 1 1 auto; display: flex; gap: 3px; min-width: 0; }
.setores { flex: 1 1 auto; display: flex; gap: 4px; min-width: 0; }
.setor { flex: 1 1 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fila { flex: 1 1 0; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fila.rotulos { flex: 0 0 40px; }
.fila-n { height: 26px; flex: 0 0 26px; font: inherit; font-size: 13px; font-weight: 700; color: var(--navy); background: none; border: 0; border-radius: 6px; cursor: pointer; padding: 0; }
.fila.rotulos .fila-n { cursor: default; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fila-n, :root:not([data-theme="light"]) .setor-cab { color: var(--gold); } }
.fila-n[data-fila]:hover { background: var(--surface-2); }

.bloco { --cor: var(--livre); position: relative; min-height: 0; min-width: 0; font: inherit; color: var(--text); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 2px;
  border-radius: 7px; border: 1px solid color-mix(in srgb, var(--cor) 45%, transparent);
  background: color-mix(in srgb, var(--cor) 16%, var(--surface)); box-shadow: inset 0 3px 0 var(--cor);
  transition: transform .08s, box-shadow .12s; -webkit-tap-highlight-color: transparent; }
.setor .bloco { min-height: 120px; flex: 1 1 auto; overflow: hidden; }
.setor .bloco > span { position: relative; z-index: 1; }
.bloco:hover { transform: translateY(-1px); }
.bloco.livre { background: transparent; border: 1.5px dashed var(--livre); box-shadow: none; }
.b-cab { font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 4px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; line-height: 1.15; text-align: center; }
.b-cab small { display: block; font-size: 10px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.b-lote { font-size: 11px; font-weight: 700; color: color-mix(in srgb, var(--cor) 70%, var(--text)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.b-dias { font-size: 17px; font-weight: 700; letter-spacing: -.3px; line-height: 1.1; }
.b-dias small { font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 1px; }
.b-sacos { font-size: 10px; color: var(--muted); min-height: 1em; white-space: nowrap; }
.b-livre { font-size: 11px; color: var(--muted); }
.b-hoje { font-size: 13px; }
.bloco.quase .b-dias { color: var(--sit-quase); }
.bloco.atrasado .b-dias, .bloco.sem-data .b-dias { color: var(--sit-atrasado); }
.bloco.atrasado::after, .bloco.sem-data::after, .bloco.quase::after { content: ""; position: absolute; top: 7px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--sit-atrasado); }
.bloco.quase::after { background: var(--sit-quase); }
.b-check { display: none; position: absolute; top: -7px; left: 50%; transform: translateX(-50%); width: 20px; height: 20px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; font-style: normal; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px var(--surface); z-index: 2; }
.bloco.sel { outline: 2.5px solid var(--navy); outline-offset: 1px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bloco.sel { outline-color: var(--gold); } :root:not([data-theme="light"]) .b-check { background: var(--gold); color: var(--navy); } }
.bloco.sel .b-check { display: block; }
.b-ocup { position: absolute; left: 0; right: 0; bottom: 0; background: color-mix(in srgb, var(--cor) 22%, transparent); pointer-events: none; }
.setor-cab { height: 26px; flex: 0 0 26px; display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; color: var(--navy); text-decoration: none; border-radius: 6px; white-space: nowrap; }
.setor-cab:hover { background: var(--surface-2); text-decoration: underline; }
.setor-cab .s-longo { display: none; }

/* bancadas pequenas (uma por linha da fila) */
.grupo { display: flex; flex-direction: column; gap: 2px; }
.grupo + .grupo { margin-top: 8px; }
.parte-tit { height: 18px; font: inherit; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); background: none; border: 0; border-radius: 5px; padding: 0; cursor: pointer; white-space: nowrap; overflow: hidden; }
.parte-tit:hover { background: var(--surface-2); color: var(--text); }
.fila .parte-tit { opacity: .55; }
.fila .parte-tit:hover { opacity: 1; }
.parte-tit .pt-c { display: none; }
.banc-n { height: 24px; font: inherit; font-size: 11px; font-weight: 600; color: var(--text-2); background: none; border: 0; border-radius: 5px; padding: 0 4px 0 0; text-align: right; cursor: pointer; }
.banc-n:hover { background: var(--surface-2); color: var(--text); }
.bloco.banc { height: 24px; min-height: 0; padding: 0; border-radius: 5px; gap: 0; box-shadow: inset 3px 0 0 var(--cor); }
.bloco.banc.livre { box-shadow: none; border-width: 1px; }
.bloco.banc .b-dias { font-size: 11.5px; font-weight: 700; letter-spacing: 0; }
.bloco.banc .b-ponto { font-size: 10px; color: var(--muted); opacity: .6; }
.bloco.banc::after { top: 3px; right: 3px; width: 5px; height: 5px; }
.bloco.banc:hover { transform: none; filter: brightness(.96); }
.bloco.banc.sel { outline-width: 2px; outline-offset: 0; background: color-mix(in srgb, var(--navy) 22%, color-mix(in srgb, var(--cor) 16%, var(--surface))); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bloco.banc.sel { background: color-mix(in srgb, var(--gold) 30%, var(--surface)); } }
.bloco.banc .b-check { display: none !important; }
.mesas.a-pintar { user-select: none; -webkit-user-select: none; }

.para-bater li { align-items: center; }
.link-bloco { font: inherit; font-size: 14px; background: none; border: 0; padding: 0; color: var(--text); cursor: pointer; text-align: left; }
.link-bloco:hover { text-decoration: underline; }
.etq.op-batida { background: color-mix(in srgb, var(--gold) 40%, transparent); color: var(--text); }
.etq.op-triagem { background: color-mix(in srgb, var(--venda) 18%, transparent); color: var(--venda); }
.etq.op-desdobramento { background: color-mix(in srgb, #7030a0 16%, transparent); color: #7a3fb0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .etq.op-desdobramento { color: #c49be8; } }
.etq.op-entrada { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.etq.op-libertar { background: var(--surface-2); color: var(--text-2); }

/* barra de ação e ficha */
.barra-acao { position: sticky; top: 8px; z-index: 20; margin: 0 0 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; box-shadow: 0 6px 24px rgba(0, 40, 50, .12); }
.barra-acao.vazia { box-shadow: none; background: var(--surface-2); }
.barra-acao.vazia .ba-ops .btn, .barra-acao.vazia .ba-data { opacity: .45; }
.barra-acao.vazia .ba-info strong { color: var(--text-2); }
.barra-acao button:disabled { cursor: default; }
.ba-linha { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; row-gap: 6px; }
.ba-info { flex: 1; font-size: 13.5px; color: var(--text-2); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ba-info strong { color: var(--text); }
.ba-data { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.ba-data input { width: auto; }
.ba-ops .btn.ativo { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.ba-rot { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.ba-mini { padding: 5px 10px; font-size: 12.5px; }
.ba-ops, .ba-lote { padding-top: 8px; border-top: 1px solid var(--border); }
.ba-ops .btn { min-width: 92px; }
.ba-lote select { min-width: 180px; max-width: 100%; }
.ba-link { font-size: 13px; font-weight: 600; color: var(--gold-forte); text-decoration: none; margin-left: auto; }
.ba-link:hover { text-decoration: underline; }
.barra-acao.vazia .ba-lote select, .barra-acao.vazia .ba-lote .btn { opacity: .45; }
.ba-extra { padding-top: 10px; border-top: 1px solid var(--border); }
.ba-extra input#opNotas { flex: 1; min-width: 140px; }
.ba-extra input#opSacos { width: 200px; }
.ficha { display: grid; grid-template-columns: minmax(130px, 1.2fr) 90px 150px 150px minmax(120px, 1.4fr) auto; gap: 8px; align-items: end; padding: 10px 0 8px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.ficha.apagada { opacity: .5; }
.ficha-campo label { font-size: 11.5px; margin-bottom: 3px; }
.ficha-campo input, .ficha-campo select { width: 100%; min-width: 0; }
.ficha .btn { height: 38px; }
@media (max-width: 1100px) { .ficha { grid-template-columns: 1fr 1fr 1fr; } .ficha .largo { grid-column: span 2; } }

/* setor: levas */
.balizas-edit { display: flex; gap: 8px; margin-top: 6px; }
.balizas-edit input { width: 90px; font-size: 22px; font-weight: 650; padding: 4px 8px; }
.barra-ocup { height: 6px; border-radius: 99px; background: var(--grid); margin-top: 8px; overflow: hidden; }
.barra-ocup i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.leva-linha { display: grid; grid-template-columns: 150px minmax(0, 1fr) 70px 60px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--border); margin: 0; }
.leva-linha > input, .leva-linha > select, .lv-data input { width: 100%; min-width: 0; }
.lv-data { display: flex; flex-direction: column; gap: 2px; }
.lv-data .dim { font-size: 11.5px; }
.lv-bal { text-align: center; color: var(--text-2); }
.lv-acoes { display: flex; gap: 6px; align-items: center; }
.lv-acoes .btn { padding: 6px 10px; font-size: 13px; }
.lv-retirar { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13.5px; background: var(--surface-2); padding: 8px 10px; border-radius: 8px; }
.lv-retirar input[type=date] { width: auto; }
.leva-linha.cab { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding-top: 0; }
.nova-leva { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.nova-leva h2 { margin-top: 0; }
.cores { display: flex; gap: 8px; flex-wrap: wrap; }
.cor { margin: 0; cursor: pointer; position: relative; }
.cor input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cor i { display: block; width: 28px; height: 28px; border-radius: 8px; border: 2px solid transparent; }
.cor input:checked + i { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }

/* ---------------------------------------------------------------- telemóvel */
@media (max-width: 760px) {
  .mapa { flex-direction: column; gap: 16px; }
  .zona-mapa { flex: none !important; }
  .zona-mapa + .zona-mapa { padding-left: 0; border-left: 0; padding-top: 14px; border-top: 2px dashed var(--border); }
  .setores { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .setor .bloco { min-height: 84px; }
  .barra-acao { position: static; padding: 8px; }        /* no telemóvel a ficha não tapa o mapa */
  .ba-ops .btn { padding: 9px 2px; font-size: 12.5px; min-width: 0; flex: 1 1 0; white-space: nowrap; letter-spacing: -.1px; }
  .ba-ops .btn[data-op=desdobramento] { flex-grow: 1.5; } .ba-data input { padding: 6px; font-size: 13px; }
  .ba-ops .ba-data { flex-basis: 100%; }
  .ba-lote select { flex: 1; min-width: 0; }
  .ba-link { flex-basis: 100%; margin-left: 0; }
  .ficha { grid-template-columns: 1fr 1fr; } .ficha .largo { grid-column: 1 / -1; } .ficha .btn { grid-column: 1 / -1; }
  .mesas { gap: 2px; }
  .fila.rotulos { flex: 0 0 24px; }
  .fila-n { font-size: 11px; }
  .bloco.banc { height: 26px; box-shadow: inset 2px 0 0 var(--cor); }
  .bloco.banc::after { display: none; }
  .banc-n { height: 26px; font-size: 10px; padding: 0 2px 0 0; }
  .bloco.banc .b-dias { font-size: 10px; }
  .parte-tit { font-size: 8.5px; letter-spacing: 0; }
  .parte-tit .pt-l { display: none; } .parte-tit .pt-c { display: inline; }
  .leva-linha.cab { display: none; }
  .balizas-edit input { width: 64px; font-size: 18px; }
  .balizas-edit .btn { padding: 6px 9px; font-size: 12.5px; }
  .leva-linha { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .lv-bal { display: none; }
  .lv-acoes { grid-column: 1 / -1; }
  .setores .setor-cab { justify-content: flex-start; padding-left: 4px; }
  .linha-ed input[name=parte_nome] { max-width: none; }
}

/* ---------------------------------------------------------------- assistente (boas-vindas e desenho guiado) */
.passos { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 18px; counter-reset: passo; flex-wrap: wrap; }
.passos li { counter-increment: passo; display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted);
  padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.passos li::before { content: counter(passo); display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--border); color: var(--text-2); font-size: 11.5px; }
.passos li.ativo { color: var(--text); border-color: var(--gold-forte); }
.passos li.ativo::before { background: var(--gold-forte); color: #fff; }
.passos li.feito::before { content: "✓"; background: color-mix(in srgb, var(--ok) 20%, var(--surface)); color: var(--ok); }
.assistente h2 { font-size: 22px; line-height: 1.25; margin-bottom: 6px; }
.assistente .sub { margin-bottom: 18px; }
.escolha-num { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.num-btn { width: 56px; height: 56px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2);
  font: inherit; font-size: 22px; font-weight: 700; color: var(--text); cursor: pointer; }
.num-btn:hover, .num-btn:focus-visible { border-color: var(--gold-forte); background: color-mix(in srgb, var(--gold) 18%, var(--surface)); }
.num-outro { display: flex; align-items: center; gap: 8px; margin: 0 0 0 4px; font-size: 14px; }
.num-outro input { width: 64px; height: 56px; font-size: 20px; text-align: center; margin: 0; }
.nomes-lista { display: grid; gap: 12px; }
.nome-viv { margin: 0; }
.nome-viv span { display: block; margin-bottom: 4px; }
.nome-viv input { width: 100%; font-size: 17px; padding: 10px 12px; margin: 0; }
.assistente .acoes { justify-content: space-between; }
.destaque-aviso { color: var(--warn); font-weight: 600; }
.viv-ordem { margin: 0 0 6px; padding-left: 22px; display: grid; gap: 8px; font-size: 16px; }
.viv-ordem li.atual { color: var(--gold-forte); }

.desenho-topo { margin-bottom: 18px; }
.dt-rot { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--gold-forte); }
.desenho-topo h1 { font-size: 32px; margin: 2px 0 12px; overflow-wrap: anywhere; }
.desenho-topo .passos { margin-bottom: 8px; }
.dt-seguir { margin: 0; font-size: 13.5px; color: var(--text-2); }

/* cartão do viveiro (nome + bater os sacos): em destaque, no topo */
.viv-cartao { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
  border-left: 4px solid var(--gold-forte); background: color-mix(in srgb, var(--gold) 9%, var(--surface)); }
.viv-cartao .viv-campos { flex: 1; }
.viv-campos { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 14px 18px; }
.viv-campos label { font-size: 13.5px; color: var(--text); }
.viv-campos input { font-size: 17px; padding: 9px 12px; }
.vc-nome input { width: 100%; }
.vc-bater .com-sufixo input { width: 84px !important; text-align: center; }
.vc-bater .com-sufixo span { font-size: 16px; font-weight: 600; }
.vc-bater .ajuda { margin: 6px 0 0; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.ed-form { margin-bottom: 16px; }
.ed-intro { margin: -6px 0 14px; }
.dica-partes { margin-top: 4px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border); }
.dica-partes p { margin: 0 0 10px; font-size: 13.5px; color: var(--text-2); }
.dica-partes.dividido { padding: 0; background: none; border: 0; }
.dica-partes.dividido p { display: none; }
.continuar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.continuar p { margin: 0; }

/* janela «tem flutuadores?» */
.modal-fundo { position: fixed; inset: 0; z-index: 80; background: rgba(5, 25, 32, .55); display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 420px; background: var(--surface); border-radius: 18px; padding: 24px 22px 20px; box-shadow: 0 20px 60px rgba(0,0,0,.3); text-align: center; }
.modal h2 { font-size: 21px; margin: 6px 0; }
.modal .sub { margin-bottom: 18px; }
.modal form { margin: 0; }
.modal .btn.largo { margin-top: 10px; }
.modal-icone { display: flex; justify-content: center; align-items: flex-end; gap: 6px; height: 46px; }
.modal-icone i { display: block; width: 22px; border-radius: 6px; background: color-mix(in srgb, var(--gold) 50%, var(--surface)); border: 1px solid color-mix(in srgb, var(--gold-forte) 45%, transparent); }
.modal-icone i:nth-child(1) { height: 30px; } .modal-icone i:nth-child(2) { height: 44px; } .modal-icone i:nth-child(3) { height: 36px; }

@media (max-width: 760px) {
  .viv-campos { grid-template-columns: 1fr; }
  .viv-cartao > .btn { width: 100%; }
  .desenho-topo h1 { font-size: 26px; }
  .btn.largo-tel { width: 100%; padding: 12px; }
  .ed-form .acoes .btn { flex: 1 1 auto; }
  .modal-fundo { align-items: end; padding: 0; }
  .modal { max-width: none; border-radius: 18px 18px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .num-btn { width: 52px; height: 52px; }
}

/* ---------------------------------------------------------------- explicação do mapa (tour) */
.tour-foco { position: fixed; z-index: 90; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 3px var(--gold-forte), 0 0 0 9999px rgba(5, 25, 32, .55); transition: all .2s ease; }
.tour-caixa { position: fixed; z-index: 91; width: min(380px, calc(100vw - 24px)); background: var(--surface); color: var(--text);
  border-radius: 16px; padding: 16px 18px; box-shadow: 0 16px 50px rgba(0,0,0,.3); }
.tour-caixa.centro { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.tour-caixa.baixo { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; }
.tour-topo { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.tour-conta { font-size: 12px; font-weight: 700; color: var(--gold-forte); text-transform: uppercase; letter-spacing: .5px; }
.tour-sair { font: inherit; font-size: 13px; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 4px; }
.tour-sair:hover { color: var(--text); }
.tour-tit { font-size: 18px; margin: 0 0 6px; }
.tour-txt { margin: 0 0 14px; font-size: 14.5px; line-height: 1.5; color: var(--text-2); }
.tour-acoes { display: flex; justify-content: space-between; gap: 8px; }
.tour-acoes .btn[data-tour-seg] { margin-left: auto; }
@media (prefers-reduced-motion: reduce) { .tour-foco { transition: none; } }

/* notas da triagem / desdobramento */
.ba-notas { display: grid; gap: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
.ba-notas label { margin: 0; }
.ba-notas textarea { width: 100%; resize: vertical; min-height: 56px; font-size: 15px; }
.ba-notas-acoes { display: flex; justify-content: flex-end; gap: 8px; }
.ba-ops .btn.ativo { border-color: var(--gold-forte); box-shadow: inset 0 0 0 1px var(--gold-forte); }
.h-notas { margin-top: 4px; font-size: 12.5px; color: var(--text-2); max-width: 260px; white-space: normal; }
@media (max-width: 760px) { .ba-notas-acoes .btn { flex: 1; } }

/* ---------------------------------------------------------------- início: tempo, maré e onde bater */
.form-linha { margin: 0; display: inline-flex; gap: 6px; align-items: center; }
.sec-topo { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; flex-wrap: wrap; }
.sec-topo h2 { margin: 0; }
.sel-local { font-size: 15px; font-weight: 600; padding: 6px 10px; max-width: 100%; }
.cond-kpis .valor small.de { font-size: 15px; }
.cond-kpis .chuva.sim .valor { color: var(--venda); }
.cond-espera { color: var(--muted); }
.mare-sentido { font-weight: 600; }
.mare-sentido.enche { color: var(--ok); }
/* computador: o tempo e a maré em cima, «onde bater» e a curva lado a lado.
   telemóvel: «onde bater» primeiro, que é a razão de abrir a página. */
.inicio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); column-gap: 16px; align-items: start;
  grid-template-areas: "cond cond" "bater mare"; }
.ini-cond { grid-area: cond; } .ini-bater { grid-area: bater; } .ini-mare { grid-area: mare; }
.ini-bater > h2 { margin: 6px 0 12px; }
.ini-mare { margin-top: 38px; }
.cond-mare h2 { margin-bottom: 4px; }
.mare-curva { display: block; width: 100%; height: auto; margin: 10px 0 8px; overflow: visible; }
.mc-area { fill: color-mix(in srgb, var(--venda) 12%, transparent); }
.mc-linha { fill: none; stroke: var(--venda); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.mc-grade { stroke: var(--grid); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mc-hora, .mc-agora-rot { fill: var(--muted); font-size: 11px; text-anchor: middle; }
.mc-agora-rot { text-anchor: start; }
.mc-agora { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.mc-ponto-agora { fill: var(--venda); stroke: var(--surface); stroke-width: 2; }
.mc-marca circle { fill: var(--surface); stroke: var(--venda); stroke-width: 2; }
.mc-marca.bm circle { fill: var(--venda); stroke: var(--surface); }
.mc-marca text { fill: var(--text-2); font-size: 12px; font-weight: 600; text-anchor: middle; }
.mare-tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.mare-tabela caption { text-align: left; padding: 0 0 4px; }
.mare-tabela td { padding: 7px 4px; border-top: 1px solid var(--border); }
.mare-tabela td:last-child { text-align: right; }
.mare-tabela tr.bm td:first-child { font-weight: 600; }
.cond-fonte { margin: 12px 0 0; }
.cond-fonte a { color: var(--text-2); }
.urgente { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: center; border-left: 6px solid var(--ok); }
.urgente.quase { border-left-color: var(--sit-quase); }
.urgente.atrasado { border-left-color: var(--sit-atrasado); }
.urg-dias { text-align: center; min-width: 70px; }
.urg-dias .num { display: block; font-size: 46px; font-weight: 750; line-height: 1; letter-spacing: -1px; }
.urg-dias small { color: var(--text-2); font-size: 13px; }
.urgente.atrasado .urg-dias .num { color: var(--sit-atrasado); }
.urgente.quase .urg-dias .num { color: var(--sit-quase); }
.urg-rot { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-2); }
.urg-info h3 { margin: 2px 0 0; font-size: 21px; }
.urg-info .sub { margin-top: 2px; }
.urg-conta { margin: 10px 0 0; display: flex; gap: 6px; flex-wrap: wrap; }
.urg-acao { grid-column: 1 / -1; margin-top: 10px; }
.urg-acao .form-linha, .urg-acao .btn { width: 100%; }
.etq.atrasado { background: var(--err-bg); color: var(--err); }
.etq.quase { background: var(--warn-bg); color: var(--warn); }
.etq.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.viv-lista { margin-top: 16px; }
.viv-lista .vl-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
@media (max-width: 960px) {
  .inicio { grid-template-columns: minmax(0, 1fr); grid-template-areas: "bater" "cond" "mare"; }
  .ini-mare { margin-top: 0; }
  .ini-bater > h2 { margin-top: 0; }
}
@media (max-width: 600px) {
  .cabecalho { margin-bottom: 14px; }
  .cabecalho h1 { font-size: 24px; }
  .urg-dias .num { font-size: 40px; }
}
@media (max-width: 600px) {   /* a curva encolhe para metade: as letras dentro dela crescem em proporção */
  .mare-curva { margin-bottom: 18px; }
  .mc-hora { font-size: 20px; }
  .mc-agora-rot { display: none; }
  .mc-marca text { font-size: 22px; }
  .mc-marca circle, .mc-ponto-agora { r: 8px; }
}
