/* CRM — usa as variáveis de style.css */
.crm .container { max-width: 1320px; }
.crm code { background: #222; padding: 1px 6px; border-radius: 3px; font-size: 12px; }

.crm-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.crm-filters select { width: auto; padding: 8px 12px; font-size: 14px; }
.seg { display: inline-flex; background: #141414; border: 1px solid #2a2a2a; border-radius: 6px; overflow: hidden; }
.seg button { background: none; border: 0; color: #aaa; padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.seg button + button { border-left: 1px solid #2a2a2a; }
.seg button.on { background: var(--accent); color: #fff; }

.tab .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 99px; background: #262626; color: #ddd; font-size: 12px; }
.tab .count.hot { background: rgba(229, 9, 20, .2); color: #ff6b72; }
.panel-title { margin: 0 0 14px; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #bdbdbd; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid #222; border-radius: 8px; padding: 16px 18px; }
.kpi small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.kpi strong { display: block; font-size: 28px; font-weight: 800; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.kpi span { color: #8f8f8f; font-size: 13px; }

.crm-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 18px; }

/* Funil */
.funnel-row { display: grid; grid-template-columns: 130px 1fr 90px; gap: 12px; align-items: center; margin-bottom: 12px; }
.funnel-row label { margin: 0; color: #ddd; font-size: 14px; }
.funnel-track { height: 28px; background: #1c1c1c; border-radius: 4px; overflow: hidden; }
.funnel-bar { height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; transition: width .4s ease; }
.funnel-val { text-align: right; font-variant-numeric: tabular-nums; }
.funnel-val b { display: block; font-size: 15px; }
.funnel-val small { color: #8f8f8f; font-size: 12px; }

/* Gráfico diário */
.chart { position: relative; height: 220px; display: flex; flex-direction: column; }
.chart-plot { flex: 1; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid #333; position: relative; }
.chart-grid { position: absolute; left: 0; right: 0; border-top: 1px dashed #262626; pointer-events: none; }
.chart-grid span { position: absolute; right: 0; top: -16px; color: #777; font-size: 11px; }
.chart-col { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.chart-col:hover .chart-bar { background: #ff3b45; }
.chart-bar { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; }
.chart-x { display: flex; justify-content: space-between; color: #777; font-size: 11px; padding-top: 6px; }

.tip { position: fixed; z-index: 300; pointer-events: none; background: #1f1f1f; border: 1px solid #333; border-radius: 6px; padding: 8px 10px; font-size: 13px; box-shadow: 0 10px 30px rgba(0, 0, 0, .6); }
.tip b { display: block; margin-bottom: 2px; }

/* Leads */
.crm-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.crm-toolbar input[type=search] { max-width: 300px; padding: 9px 12px; font-size: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.chip { background: #1c1c1c; border: 1px solid #2c2c2c; color: #bbb; border-radius: 99px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.chip.on { background: #fff; color: #000; border-color: #fff; }
.lead-row { cursor: pointer; }
.lead-row:hover td { background: #181818; }
.wa { color: #25d366; text-decoration: none; font-weight: 600; white-space: nowrap; }
.wa:hover { text-decoration: underline; }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; border: 1px solid #333; white-space: nowrap; }
.st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-pago { color: #46d369; border-color: rgba(70, 211, 105, .4); }
.st-checkout { color: #f5c518; border-color: rgba(245, 197, 24, .4); }
.st-abandonado { color: #ff6b72; border-color: rgba(229, 9, 20, .5); }
.st-contatado { color: #5aa9ff; border-color: rgba(90, 169, 255, .4); }
.st-perdido { color: #888; }
.st-novo { color: #ddd; }

/* Abandonados */
.ab-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid #222; }
.ab-item:last-child { border-bottom: 0; }
.ab-item b { font-size: 15px; }
.ab-item small { display: block; color: #8f8f8f; margin-top: 2px; }
.ab-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.btn.wa-btn { background: #25d366; color: #04140a; }
.btn.wa-btn:hover { background: #3ee07a; }

/* Drawer */
.drawer { position: fixed; inset: 0; z-index: 120; background: rgba(0, 0, 0, .6); display: flex; justify-content: flex-end; }
.drawer-box { position: relative; width: min(460px, 100%); height: 100%; overflow-y: auto; background: #101010; border-left: 1px solid #262626; padding: 28px 24px; animation: slideIn .25s ease; }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.lead-x { position: absolute; top: 12px; right: 14px; background: none; border: 0; color: #aaa; font-size: 28px; cursor: pointer; }
.drawer h2 { font-family: var(--serif); font-weight: 500; font-size: 26px; margin: 0 0 4px; }
.dl { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin: 18px 0; font-size: 14px; }
.dl dt { color: #8f8f8f; }
.dl dd { margin: 0; word-break: break-word; }

/* Stripe */
.stripe-mode { display: inline-block; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 3px; margin-left: 8px; }
.stripe-mode.test { background: #f5c518; color: #000; }
.stripe-mode.live { background: #46d369; color: #000; }
.notice { background: #141414; border: 1px solid #2a2a2a; border-left: 3px solid var(--accent); border-radius: 6px; padding: 16px 18px; color: #ccc; }
.notice code { color: #fff; }

@media (max-width: 900px) {
  .crm-grid { grid-template-columns: 1fr; }
  .funnel-row { grid-template-columns: 96px 1fr 70px; }
}
