/* =========================================================================
   Central Comercial Cowmed — Protótipo (preview)
   Visual fiel à versão inicial pré-recolor (commit e28c4d8, 18/06)
   ========================================================================= */

:root {
  /* Paleta — verde Cowmed VIBRANTE (não o #8dc153 atual) */
  --green: #39A935;
  --green-dark: #2D8A29;
  --green-darker: #256F22;
  --green-light: #E9F6E4;
  --green-soft: rgba(57,169,53,.12);

  /* Sidebar */
  --sidebar-bg: #0D130D;
  --sidebar-text: #d8dad6;
  --sidebar-text-dim: #8d918b;
  --sidebar-text-active: #ffffff;
  --sidebar-border: rgba(255,255,255,.06);

  /* Textos */
  --ink: #3a3a3a;
  --mid: #666;
  --soft-ink: #555;

  /* Backgrounds e linhas */
  --light: #f5f5f2;
  --light-2: #f1f5f4;
  --line: #e6e8ea;
  --line-2: #eef0f2;
  --white: #ffffff;

  /* Status colors */
  --status-novo-bg: #eef0f2;          --status-novo-fg: #555;
  --status-contato-bg: #e3eef9;       --status-contato-fg: #1e5a8f;
  --status-proposta-bg: #fdf5d8;      --status-proposta-fg: #8a5e04;
  --status-negociacao-bg: #fde9d7;    --status-negociacao-fg: #b54708;
  --status-ganho-bg: #E9F6E4;         --status-ganho-fg: #2d7a26;
  --status-perdido-bg: #fce4e4;       --status-perdido-fg: #a83232;

  /* Tokens */
  --card-radius: 14px;
  --card-shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 18px rgba(0,0,0,.05);
  --sidebar-width: 240px;
  --topbar-height: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
*:focus { outline: none; }
*:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  background: var(--light);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* =========================================================================
   LAYOUT SHELL
   ========================================================================= */
.app { min-height: 100vh; }

.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex; flex-direction: column;
  z-index: 50;
}

.sidebar-header {
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-logo {
  font-size: 16px; font-weight: 700; color: #fff;
  display: flex; align-items: center; gap: 8px;
  letter-spacing: .02em;
}
.sidebar-logo .dot { color: var(--green); font-size: 18px; }
.sidebar-sub {
  font-size: 11px; color: var(--sidebar-text-dim);
  margin-top: 4px; letter-spacing: .04em;
}

.sidebar-nav {
  list-style: none; padding: 14px 0; flex: 1;
  overflow-y: auto;
}
.sidebar-nav li { margin: 2px 0; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 22px;
  color: var(--sidebar-text);
  font-size: 14px;
  border-left: 4px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.sidebar-nav a:hover {
  background: rgba(255,255,255,.04);
  color: #fff;
}
.sidebar-nav a.active {
  background: var(--green-soft);
  color: var(--sidebar-text-active);
  border-left-color: var(--green);
  font-weight: 600;
}
.sidebar-nav a .ic { font-size: 16px; width: 20px; text-align: center; }
.sidebar-nav a.soon {
  color: var(--sidebar-text-dim);
  cursor: not-allowed;
}
.sidebar-nav a.soon:hover { background: transparent; color: var(--sidebar-text-dim); }

.sidebar-section {
  padding: 18px 22px 8px;
  font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--sidebar-text-dim);
}

.sidebar-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--sidebar-border);
  font-size: 11px;
  color: var(--sidebar-text-dim);
}

.main { margin-left: var(--sidebar-width); min-height: 100vh; }

.topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 40;
}
.topbar h2 {
  font-size: 15px; font-weight: 600; color: var(--ink);
}
.topbar .breadcrumb {
  font-size: 12px; color: var(--mid);
}
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-user { font-size: 13px; color: var(--ink); }
.topbar-user b { font-weight: 600; }
.topbar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: grid; place-items: center;
  font-weight: 600; font-size: 13px;
}

.hamburger {
  display: none;
  font-size: 22px; color: var(--ink);
  width: 40px; height: 40px;
  border-radius: 8px;
}
.hamburger:hover { background: var(--light-2); }

/* User dropdown */
.topbar-user-block { position: relative; }
.topbar-user-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 8px 6px 12px;
  border-radius: 10px;
  transition: background .15s;
}
.topbar-user-btn:hover { background: var(--light-2); }
.topbar-user-info { text-align: right; line-height: 1.2; }
.topbar-user-info .tu-nome { font-size: 13px; font-weight: 600; color: var(--ink); }
.topbar-user-info .tu-cargo { font-size: 11px; color: var(--mid); }
.user-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.04);
  min-width: 240px;
  padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .15s, transform .15s, visibility .15s;
  z-index: 50;
}
.user-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.user-menu .um-header {
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.user-menu .um-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.user-menu .um-email { font-size: 12px; color: var(--mid); margin-top: 2px; }
.user-menu .um-item {
  display: block; width: 100%; text-align: left;
  padding: 10px 12px; border-radius: 8px;
  font-size: 13.5px; color: var(--ink);
  background: none; border: none;
  cursor: pointer; text-decoration: none;
  font-family: inherit;
}
.user-menu .um-item:hover { background: var(--light-2); }
.user-menu .um-divider {
  height: 1px; background: var(--line);
  margin: 6px 4px;
}
.user-menu .um-danger { color: #b54040; }
.user-menu .um-danger:hover { background: #fce4e4; }

.main-content { padding: 28px; max-width: 1400px; }

/* =========================================================================
   CARDS / GRIDS
   ========================================================================= */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  padding: 20px;
  box-shadow: var(--card-shadow);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.card-header h3 {
  font-size: 15px; font-weight: 600; color: var(--ink);
}
.card-body { font-size: 14px; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-60-40 { grid-template-columns: 6fr 4fr; }
.grid-2-1 { grid-template-columns: 2fr 1fr; }

.section { margin-bottom: 24px; }
.section h2 {
  font-size: 22px; font-weight: 700; color: var(--ink);
  margin-bottom: 4px;
}
.section .sub { font-size: 13px; color: var(--mid); margin-bottom: 16px; }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 24px; font-weight: 700; color: var(--ink);
}
.page-header .crumb {
  font-size: 12px; color: var(--mid); margin-bottom: 2px;
}

/* =========================================================================
   KPI CARDS
   ========================================================================= */
.kpi-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  padding: 18px 20px;
  box-shadow: var(--card-shadow);
  position: relative;
}
.kpi-card .ic {
  position: absolute; top: 16px; right: 18px;
  font-size: 16px; opacity: .35;
}
.kpi-card .label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--mid); font-weight: 600;
}
.kpi-card .value {
  font-size: 28px; font-weight: 700; color: var(--ink);
  margin-top: 6px;
}
.kpi-card .hint { font-size: 11px; color: var(--mid); margin-top: 2px; }

/* =========================================================================
   BOTÕES
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13.5px; font-weight: 500;
  border: 1px solid transparent;
  transition: background .15s, transform .08s, box-shadow .15s, border-color .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-secondary {
  background: #fff; color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover { background: var(--light-2); border-color: #cdd2d6; }
.btn-block { width: 100%; justify-content: center; padding: 12px; }
.btn-sm { padding: 7px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { padding: 8px 10px; }

/* =========================================================================
   FORM FIELDS
   ========================================================================= */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--mid); font-weight: 600;
}
.field input, .field select, .field textarea {
  border: 1.5px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(57,169,53,.15);
}
.field textarea { resize: vertical; min-height: 70px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.radio-group { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-group label {
  flex: 1; min-width: 80px;
  text-align: center;
  padding: 9px 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px; color: var(--ink);
  text-transform: none; letter-spacing: 0; font-weight: 500;
  background: #fff;
}
.radio-group label.checked {
  border-color: var(--green);
  background: var(--green-light);
  color: var(--green-darker);
  font-weight: 600;
}
.radio-group input { display: none; }

/* =========================================================================
   BADGES (status)
   ========================================================================= */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px; font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
}
.badge-novo { background: var(--status-novo-bg); color: var(--status-novo-fg); }
.badge-contato_feito { background: var(--status-contato-bg); color: var(--status-contato-fg); }
.badge-proposta_enviada { background: var(--status-proposta-bg); color: var(--status-proposta-fg); }
.badge-em_negociacao { background: var(--status-negociacao-bg); color: var(--status-negociacao-fg); }
.badge-fechado_ganho { background: var(--status-ganho-bg); color: var(--status-ganho-fg); }
.badge-fechado_perdido { background: var(--status-perdido-bg); color: var(--status-perdido-fg); }
.badge-assinada { background: var(--status-ganho-bg); color: var(--status-ganho-fg); }
.badge-enviada { background: var(--status-negociacao-bg); color: var(--status-negociacao-fg); }
.badge-cadastrada { background: var(--status-novo-bg); color: var(--status-novo-fg); }

.chip {
  display: inline-block;
  padding: 2px 8px;
  background: var(--light-2);
  border-radius: 6px;
  font-size: 11px; color: var(--mid);
}

/* Badges de cargo (tela de Usuários) */
.role-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11.5px; font-weight: 600;
}
.role-admin     { background: #ede4f7; color: #5e2d99; }
.role-gestor    { background: #e3eef9; color: #1e5a8f; }
.role-vendedor  { background: var(--green-light); color: var(--green-darker); }
.role-sdr       { background: #fdf5d8; color: #8a5e04; }
.role-financeiro{ background: #fde9d7; color: #b54708; }

/* Avatar inline (tabela) */
.user-inline {
  display: flex; align-items: center; gap: 10px;
}
.user-inline .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: grid; place-items: center;
  font-weight: 600; font-size: 12px;
  flex-shrink: 0;
}
.user-inline .info .nome { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.user-inline .info .email { font-size: 12px; color: var(--mid); }

/* =========================================================================
   KANBAN
   ========================================================================= */
.kanban {
  display: flex; gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
}
.kanban-col {
  flex: 1; min-width: 280px;
  display: flex; flex-direction: column;
}
.kanban-col-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 4px 12px;
}
.kanban-col-header .title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--mid);
}
.kanban-col-header .count {
  background: var(--light-2);
  color: var(--mid);
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 99px;
}
.kanban-col-body {
  display: flex; flex-direction: column; gap: 10px;
  min-height: 100px;
}

.lead-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.lead-card:hover {
  transform: translateY(-2px);
  border-color: #cdd2d6;
  box-shadow: 0 4px 12px rgba(0,0,0,.07);
}
.lead-card .nome { font-weight: 600; font-size: 14px; color: var(--ink); }
.lead-card .fazenda { font-size: 12px; color: var(--mid); margin-top: 2px; }
.lead-card .row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px;
}
.lead-card .valor {
  font-weight: 700; font-size: 14px; color: var(--green-dark);
}
.lead-card .meta {
  display: flex; align-items: center; gap: 6px;
  margin-top: 8px; flex-wrap: wrap;
}

/* =========================================================================
   DRAWER
   ========================================================================= */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 100;
  opacity: 0; visibility: hidden;
  transition: opacity .2s, visibility .2s;
}
.drawer-overlay.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0;
  height: 100vh; width: 460px; max-width: 100vw;
  background: #fff;
  box-shadow: -8px 0 24px rgba(0,0,0,.1);
  z-index: 101;
  transform: translateX(100%);
  transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px;
}
.drawer-header .close {
  font-size: 22px; color: var(--mid);
  width: 32px; height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
}
.drawer-header .close:hover { background: var(--light-2); color: var(--ink); }
.drawer-header h2 { font-size: 18px; font-weight: 700; }
.drawer-header .sub { font-size: 13px; color: var(--mid); margin-top: 2px; }

.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.drawer-section { margin-bottom: 22px; }
.drawer-section h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--mid); font-weight: 700; margin-bottom: 10px;
}
.drawer-section .row {
  display: flex; justify-content: space-between;
  padding: 6px 0; font-size: 13px;
}
.drawer-section .row .lbl { color: var(--mid); }
.drawer-section .row .val { color: var(--ink); font-weight: 500; }

.timeline { display: flex; flex-direction: column; gap: 10px; }
.timeline-item {
  display: flex; gap: 12px;
  padding-bottom: 10px;
}
.timeline-item .ic {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--green-light); color: var(--green-dark);
  display: grid; place-items: center;
  font-size: 13px; flex-shrink: 0;
}
.timeline-item .ct { flex: 1; }
.timeline-item .ct .data { font-size: 11px; color: var(--mid); }
.timeline-item .ct .texto { font-size: 13px; color: var(--ink); margin-top: 2px; }

.drawer-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex; gap: 10px;
}

/* =========================================================================
   MODAL
   ========================================================================= */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  display: grid; place-items: center;
  padding: 20px;
  opacity: 0; visibility: hidden;
  transition: opacity .2s, visibility .2s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%; max-width: 540px;
  max-height: 88vh; overflow-y: auto;
  padding: 26px 28px;
  box-shadow: 0 24px 60px rgba(0,0,0,.2);
  transform: translateY(20px);
  transition: transform .2s;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.modal .sub { font-size: 13px; color: var(--mid); margin-bottom: 18px; }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* =========================================================================
   TOAST
   ========================================================================= */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--green-dark); color: #fff;
  padding: 12px 22px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500;
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
  z-index: 300;
  opacity: 0; transform: translateY(20px);
  pointer-events: none;
  transition: opacity .2s, transform .25s;
}
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.toast.error { background: #a83232; }
.toast.info { background: #1e5a8f; }

/* =========================================================================
   TABLE
   ========================================================================= */
.tbl {
  width: 100%; border-collapse: collapse;
  font-size: 13.5px;
}
.tbl thead th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--mid); font-weight: 700;
  padding: 10px 12px; text-align: left;
  border-bottom: 1px solid var(--line);
  background: var(--light-2);
}
.tbl tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink);
}
.tbl tbody tr:hover td { background: #fafbf9; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .actions { display: flex; gap: 6px; justify-content: flex-end; }

/* =========================================================================
   LEADS QUENTES (lista no Início)
   ========================================================================= */
.hot-list { display: flex; flex-direction: column; gap: 8px; }
.hot-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  background: #fff;
}
.hot-item:hover { background: #fafbf9; border-color: #cdd2d6; }
.hot-item .l-info .nome { font-weight: 600; font-size: 14px; }
.hot-item .l-info .meta { font-size: 12px; color: var(--mid); margin-top: 2px; }
.hot-item .l-right { text-align: right; }
.hot-item .valor { font-weight: 700; color: var(--green-dark); font-size: 14px; }
.hot-item .arrow { color: var(--mid); margin-left: 10px; font-size: 16px; }

/* =========================================================================
   PAINEL "MINHAS METAS" + FUNIL (home)
   ========================================================================= */
.metas-period {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
}
.meta-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  padding: 16px 20px;
  box-shadow: var(--card-shadow);
}
.meta-card .label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--mid); font-weight: 600;
}
.meta-card .value {
  font-size: 24px; font-weight: 700; color: var(--ink);
  margin-top: 4px;
}
.meta-card .meta-status {
  font-size: 11.5px; color: var(--mid); margin-top: 2px;
}

.funil-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 14px;
  align-items: center;
  padding: 9px 0;
}
.funil-row + .funil-row {
  border-top: 1px solid var(--line-2);
}
.funil-row .etapa {
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 500;
}
.funil-bar {
  background: var(--light-2);
  border-radius: 6px;
  height: 26px;
  position: relative;
  overflow: hidden;
}
.funil-bar .fill {
  height: 100%;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 12px; font-weight: 600;
  color: #fff;
  white-space: nowrap;
  min-width: 6px;
}
.funil-bar.empty {
  background: transparent;
  height: 26px;
}
.funil-bar.empty .fill {
  background: var(--light-2);
  color: var(--mid);
  font-weight: 500;
  width: auto !important;
  padding: 0 12px;
  display: inline-flex;
}
.funil-bar .fill.novo        { background: #9ca3af; }
.funil-bar .fill.contato     { background: #3b82f6; }
.funil-bar .fill.proposta    { background: #f59e0b; }
.funil-bar .fill.negociacao  { background: #ea580c; }
.funil-bar .fill.oc          { background: #14b8a6; }
.funil-bar .fill.ganho       { background: #84cc16; }
.funil-bar .fill.perdido     { background: #ef4444; opacity: .85; }

@media (max-width: 768px) {
  .funil-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .funil-row .etapa { font-size: 12.5px; font-weight: 600; }
}

/* Motivos de perda — card lateral ao funil */
.funil-layout {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 980px) {
  .funil-layout { grid-template-columns: 1fr; }
}
.motivos-card .lp-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
}
.motivos-card .lp-head h3 { font-size: 15px; font-weight: 600; color: var(--ink); }
.motivos-card .lp-head .total {
  font-size: 12px; color: var(--mid);
}
.motivo-row {
  padding: 9px 0;
}
.motivo-row + .motivo-row {
  border-top: 1px solid var(--line-2);
}
.motivo-row .lbl {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--ink);
  margin-bottom: 5px;
}
.motivo-row .lbl .qtd {
  color: var(--status-perdido-fg);
  font-weight: 700;
}
.motivo-bar {
  height: 8px; background: var(--light-2); border-radius: 99px;
  overflow: hidden;
}
.motivo-bar .fill {
  height: 100%;
  background: #ef4444; opacity: .8;
  border-radius: 99px;
}

.ia-card {
  background: var(--green-light);
  border: 1px solid #cfe5c6;
  border-radius: var(--card-radius);
  padding: 20px;
}
.ia-card .badge-ai {
  display: inline-block;
  background: #fff; color: var(--green-darker);
  padding: 3px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  margin-bottom: 10px;
}
.ia-card h4 { font-size: 15px; font-weight: 600; margin-bottom: 6px; color: var(--green-darker); }
.ia-card p { font-size: 13.5px; color: #2c4427; line-height: 1.55; margin-bottom: 14px; }

/* =========================================================================
   PROPOSTA — split & resumo sticky
   ========================================================================= */
.proposta-split {
  display: grid; grid-template-columns: 6fr 4fr;
  gap: 22px;
  align-items: start;
}
.proposta-resumo {
  position: sticky; top: calc(var(--topbar-height) + 24px);
}
.resumo-row {
  display: flex; justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13.5px;
}
.resumo-row:last-of-type { border-bottom: none; }
.resumo-row .lbl { color: var(--mid); }
.resumo-row .val { color: var(--ink); font-weight: 600; }
.resumo-total {
  margin-top: 14px; padding-top: 14px;
  border-top: 2px solid var(--green);
  display: flex; justify-content: space-between; align-items: baseline;
}
.resumo-total .lbl { font-size: 12px; text-transform: uppercase; color: var(--mid); letter-spacing: .06em; font-weight: 700; }
.resumo-total .val { font-size: 22px; font-weight: 800; color: var(--green-dark); }

/* =========================================================================
   LOGIN
   ========================================================================= */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #f6faf3 0%, #E9F6E4 100%);
  display: grid; place-items: center;
  padding: 24px;
}
.login-card {
  background: #fff;
  width: 100%; max-width: 400px;
  padding: 36px 34px;
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(45,122,38,.12), 0 2px 6px rgba(0,0,0,.04);
}
.login-logo {
  font-size: 26px; font-weight: 800;
  color: var(--green-dark);
  display: flex; align-items: center; gap: 8px;
}
.login-card h1 {
  font-size: 18px; font-weight: 700; color: var(--ink);
  margin-top: 12px;
}
.login-sub { font-size: 13.5px; color: var(--mid); margin: 4px 0 22px; }
.login-foot {
  margin-top: 22px; text-align: center;
  font-size: 11px; color: var(--mid);
}

/* =========================================================================
   MOBILE
   ========================================================================= */
@media (max-width: 920px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-60-40, .grid-2-1, .grid-2 { grid-template-columns: 1fr; }
  .proposta-split { grid-template-columns: 1fr; }
  .proposta-resumo { position: static; }
  .field-row, .field-row-3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 120;
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .hamburger { display: grid; place-items: center; }
  .topbar { padding: 0 16px; }
  .main-content { padding: 18px; }
  .drawer { width: 100vw; }
  .topbar-user { display: none; }
}
