/* ─────────────────────────────  tokens  ───────────────────────────── */
:root {
  --olive-900: #1c2f1a;
  --olive-800: #24401f;
  --olive-700: #2f5d2a;
  --olive-500: #4d8a44;
  --olive-200: #cfe2c6;
  --olive-100: #e7f0e2;
  --field: #f3f5ef;          /* fundo geral */
  --bone: #ffffff;           /* superfícies */
  --line: #dfe4d8;
  --ink: #1d251b;
  --ink-2: #4b564a;
  --ink-3: #7b8577;
  --wheat: #c9942e;          /* aviso / destaque */
  --wheat-100: #fbf1dd;
  --clay: #b5412e;           /* erro */
  --clay-100: #f8e3df;
  --sky-100: #e2ecf5;
  --radius: 10px;
  --radius-s: 6px;
  --shadow: 0 10px 30px rgba(28, 47, 26, .14);
  --font: "Manrope", ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --rail-w: 264px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.45;
  color: var(--ink); background: var(--field);
  -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 1, "cv11" 1;
}
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 20px; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { font: inherit; color: inherit; }
kbd { font: 11px var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--ink-3); background: var(--bone); }
code { font-family: var(--mono); font-size: 12px; background: var(--olive-100); padding: 1px 5px; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--olive-500); outline-offset: 2px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ─────────────────────────────  layout  ───────────────────────────── */
.app { display: grid; grid-template-columns: var(--rail-w) 1fr; min-height: 100vh; }
.main { min-width: 0; padding: 22px 28px 40px; }
.view { display: none; }
.view.is-active { display: block; }

/* rail */
.rail {
  background: var(--olive-800); color: #e9efe4; padding: 22px 16px; position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; gap: 22px;
  /* quando o menu é mais alto do que o ecrã (iPad, janelas baixas), a barra tem o seu próprio scroll (31/10/2026) */
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.25) transparent;
}
.rail > * { flex-shrink: 0; }
.rail-brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.rail-brand img { border-radius: 9px; }
.rail-brand strong { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.rail-brand span { display: block; font-size: 11.5px; color: #a9bda2; }
.rail-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 0; background: none; border-radius: 8px;
  color: #c9d7c2; text-align: left; cursor: pointer; font-weight: 600;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.is-active { background: var(--olive-700); color: #fff; }
.rail-presence { margin-top: auto; }
.presence-title { font-size: 11.5px; color: #a9bda2; padding: 0 6px 8px; font-weight: 600; }
.presence-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.presence-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,.05); }
.presence-list li.is-me { opacity: .75; }
.presence-list strong { display: block; font-size: 13px; line-height: 1.2; }
.presence-list span { display: block; font-size: 11.5px; color: #a9bda2; }
.presence-list span.editing { color: #f0c66a; }
.presence-list .dot { width: 8px; height: 8px; border-radius: 50%; background: #7ed37a; box-shadow: 0 0 0 3px rgba(126,211,122,.25); margin-left: auto; }
.presence-empty { font-size: 12.5px; color: #a9bda2; padding: 4px 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--c, var(--olive-500)); color: #fff; font-weight: 800; font-size: 14px;
}
.avatar.sm { width: 24px; height: 24px; font-size: 11px; }
.rail-me { display: flex; align-items: center; gap: 10px; padding: 10px 8px 0; border-top: 1px solid rgba(255,255,255,.1); }
.rail-me strong { display: block; font-size: 13px; }
.rail-me span { display: block; font-size: 11.5px; color: #a9bda2; }
.rail .avatar { box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.rail-me .icon-btn { margin-left: auto; color: #c9d7c2; }
.rail-me .icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }

/* ─────────────────────────────  controls  ─────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bone); font-weight: 600; color: var(--ink);
  transition: background .15s, border-color .15s;
}
.btn:hover { border-color: #c5ccbd; background: #fbfcf9; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--olive-700); border-color: var(--olive-700); color: #fff; }
.btn-primary:hover { background: var(--olive-800); border-color: var(--olive-800); }
.btn-block { width: 100%; justify-content: center; }
.btn-danger { color: var(--clay); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--olive-100); color: var(--olive-700); }
input, select, textarea {
  font: inherit; color: var(--ink); width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bone); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--olive-500); box-shadow: 0 0 0 3px rgba(77,138,68,.18); }
input:disabled, select:disabled, textarea:disabled { background: #f6f7f3; color: var(--ink-2); }
input[type=color] { padding: 3px; height: 40px; width: 64px; display: block; }
textarea { resize: vertical; }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
label > input, label > select, label > textarea, label > .input-row { margin-top: 5px; }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; }
.input-row { display: flex; align-items: center; gap: 4px; }
.input-row input { flex: 1; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--ink); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--olive-700); margin: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.span2 { grid-column: 1 / -1; }
.actions { display: flex; gap: 10px; justify-content: flex-end; }
.hint { font-size: 12px; color: var(--ink-3); font-weight: 500; }

/* ─────────────────────────────  toolbar / filters  ────────────────── */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.toolbar-right { display: flex; gap: 10px; }
.search { position: relative; flex: 1; max-width: 560px; display: flex; align-items: center; }
.search svg { position: absolute; left: 12px; color: var(--ink-3); }
.search input { padding-left: 38px; padding-right: 44px; height: 42px; border-radius: 10px; font-size: 14.5px; }
.search kbd { position: absolute; right: 12px; }
.filters { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-bottom: 12px; }
.chipset { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chipset-label { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-right: 2px; }
.chip {
  border: 1px solid var(--line); background: var(--bone); border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; color: var(--ink-2);
}
.chip.is-on { background: var(--olive-700); border-color: var(--olive-700); color: #fff; }
.toggle { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 12.5px; cursor: pointer; }
.toggle input { width: 16px; height: 16px; accent-color: var(--olive-700); margin: 0; }
.count { margin-left: auto; font-size: 12.5px; color: var(--ink-3); font-weight: 600; }

/* ─────────────────────────────  table  ────────────────────────────── */
.table-wrap { background: var(--bone); border: 1px solid var(--line); border-radius: 12px; overflow: auto; box-shadow: 0 1px 2px rgba(28,47,26,.04); }
.grid { width: 100%; border-collapse: collapse; }
.grid th { position: sticky; top: 0; background: #f8faf5; text-align: left; font-size: 12px; color: var(--ink-2); padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
.grid th.sortable { cursor: pointer; user-select: none; }
.grid th.sortable:hover { color: var(--olive-700); }
.grid th.sorted::after { content: " ↑"; color: var(--olive-500); }
.grid th.sorted.desc::after { content: " ↓"; }
.grid td { padding: 8px 12px; font-size: 13.5px; border-bottom: 1px solid #edf0e8; vertical-align: middle; white-space: nowrap; }
.grid tr:last-child td { border-bottom: 0; }
.grid tbody tr { cursor: pointer; }
.grid tbody tr:hover { background: #f6f9f2; }
.grid tbody tr.is-archived { color: var(--ink-3); }
.grid tbody tr.is-locked td:first-child::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--wheat); margin-right: 8px; vertical-align: middle; }
.grid td.num, .grid th.num { font-variant-numeric: tabular-nums; }
.grid .name { font-weight: 700; max-width: 380px; overflow: hidden; text-overflow: ellipsis; }
.grid .name small { display: block; font-weight: 500; color: var(--wheat); font-size: 11px; }
.grid .sub { color: var(--ink-3); font-size: 12px; }
.pw { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 12.5px; }
.pw .mask { letter-spacing: .15em; color: var(--ink-3); }
.pw .icon-btn { width: 26px; height: 26px; }
.pw .icon-btn svg { width: 14px; height: 14px; }
.pw .pwchg { color: var(--wheat); }
.pw .pwchg:hover { background: var(--wheat-100); color: #7a5410; }
/* luzes de estado do login IFAP */
.grid th.lightcol, .grid td.light { width: 26px; padding-left: 14px; padding-right: 0; }
.lamp { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #c9ccc3; vertical-align: middle; }
.lamp-lg { width: 14px; height: 14px; flex: none; }
.lamp-ok { background: #3fb64d; box-shadow: 0 0 0 3px rgba(63,182,77,.20); }
.lamp-fail { background: var(--clay); box-shadow: 0 0 0 3px rgba(181,65,46,.20); }
.lamp-unknown { background: #c9ccc3; }
.ifap-check { display: flex; align-items: center; gap: 12px; background: var(--bone); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.ifap-check .ifap-check-txt { display: flex; flex-direction: column; }
.ifap-check .ifap-check-txt strong { font-size: 13px; }
.ifap-check .actions { margin-left: auto; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--olive-100); color: var(--olive-800); }
.tag.olidal { background: var(--sky-100); color: #274a6d; }
.tag.ambas { background: var(--wheat-100); color: #7a5410; }
.empty { padding: 60px; text-align: center; color: var(--ink-3); }

/* ─────────────────────────────  alert bar (presença)  ─────────────── */
.alert-bar {
  display: flex; align-items: center; gap: 10px; background: var(--wheat-100); color: #6b4a0e; border: 1px solid #ecd4a0;
  padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 600;
}
.alert-bar .avatar { width: 26px; height: 26px; font-size: 12px; }
.alert-bar.is-error { background: var(--clay-100); color: #7a2a1e; border-color: #ecc3bb; }
.verif-bar { display: flex; align-items: center; gap: 10px; background: var(--sky-100); color: #274a6d; border: 1px solid #bcd2e6; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 600; }
.verif-bar .lamp { margin: 0 1px 0 6px; }
.verif-bar .btn { margin-left: auto; }
.spin { width: 15px; height: 15px; border: 2px solid #9db8d2; border-top-color: #274a6d; border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.remind-bar { display: flex; align-items: center; gap: 12px; background: var(--wheat-100); color: #6b4a0e; border: 1px solid #ecd4a0; padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 600; }
.remind-bar .btn { margin-left: auto; }
.remind-bar .icon-btn { color: #6b4a0e; }

/* ─────────────────────────────  drawer  ───────────────────────────── */
.scrim { position: fixed; inset: 0; background: rgba(28,47,26,.35); z-index: 20; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(1180px, 96vw); /* era 720px: pedido do Francisco, 08/11/2026 — não se viam os dados */ background: var(--bone); z-index: 21;
  box-shadow: var(--shadow); display: flex; flex-direction: column; animation: slide .22s ease-out;
}
@keyframes slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 26px 12px; }
.drawer-head h2 { font-size: 19px; }
.meta { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.lockbar { margin: 0 26px 10px; background: var(--wheat-100); border: 1px solid #ecd4a0; color: #6b4a0e; padding: 10px 14px; border-radius: 8px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.tabs { display: flex; gap: 4px; padding: 0 26px; border-bottom: 1px solid var(--line); }
.tab { border: 0; background: none; padding: 10px 12px; font-weight: 700; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.is-active { color: var(--olive-700); border-bottom-color: var(--olive-700); }
.tabpane { display: none; }
.tabpane.is-active { display: flex; flex-direction: column; }
.drawer-body { flex: 1; overflow: auto; padding: 18px 26px 26px; gap: 18px; }
.fs { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.fs legend { grid-column: 1 / -1; font-size: 12px; font-weight: 700; color: var(--olive-700); margin-bottom: 4px; padding: 0; }
.fs.vault { background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 16px; }
.drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.status { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.status.ok { color: var(--olive-500); }
.status.err { color: var(--clay); }
.drawer.is-readonly .drawer-foot #dSave { display: none; }

/* ─────────────────────────────  activity  ─────────────────────────── */
.activity { display: flex; flex-direction: column; gap: 6px; }
.act { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: start; background: var(--bone); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.act .avatar { width: 26px; height: 26px; font-size: 12px; }
.act .who { font-weight: 700; }
.act .what { color: var(--ink-2); }
.act .when { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.act .diff { font-family: var(--mono); font-size: 12px; margin-top: 3px; }
.act .old { color: var(--clay); text-decoration: line-through; }
.act .new { color: var(--olive-700); }
.activity.compact .act { padding: 8px 12px; }

/* ─────────────────────────────  cards / settings  ─────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card { background: var(--bone); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: flex; gap: 12px; align-items: flex-start; }
.card strong { display: block; }
.card span { display: block; font-size: 12.5px; color: var(--ink-3); }
.card .actions { margin-left: auto; flex-direction: column; }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.panel { background: var(--bone); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--ink-3); font-weight: 600; }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* ─────────────────────────────  toasts  ───────────────────────────── */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--olive-900); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow); animation: pop .18s ease-out; }
.toast.err { background: var(--clay); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ─────────────────────────────  dialog  ───────────────────────────── */
dialog { border: 0; border-radius: 14px; padding: 24px; width: min(520px, 92vw); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(28,47,26,.35); }
dialog.wide { width: min(760px, 92vw); max-height: 92vh; overflow: auto; }
.dlg-head h3 { font-size: 18px; }
.dlg-sub { font-size: 12px; font-weight: 700; color: var(--olive-700); margin-bottom: 6px; }
#tHist { max-height: 220px; overflow: auto; }

/* ─────────────────────────────  login  ────────────────────────────── */
.login-body { display: grid; place-items: center; background: linear-gradient(160deg, var(--olive-800), var(--olive-700) 55%, #5a8f4f); }
.login-card { width: min(400px, 92vw); background: var(--bone); border-radius: 16px; padding: 30px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 20px; }
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-brand img { border-radius: 12px; }
.login-brand h1 { font-size: 22px; letter-spacing: -.02em; }
.login-brand p { color: var(--ink-3); font-size: 12.5px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-error { color: var(--clay); font-weight: 600; font-size: 13px; }
.login-nota { font-size: 13px; line-height: 1.45; color: var(--ink-3); margin: 0 0 8px; }   /* 2.º fator (AZ Gere, 23/11/2026) */
.login-nota code { font-weight: 700; letter-spacing: .04em; }
.login-card [hidden] { display: none !important; }
.login-card label.login-lembrar { display: flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.login-card label.login-lembrar input { width: auto; margin: 0; flex: none; }

/* ─────────────────────────────  responsive  ───────────────────────── */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; }
  .rail-presence { margin-top: 0; }
  .main { padding: 16px; }
  .fs, .form-grid { grid-template-columns: 1fr; }
}

/* ─────────────────────────────  controlos IFAP  ───────────────────── */
.badge { margin-left: auto; background: var(--wheat); color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 7px; }
.robo { background: var(--olive-900); color: #d7e3d0; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.robo pre { margin: 6px 0 0; font: 12px var(--mono); white-space: pre-wrap; max-height: 180px; overflow: auto; }
.grid tr.is-ours td.name { color: var(--olive-700); }
.grid tr.is-new td:first-child { font-weight: 700; }
.grid td .note { width: 220px; padding: 4px 8px; font-size: 12.5px; }

/* coluna Controlo + nota editável na lista de agricultores */
.tag.ctl { background: var(--wheat-100); color: #7a5410; }
.grid td .note { width: 200px; padding: 4px 8px; font-size: 12.5px; }
.grid td .note.saved { border-color: var(--olive-500); box-shadow: 0 0 0 3px rgba(77,138,68,.18); }

/* siglas das medidas de controlo com dica ao passar o rato */
.med { border-bottom: 1px dotted currentColor; cursor: help; }
.ctl-cell { color: #7a5410; font-weight: 600; }

/* controlos físicos (Controlos IFAP 2026) */
.cifap-block { margin-bottom: 8px; }
.cifap-block .toolbar { margin: 4px 0 10px; }
.grid td .cif { width: 130px; padding: 4px 8px; font-size: 12.5px; }
.grid td .cif.wide { width: 170px; }
.grid td .cif.saved { border-color: var(--olive-500); box-shadow: 0 0 0 3px rgba(77,138,68,.18); }

/* atalhos para as minhas aplicações (barra lateral) */
.rail-atalhos { display: flex; flex-direction: column; gap: 2px; }
.rail-sub { font-size: 11px; color: #a9bda2; padding: 8px 6px 3px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.atalhos { display: flex; flex-direction: column; gap: 2px; }
.atalho { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border: 0; background: none; border-radius: 8px; color: #c9d7c2; text-align: left; cursor: pointer; font-weight: 600; font-size: 13px; text-decoration: none; width: 100%; }
.atalho:hover { background: rgba(255,255,255,.06); color: #fff; }
.atalho.off { opacity: .5; }
.atalho svg { width: 16px; height: 16px; }

/* cadeado nos atalhos protegidos por PIN */
.atalho .lk { margin-left: auto; width: 13px; height: 13px; opacity: .6; }

/* copiar NIFAP / NIF na lista (aparece ao passar o rato na linha) */
.cellcopy { display: inline-flex; align-items: center; gap: 4px; }
.cellcopy .icon-btn { width: 22px; height: 22px; visibility: hidden; }
.cellcopy .icon-btn svg { width: 13px; height: 13px; }
.grid tbody tr:hover .cellcopy .icon-btn { visibility: visible; }

/* ── ofícios do IFAP ─────────────────────────────────────────── */
.muted { color: var(--muted, #777); }
.oficio-badge { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px;
  padding: 1px 6px 1px 4px; border-radius: 10px; background: #e8f0fe; color: #1c56b0;
  font-size: 11px; font-weight: 700; vertical-align: middle; }
.oficio-badge svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.oficios-list { display: flex; flex-direction: column; gap: 6px; }
.oficio-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 7px 9px; border: 1px solid var(--line, #e3e3e3); border-radius: 8px; background: #fafafa; }
.oficio-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.oficio-main span { font-size: 12px; color: #555; }
.oficio-meta { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 12px; color: #666; }
.oficio-meta .btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.oficio-item.novo { border-color: #b9d4fb; background: #f2f7ff; }
.oficio-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #1c56b0; margin-right: 6px; vertical-align: middle; }

/* ── selo/filtro «responsabilidade AZ» ───────────────────────── */
.az-toggle { display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 17px; padding: 0 4px; margin-right: 6px;
  border-radius: 4px; font-size: 10.5px; font-weight: 800; letter-spacing: .5px;
  line-height: 1; vertical-align: middle; cursor: pointer; box-sizing: border-box; }
/* marcado: AZ verde cheio (destaca); ANA discreto (fundo claro, texto suave) */
.az-toggle.on.r-AZ { background: #2f5d2a; border: 1px solid #2f5d2a; color: #fff; }
.az-toggle.on.r-ANA { background: #eef1f4; border: 1px solid #dbe1e8; color: #7a8798; font-weight: 700; }
/* por marcar: contorno ténue, só aparece ao passar o rato na linha */
.az-toggle:not(.on) { background: transparent; color: #b6c0b3; border: 1px dashed #cdd6ca;
  visibility: hidden; }
.grid tbody tr:hover .az-toggle:not(.on) { visibility: visible; }
.az-toggle:not(.on):hover { color: #2f5d2a; border-color: #2f5d2a; border-style: solid; }
.chip.chip-resp { font-weight: 800; letter-spacing: .5px; }
.chip.chip-resp.r-AZ.is-on { background: #2f5d2a; border-color: #2f5d2a; color: #fff; }
.chip.chip-resp.r-ANA.is-on { background: #eef1f4; border-color: #c7d0da; color: #566475; }

/* ── modo só consulta (Mac da Sandra via OneDrive) ─────────────── */
.ro-banner { background:#fff4d6; border:1px solid #f0d58a; color:#6b5200; border-radius:10px;
  padding:9px 14px; margin:0 0 12px; font-size:13px; }
.ro #btnNovo, .ro #dSave, .ro #btnVerif, .ro .pwchg, .ro #dLampCheck, .ro #dLampOk, .ro #dLampFail,
.ro #dGerarMapa, .ro #dVerifOficios, .ro #dMarcarVistos, .ro #btnCtlNovo, .ro #btnCtlNossos { display:none !important; }
.ro .az-toggle:not(.on) { visibility:hidden !important; }
.ro .az-toggle { pointer-events:none; }
.ro #btnNovoTec, .ro #btnCtlParar { display:none !important; }

/* ─────────────────────────────  pagamentos PU 2026  ───────────────── */
.search.search-sm { flex: 0 1 300px; }
.search.search-sm input { height: 36px; font-size: 13.5px; padding-right: 12px; }
.pag-meses { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.pag-mes { background: var(--bone); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.pag-mes .m { font-size: 12px; font-weight: 700; color: var(--olive-700); }
.pag-mes .d { font-size: 11px; color: var(--ink-3); }
.pag-mes .v { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 2px; }
.pag-mes .r { font-size: 11px; color: var(--ink-2); margin-top: 2px; }
.pag-mes.atual { border-color: var(--olive-500); box-shadow: 0 0 0 2px var(--olive-100); }
.pag-grid td.pv, .pag-grid th.pv { text-align: right; font-variant-numeric: tabular-nums; }
.pag-grid th.pv span { display: block; font-weight: 500; color: var(--ink-3); font-size: 10.5px; }
.pag-grid td.pv { cursor: pointer; position: relative; }
.pag-grid td.pv:hover { background: var(--olive-100); }
.pag-grid td.pv.vazio { color: #c5ccc0; cursor: default; }
.pag-grid td.pv.vazio:hover { background: none; }
.pag-grid td.pv.rec { background: #e7f0e2; color: var(--olive-800); font-weight: 600; }
.pag-grid td.pv.dif { box-shadow: inset 0 -2px 0 var(--wheat); }
.pag-grid td.tot { font-weight: 700; }
.pag-grid td.nm { max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.pag-grid td.nm .sub { display: block; }
.pag-grid tfoot td { position: sticky; bottom: 0; background: #f0f4ef; font-weight: 800; border-top: 2px solid var(--olive-700); }
.pag-f { display: inline-block; font-size: 10px; font-weight: 800; color: #fff; background: var(--olive-700); border-radius: 4px; padding: 0 4px; margin-left: 4px; vertical-align: 1px; }
.pag-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; }
.pag-sw.rec { background: #e7f0e2; border: 1px solid var(--olive-200); }
.pag-legenda { margin-top: 10px; }
/* Pagamentos PU 2026: valores escondidos, só aparecem com o rato em cima (Francisco, 12/11/2026) */
.view[data-view="pagamentos"] .oc { filter: blur(6px); transition: filter .12s; }
.view[data-view="pagamentos"] td:hover .oc, .view[data-view="pagamentos"] .pag-mes:hover .oc { filter: none; }
.pag-sem { margin-top: 14px; font-size: 13px; }
.pag-sem summary { cursor: pointer; color: var(--ink-2); font-weight: 600; }
.pag-sem div { margin-top: 8px; color: var(--ink-2); line-height: 1.7; }
.pag-det { margin: 12px 0 16px; }
.pag-det td { white-space: normal; }
.pag-det tfoot td { font-weight: 800; border-top: 2px solid var(--olive-700); }
.pag-form { margin-top: 4px; }
body.ro #btnPagImportar, body.ro #pagSave, body.ro #pagIgual { display: none; }
/* luz do login IFAP clicável → abre o IFAP do agricultor */
.lamp-btn { border: 0; background: none; padding: 6px; margin: -6px; border-radius: 50%; cursor: pointer; line-height: 0; }
.lamp-btn:hover { background: var(--olive-100); }
.lamp-btn:hover .lamp { transform: scale(1.25); }
body.ro .lamp-btn { pointer-events: none; }
.fat-taxa { border: 1px solid var(--line); background: var(--bone); border-radius: 999px; padding: 2px 10px; font-weight: 800; font-size: 12px; cursor: pointer; color: var(--olive-700); }
.fat-taxa.t100 { background: var(--olive-700); color: #fff; border-color: var(--olive-700); }
.fat-taxa:hover { box-shadow: 0 0 0 3px var(--olive-100); }
body.ro .fat-taxa { pointer-events: none; }
body.ro #fatSave, body.ro #fatIgual { display: none; }
.pag-grid .f25 { background: #fafbf8; border-left: 2px solid var(--line); color: var(--ink-2); }
.pag-grid td.f25 .sub { display: block; font-size: 11px; }
.pag-grid td.f25.dif { background: var(--wheat-100); color: #7a5410; }
.pag-grid th.f25 span { display: block; font-weight: 500; color: var(--ink-3); font-size: 10.5px; }
.pag-grid tr.pag-sep td { background: var(--wheat-100); color: #7a5410; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-top: 2px solid var(--wheat); }
.fat-aadp { display: inline-block; border: 1px dashed #c7d0da; color: #566475; background: #eef1f4; border-radius: 999px; padding: 2px 9px; font-weight: 800; font-size: 11px; }
.novo-etapas{margin:4px 0 0 18px;padding:0;font-size:13px;color:var(--muted,#666);max-height:180px;overflow:auto}
.novo-etapas li{margin:2px 0}
#novoDlg{max-width:560px}
.pag-email details{margin:6px 0}
.pag-email summary{cursor:pointer;font-size:13px}
.pag-email pre{white-space:pre-wrap;font:inherit;font-size:12.5px;background:var(--bg-soft,#f6f6f3);padding:8px 10px;border-radius:6px;margin:4px 0}
.pag-email textarea{width:100%;box-sizing:border-box}
.pag-grid td.pv.certo { background: #bfe5b5; color: #1f5a17; font-weight: 700; }
.pag-grid td.pv.certo:hover { background: #aedba3; }
.pag-ok { margin-left: 4px; font-size: 11px; color: #1f5a17; }
.pag-correto { background: #eef7ea; border: 1px solid #cfe6c7; border-radius: 6px; padding: 6px 8px; }
.pag-comp tr.pag-motivo td { white-space: normal; font-size: 12.5px; line-height: 1.45; padding-top: 2px; padding-bottom: 10px; border-top: 0; }
.pag-comp tbody tr:not(.pag-motivo) td { border-bottom: 0; }
.fat-ast { position:relative; display:inline-block; margin-left:4px; color:#1f6fd1; font-weight:700; font-size:16px; line-height:1; cursor:help; vertical-align:top; }
.fat-ast .fat-nota-pop { display:none; position:absolute; left:14px; top:-4px; z-index:50; width:420px; max-width:60vw; font-size:12px; font-weight:normal; line-height:1.45; color:#1f4e79; background:#eef5fd; border:1px solid #b9d3f0; border-radius:6px; padding:8px 10px; box-shadow:0 4px 14px rgba(0,0,0,.15); white-space:normal; text-align:left; }
.fat-ast:hover .fat-nota-pop { display:block; }
.fat-desc { display:block; margin-top:3px; font-size:11.5px; color:#8a4b12; background:#fff3e2; border-radius:4px; padding:2px 6px; white-space:normal; }
.pag-motivo-ed { margin-left:6px; padding:0 6px; font-size:12px; }
th.ord { cursor: pointer; user-select: none; }
th.ord:hover { color: var(--olive-800, #2f5d2a); }
th.ord.on { color: var(--olive-800, #2f5d2a); }
td.grp, th.grp { white-space: nowrap; font-size: 12.5px; color: #4a5446; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.pag-estado { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pag-estado .pag-resolver { background: #fff3e2; border: 1px solid #f0d2a8; border-radius: 6px; padding: 6px 8px; }
.pag-estado .pag-resolver-obs { grid-column: 1 / -1; }
.pag-estado .pag-resolver-obs textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; }
.pag-grid td.pv.resolver { background: #ffe3bf; color: #8a4b12; font-weight: 700; }
.pag-grid td.pv.resolver:hover { background: #ffd6a3; }
.pag-res { margin-left: 4px; font-size: 11px; color: #b5412e; font-weight: 800; }
tr.fat-linha { cursor: pointer; }
tr.fat-linha:hover td { background: var(--olive-100, #eef3ea); }
td.fat-ref { color: #7b8577; font-style: italic; }
.pag-grid td.conta-c, .pag-grid th.conta-c { text-align: center; white-space: nowrap; min-width: 168px; }
select.fat-conta { -webkit-appearance: none; appearance: none; width: 160px; height: 32px; box-sizing: border-box;
  font: inherit; font-size: 13px; font-weight: 600; letter-spacing: .01em; text-align: left;
  padding: 0 30px 0 12px; border-radius: 8px; border: 1px solid #b9cdb0; cursor: pointer;
  background: #f1f7ec url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%234a5a43' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center / 11px 8px; color: #2f5d2a;
  box-shadow: 0 1px 0 rgba(30, 50, 20, .06); transition: border-color .15s, box-shadow .15s; }
select.fat-conta:hover { border-color: #8fb07f; }
select.fat-conta:focus-visible { outline: none; border-color: #5d8a4c; box-shadow: 0 0 0 3px rgba(93, 138, 76, .22); }
select.fat-conta.t75 { background-color: #e3f0da; border-color: #a5c595; color: #2a5523; }
select.fat-conta.t100 { background-color: #d3e9c6; border-color: #8dbb79; color: #234a1c; }
select.fat-conta.aadp { background-color: #eef1f6; border-color: #c3cad6; color: #45506a; }
.pag-grid td.nm:has(.fat-ast) { overflow: visible; }
.fat-paga { display:block; margin-top:3px; font-size:11.5px; color:#5b3d8a; background:#f2ecfa; border-radius:4px; padding:2px 6px; white-space:normal; font-weight:normal; }
.fat-subtot td { font-weight:700; background:#eef3e6; border-top:2px solid #b9c9a3; }
.fat-subtot td.f25 { background:#f3ecdc; }
.fat-reparte td { font-size:12.5px; color:#3d5226; background:#f5f8f0; padding-top:4px; padding-bottom:4px; }
.fat-reparte td:first-child { padding-left:24px; }
.fat-reparte td.f25 { background:#f7f2e6; }
.fat-acordo { display:block; margin-top:3px; font-size:11.5px; color:#2f5d3a; background:#e6f2e8; border-radius:4px; padding:2px 6px; white-space:normal; font-weight:normal; }
.fat-ana { display:block; margin-top:3px; font-size:11.5px; border-radius:4px; padding:2px 6px; white-space:normal; font-weight:600; }
.fat-ana.ok { color:#1f5a17; background:#d9efd0; }
.fat-ana.rep { color:#8a4b12; background:#ffe3bf; font-weight:500; }
.fat-ana.falta { color:#6b7280; background:#f0f2f4; font-weight:500; }
.fat-ana.val { color:#1d4e7a; background:#dde9f5; font-weight:600; }

/* ───────────────────────────── vista Mapas ───────────────────────────── */
.mapas-layout{display:flex;gap:12px;height:calc(100vh - 170px);min-height:420px}
.mapas-lista{width:300px;flex:none;background:var(--bone);border:1px solid var(--line);border-radius:var(--radius);overflow:auto}
.mapas-kpi{display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px;padding:10px;border-bottom:1px solid var(--line);position:sticky;top:0;background:var(--bone);z-index:1}
.mapas-kpi div{background:var(--olive-100);border-radius:var(--radius-s);padding:6px 8px;text-align:center}
.mapas-kpi b{display:block;font-size:16px;color:var(--olive-700)}
.mapas-kpi span{font-size:11px;color:var(--ink-3)}
.mp-item{display:flex;align-items:center;gap:8px;padding:7px 10px;border-bottom:1px solid var(--line);cursor:pointer;font-size:13px}
.mp-item:hover{background:var(--field)}
.mp-item.is-on{background:var(--olive-100)}
.mp-item .sw{width:14px;height:14px;border-radius:4px;flex:none;border:2px solid transparent}
.mp-item .nm{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mp-item .nm small{display:block;color:var(--ink-3);font-size:11px}
.mp-item .ha{color:var(--ink-2);font-variant-numeric:tabular-nums;font-size:12px;white-space:nowrap}
.mp-item.sem{opacity:.45}
.mapas-mapa{flex:1;position:relative;border-radius:var(--radius);overflow:hidden;border:1px solid var(--line);background:#2b3a29}
#mpMapa{position:absolute;inset:0}
.mapas-aviso{position:absolute;left:50%;top:12px;transform:translateX(-50%);z-index:1000;background:#fff;border-radius:20px;padding:6px 14px;font-size:13px;box-shadow:var(--shadow)}
.mp-pop{font-size:13px;line-height:1.4}
.mp-pop .btn{margin-top:6px;font-size:12px;padding:4px 8px}
.reap-ifap-acoes{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:-4px}
.reap-ifap-acoes .hint{flex:1;min-width:180px}
.az-ir{margin-top:8px;padding-top:6px;border-top:1px solid #e0e0e0;display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center;font-size:12.5px;line-height:1.5}
.az-ir-voar{border:1px solid #2e7d32;background:#fff;color:#2e7d32;border-radius:6px;padding:3px 9px;font:inherit;font-weight:600;cursor:pointer}
.az-ir a{color:#2e7d32;font-weight:600;text-decoration:none}
.az-ir-c{color:#888;font-size:11px;width:100%;user-select:all;-webkit-user-select:all}
.sel{height:36px;border:1px solid var(--line);border-radius:var(--radius-s);background:var(--bone);padding:0 10px;font:inherit;max-width:220px}
@media (max-width:900px){.mapas-layout{flex-direction:column;height:auto}.mapas-lista{width:auto;max-height:220px}.mapas-mapa{height:60vh}}
/* o mapa Leaflet desenha em SVG: isentar da regra global dos ícones (svg 18×18, stroke currentColor) */
#mpMapa svg{width:auto;height:auto;fill:none;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;flex:initial}
#mpMapa .leaflet-control-zoom a{font-size:18px}
.mp-sobre-wrap{position:relative;display:inline-block}
.mp-sobre{position:absolute;right:0;top:calc(100% + 6px);z-index:1200;background:#fff;border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:10px 12px;min-width:270px;display:flex;flex-direction:column;gap:5px;font-size:13px;text-align:left}
.mp-sobre[hidden]{display:none}
.mp-sobre b{font-size:12px;color:var(--ink-3);margin-bottom:2px}
.mp-sobre label{display:grid;grid-template-columns:18px 1fr;align-items:center;gap:7px;cursor:pointer;white-space:nowrap;text-align:left;margin:0;font-weight:normal;font-size:13px;color:var(--ink)}
.mp-sobre label input{margin:0;width:16px;height:16px}
.mp-sobre small{color:var(--ink-3);font-size:11px;margin-top:4px}
#mpS2 select{margin-left:4px}
/* análise com IA */
.analise-acoes { display:grid; gap:8px; margin-bottom:8px; }
.analise-linha { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.analise-linha select { max-width:320px; min-width:0; font:inherit; font-size:12.5px; padding:4px 8px; border-radius:6px; border:1px solid #cdd8c6; }
.analise-dica { font-size:12px; }
.analise-up { cursor:pointer; }
#dAnalPedido { width:100%; box-sizing:border-box; font:inherit; font-size:13px; }
.analise-estado { font-size:12.5px; padding:6px 10px; border-radius:6px; background:#eef5e9; color:#2f5d2a; }
.analise-estado.erro { background:#fde8e4; color:#9a2f1f; }
.analise-lista { display:grid; gap:6px; }
.analise-item { display:flex; flex-wrap:wrap; gap:4px 10px; align-items:baseline; text-align:left; font:inherit; font-size:13px; padding:8px 10px; border:1px solid #dfe6da; border-radius:8px; background:#fbfcfa; cursor:pointer; }
.analise-item:hover { border-color:#9cc78c; background:#f3f8ef; }
.analise-item .muted { font-size:12px; }
.analise-corpo { max-height:68vh; overflow:auto; padding:4px 2px 12px; font-size:14px; line-height:1.55; }
.analise-corpo h3, .analise-corpo h4 { margin:16px 0 6px; font-size:15.5px; color:#2f5d2a; }
.analise-corpo h5, .analise-corpo h6 { margin:12px 0 4px; font-size:14px; }
.analise-corpo ul, .analise-corpo ol { padding-left:22px; margin:6px 0; }
.analise-corpo li { margin:3px 0; }
.analise-corpo p { margin:6px 0; max-width:78ch; }
.analise-corpo .tw { overflow-x:auto; }
.analise-corpo table { border-collapse:collapse; font-size:13px; margin:8px 0; }
.analise-corpo th, .analise-corpo td { border:1px solid #dfe6da; padding:4px 8px; text-align:left; vertical-align:top; }
.analise-corpo th { background:#f1f6ed; }
.prio { display:inline-block; font-size:11px; font-weight:700; border-radius:4px; padding:1px 6px; margin-right:4px; }
.prio-alta { background:#fde1dc; color:#9a2f1f; }
.prio-media { background:#ffeccc; color:#8a4b12; }
.prio-baixa { background:#e6f0f8; color:#2a5577; }
/* gastos IA */
.gastos-nota { font-size:12.5px; margin:0 0 10px; max-width:90ch; }
.gastos-grupos { display:grid; grid-template-columns:repeat(auto-fit, minmax(260px, 1fr)); gap:12px; margin:12px 0; }
.gastos-grupos .panel h3, .view[data-view="gastosia"] > .panel h3 { margin:0 0 8px; font-size:14px; }
.view[data-view="gastosia"] td.num, .view[data-view="gastosia"] th.num { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.gastos-lista td .sub { display:block; font-size:11.5px; color:#6b7280; }
.gastos-linha { cursor:pointer; }
.gastos-linha:hover td { background:#f3f8ef; }
.analise-pastas { display:grid; gap:6px; padding:8px 10px; border:1px dashed #cfdac8; border-radius:8px; background:#fbfcfa; }
.analise-sub { font-size:12.5px; font-weight:600; color:#2f5d2a; }
.pastas-lista { display:grid; gap:4px; }
.pasta-item { display:flex; align-items:center; gap:8px; font-size:12.5px; min-width:0; }
.pasta-item svg { width:16px; height:16px; flex:none; fill:none; stroke:#5d8a4c; stroke-width:2; }
.pasta-item .pasta-nome { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pasta-item.off .pasta-nome { color:#9aa29a; text-decoration:line-through; }
.pastas-sug { display:flex; flex-wrap:wrap; gap:6px; align-items:center; font-size:12px; }
.pastas-sug .chip { font-size:12px; }
.analise-ensinar { display:grid; gap:8px; margin:10px 0; padding:10px 12px; border-radius:8px; background:#fff7e8; border:1px solid #f0d9a8; font-size:13px; }
.analise-ensinar textarea { width:100%; box-sizing:border-box; font:inherit; font-size:13px; }
.analise-ensinar select { font:inherit; font-size:12.5px; padding:4px 8px; border-radius:6px; border:1px solid #d8c7a0; }
#analDlg .actions { display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; }
.regras-lista { display:grid; gap:8px; }
.regra-item { display:grid; gap:6px; padding:8px 10px; border:1px solid #dfe6da; border-radius:8px; background:#fbfcfa; }
.regra-item.off { opacity:.55; }
.regra-item textarea { width:100%; box-sizing:border-box; font:inherit; font-size:13px; }
.regra-meta { display:flex; flex-wrap:wrap; gap:8px; align-items:center; font-size:12px; }
.regra-meta .chip { font-size:11.5px; cursor:default; }
.ia-bloqueio { margin:0 0 10px; }
.ia-bl { display:flex; flex-wrap:wrap; gap:6px 12px; align-items:center; padding:10px 12px; border-radius:8px; background:#eef5e9; border:1px solid #cfe1c4; font-size:13px; }
.ia-bl.on { background:#fde8e4; border-color:#f1b8ac; color:#7d2617; }
.ia-bl span { flex:1; min-width:200px; }
.btn.btn-bloq { background:#b3361f; border-color:#b3361f; color:#fff; }
.analise-item-wrap { display:flex; gap:6px; align-items:stretch; }
.analise-item-wrap .analise-item { flex:1; min-width:0; }
.analise-apagar { align-self:center; }
.gastos-linha.apagada td { color:#9aa29a; cursor:default; }
/* proposta de correção do Excel (análises com IA) */
#analDlg.prop-larga { width: min(1180px, 96vw); }
.proposta { display:grid; gap:16px; margin-top:6px; font-size:13px; line-height:1.45; }
.proposta input[type=checkbox], .proposta input[type=radio] { width:16px; height:16px; margin:0; padding:0; flex:none; box-shadow:none; accent-color:var(--olive-700); cursor:pointer; }
.pv-antiga { background:var(--clay-100); border:1px solid #e9b9b0; color:#7d2a1d; border-radius:10px; padding:10px 14px; display:flex; flex-wrap:wrap; gap:8px 12px; align-items:center; }
.pv-antiga .btn { margin-left:auto; }
.pv-resumo { display:flex; flex-wrap:wrap; gap:10px 16px; align-items:center; justify-content:space-between; background:var(--olive-100); border-radius:10px; padding:10px 14px; }
.pv-ficheiro { font-family:var(--mono); font-size:12px; color:var(--ink-2); min-width:0; overflow-wrap:anywhere; }
.pv-nums { display:flex; flex-wrap:wrap; gap:6px; }
.pv-nums span { background:var(--bone); border:1px solid var(--line); border-radius:999px; padding:3px 10px; font-size:12.5px; white-space:nowrap; }
.pv-nums .pv-num-aviso { background:var(--wheat-100); border-color:#ecd39d; color:#7a5200; }
.pv-sec > header { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; margin-bottom:8px; }
.pv-sec > header h4 { margin:0; font-size:15.5px; color:var(--olive-700); }
.pv-sel { margin-left:auto; display:flex; gap:6px; }
.pv-grupo { border:1px solid var(--line); border-radius:10px; margin-bottom:10px; overflow:hidden; background:var(--bone); }
.proposta label.pv-folha { display:flex; align-items:center; gap:10px; padding:8px 12px; background:#f6f8f3; border-bottom:1px solid var(--line); font-size:13px; font-weight:400; color:var(--ink); cursor:pointer; }
.pv-tw { overflow-x:auto; }
.proposta .pv-tab { width:100%; border-collapse:collapse; font-size:13px; margin:0; }
.proposta .pv-tab th, .proposta .pv-tab td { border:0; border-bottom:1px solid #eef1ea; padding:7px 10px; vertical-align:top; text-align:left; }
.proposta .pv-tab th { background:transparent; color:var(--ink-3); font-weight:600; font-size:10.5px; text-transform:uppercase; letter-spacing:.05em; padding-top:6px; padding-bottom:6px; }
.proposta .pv-tab tr:last-child td { border-bottom:0; }
.proposta .pv-tab td:first-child, .proposta .pv-tab th:first-child { width:30px; padding-right:0; }
.pv-tab td:first-child input { margin-top:2px; }
.pv-cel { width:64px; }
.pv-cel code, .pv-mini code { font-family:var(--mono); font-size:12px; background:var(--olive-100); padding:1px 6px; border-radius:4px; white-space:nowrap; }
.pv-antes { width:20%; } .pv-depois { width:25%; }
.proposta .pv-seta { width:14px; padding-left:0; padding-right:0; color:var(--ink-3); }
.pv-old { color:#8a3b2e; text-decoration:line-through; text-decoration-color:rgba(181,65,46,.45); overflow-wrap:anywhere; }
.pv-new { color:var(--olive-700); font-weight:700; overflow-wrap:anywhere; }
.pv-vazio { color:var(--ink-3); font-style:italic; }
.pv-motivo { color:var(--ink-2); }
.proposta .pv-aviso td { background:var(--wheat-100); }
.pv-alerta { color:#7a5200; font-weight:600; margin-top:3px; font-size:12px; }
.pv-dec { border:1px solid var(--line); border-radius:10px; padding:12px 14px; margin-bottom:10px; background:var(--bone); }
.pv-dec-q { margin-bottom:10px; } .pv-dec-q .muted { font-size:12px; margin-top:2px; }
.pv-ops { display:grid; gap:8px; }
.proposta label.pv-op { display:flex; gap:10px; align-items:flex-start; border:1px solid var(--line); border-radius:8px; padding:9px 12px; font-weight:400; font-size:13px; color:var(--ink); cursor:pointer; }
.proposta label.pv-op:has(input:checked) { border-color:var(--olive-500); background:var(--olive-100); }
.pv-op input { margin-top:2px; }
.pv-op-tit { font-weight:700; } .pv-op-exp { color:var(--ink-2); margin-top:2px; }
.pv-op-nao .pv-op-tit { font-weight:600; color:var(--ink-2); }
.pv-tag { font-size:10.5px; background:var(--olive-700); color:#fff; border-radius:999px; padding:1px 8px; font-weight:600; margin-left:4px; vertical-align:1px; }
.proposta .pv-mini { margin:8px 0 0; font-size:12px; border-collapse:collapse; }
.proposta .pv-mini td { border:0; padding:2px 10px 2px 0; background:transparent; }
.pv-decidir { margin:0; padding-left:22px; display:grid; gap:8px; }
.pv-decidir li span { display:block; color:var(--ink-2); }
.pv-barra { position:sticky; bottom:-12px; display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; background:var(--bone); border-top:1px solid var(--line); padding:12px 2px; z-index:1; }
#pvConta { font-weight:700; color:var(--olive-700); }
/* e-mail de envio ao controlo */
.envio { display:grid; gap:16px; margin-top:6px; font-size:13px; }
.ev-notas { background:var(--wheat-100); border:1px solid #ecd39d; border-radius:10px; padding:10px 14px; color:#5f4300; }
.ev-notas ul { margin:6px 0 0; padding-left:20px; }
.ev-notas summary { cursor:pointer; }
.ev-notas li { margin:4px 0; }
.ev-mail { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,2fr); gap:10px 14px; background:var(--bone); border:1px solid var(--line); border-radius:10px; padding:12px 14px; }
.ev-mail .ev-larga { grid-column:1 / -1; }
.ev-mail textarea { font:13px/1.5 var(--font); }
.ev-anexos { display:grid; gap:8px; }
.envio label.ev-anexo { display:flex; gap:10px; align-items:flex-start; border:1px solid var(--line); border-radius:8px; padding:9px 12px; font-weight:400; font-size:13px; color:var(--ink); background:var(--bone); }
.envio .ev-anexo input { width:16px; height:16px; margin:2px 0 0; flex:none; accent-color:var(--olive-700); }
.ev-anexo-tit a { font-weight:700; color:var(--olive-700); text-decoration:none; }
.ev-fontes { font-size:11.5px; color:var(--ink-3); margin-top:3px; overflow-wrap:anywhere; }
.ev-falta { margin:0; padding-left:20px; display:grid; gap:6px; }
.envio .ev-bol { width:100%; border-collapse:collapse; font-size:12.5px; margin:0; }
.envio .ev-bol th, .envio .ev-bol td { border:0; border-bottom:1px solid #eef1ea; padding:6px 8px; text-align:left; vertical-align:top; }
.envio .ev-bol th { background:transparent; color:var(--ink-3); font-size:10.5px; text-transform:uppercase; letter-spacing:.05em; }
.ev-conf { font-weight:700; white-space:nowrap; }
.ev-conf.ok { color:var(--olive-700); } .ev-conf.nao { color:var(--clay); } .ev-conf.sd { color:var(--wheat); }
@media (max-width: 640px) { .ev-mail { grid-template-columns:1fr; } }

/* ── aba Email ── */
.em-filtros { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.em-filtros select { padding: 5px 8px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--bone); font: inherit; }
.chip b { font-weight: 800; margin-left: 3px; opacity: .8; }
.em-grid .em-row { cursor: pointer; }
.em-grid .em-row.is-open td { background: var(--olive-100); }
.em-grid .nowrap { white-space: nowrap; }
.em-addr { font-size: 12px; }
/* janela estreita: o assunto e o remetente quebram de linha, para o Estado e os botões caberem sempre (15/10/2026) */
.em-grid td:nth-child(3), .em-grid td:nth-child(4) { white-space: normal; overflow-wrap: anywhere; }
.em-grid td:nth-child(3) { min-width: 170px; max-width: 240px; }
.em-grid td:nth-child(4) { min-width: 160px; }
.em-grid td:nth-child(6) { white-space: normal; min-width: 196px; }
.em-grid td:nth-child(6) .btn { margin: 2px 0; }
@media (max-width: 1400px) { .em-grid th:nth-child(2), .em-grid tr.em-row td:nth-child(2) { display: none; } }
.em-st { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.em-novo { background: var(--wheat-100); color: #8a6214; }
.em-rascunho { background: var(--olive-100); color: var(--olive-700); }
.em-ignorado, .em-respondido { background: #eef1f4; color: #566475; }
.em-det td { background: var(--bone); }
/* anexos dos emails e das tarefas (15/10/2026) */
.em-anexos { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; font-size: 13px; }
.em-anx { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--field); color: var(--ink); text-decoration: none; font-size: 12.5px; max-width: 100%; overflow-wrap: anywhere; }
a.em-anx:hover { border-color: var(--olive-500); color: var(--olive-700); }
.em-anx small { color: var(--ink-2); font-size: 11px; white-space: nowrap; }
.em-anx.off { opacity: .55; }
.em-anx.sig { opacity: .6; font-size: 11.5px; }
.em-anx.sel { cursor: pointer; }
.em-anx.sel input { margin: 0; }
.em-clip { font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.em-tarefa { background: #e8eef9; color: #2d4f86; }
.em-pess { font-size: 12px; }
.btn.em-pess-on { background: #f4ecf7; border-color: #c9a8d6; color: #6b3a80; }
.tar-anexos-lbl { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.em-meta { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.em-corpo { white-space: pre-wrap; font: 13px/1.5 var(--font); background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px; max-height: 420px; overflow: auto; margin: 0; }

/* relatório de controlo do IFAP — alerta na lista até ser lido */
.ctl-badge { margin-left: 6px; padding: 1px 7px; border-radius: 10px; border: 1px solid #e0b4b4; background: #fff4f4;
  color: #a33; font-size: 11px; font-weight: 700; cursor: pointer; vertical-align: middle; }
.ctl-badge.novo { background: #c62828; border-color: #c62828; color: #fff; animation: ctlpulse 2s ease-in-out 3; }
.ctl-badge:hover { filter: brightness(.95); }
/* envio dos documentos ao controlo (aba Controlos IFAP) */
.env { font-size: 12px; font-weight: 700; white-space: nowrap; text-decoration: none; }
.env.ok { color: var(--olive-700); }
.env.falta { color: var(--wheat); }
.env-aviso { color: var(--clay); }
/* prazo de envio dos documentos ao controlo */
.prz { font-size: 12px; font-weight: 700; white-space: nowrap; }
.prz.ok { color: var(--olive-700); }
.prz.perto { color: var(--wheat); }
.prz.fora { color: var(--clay); }
@keyframes ctlpulse { 50% { box-shadow: 0 0 0 4px rgba(198,40,40,.25); } }
/* Mapas: árvore grupo → agricultor → camadas (como no mapa simples) */
.mapas-lista{width:330px}
.mp-topo{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px;border-bottom:1px solid var(--line);font-size:12.5px;background:var(--bone)}
.mp-topo label{display:flex;align-items:center;gap:6px;margin:0;font-weight:600;cursor:pointer}
.mp-lk{background:none;border:none;color:var(--olive-700);font:inherit;font-size:12px;cursor:pointer;padding:2px 0;text-decoration:underline}
.mp-camtodos{display:flex;flex-direction:column;gap:4px;padding:8px 12px 10px;border-bottom:1px solid var(--line);background:var(--olive-100);font-size:12.5px}
.mp-camtodos[hidden]{display:none}
.mp-camtodos label,.mp-cam label{display:flex;align-items:center;gap:7px;margin:0;font-weight:normal;cursor:pointer}
.mp-camtodos small{color:var(--ink-3);font-size:11px;margin-top:2px}
.mp-grupo{display:flex;align-items:center;gap:6px;padding:7px 8px;background:var(--field);border-bottom:1px solid var(--line);font-size:13px;font-weight:700}
.mp-grupo .nm{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mp-grupo .ha{font-weight:normal;color:var(--ink-3);font-size:12px}
.mp-seta{background:none;border:none;cursor:pointer;font-size:13px;color:var(--ink-2);width:20px;padding:0;flex:none}
.mp-item{padding:6px 8px 6px 14px}
.mp-item input[type=checkbox],.mp-grupo input[type=checkbox]{margin:0;width:16px;height:16px;flex:none}
.mp-item .nm small b{color:var(--olive-700);font-weight:600}
.mp-cam{display:flex;flex-direction:column;gap:4px;padding:6px 12px 10px 44px;border-bottom:1px solid var(--line);background:#fff;font-size:12.5px}
.mp-cam .mp-acoes{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}
.mp-cam .mp-acoes .btn{font-size:12px;padding:3px 8px;height:auto}
.mp-erro{color:#b71c1c;font-size:12px;margin-bottom:4px}
.mp-legenda{background:rgba(255,255,255,.95);border-radius:8px;box-shadow:0 1px 6px rgba(0,0,0,.25);padding:8px 10px;font-size:12px;max-height:45vh;max-width:300px;overflow:auto;line-height:1.35}
.mp-legenda[hidden]{display:none}
.mp-legenda b{display:block;margin:6px 0 3px;font-size:11.5px;color:#444}
.mp-legenda b:first-child{margin-top:0}
.mp-legenda div{display:flex;align-items:center;gap:6px}
.mp-legenda i{width:12px;height:12px;border-radius:3px;flex:none;border:1px solid rgba(0,0,0,.25)}
.mp-legenda span{flex:1;min-width:0}
.mp-legenda em{font-style:normal;color:#777;white-space:nowrap;font-variant-numeric:tabular-nums}
.mp-lbl span{display:inline-block;transform:translate(-50%,-50%);background:rgba(0,0,0,.55);color:#fff;font-size:11px;font-weight:600;padding:1px 5px;border-radius:4px;text-align:center;white-space:nowrap;line-height:1.25}
.mp-sublbl span{display:inline-block;transform:translate(-50%,-50%);background:#fff;color:#222;font-size:10.5px;font-weight:700;min-width:18px;height:18px;line-height:18px;border-radius:9px;text-align:center;padding:0 4px;box-shadow:0 0 0 1px rgba(0,0,0,.35)}
#mpMapa .leaflet-control-rotate a{width:34px;height:34px;line-height:34px;background:#fff}
.mp-cam input[type=checkbox],.mp-camtodos input[type=checkbox],.mp-topo input[type=checkbox]{width:16px;height:16px;flex:none;margin:0}
.mp-cam label,.mp-camtodos label{text-align:left;color:var(--ink);font-size:12.5px;line-height:1.3}
.mp-leg-tit{display:block;width:100%;text-align:left;background:none;border:none;font:inherit;font-weight:700;font-size:12px;color:#333;padding:0 0 4px;cursor:pointer}
@media (max-width:900px){.mapas-lista{width:auto;max-height:45vh}.mapas-mapa{flex:none;height:65vh;min-height:380px}}

/* ───── Tarefas (09/10/2026) */
.tar-resumo { display:flex; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
.tar-resumo .k { background:#fff; border:1px solid var(--line); border-radius:10px; padding:8px 12px; font-size:12px; color:var(--ink-3); cursor:pointer; }
.tar-resumo .k b { display:block; font-size:18px; color:var(--ink); }
.tar-resumo .k.mau b { color:#b3261e; }
.tar-sel { border:1px solid var(--line); border-radius:999px; padding:3px 10px; font:inherit; font-size:12.5px; background:var(--bone); }
.tar-grid td.assunto { white-space:normal; min-width:240px; }
.tar-grid td.assunto .d { display:block; font-size:12px; color:var(--ink-3); max-width:520px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tar-grid tr { cursor:pointer; }
.tar-grid tr.is-res td { opacity:.55; }
.tar-grid tr.is-res td.assunto b { text-decoration:line-through; }
.tar-grid tr.is-nova td.assunto b::after { content:" ● nova"; color:#c0620a; font-size:11px; font-weight:800; }
.tar-prio { display:inline-block; width:9px; height:9px; border-radius:50%; background:#c7cfbf; }
.tar-prio.alta { background:#e0a100; } .tar-prio.urgente { background:#c62828; }
.tar-est { display:inline-block; font-size:11.5px; font-weight:700; border-radius:999px; padding:2px 9px; background:#eef1ea; color:#4a5a3f; }
.tar-est.em_curso { background:#e3edf8; color:#285a8f; } .tar-est.espera { background:#fbefd9; color:#8a5a00; }
.tar-est.resolvida { background:#e3f1e5; color:#2e6b39; } .tar-est.nota { background:#efe9f6; color:#5d3f86; }
.tar-prazo.vencido { color:#b3261e; font-weight:700; } .tar-prazo.hoje { color:#c0620a; font-weight:700; }
.tar-ok { border:1px solid var(--line); background:#fff; border-radius:8px; width:30px; height:28px; cursor:pointer; font-weight:800; color:#2e6b39; }
.tar-ok:hover { background:#e3f1e5; }
.tar-coment { border-top:1px solid var(--line); padding-top:10px; }
.tar-coment-lista { display:flex; flex-direction:column; gap:8px; max-height:240px; overflow:auto; margin-bottom:8px; }
.tar-coment-lista .c { background:#f6f8f2; border-radius:8px; padding:7px 10px; font-size:13px; white-space:pre-wrap; }
.tar-coment-lista .c small { display:block; color:var(--ink-3); font-size:11px; margin-bottom:2px; }
.tar-coment-novo { display:flex; gap:8px; align-items:flex-end; }
.tar-coment-novo textarea { flex:1; }
.tar-ficha .t { display:flex; gap:8px; align-items:center; padding:5px 0; border-bottom:1px solid #edf0e8; font-size:13px; cursor:pointer; }
.tar-ficha .t:last-child { border-bottom:none; }
.tar-ficha .t .q { flex:1; }
@media (max-width:900px) { .tar-grid th:nth-child(8), .tar-grid td:nth-child(8) { display:none; } }

/* ───── REAP: efetivo como no SI-REAP */
.reap-ef { border:1px solid var(--line); border-radius:10px; padding:10px 12px; background:#fafbf7; }
.reap-ef-tit { font-size:13px; margin-bottom:6px; }
.reap-ef-tab { width:100%; border-collapse:collapse; font-size:13px; }
.reap-ef-tab th { text-align:left; font-size:11.5px; color:var(--ink-3); padding:4px 6px; }
.reap-ef-tab td { padding:3px 6px; }
.reap-ef-tab .num { text-align:right; }
.reap-ef-tab select { width:100%; min-width:0; }
.reap-ef-tab input.ef-n { width:90px; text-align:right; }
.reap-ef-tab td.ef-cn { font-variant-numeric:tabular-nums; width:80px; }

/* ───── REAP: preparar documentos */
.rd-form { display:block; }
.rd-fs { border:1px solid var(--line); border-radius:10px; padding:8px 12px 10px; margin:10px 0; }
.rd-fs legend { font-weight:700; font-size:13px; padding:0 4px; }
.rd-fs .form-grid { padding:0; }
.rd-c.rd-f input, .rd-c.rd-f textarea { border-color:#c62828; background:#fff5f5; }
.rd-c.rd-f { color:#b3261e; }
.rd-falta { background:#fdecea; border:1px solid #f3b8b2; border-radius:10px; padding:8px 12px; font-size:13px; color:#8c1d18; }
.rd-falta ul { margin:4px 0 0 18px; padding:0; }
.rd-avisos { background:#fff6e0; border:1px solid #f0d58c; border-radius:10px; padding:8px 12px; font-size:12.5px; color:#6d4c00; margin-top:8px; display:flex; flex-direction:column; gap:4px; }
.rd-fich { background:#eef6ec; border:1px solid #c5dfc0; border-radius:10px; padding:8px 12px; font-size:13px; margin-top:10px; }
.rd-fich ul { margin:4px 0 4px 18px; padding:0; }

/* ───── REAP: estado no SI-REAP */
.reap-ifap { display:inline-block; font-size:11px; font-weight:700; border-radius:999px; padding:1px 8px; margin-left:6px; background:#e3edf8; color:#285a8f; vertical-align:1px; }
.reap-ifap.ok { background:#e3f1e5; color:#2e6b39; } .reap-ifap.mau { background:#fdecea; color:#b3261e; }
.reap-ifap.warn { background:#fdf3e0; color:#9a6a0b; }

.pag-analisar { display:flex; gap:10px; align-items:center; margin:4px 0 12px; }

.tar-est.aviso { background:#fff1d6; color:#8a5a00; }

/* ───── Análises de terra, água e foliares (11/10/2026) */
.lab-job { background:#fff6e0; border:1px solid #f0d58c; border-radius:10px; padding:8px 12px; font-size:13px; color:#6d4c00; margin-bottom:10px; }
.lab-job.err { background:#fdecea; border-color:#f3b8b2; color:#8c1d18; }
.lab-grid td { vertical-align:top; }
.lab-grid .name { max-width:260px; }
.lab-nifap { display:block; font-weight:500; font-size:11px; color:var(--ink-3); }
.lab-lab { display:block; font-size:11px; }
.lab-letra { display:inline-flex; align-items:center; justify-content:center; min-width:20px; height:20px; padding:0 5px; border-radius:6px; background:var(--olive-700); color:#fff; font-size:11.5px; font-weight:800; }
.lab-sig { display:inline-block; font-size:10.5px; font-weight:800; letter-spacing:.02em; border-radius:5px; padding:1px 6px; background:var(--sky-100); color:#274a6d; }
.lab-sig.zv { background:#fbefd9; color:#8a5a00; }
.lab-zona { display:inline-block; min-width:18px; text-align:center; font-size:11px; font-weight:800; border-radius:5px; padding:1px 5px; background:var(--olive-100); color:var(--olive-800); }
.lab-mini { display:inline-block; font-size:11px; border-radius:999px; padding:1px 7px; background:#eef1ea; color:#4a5a3f; white-space:nowrap; }
.lab-mini.valida { background:#e3f1e5; color:#2e6b39; }
.lab-mini.renovar, .lab-mini.ref_renovar, .lab-mini.antiga { background:#fbefd9; color:#8a5a00; }
.lab-mini.vencida, .lab-mini.falta { background:#fdecea; color:#b3261e; }
.lab-est { display:inline-block; font-size:11.5px; font-weight:700; border-radius:999px; padding:2px 9px; background:#eef1ea; color:#4a5a3f; white-space:nowrap; }
.lab-est.valida { background:#e3f1e5; color:#2e6b39; }
.lab-est.renovar { background:#fbefd9; color:#8a5a00; }
.lab-est.vencida, .lab-est.falta { background:#fdecea; color:#b3261e; }
.lab-est.antiga, .lab-est.ref_renovar { background:#f6f0e2; color:#7a6330; }
.lab-est.sem_analise, .lab-est.sem_zona, .lab-est.sem_prazo, .lab-est.sem_data { background:#f0f2ec; color:var(--ink-3); font-weight:600; }
.lab-ja { color:#b3261e; }
.lab-pdf { display:inline-block; font-size:11px; font-weight:800; color:#b3261e; border:1px solid #f0c9c4; border-radius:6px; padding:1px 6px; text-decoration:none; background:#fff; }
.lab-pdf:hover { background:#fdecea; }
.lab-regras-nota { margin:4px 0 10px; }
.lab-regras-tab td.lab-wrap, .lab-wrap { white-space:normal; max-width:420px; }
.lab-regras-tab tbody tr { cursor:default; }
.lab-anos { width:56px; padding:3px 6px; }
.lab-form { display:block; }
.lab-sec { border-top:1px solid var(--line); padding:10px 0; font-size:13px; }
.lab-sec p { margin:4px 0; }
.lab-vals { display:grid; grid-template-columns:repeat(auto-fill, minmax(140px, 1fr)); gap:8px; margin:6px 0 10px; }
.lab-vals div { background:#f6f8f2; border-radius:8px; padding:6px 10px; }
.lab-vals span { display:block; font-size:11px; color:var(--ink-3); }
.lab-vals b { font-size:15px; }
/* verificação com IA dos boletins (15/11/2026) */
.lab-ia-ponto { display:inline-block; width:9px; height:9px; border-radius:50%; margin-right:6px; vertical-align:1px; background:#c9ccc4; }
.lab-ia-ponto.lab-ia-verde { background:#3d8b40; }
.lab-ia-ponto.lab-ia-amarelo { background:#e0a400; }
.lab-ia-ponto.lab-ia-vermelho { background:#c62828; }
.lab-ia-ponto.lab-ia-erro { background:#7a7a7a; }
.lab-ia-ponto.lab-ia-pendente { background:#c9ccc4; }
.lab-ia-ponto.lab-ia-sem_pdf { background:transparent; box-shadow:inset 0 0 0 1.5px #9a9d95; }
.lab-sec.lab-ia { border-left:4px solid #c9ccc4; padding-left:10px; margin:4px 0 8px; border-top:none; border-radius:4px; background:#fafbf8; }
.lab-sec.lab-ia-verde { border-left-color:#3d8b40; }
.lab-sec.lab-ia-amarelo { border-left-color:#e0a400; background:#fffaeb; }
.lab-sec.lab-ia-vermelho { border-left-color:#c62828; background:#fdf1f0; }
.lab-ia li.lab-ia-vermelho { color:#a51d1d; }
.lab-ia li.lab-ia-amarelo { color:#7a5a00; }
.lab-det { margin:6px 0 10px; font-size:13px; }
.lab-det summary { cursor:pointer; color:var(--olive-700); font-weight:600; }
.lab-mini-tab { border-collapse:collapse; margin-top:6px; width:100%; }
.lab-mini-tab td { padding:3px 8px; border-bottom:1px solid #edf0e8; font-size:12.5px; }
.lab-parc { font-size:12px; word-break:break-all; }
.lab-ul { margin:6px 0 0 0; padding-left:18px; display:flex; flex-direction:column; gap:6px; }
.lab-ligar { margin-top:8px; gap:8px; flex-wrap:wrap; }
.lab-ligar select { flex:1; min-width:220px; max-width:100%; }
.lab-edit { padding:10px 0; }
.lab-quem { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.lab-zona-top { display:flex; justify-content:space-between; gap:8px; align-items:center; border-top:none; padding-top:0; }
.lab-ficha-tab { width:100%; border-collapse:collapse; font-size:12.5px; }
.lab-ficha-tab th { text-align:left; font-size:11px; color:var(--ink-3); padding:4px 6px; font-weight:600; }
.lab-ficha-tab td { padding:5px 6px; border-top:1px solid #edf0e8; vertical-align:top; }
.lab-ficha-tab tbody tr { cursor:pointer; }
.lab-ficha-tab tbody tr:hover { background:#f6f9f2; }
/* sítio-mãe das análises: n.º a abrir o PDF, cadeado ENR/PB, aviso quando o Caderno/Partilha têm outra (01/11/2026) */
a.lab-bol-link { color:#1f5d8c; text-decoration:underline; text-underline-offset:2px; }
a.lab-bol-link:hover { color:#123e60; }
.lab-tranca { display:inline-block; margin-top:2px; font-size:11.5px; font-weight:600; color:#5a4a12; background:#fbf3dc; border:1px solid #ecdcae; border-radius:6px; padding:1px 6px; white-space:nowrap; }
.lab-tr-aviso { display:inline-block; margin-top:2px; font-size:11px; font-weight:700; color:#9a4b00; background:#fff1e0; border-radius:6px; padding:1px 6px; cursor:help; white-space:nowrap; }
.lab-tr-aviso-p { color:#9a4b00; }
.lab-subs { font-size:11.5px; color:var(--ink-2); cursor:help; }
.lab-tranca-sec { border-left:3px solid #e2c56b; padding-left:10px; }
.lab-ficha-bol { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.lab-chip { font-size:12px; border:1px solid var(--line); border-radius:999px; padding:2px 9px; background:#fff; cursor:pointer; }
.lab-chip:hover { background:#f6f9f2; }
@media (max-width:900px) {
  #labZonasWrap .lab-grid th:nth-child(5), #labZonasWrap .lab-grid td:nth-child(5) { display:none; }
  #labBolWrap .lab-grid th:nth-child(n+5):nth-child(-n+8), #labBolWrap .lab-grid td:nth-child(n+5):nth-child(-n+8) { display:none; }
  .lab-grid .name { max-width:150px; }
}
section[data-view="labanalises"] .filters { gap:14px; }
section[data-view="labanalises"] .filters .chipset { flex-wrap:nowrap; }
section[data-view="labanalises"] .filters select { width:auto; max-width:250px; margin-top:0; }
section[data-view="labanalises"] .filters input[type=checkbox] { width:auto; margin:0; }
.lab-grid td { white-space:normal; }
.lab-grid td.lab-z { min-width:200px; max-width:300px; }
.lab-grid td .sub.blk, .lab-grid td .blk { display:block; }
.lab-grid td.lab-nw { white-space:nowrap; }
.lab-regras-tab td:last-child { min-width:380px; }

.mp-fora{padding:8px 10px;font-size:12px;color:var(--ink-3);border-top:1px solid var(--line);background:var(--bone)}
.mp-fora .mp-lk{margin-left:2px}

/* ── Férias (16/10/2026) ── */
.fer-pend { background: #fff6e6; border: 1px solid #f0d49a; border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; display: grid; gap: 8px; font-size: 13.5px; }
.fer-pend-l { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.fer-pend-b { margin-left: auto; display: inline-flex; gap: 6px; }
.fer-resumo { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.fer-k { background: var(--bone); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13px; display: inline-flex; align-items: center; gap: 7px; }
.fer-k b { font-size: 16px; }
.fer-k small { color: #8a6214; }
.fer-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.fer-dot.pend { background: repeating-linear-gradient(45deg, #b9a77c 0 2px, #f3ead6 2px 4px); }
.fer-ano { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; flex-wrap: wrap; }
.fer-ano b { font-size: 16px; min-width: 44px; text-align: center; }
.fer-leg { display: inline-flex; flex-wrap: wrap; gap: 12px; margin-left: 10px; font-size: 12px; color: var(--ink-2); }
.fer-leg > span { display: inline-flex; align-items: center; gap: 5px; }
.fer-cel-mini { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line); }
.fer-cel-mini.dois { border: 2px solid #d48a1c; }
.fer-cel-mini.fer { background: #f1e7e7; }
.fer-cal { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 12px; margin: 0 0 18px; }
.fer-mes { background: var(--bone); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px 10px; min-width: 0; }
.fer-mes-t { font-weight: 700; font-size: 13px; text-transform: capitalize; margin: 0 0 4px; color: var(--olive-700); }
.fer-sem, .fer-dias { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.fer-sem span { font-size: 10.5px; color: var(--ink-2); text-align: center; }
.fer-d { position: relative; height: 30px; border-radius: 6px; font-size: 11.5px; text-align: center; padding-top: 2px; color: var(--ink); font-variant-numeric: tabular-nums; }
.fer-d.vazio { visibility: hidden; }
.fer-d.fds { color: #a3aa9c; }
.fer-d.fer { background: #f1e7e7; color: #9a4b4b; }
.fer-d.hoje { outline: 2px solid var(--olive-500); outline-offset: -2px; font-weight: 700; }
.fer-d.dois { box-shadow: inset 0 0 0 2px #d48a1c; }
.fer-d i { position: absolute; left: 3px; right: 3px; bottom: 3px; display: flex; gap: 2px; }
.fer-d i b { flex: 1; height: 6px; border-radius: 3px; }
.fer-d i b.pend { opacity: .45; }
.fer-sub { font-size: 14px; margin: 6px 0 8px; }
.fer-grid .num { text-align: right; }
.fer-est { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.fer-est.marcada, .fer-est.autorizada { background: var(--olive-100); color: var(--olive-700); }
.fer-est.pendente { background: #fff1d6; color: #8a6214; }
.fer-est.recusada { background: #f4e4e4; color: #9a4b4b; }
.fer-prev { font-size: 13px; border-radius: 8px; padding: 8px 10px; }
.fer-prev:empty { display: none; }
.fer-prev.bom { background: var(--olive-100); color: var(--olive-700); }
.fer-prev.aviso { background: #fff1d6; color: #8a6214; }
.fer-prev.mau { background: #f4e4e4; color: #9a4b4b; }

/* aba «2027» › «PU 2027» */
.tabs-ano { padding: 0; margin-bottom: 14px; }
.p27-grid tbody tr { cursor: default; }
.p27-grid a.p27-nome { color: var(--olive-700); text-decoration: none; }
.p27-grid a.p27-nome:hover { text-decoration: underline; }
.p27-prep { color: var(--olive-700); font-size: 12.5px; font-weight: 600; }
.p27-acoes { text-align: right; }
.p27-acoes .btn { margin-left: 4px; }
.p27-acoes .btn svg { width: 15px; height: 15px; }
.p27-acoes .btn.p27-sem { opacity: .45; }
/* nome do agricultor que abre a ficha (todas as abas) */
.ficha-link { color: inherit; text-decoration: none; cursor: pointer; }
.ficha-link:hover { color: var(--olive-700); text-decoration: underline; }
/* grupo da ficha que abre e fecha na seta (Análise com IA) */
.fs-toggle { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 4px; }
.fs-toggle .seta { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.5; transition: transform .15s; }
fieldset:not(.fs-fechado) > .fs-toggle .seta { transform: rotate(90deg); }
.fs-fechado > :not(legend) { display: none !important; }

/* aba «Planos» › Pastagens Biodiversas */
.pb-grid tbody tr { cursor: default; }
.pb-grid td { vertical-align: top; }
.pb-grid .name { max-width: 300px; }
.pb-grid a.p27-nome { color: var(--olive-700); text-decoration: none; }
.pb-grid a.p27-nome:hover { text-decoration: underline; }
.pb-grid td small.pb-sub { display: block; font-weight: 500; font-size: 11px; color: var(--ink-3); }
.pb-an { line-height: 1.7; }
.pb-aviso { color: #b3261e; cursor: help; font-weight: 800; }
.pb-cartao { cursor: pointer; }
.pb-cartao:hover { border-color: var(--olive-500); }
.pb-grid tr.pb-painel td { background: #f8faf5; white-space: normal; }
.pb-cand-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.pb-cand ul { list-style: none; margin: 6px 0 0; padding: 0; }
.pb-cand li { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px solid #edf0e8; }
.pb-cand-nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.subpl[hidden] { display: none; }
.pb-data { font-weight: 700; font-variant-numeric: tabular-nums; }
.pb-ok { color: #2e6b39; font-weight: 800; text-decoration: none; cursor: help; }
a.pb-ok { cursor: pointer; }
a.pb-bol { color: #1f5d8c; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
a.pb-bol:hover { color: #123e60; }
.pb-nao { display: inline-block; min-width: 14px; text-align: center; border-radius: 50%; background: #f0f2ec; color: var(--ink-3); font-size: 10.5px; font-weight: 800; cursor: help; }
.pb-novas { font-size: 11.5px; color: #274a6d; background: var(--sky-100); border-radius: 6px; padding: 1px 7px; margin-top: 3px; display: inline-block; white-space: normal; }
.pb-novas a { color: inherit; }

/* aba Planos › Pastagens Biodiversas: plano inicial e alterações, verificações e emails com a Kiwa (31/10/2026) */
.pb-k { font-size: 12px; font-weight: 700; color: var(--olive-700); }
.pb-tag { display: inline-block; font-size: 10.5px; font-weight: 700; color: var(--ink-2); background: #f0f2ec; border-radius: 999px; padding: 0 7px; white-space: nowrap; }
.pb-det { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px 22px; padding: 4px 2px; }
.pb-det-full { grid-column: 1 / -1; }
.pb-det h4 { margin: 0 0 6px; font-size: 13px; }
.pb-det h4 .sub { font-weight: 500; font-size: 11px; }
.pb-vlist { list-style: none; margin: 0; padding: 0; }
.pb-v { display: flex; gap: 7px; align-items: flex-start; padding: 3px 0; font-size: 12.5px; line-height: 1.45; }
.pb-v-i { flex: 0 0 16px; text-align: center; font-weight: 800; }
.pb-v.ok .pb-v-i { color: #2e6b39; }
.pb-v.mal .pb-v-i { color: var(--clay); }
.pb-v.mal { color: #6d2418; }
.pb-v.info .pb-v-i { color: var(--wheat); }
table.pb-vers { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.pb-vers th { text-align: left; font-size: 11px; color: var(--ink-3); font-weight: 700; padding: 2px 6px; border-bottom: 1px solid var(--line); }
table.pb-vers td { padding: 4px 6px; border-bottom: 1px solid #edf0e8; vertical-align: top; }
table.pb-vers .num { text-align: right; white-space: nowrap; }
.pb-rasc { margin-top: 6px; font-size: 12px; }
.pb-rasc ul { margin: 4px 0 0; padding-left: 16px; }
.pb-ths { list-style: none; margin: 0; padding: 0; }
.pb-th { border-top: 1px solid #edf0e8; padding: 5px 0; font-size: 12.5px; }
.pb-th.resp { background: #fdf6f4; }
.pb-th-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pb-th-ass { flex: 1 1 260px; min-width: 0; }
.pb-th details summary { cursor: pointer; font-size: 11.5px; margin-top: 2px; }
.pb-msgs { margin: 4px 0 2px; padding-left: 18px; }
.pb-msgs li { margin: 3px 0; }
.pb-msgs li.nosso { color: var(--ink-2); }
.pb-res { font-size: 11.5px; color: var(--ink-2); white-space: normal; }
.pb-emails { background: var(--bone); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; margin: 0 0 12px; }
.pb-emails > summary { cursor: pointer; font-size: 13px; }
.pb-emails .pb-ths { margin-top: 6px; }
@media (max-width: 900px) { .pb-det { grid-template-columns: 1fr; } }

/* arquivo de agricultores (31/10/2026) */
.lockbar.arqbar { background: #eef0eb; border-color: var(--line); color: var(--ink-3); font-weight: 500; }
.lockbar.arqbar svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; }
.lockbar.arqbar span { flex: 1; }
.btn.btn-arq { margin-right: auto; color: var(--ink-3); }
.drawer-foot .actions:has(.btn-arq:not([hidden])) { flex: 1; }
.grid .name small.arq-motivo { color: var(--ink-3); font-style: italic; }
/* WhatsApp nos pagamentos (31/10/2026) */
.btn.btn-wa { background: #1f8f4e; border-color: #1f8f4e; color: #fff; }
.btn.btn-wa:hover { background: #17733e; border-color: #17733e; }
.pag-email .pe-wa-ico { color: #1f8f4e; font-weight: 600; }
.btn.btn-wa-mail { background: #17733e; border-color: #17733e; color: #fff; }

/* ───── Análises: «Por ligar» (31/10/2026) */
.lab-ligar-lista { display:flex; flex-direction:column; gap:12px; }
.lab-lig { background:var(--bone); border:1px solid var(--line); border-radius:var(--radius); padding:10px 14px; }
.lab-lig > header { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:6px; }
.lab-lig .lab-ficha-tab tbody tr { cursor:default; }
.lab-lig .lab-ficha-tab tbody tr:hover { background:transparent; }
.lab-lig-sel select { width:100%; max-width:420px; margin:0; font-size:12.5px; }
.lab-chip.livre { border-color:#f0d58c; background:#fff9ea; }
@media (max-width:900px) { .lab-lig .lab-ficha-tab th:nth-child(2), .lab-lig .lab-ficha-tab td:nth-child(2) { display:none; } }
.lab-lig .blk { display:block; margin-top:2px; }
.lab-sig.arroz { background:#eef4d9; color:#4f5f12; }
.lab-arroz { background:#f7f9ee; border-radius:8px; padding:8px 10px; border-top:none; margin-top:6px; }

/* ───── Ficha: enrelvamento a caducar → troca e parcelas do boletim (08/11/2026) */
.lab-enr { display:flex; flex-direction:column; gap:12px; margin:6px 0 14px; }
.lab-enr-card { border:1px solid #e6dcbd; background:#fffaf0; border-radius:10px; padding:12px 16px; }
.lab-enr-tit { font-size:13.5px; margin-bottom:6px; }
.lab-enr-card p { margin:6px 0; font-size:13px; line-height:1.55; white-space:normal; }
.lab-enr-ok { color:#2e6b39; }
.lab-enr-ok .lab-enr-anular { margin-left:8px; }
.lab-enr-acoes { display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin-top:10px; }
.lab-enr-parc { margin-top:14px; padding:16px 18px; background:#fff; border:1px solid var(--line); border-radius:10px; }
.lab-enr-parc-tit { font-weight:700; font-size:14px; margin-bottom:12px; }
.lab-enr-parc-tit .sub { display:block; font-weight:500; margin-top:3px; }
.lab-enr-linhas { display:flex; flex-direction:column; gap:14px; }
.lab-enr-linha { display:grid; grid-template-columns:minmax(190px, 240px) 1fr auto; gap:16px; align-items:end; }
.lab-enr-linha label { font-size:12.5px; }
.lab-enr-linha input { width:100%; font-size:15px; padding:9px 12px; }
.lab-enr-tirar { width:38px; height:40px; font-size:18px; }
@media (max-width:700px) {
  .lab-enr-linha { grid-template-columns:1fr auto; }
  .lab-enr-linha label:first-child { grid-column:1 / -1; }
}
.lab-enr-lista { list-style:none; margin:4px 0 10px; padding:0; display:flex; flex-direction:column; gap:6px; font-size:14px; }
.lab-enr-lista li { padding:6px 10px; background:#f6f8f2; border-radius:8px; }
.lab-enr-aviso { margin:10px 0; padding:10px 12px; background:#fff6e0; border:1px solid #f0d58c; border-radius:8px; font-size:13px; color:#6d4c00; line-height:1.55; }
.lab-enr-mao { margin-top:12px; }
.lab-enr-mao summary { cursor:pointer; color:var(--ink-3); font-size:12.5px; }
.lab-enr-mao[open] summary { margin-bottom:10px; }

/* ─── Obrigações PU 2026 na ficha do agricultor (Francisco, 08/11/2026) ─── */
.obrig-list { display: flex; flex-direction: column; gap: 6px; }
.obrig-item { display: grid; grid-template-columns: 108px 1fr; gap: 12px; align-items: start; padding: 8px 12px;
  border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 8px; background: var(--bone); font-size: 13px; line-height: 1.45; }
.obrig-estado { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
.obrig-item.is-falta { border-left-color: var(--clay); background: var(--clay-100); border-color: #ecc3bb; }
.obrig-item.is-falta .obrig-estado { color: var(--clay); }
.obrig-item.is-atencao { border-left-color: var(--wheat); background: var(--wheat-100); border-color: #ecd4a0; }
.obrig-item.is-atencao .obrig-estado { color: #8a5d0c; }
.obrig-item.is-ok { border-left-color: var(--olive-500); }
.obrig-item.is-ok .obrig-estado { color: var(--olive-500); }
.obrig-item.is-na { color: var(--ink-3); background: var(--field); }
.obrig-emails li.is-tratado { color: var(--ink-3); }
.obrig-emails .obrig-trat { color: var(--olive-500); font-weight: 600; }
.obrig-emails .btn-sm { padding: 1px 8px; margin-left: 4px; }
.obrig-item.is-na .obrig-estado { color: var(--ink-3); font-weight: 700; }
.obrig-item.is-urgente .obrig-estado::after { content: " · urgente"; }
.obrig-txt { min-width: 0; }
.obrig-txt > b { margin-right: 4px; }
.obrig-txt .sub { display: block; font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.obrig-emails { margin: 6px 0 8px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; }
.obrig-emails li { font-size: 12.5px; overflow-wrap: anywhere; }
.obrig-emails .q { color: var(--ink-3); }
@media (max-width: 600px) { .obrig-item { grid-template-columns: 1fr; gap: 2px; } }

/* respostas prontas pelo Caderno de campo, no início da aba Email (09/11/2026) */
.badge-pronto { background: #2e8b57; margin-right: 4px; }
.badge-pronto + .badge { margin-left: 0; }
.em-prontas { margin: 4px 0 14px; border: 1.5px solid #cfe5d6; background: #f6fbf7; border-radius: 12px; padding: 10px 12px; }
.em-pr-h { margin-bottom: 6px; }
.em-pronta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid #e3eee7; }
.em-pronta:first-of-type { border-top: 0; }
.em-pr-t { flex: 1 1 320px; min-width: 0; font-size: 13.5px; }
.em-pr-v { font-size: 12.5px; margin-top: 3px; }
.em-pr-f { color: #a0522d; }
.em-pr-b { display: flex; gap: 6px; align-items: center; }
.pill.pr-ok, .pill.pr-falta { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 20px; padding: 1px 8px; margin-right: 4px; }
.pill.pr-ok { background: #e6f4ea; color: #1F6F3F; }
.pill.pr-falta { background: #fff8e6; color: #8a6d3b; border: 1px solid #f0d999; }

/* Análises: campo para largar boletins (09/11/2026) */
.lab-drop { display:flex; align-items:center; gap:14px; margin:0 0 12px; padding:12px 16px; border:2px dashed var(--olive-200); border-radius:var(--radius); background:var(--bone); color:var(--ink-2); cursor:pointer; transition:background .15s, border-color .15s; }
.lab-drop:hover, .lab-drop:focus-visible { border-color:var(--olive-500); background:var(--olive-100); outline:none; }
.lab-drop svg { flex:none; width:30px; height:30px; fill:none; stroke:var(--olive-700); stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.lab-drop-txt { font-size:13.5px; line-height:1.45; }
.lab-drop-txt b { color:var(--olive-800); }
.lab-drop-txt small { display:block; font-size:12px; color:var(--ink-3); }
.lab-drop.is-over { border-color:var(--olive-700); border-style:solid; background:var(--olive-100); box-shadow:0 0 0 4px rgba(77,138,68,.15); }
.lab-drop.is-busy { cursor:progress; opacity:.85; }
section.view[data-view="labanalises"].lab-arrastar .lab-drop { border-color:var(--olive-500); background:var(--olive-100); }
.lab-drop-res { margin:-4px 0 14px; padding:10px 14px 12px; border:1px solid var(--line); border-radius:var(--radius); background:var(--bone); font-size:13px; }
.lab-drop-res .lab-dr-top { display:flex; align-items:center; gap:10px; margin-bottom:6px; }
.lab-drop-res .lab-dr-top b { color:var(--olive-800); }
.lab-drop-res .lab-dr-top .btn { margin-left:auto; }
.lab-drop-res table { width:100%; border-collapse:collapse; }
.lab-drop-res td, .lab-drop-res th { padding:5px 8px; border-top:1px solid var(--line); text-align:left; vertical-align:top; }
.lab-drop-res th { font-size:11px; font-weight:700; color:var(--ink-3); text-transform:uppercase; letter-spacing:.03em; border-top:0; }
.lab-drop-res .lab-dr-fich { max-width:240px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--ink-3); }
.lab-dr-est { display:inline-block; padding:1px 8px; border-radius:20px; font-size:11.5px; font-weight:700; white-space:nowrap; }
.lab-dr-est.novo, .lab-dr-est.sem_pdf { background:var(--olive-100); color:var(--olive-700); }
.lab-dr-est.igual, .lab-dr-est.repetido { background:var(--field); color:var(--ink-3); }
.lab-dr-est.copia { background:var(--sky-100); color:#274a6d; }
.lab-dr-est.sem_numero, .lab-dr-est.erro { background:var(--wheat-100); color:#6d4c00; }
.lab-drop-res .lab-dr-bol { font-weight:700; color:var(--olive-800); cursor:pointer; text-decoration:underline; text-decoration-color:var(--olive-200); }
.lab-drop-res .lab-dr-semcli { color:#6d4c00; }
.lab-drop-res { overflow-x:auto; }
@media (max-width: 700px) {
  .lab-drop-txt span { display:none; }
  .lab-drop-res thead { display:none; }
  .lab-drop-res tr { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 10px; padding:7px 0; border-top:1px solid var(--line); }
  .lab-drop-res td { border:0; padding:0; }
  .lab-drop-res .lab-dr-fich:empty, .lab-drop-res .lab-dr-col { display:none; }
  .lab-drop-res .lab-dr-fich { flex-basis:100%; max-width:none; font-size:12px; }
  .lab-dr-est { white-space:normal; }
}

/* Biodiversas: análise mais recente juntada à zona do plano (09/11/2026) */
#dLabPb { margin-top:10px; }
.lab-pb-aviso b { color:#7a3b00; }
.lab-pb-aviso .lab-enr-anular { margin-left:8px; }
.lab-pb-np { background:#ffe7cc; color:#8a3c00; }

/* ── Erros do IB (rotina de 5 em 5 dias) ─────────────────────── */
.ib-badge { display: inline-flex; align-items: center; margin-left: 6px; padding: 1px 7px;
  border-radius: 10px; background: #d50000; color: #fff; font-size: 11px; font-weight: 800;
  letter-spacing: .5px; vertical-align: middle; cursor: pointer; }
.ib-badge:hover { background: #a80000; }
.ib-modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 2000;
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.ib-box { background: #fff; border-radius: 14px; max-width: 760px; width: 100%;
  max-height: 80vh; overflow: auto; padding: 18px 20px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.ib-box h3 { margin: 0 0 2px; color: #b00000; }
.ib-lista { margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.ib-linha { padding: 7px 9px; border: 1px solid #f0c4c4; border-left: 4px solid #d50000;
  border-radius: 8px; background: #fff6f6; font-size: 13px; }
.ib-rodape { text-align: right; }

/* Erros antigos do IB (ignorados no distintivo) */
.ib-cab { font-size: 11px; color: #888; padding: 2px 0 6px; border-bottom: 1px solid #eee; }
.ib-sub { margin-top: 10px; font-size: 12px; font-weight: 600; color: #888; }
.ib-linha.ib-antiga { border-left-color: #bbb; color: #888; }

/* ─────────────  aba Email: caixa de correio (16/11/2026, Francisco: «melhora a zona de visualizar emails»)  ───────────── */
.em-caixa { display: grid; grid-template-columns: minmax(300px, 410px) minmax(0, 1fr); gap: 16px; align-items: start; }
.em-lista { background: var(--bone); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.em-sec { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); background: #f8faf5; border-bottom: 1px solid var(--line); }
.em-sec span { font-size: 11px; background: #eef1ea; border-radius: 999px; padding: 0 7px; letter-spacing: 0; }
.em-sec.urg { color: var(--clay); background: #fdf3f1; }
.em-sec.urg span { background: var(--clay-100); }
.em-it { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 11px; row-gap: 2px; padding: 11px 14px 11px 12px; border-bottom: 1px solid #edf0e8; cursor: pointer; transition: background .15s ease; }
.em-it:last-child { border-bottom: 0; }
.em-it:hover { background: #f7f9f4; }
.em-it.is-open { background: var(--olive-100); box-shadow: inset 3px 0 0 var(--olive-700); }
.em-it.urg { box-shadow: inset 3px 0 0 var(--clay); }
.em-it.urg.is-open { background: #fbefec; }
.em-it > :not(.em-av) { grid-column: 2; min-width: 0; }
.em-av { grid-row: 1 / span 4; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; letter-spacing: .02em; user-select: none; }
.em-l1 { display: flex; align-items: baseline; gap: 8px; }
.em-l1 b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.em-l1 time { flex: none; font-size: 11.5px; color: var(--ink-3); }
.em-it.nova .em-l1 b::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--olive-500); margin-right: 6px; vertical-align: 2px; }
.em-l2 { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-it.nova .em-l2 { font-weight: 700; }
.em-l3 { font-size: 12.5px; line-height: 1.4; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.em-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.em-tg { display: inline-block; font-size: 11px; font-weight: 700; line-height: 1.6; padding: 0 7px; border-radius: 999px; background: #eef1ea; color: var(--ink-2); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.em-tg.urg { background: var(--clay-100); color: var(--clay); }
.em-tg.prazo { background: var(--wheat-100); color: #8a6214; }
.em-tg.prazo.perto { background: var(--clay-100); color: var(--clay); }
.em-tg.cli { background: var(--olive-100); color: var(--olive-700); }
.em-tg.dup { background: var(--sky-100); color: #2d4f86; }
.em-vazio { padding: 40px 20px; text-align: center; color: var(--ink-3); }
.em-chip-urg { font-style: normal; margin-left: 6px; font-size: 11px; font-weight: 800; color: #fff; background: var(--clay); border-radius: 999px; padding: 0 7px; }
.badge.badge-urg { background: var(--clay); }

/* leitura */
.em-leitor { position: sticky; top: 12px; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain;
  background: var(--bone); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(28, 47, 26, .04); }
.em-r { animation: emEntra .22s ease-out; padding-bottom: 14px; }
@keyframes emEntra { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.em-r-bar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 18px;
  background: rgba(255, 255, 255, .95); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.em-r-bar .esp { flex: 1; }
.btn.em-urg-on { background: var(--clay-100); border-color: #e7b3a8; color: var(--clay); }
.em-volta { display: none; }
.em-r-cab { padding: 18px 22px 4px; }
.em-r-ass { font-size: 19px; font-weight: 800; letter-spacing: -.01em; line-height: 1.3; overflow-wrap: anywhere; }
.em-r-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.em-r-tags .em-st { font-size: 11px; line-height: 1.6; padding: 0 8px; }
.em-r-de { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: 12px; row-gap: 1px; align-items: center; margin-top: 14px; }
.em-r-de .em-av { grid-row: 1 / span 2; width: 40px; height: 40px; font-size: 13px; }
.em-r-quem { min-width: 0; overflow-wrap: anywhere; }
.em-r-quem b { font-size: 14px; }
.em-r-quem .addr { color: var(--ink-3); font-size: 12.5px; }
.em-r-de time { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.em-r-para { grid-column: 2 / -1; font-size: 12.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.em-r-alerta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin: 14px 22px 0; padding: 10px 14px; border-radius: 10px;
  background: #fdf1ee; border: 1px solid #f1cfc7; color: #7d2b1d; font-size: 13.5px; line-height: 1.5; }
.em-r-alerta b { white-space: nowrap; }
.em-r-alerta.prazo { background: var(--wheat-100); border-color: #efdcb2; color: #6e4d0f; }
.em-r-cli { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin: 12px 22px 0; padding: 9px 12px; background: #f6f9f3; border: 1px solid #e3ebdc; border-radius: 10px; }
.em-r-cli .lbl { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-right: 2px; }
.em-cli { display: inline-flex; flex-direction: column; padding: 4px 10px; background: var(--bone); border: 1px solid #dfe8d7; border-radius: 8px; line-height: 1.3; }
.em-cli a.ficha-link { font-weight: 700; font-size: 13px; color: var(--olive-700); text-decoration: none; }
.em-cli a.ficha-link:hover { text-decoration: underline; }
.em-cli small { font-size: 11px; color: var(--ink-3); }
.em-dups { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 22px 0; font-size: 12.5px; color: var(--ink-2); }
.em-dups .chip { font-size: 12px; }
.em-r-anx { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin: 14px 22px 0; }
.em-ax { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcf9; color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
a.em-ax:hover { border-color: var(--olive-500); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(28, 47, 26, .08); }
.em-ax.off { opacity: .55; cursor: default; }
.em-ax .ic { flex: none; width: 34px; height: 40px; border-radius: 6px; display: grid; place-items: center; font-size: 9.5px; font-weight: 800; letter-spacing: .03em; color: #fff; background: #8a948a; }
.em-ax .ic.pdf { background: #c0392b; } .em-ax .ic.img { background: #2e86c1; } .em-ax .ic.xls { background: #1e8449; }
.em-ax .ic.doc { background: #2a5aa8; } .em-ax .ic.zip { background: #7d6608; }
.em-ax .nm { display: flex; flex-direction: column; min-width: 0; }
.em-ax .nm > span { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-ax .nm small { font-size: 11px; color: var(--ink-3); }
.em-r-sig { margin: 8px 22px 0; }
.em-r-sig > summary, .em-legal > summary, .em-orig > summary { cursor: pointer; font-size: 12px; color: var(--ink-3); width: fit-content; }
.em-r-sig .em-r-anx { margin: 8px 0 0; }
.em-r-corpo { padding: 16px 22px 2px; font-size: 14.5px; line-height: 1.65; color: var(--ink); max-width: 80ch; }
.em-r-corpo p { margin: 0 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.em-r-nota { margin: 16px 22px 4px; color: var(--ink-3); font-style: italic; }
.em-lk { color: var(--olive-700); text-decoration: underline; text-decoration-color: rgba(47, 93, 42, .35); text-underline-offset: 2px; overflow-wrap: anywhere; }
.em-lk:hover { text-decoration-color: currentColor; }
.em-lk-s { text-decoration: none; font-size: 12px; }
.em-cadeia { margin: 10px 22px 8px; font-size: 12.5px; color: var(--ink-3); line-height: 1.6; }
.em-cadeia b { color: var(--ink-2); font-weight: 700; }
.em-enc { margin: 8px 22px 12px; border: 1px solid var(--line); border-left: 3px solid var(--olive-200); border-radius: 10px; background: #fbfcf9; }
.em-enc-h { display: flex; flex-wrap: wrap; gap: 3px 10px; align-items: baseline; padding: 9px 14px; border-bottom: 1px solid #edf0e8; font-size: 12.5px; color: var(--ink-3); }
.em-enc-h .tp { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--olive-700); }
.em-enc-h b { color: var(--ink); }
.em-enc-h .as { color: var(--ink-2); }
.em-enc .em-r-corpo { padding: 12px 14px 2px; font-size: 14px; }
.em-legal, .em-orig { margin: 6px 22px 0; }
.em-legal p { font-size: 12px; line-height: 1.5; color: var(--ink-3); white-space: pre-wrap; margin: 6px 0 0; }
.em-orig pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.5 var(--mono); background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 12px; max-height: 50vh; overflow: auto; margin: 8px 0 0; }
.em-r-vazio { padding: 70px 30px; text-align: center; color: var(--ink-3); }
.em-r-vazio .big { font-size: 34px; margin-bottom: 8px; }
.em-r-vazio p { margin-top: 6px; }
/* uma coluna quando a caixa é estreita (classe posta pelo app.js conforme a largura real da caixa) */
.em-caixa.estreita { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) {
  .em-caixa { grid-template-columns: minmax(0, 1fr); }
  .em-caixa.tem-aberto .em-lista { display: none; }
  .em-caixa:not(.tem-aberto) .em-leitor { display: none; }
  .em-leitor { position: static; max-height: none; overflow: visible; }
  .em-volta { display: inline-flex; }
  .em-r-bar { padding: 10px 12px; top: 0; }
  .em-r-cab { padding: 16px 16px 4px; }
  .em-r-corpo { padding-left: 16px; padding-right: 16px; }
  .em-r-alerta, .em-r-cli, .em-r-anx, .em-dups, .em-cadeia, .em-enc, .em-legal, .em-orig, .em-r-sig, .em-r-nota { margin-left: 16px; margin-right: 16px; }
  .em-r-anx { grid-template-columns: minmax(0, 1fr); }
  .em-r-de { grid-template-columns: 40px minmax(0, 1fr); }
  .em-r-de time { grid-column: 2; }
}
.em-caixa.estreita.tem-aberto .em-lista { display: none; }
.em-caixa.estreita:not(.tem-aberto) .em-leitor { display: none; }
.em-caixa.estreita .em-leitor { position: static; max-height: none; overflow: visible; }
.em-caixa.estreita .em-volta { display: inline-flex; }
.em-caixa.estreita .em-r-bar { padding: 10px 12px; top: 0; }
.em-caixa.estreita .em-r-cab { padding: 16px 16px 4px; }
.em-caixa.estreita .em-r-corpo { padding-left: 16px; padding-right: 16px; }
.em-caixa.estreita .em-r-alerta, .em-caixa.estreita .em-r-cli, .em-caixa.estreita .em-r-anx, .em-caixa.estreita .em-dups, .em-caixa.estreita .em-cadeia, .em-caixa.estreita .em-enc, .em-caixa.estreita .em-legal, .em-caixa.estreita .em-orig, .em-caixa.estreita .em-r-sig, .em-caixa.estreita .em-r-nota { margin-left: 16px; margin-right: 16px; }
.em-caixa.estreita .em-r-anx { grid-template-columns: minmax(0, 1fr); }
.em-caixa.estreita .em-r-de { grid-template-columns: 40px minmax(0, 1fr); }
.em-caixa.estreita .em-r-de time { grid-column: 2; }
.em-assin { white-space: pre-line; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); border-top: 1px solid #edf0e8; padding-top: 8px; margin: 4px 0 12px; }
