:root {
  --navy: #1d3557;
  --navy-2: #152942;
  --primary: #1d3557;
  --primary-2: #152942;
  --ink: #333;
  --muted: #6b7280;
  --line: #e8e8e8;
  --paper: #f6f7f9;
  --white: #fff;
  --danger: #dc2626;
  --ok: #16a34a;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: Inter, "DM Sans", system-ui, sans-serif;
  font-size: 13px;
  color: var(--ink);
  background: var(--paper);
}
a { color: inherit; text-decoration: none; }
[x-cloak] { display: none !important; }

.app {
  height: 100%;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 220px 1fr;
  overflow: hidden;
}

/* —— Sidebar (padrão IZTEC.FOOD) —— */
.sidebar {
  background: #fff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  letter-spacing: -1px;
}
.brand-logo {
  display: block;
  max-height: 36px;
  max-width: 168px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.brand-logo:not([src]),
.brand-logo[src=""] {
  opacity: 0;
}
.brand-iz {
  font-weight: 700;
  font-size: 22px;
  color: var(--navy);
}
.brand-cred {
  font-weight: 600;
  font-size: 22px;
  color: var(--navy);
}
.sidebar-company {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.sidebar-company .name {
  font-weight: 700;
  font-size: 12px;
  color: #333;
  text-transform: uppercase;
  letter-spacing: .3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-company .role {
  font-size: 10px;
  color: #999;
  margin-top: 2px;
}
.nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 16px;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { width: 0; }
.nav-label {
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #9ca3af;
  font-weight: 600;
  padding: 14px 18px 6px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 18px;
  color: #444;
  font-size: 12px;
  font-weight: 400;
}
.nav a:hover { background: #f5f5f5; color: #333; }
.nav a.on { color: var(--navy); font-weight: 700; background: #eef2f6; }
.nav a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #777;
}
.nav a.on svg { color: var(--navy); }
.sidebar-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: #9ca3af;
  flex-shrink: 0;
}

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 12px;
  background: var(--paper);
  flex-shrink: 0;
}
.top h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
}
.top-user { font-size: 12px; color: var(--muted); display: flex; gap: 14px; align-items: center; }
.top-user button {
  border: 0;
  background: none;
  color: var(--danger);
  cursor: pointer;
  font: 600 12px Inter, "DM Sans", sans-serif;
}
.content { padding: 0 24px 24px; flex: 1; min-height: 0; overflow: auto; }
.card {
  background: var(--white);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.lista-abas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -6px 0 16px;
}
.lista-abas button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  color: #4b5563;
  font: 600 12px Inter, sans-serif;
  cursor: pointer;
}
.lista-abas button:hover { border-color: #cbd5e1; color: var(--navy); }
.lista-abas button.on {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.lista-abas button em {
  font: 700 11px Inter, sans-serif;
  font-style: normal;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  display: inline-grid;
  place-items: center;
}
.lista-abas button.on em { background: rgba(255,255,255,.18); color: #fff; }
.btn {
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font: 600 13px Inter, "DM Sans", sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: var(--primary-2); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-ghost {
  background: #f3f4f6;
  color: #374151;
}
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.table-wrap { overflow-x: auto; }
.t-actions { display: flex; gap: 10px; white-space: nowrap; }
.t-actions button {
  border: 0;
  background: none;
  cursor: pointer;
  font: 600 12px Inter, sans-serif;
  padding: 0;
}
.t-actions .edit { color: var(--primary); }
.t-actions .off { color: var(--danger); }
.t-actions .on { color: var(--ok); }
.grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.grid-form .full { grid-column: 1 / -1; }
label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; color: #374151; }
input, select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font: 13px Inter, "DM Sans", sans-serif;
  outline: none;
}
input:focus, select:focus {
  border-color: #7c93b3;
  box-shadow: 0 0 0 3px rgba(29,53,87,.14);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 8px;
  border-bottom: 1px solid #e5e7eb;
}
td { padding: 12px 8px; border-bottom: 1px solid #f3f4f6; }
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef6f1;
  color: var(--ok);
}
.badge.off { background: #f8e8e6; color: var(--danger); }
.erro { color: var(--danger); font-size: 13px; margin: 8px 0; }
.ok { color: var(--ok); font-size: 13px; margin: 8px 0; }
.empty { color: var(--muted); padding: 24px 8px; }

/* —— Esteira Kanban (padrão IZTEC.FOOD) —— */
.content.board-page {
  padding: 0 16px 10px;
  background: var(--paper);
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.board-fill {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.board-toolbar {
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.board-toolbar h2 {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 8px;
}
.board-toolbar h2 svg { color: var(--primary); }
.board-count {
  font-size: 10px;
  font-weight: 600;
  background: #f3f4f6;
  color: #4b5563;
  padding: 3px 8px;
  border-radius: 999px;
}
.board-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.board-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.board-filters select {
  width: auto;
  min-width: 148px;
  max-width: 200px;
  height: 32px;
  padding: 0 8px;
  font-size: 12px;
  border-radius: 8px;
}
.board-clear {
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.board-clear:hover { text-decoration: underline; }
.board-search {
  position: relative;
}
.board-search input {
  height: 32px;
  width: 180px;
  padding: 0 10px 0 28px;
  font-size: 12px;
  border-radius: 8px;
}
.board-search svg {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  color: #9ca3af;
  pointer-events: none;
}
.board-vista {
  height: 32px;
  padding: 0 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font: 600 12px Inter, sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.board-vista:hover { background: #f3f4f6; }
.board-vista svg { width: 14px; height: 14px; }
.board-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.board-list table { min-width: 860px; }
.board-list thead th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.board-list tbody tr { cursor: pointer; }
.board-list tbody tr:hover { background: #f8fafc; }
.board-list-empty {
  color: var(--muted);
  padding: 40px 16px;
  text-align: center;
}
.plist-id { color: #6b7280; font-weight: 600; white-space: nowrap; }
.plist-val { font-weight: 700; color: var(--navy); white-space: nowrap; }
.plist-etapa {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--navy);
  white-space: nowrap;
}
.plist-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.plist-prazo { font-size: 12px; color: #4b5563; }
.plist-prazo.late { color: var(--danger); font-weight: 600; }
.plist-act { text-align: right; white-space: nowrap; }
.plist-act button {
  border: 0;
  background: none;
  color: var(--navy);
  font: 600 12px Inter, sans-serif;
  cursor: pointer;
}
.plist-act button:hover { text-decoration: underline; }
.kanban {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  align-items: stretch;
}
.kcol {
  width: 260px;
  min-width: 220px;
  flex: 1 0 220px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
.kcol-box {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}
.kcol-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  background: #1d3557;
  color: #fff;
  flex-shrink: 0;
}
.kcol-h .left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.kdot { display: none; }
.kcol-h .ttl {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
}
.kcount {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  color: #fff;
}
.klist {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.klist::-webkit-scrollbar { width: 4px; }
.klist::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.kempty {
  text-align: center;
  padding: 32px 8px;
  color: #d1d5db;
  font-size: 12px;
  pointer-events: none;
}
.kempty svg {
  width: 28px;
  height: 28px;
  display: block;
  margin: 0 auto 8px;
  opacity: .7;
}

.kcard {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  padding: 12px;
  cursor: grab;
  transition: transform .2s ease, box-shadow .2s ease;
}
.kcard:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.kcard:active { cursor: grabbing; }
.kcard-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.kcard-id {
  font-size: 11px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #374151;
}
.kcard-time {
  font-size: 10px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 4px;
}
.kcard-name {
  font-size: 12px;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kcard-rede {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 4px;
}
.kcard-sub {
  font-size: 10px;
  color: #9ca3af;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kcard-foot {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.kcard-val {
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
}
.kcard-chip {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: #f3f4f6;
  color: #4b5563;
}
.kcard-actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
}
.kcard-actions button {
  flex: 1;
  border: 0;
  background: #f3f4f6;
  color: #4b5563;
  font: 600 10px Inter, sans-serif;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.kcard-actions button:hover { background: #e5e7eb; }

.kanban-col-dragover .kcol-box {
  border-color: #1d3557 !important;
  border-style: dashed !important;
}

.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0,0,0,.18);
  overflow: hidden;
}
.modal-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 13px;
  font-weight: 700;
}
.modal-h button {
  border: 0;
  background: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.modal-b { padding: 16px; font-size: 13px; }
.modal-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f3f4f6;
}
.modal-row span { color: #9ca3af; font-size: 12px; }
.modal-row b { color: #111; font-weight: 600; }

textarea {
  width: 100%;
  min-height: 84px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font: 13px Inter, "DM Sans", sans-serif;
  outline: none;
  resize: vertical;
}
textarea:focus {
  border-color: #7c93b3;
  box-shadow: 0 0 0 3px rgba(29,53,87,.14);
}
.field { margin-bottom: 12px; }
.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 400;
  margin: 6px 0;
  color: #374151;
}
.check-line input { width: auto; height: auto; }
.check-line em { font-size: 10px; color: #9ca3af; font-style: normal; }

.stage-list { display: flex; flex-direction: column; gap: 14px; padding-bottom: 24px; }
.page-lead { color: var(--muted); font-size: 14px; margin-bottom: 16px; max-width: 62ch; line-height: 1.5; }
.stage-card { padding: 0; overflow: hidden; }
.stage-card-h {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--navy);
  color: #fff;
}
.stage-drag {
  width: 22px;
  height: 28px;
  display: grid;
  place-items: center;
  cursor: grab;
  color: rgba(255,255,255,.55);
  flex-shrink: 0;
}
.stage-drag:active { cursor: grabbing; }
.stage-drag svg { width: 14px; height: 14px; }
.stage-tools { display: flex; gap: 4px; flex-shrink: 0; }
.stage-tools button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,.14);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.stage-tools button:hover { background: rgba(255,255,255,.24); }
.stage-tools button:disabled { opacity: .35; cursor: default; }
.stage-tools button.danger:hover { background: #dc2626; }
.stage-tools svg { width: 15px; height: 15px; }
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,.16);
  display: grid;
  place-items: center;
  font: 700 12px Inter, sans-serif;
  flex-shrink: 0;
}
.stage-name {
  font: 700 16px Inter, sans-serif;
  border: 0;
  background: transparent;
  color: #fff;
  height: 32px;
  padding: 0 4px;
  flex: 1;
  width: auto;
  min-width: 0;
  border-bottom: 1px dashed rgba(255,255,255,.25);
}
.stage-name:focus { box-shadow: none; border-color: rgba(255,255,255,.6); }
.stage-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  color: #fff;
  white-space: nowrap;
}
.stage-pill.ganho { background: #bbf7d0; color: #166534; }
.stage-pill.perdido { background: #fecaca; color: #991b1b; }
.stage-sec { padding: 14px 16px 6px; }
.stage-sec + .stage-sec { border-top: 1px solid #f3f4f6; }
.stage-sec-h {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 2px;
}
.stage-sec-sub { font-size: 12px; color: #9ca3af; margin-bottom: 10px; }
.stage-toggles, .stage-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.tog, .choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  margin: 0;
  font-weight: 600;
}
.tog input, .choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  margin: 0;
}
.tog-ico, .choice-ico {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: #eef2f6;
  color: var(--navy);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.tog-ico svg, .choice-ico svg { width: 18px; height: 18px; }
.choice-ico.green { background: #ecfdf5; color: #166534; }
.choice-ico.red { background: #fef2f2; color: #991b1b; }
.tog-txt, .choice-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.tog-txt b, .choice-txt b { font-size: 13px; color: #1f2937; font-weight: 700; }
.tog-txt small, .choice-txt small { font-weight: 400; color: #9ca3af; font-size: 11px; line-height: 1.3; }
.tog-sw {
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: #e5e7eb;
  flex-shrink: 0;
  position: relative;
}
.tog-sw::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
  transition: left .15s;
}
.tog.on {
  border-color: var(--navy);
  background: #eef2f6;
}
.tog.on .tog-ico { background: var(--navy); color: #fff; }
.tog.on .tog-sw { background: var(--navy); }
.tog.on .tog-sw::after { left: 16px; }
.choice.on {
  border-color: var(--navy);
  background: #eef2f6;
  box-shadow: inset 0 0 0 1px var(--navy);
}
.choice.win.on {
  border-color: #16a34a;
  background: #f0fdf4;
  box-shadow: inset 0 0 0 1px #16a34a;
}
.choice.lost.on {
  border-color: #dc2626;
  background: #fef2f2;
  box-shadow: inset 0 0 0 1px #dc2626;
}
.stage-block {
  margin: 0 16px 16px;
  padding: 12px;
  border: 1px dashed #e5e7eb;
  border-radius: 10px;
  background: #fafafa;
}
.stage-block-h { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #6b7280; margin-bottom: 8px; }
.kcol-flags { display: flex; align-items: center; gap: 6px; }
.kflag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
}
.kflag.win { background: #bbf7d0; color: #166534; }
.kflag.lost { background: #fecaca; color: #991b1b; }
.kcard-lead {
  margin-top: 8px;
  font-size: 10px;
  font-weight: 700;
  color: #166534;
  background: #ecfdf5;
  border-radius: 4px;
  padding: 4px 6px;
  text-align: center;
}
.kcard-lead.lost { color: #991b1b; background: #fef2f2; }
.stage-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.stage-line input { flex: 1; height: 36px; }
.stage-add { display: flex; gap: 8px; margin-top: 8px; }
.stage-add input { flex: 1; height: 36px; }
.mini { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: #4b5563; white-space: nowrap; }
.mini input { width: auto; height: auto; }
.link-off {
  border: 0;
  background: none;
  color: var(--danger);
  font: 600 12px Inter, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.hint { color: #6b7280; font-size: 12px; font-weight: 400; margin: 4px 0 10px; }
.hint-box {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 12px;
  color: #4b5563;
  line-height: 1.5;
}
.hint-box p { margin-bottom: 6px; }
.hint-box p:last-child { margin-bottom: 0; }
.mip-box {
  margin-top: 8px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafafa;
}
.mip-table { font-size: 13px; }
.mip-table th { text-transform: none; letter-spacing: 0; }
.mip-table input { height: 36px; }

/* —— Cadastros (padrão IZTEC.FOOD · azul-marinho) —— */
.person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e8eef5;
  color: var(--navy);
  font: 700 13px Inter, sans-serif;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  text-transform: uppercase;
}
.avatar-img {
  object-fit: contain;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 3px;
}
.avatar.lg {
  width: 64px;
  height: 64px;
  font-size: 24px;
  background: rgba(255,255,255,.18);
  color: #fff;
}
.person strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
}
.person small {
  display: block;
  font-size: 11px;
  color: #9ca3af;
  margin-top: 1px;
}
.pill-navy {
  display: inline-block;
  min-width: 28px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  background: #e8eef5;
  border-radius: 999px;
  padding: 3px 10px;
}
.ico-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.ico-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: #f3f4f6;
  color: #374151;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.ico-btn:hover { background: #e8eef5; color: var(--navy); }
.ico-btn.view { color: #374151; }
.ico-btn.edit { color: #be4a5a; background: #fdf2f4; }
.ico-btn.edit:hover { background: #fce7eb; }
.ico-btn.danger { color: var(--danger); background: #fef2f2; }
.ico-btn.ok { color: var(--ok); background: #ecfdf5; }
.ico-btn svg { width: 16px; height: 16px; }
a.ico-btn { text-decoration: none; }
.toolbar .busca {
  flex: 1;
  max-width: 320px;
  height: 38px;
  margin: 0;
}
.cad-sec {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
  background: #fff;
}
.cad-sec header {
  background: var(--navy);
  color: #fff;
  font: 700 13px Inter, sans-serif;
  padding: 10px 14px;
}
.cad-sec-b { padding: 16px; }
.cad-sec small { display: block; margin-top: 4px; color: #6b7280; font-size: 11px; }
.modal.ficha {
  max-width: 680px;
  max-height: calc(100vh - 48px);
  overflow: auto;
}
.modal.ficha.lead-ficha {
  width: min(1600px, calc(100vw - 32px));
  max-width: 1600px;
  height: calc(100vh - 48px);
  max-height: calc(100vh - 48px);
  min-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ficha-hero {
  background: linear-gradient(135deg, #1d3557 0%, #2d4a73 100%);
  color: #fff;
  padding: 22px 22px 0;
  flex-shrink: 0;
}
.ficha-hero-top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
}
.ficha-hero-top h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}
.ficha-hero-top p {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(255,255,255,.72);
}
.ficha-hero-top .ficha-cli {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.ficha-hero-top .grow { flex: 1; min-width: 0; }
.ficha-corretor {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
  max-width: 280px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.72);
}
.ficha-corretor select {
  height: 32px;
  border: 0;
  border-radius: 8px;
  padding: 0 8px;
  font: 600 12px Inter, sans-serif;
  color: var(--navy);
}
.ficha-rede {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
}
.ficha-rede span {
  font-size: 12px;
  color: rgba(255,255,255,.78);
  line-height: 1.35;
}
.btn-hero {
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: rgba(255,255,255,.16);
  color: #fff;
  font: 600 12px Inter, sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-hero:hover { background: rgba(255,255,255,.24); }
.btn-hero svg { width: 14px; height: 14px; }
.btn-hero-danger { background: rgba(220, 38, 38, .88); }
.btn-hero-danger:hover { background: #b91c1c; }
.ficha-cta { margin-top: 14px; }
.btn-hero-cta { background: #fff; color: var(--navy); font-size: 13px; height: 38px; padding: 0 16px; }
.btn-hero-cta:hover { background: #e8eef5; color: var(--navy); }
.capp-cta { margin-top: 12px; }
.capp-cta .btn { width: 100%; }
.btn-on-navy { background: #fff; color: var(--navy); }
.btn-on-navy:hover { background: #e8eef5; color: var(--navy); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.ficha-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(255,255,255,.12);
}
.ficha-metrics div {
  padding: 12px 4px 14px;
  text-align: center;
}
.ficha-metrics div + div { border-left: 1px solid rgba(255,255,255,.12); }
.ficha-metrics b {
  display: block;
  font-size: 14px;
  font-weight: 700;
}
.ficha-metrics span {
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
}
.ficha-body { padding: 16px; }
.ficha-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
}
.ficha-card h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
}
.ficha-card h4 svg { width: 16px; height: 16px; }
.ficha-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
}
.ficha-grid .full { grid-column: 1 / -1; }
.ficha-item span {
  display: block;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 2px;
}
.ficha-item b { font-size: 13px; font-weight: 600; color: #1f2937; }

.sim-box {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px 14px;
  margin-bottom: 14px;
  background: #fff;
}
.sim-box-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 10px;
}
.sim-box-h .link-navy { text-transform: none; letter-spacing: 0; }
.sim-box-h-acoes { display: flex; align-items: center; gap: 12px; }
.sim-sub-h {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 12px 0 6px;
}
.sim-box .sim-rows + .sim-sub-h { margin-top: 14px; }
.sim-rows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid #eef2f6;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}
.sim-rows div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid #eef2f6;
}
.sim-rows div:nth-child(odd) { border-right: 1px solid #eef2f6; }
.sim-rows span { font-size: 11px; color: #6b7280; }
.sim-rows b { font-size: 13px; font-weight: 700; color: #1f2937; text-align: right; }
.sim-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.sim-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 8px;
  text-align: center;
  background: #fafbfc;
}
.sim-card.on {
  border-color: #86efac;
  background: #f0fdf4;
}
.sim-card span {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 4px;
}
.sim-card.on span { color: #166534; }
.sim-card b { font-size: 13px; font-weight: 700; color: #1f2937; }
.sim-card.on b { color: #166534; }

.lead-ficha { max-width: 1180px; }
.kcard-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.etag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.4;
}
.etag button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
}
.kcard-crm {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  font-size: 10px;
  font-weight: 600;
  color: var(--navy);
}
.kcard-crm span { background: #eef2f6; border-radius: 4px; padding: 2px 6px; }
.kcard-crm .crm-pend { background: #fff7ed; color: #9a3412; }
.kcard-crm .crm-agend { background: #eff6ff; color: #1d4ed8; }
.kcard-crm .crm-nota { background: #f3f4f6; color: #374151; }
.kcard-agend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
}
.kcard-agend svg { width: 12px; height: 12px; flex-shrink: 0; }
.kcard-prazo {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
}
.kcard-prazo.late { background: #fef2f2; color: #991b1b; }
.kcard-prazo svg { width: 12px; height: 12px; flex-shrink: 0; }
.lead-body {
  padding: 14px 16px 18px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.lead-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; flex-shrink: 0; }
.lead-split {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 16px;
  align-items: stretch;
}
.lead-col-sim {
  min-height: 0;
  overflow: auto;
}
.lead-col-sim .sim-box { margin-bottom: 0; }
.lead-col-sim .pend-destaque { margin-top: 12px; margin-bottom: 0; }
.lead-col-sim .follow-destaque { margin-top: 12px; margin-bottom: 0; }
.lead-col-crm {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
}
.lead-col-crm .lead-tabs { flex-shrink: 0; overflow-x: auto; }
.lead-col-crm .lead-tabs button { padding: 8px 8px; white-space: nowrap; }
.lead-col-crm .lead-form { flex-shrink: 0; }
.lead-col-crm .lead-list,
.lead-col-crm .hist-list {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
}
.tag-add { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.tag-add input { height: 28px; width: 140px; font-size: 12px; }
.tag-add .btn { height: 28px; padding: 0 10px; }
.tag-select {
  width: auto;
  min-width: 170px;
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
  border-radius: 8px;
}
.tag-custom { display: inline-flex; gap: 4px; align-items: center; }
.tag-cores { display: flex; gap: 4px; }
.cor-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.cor-dot.on { border-color: #111; box-shadow: 0 0 0 1px #fff inset; }
.lead-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 12px;
}
.lead-tabs button {
  border: 0;
  background: none;
  padding: 8px 10px;
  font: 600 12px Inter, sans-serif;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.lead-tabs button.on { color: var(--navy); border-bottom-color: var(--navy); }
.tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 999px;
  background: #c2410c;
  color: #fff;
  font: 700 10px Inter, sans-serif;
  font-style: normal;
  vertical-align: middle;
}
.pend-destaque {
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.pend-destaque-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.pend-destaque-h b {
  flex: 1;
  font-size: 12px;
  font-weight: 700;
  color: #9a3412;
}
.pend-ico {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #ffedd5;
  color: #c2410c;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.pend-ico svg { width: 14px; height: 14px; }
.pend-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 8px 10px;
}
.pend-row + .pend-row { margin-top: 6px; }
.pend-row-body { flex: 1; min-width: 0; }
.pend-row-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pend-row strong { display: block; font-size: 13px; color: #7c2d12; }
.pend-row p { margin: 4px 0 0; font-size: 12px; color: #9a3412; white-space: pre-wrap; }
.follow-destaque {
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 10px;
  padding: 10px 12px;
}
.follow-destaque-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.follow-destaque-h b {
  flex: 1;
  font-size: 12px;
  font-weight: 700;
  color: #0f766e;
}
.follow-ico {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #ccfbf1;
  color: #0f766e;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.follow-ico svg { width: 14px; height: 14px; }
.follow-row {
  background: #fff;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  padding: 8px 10px;
}
.follow-row + .follow-row { margin-top: 6px; }
.follow-row.done { opacity: .55; }
.follow-row-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px; }
.follow-row strong { font-size: 13px; color: #115e59; }
.follow-row p { margin: 4px 0; font-size: 12px; color: #0f766e; white-space: pre-wrap; }
.prazo-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: #ffedd5;
  color: #9a3412;
  font: 700 10px Inter, sans-serif;
  white-space: nowrap;
}
.prazo-badge.late { background: #fee2e2; color: #991b1b; }
.prazo-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font: 600 11px Inter, sans-serif;
  color: #6b7280;
}
.prazo-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font: 600 11px Inter, sans-serif;
  color: #6b7280;
}
.prazo-edit input { width: 150px; height: 28px; font-size: 12px; }
.pend-coms {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #fed7aa;
}
.lead-item .pend-coms { border-top-color: #e5e7eb; }
.pend-com { margin-bottom: 8px; }
.pend-com-h {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.pend-com-h b { font-size: 11px; color: #7c2d12; }
.lead-item .pend-com-h b { color: var(--navy); }
.pend-com-h span { font-size: 11px; color: #9ca3af; }
.pend-com p { margin: 2px 0 0; font-size: 12px; color: #4b5563; white-space: pre-wrap; }
.pend-com-form { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.pend-com-form input { flex: 1; min-width: 120px; height: 30px; font-size: 12px; }
.pend-com-form .btn { height: 30px; padding: 0 10px; font-size: 12px; }
.pend-arqs { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.pend-arq { display: flex; align-items: center; gap: 8px; }
.pend-file-btn {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  font: 600 12px Inter, sans-serif;
  color: var(--navy);
  cursor: pointer;
}
.pend-file-btn input { display: none; }
.pend-file-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: #4b5563;
  cursor: pointer;
  background: #f8fafc;
}
.pend-file-pick input { display: none; }
.pend-file-pick:hover { border-color: var(--navy); color: var(--navy); }
.pend-ok {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  flex-shrink: 0;
  color: #9a3412;
  border-color: #fdba74;
}
.lead-item.warn {
  border-color: #fdba74;
  background: #fff7ed;
}
.hist-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 320px;
  overflow-y: auto;
  padding-left: 6px;
}
.hist-item {
  display: flex;
  gap: 10px;
  padding: 0 0 14px;
  position: relative;
}
.hist-item:last-child { padding-bottom: 0; }
.hist-item:last-child .hist-dot::after { display: none; }
.hist-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--navy);
  flex-shrink: 0;
  margin-top: 5px;
  position: relative;
  z-index: 1;
}
.hist-dot::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 12px;
  bottom: -18px;
  width: 2px;
  background: #e5e7eb;
}
.hist-etapa .hist-dot { background: var(--navy); }
.hist-nota .hist-dot { background: #6b7280; }
.hist-pend .hist-dot { background: #c2410c; }
.hist-agend .hist-dot { background: #1d4ed8; }
.hist-follow .hist-dot { background: #0f766e; }
.hist-tag .hist-dot { background: #7c3aed; }
.hist-off .hist-dot { background: #9ca3af; }
.hist-body { flex: 1; min-width: 0; }
.hist-h { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.hist-h b { font-size: 13px; color: var(--navy); }
.hist-body p { font-size: 12px; color: #4b5563; margin: 4px 0; white-space: pre-wrap; }

.nota-visao {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.nota-visao button {
  height: 28px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font: 600 12px Inter, sans-serif;
  color: #6b7280;
  cursor: pointer;
}
.nota-visao button.on {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.nota-visao small { font-size: 11px; color: #6b7280; }
.nota-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font: 700 10px Inter, sans-serif;
  white-space: nowrap;
}
.nota-badge.pub { background: #ecfdf5; color: #047857; }
.nota-badge.priv { background: #f3f4f6; color: #374151; }
.lead-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.lead-form textarea { min-height: 64px; }
.lead-list { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; }
.lead-item {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}
.lead-item.done { opacity: .55; }
.lead-item-h { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.lead-item-h b { font-size: 13px; color: var(--navy); }
.lead-item p { font-size: 12px; color: #4b5563; margin: 6px 0; white-space: pre-wrap; }
.lead-item-f { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.muted { font-size: 11px; color: #9ca3af; }
.link-navy {
  border: 0;
  background: none;
  color: var(--navy);
  font: 600 12px Inter, sans-serif;
  cursor: pointer;
  margin-right: 8px;
}

.sim-page { width: 100%; max-width: none; }
.sim-step {
  width: 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  margin-bottom: 16px;
}
.sim-step-h {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--navy);
  color: #fff;
  font: 700 15px Inter, sans-serif;
  padding: 12px 16px;
}
.sim-step-n {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  display: grid;
  place-items: center;
  font-size: 13px;
  flex-shrink: 0;
}
.sim-step-b { padding: 16px 16px 18px; }
.sim-field { min-width: 0; }
.sim-field label { margin-bottom: 6px; }
.sim-field label em { color: #dc2626; font-style: normal; }
.sim-field small { display: block; margin-top: 4px; font-size: 11px; color: #6b7280; }
.sim-rede { display: grid; gap: 12px; max-width: 560px; margin-top: 14px; }
.sim-pick { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.sim-pick .sim-field { flex: 1; min-width: 0; }
.sim-pick .btn { height: 38px; padding: 0 12px; flex-shrink: 0; }
.sim-field input.hi { background: #fffbeb; }
.sim-row { display: grid; gap: 12px; margin-top: 12px; }
.sim-row.nome-nasc { grid-template-columns: minmax(0, 1.6fr) minmax(180px, .7fr); }
.sim-row.cols-2 { grid-template-columns: 1fr 1fr; }
.sim-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.sim-row.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sim-row.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sim-sub { margin-top: 18px; padding-top: 12px; border-top: 1px solid #eef2f6; }
.sim-sub h4 {
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 10px;
}
.sim-segundo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}
.sim-segundo label {
  margin: 0;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .05em;
}
.sim-segundo select { width: 110px; height: 34px; }
.sim-aviso {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}
.sim-aviso.ok { background: #ecfdf5; color: #047857; }
.sim-aviso.warn { background: #fff7ed; color: #9a3412; }
.sim-aviso p { margin: 0 0 8px; font-weight: 600; }
.sim-anexar { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.sim-anexar label { display: flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; }
.sim-anexar input { margin: 0; }
.sim-bancos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 4px;
}
.sim-bancos-centro { justify-content: center; }
.sim-banco {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font: 600 13px Inter, sans-serif;
  color: #374151;
}
.sim-banco.on { border-color: var(--navy); background: var(--navy); color: #fff; }
.sim-banco span { font-size: 11px; font-weight: 500; opacity: .8; }
.sim-previews { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 16px; }
.sim-preview-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
}
.sim-preview-card > strong { display: block; margin-bottom: 8px; color: var(--navy); font-size: 13px; }
.sim-preview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 16px;
}
.sim-preview div {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
}
.sim-preview span { display: block; font-size: 11px; color: #6b7280; margin-bottom: 4px; }
.sim-preview b { font-size: 14px; color: var(--navy); }
.sim-outras { margin-top: 12px; padding-top: 10px; border-top: 1px dashed #e5e7eb; }
.sim-outras-h { font-size: 11px; font-weight: 700; color: #6b7280; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .04em; }
.sim-outra {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
  width: 100%;
  text-align: left;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  margin-bottom: 6px;
}
.sim-outra.on { border-color: var(--navy); background: #f8fafc; }
.sim-outra b { font-size: 12px; color: var(--navy); }
.sim-outra span, .sim-outra em { font-size: 11px; color: #6b7280; font-style: normal; }
.sim-outra-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.sim-outra-row .sim-outra { flex: 1; margin-bottom: 0; }
.sim-outra-acoes { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .grid-form { grid-template-columns: 1fr; }
  .kcol { flex: 0 0 260px; }
  .stage-toggles, .stage-choices { grid-template-columns: 1fr; }
  .ficha-grid, .ficha-metrics, .sim-cards { grid-template-columns: 1fr 1fr; }
  .sim-rows { grid-template-columns: 1fr; }
  .sim-rows div:nth-child(odd) { border-right: 0; }
  .ficha-metrics div + div { border-left: 0; border-top: 1px solid rgba(255,255,255,.12); }
  .modal.ficha.lead-ficha { overflow: auto; }
  .lead-body { overflow: visible; }
  .lead-split { grid-template-columns: 1fr; overflow: visible; }
  .lead-col-crm { overflow: visible; }
  .sim-grid, .sim-preview,
  .sim-row.nome-nasc, .sim-row.cols-2, .sim-row.cols-3, .sim-row.cols-4, .sim-row.cols-5 {
    grid-template-columns: 1fr;
  }
  .modal.sim-view { max-height: 100dvh; border-radius: 0; }
  .modal-bg.sim-view-bg { padding: 0; }
}

.kcard-analises, .capp-card .kcard-analises {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.an-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--navy);
}
.an-chip.aprovada { background: #dcfce7; color: #166534; }
.an-chip.reprovada { background: #fee2e2; color: #991b1b; }
.an-chip.condicionada { background: #fef3c7; color: #92400e; }
.an-chip.em_analise { background: #dbeafe; color: #1d4ed8; }
.analise-box { margin-top: 14px; }
.an-tab { flex-shrink: 0; }
.lead-col-crm .an-form { margin-top: 0; padding-top: 0; border-top: 0; }
.lead-col-crm .an-form .grid-form { gap: 8px; margin-bottom: 10px; }
.lead-col-crm .an-form input,
.lead-col-crm .an-form select { height: 36px; }
.an-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fff;
}
.an-card.st-aprovada { border-color: #86efac; }
.an-card.st-reprovada { border-color: #fca5a5; }
.an-card-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.an-card b { color: var(--navy); }
.an-card p { font-size: 12px; color: #4b5563; margin: 4px 0; }
.an-card em { font-size: 11px; color: #9ca3af; font-style: normal; }
.an-card-f { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 4px; }
.an-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid #e5e7eb; }
.an-form-h { font-size: 12px; font-weight: 700; color: var(--navy); margin-bottom: 10px; }

html:has(body.capp-body), body.capp-body {
  height: auto;
  min-height: 100%;
  overflow: auto;
  background: #f3f4f6;
}
.capp {
  min-height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}
.capp-top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}
.capp-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.capp-top .brand-logo {
  display: block;
  height: 32px;
  width: auto;
  max-width: min(168px, 52vw);
  object-fit: contain;
}
.capp-user { font-size: 12px; color: #6b7280; display: flex; gap: 10px; align-items: center; }
.capp-user button { border: 0; background: none; color: var(--danger); font: 600 12px Inter, sans-serif; cursor: pointer; }
.capp-avatar {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  color: #fff;
  font: 700 12px Inter, sans-serif;
  letter-spacing: .02em;
  text-decoration: none;
}
.capp-avatar.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--navy); }
.capp-avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.capp-perfil-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  margin-bottom: 16px;
}
.capp-perfil-hero strong { font-size: 18px; color: var(--navy); }
.capp-perfil-hero em { font-style: normal; font-size: 12px; color: #6b7280; font-weight: 600; }
.capp-perfil-rows { display: flex; flex-direction: column; }
.capp-perfil-rows div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 13px;
}
.capp-perfil-rows div:last-child { border-bottom: 0; }
.capp-perfil-rows span { color: #6b7280; }
.capp-perfil-rows b { color: var(--navy); text-align: right; font-weight: 600; }
.capp-sair { width: 100%; margin-top: 8px; color: var(--danger) !important; }
.capp-sec-pend { border-color: #fdba74; background: #fff7ed; }
.capp-sec-pend h2 { color: #9a3412; }
.capp-pend-com { margin: 6px 0 0; font-size: 12px; color: #7c2d12; }
.capp-main { flex: 1; padding: 16px 16px 88px; }
.capp-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 560px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}
.capp-nav a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
}
.nav-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 22px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.capp-nav a.on { color: var(--navy); }
.capp-nav svg { width: 22px; height: 22px; }
.capp-head h1 { font-size: 22px; color: var(--navy); }
.capp-head p { font-size: 12px; color: #6b7280; margin: 4px 0 12px; }
.capp-search input { width: 100%; height: 42px; border-radius: 10px; margin-bottom: 14px; }
.capp-card {
  display: block;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.capp-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.capp-card strong { display: block; font-size: 16px; color: var(--navy); }
.capp-card-val { font-weight: 700; margin-top: 6px; color: var(--navy); }
.capp-card-sub { font-size: 12px; color: #6b7280; margin-top: 2px; }
.capp-pend {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 700;
}
.capp-pend em { font-style: normal; font-weight: 500; color: #c2410c; }
.capp-dash-alert {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
}
.capp-dash-alert b { font-size: 14px; }
.capp-dash-alert span { font-size: 12px; }
.capp-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.capp-kpi {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
}
.capp-kpi em { display: block; font-style: normal; font-size: 11px; color: #6b7280; font-weight: 600; }
.capp-kpi b { display: block; margin-top: 4px; font-size: 18px; color: var(--navy); }
.capp-kpi.warn { background: #fff7ed; border-color: #fdba74; }
.capp-kpi.warn b { color: #9a3412; }
.capp-etapas { display: flex; flex-direction: column; gap: 8px; }
.capp-etapa-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #374151;
}
.capp-etapa-row b { color: var(--navy); }
.capp-pend-item {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}
.capp-pend-item:last-child { border-bottom: 0; }
.capp-pend-item.done { opacity: .55; }
.capp-pend-item .link-navy { margin-top: 6px; font-size: 12px; }
.capp-pend-item strong { display: block; font-size: 14px; color: var(--navy); }
.capp-pend-item span { display: block; margin-top: 2px; font-size: 12px; color: #6b7280; }
.capp-pend-item em { display: block; margin-top: 2px; font-size: 11px; font-style: normal; font-weight: 600; color: #9a3412; }
.capp-pend-form { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.capp-pend-form textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  font-size: 13px;
}
.capp-pend-acoes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.capp-pend-acoes .btn { height: 34px; padding: 0 12px; font-size: 12px; }
.capp-pend-acoes .pend-file-btn { height: 34px; }
.capp-etapa {
  font-size: 11px;
  font-weight: 700;
  background: #eef2f6;
  color: var(--navy);
  padding: 3px 8px;
  border-radius: 999px;
}
.capp-back { font-size: 13px; font-weight: 600; color: var(--navy); display: inline-block; margin-bottom: 12px; }
.capp-hero { background: var(--navy); color: #fff; border-radius: 16px; padding: 18px; margin-bottom: 16px; }
.capp-hero h1 { font-size: 20px; margin: 6px 0; color: #fff; }
.capp-hero .capp-etapa { background: rgba(255,255,255,.16); color: #fff; }
.capp-hero b { display: block; margin-top: 10px; font-size: 18px; }
.capp-sec { background: #fff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.capp-sec h2 { font-size: 14px; color: var(--navy); margin-bottom: 10px; }
.capp-main .sim-page { max-width: none; }
.capp-main .sim-step { margin-bottom: 12px; }

.docs-tab { display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; flex: 1; }
.docs-arqs { display: flex; flex-direction: column; gap: 8px; }
.docs-arqs .doc-slot { border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; }
.docs-arqs .doc-slot.ok { border-color: #bbf7d0; }
.docs-ctx { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.docs-ctx label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: #6b7280; font-weight: 600; }
.docs-ctx select { height: 34px; min-width: 160px; }
.docs-check { flex-direction: row !important; align-items: center; gap: 6px !important; height: 34px; }
.docs-grupo { border: 1px solid #e5e7eb; border-radius: 10px; background: #fff; overflow: hidden; }
.docs-grupo-h {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--navy); padding: 8px 10px; background: #f8fafc; border-bottom: 1px solid #eef2f6;
}
.doc-slot { padding: 10px; border-bottom: 1px solid #eef2f6; }
.doc-slot:last-child { border-bottom: 0; }
.doc-slot.ok { background: #f0fdf4; }
.doc-slot-t { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.doc-slot-t b { font-size: 12px; color: #1f2937; }
.doc-slot-t span { font-size: 11px; color: #6b7280; text-align: right; }
.doc-slot input[type="text"], .doc-slot > input:not([type="file"]):not([type="checkbox"]) {
  width: 100%; height: 34px; margin-bottom: 6px;
}
.doc-slot-a { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.doc-up { position: relative; overflow: hidden; margin: 0; cursor: pointer; }
.doc-up input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.docs-view { display: flex; flex-direction: column; gap: 12px; }
.docs-view-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.docs-view-h span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--navy);
}
.docs-form { display: flex; flex-direction: column; gap: 12px; }
.docs-form-sec {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  padding: 14px;
}
.docs-form-sec h3 { font-size: 13px; color: var(--navy); margin: 0 0 12px; }
.docs-form .grid-form { margin-bottom: 0; }
.docs-form .grid-form label { margin-bottom: 0; }
.docs-banco { margin-top: 12px; }
.docs-banco > span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 8px;
}
.docs-banco-g { grid-template-columns: 1.3fr .8fr 1fr .9fr; }
@media (max-width: 720px) {
  .docs-banco-g { grid-template-columns: 1fr 1fr; }
}
.logo-edit { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.logo-preview {
  width: 148px;
  height: 76px;
  border: 1px dashed #d1d5db;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #f8fafc;
  overflow: hidden;
  padding: 8px;
}
.logo-preview img { max-width: 100%; max-height: 60px; object-fit: contain; }
.logo-preview span { font-size: 11px; color: #9ca3af; }
.logo-edit-a { display: flex; gap: 10px; align-items: center; }
.token-box {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #c4a574;
  border-radius: 10px;
  background: #fffbeb;
}
.token-box label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 8px; color: #92400e; }
.token-row { display: flex; gap: 8px; align-items: center; }
.token-row input {
  flex: 1;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.modal-bg.sim-view-bg { z-index: 50; padding: 16px; }
.modal.sim-view {
  max-width: 980px;
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sim-view-hero {
  flex-shrink: 0;
  background: linear-gradient(135deg, #1d3557 0%, #2d4a73 100%);
  color: #fff;
  padding: 16px 20px 18px;
}
.sim-view-hero-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.sim-view-logo-wrap {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 6px;
  padding: 3px 7px;
  height: 30px;
}
.sim-view-logo {
  display: block;
  max-height: 22px;
  max-width: 110px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.sim-view-brand {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.4px;
}
.sim-view-ttl {
  font-size: 11px;
  color: rgba(255,255,255,.7);
}
.sim-view-hero-acoes {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sim-view-hero-acoes .link-navy { color: #fff; font-size: 12px; }
.sim-view-x {
  border: 0;
  background: none;
  color: rgba(255,255,255,.8);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.sim-view-hero h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.sim-view-hero p {
  margin: 6px 0 0;
  font-size: 12px;
  color: rgba(255,255,255,.72);
}
.sim-view-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px 20px 20px;
  background: #f6f7f9;
}
.sim-view-body .sim-cards { margin-bottom: 4px; }
.sim-view-tab {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: auto;
  max-height: min(52vh, 560px);
  background: #fff;
}
.sim-view-tab table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.sim-view-tab th,
.sim-view-tab td {
  padding: 6px 8px;
  white-space: nowrap;
}
.sim-view-tab th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #1d3557;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.sim-view-tab tbody tr:nth-child(even) { background: #f6f7f9; }
.sim-view-tab .num { text-align: center; width: 44px; }
.sim-view-tab .val { text-align: right; }
.sim-view-foot {
  margin-top: 12px;
  font-size: 11px;
  color: #6b7280;
}
