﻿/* =========================================================
   Link Imóveis — Sistema de Design
   Paleta: laranja (#F58220) + azul-marinho (#1E3A5F)
   ========================================================= */

:root {
  /* Cores institucionais (da logo) */
  --primary:        #1E3A5F;
  --primary-700:    #14365C;
  --primary-900:    #0E2A45;
  --accent:         #F58220;
  --accent-700:     #D96E0F;
  --accent-soft:    #FFF1E0;
  --gray-roof:      #9AA3AD;

  /* Neutros */
  --ink:            #1A2332;
  --muted:          #6B7785;
  --line:           #E6E9EE;
  --line-strong:    #D2D8E1;
  --bg:             #FFFFFF;
  --bg-soft:        #F7F8FA;
  --bg-soft-2:      #EEF1F5;

  /* Sinalização */
  --success:        #2D9A4D;
  --success-soft:   #E7F5EC;
  --warn:           #E0A800;
  --warn-soft:      #FFF6D5;
  --danger:         #D62828;
  --danger-soft:    #FCE5E5;
  --info:           #2462A8;
  --info-soft:      #E1ECF7;

  /* Status de leads */
  --st-novo:        #B8722C;
  --st-novo-soft:   #FBEFE0;
  --st-contato:     #2462A8;
  --st-contato-soft:#E1ECF7;
  --st-qualif:      #2D9A4D;
  --st-qualif-soft: #E7F5EC;
  --st-sujo:        #2D3037;
  --st-sujo-soft:   #E5E7EB;
  --st-nq:          #D62828;
  --st-nq-soft:     #FCE5E5;
  --st-fechado:     #15803D;
  --st-fechado-soft:#D1FAE5;

  /* Status de classificação do corretor */
  --st-aprovado:      #22C55E;
  --st-aprovado-ink:  #15803D;
  --st-aprovado-soft: #DCFCE7;
  --st-condic:        #F59E0B;
  --st-condic-ink:    #B45309;
  --st-condic-soft:   #FEF3C7;
  --st-reprov:        #EF4444;
  --st-reprov-ink:    #DC2626;
  --st-reprov-soft:   #FEE2E2;

  /* Sinalizações manuais (flags) */
  --fl-sement:    #B45309;  --fl-sement-soft:    #FEF3C7;  /* âmbar */
  --fl-limpando:  #6D28D9;  --fl-limpando-soft:  #EDE9FE;  /* roxo */
  --fl-avaliacao: #0F766E;  --fl-avaliacao-soft: #CCFBF1;  /* verde-água */

  /* Tipografia */
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Playfair Display', Georgia, serif;

  /* Sombras */
  --shadow-sm:  0 1px 2px rgba(14,42,69,.05);
  --shadow:     0 4px 12px rgba(14,42,69,.08);
  --shadow-lg:  0 12px 32px rgba(14,42,69,.12);

  /* Raios */
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* =========================================================
   Tipografia
   ========================================================= */
h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--primary);
  line-height: 1.18;
  font-weight: 600;
  margin: 0;
}
h1 { font-size: clamp(32px, 4.5vw, 52px); }
h2 { font-size: clamp(26px, 3vw, 36px); }
h3 { font-size: 20px; }

.eyebrow {
  display: inline-block;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.eyebrow-dark { color: var(--accent-700); }

em { font-style: normal; color: var(--accent); font-family: var(--serif); }

/* =========================================================
   Botões
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 22px;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .01em;
  border: 0;
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(245,130,32,.25);
}
.btn-primary:hover { background: var(--accent-700); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245,130,32,.35); }
.btn-secondary {
  background: var(--primary);
  color: #fff;
}
.btn-secondary:hover { background: var(--primary-700); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--line-strong);
}
.btn-ghost:hover { background: var(--bg-soft); border-color: var(--primary); color: var(--primary); }
.btn-wa {
  background: #25D366;
  color: #fff;
}
.btn-wa:hover { background: #1DA851; color: #fff; }
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #B11F1F; color: #fff; }
.btn-sm { height: 36px; font-size: 13px; padding: 0 14px; }
.btn-xs { height: 28px; font-size: 12px; padding: 0 10px; gap: 4px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* =========================================================
   Header público
   ========================================================= */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-logo { height: 52px; width: auto; }
.brand-text { display: none; }
.header-nav { display: flex; align-items: center; gap: 24px; }
.header-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  transition: color .15s;
}
.header-nav a:hover { color: var(--accent); }
.header-cta {
  padding: 10px 18px;
  background: var(--accent);
  color: #fff !important;
  border-radius: 8px;
  font-weight: 600;
}
.header-cta:hover { background: var(--accent-700); color: #fff !important; }

@media (max-width: 720px) {
  .header-nav a:not(.header-cta) { display: none; }
  .header-nav { gap: 10px; }
  .brand-logo { height: 40px; }
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  padding: 80px 0 100px;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -100px; right: -120px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(245,130,32,.10) 0%, transparent 70%);
  z-index: 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 60px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-text { max-width: 640px; }
.hero-title { margin-bottom: 24px; }
.hero-lede {
  font-size: 18px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 32px;
}
.hero-cta { display: flex; gap: 12px; margin-bottom: 36px; flex-wrap: wrap; }
.hero-trust {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  list-style: none;
  padding: 24px 0 0;
  margin: 0;
  border-top: 1px solid var(--line);
}
.hero-trust li { display: flex; flex-direction: column; gap: 4px; }
.hero-trust strong { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.hero-trust span { font-size: 14px; color: var(--ink); font-weight: 500; }

.hero-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow);
  position: relative;
}
.card-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.hero-card h3 { font-family: var(--serif); font-size: 22px; color: var(--primary); margin: 0 0 18px; }
.check-list { list-style: none; padding: 0; margin: 0 0 22px; }
.check-list li {
  position: relative;
  padding: 10px 0 10px 32px;
  font-size: 14.5px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.check-list li:last-child { border-bottom: 0; }
.check-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 13px;
  width: 22px; height: 22px;
  background: var(--accent-soft);
  border-radius: 50%;
}
.check-list li::after {
  content: '';
  position: absolute;
  left: 6px; top: 17px;
  width: 10px; height: 6px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.card-meta strong { color: var(--primary); font-size: 16px; font-family: var(--serif); }

@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero { padding: 50px 0 70px; }
}

/* =========================================================
   Sections
   ========================================================= */
.section { padding: 80px 0; }
.section-about { background: var(--primary); color: #fff; }
.section-about h2 { color: #fff; }
.section-about p { color: rgba(255,255,255,.85); }
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 60px;
  align-items: center;
}
.about-text p { margin: 0 0 16px; font-size: 17px; line-height: 1.65; }
.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,.18);
}
.about-stats div { display: flex; flex-direction: column; gap: 4px; }
.about-stats strong { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.about-stats span { font-size: 14px; color: #fff; font-weight: 500; }
.about-quote {
  background: rgba(255,255,255,.05);
  border-left: 4px solid var(--accent);
  padding: 30px;
  border-radius: 0 12px 12px 0;
}
.about-quote blockquote { margin: 0; }
.about-quote p { font-family: var(--serif); font-style: italic; font-size: 22px; line-height: 1.45; color: #fff; margin: 0 0 12px; }
.about-quote cite { display: block; font-style: normal; font-size: 13px; color: var(--accent); font-weight: 500; }

@media (max-width: 920px) {
  .about-grid { grid-template-columns: 1fr; gap: 36px; }
  .section { padding: 50px 0; }
}

/* =========================================================
   Formulário público
   ========================================================= */
.section-form { background: var(--bg-soft); }
.form-head { text-align: center; max-width: 700px; margin: 0 auto 40px; }
.form-head h2 { margin-bottom: 12px; }
.form-head p { color: var(--muted); font-size: 17px; }
.form-card {
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  padding: 48px 56px;
  max-width: 760px;
  margin: 0 auto;
}

/* Stepper */
.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  list-style: none;
  padding: 0 0 36px;
  margin: 0 0 36px;
  border-bottom: 1px solid var(--line);
  gap: 8px;
}
.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}
.step-dot span {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-soft-2);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 15px;
  transition: all .25s;
}
.step-dot b { font-size: 13px; color: var(--muted); font-weight: 500; text-align: center; }
.step-dot.is-active span { background: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.step-dot.is-active b { color: var(--primary); font-weight: 600; }
.step-dot.is-done span { background: var(--success); color: #fff; }
.step-dot.is-done span::before { content: '✓'; }
.step-dot.is-done span > * { display: none; }

@media (max-width: 620px) {
  .form-card { padding: 28px 22px; }
  .stepper { gap: 4px; }
  .step-dot b { font-size: 11px; }
  .step-dot span { width: 32px; height: 32px; font-size: 13px; }
}

/* Steps */
.step { display: none; border: 0; padding: 0; margin: 0; }
.step.is-active { display: block; }
.step-title { font-family: var(--serif); font-size: 24px; color: var(--primary); padding: 0; margin: 0 0 6px; }
.step-sub { color: var(--muted); margin: 0 0 28px; font-size: 14.5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-2 .field-full { grid-column: 1 / -1; }

@media (max-width: 620px) { .grid-2 { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span,
.field-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
}
.field > span i, .field-label i { color: var(--muted); font-style: italic; font-weight: 400; font-size: 12.5px; }
.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="number"],
.field input[type="password"],
.field select,
.field textarea {
  height: 50px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--line-strong);
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  transition: all .15s;
  width: 100%;
}
.field textarea { padding: 12px 14px; height: auto; min-height: 90px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(245,130,32,.12);
}
.field input.is-error,
.field select.is-error,
.field textarea.is-error { border-color: var(--danger); background: var(--danger-soft); }
.field .error { font-size: 12.5px; color: var(--danger); font-style: normal; min-height: 16px; }

/* Radio cards */
.radio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.radio-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .15s;
  background: #fff;
}
.radio-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.radio-card input { position: absolute; opacity: 0; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(245,130,32,.12); }
.radio-title { font-weight: 600; font-size: 14.5px; color: var(--primary); }
.radio-sub { font-size: 12.5px; color: var(--muted); }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all .15s;
  background: #fff;
}
.radio-pill:hover { border-color: var(--accent); }
.radio-pill input { position: absolute; opacity: 0; }
.radio-pill:has(input:checked) { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Step actions */
.step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.step-info { font-size: 13px; color: var(--muted); }

.conditional { display: none; }
.conditional.is-visible { display: flex; }

/* LGPD */
.lgpd-notice {
  grid-column: 1 / -1;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.lgpd-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 12px;
}
.lgpd-list { list-style: none; padding: 0; margin: 0; }
.lgpd-list li { font-size: 13px; color: var(--ink); margin-bottom: 6px; line-height: 1.5; }
.lgpd-list strong { color: var(--primary); }
.consent {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  cursor: pointer;
  align-items: flex-start;
}
.consent input { margin-top: 3px; flex-shrink: 0; }
.consent span { font-size: 13.5px; color: var(--ink); line-height: 1.5; }
.consent strong { color: var(--primary); }

/* Sucesso */
.step-success {
  display: none;
  text-align: center;
  padding: 30px 0;
}
.step-success[data-step="success"]:not([hidden]) { display: block; }
.success-mark {
  width: 80px; height: 80px;
  margin: 0 auto 20px;
  color: var(--success);
}
.step-success h3 { font-family: var(--serif); font-size: 28px; color: var(--primary); margin: 0 0 10px; }
.success-sub { color: var(--muted); margin-bottom: 28px; line-height: 1.6; font-size: 16px; }
.btn-wa-big { height: 56px; padding: 0 32px; font-size: 16px; }
.success-note { color: var(--muted); font-size: 13px; margin-top: 14px; }

.form-disclaimer {
  text-align: center;
  max-width: 600px;
  margin: 24px auto 0;
  font-size: 13px;
  color: var(--muted);
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: var(--primary);
  color: #fff;
  padding: 64px 0 24px;
  margin-top: 0;
}
.site-footer h4 { font-family: var(--sans); font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin: 0 0 16px; font-weight: 600; }
.site-footer p { font-size: 14px; color: rgba(255,255,255,.85); margin: 0 0 8px; line-height: 1.55; }
.site-footer a { color: var(--accent); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand { display: flex; gap: 16px; align-items: flex-start; }
.footer-brand img { width: 70px; }
.footer-brand strong { font-family: var(--serif); display: block; font-size: 22px; color: #fff; margin-bottom: 4px; }
.footer-brand span { font-size: 13px; color: rgba(255,255,255,.7); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.15);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: rgba(255,255,255,.65);
  flex-wrap: wrap;
}
.footer-admin { color: rgba(255,255,255,.65) !important; font-size: 12.5px; }
.footer-admin:hover { color: var(--accent) !important; }

@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   Login
   ========================================================= */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(900px 360px at 50% -10%, rgba(245,130,32,.18), transparent 60%),
    var(--bg-soft);
  padding: 20px;
}
.login-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 44px 38px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.login-logo { text-align: center; margin-bottom: 22px; }
.login-logo img { height: 64px; margin: 0 auto; }
.login-card h1 { font-family: var(--serif); font-size: 26px; color: var(--primary); text-align: center; margin: 0 0 6px; }
.login-card .sub { color: var(--muted); text-align: center; font-size: 14px; margin: 0 0 28px; }
.login-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.login-field label { font-size: 13.5px; font-weight: 500; color: var(--ink); }
.login-field input {
  height: 50px;
  padding: 0 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--line-strong);
  font-size: 15px;
  font-family: var(--sans);
}
.login-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(245,130,32,.12); }
.login-error {
  background: var(--danger-soft);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
  font-weight: 500;
  text-align: center;
}
.login-card .btn-block { margin-top: 8px; }
.login-back { display: block; text-align: center; margin-top: 22px; font-size: 12.5px; color: var(--muted); }

/* =========================================================
   PAINEL (compartilhado gerente + corretor)
   ========================================================= */
.ap-body { background: var(--bg-soft); min-height: 100vh; }

.ap-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.ap-header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 32px;
  max-width: 1400px;
  margin: 0 auto;
}
.ap-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.ap-brand img { height: 44px; }
.ap-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-left: auto;
  align-items: flex-end;
}
.ap-user-name { font-size: 14px; font-weight: 600; color: var(--primary); }
.ap-user-role {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 4px;
}
.ap-user-role.is-gerente { color: #fff; background: var(--primary); }
.ap-pausa-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
  margin-right: 8px;
}
.ap-pausa-toggle.is-active { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); font-weight: 600; }
.ap-logout-btn {
  background: transparent;
  border: 1px solid var(--line-strong);
  height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--sans);
}
.ap-logout-btn:hover { background: var(--bg-soft); color: var(--danger); border-color: var(--danger); }

.ap-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-soft);
  padding: 4px;
  border-radius: 10px;
}
.ap-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
}
.ap-tab:hover { color: var(--primary); }
.ap-tab.is-active { background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); font-weight: 600; }
.ap-tab .ap-notif {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px; height: 18px;
  padding: 0 6px;
  background: var(--accent);
  color: #fff;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
}

.ap-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 32px 48px;
}
.ap-panel { display: none; }
.ap-panel.is-active { display: block; }

@media (max-width: 720px) {
  .ap-header-inner { padding: 12px 16px; flex-wrap: wrap; }
  .ap-tabs { order: 3; width: 100%; }
  .ap-main { padding: 16px; }
}

/* Stats faixa */
.ap-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.ap-stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
}
.ap-stat-card .label { font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.ap-stat-card .value { font-size: 28px; font-family: var(--serif); font-weight: 700; color: var(--primary); line-height: 1; }
.ap-stat-card .sublabel { font-size: 12px; color: var(--muted); margin-top: 6px; }
.ap-stat-card.is-accent { border-color: var(--accent); background: var(--accent-soft); }
.ap-stat-card.is-accent .value { color: var(--accent-700); }

/* Toolbar busca */
.ap-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  align-items: center;
}
.ap-search-wrap {
  flex: 1;
  position: relative;
  min-width: 260px;
}
.ap-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.ap-toolbar input[type="search"] {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: 14px;
  font-family: var(--sans);
  background: #fff;
}
.ap-toolbar input[type="search"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(245,130,32,.12); }
.ap-filter-toggle {
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  color: var(--ink);
}
.ap-filter-toggle:hover { border-color: var(--accent); color: var(--accent); }

.ap-filters {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 18px;
}
.ap-filter-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 720px) { .ap-filter-row { grid-template-columns: 1fr; } }
.ap-filter-label { font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.ap-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ap-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: all .12s;
}
.ap-chip.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.ap-clear-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  margin-top: 12px;
  padding: 0;
}
.ap-clear-btn:hover { color: var(--danger); }

/* Leads list */
.ap-leads-list { display: grid; gap: 10px; }
.ap-lead-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--st-novo);
  border-radius: 10px;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  transition: all .15s;
}
.ap-lead-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); }
.ap-lead-card.st-em_contato      { border-left-color: var(--st-contato); }
.ap-lead-card.st-qualificado     { border-left-color: var(--st-qualif); }
.ap-lead-card.st-nome_sujo       { border-left-color: var(--st-sujo); }
.ap-lead-card.st-nao_qualificado { border-left-color: var(--st-nq); }
.ap-lead-card.st-fechado         { border-left-color: var(--st-fechado); background: var(--st-fechado-soft); }
.ap-lead-card.st-aprovado        { border-left-color: var(--st-aprovado); }
.ap-lead-card.st-condicionado    { border-left-color: var(--st-condic); }
.ap-lead-card.st-reprovado       { border-left-color: var(--st-reprov); }
.ap-lead-info { display: flex; flex-direction: column; gap: 4px; }
.ap-lead-name { font-weight: 600; color: var(--primary); font-size: 15px; }
.ap-lead-meta { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.ap-lead-meta strong { color: var(--ink); font-weight: 500; }
.ap-lead-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.ap-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .3px;
  text-transform: uppercase;
}
.ap-status-badge.s-novo            { background: var(--st-novo-soft);    color: var(--st-novo); }
.ap-status-badge.s-em_contato      { background: var(--st-contato-soft); color: var(--st-contato); }
.ap-status-badge.s-qualificado     { background: var(--st-qualif-soft);  color: var(--st-qualif); }
.ap-status-badge.s-nome_sujo       { background: var(--st-sujo-soft);    color: var(--st-sujo); }
.ap-status-badge.s-nao_qualificado { background: var(--st-nq-soft);      color: var(--st-nq); }
.ap-status-badge.s-fechado         { background: var(--st-fechado-soft); color: var(--st-fechado); }
.ap-status-badge.s-aprovado        { background: var(--st-aprovado-soft); color: var(--st-aprovado-ink); }
.ap-status-badge.s-condicionado    { background: var(--st-condic-soft);   color: var(--st-condic-ink); }
.ap-status-badge.s-reprovado       { background: var(--st-reprov-soft);   color: var(--st-reprov-ink); }

/* Sinalizações no cartão */
.ap-lead-flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.flag-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 5px;
  font-size: 11px; font-weight: 600; letter-spacing: .2px;
}
.flag-badge.f-sem-entrada { background: var(--fl-sement-soft);    color: var(--fl-sement); }
.flag-badge.f-limpando    { background: var(--fl-limpando-soft);  color: var(--fl-limpando); }
.flag-badge.f-avaliacao   { background: var(--fl-avaliacao-soft); color: var(--fl-avaliacao); }

/* Toggles de sinalização (modal) */
.flag-toggle-group { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.flag-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border: 1.5px solid var(--line); border-radius: 8px;
  background: #fff; cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--ink); transition: all .15s; user-select: none;
}
.flag-toggle:hover { border-color: var(--accent); }
.flag-toggle .chk {
  width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid currentColor;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; line-height: 1; color: var(--muted);
}
.flag-toggle.is-on .chk::after { content: '✓'; }
.flag-toggle.is-on.f-sem-entrada { background: var(--fl-sement-soft);    border-color: var(--st-condic);     color: var(--fl-sement); }
.flag-toggle.is-on.f-limpando    { background: var(--fl-limpando-soft);  border-color: var(--fl-limpando);   color: var(--fl-limpando); }
.flag-toggle.is-on.f-avaliacao   { background: var(--fl-avaliacao-soft); border-color: var(--fl-avaliacao);  color: var(--fl-avaliacao); }
.flag-toggle.is-on .chk { color: currentColor; }

.ap-docs-ready {
  background: var(--accent);
  color: #fff;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 50% { opacity: .6; } }

.ap-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
  background: #fff;
  border-radius: 16px;
  border: 2px dashed var(--line);
}
.ap-empty svg { color: var(--line-strong); margin: 0 auto 14px; }
.ap-empty strong { display: block; font-size: 18px; color: var(--primary); font-family: var(--serif); margin-bottom: 6px; }
.ap-empty span { font-size: 14px; }

/* =========================================================
   ROLETA / ESCALA (peça nova — gerente)
   ========================================================= */
.escala-intro {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.escala-intro-icon {
  width: 56px; height: 56px;
  background: var(--accent-soft);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--accent);
  flex-shrink: 0;
}
.escala-intro h3 { margin: 0 0 4px; font-family: var(--serif); color: var(--primary); font-size: 19px; }
.escala-intro p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.escala-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.dia-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dia-card.is-hoje {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.dia-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dia-card-titulo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--serif);
  font-size: 17px;
  color: var(--primary);
  font-weight: 600;
}
.dia-hoje-badge {
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--sans);
}
.dia-count {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg-soft);
  padding: 3px 10px;
  border-radius: 99px;
}
.plantonistas-list { display: flex; flex-direction: column; gap: 6px; min-height: 50px; }
.plantonista-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: grab;
  user-select: none;
  transition: all .15s;
}
.plantonista-item:hover { background: var(--accent-soft); border-color: var(--accent); }
.plantonista-item.is-dragging { opacity: .4; }
.plantonista-item.is-proximo {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-700);
}
.plantonista-item.is-proximo .plantonista-pos,
.plantonista-item.is-proximo .plantonista-nome { color: #fff; }
.plantonista-pos {
  font-weight: 700;
  color: var(--accent);
  font-size: 13px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.plantonista-handle { color: var(--muted); cursor: grab; flex-shrink: 0; }
.plantonista-nome { flex: 1; font-size: 14px; font-weight: 500; color: var(--ink); }
.plantonista-remove {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
}
.plantonista-remove:hover { background: var(--danger-soft); color: var(--danger); }
.plantao-empty {
  padding: 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--bg-soft);
  border-radius: 8px;
  border: 1px dashed var(--line);
}

.add-plantonista-wrap {
  display: flex;
  gap: 6px;
  position: relative;
}
.add-plantonista-select {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-family: var(--sans);
}
.add-plantonista-btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--sans);
}
.add-plantonista-btn:hover { background: var(--accent-700); }
.add-plantonista-btn:disabled { opacity: .5; cursor: not-allowed; }

.dia-proximo {
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--accent-700);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =========================================================
   CORRETORES (gerente)
   ========================================================= */
.corretor-actions { margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.corretor-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 8px;
}
.corretor-card.is-inactive { opacity: .5; }
.corretor-nome { font-weight: 600; color: var(--primary); font-size: 15px; }
.corretor-meta { font-size: 12.5px; color: var(--muted); margin-top: 4px; display: flex; gap: 14px; flex-wrap: wrap; }
.corretor-meta-item strong { color: var(--ink); font-weight: 500; }
.corretor-actions-row { display: flex; gap: 6px; }

/* =========================================================
   Modais
   ========================================================= */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(14,42,69,.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.is-open { display: flex; }
.modal-card {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-family: var(--serif); font-size: 20px; color: var(--primary); margin: 0; }
.modal-close {
  background: transparent;
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  display: grid;
  place-items: center;
}
.modal-close:hover { background: var(--bg-soft); color: var(--ink); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-soft);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.det-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.det-grid .full { grid-column: 1 / -1; }
.det-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--bg-soft); border-radius: 8px; }
.det-item .lbl { font-size: 11px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.det-item .val { font-size: 14px; color: var(--ink); font-weight: 500; word-break: break-word; }
.det-section-title {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--primary);
  margin: 24px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.det-section-title:first-child { margin-top: 0; }

.status-btn-group { display: flex; flex-wrap: wrap; gap: 6px; }
.status-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1.5px solid var(--line-strong);
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--sans);
  color: var(--ink);
}
.status-btn:hover { border-color: var(--accent); color: var(--accent); }
.status-btn.is-current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* =========================================================
   Página de upload (cliente)
   ========================================================= */
.up-body { background: var(--bg-soft); min-height: 100vh; }
.up-wrap { max-width: 720px; margin: 0 auto; padding: 32px 20px 60px; }
.up-header { text-align: center; margin-bottom: 28px; }
.up-header img { height: 56px; margin: 0 auto 16px; }
.up-header h1 { font-family: var(--serif); font-size: 28px; color: var(--primary); margin: 0 0 8px; }
.up-header p { color: var(--muted); font-size: 15px; line-height: 1.55; }
.up-progress {
  background: #fff;
  border-radius: 14px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  margin-bottom: 22px;
}
.up-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.up-progress-head strong { color: var(--primary); font-family: var(--serif); font-size: 18px; }
.up-progress-head .pct { font-size: 22px; font-weight: 700; color: var(--accent); font-family: var(--serif); }
.up-progress-bar {
  height: 10px;
  background: var(--bg-soft-2);
  border-radius: 5px;
  overflow: hidden;
}
.up-progress-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-700));
  transition: width .4s ease;
}
.up-docs { display: flex; flex-direction: column; gap: 10px; }
.up-doc {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
}
.up-doc.is-done { border-color: var(--success); background: var(--success-soft); }
.up-doc.is-pending { border-color: var(--warn); }
.up-doc-head { display: flex; gap: 12px; align-items: flex-start; }
.up-doc-status {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-weight: 700;
}
.up-doc.is-done .up-doc-status { background: var(--success); color: #fff; }
.up-doc.is-pending .up-doc-status { background: var(--warn); color: #fff; }
.up-doc-info { flex: 1; }
.up-doc-label { font-weight: 600; color: var(--primary); font-size: 15px; margin-bottom: 4px; }
.up-doc-hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.up-doc-hint strong { color: var(--ink); }
.up-doc-files { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding-left: 40px; }
.up-doc-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12.5px;
}
.up-doc-file-name { flex: 1; }
.up-doc-file-remove {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
}
.up-doc-file-remove:hover { color: var(--danger); }
.up-doc-upload {
  margin-top: 12px;
  padding-left: 40px;
}
.up-doc-upload label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.up-doc-upload label:hover { background: var(--primary-700); }
.up-doc-upload input { display: none; }
.up-doc.is-done .up-doc-upload label { background: var(--success); }
.up-success {
  background: var(--success-soft);
  border: 1px solid var(--success);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  color: var(--success);
  font-weight: 500;
  margin-bottom: 18px;
}

/* =========================================================
   Relatório (correspondente)
   ========================================================= */
.rel-body { background: var(--bg-soft); min-height: 100vh; padding: 30px 20px 60px; }
.rel-wrap { max-width: 920px; margin: 0 auto; }
.rel-header { text-align: center; margin-bottom: 28px; }
.rel-header img { height: 50px; margin: 0 auto 14px; }
.rel-header h1 { font-family: var(--serif); font-size: 26px; color: var(--primary); margin: 0; }
.rel-header p { color: var(--muted); margin: 6px 0 0; }
.rel-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 16px;
}
.rel-card h2 { font-family: var(--serif); color: var(--primary); font-size: 18px; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.rel-bloco-dourado {
  background: linear-gradient(135deg, var(--accent-soft), #FFE5C7);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 16px;
}
.rel-bloco-dourado h2 { color: var(--accent-700); border-bottom-color: var(--accent); }
.rel-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.rel-files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.rel-file-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rel-file-thumb {
  aspect-ratio: 1;
  background: var(--bg-soft);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  overflow: hidden;
}
.rel-file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rel-file-actions { display: flex; gap: 4px; }
.rel-file-actions a { flex: 1; text-align: center; font-size: 11.5px; padding: 5px; background: var(--bg-soft); border-radius: 5px; color: var(--ink); }

/* =========================================================
   Toast
   ========================================================= */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  transition: all .3s ease;
  box-shadow: var(--shadow-lg);
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.is-success { background: var(--success); }
.toast.is-error { background: var(--danger); }

/* Utilitários */
.muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.hidden { display: none !important; }

/* =========================================================
   Animações e micro-interações
   ========================================================= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}

.hero-text  { animation: fadeInUp .8s cubic-bezier(.16,.84,.44,1) both; }
.hero-card  { animation: slideInRight .8s cubic-bezier(.16,.84,.44,1) .15s both; }
.section h2 { animation: fadeInUp .7s ease-out both; }
.form-card  { animation: fadeInUp .6s ease-out .2s both; }

/* Reveal on scroll (controlado por JS) */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s cubic-bezier(.16,.84,.44,1), transform .8s cubic-bezier(.16,.84,.44,1); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Hover refinado em cards de lead */
.ap-lead-card { transition: transform .2s cubic-bezier(.16,.84,.44,1), box-shadow .2s, border-color .2s; }
.ap-lead-card:hover { transform: translateY(-2px) scale(1.003); box-shadow: 0 10px 24px rgba(14,42,69,.10); }

/* Botão CTA com brilho sutil ao hover */
.btn-primary {
  position: relative;
  overflow: hidden;
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.25), transparent);
  transition: left .6s ease;
}
.btn-primary:hover::after { left: 100%; }

/* Stepper transição entre etapas */
.step.is-active { animation: fadeIn .35s ease-out both; }

/* Modal slide-up */
.modal.is-open .modal-card { animation: scaleIn .25s cubic-bezier(.16,.84,.44,1) both; }

/* Cards de roleta com transição suave ao reordenar */
.dia-card { transition: border-color .2s, box-shadow .3s; }
.plantonista-item {
  transition: background .15s, border-color .15s, transform .2s, color .15s;
}
.plantonista-item:active { transform: scale(.98); }

/* Loading state */
.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.is-loading::before {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Status badge entrando */
.ap-status-badge { transition: background .2s, color .2s; }

/* Focus ring acessível para todos os interativos */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Header com sombra suave ao rolar (controlado por JS) */
.site-header.is-scrolled { box-shadow: 0 4px 18px rgba(14,42,69,.07); }
.ap-header.is-scrolled   { box-shadow: 0 4px 18px rgba(14,42,69,.07); }

/* Tabs slide indicator */
.ap-tab { position: relative; }

/* Print friendly */
@media print {
  .site-header, .site-footer, .ap-header, .modal, .toast, .rel-actions { display: none !important; }
  body { background: #fff; }
  .rel-card, .rel-bloco-dourado { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}

/* Acessibilidade — respeita preferência por movimento reduzido */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================================
   Distribuição rápida da Roleta
   ========================================================= */
.distrib-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-soft);
  margin-bottom: 6px;
  border: 1px solid transparent;
  transition: border-color .15s, background .15s;
}
.distrib-row:hover { border-color: var(--line-strong); }
.distrib-row.is-paused { opacity: .55; }
.distrib-name {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.distrib-name em { font-style: normal; font-size: 11px; color: var(--warn); font-family: var(--sans); }
.distrib-days { display: flex; gap: 4px; }
.distrib-day {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--line-strong);
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  transition: all .12s;
  font-family: var(--sans);
  display: grid;
  place-items: center;
  position: relative;
}
.distrib-day:hover { border-color: var(--accent); color: var(--accent); }
.distrib-day.is-on {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(245,130,32,.3);
}
.distrib-day.is-on::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(255,255,255,.18), transparent 60%);
  pointer-events: none;
}
.distrib-day.is-today { box-shadow: 0 0 0 2px var(--accent-soft); }

/* =========================================================
   Desempenho dos corretores
   ========================================================= */
.desempenho-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.desempenho-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.desempenho-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); }
.desempenho-card.is-inactive { opacity: .55; }
.desempenho-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.desempenho-nome { font-weight: 700; color: var(--primary); font-size: 16px; font-family: var(--serif); }
.desempenho-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.desempenho-badge-tot {
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 14px;
  min-width: 38px;
  text-align: center;
}
.desempenho-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  font-size: 12px;
}
.desempenho-stat {
  background: var(--bg-soft);
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}
.desempenho-stat-num { font-size: 18px; font-weight: 700; color: var(--primary); line-height: 1; }
.desempenho-stat-lbl { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; margin-top: 4px; }
.desempenho-stat.is-good .desempenho-stat-num { color: var(--success); }
.desempenho-stat.is-warn .desempenho-stat-num { color: var(--warn); }
.desempenho-stat.is-bad  .desempenho-stat-num { color: var(--danger); }

.desempenho-conv {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 10px 12px;
}
.desempenho-conv-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-soft-2);
  border-radius: 4px;
  overflow: hidden;
}
.desempenho-conv-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-700));
  border-radius: 4px;
  transition: width .6s ease;
}
.desempenho-conv-pct { font-weight: 700; color: var(--accent); font-size: 14px; min-width: 38px; text-align: right; }

/* =========================================================
   Charts e analytics
   ========================================================= */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.ap-card .card-title {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--primary);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.ap-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
}

/* Bar chart — barras verticais (acessos por dia) */
.ap-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 180px;
  padding: 14px 0 0;
  border-bottom: 1px solid var(--line);
}
.ap-bar-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.ap-bar {
  width: 100%;
  background: linear-gradient(180deg, var(--accent), var(--accent-700));
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height .6s cubic-bezier(.16,.84,.44,1);
  position: relative;
}
.ap-bar:hover::after {
  content: attr(data-count);
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}
.ap-bar-label { font-size: 10px; color: var(--muted); font-weight: 500; white-space: nowrap; }

/* Horizontal list (top X) */
.chart-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 13px;
}
.chart-row-label { flex: 1; color: var(--ink); }
.chart-row-bar {
  width: 100px;
  height: 6px;
  background: var(--bg-soft);
  border-radius: 3px;
  overflow: hidden;
}
.chart-row-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}
.chart-row-num { font-weight: 700; color: var(--primary); min-width: 32px; text-align: right; font-size: 13px; }

/* Heatmap horário (24 colunas) */
.heatmap-hours {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 2px;
  margin-bottom: 6px;
}
.heatmap-cell {
  aspect-ratio: 1;
  background: var(--bg-soft);
  border-radius: 3px;
  position: relative;
}
.heatmap-cell[data-level="0"] { background: var(--bg-soft); }
.heatmap-cell[data-level="1"] { background: #FCD7AE; }
.heatmap-cell[data-level="2"] { background: #F8B978; }
.heatmap-cell[data-level="3"] { background: #F58220; }
.heatmap-cell[data-level="4"] { background: #D96E0F; }
.heatmap-hours-labels {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 2px;
  font-size: 9px;
  color: var(--muted);
  text-align: center;
  margin-top: 2px;
}

/* IPs ignorados */
.ip-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-soft);
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}
.ip-card code { font-family: monospace; color: var(--primary); font-weight: 500; }

/* Timeline (histórico do lead) */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--line);
}
.timeline-item {
  position: relative;
  padding-left: 28px;
  padding-bottom: 14px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--accent);
}
.timeline-item .tl-acao {
  font-weight: 600;
  color: var(--primary);
  font-size: 13.5px;
}
.timeline-item .tl-detalhes { color: var(--ink); font-size: 13px; margin-top: 2px; }
.timeline-item .tl-meta { color: var(--muted); font-size: 11.5px; margin-top: 4px; }

/* Reforço visual: cores positivo/negativo no formulário */
.radio-pill:has(input[value="Sim"]:checked)       { background: var(--accent); color: #fff; border-color: var(--accent); }
.radio-pill:has(input[value="Não"]:checked)       { background: var(--primary); color: #fff; border-color: var(--primary); }
.radio-pill:has(input[value="Não sei"]:checked)   { background: var(--muted); color: #fff; border-color: var(--muted); }
/* Restrição = caso especial: "Sim" é negativo (alerta) */
.field:has(input[name="restricao"][value="Sim"]:checked) .radio-pill:has(input[value="Sim"]:checked) {
  background: var(--danger); border-color: var(--danger);
}

/* Modal scroll suave em mobile */
@media (max-width: 720px) {
  .modal-body { padding: 16px; }
  .modal-head { padding: 14px 16px; }
  .modal-foot { padding: 12px 16px; }
}

/* Lead pendente (sem corretor) — destaque para chamar atenção do gerente */
.ap-lead-card.is-pendente {
  background: linear-gradient(180deg, #FFF7EC 0%, #fff 60%);
  border-left-color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}
.ap-lead-card.is-pendente::before {
  content: 'AGUARDANDO';
  position: absolute;
  top: -8px; left: 18px;
  background: var(--accent);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  padding: 2px 8px;
  border-radius: 4px;
}
.ap-lead-card { position: relative; }

/* Bloco "Roleta" no modal do lead — botão principal grande */
.roleta-action-box {
  background: linear-gradient(135deg, var(--accent-soft) 0%, #FFE5C7 100%);
  border: 2px solid var(--accent);
  border-radius: 14px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.roleta-action-info { flex: 1; min-width: 240px; }
.roleta-action-titulo {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--accent-700);
  margin-bottom: 4px;
}
.roleta-action-corretor {
  font-size: 22px;
  font-family: var(--serif);
  font-weight: 700;
  color: var(--primary);
}
.roleta-action-status {
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 500;
}
.roleta-action-status.is-pending { color: var(--accent-700); }
.roleta-action-status.is-ok      { color: var(--success); }
.btn-roleta-acao {
  height: 54px !important;
  padding: 0 24px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: .5px;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(245,130,32,.35);
}
.btn-roleta-acao:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245,130,32,.45);
}

.reatribuir-manual {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
}
.reatribuir-manual summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.reatribuir-manual summary::before {
  content: '⚙';
  font-size: 14px;
}
.reatribuir-manual summary:hover { color: var(--primary); }
.reatribuir-manual[open] summary { color: var(--primary); margin-bottom: 4px; }

/* Timer regressivo nos cards */
.lead-timer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-soft);
  color: var(--accent-700);
  border: 1px solid var(--accent);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--sans);
}
.lead-timer.is-urgent {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger);
  animation: blink 1.5s ease-in-out infinite;
}
@keyframes blink { 50% { opacity: .55; } }

/* =========================================================
   GERAL — ajustes finos (valem em desktop e mobile)
   ========================================================= */
/* Painel do correspondente usa .ap-user — alinhar à direita igual aos outros */
.ap-user { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.ap-user #user-name { font-size: 14px; font-weight: 600; color: var(--primary); }
.ap-brand span { font-family: var(--serif); font-weight: 600; color: var(--primary); font-size: 16px; }
/* Rolagem por toque suave em áreas com scroll interno */
.modal-body, .ap-tabs, #notif-panel, #notif-lista { -webkit-overflow-scrolling: touch; }
/* Imagens/quebras nunca estouram a largura */
img, svg, video, canvas { max-width: 100%; }
.det-item .val, .ap-lead-name, .corretor-nome, .analise-card-info h4 { overflow-wrap: anywhere; }

/* =========================================================
   MOBILE — experiência completa e sem bugs no celular
   ========================================================= */

/* Segurança contra rolagem horizontal acidental + feedback de toque */
html { overflow-x: hidden; }
* { -webkit-tap-highlight-color: rgba(245,130,32,.18); }

/* iOS: impede o zoom automático ao focar campos (precisa fonte >= 16px) */
@media (max-width: 768px) {
  input[type="text"], input[type="tel"], input[type="email"],
  input[type="number"], input[type="password"], input[type="search"],
  input[type="date"], select, textarea { font-size: 16px; }
}

/* ---- Tablets e celulares (<= 768px) ---- */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .section { padding: 48px 0; }

  /* Hero */
  .hero { padding: 36px 0 52px; }
  .hero-lede { font-size: 16px; margin-bottom: 26px; }

  /* Cabeçalho dos painéis (gerente / corretor / correspondente) */
  .ap-header-inner { padding: 12px 16px; gap: 12px 14px; flex-wrap: wrap; }
  .ap-brand img { height: 36px; }
  .ap-brand span { font-size: 15px; }
  .ap-user, .ap-user-info { margin-left: auto; }
  .ap-user-name { font-size: 13px; }
  /* Remove o espaçador flex do cabeçalho do corretor (quebra limpa) */
  .ap-header-inner > div[style*="flex:1"] { display: none; }

  /* Abas roláveis lateralmente — não estouram a tela */
  .ap-tabs {
    order: 3; width: 100%;
    flex-wrap: nowrap; overflow-x: auto;
    scrollbar-width: none;
  }
  .ap-tabs::-webkit-scrollbar { display: none; }
  .ap-tab { flex: 0 0 auto; white-space: nowrap; }

  .ap-main { padding: 16px 16px 40px; }

  /* Estatísticas: 2 por linha */
  .ap-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .ap-stat-card { padding: 14px 16px; }
  .ap-stat-card .value { font-size: 24px; }
  .corr-stats { grid-template-columns: repeat(2, 1fr) !important; }

  /* Busca ocupa a linha inteira; filtro abaixo */
  .ap-toolbar { gap: 10px; }
  .ap-search-wrap { min-width: 0; flex: 1 1 100%; }
  .ap-filter-toggle { flex: 1 1 auto; justify-content: center; }

  /* Cartões */
  .ap-lead-card { padding: 14px 16px; gap: 10px; }
  .corretor-card { padding: 14px 16px; }
  .analise-card { padding: 14px; }

  /* Detalhes do lead em 1 coluna */
  .det-grid { grid-template-columns: 1fr; }

  /* Modais ocupam melhor a tela e empilham as ações */
  .modal { padding: 10px; }
  .modal-card { max-height: 94vh; }
  .modal-head { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-close { width: 40px; height: 40px; }
  .modal-foot { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 16px; }
  .modal-foot > *, .modal-foot .btn { width: 100%; }
  .modal-foot .status-btn-group { justify-content: center; }

  /* Alvos de toque maiores */
  .status-btn { height: 40px; padding: 0 16px; }
  .ap-chip, .corr-chip { padding: 8px 14px; }
  .ap-logout-btn { height: 40px; }

  /* Painel de notificações vira faixa no topo (não vaza pela lateral) */
  #notif-panel {
    position: fixed !important;
    top: 58px !important; left: 12px !important; right: 12px !important;
    width: auto !important; max-height: 72vh !important; z-index: 60 !important;
  }

  /* Roleta / escala */
  .roleta-action-box { flex-direction: column; align-items: stretch; }
  .btn-roleta-acao { width: 100%; }
  .escala-intro { flex-direction: column; text-align: center; }
  .escala-intro-icon { margin: 0 auto; }

  /* Upload do cliente */
  .up-wrap { padding: 22px 14px 44px; }
  .up-doc-files, .up-doc-upload { padding-left: 0; }

  /* Relatório */
  .rel-body { padding: 18px 12px 44px; }
  .rel-card, .rel-bloco-dourado { padding: 18px 16px; }

  /* Login */
  .login-card { padding: 30px 22px; }
}

/* ---- Celulares pequenos (<= 480px) ---- */
@media (max-width: 480px) {
  .brand-logo { height: 34px; }

  /* Confiança/números: 2 colunas legíveis */
  .hero-trust { grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
  .about-stats { grid-template-columns: repeat(2, 1fr); }

  /* CTAs do hero empilhados e largos */
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }

  /* Cartões de opção 1 por linha (toque fácil) */
  .radio-grid { grid-template-columns: 1fr; }

  /* Stepper compacto */
  .step-dot b { font-size: 10px; }
  .step-title { font-size: 21px; }

  /* Análise (correspondente): status em 1 coluna */
  .status-radio-group { grid-template-columns: 1fr !important; }

  /* Texto longo da marca do correspondente esconde no muito estreito */
  .ap-brand span { display: none; }
}
