/* =========================================================
   CRM Good Marketing — identidade: preto, amarelo #FECF35, laranja #FFA01C
   ========================================================= */
:root {
  color-scheme: light;
  --ink: #0b0b0b;
  --ink-2: #3d3b37;
  --muted: #7d7a72;
  --bg: #f5f4ef;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --line: #e8e6df;
  --line-2: #f0eee8;
  --yellow: #fecf35;
  --yellow-soft: #fff6d6;
  --yellow-deep: #b88a00;
  --orange: #ffa01c;
  --black: #000000;
  --on-accent: #000000;      /* texto sobre a cor de destaque */
  --accent-on-dark: #fecf35; /* destaque sobre fundo preto */
  --good: #137a3a;   --good-bg: #e6f4ea;
  --warn: #9a5b00;   --warn-bg: #fff1db;
  --bad: #c0281f;    --bad-bg: #fdeceb;
  --info: #3d3b37;   --info-bg: #f0eee8;
  /* séries dos gráficos — paleta validada (CVD), ordem fixa */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --radius: 12px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
.hidden { display: none !important; }
a { color: inherit; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.02em; font-weight: 800; }
h2 { font-size: 14.5px; margin: 0 0 12px; font-weight: 700; letter-spacing: -.01em; }
small { color: var(--muted); }
.num, td.r, .kpi .v { font-variant-numeric: tabular-nums; }
.ico { flex: none; display: inline-block; vertical-align: -3px; }
::selection { background: var(--yellow); color: var(--black); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--black); }
.login-art { padding: 56px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; position: relative; overflow: hidden; }
.login-art::after { content: ""; position: absolute; width: 360px; height: 360px; border-radius: 50%; border: 56px solid var(--yellow); right: -230px; top: 50%; transform: translateY(-50%); }
.login-art > * { position: relative; z-index: 1; }
.login-claim { font-size: 34px; font-weight: 800; line-height: 1.12; letter-spacing: -.03em; max-width: 480px; margin: 0; position: relative; z-index: 1; }
.brand-lg { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 12px; }
.login-card { align-self: center; justify-self: center; width: min(380px, 90vw); background: var(--surface); border-radius: 16px; padding: 32px; display: grid; gap: 16px; }
.login-card h1 { font-size: 20px; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: var(--yellow); color: var(--on-accent); display: grid; place-items: center; font-weight: 800; flex: none; font-size: 17px; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--black); color: #b9b7b0; display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 11px; align-items: center; padding: 0 8px 22px; color: #fff; }
.brand strong { font-weight: 800; letter-spacing: -.01em; }
.brand small { display: block; color: #8d8a82; font-size: 12px; margin-top: 1px; }
.ws-switch { margin: 0 6px 14px; width: calc(100% - 12px); background: #141414; color: #fff; border: 1px solid #2a2a2a; }
nav { display: grid; gap: 2px; }
nav a { color: #b9b7b0; padding: 10px 12px; border-radius: 9px; display: flex; gap: 12px; align-items: center; font-size: 13.5px; font-weight: 600; text-decoration: none; position: relative; }
nav a:hover { background: #161616; color: #fff; }
nav a.active { background: #1a1a1a; color: #fff; }
nav a.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--yellow); }
nav a.active .ico { color: var(--accent-on-dark); }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 6px 0; border-top: 1px solid #1f1f1f; color: #fff; }
.me-info { flex: 1; min-width: 0; }
.me-info strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { display: block; color: #8d8a82; font-size: 11.5px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #262626; color: var(--accent-on-dark); display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }
.icon-btn { background: none; border: 0; color: #8d8a82; cursor: pointer; padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.icon-btn:hover { color: #fff; background: #1a1a1a; }
.view { padding: 26px 30px 40px; min-width: 0; }

/* ---------- Menu recolhido ---------- */
.app { transition: grid-template-columns .2s ease; }
.brand-txt { flex: 1; min-width: 0; }
.brand-txt strong, .brand-txt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.collapse-btn { margin-left: auto; }
.app.collapsed { grid-template-columns: 72px 1fr; }
.app.collapsed .sidebar { padding: 20px 12px; align-items: center; }
.app.collapsed .brand { flex-direction: column; padding: 0 0 18px; gap: 12px; }
.app.collapsed .collapse-btn { margin: 0; }
.app.collapsed .brand-txt, .app.collapsed .ws-switch, .app.collapsed .me-info { display: none; }
.app.collapsed nav { width: 100%; }
.app.collapsed nav a { font-size: 0; justify-content: center; padding: 11px 0; gap: 0; }
.app.collapsed nav a.active::before { left: -12px; }
.app.collapsed nav a[data-view=empresas]::after { left: 6px; right: 6px; }
.app.collapsed .me { flex-direction: column; gap: 8px; padding: 14px 0 0; width: 100%; }
.main { min-width: 0; }
.ctx-bar { background: var(--yellow); color: var(--on-accent); padding: 9px 30px; font-size: 13px; display: flex; gap: 14px; align-items: center; position: sticky; top: 0; z-index: 5; }
.ctx-bar a { font-weight: 800; text-decoration: underline; text-underline-offset: 3px; margin-left: auto; }
nav a[data-view=empresas] { margin-bottom: 10px; }
nav a[data-view=empresas]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -6px; height: 1px; background: #222; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sp { flex: 1; }
.sub { color: var(--muted); margin-top: 4px; font-size: 13px; }

/* ---------- Controles ---------- */
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; width: 100%; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: #d6d3ca; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--yellow-soft); }
textarea { resize: vertical; min-height: 70px; }
label { display: grid; gap: 5px; font-size: 12px; color: var(--ink-2); font-weight: 600; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: auto; accent-color: var(--black); }
input[type=checkbox] { accent-color: var(--black); }
.btn { font: inherit; font-weight: 700; font-size: 13px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 9px; padding: 8px 14px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; transition: background .15s, border-color .15s; }
.btn:hover { border-color: #cfccc2; background: var(--surface-2); }
.btn.primary { background: var(--yellow); border-color: var(--yellow); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.dark { background: var(--black); border-color: var(--black); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); border-color: #f4c7c3; }
.btn.ghost { background: transparent; border-color: transparent; color: inherit; }
.btn.ghost:hover { background: var(--line-2); }
.btn.sm { padding: 5px 9px; font-size: 12px; }
.btn.block { width: 100%; justify-content: center; padding: 11px; }
.btn:disabled { opacity: .5; cursor: default; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { width: auto; min-width: 0; max-width: 200px; }
.form-error { color: var(--bad); font-size: 13px; font-weight: 600; }
.form-error:empty { display: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.span2 { grid-column: span 2; }

/* ---------- Painéis ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.panel-head small { font-size: 12px; }
.cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); margin-bottom: 16px; }
.cols.split { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); }
@media (max-width: 1200px) { .cols.split { grid-template-columns: 1fr; } }
.empty { color: var(--muted); padding: 18px 0; text-align: center; font-size: 13px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; line-height: 1.2; }
.badge .ico { vertical-align: 0; }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--yellow-soft); color: #6b5100; }
.badge.dark { background: var(--black); color: var(--yellow); }
.temp { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.temp::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.temp-quente { color: #d2401a; }
.temp-morna { color: #c07a00; }
.temp-fria { color: #6b8aa8; }

/* ---------- Kanban ---------- */
.board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; min-height: calc(100vh - 160px); }
.col { flex: 0 0 286px; background: #ecebe5; border-radius: 14px; display: flex; flex-direction: column; max-height: calc(100vh - 160px); }
.col-head { padding: 13px 14px 10px; }
.col-head .t { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 13px; gap: 8px; }
.col-head .t span:first-child { display: flex; align-items: center; gap: 8px; }
.col-head .dot { width: 9px; height: 9px; border-radius: 3px; background: var(--c, #999); }
.col-head .count { background: var(--surface); border-radius: 6px; padding: 1px 7px; font-size: 11.5px; color: var(--ink-2); font-weight: 700; }
.col-head .sum { font-size: 12px; color: var(--muted); margin-top: 3px; font-weight: 600; font-variant-numeric: tabular-nums; }
.col-body { padding: 2px 8px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 90px; flex: 1; border-radius: 0 0 14px 14px; transition: background .15s; }
.col.drop { outline: 2px dashed var(--ink); outline-offset: -2px; }
.col.drop .col-body { background: var(--yellow-soft); }
.card { background: var(--surface); border: 1px solid transparent; border-radius: 10px; padding: 11px 12px; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.06); display: grid; gap: 7px; position: relative; transition: box-shadow .15s, transform .15s; }
.card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.card.dragging { opacity: .35; }
.card.alert { box-shadow: inset 3px 0 0 var(--bad), 0 1px 2px rgba(0,0,0,.06); }
.card.warnb { box-shadow: inset 3px 0 0 var(--orange), 0 1px 2px rgba(0,0,0,.06); }
.card .co { font-weight: 700; line-height: 1.3; font-size: 13.5px; }
.card .meta { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.card .row { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.card .val { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 14px; letter-spacing: -.01em; }
.card .val small { font-weight: 600; font-size: 11px; }
.card .flags { display: flex; gap: 4px; flex-wrap: wrap; }
.card .next { font-size: 12px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 7px; padding: 5px 7px; display: flex; gap: 6px; align-items: flex-start; }
.card .foot { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line-2); padding-top: 7px; }
.card .owner { display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; }
.mini-av { width: 20px; height: 20px; border-radius: 50%; background: var(--black); color: var(--yellow); display: grid; place-items: center; font-size: 9px; font-weight: 800; }
.score { font-size: 11px; font-weight: 800; color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.score .bar { width: 36px; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; display: inline-block; }
.score .bar span { display: block; height: 100%; background: var(--ink); border-radius: 2px; }
.score.hi .bar span { background: var(--yellow-deep); }
.add-card { color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; padding: 8px; text-align: center; border: 1px dashed #cdcac0; border-radius: 9px; cursor: pointer; background: transparent; display: flex; gap: 6px; justify-content: center; align-items: center; }
.add-card:hover { color: var(--ink); border-color: var(--ink); background: var(--surface); }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 700; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 0 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
th.r, td.r { text-align: right; }
td.strong { font-weight: 700; }
tfoot td { border-top: 1px solid var(--line); border-bottom: 0; font-weight: 800; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--surface-2); }
.cell-bar { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.cell-bar .b { width: 56px; height: 5px; background: var(--line-2); border-radius: 3px; overflow: hidden; }
.cell-bar .b span { display: block; height: 100%; background: var(--ink); border-radius: 3px; }
.delta { font-weight: 800; font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 3px; }
.delta.pos { color: var(--good); }
.delta.neg { color: var(--bad); }
.lead-name strong { display: block; font-weight: 700; }
.lead-name small { font-size: 12px; }

/* ---------- Listas da central ---------- */
.list { display: grid; }
.item { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 8px; margin: 0 -8px; border-radius: 8px; cursor: pointer; }
.item + .item { border-top: 1px solid var(--line-2); }
.item:hover { background: var(--surface-2); }
.item .l { min-width: 0; }
.item .l strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; font-size: 13px; }
.item .l small { display: block; font-size: 12px; margin-top: 1px; }
.item .r { text-align: right; flex: none; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.item .r small { font-weight: 500; }
.q-title { display: flex; align-items: center; gap: 10px; }
.q-title .n { background: var(--black); color: var(--yellow); border-radius: 7px; min-width: 24px; height: 24px; padding: 0 6px; display: grid; place-items: center; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.q-title .n.zero { background: var(--line-2); color: var(--muted); }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi .lbl { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.kpi .v { font-size: 28px; font-weight: 800; margin: 8px 0 4px; letter-spacing: -.035em; white-space: nowrap; line-height: 1; }
.kpi .v small { font-size: 13px; font-weight: 600; margin-left: 2px; letter-spacing: 0; color: var(--muted); }
.kpi > small { font-size: 12px; display: block; line-height: 1.4; }
.kpi.hero { background: var(--black); border-color: var(--black); color: #fff; }
.kpi.hero .lbl, .kpi.hero > small, .kpi.hero .v small { color: #a9a69e; }
.kpi.hero .v { color: var(--accent-on-dark); }

/* ---------- Gráficos ---------- */
.funnel { display: grid; gap: 6px; }
.funnel-row { display: grid; grid-template-columns: 150px 1fr 92px; gap: 12px; align-items: center; font-size: 12.5px; }
.funnel-row .nm { font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.funnel-row .track { height: 26px; background: var(--surface-2); border-radius: 4px; position: relative; }
.funnel-row .fill { height: 100%; background: var(--yellow); border-radius: 0 4px 4px 0; min-width: 3px; }
.funnel-row.last .fill { background: var(--black); }
.funnel-row .vv { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.funnel-row .vv small { font-weight: 600; margin-left: 4px; }
.funnel-step { font-size: 10.5px; color: var(--muted); font-weight: 600; padding-left: 2px; line-height: 1; }
.funnel-row:has(.funnel-step) { margin: -1px 0; }
.hbars { display: grid; gap: 12px; }
.hbar .top { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; font-weight: 600; color: var(--ink-2); gap: 10px; }
.hbar .top span:last-child { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar .track { height: 8px; background: var(--line-2); border-radius: 4px; }
.hbar .fill { height: 100%; background: var(--ink); border-radius: 0 4px 4px 0; min-width: 2px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .grid line.base { stroke: #cfccc2; }
.chart text { font-family: var(--font); font-size: 11px; fill: var(--muted); font-weight: 600; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover { fill: rgba(0,0,0,.035); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink-2); margin-bottom: 10px; flex-wrap: wrap; font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tip { position: fixed; pointer-events: none; background: var(--black); color: #fff; font-size: 12px; padding: 8px 10px; border-radius: 8px; z-index: 100; white-space: nowrap; line-height: 1.5; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.tip b { color: var(--yellow); }
.tip .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
details.data-table { margin-top: 12px; }
details.data-table summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--muted); }
details.data-table table { margin-top: 8px; }

/* ---------- Modal / ficha ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); display: flex; justify-content: flex-end; z-index: 50; animation: fade .15s; }
.overlay.center { justify-content: center; align-items: center; }
@keyframes fade { from { opacity: 0; } }
.drawer { background: var(--bg); width: min(1020px, 100%); height: 100%; overflow-y: auto; display: flex; flex-direction: column; }
.dialog { background: var(--surface); width: min(560px, 94vw); max-height: 92vh; overflow-y: auto; border-radius: 16px; padding: 24px; display: grid; gap: 16px; }
.dialog h2 { font-size: 17px; margin: 0; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; }
.drawer-head { background: var(--surface); padding: 20px 24px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; position: sticky; top: 0; z-index: 2; }
.drawer-head .t { flex: 1; min-width: 0; }
.drawer-head .sub strong { color: var(--ink); }
.drawer-body { padding: 18px 24px; display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: start; }
.stage-path { display: flex; gap: 3px; margin-top: 14px; flex-wrap: wrap; }
.stage-path button { border: 0; font: inherit; font-size: 11.5px; font-weight: 700; padding: 7px 12px 7px 16px; background: var(--line-2); color: var(--muted); cursor: pointer; clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%); }
.stage-path button:first-child { clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%); padding-left: 12px; border-radius: 6px 0 0 6px; }
.stage-path button:hover { background: #e3e1d9; color: var(--ink); }
.stage-path button.done { background: var(--yellow-soft); color: #6b5100; }
.stage-path button.cur { background: var(--yellow); color: var(--on-accent); }
.stage-path button.won { background: var(--good); color: #fff; }
.stage-path button.lost { background: var(--bad); color: #fff; }
.timeline { display: grid; }
.ev { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 10px 0; position: relative; }
.ev:not(:last-child)::before { content: ""; position: absolute; left: 14px; top: 38px; bottom: -4px; width: 1px; background: var(--line); }
.ev .ic { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-2); }
.ev .ic.won { background: var(--good-bg); color: var(--good); border-color: transparent; }
.ev .ic.lost { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.ev .ic.stage { background: var(--yellow-soft); color: #6b5100; border-color: transparent; }
.ev .c { font-size: 13px; white-space: pre-wrap; word-break: break-word; padding-top: 5px; }
.ev small { display: block; margin-top: 2px; font-size: 11.5px; }
.tabs { display: inline-flex; gap: 2px; margin-bottom: 12px; flex-wrap: wrap; background: var(--line-2); padding: 3px; border-radius: 10px; }
.tabs button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; color: var(--muted); }
.tabs button:hover { color: var(--ink); }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.task { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; }
.task + .task { border-top: 1px solid var(--line-2); }
.task input { width: auto; margin-top: 3px; }
.task .tt { flex: 1; font-size: 13px; font-weight: 600; }
.task .tt small { font-weight: 500; }
.task.done .tt { text-decoration: line-through; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); border-radius: 8px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; background: var(--surface); user-select: none; color: var(--ink-2); }
.chip:hover { border-color: #cfccc2; }
.chip.on { background: var(--black); border-color: var(--black); color: #fff; }
.section-title { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 6px 0 -2px; display: flex; align-items: center; gap: 10px; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--black); color: #fff; padding: 11px 18px; border-radius: 10px; opacity: 0; transition: .2s; z-index: 200; pointer-events: none; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); margin-right: 10px; }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err::before { background: #ff6b5e; }

.stage-row { display: grid; grid-template-columns: 30px 1.6fr 76px 90px 96px 96px 96px; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line-2); }
.stage-row input[type=color] { padding: 2px; height: 30px; width: 30px; border-radius: 8px; }
.stage-row.head { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background: var(--black); color: #f2f0e8; padding: 14px; border-radius: 10px; white-space: pre-wrap; word-break: break-all; }

@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 32px; }
  .login-claim { font-size: 24px; }
  .app, .app.collapsed { grid-template-columns: 1fr; }
  .collapse-btn { display: none; }
  .sidebar { position: static; height: auto; }
  nav { grid-template-columns: repeat(2, 1fr); }
  .drawer-body { grid-template-columns: 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .view { padding: 18px; }
}

/* ---------- Logo da empresa ---------- */
.logo.img { background: #fff; padding: 3px; overflow: hidden; }
.logo.img img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ---------- Login: esqueci a senha ---------- */
.link-sm { font-size: 12.5px; font-weight: 600; color: var(--muted); text-align: center; text-decoration: none; }
.link-sm:hover { color: var(--ink); text-decoration: underline; }
.muted-p { margin: -6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.form-ok { font-size: 13px; color: var(--good); font-weight: 600; line-height: 1.45; }
.form-ok:empty { display: none; }

/* ---------- Duplicado / importação ---------- */
.dup-hint { background: var(--warn-bg); color: var(--warn); border-radius: 9px; padding: 9px 12px; font-size: 12.5px; font-weight: 600; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.dup-hint a { color: inherit; font-weight: 800; }
.dup-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); display: grid; gap: 3px; }
.import-map { max-height: 46vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.import-map table td, .import-map table th { padding: 8px 12px; }
.import-map table th:first-child, .import-map table td:first-child { padding-left: 12px; }
.import-map select { min-width: 190px; }
.import-map .sample { color: var(--muted); font-size: 12px; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropzone { border: 2px dashed #cfccc2; border-radius: 12px; padding: 30px; text-align: center; color: var(--muted); cursor: pointer; display: grid; gap: 6px; justify-items: center; }
.dropzone:hover, .dropzone.over { border-color: var(--ink); color: var(--ink); background: var(--surface-2); }
.dropzone strong { color: var(--ink); }
.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.result-grid div { background: var(--surface-2); border-radius: 10px; padding: 12px; }
.result-grid b { display: block; font-size: 22px; }

/* ---------- Marca ---------- */
.brand-preview { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--black); border-radius: 12px; color: #fff; }
.brand-preview .logo { width: 48px; height: 48px; font-size: 20px; }
.color-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.color-row input[type=color] { width: 44px; height: 36px; padding: 2px; }
.swatch { width: 28px; height: 28px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.swatch.on { border-color: var(--ink); }
.cf-row { display: grid; grid-template-columns: 1.5fr 130px 1.6fr auto; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line-2); }

/* ---------- Relatório (impressão / PDF) ---------- */
.report { background: #fff; max-width: 960px; margin: 0 auto; padding: 40px 44px; border-radius: 14px; border: 1px solid var(--line); }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 3px solid var(--yellow); padding-bottom: 18px; margin-bottom: 22px; }
.report-head .co { display: flex; align-items: center; gap: 14px; }
.report-head .co img { max-height: 56px; max-width: 180px; object-fit: contain; }
.report-head h1 { font-size: 24px; }
.report-head .by { text-align: right; font-size: 12px; color: var(--muted); }
.report h2 { font-size: 15px; margin: 26px 0 10px; }
.report .kpis { grid-template-columns: repeat(4, 1fr); }
.report .kpi { padding: 12px 14px; }
.report .kpi .v { font-size: 22px; }
.report .highlight { background: var(--yellow-soft); border-left: 4px solid var(--yellow); padding: 14px 16px; border-radius: 0 10px 10px 0; font-size: 14px; line-height: 1.55; }
.report table { font-size: 12.5px; }
.report-foot { margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; }
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sidebar, .ctx-bar, .no-print, .toast, #modal-root { display: none !important; }
  .app, .app.collapsed { display: block; }
  .view { padding: 0; }
  .report { border: 0; padding: 0; max-width: none; border-radius: 0; }
  .report .panel, .report .kpi, .report table { break-inside: avoid; }
}
