/* =====================================================================
   LeadFlow — Design system
   ===================================================================== */
:root {
  --lf-primary: #1c5eac;
  --lf-primary-2: #2f7fd8;
  --lf-primary-dark: #0e3a73;
  --lf-orange: #ff7900;
  --lf-orange-2: #ff9a3d;
  --lf-dark: #0a1f3d;
  --lf-sidebar: #0b2550;
  --lf-bg: #f3f6fb;
  --lf-card: #ffffff;
  --lf-border: #e8ebf3;
  --lf-muted: #64748b;
  --lf-radius: 16px;
  --lf-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --bs-primary: #1c5eac;
  --bs-primary-rgb: 28, 94, 172;
  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-bg: var(--lf-bg);
  --bs-link-color: #1c5eac;
  --bs-link-color-rgb: 28, 94, 172;
  --bs-link-hover-color: #0e3a73;
}
body { background: var(--lf-bg); color: #1e293b; font-size: .925rem; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
.btn { border-radius: 10px; font-weight: 500; }
.btn-primary { background: linear-gradient(135deg, var(--lf-primary), var(--lf-primary-2)); border: 0; box-shadow: 0 4px 14px rgba(28, 94, 172, .28); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active { background: linear-gradient(135deg, var(--lf-primary-dark), var(--lf-primary)) !important; box-shadow: 0 6px 20px rgba(28, 94, 172, .4); }
.btn-accent { background: linear-gradient(135deg, var(--lf-orange), var(--lf-orange-2)); color: #fff; border: 0; box-shadow: 0 4px 14px rgba(255, 121, 0, .3); }
.btn-accent:hover, .btn-accent:focus { color: #fff; background: linear-gradient(135deg, #e86d00, var(--lf-orange)); box-shadow: 0 6px 20px rgba(255, 121, 0, .4); }
.btn-outline-primary { --bs-btn-color: #1c5eac; --bs-btn-border-color: #1c5eac; --bs-btn-hover-bg: #1c5eac; --bs-btn-hover-border-color: #1c5eac; --bs-btn-active-bg: #0e3a73; }
.text-primary { color: var(--lf-primary) !important; }
.bg-primary-subtle { background-color: #e7f0fb !important; }
.btn-light { background: #f1f4f9; border-color: #f1f4f9; }
.form-control, .form-select { border-radius: 10px; border-color: #dfe3ec; padding: .55rem .85rem; }
.form-control:focus, .form-select:focus { border-color: #8db5e6; box-shadow: 0 0 0 .2rem rgba(28, 94, 172, .12); }
.form-check-input:checked { background-color: var(--lf-primary); border-color: var(--lf-primary); }
.page-link { color: var(--lf-primary); border-radius: 8px !important; margin: 0 2px; border: 0; }
.active > .page-link { background: var(--lf-primary); }
.form-label { font-weight: 500; font-size: .85rem; color: #334155; }
.min-w-0 { min-width: 0; }
.w-1 { width: 1%; }
.mw-140 { min-width: 140px; }
.mw-300 { max-width: 300px; }
.text-pre { white-space: pre-line; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 264px; flex-shrink: 0; background: linear-gradient(180deg, #0e3a73 0%, var(--lf-sidebar) 45%, #071a38 100%);
  color: #c7d6ea; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 1040;
  transition: transform .25s ease;
}
.main { flex: 1; margin-left: 264px; min-width: 0; display: flex; flex-direction: column; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: .35rem; padding: 1.5rem 1.4rem 1.25rem; border-bottom: 1px solid rgba(255, 255, 255, .08); margin-bottom: .5rem; }
.brand-img { height: 34px; width: auto; }
.brand-img-lg { height: 56px; width: auto; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-size: 1.2rem;
  background: linear-gradient(135deg, var(--lf-orange), var(--lf-orange-2)); box-shadow: 0 6px 20px rgba(255, 121, 0, .4);
}
.brand-logo.lg { width: 64px; height: 64px; font-size: 2rem; border-radius: 18px; }
.brand-name { font-weight: 800; color: #fff; font-size: 1.1rem; letter-spacing: -.02em; }
.brand-sub { font-size: .66rem; color: #9fb6d6; text-transform: uppercase; letter-spacing: .16em; font-weight: 600; }
.side-nav { padding: .5rem .75rem; flex: 1; overflow-y: auto; }
.side-link {
  display: flex; align-items: center; gap: .75rem; padding: .65rem .85rem; margin-bottom: 2px; border-radius: 10px;
  color: #c7d6ea; font-weight: 500; transition: all .15s; position: relative;
}
.side-link i { font-size: 1.1rem; opacity: .85; }
.side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.side-link.active { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.side-link.active::before { content: ''; position: absolute; left: -.75rem; top: 20%; bottom: 20%; width: 4px; border-radius: 0 4px 4px 0; background: var(--lf-orange); }
.side-link.active i { color: var(--lf-orange-2); opacity: 1; }
.side-sep { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: #7f9bc2; padding: 1.1rem .85rem .4rem; font-weight: 700; }
.side-footer { padding: 1rem 1.25rem; border-top: 1px solid rgba(255, 255, 255, .06); }
.sidebar-backdrop { display: none; }

.topbar {
  position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: .75rem; padding: .85rem 1.75rem;
  background: rgba(255, 255, 255, .88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--lf-border); box-shadow: 0 1px 0 rgba(10, 31, 61, .02);
}
.page-title { font-size: 1.25rem; font-weight: 700; margin: 0; letter-spacing: -.02em; color: var(--lf-dark); }
.content { padding: 1.75rem; flex: 1; }
.btn-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #fff; border: 1px solid var(--lf-border); font-size: 1.15rem; color: #334155; }
.btn-icon:hover { background: #e7f0fb; color: var(--lf-primary); }
.notif-dot { position: absolute; top: -4px; right: -4px; background: var(--lf-orange); color: #fff; font-size: .65rem; font-weight: 700; border-radius: 999px; padding: 1px 6px; border: 2px solid var(--lf-bg); }
.user-chip { display: flex; align-items: center; gap: .6rem; background: #fff; border: 1px solid var(--lf-border); border-radius: 14px; padding: .3rem .75rem .3rem .3rem; }
.user-chip::after { margin-left: .25rem; }
.avatar { width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; color: #fff; font-weight: 700; background: linear-gradient(135deg, var(--lf-primary), var(--lf-orange)); flex-shrink: 0; }
.avatar.sm { width: 30px; height: 30px; font-size: .8rem; border-radius: 9px; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.4rem; border-radius: 16px; }
.avatar.xl { width: 72px; height: 72px; font-size: 1.9rem; border-radius: 20px; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 20px 0 60px rgba(0, 0, 0, .3); }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 1030; }
  .main { margin-left: 0; }
  .content { padding: 1rem; }
  .topbar { padding: .75rem 1rem; }
  .page-title { font-size: 1.05rem; }
}

/* ---------- Cards ---------- */
.card-soft { background: var(--lf-card); border: 1px solid var(--lf-border); border-radius: var(--lf-radius); box-shadow: var(--lf-shadow); }
.card-soft .card-footer { border-top: 1px solid var(--lf-border); }
.card-title-sm { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #475569; }
.filter-bar { background: #fff; border: 1px solid var(--lf-border); border-radius: var(--lf-radius); padding: .85rem; box-shadow: var(--lf-shadow); }

.kpi {
  display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; border-radius: var(--lf-radius); background: #fff;
  border: 1px solid var(--lf-border); box-shadow: var(--lf-shadow); color: inherit; height: 100%; position: relative; overflow: hidden;
  transition: transform .15s, box-shadow .15s;
}
a.kpi:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(15, 23, 42, .1); color: inherit; }
.kpi::after { content: ''; position: absolute; right: -30px; top: -30px; width: 100px; height: 100px; border-radius: 50%; opacity: .08; background: var(--k); }
.kpi-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 1.3rem; color: #fff; background: var(--k); flex-shrink: 0; box-shadow: 0 6px 16px -4px var(--k); }
.kpi-label { font-size: .78rem; color: var(--lf-muted); font-weight: 500; }
.kpi-value { font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.kpi-indigo { --k: #1c5eac; } .kpi-green { --k: #12a26b; } .kpi-red { --k: #e5484d; } .kpi-cyan { --k: #ff7900; }
.kpi-amber { --k: #f5a524; } .kpi-rose { --k: #d9363e; } .kpi-violet { --k: #2f7fd8; } .kpi-slate { --k: #0e3a73; }
.kpi { border-bottom: 3px solid transparent; } a.kpi:hover { border-bottom-color: var(--k); }
@media (max-width: 575.98px) { .kpi { flex-direction: column; align-items: flex-start; gap: .6rem; padding: .9rem; } .kpi-value { font-size: 1.2rem; } }

.callout { display: flex; align-items: center; gap: .85rem; padding: .9rem 1.1rem; border-radius: 14px; color: inherit; border: 1px solid; }
.callout > i:first-child { font-size: 1.4rem; }
.callout-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.callout-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.callout-info { background: #eaf2fc; border-color: #bcd4f2; color: #0e3a73; }
a.callout:hover { filter: brightness(.98); }

.chart-box { position: relative; height: 300px; }
.chart-box.sm { height: 260px; }

.hero-card { border-radius: 20px; padding: 1.5rem; color: #fff; position: relative; overflow: hidden; background: linear-gradient(120deg, #0e3a73 0%, #1c5eac 60%, #2f7fd8 100%); box-shadow: 0 16px 40px -14px rgba(28, 94, 172, .55); }
.hero-card::after { content: ''; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 121, 0, .55), transparent 65%); pointer-events: none; }
.hero-card > * { position: relative; z-index: 1; }
.hero-card .badge-status { background: rgba(255, 255, 255, .95); }

/* ---------- Tabelas ---------- */
.table-modern { --bs-table-bg: transparent; }
.table-modern thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #5b6f8c; font-weight: 700; background: #f5f8fc; border-bottom: 1px solid var(--lf-border); padding: .8rem 1rem; white-space: nowrap; }
.table-modern td { padding: .85rem 1rem; border-color: #f1f4f9; }
.card-soft .table-modern thead th:first-child { border-top-left-radius: var(--lf-radius); }
.card-soft .table-modern thead th:last-child { border-top-right-radius: var(--lf-radius); }
.row-late td { background: #fff7f7 !important; }
.progress-thin { height: 6px; border-radius: 99px; background: #eef1f6; }
.w-0{width:0}.w-5{width:5%}.w-10{width:10%}.w-15{width:15%}.w-20{width:20%}.w-30{width:30%}.w-35{width:35%}.w-40{width:40%}.w-45{width:45%}.w-55{width:55%}.w-60{width:60%}.w-65{width:65%}.w-70{width:70%}.w-80{width:80%}.w-85{width:85%}.w-90{width:90%}.w-95{width:95%}

/* ---------- Badges ---------- */
.badge-status { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 600; padding: .3rem .6rem; border-radius: 8px; white-space: nowrap; }
.bs-warning { background: #fef3c7; color: #92400e; } .bs-info { background: #e0f2fe; color: #075985; }
.bs-success { background: #d1fae5; color: #065f46; } .bs-danger { background: #fee2e2; color: #991b1b; }
.bs-secondary { background: #f1f5f9; color: #475569; } .bs-dark { background: #e2e8f0; color: #0f172a; }
.bs-primary { background: #e1ecfa; color: #0e3a73; }
.bs-orange { background: #fff0e3; color: #b45309; }
.mod-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; padding: .25rem .5rem; border-radius: 8px; font-size: .72rem; font-weight: 800; letter-spacing: .03em; color: #fff; background: #1c5eac; }
.mod-pill.lg { min-width: 64px; height: 64px; border-radius: 16px; font-size: 1rem; border: 2px solid rgba(255, 255, 255, .3); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .5rem; background: #1c5eac; }

.nav-pills-soft .nav-link { border-radius: 10px; color: #475569; font-weight: 500; white-space: nowrap; padding: .5rem .9rem; }
.nav-pills-soft .nav-link.active { background: #fff; color: var(--lf-primary); font-weight: 600; box-shadow: var(--lf-shadow); border: 1px solid var(--lf-border); }
.nav-pills-soft .nav-link:hover:not(.active) { background: rgba(255, 255, 255, .6); }

/* ---------- Detalhe ---------- */
.info-grid label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; font-weight: 600; margin-bottom: .15rem; }
.info-grid div { font-weight: 500; }
.timeline { list-style: none; padding: 0 0 0 1.5rem; margin: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: .45rem; top: .3rem; bottom: .3rem; width: 2px; background: #e9edf5; }
.timeline li { position: relative; padding-bottom: 1.2rem; }
.timeline li:last-child { padding-bottom: 0; }
.tl-dot { position: absolute; left: -1.5rem; top: .2rem; width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #e2e8f0; }
.tl-dot.bs-warning { background: #f59e0b; } .tl-dot.bs-info { background: #0ea5e9; } .tl-dot.bs-success { background: #10b981; }
.tl-dot.bs-danger { background: #ef4444; } .tl-dot.bs-secondary { background: #94a3b8; } .tl-dot.bs-dark { background: #334155; }
.sticky-offset { top: 90px; z-index: 1; }

.status-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .5rem; }
.status-opt { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .85rem .5rem; border: 2px solid var(--lf-border); border-radius: 12px; cursor: pointer; font-size: .8rem; font-weight: 600; text-align: center; transition: all .15s; background: #fff; }
.status-opt i { font-size: 1.4rem; }
.status-opt:hover { border-color: #bcd4f2; }
.so-info i { color: #0ea5e9; } .so-success i { color: #10b981; } .so-danger i { color: #ef4444; }
.btn-check:checked + .so-info { border-color: #0ea5e9; background: #f0f9ff; }
.btn-check:checked + .so-success { border-color: #10b981; background: #ecfdf5; }
.btn-check:checked + .so-danger { border-color: #ef4444; background: #fef2f2; }
.btn-check:focus-visible + .status-opt { box-shadow: 0 0 0 .2rem rgba(28, 94, 172, .25); }

/* ---------- Nova consulta ---------- */
.stepper { display: flex; align-items: center; gap: .5rem; }
.step { display: flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 600; color: #94a3b8; white-space: nowrap; }
.step span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #e2e8f0; color: #64748b; font-size: .78rem; }
.step.active { color: #1e293b; } .step.active span { background: linear-gradient(135deg, var(--lf-primary), var(--lf-primary-2)); color: #fff; }
.step:last-child span { background: #fff0e3; color: var(--lf-orange); }
.step-line { flex: 1; height: 2px; background: #e2e8f0; min-width: 12px; }
@media (max-width: 575.98px) { .step { font-size: 0; gap: 0; } .step span { font-size: .78rem; } }
.mod-card { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; padding: 1rem; border: 2px solid var(--lf-border); border-radius: 14px; cursor: pointer; height: 100%; font-weight: 600; font-size: .85rem; transition: all .15s; background: #fff; }
.mod-card:hover { border-color: #bcd4f2; transform: translateY(-1px); }
.btn-check:checked + .mod-card { border-color: var(--lf-primary); background: #eef5fd; box-shadow: 0 6px 18px -6px rgba(28, 94, 172, .4); }
.cliente-preview { border: 1px solid #bcd4f2; background: #f5f9fe; border-radius: 14px; padding: 1rem; }
.cliente-preview .sit { display: flex; align-items: center; gap: .5rem; font-size: .8rem; padding: .25rem 0; }
.lgpd-box { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 14px; padding: 1rem; }

/* ---------- Esteira ---------- */
.opp-card { display: flex; flex-direction: column; height: 100%; background: #fff; border: 1px solid var(--lf-border); border-radius: var(--lf-radius); padding: 1.15rem; box-shadow: var(--lf-shadow); transition: transform .15s, box-shadow .15s; }
.opp-card { border-top: 3px solid var(--lf-orange); }
.opp-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px -10px rgba(28, 94, 172, .28); border-color: #bcd4f2; border-top-color: var(--lf-orange); }

/* ---------- Lojas ---------- */
.store-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 1.3rem; background: #e7f0fb; color: var(--lf-primary); flex-shrink: 0; }
.mini-row > div { border-right: 1px solid var(--lf-border); padding: .25rem 0; }
.mini-row > div:last-child { border-right: 0; }
.mini-stat { background: #f8fafc; border-radius: 12px; padding: .85rem; }

/* ---------- Import ---------- */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 2.5rem 1rem; border: 2px dashed #bcd4f2; border-radius: 16px; background: #f5f9fe; cursor: pointer; text-align: center; transition: all .15s; }
.dropzone i { font-size: 2.5rem; color: var(--lf-primary); }
.dropzone:hover, .dropzone.drag { background: #eaf2fc; border-color: var(--lf-primary); }
.log-box { max-height: 260px; overflow: auto; background: #0f172a; color: #fca5a5; font-family: ui-monospace, Menlo, monospace; font-size: .78rem; border-radius: 12px; padding: .85rem 1rem; }

/* ---------- Notificações ---------- */
.notif-item { display: flex; align-items: center; gap: .9rem; width: 100%; padding: .95rem 1.2rem; background: transparent; border: 0; }
.notif-item:hover { background: #f8fafc; }
.notif-unread { background: #f3f8fe; }
.notif-unread .notif-item .fw-semibold::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--lf-orange); margin-right: .45rem; vertical-align: middle; }
.notif-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.15rem; flex-shrink: 0; }

/* ---------- Vazio ---------- */
.empty-state { text-align: center; padding: 3.5rem 1rem; color: var(--lf-muted); }
.empty-state i { font-size: 3rem; color: #bcd4f2; display: block; margin-bottom: .75rem; }
.empty-state.sm { padding: 2rem 1rem; } .empty-state.sm i { font-size: 2rem; }
.empty-state p { margin: 0; }

/* ---------- Login ---------- */
.auth-wrap { min-height: 100vh; display: flex; }
.auth-side { flex: 1.1; align-items: center; padding: 4rem; background: linear-gradient(140deg, #1c5eac 0%, #0e3a73 55%, #071a38 100%); position: relative; overflow: hidden; }
.auth-side::before { content: ''; position: absolute; width: 420px; height: 420px; border-radius: 50%; left: -140px; top: -160px; border: 60px solid rgba(255, 255, 255, .04); }
.auth-side::after { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; right: -160px; bottom: -160px; background: radial-gradient(circle, rgba(255, 121, 0, .45), transparent 68%); }
.auth-side > div { position: relative; z-index: 1; max-width: 480px; }
.auth-feature { color: #dbe7f6; display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; font-weight: 500; }
.auth-feature i { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 121, 0, .18); color: var(--lf-orange-2); font-size: 1.1rem; }
.auth-highlight { color: var(--lf-orange-2); }
.auth-form { background: #fff; }
.auth-form { flex: 1; display: grid; place-items: center; padding: 2rem 1.25rem; }
.auth-card { width: 100%; max-width: 420px; }
.btn-eye { position: absolute; right: .75rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #94a3b8; font-size: 1.1rem; z-index: 5; }
.form-floating > .form-control { border-radius: 12px; }

/* ---------- Animações ---------- */
@media (prefers-reduced-motion: no-preference) {
  .content > * { animation: fadeUp .35s ease both; }
  @keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
.btn-check:disabled + .mod-card { opacity: .4; cursor: not-allowed; filter: grayscale(.6); }
.text-orange { color: var(--lf-orange) !important; }
.auth-logo { height: 56px; width: auto; }
a.brand:hover { opacity: .95; }
.card-soft:hover { border-color: #dbe5f2; }
.kpi-value { color: var(--lf-dark); }
.progress-bar.bg-success { background: linear-gradient(90deg, #12a26b, #34c58a) !important; }
.progress-bar.bg-warning { background: linear-gradient(90deg, #ff7900, #ffa24d) !important; }
::selection { background: rgba(255, 121, 0, .25); }
