/* =========================================================
   Pedro Moura — Análise de Financiamento Caixa
   Design system
   ========================================================= */

:root {
  --bg: #FAFAF7;
  --bg-soft: #F3F2EC;
  --surface: #FFFFFF;
  --ink: #14202B;
  --ink-soft: #4B5663;
  --muted: #8A93A0;
  --line: #E6E4DC;
  --line-strong: #D2CFC2;

  --primary: #0E2A3F;
  --primary-700: #0A2031;
  --primary-100: #E8EDF1;

  --accent: #B5895A;
  --accent-700: #8E6A41;
  --accent-100: #F4EADC;

  --danger: #B8403A;
  --success: #2F7A55;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(20, 32, 43, 0.04), 0 1px 1px rgba(20, 32, 43, 0.03);
  --shadow: 0 4px 18px -8px rgba(20, 32, 43, 0.18), 0 2px 4px rgba(20, 32, 43, 0.04);
  --shadow-lg: 0 24px 60px -28px rgba(14, 42, 63, 0.35), 0 6px 14px rgba(20, 32, 43, 0.05);

  --max: 1140px;
  --gap: clamp(16px, 3vw, 28px);

  --t-fast: 140ms cubic-bezier(.2,.7,.3,1);
  --t: 240ms cubic-bezier(.2,.7,.3,1);
  --t-slow: 480ms cubic-bezier(.2,.7,.3,1);

  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: var(--primary); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--accent-700); }

h1, h2, h3, h4 { margin: 0 0 .4em; font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; line-height: 1.18; color: var(--ink); }
p  { margin: 0 0 1em; }

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

/* ============== Header ============== */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,250,247,.85);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex; align-items: center; gap: 14px; color: var(--ink);
}
.brand-mark {
  width: 42px; height: 42px;
  border-radius: 9px;
  background: var(--primary);
  color: var(--accent);
  display: grid; place-items: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .02em;
}
.brand-mark.large { width: 56px; height: 56px; font-size: 22px; border-radius: 12px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 18px; }
.brand-creci { font-size: 12px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }

.header-nav { display: flex; align-items: center; gap: 28px; }
.header-nav a { color: var(--ink-soft); font-weight: 500; font-size: 14.5px; }
.header-nav a:hover { color: var(--primary); }
.header-nav .header-cta {
  background: var(--primary); color: #fff;
  padding: 10px 18px; border-radius: 999px; font-size: 13.5px; letter-spacing: .01em;
}
.header-nav .header-cta:hover { background: var(--primary-700); color: #fff; }

@media (max-width: 720px) {
  .header-nav a:not(.header-cta) { display: none; }
  .header-inner { height: 64px; }
  .brand-creci { display: none; }
}

/* ============== Buttons ============== */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 50px; padding: 0 24px;
  border-radius: 999px;
  font-family: var(--sans);
  font-weight: 600; font-size: 14.5px; letter-spacing: .01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--t-fast), background var(--t), color var(--t), box-shadow var(--t), border-color var(--t);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--primary); color: #fff;
  box-shadow: 0 8px 18px -10px rgba(14,42,63,.6);
}
.btn-primary:hover { background: var(--primary-700); color: #fff; box-shadow: 0 12px 26px -12px rgba(14,42,63,.7); }
.btn-ghost {
  background: transparent; color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ============== Hero ============== */

.hero {
  position: relative;
  background:
    radial-gradient(1100px 480px at 80% -10%, rgba(181,137,90,.12), transparent 60%),
    linear-gradient(180deg, #FAFAF7 0%, #F3F2EC 100%);
  overflow: hidden;
}
.hero-pattern {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(14,42,63,.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.5) 0%, rgba(0,0,0,0) 80%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.5) 0%, rgba(0,0,0,0) 80%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.25fr .9fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding: clamp(56px, 9vw, 120px) 24px clamp(48px, 7vw, 96px);
}

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

.hero-title {
  font-size: clamp(34px, 5.2vw, 60px);
  line-height: 1.05;
  letter-spacing: -.02em;
  margin: 0 0 18px;
  color: var(--primary);
}
.hero-title em { font-style: italic; color: var(--accent-700); font-family: var(--serif); }

.hero-lede {
  max-width: 56ch;
  font-size: clamp(16px, 1.6vw, 18.5px);
  color: var(--ink-soft);
  margin-bottom: 32px;
}

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 36px; }

.hero-trust {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 18px;
  list-style: none; padding: 0; margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  max-width: 520px;
}
.hero-trust li { display: flex; flex-direction: column; gap: 2px; }
.hero-trust strong { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.hero-trust span { font-family: var(--serif); font-size: 18px; color: var(--ink); }

.hero-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.hero-card::before {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6);
}
.hero-card .card-eyebrow {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-700);
  margin-bottom: 8px; font-weight: 600;
}
.hero-card h3 { font-size: 22px; margin-bottom: 16px; color: var(--primary); }
.check-list { list-style: none; padding: 0; margin: 0 0 22px; }
.check-list li {
  position: relative;
  padding: 10px 0 10px 30px;
  border-bottom: 1px dashed var(--line);
  font-size: 14.5px;
  color: var(--ink-soft);
}
.check-list li:last-child { border-bottom: 0; }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 14px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent-100);
  background-image: linear-gradient(135deg, var(--accent), var(--accent-700));
  box-shadow: 0 0 0 1px var(--accent-700) inset;
}
.check-list li::after {
  content: ""; position: absolute; left: 5px; top: 17px;
  width: 9px; height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

.card-meta {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.card-meta span { font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.card-meta strong { font-family: var(--serif); font-size: 18px; color: var(--primary); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { order: 2; }
}

/* ============== Section: about ============== */

.section { padding: clamp(72px, 9vw, 120px) 0; }
.section-about { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr .9fr;
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
}
.about-text h2 {
  font-size: clamp(28px, 3.6vw, 42px);
  color: var(--primary);
  letter-spacing: -.015em;
  margin-bottom: 18px;
}
.about-text p { color: var(--ink-soft); font-size: 17px; max-width: 56ch; }
.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.about-stats > div { display: flex; flex-direction: column; gap: 4px; }
.about-stats strong { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.about-stats span { font-family: var(--serif); font-size: 18px; color: var(--ink); }

.about-quote {
  background:
    linear-gradient(180deg, rgba(244,234,220,.55), rgba(244,234,220,.15));
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.about-quote blockquote { margin: 0; }
.about-quote p {
  font-family: var(--serif);
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.35;
  color: var(--primary);
  font-style: italic;
  margin-bottom: 14px;
}
.about-quote cite { font-style: normal; color: var(--ink-soft); font-size: 13.5px; letter-spacing: .04em; }

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

/* ============== Section: form ============== */

.section-form { background: var(--bg-soft); }
.form-head { text-align: center; max-width: 640px; margin: 0 auto clamp(28px, 4vw, 44px); }
.form-head h2 {
  font-size: clamp(28px, 3.6vw, 42px);
  color: var(--primary);
  letter-spacing: -.015em;
}
.form-head p { color: var(--ink-soft); font-size: 17px; }

.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 40px);
  box-shadow: var(--shadow);
  max-width: 920px;
  margin: 0 auto;
}

/* Stepper */
.stepper {
  list-style: none; padding: 0; margin: 0 0 28px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  position: relative;
}
.step-dot {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  color: var(--muted);
  padding: 12px 8px;
  border-bottom: 2px solid var(--line);
  transition: color var(--t), border-color var(--t);
}
.step-dot span {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--line-strong);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--muted);
  flex-shrink: 0;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.step-dot b { font-weight: 600; letter-spacing: .01em; }
.step-dot.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.step-dot.is-active span { background: var(--primary); color: #fff; border-color: var(--primary); }
.step-dot.is-done span {
  background: var(--accent); color: #fff; border-color: var(--accent);
  background-image: linear-gradient(135deg, var(--accent), var(--accent-700));
}
.step-dot.is-done { color: var(--accent-700); border-bottom-color: var(--accent); }

@media (max-width: 720px) {
  .step-dot b { display: none; }
  .stepper { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .step-dot { justify-content: center; }
}

/* Step content */
.step {
  border: 0; padding: 0; margin: 0;
  display: none;
  animation: stepIn var(--t-slow);
}
.step.is-active { display: block; }
.step-title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(22px, 2.6vw, 28px);
  color: var(--primary);
  margin: 0 0 6px;
}
.step-sub { color: var(--ink-soft); margin-bottom: 24px; }

@keyframes stepIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* Grid */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 22px;
}
.field-full { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* Fields */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span,
.field-label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
}
.field i {
  font-style: normal;
  color: var(--muted);
  font-weight: 400;
  font-size: 12.5px;
  margin-left: 4px;
}

.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field input[type="number"],
.field input[type="date"],
.field select,
.field textarea {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
  appearance: none;
}
.field textarea { height: auto; padding: 12px 14px; resize: vertical; min-height: 92px; }
.field select { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%2314202B' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }

.field input:hover,
.field select:hover,
.field textarea:hover { border-color: #B7B3A3; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(14,42,63,.10);
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(184,64,58,.10);
}

.field .error {
  font-style: normal;
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 500;
  display: none;
  letter-spacing: .01em;
}
.field.has-error .error { display: block; }

/* Radio cards */
.radio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (max-width: 640px) { .radio-grid { grid-template-columns: 1fr; } }

.radio-card {
  display: flex; flex-direction: column; gap: 2px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: #fff;
  cursor: pointer;
  transition: border-color var(--t), background var(--t), box-shadow var(--t), transform var(--t-fast);
  position: relative;
}
.radio-card:hover { border-color: #B7B3A3; }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card .radio-title { font-weight: 600; color: var(--ink); font-size: 14.5px; }
.radio-card .radio-sub { font-size: 12.5px; color: var(--muted); }
.radio-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-100);
  box-shadow: 0 0 0 1px var(--primary) inset;
}
.radio-card:has(input:checked) .radio-title { color: var(--primary); }

/* Radio pills */
.radio-row {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.radio-pill {
  display: inline-flex; align-items: center;
  cursor: pointer;
  position: relative;
  user-select: none;
}
.radio-pill input { position: absolute; opacity: 0; pointer-events: none; }
.radio-pill span {
  display: inline-flex; align-items: center;
  height: 42px; padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-size: 14px; font-weight: 500;
  transition: background var(--t), border-color var(--t), color var(--t), box-shadow var(--t);
}
.radio-pill:hover span { border-color: #B7B3A3; }
.radio-pill input:checked + span {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Consent */
.consent {
  flex-direction: row; align-items: flex-start; gap: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.consent input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); }
.consent span { font-size: 13.5px; color: var(--ink-soft); }

/* Conditional */
.conditional { display: none; }
.conditional.is-shown { display: flex; animation: stepIn var(--t); }

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

/* Success */
.step-success {
  text-align: center;
  padding: 32px 12px;
}
.step-success.is-active { display: block; animation: stepIn var(--t-slow); }
.success-mark {
  width: 72px; height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--accent-100);
  color: var(--accent-700);
  display: grid; place-items: center;
}
.step-success h3 {
  font-size: clamp(22px, 2.5vw, 30px);
  color: var(--primary);
  margin-bottom: 10px;
}
.step-success p { color: var(--ink-soft); max-width: 48ch; margin-left: auto; margin-right: auto; }
.success-foot { font-size: 13.5px; color: var(--muted); margin-top: 18px; }

.form-disclaimer {
  text-align: center;
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
}

/* ============== Footer ============== */

.site-footer {
  background: var(--primary);
  color: rgba(255,255,255,.78);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 28px;
  padding: clamp(48px, 6vw, 72px) 24px 32px;
}
.footer-brand { display: flex; align-items: center; gap: 14px; color: #fff; }
.footer-brand strong { display: block; font-family: var(--serif); font-size: 19px; color: #fff; }
.footer-brand span { font-size: 13px; color: rgba(255,255,255,.7); }
.footer-block h4 {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}
.footer-block p { font-size: 14px; color: rgba(255,255,255,.78); margin-bottom: 6px; line-height: 1.55; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.10);
  padding: 18px 24px;
  max-width: var(--max);
  margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px;
  color: rgba(255,255,255,.55);
  gap: 12px; flex-wrap: wrap;
}
.footer-admin { color: rgba(255,255,255,.55); border-bottom: 1px dotted rgba(255,255,255,.4); padding-bottom: 1px; }
.footer-admin:hover { color: var(--accent); border-color: var(--accent); }

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


/* =========================================================
   ADMIN PANEL
   ========================================================= */

.admin-body { background: var(--bg-soft); min-height: 100vh; display: flex; flex-direction: column; }

.admin-login {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 360px at 50% -10%, rgba(181,137,90,.18), transparent 60%),
    var(--bg-soft);
}
.admin-login .login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.admin-login .brand-mark { margin: 0 auto 16px; width: 56px; height: 56px; font-size: 22px; }
.admin-login h1 { font-size: 24px; color: var(--primary); margin-bottom: 4px; }
.admin-login p { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.admin-login .field { text-align: left; margin-bottom: 14px; }
.admin-login .login-error { color: var(--danger); font-size: 13px; min-height: 18px; }
.admin-login .btn { width: 100%; }
.admin-login .login-foot {
  margin-top: 22px;
  font-size: 12px;
  color: var(--muted);
}
.admin-login .login-foot a { color: var(--ink-soft); }

.admin-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}
.admin-sidebar {
  background: var(--primary);
  color: rgba(255,255,255,.85);
  padding: 28px 22px;
  position: sticky; top: 0; height: 100vh; overflow: auto;
}
.admin-sidebar .brand { color: #fff; margin-bottom: 28px; }
.admin-sidebar .brand-name { color: #fff; }
.admin-sidebar .brand-creci { color: rgba(255,255,255,.55); }
.admin-sidebar h4 {
  font-family: var(--sans); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
  margin: 18px 0 10px;
  font-weight: 600;
}
.admin-sidebar .filter-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.admin-sidebar label.filter-opt {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: rgba(255,255,255,.78);
  cursor: pointer;
  transition: background var(--t-fast);
}
.admin-sidebar label.filter-opt:hover { background: rgba(255,255,255,.05); }
.admin-sidebar label.filter-opt input { accent-color: var(--accent); }
.admin-sidebar .count {
  background: rgba(255,255,255,.08);
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  color: rgba(255,255,255,.7);
}
.admin-sidebar .reset {
  background: transparent;
  color: rgba(255,255,255,.6);
  border: 1px solid rgba(255,255,255,.15);
  padding: 8px 10px; border-radius: 8px;
  font-size: 12.5px;
  width: 100%;
  margin-top: 8px;
  cursor: pointer;
}
.admin-sidebar .reset:hover { color: #fff; border-color: rgba(255,255,255,.3); }
.admin-sidebar .logout {
  margin-top: 28px;
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.12);
  padding: 10px 12px; border-radius: 8px;
  font-size: 13px;
  cursor: pointer; width: 100%;
}
.admin-sidebar .logout:hover { background: rgba(255,255,255,.10); color: #fff; }

.admin-main { padding: 28px clamp(16px, 3vw, 36px); }

.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin-bottom: 22px;
}
.admin-topbar h1 {
  font-family: var(--serif); font-size: clamp(22px, 2.6vw, 30px); color: var(--primary);
}
.admin-topbar .topbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.search {
  position: relative;
  flex: 1; min-width: 260px;
  max-width: 420px;
}
.search input {
  width: 100%; height: 44px;
  padding: 0 14px 0 38px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 14px;
}
.search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(14,42,63,.10); }
.search::before {
  content: ""; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A93A0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m20 20-3-3'/></svg>") center/contain no-repeat;
}

.btn-sm {
  height: 44px;
  padding: 0 16px;
  font-size: 13.5px;
  border-radius: var(--radius);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-card span {
  font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.stat-card strong {
  display: block;
  font-family: var(--serif);
  font-size: 32px;
  color: var(--primary);
  margin-top: 6px;
  font-weight: 600;
}
.stat-card em { font-style: normal; font-size: 12px; color: var(--ink-soft); }
@media (max-width: 920px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-wrap { overflow-x: auto; }
table.leads {
  width: 100%; border-collapse: collapse; min-width: 760px;
}
table.leads th, table.leads td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  vertical-align: middle;
}
table.leads th {
  background: var(--bg-soft);
  font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  font-weight: 600;
}
table.leads tbody tr { transition: background var(--t-fast); cursor: pointer; }
table.leads tbody tr:hover { background: var(--bg-soft); }
table.leads tbody tr:last-child td { border-bottom: 0; }
.lead-name { font-weight: 600; color: var(--ink); }
.lead-meta { color: var(--muted); font-size: 12.5px; }

.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  border: 1px solid transparent;
}
.badge.novo     { background: var(--primary-100); color: var(--primary); border-color: var(--primary-100); }
.badge.contato  { background: #FFF6E5; color: #8C6A0F; border-color: #F6E2B0; }
.badge.qualificado { background: #E5F2EC; color: #2F7A55; border-color: #BFE0D0; }
.badge.naoqualificado { background: #F7E2E0; color: var(--danger); border-color: #EFC7C3; }
.badge.fechado  { background: var(--accent-100); color: var(--accent-700); border-color: #ECDCC2; }

.empty {
  padding: 52px 24px;
  text-align: center;
  color: var(--muted);
}
.empty strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 18px; margin-bottom: 6px; }

/* Modal */
.modal {
  position: fixed; inset: 0;
  background: rgba(14,32,49,.55);
  display: none;
  align-items: flex-start; justify-content: center;
  padding: 4vh 16px;
  z-index: 60;
  overflow-y: auto;
  backdrop-filter: blur(4px);
}
.modal.is-open { display: flex; }
.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 720px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  animation: stepIn var(--t-slow);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.modal-head h3 { font-size: 20px; color: var(--primary); margin: 0; }
.modal-head .close {
  background: transparent; border: 0; cursor: pointer;
  width: 36px; height: 36px; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--ink-soft);
}
.modal-head .close:hover { background: rgba(0,0,0,.05); color: var(--ink); }
.modal-body { padding: 24px; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
.detail-grid > div { display: flex; flex-direction: column; gap: 2px; }
.detail-grid span {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.detail-grid strong { font-weight: 500; color: var(--ink); font-size: 14.5px; word-break: break-word; }
.detail-grid .full { grid-column: 1 / -1; }
@media (max-width: 580px) { .detail-grid { grid-template-columns: 1fr; } }

.modal-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  flex-wrap: wrap;
}
.status-select {
  height: 42px;
  padding: 0 36px 0 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 14px;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%2314202B' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}
.modal-foot .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid #E8C4C0;
}
.btn-danger:hover { background: #FBEFEE; }

.btn-wa {
  background: #25D366;
  color: #fff;
  border: 1px solid #1FBA59;
}
.btn-wa:hover { background: #1FBA59; color: #fff; }

/* ── Botões de status no modal ── */
.modal-foot {
  flex-direction: column;
  gap: 14px;
  align-items: stretch;
}
.modal-foot-top {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.move-label {
  font-size: 12.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.modal-foot-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
}
.status-btn-group {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.btn-status-action {
  height: 36px; padding: 0 14px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600; font-family: var(--sans);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform var(--t-fast), background var(--t), color var(--t), border-color var(--t), box-shadow var(--t);
  background: var(--bg-soft);
  color: var(--ink-soft);
  border-color: var(--line-strong);
}
.btn-status-action:hover { border-color: #B7B3A3; color: var(--ink); }
.btn-status-action:active { transform: translateY(1px); }

/* Ativo = status atual do lead */
.btn-status-action.active[data-sid="contato"]        { background:#FFF6E5; color:#8C6A0F; border-color:#F6E2B0; }
.btn-status-action.active[data-sid="qualificado"]    { background:#E5F2EC; color:#2F7A55; border-color:#BFE0D0; }
.btn-status-action.active[data-sid="naoqualificado"] { background:#F7E2E0; color:var(--danger); border-color:#EFC7C3; }
.btn-status-action.active[data-sid="fechado"]        { background:var(--accent-100); color:var(--accent-700); border-color:#ECDCC2; }

/* Hover colorido (antecipa a cor do destino) */
.btn-status-action[data-sid="contato"]:hover        { background:#FFF6E5; color:#8C6A0F; border-color:#F6E2B0; }
.btn-status-action[data-sid="qualificado"]:hover    { background:#E5F2EC; color:#2F7A55; border-color:#BFE0D0; }
.btn-status-action[data-sid="naoqualificado"]:hover { background:#F7E2E0; color:var(--danger); border-color:#EFC7C3; }
.btn-status-action[data-sid="fechado"]:hover        { background:var(--accent-100); color:var(--accent-700); border-color:#ECDCC2; }

@media (max-width: 880px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; }
}
