/* ============================================================
   modules.css — componentes das etapas 2, 3 e 4
   (projetos, orçamentos, custos, relatórios, configurações)
   ============================================================ */

/* ---------- Barra de progresso ---------- */
.progress {
  height: 8px; border-radius: var(--radius-pill);
  background: var(--bg-surface-2); overflow: hidden;
}
.progress__bar {
  height: 100%; border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--brand-green-500), var(--brand-petrol-600));
  transition: width .3s ease;
}

/* ---------- Cabeçalho de detalhe ---------- */
.detail-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-5);
}
.detail-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* ---------- Etapas ---------- */
.etapa {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-surface); margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-sm);
}
.etapa + .etapa { margin-top: 0; }
.etapa__head {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.etapa__grip { cursor: grab; color: var(--text-muted); }
.etapa__grip:active { cursor: grabbing; }
.etapa__num {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 700;
  background: var(--brand-green-500); color: #fff;
}
.etapa__titulo {
  flex: 1; border: 1px solid transparent; background: transparent;
  font-family: var(--font-display); font-weight: 600; font-size: var(--fs-md);
  color: var(--text-strong); padding: 6px 8px; border-radius: var(--radius-sm);
}
.etapa__titulo:hover { border-color: var(--border); }
.etapa__titulo:focus { border-color: var(--brand-petrol-600); background: var(--input-bg); outline: none; }
.etapa__mes {
  flex: 0 0 auto; padding: 6px 8px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--input-bg); color: var(--text-strong);
}
.etapa__total {
  font-family: var(--font-display); font-weight: 700; color: var(--text-strong);
  min-width: 110px; text-align: right;
}
.etapa__prog {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4); font-size: var(--fs-xs); color: var(--text-muted);
}
.etapa__prog input[type="range"] { flex: 1; accent-color: var(--brand-petrol-600); }
.etapa__prog b { color: var(--text-strong); min-width: 42px; text-align: right; }

/* ---------- Itens (linhas editáveis) ---------- */
.itens { padding: var(--sp-3) var(--sp-4) var(--sp-4); overflow-x: auto; }
.itens__head, .item-row {
  display: grid;
  grid-template-columns: 2fr 1.2fr .8fr .9fr 1fr 1fr 34px;
  gap: var(--sp-2); align-items: center; min-width: 720px;
}
.itens__head--orc, .item-row--orc {
  grid-template-columns: 2fr 1.3fr .8fr .9fr 1fr 1fr 34px;
}
.itens__head {
  font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .04em; padding: 0 0 var(--sp-2);
}
.item-row { padding: 4px 0; }
.item-row input, .item-row select {
  width: 100%; padding: 7px 8px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--input-bg);
  color: var(--text-strong); font-size: var(--fs-sm);
}
.item-row input:focus, .item-row select:focus {
  outline: none; border-color: var(--brand-petrol-600);
}
.item-total {
  font-weight: 600; color: var(--text-strong); text-align: right; font-size: var(--fs-sm);
}

/* ---------- Cronograma ---------- */
.crono { overflow-x: auto; }
.crono__months {
  display: grid; grid-template-columns: 160px repeat(12, minmax(34px, 1fr));
  gap: 3px; margin-bottom: var(--sp-2); min-width: 640px;
}
.crono__months span {
  font-size: var(--fs-xs); color: var(--text-muted); text-align: center;
}
.crono__row {
  display: grid; grid-template-columns: 160px 1fr; gap: var(--sp-2);
  align-items: center; margin-bottom: 6px; min-width: 640px;
}
.crono__label {
  font-size: var(--fs-xs); color: var(--text-strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.crono__track {
  display: grid; grid-template-columns: repeat(12, minmax(34px, 1fr)); gap: 3px;
}
.crono__bar {
  height: 22px; border-radius: var(--radius-sm);
  background: var(--bg-surface-2); overflow: hidden; position: relative;
}
.crono__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-petrol-600), var(--brand-green-500));
}

/* ---------- Painel de cálculo (orçamento) ---------- */
.calc-card { position: sticky; top: var(--sp-4); }
.calc-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; font-size: var(--fs-sm); color: var(--text-muted);
}
.calc-row b { color: var(--text-strong); font-weight: 600; }
.calc-input {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--sp-3); padding: 6px 0;
}
.calc-input label { font-size: var(--fs-sm); color: var(--text-muted); }
.calc-input input {
  width: 120px; padding: 7px 9px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--input-bg);
  color: var(--text-strong); text-align: right;
}
.calc-input input:focus { outline: none; border-color: var(--brand-petrol-600); }
.calc-total {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: var(--sp-3); padding-top: var(--sp-3);
  border-top: 2px solid var(--brand-green-500);
}
.calc-total span { color: var(--text-muted); font-size: var(--fs-sm); }
.calc-total b {
  font-family: var(--font-display); font-size: var(--fs-xl);
  color: var(--brand-green-500);
}
[data-theme="dark"] .calc-total b { color: var(--brand-green-300); }

/* ---------- Assistente ---------- */
.assist-hint {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-3) var(--sp-4); border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand-petrol-600) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand-petrol-600) 30%, transparent);
  font-size: var(--fs-sm); color: var(--text-strong); line-height: 1.5;
}
.assist-hint i { color: var(--brand-petrol-600); margin-top: 2px; }

/* ---------- Configurações ---------- */
.logo-box {
  height: 150px; border: 2px dashed var(--border); border-radius: var(--radius);
  display: grid; place-items: center; background: var(--bg-surface-2);
  color: var(--text-muted); text-align: center; overflow: hidden;
}
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.color-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-2) 0;
}
.color-row label { font-size: var(--fs-sm); color: var(--text-strong); }
.color-row input[type="color"] {
  width: 54px; height: 34px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: none; cursor: pointer;
}

/* ---------- Ajustes responsivos ---------- */
@media (max-width: 860px) {
  .calc-card { position: static; }
  .etapa__total { min-width: 90px; }
}

/* ---------- Viabilidade ---------- */
.viab-table th, .viab-table td { white-space: nowrap; text-align: right; }
.viab-table th:first-child, .viab-table td:first-child { text-align: left; }
.viab-table th:nth-child(2), .viab-table td:nth-child(2) { text-align: center; }
.cv-input {
  width: 78px; padding: 5px 7px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--input-bg);
  color: var(--text-strong); text-align: center;
}
.cv-input:focus { outline: none; border-color: var(--brand-petrol-600); }

.breakeven {
  margin-top: var(--sp-4); padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius); background: var(--bg-surface-2);
  border: 1px solid var(--border);
}
.be-title {
  font-family: var(--font-display); font-weight: 600; font-size: var(--fs-sm);
  color: var(--text-strong); margin-bottom: var(--sp-2);
}
.be-title i { color: var(--brand-amber-500); margin-right: 6px; }
.be-row {
  display: flex; justify-content: space-between; padding: 4px 0;
  font-size: var(--fs-sm); color: var(--text-muted);
}
.be-row b { color: var(--text-strong); }
.cenarios-resumo {
  display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-3);
  justify-content: center;
}

/* ---------- Recomendação (solo) ---------- */
.field .unit { color: var(--text-muted); font-weight: 400; font-size: .85em; }
.triple { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.triple input {
  padding: 7px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--input-bg); color: var(--text-strong); text-align: center; width: 100%;
}
.adv { margin-top: var(--sp-3); }
.adv summary {
  cursor: pointer; font-size: var(--fs-sm); color: var(--brand-petrol-600);
  font-weight: 600; user-select: none;
}
.diag { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2) var(--sp-4); }
.diag__item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm);
  color: var(--text-muted);
}
.diag__item b { color: var(--text-strong); }
.reco-line {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0; font-size: var(--fs-sm); color: var(--text-muted);
}
.reco-line b { color: var(--text-strong); }
.reco-line--big { font-size: var(--fs-md); }
.reco-line--big b {
  font-family: var(--font-display); font-size: var(--fs-lg); color: var(--brand-green-500);
}
[data-theme="dark"] .reco-line--big b { color: var(--brand-green-300); }
.reco-disclaimer {
  margin-top: var(--sp-4); padding: var(--sp-3); border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand-amber-500) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand-amber-500) 30%, transparent);
  font-size: var(--fs-xs); color: var(--text-strong); line-height: 1.5;
}
.reco-disclaimer i { color: var(--brand-amber-500); margin-right: 6px; }

/* ---------- Receituário ---------- */
.rct-item {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4);
  background: var(--bg-surface-2);
}
.rct-item__head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--sp-3);
}
.rct-item__head b { font-family: var(--font-display); color: var(--text-strong); }

/* ---------- Funil de orçamentos ---------- */
.funil {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.funil__col {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--sp-3) var(--sp-4);
  box-shadow: var(--shadow-sm); text-align: center;
}
.funil__n {
  font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 700;
  color: var(--text-strong); margin-top: var(--sp-2);
}
.funil__v { font-size: var(--fs-xs); color: var(--text-muted); }
.funil__conv { background: var(--brand-green-500); border-color: var(--brand-green-500); color: #fff; }
.funil__conv .funil__n, .funil__conv .funil__v { color: #fff; }
.funil__conv-label { font-size: var(--fs-xs); font-weight: 600; opacity: .9; }
.status-select {
  border: none; border-radius: var(--radius-pill); padding: 4px 10px;
  font-size: var(--fs-xs); font-weight: 600; cursor: pointer; color: #fff;
  -webkit-appearance: none; appearance: none;
}
.status-select.badge--gray { background: var(--text-muted); }
.status-select.badge--petrol { background: var(--brand-petrol-600); }
.status-select.badge--amber { background: var(--brand-amber-500); }
.status-select.badge--green { background: var(--brand-green-500); }
.status-select.badge--soil { background: var(--brand-soil-500); }
.status-select option { color: var(--text-strong); background: var(--bg-surface); }

@media (max-width: 860px) {
  .funil { grid-template-columns: repeat(2, 1fr); }
  .diag { grid-template-columns: 1fr; }
}

/* ---------- Anexos ---------- */
.anexos__list { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.anexos__vazio { color: var(--text-muted); font-size: var(--fs-sm); margin: 0; }
.anexo {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-surface-2); font-size: var(--fs-sm);
}
.anexo > i:first-child { color: var(--brand-petrol-600); }
.anexo__nome { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-strong); }
.anexo__tam { color: var(--text-muted); font-size: var(--fs-xs); }

/* ---------- Laudo ---------- */
.laudo-secao {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3); background: var(--bg-surface-2);
}
.laudo-secao__head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-2); }
.laudo-secao__head input {
  flex: 1; font-family: var(--font-display); font-weight: 600; padding: 7px 9px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--input-bg); color: var(--text-strong);
}
.laudo-secao textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--input-bg); color: var(--text-strong);
  font-family: var(--font-body); resize: vertical;
}

/* ---------- Croqui ---------- */
.croqui-card { cursor: pointer; overflow: hidden; padding: 0; transition: transform .15s, box-shadow .15s; }
.croqui-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.croqui-thumb {
  height: 150px; display: grid; place-items: center; overflow: hidden;
  background: var(--bg-surface-2); color: var(--text-muted); font-size: 2rem;
}
.croqui-thumb img { width: 100%; height: 100%; object-fit: contain; }
.croqui-toolbar {
  display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center;
  padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-surface-2); margin-bottom: var(--sp-3);
}
.tool-group { display: flex; align-items: center; gap: 6px; }
.tool-group + .tool-group { border-left: 1px solid var(--border); padding-left: var(--sp-3); }
.tool {
  width: 38px; height: 38px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-surface); color: var(--text-strong); cursor: pointer;
  display: grid; place-items: center; transition: all .12s;
}
.tool:hover { border-color: var(--brand-petrol-600); color: var(--brand-petrol-600); }
.tool.is-active { background: var(--brand-green-500); border-color: var(--brand-green-500); color: #fff; }
.tool-group input[type="color"] { width: 38px; height: 38px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: none; cursor: pointer; padding: 2px; }
.tool-group select { padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--input-bg); color: var(--text-strong); }
.tool-check { display: flex; align-items: center; gap: 5px; font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; }
.tool-info { margin-left: auto; font-size: var(--fs-xs); color: var(--text-muted); }
.croqui-canvas-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; }
.croqui-svg { display: block; width: 100%; height: auto; aspect-ratio: 10 / 7; touch-action: none; cursor: crosshair; background: #fff; }
.croqui-svg .cq-text { font: 600 18px var(--font-body, sans-serif); }
.croqui-svg .cq-area { font: 600 15px var(--font-body, sans-serif); fill: #14432E; text-anchor: middle; }
.croqui-svg .cq-mlabel { font: 12px var(--font-body, sans-serif); fill: #0F6E6E; text-anchor: middle; }
.croqui-svg .cq-sel { filter: drop-shadow(0 0 3px rgba(224,168,62,.9)); }

@media (max-width: 860px) {
  .croqui-toolbar { gap: var(--sp-2); }
  .tool-group + .tool-group { border-left: none; padding-left: 0; }
  .tool-info { margin-left: 0; width: 100%; }
}

/* ---------- Cronograma semanal (fertirrigação) ---------- */
.semana {
  display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr));
  gap: var(--sp-3); overflow-x: auto; padding-bottom: var(--sp-2);
}
.dia-col {
  display: flex; flex-direction: column; min-width: 150px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-surface); box-shadow: var(--shadow-sm); overflow: hidden;
}
.dia-col--hoje { border-color: var(--brand-green-500); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-green-500) 25%, transparent); }
.dia-col__head {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-3); font-family: var(--font-display); font-weight: 600;
  font-size: var(--fs-sm); color: #fff;
  background: linear-gradient(120deg, var(--brand-green-700), var(--brand-petrol-800));
}
.dia-col--hoje .dia-col__head { background: linear-gradient(120deg, var(--brand-green-500), var(--brand-petrol-600)); }
.dia-col__count {
  background: rgba(255,255,255,.25); border-radius: var(--radius-pill);
  min-width: 22px; height: 22px; display: grid; place-items: center; font-size: var(--fs-xs);
}
.dia-col__body { flex: 1; padding: var(--sp-2); display: flex; flex-direction: column; gap: var(--sp-2); min-height: 60px; }
.dia-col__vazio { color: var(--text-muted); font-size: var(--fs-xs); text-align: center; margin: var(--sp-3) 0; }
.dia-col__add {
  border: none; border-top: 1px solid var(--border); background: var(--bg-surface-2);
  color: var(--brand-petrol-600); font-weight: 600; font-size: var(--fs-xs);
  padding: 8px; cursor: pointer; transition: background .12s;
}
.dia-col__add:hover { background: color-mix(in srgb, var(--brand-petrol-600) 12%, transparent); }

.atv {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-surface-2); padding: var(--sp-2) var(--sp-3); position: relative;
}
.atv--feito { opacity: .6; }
.atv--feito .atv__prod { text-decoration: line-through; }
.atv__top { display: flex; justify-content: space-between; align-items: center; }
.atv__check input { cursor: pointer; }
.atv__prod { font-weight: 600; color: var(--text-strong); font-size: var(--fs-sm); margin-top: 4px; }
.atv__meta { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; font-size: var(--fs-xs); color: var(--text-muted); }
.atv__meta i { width: 12px; color: var(--brand-petrol-600); }
.atv__obs { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 4px; font-style: italic; }
.atv__actions { display: flex; justify-content: flex-end; gap: 2px; margin-top: 6px; }

@media (max-width: 860px) {
  .semana { grid-template-columns: 1fr; }
  .dia-col { min-width: 0; }
}

/* ---------- Visitas: abas e segmentos ---------- */
.tabs { display: flex; gap: 4px; background: var(--bg-surface-2); padding: 4px; border-radius: var(--radius); }
.tab {
  border: none; background: transparent; padding: 8px 16px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: var(--fs-sm); color: var(--text-muted); cursor: pointer;
}
.tab.is-active { background: var(--bg-surface); color: var(--brand-green-500); box-shadow: var(--shadow-sm); }
.seg { display: inline-flex; gap: 4px; background: var(--bg-surface-2); padding: 3px; border-radius: var(--radius-pill); }
.seg__btn {
  border: none; background: transparent; padding: 6px 14px; border-radius: var(--radius-pill);
  font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); cursor: pointer;
}
.seg__btn.is-active { background: var(--brand-green-500); color: #fff; }

/* ---------- Agenda por data ---------- */
.agenda-dia { margin-bottom: var(--sp-4); }
.agenda-dia__head {
  display: flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-display); font-weight: 600; color: var(--text-strong);
  padding: var(--sp-2) 0; border-bottom: 2px solid var(--brand-green-500); margin-bottom: var(--sp-3);
}
.agenda-dia__head i { color: var(--brand-green-500); }
.agenda-dia__n {
  margin-left: auto; background: var(--bg-surface-2); border-radius: var(--radius-pill);
  padding: 2px 10px; font-size: var(--fs-xs); color: var(--text-muted);
}
.agenda-dia__list { display: flex; flex-direction: column; gap: var(--sp-2); }
.visita {
  display: flex; align-items: center; gap: var(--sp-3);
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-surface); padding: var(--sp-3) var(--sp-4); box-shadow: var(--shadow-sm);
}
.visita__hora {
  font-family: var(--font-display); font-weight: 700; color: var(--brand-petrol-600);
  min-width: 52px; text-align: center; font-size: var(--fs-sm);
}
.visita__main { flex: 1; min-width: 0; }
.visita__top { display: flex; align-items: center; gap: var(--sp-2); }
.visita__top b { color: var(--text-strong); }
.visita__meta { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: 3px; font-size: var(--fs-xs); color: var(--text-muted); }
.visita__meta i { color: var(--brand-petrol-600); margin-right: 3px; }
.visita__actions { display: flex; gap: 2px; }
a.icon-btn { text-decoration: none; display: inline-grid; place-items: center; }

/* ---------- Por localidade ---------- */
.local-card { display: flex; flex-direction: column; }
.local-card__head {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-display); font-weight: 600; color: var(--text-strong);
}
.local-card__head i { color: var(--brand-soil-500); margin-right: 4px; }
.local-card__count { font-size: var(--fs-xs); color: var(--text-muted); margin: 4px 0 var(--sp-3); }
.local-card__list { display: flex; flex-direction: column; gap: var(--sp-2); border-top: 1px solid var(--border); padding-top: var(--sp-3); }
.local-cli { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.local-cli__info { display: flex; flex-direction: column; min-width: 0; }
.local-cli__info b { color: var(--text-strong); font-size: var(--fs-sm); }
.local-cli__data { font-size: var(--fs-xs); color: var(--brand-green-500); }
.local-cli__data i { margin-right: 3px; }
.local-cli__sem { font-size: var(--fs-xs); color: var(--text-muted); }

/* ---------- Subgrupo de localidade dentro do município ---------- */
.local-sub { border-left: 2px solid var(--border); padding-left: var(--sp-3); margin-bottom: var(--sp-2); }
.local-sub__head {
  display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs);
  font-weight: 600; color: var(--brand-soil-500); margin-bottom: 4px;
}
.local-sub__head i { color: var(--brand-soil-500); }
.local-sub__head span {
  margin-left: auto; background: var(--bg-surface-2); border-radius: var(--radius-pill);
  padding: 0 8px; color: var(--text-muted); font-weight: 400;
}
.local-sub .local-cli { padding: 3px 0; }

/* ---------- Calendário mensal ---------- */
.cal { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-4); box-shadow: var(--shadow-sm); }
.cal__nav { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.cal__title { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-md); color: var(--text-strong); }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal__wd-row { margin-bottom: 6px; }
.cal__wd { text-align: center; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); padding: 4px 0; }
.cal__cell {
  position: relative; min-height: 62px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-surface-2); cursor: pointer;
  padding: 6px; transition: all .12s; display: flex; flex-direction: column;
}
.cal__cell:hover { border-color: var(--brand-petrol-600); }
.cal__cell--empty { background: transparent; border: none; cursor: default; }
.cal__cell--has { background: color-mix(in srgb, var(--brand-petrol-600) 10%, var(--bg-surface)); border-color: color-mix(in srgb, var(--brand-petrol-600) 35%, transparent); }
.cal__cell--today { outline: 2px solid var(--brand-amber-500); outline-offset: -2px; }
.cal__cell--sel { background: var(--brand-green-500); border-color: var(--brand-green-500); }
.cal__cell--sel .cal__day { color: #fff; }
.cal__day { font-weight: 600; font-size: var(--fs-sm); color: var(--text-strong); }
.cal__count {
  margin-top: auto; align-self: flex-start; background: var(--brand-petrol-600); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: var(--radius-pill); padding: 1px 7px;
}
.cal__cell--sel .cal__count { background: rgba(255,255,255,.3); }

@media (max-width: 620px) {
  .cal__cell { min-height: 48px; padding: 4px; }
  .cal__day { font-size: var(--fs-xs); }
  .cal__count { padding: 0 5px; }
}

/* ---------- Compromissos (dias sem visita) ---------- */
.cal__cell--comp { background: repeating-linear-gradient(45deg, var(--bg-surface-2), var(--bg-surface-2) 7px, color-mix(in srgb, var(--brand-soil-500) 14%, transparent) 7px, color-mix(in srgb, var(--brand-soil-500) 14%, transparent) 14px); }
.cal__comp {
  font-size: 9px; font-weight: 600; color: #fff; background: var(--brand-soil-500);
  border-radius: var(--radius-sm); padding: 1px 5px; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.cal__comp i { font-size: 8px; }
.cal__cell--sel .cal__comp { background: rgba(255,255,255,.35); }
.comp-tags { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.comp-tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-xs); font-weight: 600;
  color: #fff; background: var(--brand-soil-500); border-radius: var(--radius-pill); padding: 3px 10px;
}
.comp-sec__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-2); }
.comp-sec__head b { color: var(--text-strong); font-family: var(--font-display); }
.comp-row { display: flex; gap: var(--sp-2); align-items: center; margin-bottom: 6px; }
.comp-row select, .comp-row input {
  padding: 7px 9px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--input-bg); color: var(--text-strong);
}
.comp-row select { flex: 0 0 130px; }
.comp-row input[type="date"] { flex: 0 0 150px; }
.comp-row input[data-f="label"] { flex: 1; }
.comp-vazio { color: var(--text-muted); font-size: var(--fs-sm); margin: 4px 0; }

/* ---------- Gráficos e fertigrama da recomendação ---------- */
.chart-title { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); text-align: center; margin-bottom: var(--sp-2); text-transform: uppercase; letter-spacing: .03em; }
.fg-label { width: 100%; padding: 5px 7px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--input-bg); color: var(--text-strong); font-size: var(--fs-sm); }
.fg-label:focus, .fg-pct:focus { outline: none; border-color: var(--brand-petrol-600); }
.viab-table tfoot td { border-top: 2px solid var(--border); padding-top: 6px; }
.fg-aviso { margin: var(--sp-3) 0 0; font-size: var(--fs-xs); color: var(--brand-amber-500); }
.fg-aviso i { margin-right: 5px; }

/* ---------- Galeria de clientes ---------- */
.cli-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-4); }
.cli-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--sp-4); box-shadow: var(--shadow-sm); cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s;
  display: flex; flex-direction: column; gap: var(--sp-3);
}
.cli-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand-petrol-600); }
.cli-card__top { display: flex; align-items: center; gap: var(--sp-3); }
.cli-card__avatar {
  width: 46px; height: 46px; border-radius: 50%; color: #fff; font-weight: 700; font-size: var(--fs-md);
  display: grid; place-items: center; flex: 0 0 46px; font-family: var(--font-display);
}
.cli-card__id { min-width: 0; }
.cli-card__name { font-weight: 600; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cli-card__doc { font-size: var(--fs-xs); color: var(--text-muted); }
.cli-card__info { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); color: var(--text-muted); border-top: 1px solid var(--border); padding-top: var(--sp-3); }
.cli-card__info i { color: var(--brand-petrol-600); width: 14px; margin-right: 5px; }
.cli-card__info div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cli-card__actions { display: flex; gap: 4px; justify-content: flex-end; margin-top: auto; }
.cli-card__actions a.icon-btn { text-decoration: none; display: inline-grid; place-items: center; }

/* ---------- Relatório fotográfico ---------- */
.rft-card { padding: 0 !important; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.rft-card:hover { box-shadow: var(--shadow-md); border-color: var(--brand-petrol-600); }
.rft-card__capa {
  height: 130px; background-size: cover; background-position: center; position: relative;
  display: grid; place-items: center; color: var(--text-muted); font-size: 2rem;
}
.rft-card__badge {
  position: absolute; top: 8px; right: 8px; background: rgba(20,67,46,.85); color: #fff;
  border-radius: var(--radius-pill); padding: 2px 9px; font-size: var(--fs-xs); font-weight: 600;
}
.rft-card__body { padding: var(--sp-3) var(--sp-4); flex: 1; }
.rft-card__title { font-weight: 600; color: var(--text-strong); }
.rft-card__meta { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.rft-card__actions { display: flex; gap: 2px; justify-content: flex-end; padding: 0 var(--sp-3) var(--sp-3); }

.oco-card .card__head h3 { display: flex; align-items: center; gap: 8px; }
.oco-num { background: var(--brand-green-500); color: #fff; border-radius: 50%; width: 24px; height: 24px; display: inline-grid; place-items: center; font-size: var(--fs-sm); }
.foto-grid { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.foto-thumb { position: relative; width: 104px; height: 104px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.foto-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-del {
  position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border: none; cursor: pointer;
  background: rgba(0,0,0,.6); color: #fff; border-radius: 50%; display: grid; place-items: center; font-size: 11px;
}
.foto-vazio { color: var(--text-muted); font-size: var(--fs-sm); padding: var(--sp-2) 0; }

/* ============================================================
   ABAS DO PROJETO
   ============================================================ */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.tab {
  padding: 8px 20px;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color .15s, border-color .15s, background .15s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab:hover { color: var(--text-strong); background: var(--surface-2); }
.tab--active { color: var(--primary); border-bottom-color: var(--primary); }
.tab--market { color: #1b4332 !important; font-weight: 600; }
.tab--market.tab--active { border-bottom-color: #1b4332; color: #1b4332 !important; }

/* ============================================================
   MERCADO AGRÍCOLA — stat boxes
   ============================================================ */
.stat-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4);
  text-align: center;
}
.stat-box--green { border-color: var(--success); background: rgba(22,163,74,.06); }
.stat-box--red   { border-color: var(--danger);  background: rgba(220,38,38,.06); }
.stat-box--amber { border-color: var(--amber);   background: rgba(233,168,37,.06); }
.stat-box__label { font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: 4px; }
.stat-box__value { font-size: var(--fs-lg); font-weight: 700; color: var(--text-strong); font-family: var(--font-display); }

/* Tooltip de clique nas linhas da tabela de preços */
tr[onclick]:hover { background: var(--surface-2) !important; }

/* Aba Lucro */
.tab--lucro { color: #e9a825 !important; font-weight: 600; }
.tab--lucro.tab--active { border-bottom-color: #e9a825; color: #e9a825 !important; }
