@font-face { font-family: "Manrope"; src: url("/assets/Manrope-Light.ttf") format("truetype"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/assets/Manrope-Medium.ttf") format("truetype"); font-weight: 500 700; font-style: normal; font-display: swap; }
:root {
  --blue: #143f8f; --blue-dark: #0d2c69; --blue-wash: #f1f4fa; --ink: #050505;
  --muted: #667085; --line: #dfe4ec; --soft-line: #edf0f4; --paper: #fff; --surface: #f8fafc;
  --sans: "Manrope", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body { margin: 0; color: var(--ink); font-family: var(--sans); font-weight: 300; background: var(--paper); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-shell { max-width: 1600px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 64px); }
.topbar { height: 96px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--soft-line); }
.brand { display: flex; align-items: center; gap: 17px; color: inherit; text-decoration: none; }
.brand-logo { width: 58px; height: 58px; object-fit: contain; }
.brand-context { display: grid; gap: 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.brand-context b { color: var(--blue); font-weight: 500; }
.brand-context span { color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 26px; }
.campaign-period { color: var(--muted); font-size: 11px; letter-spacing: .16em; }
.status-dot { display: inline-block; width: 6px; height: 6px; margin-right: 9px; border-radius: 50%; background: var(--blue); }

.button { min-height: 48px; border: 1px solid transparent; border-radius: 0; padding: 0 21px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; letter-spacing: .02em; transition: color .2s ease, background .2s ease, transform .2s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--blue); border-color: var(--blue); }
.button-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.button-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.quick-add { display: none; }
.icon-button { width: 44px; height: 44px; border: 1px solid var(--line); background: #fff; border-radius: 50%; font-size: 25px; line-height: 1; }

.hero { display: grid; grid-template-columns: minmax(0, .9fr) minmax(540px, 1.1fr); gap: clamp(42px, 6vw, 96px); align-items: center; padding: clamp(46px, 5vw, 76px) 0 50px; }
.kicker { margin: 0 0 16px; color: var(--blue); font-size: 10px; font-weight: 500; letter-spacing: .22em; }
.hero h1, .section-heading h2 { margin: 0; font-size: clamp(44px, 4.25vw, 64px); font-weight: 300; line-height: 1.02; letter-spacing: -.045em; }
.accent-text { color: var(--blue); font: inherit; }
.hero-intro { max-width: 520px; margin: 25px 0 0; color: #4c5260; font-size: 15px; line-height: 1.7; }
.campaign-card { background: var(--blue); color: #fff; padding: 25px clamp(24px, 3vw, 40px) 26px; }
.campaign-card-heading { display: flex; justify-content: space-between; gap: 18px; padding-bottom: 17px; border-bottom: 1px solid rgba(255,255,255,.24); color: rgba(255,255,255,.7); font-size: 10px; letter-spacing: .15em; text-transform: uppercase; }
.primary-metric { display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 22px; padding: 20px 0 22px; }
.primary-metric strong { font-family: var(--sans); font-size: clamp(72px, 6.6vw, 96px); font-weight: 300; font-style: normal; letter-spacing: -.07em; line-height: .76; }
.primary-metric span { max-width: 155px; padding-bottom: 4px; color: rgba(255,255,255,.8); font-size: 14px; line-height: 1.35; }
.metric-grid { margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgba(255,255,255,.24); border-left: 1px solid rgba(255,255,255,.24); }
.metric-grid div { min-width: 0; padding: 15px 13px; border-right: 1px solid rgba(255,255,255,.24); border-bottom: 1px solid rgba(255,255,255,.24); }
.metric-grid dt { min-height: 30px; margin: 0 0 7px; color: rgba(255,255,255,.62); font-size: 9px; line-height: 1.35; }
.metric-grid dd { margin: 0; font-size: clamp(15px, 1.4vw, 20px); white-space: nowrap; }
.source-note { margin: 14px 0 0; color: rgba(255,255,255,.55); font-size: 9px; letter-spacing: .04em; }

.section-nav { position: sticky; top: 0; z-index: 10; display: flex; gap: 36px; align-items: center; min-height: 62px; background: rgba(255,255,255,.94); backdrop-filter: blur(14px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.nav-tab { align-self: stretch; padding: 0; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 13px; }
.nav-tab.is-active { color: var(--ink); border-bottom-color: var(--blue); }
.nav-tab span { margin-left: 6px; padding: 2px 7px; background: var(--blue-wash); color: var(--blue); font-size: 10px; }
.view { padding: 48px 0 84px; }
.section-heading { display: flex; justify-content: space-between; gap: 40px; align-items: end; margin-bottom: 32px; }
.section-heading h2 { font-size: clamp(36px, 3.6vw, 52px); }
.section-heading > p { max-width: 410px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

.crm-metrics { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.crm-metrics article { min-height: 158px; padding: 20px 22px; border-right: 1px solid var(--line); display: flex; flex-direction: column; background: #fff; }
.crm-metrics article:last-child { border-right: 0; }
.crm-metrics span { color: var(--muted); font-size: 11px; }
.crm-metrics strong { margin-top: auto; color: var(--blue); font-family: var(--sans); font-size: 52px; font-weight: 300; font-style: normal; letter-spacing: -.06em; line-height: .88; }
.crm-metrics small { margin-top: 10px; color: var(--muted); font-size: 10px; }
.accent-metric { background: var(--blue) !important; }
.accent-metric span, .accent-metric strong, .accent-metric small { color: #fff; }
.overview-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; margin-top: 16px; }
.panel { border: 1px solid var(--line); background: #fff; padding: 26px; min-height: 300px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.panel-heading h3 { margin: 0; color: var(--blue); font-size: 17px; font-weight: 500; }
.panel-heading span { color: var(--muted); font-size: 10px; }
.text-button { border: 0; background: none; color: var(--blue); padding: 0; font-size: 11px; font-weight: 500; }
.stage-row { display: grid; grid-template-columns: 108px 1fr 28px; align-items: center; gap: 14px; margin-bottom: 18px; font-size: 11px; }
.stage-track { height: 4px; background: var(--soft-line); overflow: hidden; }
.stage-fill { height: 100%; min-width: 0; background: var(--blue); transition: width .35s ease; }
.empty-inline { min-height: 210px; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 11px; }
.empty-inline strong { display: block; margin-bottom: 6px; color: var(--blue); font-family: var(--sans); font-size: 24px; font-style: normal; font-weight: 300; }
.upcoming-item { width: 100%; display: grid; grid-template-columns: 50px 1fr auto; gap: 14px; align-items: center; padding: 13px 0; border: 0; border-top: 1px solid var(--line); background: #fff; color: inherit; text-align: left; }
.date-tile { background: var(--blue-wash); color: var(--blue); text-align: center; padding: 8px 4px; }
.date-tile strong { display: block; font-family: var(--sans); font-size: 22px; font-style: normal; font-weight: 300; letter-spacing: -.04em; line-height: .85; }
.date-tile span { font-size: 8px; text-transform: uppercase; }
.upcoming-item h4, .upcoming-item p { margin: 0; }
.upcoming-item h4 { font-size: 12px; font-weight: 500; }
.upcoming-item p { margin-top: 4px; color: var(--muted); font-size: 10px; }

.contacts-heading { align-items: center; }
.mobile-add { display: none; }
.toolbar { display: flex; justify-content: space-between; gap: 14px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-bottom: 0; }
.toolbar input, .toolbar select { height: 44px; border: 1px solid var(--line); background: #fff; padding: 0 13px; color: var(--ink); font-size: 12px; }
.search-field { flex: 1; max-width: 580px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; padding-left: 13px; }
.search-field input { flex: 1; border: 0; padding-left: 0; outline: 0; }
.lead-list { border: 1px solid var(--line); background: #fff; }
.lead-head, .lead-row { display: grid; grid-template-columns: 1.2fr 1.5fr .8fr .95fr .95fr 24px; gap: 18px; align-items: center; }
.lead-head { padding: 12px 19px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 9px; letter-spacing: .11em; text-transform: uppercase; }
.lead-row { width: 100%; padding: 17px 19px; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: inherit; text-align: left; transition: background .18s ease; }
.lead-row:last-child { border-bottom: 0; }
.lead-row:hover { background: var(--blue-wash); }
.lead-name strong, .lead-name span { display: block; }
.lead-name strong { font-size: 13px; font-weight: 500; }
.lead-name span, .lead-request, .lead-owner { margin-top: 4px; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-pill, .status-pill { width: max-content; max-width: 100%; padding: 6px 8px; font-size: 9px; white-space: nowrap; }
.stage-pill { color: var(--blue); background: var(--blue-wash); }
.stage-pill[data-stage="cerrado"] { color: #fff; background: var(--blue); }
.status-pill { color: #50596a; background: #f0f2f5; }
.status-pill[data-status="no_contesto"] { color: #8f3d32; background: #f8e9e7; }
.next-date { font-size: 11px; }
.next-date span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.row-arrow { color: var(--blue); font-size: 17px; }
.empty-state { padding: 62px 24px; text-align: center; }
.empty-state .empty-number { display: block; color: var(--blue); font-family: var(--sans); font-size: 64px; font-weight: 300; font-style: normal; letter-spacing: -.06em; line-height: .85; }
.empty-state h3 { margin: 18px 0 8px; color: var(--blue); font-size: 24px; font-weight: 300; }
.empty-state p { max-width: 500px; margin: 0 auto 22px; color: var(--muted); font-size: 12px; line-height: 1.6; }

.kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 10px; }
.kanban-column { min-height: 410px; padding: 13px; border-top: 3px solid var(--blue); background: var(--surface); }
.kanban-heading { display: flex; align-items: center; justify-content: space-between; padding: 3px 2px 14px; font-size: 11px; }
.kanban-heading span { min-width: 23px; height: 23px; display: inline-grid; place-items: center; background: #fff; color: var(--blue); font-size: 9px; }
.kanban-card { width: 100%; margin-bottom: 9px; padding: 15px; border: 1px solid var(--line); background: #fff; color: inherit; text-align: left; transition: border-color .18s ease, transform .18s ease; }
.kanban-card:hover { border-color: var(--blue); transform: translateY(-1px); }
.kanban-card strong { display: block; font-size: 12px; font-weight: 500; }
.kanban-card p { min-height: 32px; margin: 8px 0 17px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.kanban-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 8px; }
.kanban-empty { padding: 32px 8px; color: #9098a6; text-align: center; font-size: 10px; }

footer { min-height: 92px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
dialog { width: min(900px, calc(100vw - 30px)); max-height: min(920px, calc(100vh - 30px)); padding: 0; border: 0; border-top: 4px solid var(--blue); border-radius: 0; box-shadow: 0 28px 90px rgba(4,18,48,.22); }
dialog::backdrop { background: rgba(7,16,35,.55); backdrop-filter: blur(4px); }
#lead-form { padding: clamp(22px, 4vw, 40px); }
.dialog-head { display: flex; justify-content: space-between; gap: 20px; align-items: start; margin-bottom: 28px; }
.dialog-head h2 { margin: 0; color: var(--blue); font-size: 35px; font-weight: 300; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.form-grid label { display: flex; flex-direction: column; gap: 8px; color: #343a46; font-size: 10px; letter-spacing: .02em; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; border: 1px solid var(--line); border-radius: 0; background: #fff; color: var(--ink); padding: 12px 13px; outline: 0; font-size: 12px; }
.form-grid input, .form-grid select { min-height: 46px; }
.form-grid textarea { resize: vertical; line-height: 1.55; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20,63,143,.08); }
.span-2 { grid-column: 1 / -1; }
.money-field { display: flex; align-items: center; background: #fff; border: 1px solid var(--line); }
.money-field span { padding-left: 13px; color: var(--muted); }
.money-field input { border: 0; }
.dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 28px; padding-top: 21px; border-top: 1px solid var(--line); }
.dialog-actions > div { display: flex; gap: 9px; }
#form-status { color: #9a4637; font-size: 10px; }
.toast { position: fixed; z-index: 50; right: 22px; bottom: 22px; max-width: 360px; padding: 15px 18px; background: var(--blue); color: #fff; font-size: 11px; transform: translateY(30px); opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.is-visible { transform: translateY(0); opacity: 1; }

@media (max-width: 1120px) {
  body { padding-bottom: 84px; }
  .topbar .button { display: none; }
  .quick-add {
    position: fixed;
    z-index: 30;
    right: max(24px, env(safe-area-inset-right));
    bottom: max(24px, env(safe-area-inset-bottom));
    display: inline-flex;
    min-height: 52px;
    padding-inline: 24px;
    box-shadow: 0 14px 34px rgba(13,44,105,.24);
  }
  .toast { bottom: 94px; }
  .hero { grid-template-columns: 1fr; gap: 34px; }
  .hero-copy { max-width: 760px; }
  .campaign-card { max-width: 900px; }
  .metric-grid dd { font-size: 19px; }
  .crm-metrics { grid-template-columns: repeat(2, 1fr); }
  .crm-metrics article:nth-child(2) { border-right: 0; }
  .crm-metrics article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .overview-grid { grid-template-columns: 1fr; }
  .lead-head, .lead-row { grid-template-columns: 1.2fr 1fr .8fr .9fr 24px; }
  .lead-owner { display: none; }
}

@media (max-width: 760px) {
  .app-shell { padding-inline: 16px; }
  .topbar { height: 80px; }
  .brand-logo { width: 50px; height: 50px; }
  .brand-context, .campaign-period, .topbar .button { display: none; }
  .hero { gap: 30px; padding: 40px 0 38px; }
  .hero h1 { font-size: clamp(40px, 11.5vw, 52px); }
  .hero-intro { margin-top: 20px; }
  .campaign-card { padding: 21px 18px 22px; }
  .campaign-card-heading { display: grid; gap: 5px; }
  .primary-metric { padding: 20px 0; }
  .primary-metric strong { font-size: 84px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-grid dt { min-height: 0; }
  .metric-grid dd { font-size: 18px; }
  .section-nav { gap: 24px; min-height: 58px; overflow-x: auto; }
  .view { padding: 42px 0 66px; }
  .section-heading { display: block; margin-bottom: 27px; }
  .section-heading h2 { font-size: 38px; }
  .section-heading > p { margin-top: 17px; }
  .crm-metrics { grid-template-columns: 1fr 1fr; }
  .crm-metrics article { min-height: 136px; padding: 16px; }
  .crm-metrics strong { font-size: 44px; }
  .panel { padding: 20px; }
  .mobile-add { display: none; }
  .quick-add {
    left: max(16px, env(safe-area-inset-left));
    right: max(16px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    width: auto;
  }
  .toolbar { display: grid; grid-template-columns: 1fr; border-bottom: 1px solid var(--line); }
  .search-field { max-width: none; }
  .toolbar select { width: 100%; }
  .lead-list { margin-top: 10px; border: 0; background: transparent; }
  .lead-head { display: none; }
  .lead-row { grid-template-columns: 1fr auto; gap: 12px; margin-bottom: 9px; padding: 16px; border: 1px solid var(--line); }
  .lead-request, .lead-owner { display: block; grid-column: 1 / -1; margin: 0; white-space: normal; }
  .lead-row .stage-pill, .lead-row .status-pill, .lead-row .next-date { grid-column: 1; }
  .lead-row .row-arrow { grid-column: 2; grid-row: 1; }
  .kanban { margin-right: -16px; padding-right: 16px; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 7px; }
  dialog { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); }
  #lead-form { padding: 21px 17px; }
  .dialog-head h2 { font-size: 32px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .dialog-actions { align-items: stretch; flex-direction: column; }
  .dialog-actions > div { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 390px) {
  .metric-grid dd { font-size: 16px; }
  .crm-metrics { grid-template-columns: 1fr; }
  .crm-metrics article { border-right: 0; border-bottom: 1px solid var(--line); }
  .stage-row { grid-template-columns: 88px 1fr 22px; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
