:root {
  --laranja: #E8722B;
  --laranja-escuro: #C75A1A;
  --verde: #3E7D54;
  --verde-claro: #6BAE81;
  --texto: #2A2520;
  --muted: #7B7167;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-shadow: 0 8px 32px rgba(60, 40, 15, 0.14);
  --radius: 18px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--texto);
  font-size: 15px;
  position: relative;
  background:
    radial-gradient(closest-side at 100% 100%, rgba(62, 125, 84, 0.12), transparent 70%),
    linear-gradient(135deg, #FBF4EA 0%, #F6EEE2 45%, #EFF3EC 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}
/* blobs de cor desfocados (suporte do glass) */
body::before, body::after {
  content: ""; position: fixed; z-index: -1; border-radius: 50%;
  filter: blur(90px); opacity: .5; pointer-events: none;
}
body::before { width: 480px; height: 480px; background: var(--laranja); top: -140px; left: -120px; }
body::after { width: 520px; height: 520px; background: var(--verde-claro); bottom: -180px; right: -140px; }

.hidden { display: none !important; }
button { cursor: pointer; font-family: inherit; }

/* ÍCONES */
.ic { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; vertical-align: -0.18em; }
.ic-fill { fill: currentColor; stroke: none; }

/* LOGIN */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--glass-border);
  padding: 40px; border-radius: 24px; width: 350px; text-align: center;
  box-shadow: var(--glass-shadow);
}
.brand-svg { width: 56px; height: 56px; }
.login-card h1 { font-size: 26px; margin: 10px 0 0; }
.login-card h1 span { color: var(--laranja); font-style: italic; font-weight: 500; }
.login-card .muted { color: var(--muted); margin-bottom: 24px; font-size: 14px; }
.login-card input {
  width: 100%; padding: 13px 14px; border: 1px solid var(--glass-border);
  border-radius: 12px; margin-bottom: 12px; font-size: 15px; background: rgba(255,255,255,.6);
}
.login-card button {
  width: 100%; padding: 13px; background: var(--laranja); color: #fff; border: none;
  border-radius: 12px; font-size: 16px; font-weight: 600; transition: .15s;
}
.login-card button:hover { background: var(--laranja-escuro); }
.erro { color: #C0392B; font-size: 13px; margin-top: 10px; min-height: 16px; }

/* APP LAYOUT */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; padding: 22px 16px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; margin: 14px 0 14px 14px; border-radius: var(--radius);
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.logo { display: flex; align-items: center; gap: 11px; margin-bottom: 28px; padding: 0 6px; }
.logo .brand-svg { width: 36px; height: 36px; }
.logo strong { display: block; font-size: 16px; }
.logo small { color: var(--laranja); font-style: italic; }
nav { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.nav-btn {
  display: flex; align-items: center; gap: 11px; text-align: left; padding: 11px 14px;
  border: 1px solid transparent; background: transparent; border-radius: 12px;
  font-size: 14.5px; color: var(--texto); transition: .15s;
}
.nav-btn .ic { width: 18px; height: 18px; }
.nav-btn:hover { background: rgba(255,255,255,.5); }
.nav-btn.active { background: var(--laranja); color: #fff; font-weight: 600; box-shadow: 0 4px 14px rgba(232,114,43,.35); }
.logout {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px; background: rgba(255,255,255,.4); border: 1px solid var(--glass-border);
  border-radius: 12px; color: var(--muted); transition: .15s;
}
.logout:hover { border-color: var(--laranja); color: var(--laranja); }

.content { flex: 1; padding: 30px 38px; max-width: 1200px; }
.view-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.view-head h2 { font-size: 25px; display: flex; align-items: center; gap: 10px; }
.view-head p { color: var(--muted); font-size: 14px; margin-top: 3px; }

/* BOTOES */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 18px;
  background: var(--laranja); color: #fff; border: none; border-radius: 12px;
  font-weight: 600; font-size: 14px; transition: .15s; text-decoration: none;
}
.btn:hover { background: var(--laranja-escuro); }
.btn-sec {
  background: rgba(255,255,255,.5); color: var(--texto); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.btn-sec:hover { border-color: var(--laranja); color: var(--laranja); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-danger { background: rgba(192,57,43,.08); color: #C0392B; border: 1px solid rgba(192,57,43,.25); }
.btn-danger:hover { background: #C0392B; color: #fff; }
.btn-ok { background: rgba(62,125,84,.1); color: var(--verde); border: 1px solid rgba(62,125,84,.3); }
.btn-ok:hover { background: var(--verde); color: #fff; }
.btn .ic, .btn-sec .ic, .btn-danger .ic, .btn-ok .ic { width: 16px; height: 16px; }

/* CARTOES GLASS */
.glass-panel, .panel, .stat, .tile, .modal-box, .login-card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat { border-radius: var(--radius); padding: 20px; }
.stat .ic-wrap { width: 38px; height: 38px; border-radius: 11px; background: rgba(232,114,43,.14); color: var(--laranja); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.stat .ic-wrap .ic { width: 20px; height: 20px; }
.stat .num { font-size: 30px; font-weight: 700; color: var(--laranja); line-height: 1; }
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 5px; }

.panel { border-radius: var(--radius); padding: 22px; margin-bottom: 22px; }
.panel h3 { font-size: 17px; margin-bottom: 16px; display: flex; align-items: center; gap: 9px; }
.panel h3 .ic { width: 19px; height: 19px; color: var(--laranja); }

/* TABELA */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--glass-border); letter-spacing: .03em; }
td { padding: 12px; border-bottom: 1px solid rgba(255,255,255,.45); font-size: 14px; vertical-align: middle; }
tr:hover td { background: rgba(255,255,255,.35); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* BADGES */
.badge { display: inline-block; padding: 4px 11px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.b-a_contactar { background: rgba(232,114,43,.16); color: var(--laranja-escuro); }
.b-contactado { background: rgba(44,107,179,.14); color: #2C6BB3; }
.b-em_conversa { background: rgba(163,125,0,.16); color: #A37D00; }
.b-fechado { background: rgba(62,125,84,.16); color: var(--verde); }
.b-sem_interesse { background: rgba(123,113,103,.16); color: var(--muted); }
.b-pendente { background: rgba(163,125,0,.16); color: #A37D00; }
.b-confirmado { background: rgba(62,125,84,.16); color: var(--verde); }
.b-cancelado { background: rgba(123,113,103,.16); color: var(--muted); }
.b-novo { background: rgba(232,114,43,.16); color: var(--laranja-escuro); }
.b-qualificado { background: rgba(44,107,179,.14); color: #2C6BB3; }
.b-convertido { background: rgba(62,125,84,.16); color: var(--verde); }
.b-descartado { background: rgba(123,113,103,.16); color: var(--muted); }
.lead-estado-sel { border: none; padding: 4px 24px 4px 11px; width: auto; cursor: pointer; -webkit-appearance: none; appearance: none; background-position: right 7px center; background-repeat: no-repeat; background-size: 9px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%237B7167' stroke-width='3'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); }
.nicho-tag { font-size: 12px; color: var(--verde); font-weight: 600; }
.followup-due { color: #C0392B; font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 32px; font-style: italic; }

/* FORM */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--glass-border); border-radius: 11px;
  font-size: 14px; font-family: inherit; background: rgba(255,255,255,.6);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--laranja); background: #fff; }
textarea { resize: vertical; min-height: 90px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; grid-column: 1 / -1; }

/* MODAL */
.modal { position: fixed; inset: 0; background: rgba(40,30,15,.35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100; }
.modal-box { border-radius: 20px; width: 100%; max-width: 640px; max-height: 90vh; overflow-y: auto; background: var(--glass-strong); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--glass-border); position: sticky; top: 0; background: var(--glass-strong); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); border-radius: 20px 20px 0 0; }
.modal-head h3 { font-size: 19px; }
#modal-close { display: flex; background: none; border: none; color: var(--muted); padding: 4px; border-radius: 8px; }
#modal-close:hover { color: var(--laranja); background: rgba(255,255,255,.5); }
#modal-body { padding: 24px; }

/* TILES */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.tile { border-radius: var(--radius); padding: 20px; }
.tile h4 { font-size: 15px; margin-bottom: 7px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.tile .desc { color: var(--muted); font-size: 13px; margin-bottom: 14px; white-space: pre-wrap; max-height: 120px; overflow: hidden; }
.tile-foot { display: flex; gap: 8px; flex-wrap: wrap; }

/* TOAST */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: rgba(62,125,84,.92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; padding: 13px 24px; border-radius: 12px; box-shadow: var(--glass-shadow); z-index: 200; font-weight: 500; display: flex; align-items: center; gap: 8px; }

.gen-output { width: 100%; min-height: 220px; font-family: inherit; }
.gen-row { display: flex; gap: 10px; margin-bottom: 14px; }

@media (max-width: 760px) {
  .app { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: relative; flex-direction: row; flex-wrap: wrap; align-items: center; margin: 10px; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; flex: 1; }
  .logout { width: auto; }
  .content { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
}
