/* CRM Thaís Murasawa — identidade neutra: azul-marinho da marca, linha bronze, papel frio */
:root {
  --navy: #1C2B4E;
  --navy-2: #26375F;
  --navy-3: #33466F;
  --bronze: #A88458;
  --bronze-l: #C9A979;
  --paper: #F3F5F8;
  --surface: #FFFFFF;
  --ink: #1A2130;
  --ink-2: #333C4D;
  --muted: #5E6878;
  --line: #DCE1E8;
  --line-2: #EBEEF2;
  --ok: #2F7D5B;   --ok-bg: #E6F2EC;
  --warn: #8F6219; --warn-bg: #F7EFDF;
  --bad: #B2453B;  --bad-bg: #F8E8E6;
  --font: "Public Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --r-sm: 6px;
  --r-md: 10px;
  --side: 236px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 14px/1.5 var(--font); color: var(--ink); background: var(--paper); }
a { color: var(--navy-3); text-underline-offset: 2px; }
a:hover { color: var(--navy); }
h1, h2, h3 { margin: 0; line-height: 1.25; color: var(--ink); }
h1 { font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 600; }
h2 small, h1 small { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 4px; }
code { background: var(--line-2); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
:focus-visible { outline: 2px solid var(--bronze); outline-offset: 2px; }
.sr, .print-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 50; border-radius: var(--r-sm); }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.block { display: block; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pos { color: var(--ok); }
.neg { color: var(--bad); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- estrutura */
.app { display: flex; min-height: 100vh; }
.side {
  width: var(--side); flex: 0 0 var(--side); background: var(--navy); color: #D5DBE6;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 22px 20px 18px; }
.mono {
  width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto;
  border: 1.5px solid var(--bronze-l); border-radius: 9px 2px 9px 2px;
  color: var(--bronze-l); font-weight: 600; font-size: 13px; letter-spacing: .04em;
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.2; }
.brand-txt strong { color: #fff; font-weight: 600; font-size: 15px; }
.brand-txt small { color: var(--bronze-l); font-size: 12px; }
.nav { display: flex; flex-direction: column; padding: 4px 12px 16px; gap: 1px; }
.nav a {
  color: #C9D1DE; text-decoration: none; padding: 7px 10px 7px 12px; border-radius: var(--r-sm);
  border-left: 2px solid transparent; font-size: 14px;
}
.nav a:hover { background: var(--navy-2); color: #fff; }
.nav a[aria-current="page"] { background: var(--navy-2); color: #fff; border-left-color: var(--bronze-l); font-weight: 500; }
.nav-g { margin: 16px 12px 4px; font-size: 12px; color: #8D99AF; }
.side-foot { margin-top: auto; padding: 14px 20px; border-top: 1px solid var(--navy-3); display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.side-foot a { color: var(--bronze-l); }
.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.main { padding: 28px 36px 64px; max-width: 1320px; width: 100%; }

/* ---------- cabeçalho de página: a linha bronze em canto, eco do quadro da marca */
.page-h {
  position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px;
  flex-wrap: wrap; margin-bottom: 22px; padding: 14px 0 0 18px;
}
.page-h::before {
  content: ""; position: absolute; left: 0; top: 0; width: 34px; height: 34px;
  border-left: 1.5px solid var(--bronze); border-top: 1.5px solid var(--bronze); border-top-left-radius: 12px;
}
.page-h .sub { margin: 4px 0 0; color: var(--muted); }
.crumb { margin: 0 0 4px; font-size: 13px; }
.crumb a { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 500 14px/1 var(--font); padding: 10px 16px; border-radius: var(--r-sm);
  border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); color: #fff; }
.btn.ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.btn.ghost:hover { border-color: #B9C1CD; color: var(--ink); }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--navy-3); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link.danger, .danger { color: var(--bad); }
.icon-btn { width: 28px; height: 28px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink-2); font-size: 15px; line-height: 1; }
.icon-btn:disabled { opacity: .35; cursor: default; }

/* ---------- avisos */
.flash { padding: 11px 14px; border-radius: var(--r-sm); margin-bottom: 16px; border: 1px solid; }
.flash.ok { background: var(--ok-bg); border-color: #BFDCCD; color: #1F5A40; }
.flash.bad { background: var(--bad-bg); border-color: #EBC6C2; color: #8A2F27; }
.flash.warn { background: var(--warn-bg); border-color: #E8D5AE; color: #6E4A10; }

/* ---------- painéis */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 20px; margin: 0 0 18px; min-width: 0; }
fieldset.panel { padding-top: 6px; }
legend { font-weight: 600; font-size: 15px; padding: 0 6px; margin-left: -6px; }
.panel-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.hint { color: var(--muted); margin: 6px 0 12px; font-size: 13px; max-width: 72ch; }
.note { background: var(--paper); border-radius: var(--r-sm); padding: 10px 12px; margin-top: 12px; color: var(--ink-2); }
.empty { text-align: center; padding: 48px 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r-md); }
.empty p { margin: 0 0 14px; color: var(--muted); }
.empty-sm { color: var(--muted); margin: 4px 0; }

/* ---------- indicadores */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink); }
a.kpi:hover { border-color: #B9C1CD; }
.kpi span { color: var(--muted); font-size: 13px; }
.kpi strong { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: 12px; }
.kpi.is-bad strong { color: var(--bad); }

/* ---------- formulários */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.w1 { grid-column: span 1; } .w2 { grid-column: span 2; } .w3 { grid-column: span 3; } .w4 { grid-column: 1 / -1; }
label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.req { color: var(--bad); }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  font: 400 14px/1.4 var(--font); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px; width: 100%; min-width: 0;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-3); box-shadow: 0 0 0 3px rgba(51,70,111,.14); }
[aria-invalid="true"] { border-color: var(--bad) !important; }
.err { margin: 0; color: var(--bad); font-size: 12px; }
.help { margin: 0; color: var(--muted); font-size: 12px; }
input.is-calc { background: var(--paper); font-weight: 600; color: var(--ink); }
.affix { display: flex; align-items: stretch; }
.affix span { display: grid; place-items: center; padding: 0 10px; background: var(--paper); border: 1px solid var(--line); border-right: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); color: var(--muted); font-size: 13px; }
.affix input { border-radius: 0 var(--r-sm) var(--r-sm) 0; text-align: right; font-variant-numeric: tabular-nums; }
.affix-r span { border: 1px solid var(--line); border-left: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.affix-r input { border-radius: var(--r-sm) 0 0 var(--r-sm); }
input[type=color] { width: 40px; height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 38px; height: 22px; border-radius: 11px; background: var(--line); position: relative; transition: background .15s; flex: 0 0 auto; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--navy); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--bronze); outline-offset: 2px; }
.form-actions { display: flex; gap: 8px; margin-top: 4px; position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(to top, var(--paper) 70%, transparent); }
.danger-zone { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
[data-dep].is-hidden { display: none; }
.fk-wrap { display: flex; gap: 6px; }
.fk-wrap select { flex: 1; min-width: 0; }
.fk-add { padding: 0 12px; flex: 0 0 auto; }
.qdlg { border: 0; border-radius: var(--r-md); padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(16,24,40,.25); color: var(--ink); }
.qdlg::backdrop { background: rgba(20,30,55,.45); }
.qdlg form { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.qdlg-h { display: flex; justify-content: space-between; align-items: center; }
.qdlg-h h2 { font-size: 18px; }
.qdlg .flash { margin: 0; }
.qdlg .hint { margin: 0; }
.qdlg-a { display: flex; gap: 8px; }

/* ---------- barra de filtros */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.toolbar input[type=search] { flex: 1 1 240px; max-width: 380px; }
.toolbar select { width: auto; max-width: 220px; }
.toolbar input[type=date] { width: auto; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; color: var(--muted); }
.quick, .seg { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.quick a { font-size: 13px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--ink-2); background: var(--surface); }
.quick a[aria-current] { background: var(--navy); border-color: var(--navy); color: #fff; }
.seg { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; background: var(--surface); gap: 2px; }
.seg a { padding: 6px 12px; border-radius: 4px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 13px; }
.seg a[aria-current] { background: var(--navy); color: #fff; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--bronze); font-weight: 500; }

/* ---------- tabelas */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.panel .table-wrap { border: 0; border-radius: 0; margin: 0 -20px -18px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table thead th { font-size: 12px; font-weight: 600; color: var(--muted); background: #FAFBFC; border-bottom-color: var(--line); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FAFBFD; }
.table tfoot td { font-weight: 600; border-top: 1px solid var(--line); background: #FAFBFC; }
.table .num { text-align: right; }
.table td.act { text-align: right; white-space: nowrap; }
.table td.act > * { margin-left: 12px; display: inline; }
.table td.act form { display: inline; }
.row-link { color: var(--ink); font-weight: 500; text-decoration: none; }
.row-link:hover { text-decoration: underline; color: var(--navy); }
.table tr.group th { background: var(--paper); font-size: 13px; font-weight: 500; color: var(--ink-2); }
.table select { width: auto; padding: 5px 8px; font-size: 13px; }
.wa { color: #1F8A55; display: inline-flex; vertical-align: -2px; margin-left: 4px; }
.wa:hover { color: #156B41; }
.pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin-top: 16px; color: var(--muted); }

/* ---------- selos */
.badge { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; text-decoration: none; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.navy { background: #E4E9F2; color: var(--navy); }
.stage { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.stage::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 4px; background: var(--line-2); color: var(--ink-2); }
.tag-venda { background: #E4E9F2; color: var(--navy); }
.tag-compra { background: #F3ECE1; color: #7A5A30; }
.tag-aluguel { background: #E7F0EE; color: #2B6457; }

/* ---------- fichas */
.dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.dl dt { font-size: 12px; color: var(--muted); }
.dl dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.dl dd.strong { font-weight: 600; font-size: 16px; }
.chips { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--ink-2); }

/* avaliação: três cenários e a faixa de preço */
.aval-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.aval-cards div { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.aval-cards span { font-size: 12px; color: var(--muted); }
.aval-cards strong { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.aval-cards .mid { border-color: var(--bronze); background: #FBF8F3; }
.range { position: relative; height: 54px; margin: 18px 4px 4px; }
.range::before { content: ""; position: absolute; left: 0; right: 0; top: 14px; height: 4px; background: var(--line-2); border-radius: 2px; }
.range-bar { position: absolute; top: 14px; height: 4px; background: var(--bronze); border-radius: 2px; }
.tick { position: absolute; top: 9px; width: 2px; height: 14px; background: var(--bronze); transform: translateX(-1px); }
.tick.t-medio { width: 12px; height: 12px; top: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--bronze); transform: translateX(-6px); }
.pin { position: absolute; top: 4px; transform: translateX(-1px); width: 2px; height: 24px; background: var(--navy); }
.pin em { position: absolute; top: 28px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 12px; white-space: nowrap; color: var(--navy); font-weight: 500; }

/* arquivos */
.gallery { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gallery li { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-sm); overflow: hidden; background: var(--line-2); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery form { position: absolute; top: 6px; right: 6px; }
.gallery .icon-btn { background: rgba(255,255,255,.92); border-color: transparent; }
.filelist { list-style: none; padding: 0; margin: 0 0 14px; }
.filelist li { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.filelist li a { font-weight: 500; overflow-wrap: anywhere; }
.filelist form { margin-left: auto; }
.dropzone label {
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; cursor: pointer;
  padding: 18px; border: 1.5px dashed var(--line); border-radius: var(--r-sm); font-weight: 400; color: var(--ink-2);
}
.dropzone label strong { color: var(--navy-3); }
.dropzone label .muted { font-size: 12px; }
.dropzone input[type=file] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dropzone.is-over label, .dropzone label:hover { border-color: var(--navy-3); background: #F7F9FC; }
.dropzone.is-busy label { opacity: .6; pointer-events: none; }
.dropzone input:focus-visible + strong { outline: 2px solid var(--bronze); outline-offset: 2px; }

/* ---------- kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kcol { background: #E9EDF2; border-radius: var(--r-md); border-top: 3px solid var(--c); min-height: 220px; display: flex; flex-direction: column; }
.kcol > header { padding: 12px 14px 8px; }
.kcol h2 { font-size: 14px; display: flex; justify-content: space-between; align-items: baseline; }
.kcol header p { margin: 2px 0 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.kcards { padding: 4px 8px 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 80px; }
.kcards.is-over { background: rgba(28,43,78,.05); border-radius: 0 0 var(--r-md) var(--r-md); }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; cursor: grab; }
.kcard:hover { border-color: #B9C1CD; }
.kcard.is-dragging { opacity: .5; }
.kcard-t { font-weight: 600; color: var(--ink); text-decoration: none; display: block; line-height: 1.3; }
.kcard-t:hover { text-decoration: underline; }
.kcard-who { margin: 2px 0 8px; color: var(--muted); font-size: 13px; }
.kcard-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.kcard-v { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; border-top: 1px solid var(--line-2); padding-top: 8px; }
.kcard-v dt { font-size: 11px; color: var(--muted); }
.kcard-v dd { margin: 0; font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.kcard-move { display: none; margin-top: 8px; padding: 5px 8px; font-size: 13px; }
.kadd { text-align: center; font-size: 13px; color: var(--muted); padding: 8px; border-radius: var(--r-sm); text-decoration: none; border: 1px dashed transparent; }
.kadd:hover { border-color: #C3CAD5; color: var(--ink-2); }

/* resumo do funil */
.funnel-sum { display: flex; flex-direction: column; gap: 6px; }
.panel.funnel-sum { gap: 10px; }
.fs-row { display: grid; grid-template-columns: 136px 1fr auto auto; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); padding: 4px 0; }
.fs-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-bar { height: 10px; background: var(--line-2); border-radius: 5px; overflow: hidden; }
.fs-bar i { display: block; height: 100%; background: var(--c); border-radius: 5px; }
.fs-n { color: var(--muted); font-size: 13px; white-space: nowrap; }
.fs-v { font-variant-numeric: tabular-nums; font-size: 13px; min-width: 100px; text-align: right; }

/* listas curtas do painel */
.mini { list-style: none; padding: 0; margin: 0; }
.mini li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.mini li:last-child { border-bottom: 0; }
.mini li > a { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); text-decoration: none; }
.mini li > a:hover { text-decoration: underline; }
.split { display: flex; gap: 24px; margin: 0 0 8px; color: var(--muted); flex-wrap: wrap; }
.split strong { margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ---------- fluxo de caixa */
.cash { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 18px; overflow: hidden; }
.cash-row { padding: 14px 14px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line-2); }
.cash-row:last-child { border-right: 0; }
.cash-row span { font-size: 12px; color: var(--muted); }
.cash-row strong { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cash-row.in strong { color: var(--ok); }
.cash-row.out strong { color: var(--bad); }
.cash-row.soft strong { opacity: .75; }
.cash-row.total { background: #FAFBFC; }
.cash-row.proj { background: var(--navy); }
.cash-row.proj span { color: #B9C3D6; }
.cash-row.proj strong { color: #fff; }
.cash-row.proj strong.neg { color: #F2B8B1; }
.legend { margin: 0; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.lg { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-left: 8px; }
.lg.in { background: var(--ok); } .lg.out { background: var(--bad); } .lg.soft { background: #C9CFD8; }
.barcell { width: 32%; min-width: 160px; }
.bar { display: flex; height: 7px; margin: 3px 0; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.bar i { display: block; height: 100%; }
.bar.in i { background: var(--ok); } .bar.out i { background: var(--bad); }
.bar i.soft { opacity: .35; }

/* ---------- etapas */
.stages { list-style: none; margin: 0; padding: 0; }
.stages li { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; border-left: 3px solid var(--c); padding-left: 12px; margin-bottom: 4px; }
.st-order { display: flex; gap: 4px; }
.st-form { display: flex; align-items: center; gap: 8px; flex: 1 1 460px; flex-wrap: wrap; }
.st-form input[type=text] { flex: 1 1 160px; width: auto; }
.st-form select { width: auto; }
.st-del { display: flex; gap: 8px; align-items: center; }
.st-del select { width: auto; font-size: 13px; padding: 6px 8px; }
.st-new { flex: none; }

/* ---------- login */
.login-body { background: var(--navy); min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: 100%; max-width: 420px; }
.login-frame { position: relative; padding: 28px; }
.login-frame::before, .login-frame::after { content: ""; position: absolute; width: 72px; height: 72px; border: 1.5px solid var(--bronze-l); }
.login-frame::before { left: 0; top: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 22px; }
.login-frame::after { right: 0; bottom: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 22px; }
.brand-lg { padding: 0 0 20px; }
.login-card { background: var(--surface); border-radius: var(--r-md); padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { font-size: 20px; }
.login-card p { margin: 0; color: var(--ink-2); }
.login-card .flash { margin: 0; }

/* ---------- responsivo */
@media (max-width: 1100px) {
  .cash { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cash-row:nth-child(4) { border-right: 0; }
  .cash-row { border-bottom: 1px solid var(--line-2); }
}
@media (max-width: 900px) {
  .side { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .side.is-open { transform: none; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 30; }
  .menu-btn { background: none; border: 1px solid var(--navy-3); color: #fff; padding: 6px 12px; border-radius: var(--r-sm); font: 500 14px var(--font); cursor: pointer; }
  .topbar-brand { font-weight: 600; }
  .main { padding: 20px 16px 48px; }
  .cols { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .w3, .w4 { grid-column: 1 / -1; }
  .kanban { grid-auto-columns: 82%; scroll-snap-type: x mandatory; }
  .kcol { scroll-snap-align: start; }
  .kcard-move { display: block; width: 100%; }
}
@media (max-width: 560px) {
  h1 { font-size: 22px; }
  .grid { grid-template-columns: 1fr; }
  .w1, .w2 { grid-column: 1 / -1; }
  .dl { grid-template-columns: 1fr; }
  .aval-cards { grid-template-columns: 1fr; }
  .cash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cash-row { border-right: 0; }
  .cash-row.proj { grid-column: 1 / -1; }
  .fs-row { grid-template-columns: 80px 1fr auto; }
  .fs-v { display: none; }
  .mini li { grid-template-columns: minmax(0, 1fr) auto; }
  .mini li > :nth-child(2) { display: none; }
  .toolbar select, .toolbar input[type=search] { max-width: none; flex: 1 1 100%; }
}

/* ---------- impressão */
@media print {
  body { background: #fff; font-size: 11px; }
  .side, .topbar, .no-print, .toolbar, .actions, .flash, .form-actions, .danger-zone, .dropzone { display: none !important; }
  .main { padding: 0; max-width: none; }
  .table-wrap, .panel { border: 0; overflow: visible; }
  .table th, .table td { padding: 5px 6px; }
  .print-only { position: static !important; width: auto; height: auto; clip: auto; }
  a { color: inherit; text-decoration: none; }
  .wa { display: none; }
}
