@import url('tokens.css');

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-title); margin: 0; letter-spacing: -0.01em; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-darker); }
input, select, textarea, button { font-family: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cfd8c8; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

@keyframes fadeup { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }

.fadeup { animation: fadeup .4s ease; }

/* ---------- botões ---------- */
.btn {
  border: none;
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  transition: background .15s;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-btn-primary); }
.btn-primary:hover:not(:disabled) { background: var(--primary-darker); }
.btn-secondary { background: var(--surface-alt-2); color: var(--primary); border: 1px solid #dbe4d2; }
.btn-block { width: 100%; }

/* ---------- inputs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text); }
.field input, .field select, .field textarea {
  border: 1px solid var(--border-input);
  border-radius: var(--radius-input);
  padding: 11px 13px;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
  resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--secondary); }
.field-error { color: var(--error-text); font-size: 11.5px; margin-top: 2px; }

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
}

/* ---------- avatar ---------- */
.avatar {
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  flex: none;
}
.avatar-user {
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
}

/* ---------- toast ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: #20291d;
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 999;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =====================================================================
   Tela de login / cadastro
   ===================================================================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at 30% 20%, #f3f6ee 0%, var(--bg) 60%);
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 34px 30px;
  box-shadow: var(--shadow-highlight);
}
.auth-logo { display: flex; align-items: center; gap: 11px; margin-bottom: 26px; }
.auth-logo .mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(140deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(72,121,76,.35);
}
.auth-logo .name { font-family: var(--font-title); font-weight: 800; font-size: 19px; color: var(--text-title); line-height: 1; }
.auth-logo .tag { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.auth-title { font-size: 20px; font-weight: 800; color: var(--text-title); margin-bottom: 4px; }
.auth-subtitle { font-size: 13px; color: var(--text-muted); margin-bottom: 22px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 12.5px; color: var(--text-muted); }
.auth-switch button { background: none; border: none; color: var(--primary); font-weight: 700; cursor: pointer; font-size: 12.5px; padding: 0; }
.auth-error {
  background: var(--error-bg); border: 1px solid var(--error-border); color: var(--error-text);
  border-radius: var(--radius-input); padding: 10px 13px; font-size: 12.5px; margin-bottom: 16px;
}

/* =====================================================================
   Shell do painel (app.html)
   ===================================================================== */
.shell { height: 100vh; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }

.topbar {
  flex: none; height: 60px; background: var(--surface);
  border-bottom: 1px solid var(--border-input);
  display: flex; align-items: center; padding: 0 22px; gap: 20px; z-index: 20;
}
.topbar .brand { display: flex; align-items: center; gap: 11px; }
.topbar .brand .mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(140deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(72,121,76,.35);
}
.topbar .brand .name { font-family: var(--font-title); font-weight: 800; font-size: 18px; line-height: 1; color: var(--text-title); }
.topbar .brand .tag { font-size: 10.5px; color: var(--text-faint); letter-spacing: .02em; margin-top: 2px; }
.topbar .spacer { flex: 1; }
.topbar .user { display: flex; align-items: center; gap: 10px; }
.topbar .user .who { text-align: right; }
.topbar .user .who .n { font-size: 12.5px; font-weight: 600; line-height: 1.1; }
.topbar .user .who .r { font-size: 10.5px; color: var(--text-faint); }
.topbar .avatar-user { width: 34px; height: 34px; font-size: 13px; }
.topbar .logout {
  background: none; border: 1px solid var(--border-input); color: var(--text-muted);
  border-radius: var(--radius-btn); padding: 7px 12px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.topbar .logout:hover { color: var(--error-text); border-color: var(--error-border); }

.main-area { flex: 1; display: flex; min-height: 0; }

.sidebar {
  flex: none; width: 230px; background: var(--primary);
  padding: 16px 12px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto;
}
.sidebar .group-label {
  font-size: 10px; font-weight: 700; letter-spacing: .08em; color: #bcd9b0; padding: 14px 12px 8px;
}
.sidebar .group-label:first-child { padding-top: 6px; }
.sidebar .nav-item {
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; color: #d9ecce;
  font-size: 13px; font-weight: 600; text-align: left;
  padding: 10px 12px; border-radius: 9px; cursor: pointer;
}
.sidebar .nav-item svg { flex: none; }
.sidebar .nav-item:hover { background: rgba(255,255,255,.08); }
.sidebar .nav-item.active { background: rgba(255,255,255,.16); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.sidebar .spacer { flex: 1; }
.sidebar .safra-card { background: rgba(255,255,255,.1); border-radius: 12px; padding: 13px; margin-top: 12px; }
.sidebar .safra-card .l1 { font-size: 11px; color: #d9ecce; line-height: 1.4; }
.sidebar .safra-card .l1 b { color: #fff; font-weight: 600; }
.sidebar .safra-card .track { height: 6px; background: rgba(255,255,255,.18); border-radius: 6px; margin-top: 9px; overflow: hidden; }
.sidebar .safra-card .fill { height: 100%; background: var(--secondary); border-radius: 6px; }
.sidebar .safra-card .l2 { font-size: 10px; color: #bcd9b0; margin-top: 6px; }

main.content { flex: 1; overflow-y: auto; min-width: 0; }
.view { padding: 26px 30px; }

.view-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.view-header h1 { font-size: 25px; font-weight: 800; color: var(--text-title); }
.view-header p { margin: 5px 0 0; color: var(--text-muted); font-size: 13.5px; }

/* ---------- kpis ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 18px; }
.kpi-card .label { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 12px; font-weight: 600; }
.kpi-card .icon { width: 28px; height: 28px; border-radius: 8px; background: var(--success-bg); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.kpi-card .value { font-family: var(--font-title); font-size: 30px; font-weight: 800; margin-top: 10px; color: var(--text); }
.kpi-card .value small { font-size: 15px; color: var(--text-muted); font-weight: 700; }
.kpi-card .hint { font-size: 11.5px; color: var(--text-muted); font-weight: 600; margin-top: 2px; }
.kpi-card .hint.positive { color: var(--success-text); }

/* ---------- painel dashboard ---------- */
.panel-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .panel-grid { grid-template-columns: 1fr; } }
.panel-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.panel-title h3 { font-size: 15px; font-weight: 700; }
.panel-title span { font-size: 11px; color: var(--text-muted); }

.consultant-row { display: flex; align-items: center; gap: 11px; }
.consultant-row .dot-wrap { position: relative; }
.consultant-row .live-dot {
  position: absolute; bottom: -1px; right: -1px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--secondary); border: 2px solid #fff; animation: pulse 2s infinite;
}
.consultant-row .info { flex: 1; min-width: 0; }
.consultant-row .info .n { font-size: 12.5px; font-weight: 600; }
.consultant-row .info .s { font-size: 11px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.consultant-row .km { font-size: 11px; font-weight: 700; color: var(--primary); white-space: nowrap; }

.empty-state { text-align: center; padding: 26px 10px; color: var(--text-muted); font-size: 12.5px; }
.empty-state svg { color: var(--text-faint); margin-bottom: 8px; }

.placeholder-view { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.placeholder-view h2 { color: var(--text-title); font-size: 19px; margin-bottom: 8px; }

/* ---------- chips genéricos ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-pill);
}
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

.btn-danger { background: var(--error-bg); color: var(--error-text); border: 1px solid var(--error-border); }
.btn-danger:hover:not(:disabled) { background: var(--error-border); }
.btn-excel { background: #fff; color: #1d6f42; border: 1.5px solid #1d6f42; }
.btn-excel:hover:not(:disabled) { background: #eaf6f0; }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-icon { padding: 6px; width: 30px; height: 30px; border-radius: 9px; }
.btn-dashed {
  background: var(--success-bg); border: 1.5px dashed #b9cfa8; color: var(--primary);
  border-radius: 9px; font-weight: 600; font-size: 12px; cursor: pointer;
  padding: 9px 14px; display: inline-flex; align-items: center; gap: 6px; width: 100%; justify-content: center;
}

/* ---------- busca + chips de filtro ---------- */
.search-box {
  display: flex; align-items: center; gap: 8px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-input); padding: 9px 13px; width: 260px;
}
.search-box input { border: none; outline: none; font-size: 13px; flex: 1; background: transparent; color: var(--text); }
.filter-chips { display: flex; gap: 7px; overflow-x: auto; flex-wrap: wrap; margin-bottom: 16px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border-input);
  color: var(--text-muted); font-size: 12px; font-weight: 600; padding: 7px 13px; border-radius: var(--radius-pill);
  cursor: pointer; white-space: nowrap;
}
.filter-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.filter-chip .fdot { width: 7px; height: 7px; border-radius: 50%; }

/* ---------- grid de produtores ---------- */
.producers-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 900px) { .producers-grid { grid-template-columns: 1fr; } }
.producer-card {
  position: relative; text-align: left; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 18px; cursor: pointer; display: flex; gap: 14px; align-items: flex-start;
  transition: box-shadow .15s, transform .15s; width: 100%;
}
.producer-card:hover { border-color: #b9cfa8; box-shadow: 0 6px 18px rgba(72,121,76,.12); transform: translateY(-2px); }
.producer-card .body { flex: 1; min-width: 0; padding-right: 22px; }
.producer-card .top-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.producer-card .pname { font-size: 15.5px; font-weight: 700; color: var(--text); }
.producer-card .since-badge { font-size: 10px; color: var(--text-faint); background: var(--divider); padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.producer-card .meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.mini-stats { display: flex; gap: 8px; margin-top: 12px; }
.mini-stat { flex: 1; background: var(--surface-alt); border-radius: 9px; padding: 8px 10px; }
.mini-stat .v { font-size: 16px; font-weight: 800; color: var(--primary); font-family: var(--font-title); }
.mini-stat .l { font-size: 10px; color: var(--text-faint); }
.card-delete-btn {
  position: absolute; top: 12px; right: 12px; background: none; border: none; color: var(--text-faint);
  cursor: pointer; padding: 5px; border-radius: 7px; line-height: 0;
}
.card-delete-btn:hover { color: var(--error-text); background: var(--error-bg); }

/* transferência em massa de produtores (docs/equipeeprodutor.md §2.4) — item de flex normal
   (não absolute) pra não sobrepor o avatar, que também flui no mesmo flex row do card. */
.card-select-cb { flex-shrink: 0; width: 17px; height: 17px; margin-top: 15px; cursor: pointer; accent-color: var(--primary); }

/* ---------- tela Equipe (docs/equipeeprodutor.md §2.5) ---------- */
.equipe-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 900px) { .equipe-grid { grid-template-columns: 1fr; } }
.equipe-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 18px; display: flex; gap: 14px; align-items: flex-start; transition: opacity .15s;
}
.equipe-card.inativo { opacity: .55; }
.equipe-card .body { flex: 1; min-width: 0; }
.badge-inativo { font-size: 10px; font-weight: 700; color: var(--error-text); background: var(--error-bg); padding: 2px 8px; border-radius: 20px; margin-left: 6px; vertical-align: middle; }
.equipe-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.transfer-list { max-height: 160px; overflow-y: auto; margin: 0 0 14px; padding-left: 18px; font-size: 13px; color: var(--text-muted); }
.bulk-transfer-bar {
  display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 10px 14px; margin-bottom: 16px; font-size: 13px; font-weight: 600;
}
.bulk-transfer-bar select { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); font-size: 13px; font-family: var(--font-body); }

/* ---------- modal "Transferir produtores" (tela rápida, todos os produtores) ---------- */
.transfer-modal-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.transfer-modal-toolbar span { font-size: 12px; color: var(--text-faint); }
.transfer-modal-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-card); padding: 6px; }
.transfer-modal-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 10px; cursor: pointer; }
.transfer-modal-row:hover { background: var(--surface-alt-2); }
.transfer-modal-row .info { flex: 1; min-width: 0; }
.transfer-modal-row .info .n { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer-modal-row .info .s { font-size: 11px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- detalhe do produtor ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: none; color: var(--text-muted);
  font-size: 12.5px; font-weight: 600; cursor: pointer; margin-bottom: 14px; padding: 0;
}
.back-link:hover { color: var(--primary); }
.detail-header { display: flex; gap: 18px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.detail-header .avatar { width: 64px; height: 64px; border-radius: 18px; font-size: 22px; font-weight: 800; }
.detail-header .info { flex: 1; min-width: 200px; }
.detail-header h1 { font-size: 22px; font-weight: 800; color: var(--text-title); }
.detail-header .sub { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.detail-header .actions { display: flex; gap: 9px; flex-wrap: wrap; }

.consultor-row {
  display: flex; align-items: center; gap: 10px; background: var(--surface-alt); border-radius: 10px;
  padding: 10px 14px; margin-bottom: 16px; font-size: 12.5px;
}
.consultor-row .lbl { color: var(--text-muted); font-weight: 600; }
.consultor-row .val { font-weight: 700; color: var(--text); }
.consultor-row button { margin-left: auto; }

/* Documento/Endereço/Localização/Crédito do produtor (docs/equipeeprodutor.md) — só aparece
   quando há algo pra mostrar (ver temDadosCompletos() em produtores.js). */
.producer-info-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px 20px;
  background: var(--surface-alt); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px;
}
.producer-info-grid .lbl { font-size: 10px; font-weight: 700; color: var(--text-faint); letter-spacing: .03em; text-transform: uppercase; }
.producer-info-grid .val { font-size: 12.5px; font-weight: 600; color: var(--text); margin-top: 3px; }

.farm-card { margin-bottom: 14px; }
.farm-card .head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.farm-card .head .left { display: flex; align-items: center; gap: 10px; }
.farm-card .head .icon { width: 34px; height: 34px; border-radius: 10px; background: var(--success-bg); color: var(--primary); display: flex; align-items: center; justify-content: center; flex: none; }
.farm-card .head h3 { font-size: 16px; font-weight: 700; }
.farm-card .head .meta { font-size: 11.5px; color: var(--text-faint); }
.farm-card .head .btns { display: flex; gap: 6px; }

.plots-table { border: 1px solid var(--divider); border-radius: 12px; overflow: hidden; }
.plots-row {
  display: grid; grid-template-columns: 1.3fr 0.8fr 1.2fr 1.2fr 0.9fr 70px;
  padding: 11px 14px; font-size: 12.5px; align-items: center; gap: 6px;
}
.plots-row.head { background: var(--surface-alt-2); font-size: 10.5px; font-weight: 700; color: var(--text-faint); letter-spacing: .03em; text-transform: uppercase; }
.plots-row.body { border-top: 1px solid var(--divider); }
.plots-row .pname { font-weight: 600; }
.plots-row .actions-cell { display: flex; gap: 4px; justify-content: flex-end; }
.badge-situacao { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 20px; }
.badge-ok { background: var(--success-bg); color: var(--success-text); }
.badge-atencao { background: var(--warning-bg); color: var(--warning-text); }

/* ---------- timeline ---------- */
.timeline-wrap { position: relative; }
.timeline-line { position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.timeline-item { display: flex; gap: 14px; align-items: flex-start; position: relative; margin-bottom: 16px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-node {
  width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-input);
  display: flex; align-items: center; justify-content: center; flex: none; z-index: 1;
}
.timeline-node .dot { width: 11px; height: 11px; border-radius: 50%; }
.timeline-body { flex: 1; min-width: 0; border: 1px solid var(--divider); border-radius: 12px; padding: 13px 15px; }
.timeline-body .row1 { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; flex-wrap: wrap; }
.timeline-body .date { font-size: 13px; font-weight: 800; }
.timeline-body .meta { font-size: 11px; color: var(--text-faint); }
.timeline-body .resumo { font-size: 12.5px; color: var(--text-muted); line-height: 1.55; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20,25,15,.45); display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal-card { background: var(--surface); border-radius: 18px; width: 100%; max-width: 460px; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-highlight); }
.modal-card-sm { max-width: 380px; padding: 22px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 4px; }
.modal-header h3 { font-size: 17px; font-weight: 800; color: var(--text-title); }
.modal-close { background: none; border: none; font-size: 22px; line-height: 1; color: var(--text-faint); cursor: pointer; padding: 4px 8px; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 14px 20px 4px; }
.modal-body-text { padding: 4px 4px 18px; font-size: 13.5px; color: var(--text); line-height: 1.5; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px 20px; }
.modal-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- lixeira ---------- */
.trash-section { margin-bottom: 18px; }
.trash-section h3 { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.trash-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--divider);
  border-radius: 12px; margin-bottom: 8px; background: var(--surface);
}
.trash-row .info { flex: 1; min-width: 0; }
.trash-row .info .n { font-size: 13px; font-weight: 700; }
.trash-row .info .m { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.trash-row .btns { display: flex; gap: 8px; flex: none; }

/* ---------- tabela de estoque ---------- */
.stock-table { border: 1px solid var(--divider); border-radius: 16px; overflow: hidden; background: var(--surface); }
.stock-row {
  display: grid; grid-template-columns: 1.6fr 1.1fr 1.2fr 1fr 0.9fr 1fr 70px;
  padding: 12px 18px; font-size: 12.5px; align-items: center; gap: 8px;
}
.stock-row.head { background: var(--surface-alt-2); font-size: 10.5px; font-weight: 700; color: var(--text-faint); letter-spacing: .03em; text-transform: uppercase; }
.stock-row.body { border-top: 1px solid var(--divider); }
.stock-row .actions-cell { display: flex; gap: 4px; justify-content: flex-end; }
@media (max-width: 1100px) { .stock-row { grid-template-columns: 1.4fr 1fr 1fr 0.9fr 0.8fr 0.9fr 60px; font-size: 12px; } }

/* ---------- kanban (funil de vendas / prospects) ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kanban-col { background: #f3f6ee; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 220px; }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kanban-col-head .name { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--text); }
.kanban-col-head .name .fdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.kanban-col-head .count { background: #fff; border-radius: 20px; padding: 2px 9px; font-size: 11px; font-weight: 700; color: #5a6656; }
.kanban-col-total { font-size: 11px; color: var(--text-muted); font-weight: 600; margin-top: -4px; }
.kanban-cards { display: flex; flex-direction: column; gap: 10px; min-height: 40px; }
.kanban-empty { font-size: 11.5px; color: var(--text-faint); text-align: center; padding: 14px 4px; }

.deal-card, .prospect-card {
  background: #fff; border-radius: 12px; padding: 12px; border: 1px solid var(--border); position: relative;
}
.deal-card .top-row, .prospect-card .top-row { display: flex; gap: 9px; align-items: flex-start; }
.deal-card .avatar-sm, .prospect-card .avatar-sm {
  width: 26px; height: 26px; border-radius: 8px; font-size: 10.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex: none; color: #fff;
}
.deal-card .producer, .prospect-card .producer { font-size: 12.5px; font-weight: 700; color: var(--text); }
.deal-card .produto, .prospect-card .interesse { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.deal-card .consultor-row, .prospect-card .consultor-row { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-faint); margin: 8px 0; }
.deal-card .bottom-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; }
.deal-card .valor { font-family: var(--font-title); font-weight: 800; font-size: 14px; color: var(--primary); }
.prospect-card .potencial { font-family: var(--font-title); font-weight: 800; font-size: 14px; color: var(--info-text); }
.deal-card .prob { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.card-actions { display: flex; gap: 6px; }
.card-actions .btn-back { flex: 1; }
.card-actions .btn-advance { flex: 2; }
.card-link-danger {
  display: block; width: 100%; text-align: center; background: none; border: none; margin-top: 8px;
  font-size: 11px; font-weight: 600; color: var(--error-text); cursor: pointer; padding: 2px;
}
.card-link-danger:hover { text-decoration: underline; }
.card-delete-corner {
  position: absolute; top: 8px; right: 8px; background: none; border: none; color: var(--text-faint);
  cursor: pointer; padding: 4px; border-radius: 6px; line-height: 0;
}
.card-delete-corner:hover { color: var(--error-text); background: var(--error-bg); }
.btn-convert {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin-top: 9px; padding: 9px; border-radius: 9px;
  background: var(--success-bg); border: 1px solid #cfe3bf; color: var(--primary);
  font-weight: 700; font-size: 12px; cursor: pointer;
}
.btn-convert:hover { background: #dcefd0; }

/* ---------- segmented control ---------- */
.segmented { display: inline-flex; background: var(--surface-alt-2); border-radius: 12px; padding: 3px; gap: 2px; }
.segmented button {
  border: none; background: none; padding: 8px 18px; border-radius: 9px; font-size: 12.5px;
  font-weight: 600; color: var(--text-muted); cursor: pointer;
}
.segmented button.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(31,42,30,.08); }

/* ---------- kpi colorido (análise de vendas) ---------- */
.kpi-tinted { border-radius: var(--radius-card); padding: 16px; }
.kpi-tinted .label { font-size: 12px; font-weight: 600; }
.kpi-tinted .value { font-family: var(--font-title); font-size: 24px; font-weight: 800; margin-top: 6px; }
.kpi-tinted .hint { font-size: 11px; font-weight: 600; margin-top: 2px; opacity: .85; }
.kpi-tinted.tint-success { background: var(--success-bg); border: 1px solid #cfe3bf; }
.kpi-tinted.tint-success .label, .kpi-tinted.tint-success .value { color: var(--success-text); }
.kpi-tinted.tint-warning { background: var(--warning-bg); border: 1px solid var(--warning-border); }
.kpi-tinted.tint-warning .label, .kpi-tinted.tint-warning .value { color: var(--warning-text); }
.kpi-tinted.tint-error { background: var(--error-bg); border: 1px solid var(--error-border); }
.kpi-tinted.tint-error .label, .kpi-tinted.tint-error .value { color: var(--error-text); }
.kpi-tinted.tint-neutral { background: var(--surface); border: 1px solid var(--border); }
.kpi-tinted.tint-neutral .label { color: var(--text-muted); }
/* Esmaecido no recorte por categoria da Análise (docs/metas.md §7.1) — card/KPI sem leitura
   por categoria não some (layout não pula) nem mente (fica visivelmente fora do recorte). */
.kpi-tinted.dim, .card.dim { opacity: .5; }
.kpi-tinted.tint-neutral .value { color: var(--text); }

/* ---------- visitas × vendas por consultor ---------- */
.vv-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--divider); }
.vv-row:last-child { border-bottom: none; }
.vv-row .avatar-sm { width: 30px; height: 30px; border-radius: 9px; font-size: 11px; }
.vv-row .name { width: 92px; flex: none; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vv-bars { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.vv-bar-line { display: flex; align-items: center; gap: 8px; }
.vv-bar-track { flex: 1; height: 7px; border-radius: 6px; background: var(--divider); overflow: hidden; }
.vv-bar-fill { height: 100%; border-radius: 6px; transition: width .3s; }
.vv-bar-fill.visitas { background: #c8dcb2; }
.vv-bar-fill.vendas { background: var(--primary); }
.vv-bar-label { flex: none; width: 74px; font-size: 10.5px; color: var(--text-faint); }
.vv-stats { flex: none; width: 92px; text-align: right; }
.vv-stats .conv { font-family: var(--font-title); font-size: 15px; font-weight: 800; color: var(--primary); }
.vv-stats .lbl { font-size: 9px; color: var(--text-faint); letter-spacing: .03em; text-transform: uppercase; }
.vv-stats .valor { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }

/* ---------- negócios perdidos ---------- */
.lost-card { background: #fdf5f4; border: 1px solid var(--error-border); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.lost-card .row1 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.lost-card .producer { font-size: 13px; font-weight: 700; }
.lost-card .valor { font-family: var(--font-title); font-weight: 800; color: var(--error-text); font-size: 13px; }
.lost-card .produto { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.lost-card .motivo { font-size: 11px; color: var(--text-faint); margin-top: 6px; }

/* ---------- ranking produtores (top/bottom) ---------- */
.rank-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--divider); }
.rank-row:last-child { border-bottom: none; }
.rank-row .pos { width: 18px; font-size: 11px; font-weight: 700; color: var(--text-faint); flex: none; }
.rank-row .name { flex: 1; font-size: 12.5px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .badge-visits { flex: none; font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px; background: var(--success-bg); color: var(--success-text); }
.rank-row.bottom .badge-visits { background: var(--warning-bg); color: var(--warning-text); }
.rank-row .fat { flex: none; width: 90px; text-align: right; font-size: 12px; font-weight: 700; }
.rank-row .fat.low { color: var(--error-text); }

/* ---------- vendas por mês ---------- */
.month-card { margin-bottom: 16px; }
.month-card .head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.month-card .head h3 { font-size: 15px; font-weight: 700; }
.month-card .head .meta { font-size: 11.5px; color: var(--text-muted); }
.posvenda-chip { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.posvenda-chip .line1 { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.posvenda-chip.done .line1 { background: var(--success-bg); color: var(--success-text); }
.posvenda-chip.pending .line1 { background: var(--warning-bg); color: var(--warning-text); }
.posvenda-chip .sub { font-size: 9.5px; color: var(--text-faint); }
.sales-table { border: 1px solid var(--divider); border-radius: 12px; overflow: hidden; }
.sales-row { display: grid; grid-template-columns: 0.7fr 1.6fr 1fr 0.9fr 1.3fr; padding: 10px 14px; font-size: 12px; align-items: center; gap: 8px; }
.sales-row.head { background: var(--surface-alt-2); font-size: 10.5px; font-weight: 700; color: var(--text-faint); letter-spacing: .03em; text-transform: uppercase; }
.sales-row.body { border-top: 1px solid var(--divider); }

/* ---------- pós-venda (docs/safra.md) ---------- */
.pv-card { border: 1px solid var(--divider); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; background: var(--surface); transition: box-shadow .3s, border-color .3s; }
.pv-card.pv-focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(72,121,76,.18); }
.pv-card .pv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.pv-card .pv-head .producer { font-weight: 700; font-size: 13.5px; }
.pv-card .pv-head .itens { font-size: 11px; color: var(--text-faint); margin-top: 1px; }
.pv-card .pv-head .valor { font-family: var(--font-title); font-weight: 800; color: var(--primary); font-size: 14px; }
.pv-card .pv-meta { font-size: 10.5px; color: var(--text-faint); margin-top: 3px; }
.pv-stepper { display: flex; align-items: center; gap: 0; margin-top: 12px; }
.pv-step { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; min-width: 0; position: relative; }
.pv-step .dot {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; border: 2px solid var(--border-input); color: var(--text-faint); background: var(--surface);
}
.pv-step.done .dot { background: var(--success-text); border-color: var(--success-text); color: #fff; }
.pv-step.alerta-atencao .dot { background: var(--warning-bg); border-color: var(--warning-text); color: var(--warning-text); }
.pv-step.alerta-critico .dot { background: var(--error-bg); border-color: var(--error-text); color: var(--error-text); }
.pv-step .lbl { font-size: 9.5px; font-weight: 700; color: var(--text-faint); text-align: center; }
.pv-step.done .lbl { color: var(--text); }
.pv-step .conn { position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--border-input); z-index: -1; }
.pv-step:first-child .conn { display: none; }
.pv-step.done .conn { background: var(--success-text); }
.pv-step button { margin-top: 2px; font-size: 10px; background: none; border: none; color: var(--primary); font-weight: 700; cursor: pointer; padding: 2px 4px; }
/* Card de alerta genérico (vermelho) — usado por pós-venda (plantio) e pelo dashboard
   (produtor sem visita), mesmo visual pras duas features. */
.alert-card { border: 1px solid var(--error-border); background: var(--error-bg); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
.alert-card h3 { font-size: 13px; font-weight: 800; color: var(--error-text); margin-bottom: 8px; }
.alert-card-row { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; padding: 5px 0; border-top: 1px solid var(--error-border); }
.alert-card-row:first-of-type { border-top: none; }
.alert-card-row .nivel-critico { color: var(--error-text); font-weight: 700; }
.alert-card-row .nivel-atencao { color: var(--warning-text); font-weight: 700; }
.pv-preview { background: var(--surface-alt); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.pv-preview .stat-line { display: flex; justify-content: space-between; font-size: 12px; padding: 2px 0; }
.pv-preview .stat-line b { color: var(--text-title); }

/* ---------- dashboard gestor (protótipo) ---------- */
.chart7d { display: flex; align-items: flex-end; gap: 20px; height: 180px; padding: 16px 6px 0; }
.chart7d-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart7d-val { font-size: 11px; font-weight: 700; color: var(--primary); }
.chart7d-bar { width: 100%; max-width: 34px; background: linear-gradient(180deg, #84c225, #48794c); border-radius: 7px 7px 3px 3px; }
.chart7d-day { font-size: 10.5px; color: var(--text-faint); }

.perf-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 22px; }
@media (max-width: 1000px) { .perf-grid { grid-template-columns: 1fr; } }
.funil-mini { border-left: 1px solid #eef1e8; padding-left: 22px; }
@media (max-width: 1000px) { .funil-mini { border-left: none; padding-left: 0; } }
.fm-track { height: 14px; border-radius: 7px; background: var(--divider); overflow: hidden; }
.fm-fill { height: 100%; border-radius: 7px; transition: width .3s; }

.sales-bars { display: flex; align-items: flex-end; gap: 14px; height: 150px; padding-top: 6px; }
.sales-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.sb-val { font-size: 10px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.sb-bar { width: 100%; max-width: 44px; border-radius: 8px 8px 3px 3px; transition: height .3s; }
.sb-name { font-size: 10.5px; color: var(--text-faint); }

/* ---------- tabela de produtos ---------- */
.products-table { border: 1px solid var(--divider); border-radius: 16px; overflow: hidden; background: var(--surface); }
.products-row {
  display: grid; grid-template-columns: 1.8fr 1.1fr 0.9fr 0.8fr 0.9fr 0.9fr 0.9fr 0.7fr 70px;
  padding: 11px 16px; font-size: 12px; align-items: center; gap: 8px;
}
.products-row.head { background: var(--surface-alt-2); font-size: 10px; font-weight: 700; color: var(--text-faint); letter-spacing: .03em; text-transform: uppercase; }
.products-row.body { border-top: 1px solid var(--divider); }
.products-row .actions-cell { display: flex; gap: 4px; justify-content: flex-end; }

/* ---------- orçamentos ---------- */
.quote-card { margin-bottom: 12px; }
.quote-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.brico-num { font-family: var(--font-title); font-weight: 800; font-size: 14px; color: var(--text-title); }
.quote-total { font-family: var(--font-title); font-weight: 800; font-size: 19px; color: var(--primary); }
.quote-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ob-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--divider);
  border-radius: 10px; margin-bottom: 6px; background: var(--surface-alt);
}

/* ---------- pedidos ---------- */
.pedidos-table { border: 1px solid var(--divider); border-radius: 16px; overflow: hidden; background: var(--surface); }
.pedidos-row {
  display: grid; grid-template-columns: 0.7fr 1.8fr 1.1fr 1fr 0.9fr 1fr 50px;
  padding: 11px 16px; font-size: 12px; align-items: center; gap: 8px;
}
.pedidos-row.head { background: var(--surface-alt-2); font-size: 10px; font-weight: 700; color: var(--text-faint); letter-spacing: .03em; text-transform: uppercase; }
.pedidos-row.body { border-top: 1px solid var(--divider); }
.pedidos-row .actions-cell { display: flex; justify-content: flex-end; }

/* ---------- modal largo ---------- */
.modal-card-wide { max-width: 680px; }

/* ---------- desenhar talhões (mapa satélite + Leaflet.draw) ---------- */
.talhoes-map-card {
  max-width: 1060px; width: 96vw; height: 88vh; max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.talhoes-map-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 20px 20px; }
.talhoes-geo-fallback { padding: 16px; background: var(--surface-alt-2); border-radius: 12px; margin-bottom: 14px; flex: none; }
.talhoes-geo-fallback .row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; }
.talhoes-geo-fallback .row .field { margin: 0; width: 140px; }
.talhoes-map-layout { flex: 1; min-height: 0; display: flex; gap: 16px; }
.talhoes-map-canvas { flex: 1.6; min-height: 380px; border-radius: 12px; overflow: hidden; }
.talhoes-map-sidebar { flex: 1; min-width: 250px; max-width: 320px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding-right: 2px; }
.talhao-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; transition: border-color .15s; }
.talhao-item:hover { border-color: var(--primary); }
.talhao-item .n { font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.talhao-item .m { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.talhao-item .acoes { display: flex; gap: 8px; margin-top: 8px; }
.talhao-item .acoes button { font-size: 10.5px; font-weight: 700; color: var(--primary); background: none; border: none; padding: 0; cursor: pointer; }
.talhao-item .acoes button.danger { color: var(--error-text); }
.talhao-badge-irrigacao { font-size: 9.5px; font-weight: 700; padding: 2px 7px; border-radius: 20px; }
.talhao-badge-irrigacao.irrigado { color: #5a8fa8; background: #e9eef4; }
.talhao-badge-irrigacao.sequeiro { color: #8a7248; background: #f5eede; }
.modal-section-title {
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-faint); margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid var(--divider);
}
.modal-section-title:first-child { margin-top: 0; padding-top: 0; border-top: none; }

/* ---------- personalização (settings) ---------- */
.settings-section { border-top: 1px solid var(--divider); padding-top: 16px; margin-top: 16px; }
.settings-section:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.settings-section h4 { font-size: 13.5px; font-weight: 800; color: var(--text-title); margin-bottom: 10px; }
.settings-section h4 span { font-size: 10.5px; font-weight: 600; color: var(--text-faint); margin-left: 6px; }
.settings-row { display: flex; gap: 14px; align-items: flex-start; }
.settings-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.settings-preview {
  width: 72px; height: 72px; border-radius: 14px; background: var(--surface-alt);
  border: 1.5px dashed var(--border-input); display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex: none;
}
.settings-preview.round { border-radius: 50%; font-family: var(--font-title); font-weight: 800; font-size: 20px; color: var(--text-muted); }
.settings-preview.banner { width: 100%; height: 84px; border-radius: 12px; }
.settings-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.settings-preview.round img { width: 100%; height: 100%; object-fit: cover; }
.color-input {
  width: 56px; height: 40px; border: 1px solid var(--border-input); border-radius: 10px;
  padding: 3px; background: var(--surface); cursor: pointer;
}
input[type="range"] { accent-color: var(--primary); width: 100%; }

/* ---------- sugestão de embalagens (orçamento) ---------- */
.ob-hint { font-size: 11.5px; padding: 9px 12px; border-radius: 10px; margin-top: 8px; }
.ob-hint.warn { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-border); }
.ob-suggest { background: var(--surface-alt); border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px; margin-top: 8px; }
.ob-suggest-head { font-size: 11.5px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.5; }
.ob-option {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: var(--surface); border: 1.5px solid var(--border-input); border-radius: 10px;
  padding: 9px 12px; margin-bottom: 6px; font-size: 12px; cursor: pointer; flex-wrap: wrap;
}
.ob-option:hover { border-color: var(--primary); }
.ob-option.recomendado { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, white); }
.ob-option .ob-op-sub { font-size: 10.5px; color: var(--text-faint); }
.ob-option .tagrec {
  margin-left: auto; font-size: 9.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  background: var(--primary); color: #fff; padding: 2px 8px; border-radius: 20px;
}

/* ---------- visitas & rotas ---------- */
.kpi-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-card); padding: 18px; color: #fff; box-shadow: var(--shadow-card-green);
}
.kpi-gradient .label { font-size: 12px; font-weight: 600; opacity: .9; }
.kpi-gradient .value { font-family: var(--font-title); font-size: 30px; font-weight: 800; margin-top: 10px; }
.kpi-gradient .hint { font-size: 11.5px; font-weight: 600; margin-top: 2px; opacity: .85; }

.rotas-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 1000px) { .rotas-grid { grid-template-columns: 1fr; } }
#rota-sat-map { height: 420px; border-radius: 14px; background: #20291d; overflow: hidden; }
#fazendas-map { height: 520px; border-radius: 14px; background: #20291d; overflow: hidden; }

/* ---------- tela Fazendas (docs/fazendas.md) ---------- */
.farms-table { border: 1px solid var(--divider); border-radius: 12px; overflow: hidden; }
.farms-row {
  display: grid; grid-template-columns: 1.4fr 1.3fr 1.1fr 0.7fr 0.7fr 1fr;
  padding: 11px 14px; font-size: 12.5px; align-items: center; gap: 6px;
}
.farms-row.head { background: var(--surface-alt-2); font-size: 10.5px; font-weight: 700; color: var(--text-faint); letter-spacing: .03em; text-transform: uppercase; }
.farms-row.body { border-top: 1px solid var(--divider); cursor: pointer; }
.farms-row.body:hover { background: var(--surface-alt); }
.farms-row .pname { font-weight: 600; }
.leaflet-container { font-family: var(--font-body); background: #20291d; }
.leaflet-popup-content { font-size: 12px; line-height: 1.4; }

.rota-legend { display: flex; gap: 14px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.rota-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--text-muted); }
.rota-legend .fdot { width: 10px; height: 10px; border-radius: 3px; }

.pin-visita {
  width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  border: 2.5px solid #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.pin-visita span { transform: rotate(45deg); color: #fff; font-weight: 800; font-size: 11px; font-family: var(--font-body); }
.pin-base {
  width: 30px; height: 30px; border-radius: 50%; background: #20291d; border: 2.5px solid #fff;
  color: #fff; font-weight: 800; font-size: 12px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.4); font-family: var(--font-body);
}

.rota-timeline { display: flex; flex-direction: column; gap: 12px; }
.dia-card { padding: 14px 16px; }
.dia-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.dia-head b { font-size: 13px; }
.dia-head .meta { font-size: 11px; color: var(--text-faint); }
.dia-head .fdot { width: 11px; height: 11px; border-radius: 4px; }
.dia-head .km-badge { background: var(--success-bg); color: var(--primary); font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px; }
.visita-item { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--divider); }
.visita-item .vnum {
  width: 22px; height: 22px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 10.5px;
  display: flex; align-items: center; justify-content: center; flex: none; margin-top: 2px;
}

/* ---------- análise de vendas (BI) ---------- */
.bi-filters { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; }
.bi-dates { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.bi-dates label { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.bi-dates input[type="date"] {
  border: 1px solid var(--border-input); border-radius: 10px; padding: 8px 10px;
  font-size: 12.5px; color: var(--text); background: var(--surface); outline: none; font-family: inherit;
}
.bi-dates input[type="date"]:focus { border-color: var(--secondary); }

.kpi-grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 1200px) { .kpi-grid-6 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .kpi-grid-6 { grid-template-columns: repeat(2, 1fr); } }
.kpi-grid-6 .kpi-tinted .value { font-size: 19px; }

.bi-grid-21 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-bottom: 16px; }
.bi-grid-11 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 1000px) { .bi-grid-21, .bi-grid-11 { grid-template-columns: 1fr; } }

.chart-meses { display: grid; align-items: end; gap: 10px; height: 190px; padding: 14px 4px 0; }
.chart-mes-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.cm-val { font-size: 9.5px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.cm-bar { width: 100%; max-width: 38px; background: linear-gradient(180deg, var(--secondary), var(--primary)); border-radius: 7px 7px 3px 3px; transition: height .3s; }
.cm-label { font-size: 10px; color: var(--text-faint); white-space: nowrap; }

.hbar-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--divider); }
.hbar-row:last-child { border-bottom: none; }
.hbar-track { flex: 1; height: 10px; border-radius: 6px; background: var(--divider); overflow: hidden; }
.hbar-fill { height: 100%; border-radius: 6px; transition: width .3s; }
.hbar-val { flex: none; width: 96px; text-align: right; font-size: 11px; color: var(--text-muted); }

.vrank-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--divider); }
.vrank-row:last-child { border-bottom: none; }
.vrank-row .pos { width: 18px; font-size: 11px; font-weight: 700; color: var(--text-faint); flex: none; }
.vrank-mid { flex: 1; min-width: 0; }
.vrank-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.vrank-head b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vrank-head span { font-size: 10.5px; color: var(--text-faint); flex: none; }
.vrank-valor { flex: none; width: 84px; text-align: right; font-family: var(--font-title); font-weight: 800; font-size: 13px; color: var(--primary); }

/* ---------- avaliação semanal ---------- */
.eval-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; align-items: start; }
.eval-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; }
@media (max-width: 1000px) { .eval-grid { grid-template-columns: 1fr; } .eval-grid-2 { grid-template-columns: 1fr; } }

.eval-ring { width: 118px; height: 118px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.eval-ring-inner { width: 92px; height: 92px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; }

.eval-rank-row {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 12px;
  cursor: pointer; width: 100%; background: var(--surface); border: 1px solid var(--divider); text-align: left;
}
.eval-rank-row:hover { border-color: var(--border-input); }
.eval-rank-row.active { background: var(--surface-alt); border-color: var(--secondary); }
.eval-rank-row .pos { font-size: 13px; font-weight: 800; color: var(--text-faint); width: 18px; flex: none; font-family: var(--font-title); }

.eval-table-row {
  display: grid; grid-template-columns: 0.5fr 1.4fr 1fr 0.7fr 1.3fr 1.2fr; min-width: 600px;
  padding: 12px 16px; font-size: 12px; border-top: 1px solid var(--divider); align-items: center; gap: 6px;
}
.eval-table-row:first-child { border-top: none; }
.eval-table-head {
  background: var(--surface-alt-2); padding: 10px 16px; font-size: 10px; font-weight: 700;
  color: var(--text-muted); letter-spacing: .03em; text-transform: uppercase; border-radius: 12px 12px 0 0;
}
.reg-chip { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.star-btn { cursor: pointer; line-height: 0; transition: color .15s; }
.star-btn:hover { color: #ffcc29 !important; }

/* ---------- laudo agronômico (página-documento, protótipo linhas 464-518) ---------- */
.laudo-doc { max-width: 820px; margin: 0 auto; background: var(--surface); border-radius: 8px; box-shadow: 0 12px 40px rgba(31,42,30,.14); overflow: hidden; }
.laudo-doc-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-darker)); padding: 24px 34px;
  display: flex; align-items: center; gap: 14px; color: #fff;
}
.laudo-doc-header .icon { width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; flex: none; }
.laudo-doc-body { padding: 28px 34px; }
.laudo-meta-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 24px;
  padding-bottom: 22px; border-bottom: 1px solid var(--divider); margin-bottom: 22px;
}
.laudo-meta-grid .lbl { font-size: 10px; font-weight: 700; color: var(--text-faint); letter-spacing: .04em; text-transform: uppercase; }
.laudo-meta-grid .val { font-size: 13.5px; font-weight: 600; margin-top: 3px; color: var(--text); }
.laudo-section-title { font-size: 14px; font-weight: 700; color: var(--text-title); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.laudo-section-title .dash { width: 5px; height: 16px; background: var(--secondary); border-radius: 3px; flex: none; }
.laudo-diag-item { border: 1px solid var(--divider); border-radius: 11px; padding: 13px 15px; }
.laudo-rec-table { border: 1px solid var(--divider); border-radius: 11px; overflow: hidden; margin-bottom: 24px; }
.laudo-rec-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1.8fr; padding: 12px 15px; font-size: 12px; align-items: center; gap: 8px; }
.laudo-rec-row.head { background: var(--surface-alt-2); padding: 10px 15px; font-size: 10px; font-weight: 700; color: var(--text-faint); letter-spacing: .03em; text-transform: uppercase; }
.laudo-rec-row.body { border-top: 1px solid var(--divider); }
.laudo-obs-box { background: var(--surface-alt-2); border-radius: 11px; padding: 16px 18px; margin-bottom: 26px; }
.laudo-obs-box .lbl { font-size: 11px; font-weight: 700; color: var(--text-faint); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 6px; }
.laudo-obs-box p { margin: 0; font-size: 12.5px; color: var(--text-muted); line-height: 1.55; }
@media (max-width: 760px) { .laudo-meta-grid { grid-template-columns: repeat(2, 1fr); } .laudo-rec-row { grid-template-columns: 1.4fr 0.8fr; } }
