/* ===========================================================
   Venus — "Twilight Venus" dark theme
   Indigo night · Venusian gold · sea-foam · rose
   =========================================================== */

:root {
  --bg:        #0B1020;   /* deep twilight indigo */
  --bg-2:      #0E1428;
  --surface:   #141B33;   /* card */
  --surface-2: #1A2240;   /* elevated / inputs */
  --line:      #283250;   /* hairline */
  --line-soft: #1F2840;

  --gold:      #F0C674;   /* planet glow — primary accent */
  --gold-deep: #E0A14B;
  --foam:      #5FD6BC;   /* sea-foam — success / contatado */
  --rose:      #F2899E;   /* love — due / alert */

  --text:      #F3EFE7;   /* pearl */
  --text-2:    #AEB9D6;   /* secondary */
  --muted:     #7E8AAB;   /* tertiary / meta */

  --wa:        #25D366;

  --radius:    16px;
  --radius-sm: 11px;
  --shadow:    0 18px 40px -22px rgba(0,0,0,.8);
  --glow-gold: 0 0 0 1px rgba(240,198,116,.18), 0 14px 38px -18px rgba(240,198,116,.45);

  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Manrope", system-ui, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 540px at 80% -8%, rgba(240,198,116,.10), transparent 60%),
    radial-gradient(900px 520px at -5% 8%, rgba(95,214,188,.07), transparent 55%),
    radial-gradient(800px 600px at 50% 120%, rgba(242,137,158,.06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  background: rgba(11,16,32,.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center;
  filter: drop-shadow(0 4px 14px rgba(240,198,116,.35));
  animation: floatIn .7s var(--ease) both;
}
.brand-mark svg { width: 42px; height: 42px; }
.brand-mark .star { transform-origin: 47px 14px; animation: twinkle 4.5s ease-in-out infinite; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600; font-size: 30px; letter-spacing: .5px;
  background: linear-gradient(135deg, #FBE3A6, #EDBB66 55%, #DE934A);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-tag {
  font-size: 9.5px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--muted); margin-top: 3px; font-weight: 600;
}
.counter {
  font-size: 12px; color: var(--text-2); font-weight: 600;
  padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,.02);
}
.counter b { color: var(--gold); }

/* ---------- Layout ---------- */
.container { max-width: 780px; margin: 0 auto; padding: 26px 22px 40px; }

.section-title {
  display: flex; align-items: center; gap: 9px;
  font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-2); margin: 28px 0 14px;
}
.section-title::before {
  content: "✦"; color: var(--gold); font-size: 11px; opacity: .85;
}
.due-section .section-title { color: var(--rose); }
.due-section .section-title::before { color: var(--rose); }

/* ---------- Filters ---------- */
.filters { display: flex; gap: 9px; flex-wrap: wrap; margin: 18px 0 16px; }
.chip {
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--text-2); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line);
  padding: 8px 16px; border-radius: 999px;
  transition: color .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease), transform .12s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--gold-deep); transform: translateY(-1px); }
.chip-active {
  color: #1a1306; font-weight: 700; border-color: transparent;
  background: linear-gradient(135deg, #FBE3A6, #EDBB66);
  box-shadow: 0 8px 20px -10px rgba(240,198,116,.6);
}

/* ---------- Card list ---------- */
.card-list { display: flex; flex-direction: column; gap: 13px; }

.lead-card {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  animation: cardIn .45s var(--ease) both;
  transition: transform .22s var(--ease), border-color .22s var(--ease), box-shadow .22s var(--ease);
}
/* status accent rail */
.lead-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--gold); opacity: .9;
}
.lead-card.s-contatado::before { background: var(--foam); }
.lead-card.s-concluido::before { background: var(--muted); }
.lead-card.s-concluido { opacity: .72; }
.lead-card.is-due::before { background: var(--rose); }
.lead-card.is-due {
  border-color: rgba(242,137,158,.35);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(242,137,158,.12), transparent 45%),
    linear-gradient(180deg, var(--surface), var(--bg-2));
}
.lead-card:hover { transform: translateY(-3px); border-color: rgba(240,198,116,.4); box-shadow: 0 24px 50px -24px rgba(0,0,0,.85), 0 0 0 1px rgba(240,198,116,.12); }

/* stagger first cards */
.lead-card:nth-child(1) { animation-delay: .02s; }
.lead-card:nth-child(2) { animation-delay: .08s; }
.lead-card:nth-child(3) { animation-delay: .14s; }
.lead-card:nth-child(4) { animation-delay: .20s; }
.lead-card:nth-child(5) { animation-delay: .26s; }
.lead-card:nth-child(6) { animation-delay: .32s; }

.lead-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.lead-name { font-size: 15.5px; font-weight: 700; color: var(--text); letter-spacing: .2px; }
.lead-pedido { color: var(--text-2); font-size: 12.5px; margin-top: 4px; line-height: 1.5; }
.lead-meta { color: var(--muted); font-size: 11px; margin-top: 7px; font-weight: 600; letter-spacing: .2px; }

/* ---------- Badges ---------- */
.badge {
  font-size: 10px; font-weight: 700; letter-spacing: .4px;
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  border: 1px solid transparent;
}
.badge.pendente   { color: var(--gold);  background: rgba(240,198,116,.12); border-color: rgba(240,198,116,.28); }
.badge.contatado  { color: var(--foam);  background: rgba(95,214,188,.12);  border-color: rgba(95,214,188,.28); }
.badge.concluido  { color: var(--muted); background: rgba(126,138,171,.12);  border-color: rgba(126,138,171,.26); }
.badge.due {
  color: #1a0d10; background: linear-gradient(135deg, #F7AABA, #F2899E);
  border-color: transparent; box-shadow: 0 6px 16px -8px rgba(242,137,158,.7);
}
.badge.due::before { content: "✦ "; }

/* ---------- Actions ---------- */
.lead-actions { display: flex; gap: 9px; align-items: center; margin-top: 15px; }
.wa-btn {
  text-decoration: none; display: inline-flex; align-items: center; gap: 7px;
  background: rgba(37,211,102,.12); color: #5ef0a0; border: 1px solid rgba(37,211,102,.32);
  font-size: 12px; font-weight: 700; padding: 8px 13px; border-radius: 10px;
  transition: background .2s var(--ease), transform .12s var(--ease);
}
.wa-btn:hover { background: rgba(37,211,102,.2); transform: translateY(-1px); }
.spacer { flex: 1; }
.status-select {
  font-family: inherit; font-size: 12px; font-weight: 600;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px;
  cursor: pointer; transition: border-color .2s var(--ease);
}
.status-select:hover { border-color: var(--gold-deep); }
.status-select option { background: #141B33; color: var(--text); }
.icon-btn {
  border: 1px solid var(--line); background: var(--surface-2); cursor: pointer;
  font-size: 14px; padding: 7px 9px; border-radius: 10px; line-height: 1;
  transition: border-color .2s var(--ease), transform .12s var(--ease), background .2s var(--ease);
}
.icon-btn:hover { transform: translateY(-1px); border-color: var(--gold-deep); background: rgba(240,198,116,.08); }

/* ---------- Empty ---------- */
.empty {
  text-align: center; color: var(--muted); font-size: 13.5px;
  padding: 48px 20px; border: 1px dashed var(--line); border-radius: var(--radius);
  background: rgba(255,255,255,.015);
}

/* ---------- FAB ---------- */
.fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 15;
  display: inline-flex; align-items: center; gap: 9px;
  font-family: inherit; font-size: 14px; font-weight: 800; letter-spacing: .2px;
  color: #1a1306; cursor: pointer; border: none;
  padding: 15px 22px; border-radius: 999px;
  background: linear-gradient(135deg, #FBE3A6, #EDBB66 55%, #DE934A);
  box-shadow: 0 16px 40px -14px rgba(240,198,116,.65), 0 0 0 1px rgba(255,255,255,.12) inset;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
  animation: floatIn .8s var(--ease) both;
}
.fab::before { content: "✦"; font-size: 13px; }
.fab:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 24px 50px -16px rgba(240,198,116,.8); }
.fab:active { transform: scale(.97); }

/* ---------- Modal ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 30; padding: 18px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,9,20,.66); backdrop-filter: blur(7px);
  animation: fade .22s var(--ease) both;
}
.modal {
  width: 460px; max-width: 100%;
  background: linear-gradient(180deg, #161E3A, #0F1528);
  border: 1px solid var(--line);
  border-radius: 22px; overflow: hidden;
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(240,198,116,.06);
  animation: modalIn .34s var(--ease) both;
}
.modal-head {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
  background:
    radial-gradient(120% 180% at 0% 0%, rgba(240,198,116,.14), transparent 55%);
}
.modal-head strong {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600; font-size: 22px; color: var(--text); letter-spacing: .4px;
}
.modal-close {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2);
  width: 32px; height: 32px; border-radius: 10px; cursor: pointer; font-size: 15px;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.modal-close:hover { color: var(--rose); border-color: var(--rose); }
.modal-body { padding: 22px; }

.field { display: block; margin-bottom: 16px; }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }
.field-label {
  display: block; font-size: 10.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 7px;
}
.field input, .field textarea {
  width: 100%; font-family: inherit; font-size: 13.5px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 13px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: #5a6a8a; }
.field textarea { min-height: 132px; resize: vertical; line-height: 1.55; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--gold-deep);
  box-shadow: 0 0 0 3px rgba(240,198,116,.15);
}
/* date picker icon visible on dark */
.field input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.85) sepia(1) saturate(3) hue-rotate(2deg); cursor: pointer; }

.field-error { display: none; color: var(--rose); font-size: 11px; margin-top: 6px; font-weight: 600; }
.field-error.show { display: block; }

.modal-actions { display: flex; gap: 11px; margin-top: 20px; }
.btn { font-family: inherit; border-radius: 12px; font-size: 13.5px; font-weight: 700; padding: 13px; cursor: pointer; border: none; transition: transform .14s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease); }
.btn-ghost { flex: 1; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.btn-ghost:hover { color: var(--text); border-color: var(--gold-deep); }
.btn-primary {
  flex: 2; color: #1a1306;
  background: linear-gradient(135deg, #FBE3A6, #EDBB66 55%, #DE934A);
  box-shadow: 0 14px 32px -14px rgba(240,198,116,.6);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 20px 44px -16px rgba(240,198,116,.75); }
.btn-primary:disabled { opacity: .55; cursor: default; transform: none; }

/* ---------- Footer ---------- */
.footer {
  max-width: 780px; margin: 30px auto 0; padding: 26px 22px 36px;
  text-align: center; border-top: 1px solid var(--line-soft);
}
.footer .mark { width: 22px; height: 22px; opacity: .8; margin: 0 auto 10px; }
.footer p { margin: 0; font-size: 11.5px; color: var(--muted); letter-spacing: .4px; }
.footer .powered b { color: var(--text-2); font-weight: 700; }

/* ---------- Utilities ---------- */
.hidden { display: none !important; }

/* ---------- Keyframes ---------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(26px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes floatIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes twinkle { 0%,100% { opacity: 1; transform: scale(1); } 45% { opacity: .55; transform: scale(.82); } }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .brand-name { font-size: 25px; }
  .counter { font-size: 11px; padding: 6px 11px; }
  .field-row { flex-direction: column; gap: 0; }
  .fab { right: 16px; bottom: 16px; padding: 13px 18px; }
  .container { padding: 20px 16px 36px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
