/* =======================================================
   OLYMPUS · MANDA LEAD — Identidade Visual
   Paleta: preto + escala silver (8 tons) + ouro champagne
   Tipografia: Cinzel (brand) + Inter (UI)
   ======================================================= */

:root {
  /* Backgrounds — escala de pretos com nuance */
  --bg-0:        #000000;   /* puro */
  --bg-1:        #0a0a0c;   /* off-black */
  --bg-2:        #131317;   /* graphite */
  --bg-3:        #18181d;   /* card surface */
  --bg-4:        #1f1f25;   /* elevated / hover */
  --bg-5:        #2a2a31;   /* active / pressed */

  /* Silver — escala de prata metálica (do logo) */
  --silver-50:   #fafafa;
  --silver-100:  #ececef;
  --silver-200:  #c0c0c5;
  --silver-300:  #9a9aa1;
  --silver-400:  #6c6c74;
  --silver-500:  #4a4a52;
  --silver-600:  #2e2e35;

  /* Acentos premium */
  --gold:        #c9a84c;   /* champagne gold */
  --gold-soft:   #b89236;

  /* Estados semânticos */
  --ok:          #2ec27e;
  --warn:        #f5b342;
  --err:         #ef4444;
  --info:        #6aa9ff;

  /* Linhas e divisores (com tinta prata translúcida) */
  --line:        rgba(192, 192, 200, 0.10);
  --line-soft:   rgba(192, 192, 200, 0.06);
  --line-strong: rgba(192, 192, 200, 0.20);

  /* Gradients premium */
  --grad-silver:        linear-gradient(180deg, #fafafa 0%, #e6e6e9 35%, #b8b8be 100%);
  --grad-silver-active: linear-gradient(180deg, #ffffff 0%, #d8d8dc 50%, #a0a0a8 100%);
  --grad-card:          linear-gradient(180deg, rgba(255,255,255,0.025) 0%, rgba(255,255,255,0) 60%);
  --grad-bg-radial:     radial-gradient(1100px 600px at 50% -10%, rgba(192,192,200,.06), transparent 70%);

  /* Sombras multi-layer (depth realista) */
  --shadow-sm:    0 1px 2px rgba(0,0,0,.5);
  --shadow-md:    0 4px 12px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.5);
  --shadow-lg:    0 12px 32px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.5);
  --shadow-xl:    0 24px 56px rgba(0,0,0,.55), 0 4px 12px rgba(0,0,0,.4);
  --shadow-glow:  0 0 24px rgba(192,192,200,.10);
  --shadow-card:  0 1px 0 rgba(255,255,255,.04) inset, 0 8px 24px rgba(0,0,0,.4);
  --shadow-inset: inset 0 1px 0 rgba(255,255,255,.05);

  /* Geometria */
  --radius:       10px;
  --radius-sm:    6px;
  --radius-lg:    14px;
  --radius-pill:  999px;

  /* Tipografia */
  --font-brand:   'Cinzel', 'Times New Roman', serif;
  --font-ui:      'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, "SF Mono", monospace;

  /* Transitions */
  --t-fast:   120ms cubic-bezier(.4, 0, .2, 1);
  --t-base:   200ms cubic-bezier(.4, 0, .2, 1);
  --t-slow:   320ms cubic-bezier(.4, 0, .2, 1);
}

/* Reset suave */
* { box-sizing: border-box; }
*::selection { background: rgba(192,192,200,.25); color: var(--silver-50); }

html, body {
  margin: 0; padding: 0;
  background: var(--bg-0);
  color: var(--silver-100);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  height: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; cursor: pointer; }
input, textarea, select {
  font-family: inherit; font-size: 14px;
  background: var(--bg-1);
  color: var(--silver-100);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  outline: none;
  transition: border-color var(--t-base), box-shadow var(--t-base);
}
input:hover, textarea:hover, select:hover { border-color: var(--line-strong); }
input:focus, textarea:focus, select:focus {
  border-color: var(--silver-200);
  box-shadow: 0 0 0 3px rgba(192,192,200,.10);
}
::placeholder { color: var(--silver-400); }

/* Animações reutilizáveis */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { opacity: .55; } }
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ======================================================
   LOGIN
   ====================================================== */
.login-bg {
  display: flex; align-items: center; justify-content: center;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(192,192,200,.10), transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(201,168,76,.04), transparent 70%),
    var(--bg-0);
  padding: 24px;
}
.login-card {
  width: 380px; max-width: 100%;
  background: linear-gradient(180deg, var(--bg-3) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 36px 32px 28px;
  box-shadow: var(--shadow-xl), var(--shadow-inset);
  animation: scaleIn 320ms cubic-bezier(.4, 0, .2, 1);
  position: relative;
}
.login-card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, rgba(192,192,200,.18), transparent 50%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.login-logo {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  margin-bottom: 26px;
}
.login-logo img {
  width: 64px; height: 64px;
  filter: drop-shadow(0 4px 16px rgba(192,192,200,.18));
}
.login-logo h1 {
  margin: 0;
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 6px;
  color: var(--silver-50);
  text-align: center;
}
.login-logo .sub {
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--silver-400);
  text-transform: uppercase;
}
.login-card label {
  display: block;
  font-size: 11px;
  letter-spacing: 1.2px;
  color: var(--silver-300);
  margin: 14px 0 6px;
  text-transform: uppercase;
  font-weight: 500;
}
.login-card input { width: 100%; }
.login-card .err {
  color: var(--err);
  font-size: 12px;
  margin-top: 10px;
  min-height: 16px;
}
.login-card button[type="submit"] {
  width: 100%;
  margin-top: 22px;
  background: var(--grad-silver);
  color: #1a1a1f;
  border: none;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  letter-spacing: 1.4px;
  font-size: 12px;
  text-transform: uppercase;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform var(--t-fast), box-shadow var(--t-base), background var(--t-base);
}
.login-card button[type="submit"]:hover {
  background: var(--grad-silver-active);
  box-shadow: var(--shadow-lg), 0 0 24px rgba(192,192,200,.15), inset 0 1px 0 rgba(255,255,255,.5);
  transform: translateY(-1px);
}
.login-card button[type="submit"]:active { transform: translateY(0) scale(.99); }

/* ======================================================
   APP LAYOUT
   ====================================================== */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  height: 100dvh;
}

/* Sidebar */
.sidebar {
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 100%);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 20px 14px;
  box-shadow: 1px 0 0 var(--line-soft);
}
.sidebar .brand {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 8px 0 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.sidebar .brand img {
  width: 44px; height: 44px;
  filter: drop-shadow(0 2px 8px rgba(192,192,200,.15));
}
.sidebar .brand-name {
  font-family: var(--font-brand);
  font-weight: 700;
  letter-spacing: 4px;
  font-size: 14px;
  color: var(--silver-50);
}
.sidebar .brand small {
  display: block;
  color: var(--silver-400);
  font-family: var(--font-ui);
  font-weight: 500;
  letter-spacing: 3.5px;
  font-size: 9px;
  text-transform: uppercase;
}

.nav-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; margin-bottom: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--silver-300);
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .3px;
  width: 100%;
  position: relative;
  transition: background var(--t-base), color var(--t-base), border-color var(--t-base);
}
.nav-btn:hover {
  background: var(--bg-3);
  color: var(--silver-50);
}
.nav-btn.active {
  background: linear-gradient(180deg, var(--bg-4), var(--bg-3));
  color: var(--silver-50);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm), var(--shadow-inset);
}
.nav-btn .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--silver-500);
  flex-shrink: 0;
  transition: background var(--t-base), box-shadow var(--t-base);
}
.nav-btn:hover .dot { background: var(--silver-300); }
.nav-btn.active .dot {
  background: var(--silver-100);
  box-shadow: 0 0 12px rgba(192,192,200,.6);
}

.user-box {
  margin-top: auto;
  padding: 14px 4px 4px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--silver-400);
}
.user-box .name {
  color: var(--silver-50);
  font-weight: 600;
  letter-spacing: .3px;
}
.user-box .role {
  color: var(--silver-300);
  font-size: 11px;
  letter-spacing: .5px;
  margin-top: 2px;
}
.user-box button {
  margin-top: 10px;
  width: 100%;
  background: transparent;
  color: var(--silver-300);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-size: 12px;
  letter-spacing: .3px;
  transition: all var(--t-base);
}
.user-box button:hover {
  color: var(--silver-50);
  border-color: var(--silver-400);
  background: var(--bg-3);
}

/* Main */
.main {
  overflow: hidden;
  display: flex; flex-direction: column;
  background: var(--bg-0);
  position: relative;
}
.main::before {
  content: '';
  position: absolute; inset: 0;
  background: var(--grad-bg-radial);
  pointer-events: none;
  opacity: .4;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 26px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 100%);
  position: relative;
  z-index: 1;
}
.topbar h2 {
  margin: 0;
  font-family: var(--font-brand);
  color: var(--silver-50);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 4px;
  text-transform: uppercase;
}
.topbar .wa-status {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
  color: var(--silver-400);
}

.wa-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-3);
  border: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: .3px;
  transition: all var(--t-base);
}
.wa-pill .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--silver-400);
  transition: all var(--t-base);
}
.wa-pill.ready  { color: var(--ok); border-color: rgba(46,194,126,.25); }
.wa-pill.ready  .dot { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.wa-pill.qr     { color: var(--warn); border-color: rgba(245,179,66,.25); animation: pulse 2s infinite; }
.wa-pill.qr     .dot { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.wa-pill.off    { color: var(--err); border-color: rgba(239,68,68,.25); }
.wa-pill.off    .dot { background: var(--err); }

.view {
  flex: 1;
  overflow: auto;
  padding: 24px;
  position: relative; z-index: 1;
  animation: fadeInUp 280ms cubic-bezier(.4, 0, .2, 1);
}

/* ======================================================
   BOTÕES & CHIPS
   ====================================================== */
.btn {
  background: linear-gradient(180deg, var(--bg-4), var(--bg-3));
  color: var(--silver-100);
  border: 1px solid var(--line-strong);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .2px;
  box-shadow: var(--shadow-sm), var(--shadow-inset);
  transition: all var(--t-base);
}
.btn:hover {
  border-color: var(--silver-400);
  color: var(--silver-50);
  background: linear-gradient(180deg, var(--bg-5), var(--bg-4));
}
.btn:active { transform: translateY(0.5px); }
.btn:disabled {
  opacity: .4;
  cursor: not-allowed;
  transform: none !important;
}

.btn.primary {
  background: var(--grad-silver);
  color: #18181d;
  border-color: var(--silver-200);
  font-weight: 600;
  letter-spacing: .3px;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,.4);
}
.btn.primary:hover {
  background: var(--grad-silver-active);
  box-shadow: var(--shadow-lg), 0 0 16px rgba(192,192,200,.18), inset 0 1px 0 rgba(255,255,255,.5);
  transform: translateY(-1px);
}
.btn.primary:active { transform: translateY(0); }

.btn.danger { color: var(--err); border-color: rgba(239,68,68,.4); }
.btn.danger:hover { color: #ff6c6c; border-color: var(--err); background: rgba(239,68,68,.06); }

.btn.small { padding: 5px 11px; font-size: 11.5px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  letter-spacing: .4px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--silver-300);
  font-weight: 500;
  text-transform: uppercase;
}
.chip.ok    { color: var(--ok);    border-color: rgba(46,194,126,.30);  background: rgba(46,194,126,.06); }
.chip.neg   { color: var(--info);  border-color: rgba(106,169,255,.30); background: rgba(106,169,255,.06); }
.chip.warn  { color: var(--warn);  border-color: rgba(245,179,66,.30);  background: rgba(245,179,66,.06); }
.chip.err   { color: var(--err);   border-color: rgba(239,68,68,.30);   background: rgba(239,68,68,.06); }
.chip.none  { color: var(--silver-400); }
.chip.new   {
  background: var(--grad-silver);
  color: #18181d;
  border-color: var(--silver-200);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(192,192,200,.20);
}

/* ======================================================
   TABELA
   ====================================================== */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--silver-100);
}
.table th {
  color: var(--gold);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  background: rgba(201, 168, 76, 0.10);
  border-bottom: 1px solid rgba(201, 168, 76, 0.35);
}
.table tr { transition: background var(--t-fast); }
.table tr:hover td { background: var(--bg-3); }

/* Cards */
.card {
  background: var(--bg-3);
  background-image: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
  position: relative;
}
.card h3 {
  margin: 0 0 14px;
  color: var(--silver-50);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

/* ======================================================
   LEADS — chat layout
   ====================================================== */
.chat-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: 100%;
}
.lead-list {
  border-right: 1px solid var(--line);
  background: var(--bg-1);
  overflow: auto;
}
.lead-search {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
  position: sticky; top: 0; z-index: 1;
  backdrop-filter: blur(8px);
}
.lead-search input { width: 100%; }
.lead-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background var(--t-fast);
  position: relative;
}
.lead-item:hover { background: var(--bg-3); }
.lead-item.active {
  background: var(--bg-3);
  background-image: var(--grad-card);
}
.lead-item.active::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--grad-silver);
}
.lead-item .avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-4), var(--bg-2));
  display: flex; align-items: center; justify-content: center;
  color: var(--silver-200);
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-inset);
}
.lead-item .meta { flex: 1; min-width: 0; }
.lead-item .meta .top { display: flex; justify-content: space-between; gap: 8px; }
.lead-item .meta .name {
  color: var(--silver-50);
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lead-item .meta .time { font-size: 10.5px; color: var(--silver-400); flex-shrink: 0; }
.lead-item .meta .preview {
  font-size: 11.5px;
  color: var(--silver-400);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.lead-item .badge {
  background: var(--grad-silver);
  color: #18181d;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  box-shadow: 0 0 8px rgba(192,192,200,.20);
}

.chat-pane { display: flex; flex-direction: column; height: 100%; min-width: 0; }
.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
  gap: 16px;
}
.chat-header .lead-name {
  color: var(--silver-50);
  font-weight: 600;
  font-size: 14px;
}
.chat-header .lead-phone {
  color: var(--silver-400);
  font-size: 11px;
  margin-top: 2px;
}
.chat-header .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.chat-body {
  flex: 1; overflow: auto;
  padding: 20px;
  background:
    radial-gradient(800px 500px at 50% 0%, rgba(192,192,200,.03), transparent 70%),
    var(--bg-0);
}
.bubble {
  max-width: 70%;
  padding: 9px 13px;
  margin: 5px 0;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  word-wrap: break-word; word-break: break-word;
  animation: fadeInUp 240ms cubic-bezier(.4, 0, .2, 1);
}
.bubble.in {
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--silver-100);
  margin-right: auto;
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}
.bubble.out {
  background: var(--grad-silver);
  color: #18181d;
  margin-left: auto;
  border-bottom-right-radius: 4px;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,.35);
}
.bubble .time { font-size: 10px; opacity: .65; margin-top: 4px; }
.bubble-state {
  margin-left: 6px;
  opacity: .8;
  font-style: italic;
}
.bubble-state.err { color: var(--err); font-weight: 500; opacity: 1; }

/* Estado "enviando" — bubble translúcido com shimmer sutil */
.bubble.bubble-pending {
  opacity: .72;
  position: relative;
  overflow: hidden;
}
.bubble.bubble-pending::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.12) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  pointer-events: none;
}

/* Estado "falhou" — borda vermelha + tom de erro */
.bubble.bubble-error {
  border: 1px solid var(--err);
  box-shadow: 0 0 0 1px rgba(239,68,68,.25);
}
.bubble img, .bubble video {
  max-width: 100%;
  border-radius: var(--radius-sm);
  display: block;
  margin-top: 4px;
}
.bubble audio { width: 100%; margin-top: 4px; }

.chat-input {
  display: flex; gap: 10px; align-items: center;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--bg-1);
}
.chat-input input[type="text"] { flex: 1; }
.icon-btn {
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--silver-300);
  border-radius: var(--radius-sm);
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: all var(--t-base);
}
.icon-btn:hover {
  color: var(--silver-50);
  border-color: var(--silver-400);
  background: var(--bg-4);
}
.icon-btn.recording {
  color: var(--err);
  border-color: var(--err);
  background: rgba(239,68,68,.08);
  animation: pulse 1.2s infinite;
}

.chat-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%;
  color: var(--silver-400);
  font-size: 13px;
  text-align: center;
}

/* ======================================================
   MODAL
   ====================================================== */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  z-index: 100;
}
.modal-bg.open { display: flex; animation: fadeIn 180ms ease-out; }
.modal {
  background: linear-gradient(180deg, var(--bg-3) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  width: 440px; max-width: 92%;
  padding: 26px;
  box-shadow: var(--shadow-xl), var(--shadow-inset);
  animation: scaleIn 220ms cubic-bezier(.4, 0, .2, 1);
}
.modal h3 {
  margin: 0 0 16px;
  color: var(--silver-50);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.modal label {
  display: block;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--silver-300);
  margin: 12px 0 6px;
  text-transform: uppercase;
}
.modal input, .modal select { width: 100%; }
.modal .actions {
  display: flex; gap: 10px;
  justify-content: flex-end;
  margin-top: 22px;
}
.modal .err {
  color: var(--err);
  font-size: 12px;
  min-height: 14px;
  margin-top: 10px;
}

/* ======================================================
   DASHBOARD — KPIs e barras
   ====================================================== */
.kpi {
  background: var(--bg-3);
  background-image: var(--grad-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--t-base), transform var(--t-base);
}
.kpi:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}
.kpi .label {
  color: var(--silver-400);
  font-size: 10.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  font-weight: 600;
}
.kpi .value {
  color: var(--silver-50);
  font-size: 30px;
  font-weight: 600;
  margin-top: 6px;
  font-feature-settings: "tnum";
  letter-spacing: -0.5px;
}
.kpi .sub {
  color: var(--silver-300);
  font-size: 12px;
  margin-top: 2px;
}

.bar {
  height: 6px;
  background: var(--bg-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 4px;
}
.bar > span {
  display: block;
  height: 100%;
  background: var(--grad-silver);
  box-shadow: 0 0 8px rgba(192,192,200,.20);
  border-radius: inherit;
  transition: width var(--t-slow);
}

/* ======================================================
   QR Code overlay
   ====================================================== */
.qr-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none; align-items: center; justify-content: center;
  z-index: 200;
}
.qr-overlay.open { display: flex; animation: fadeIn 200ms; }
.qr-card {
  background: #fff;
  padding: 24px;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-xl), 0 0 80px rgba(192,192,200,.15);
  animation: scaleIn 280ms cubic-bezier(.4, 0, .2, 1);
}
.qr-card img { width: 280px; height: 280px; border-radius: var(--radius-sm); }
.qr-card p {
  color: #1a1a1f;
  margin: 14px 0 0;
  font-size: 13px;
  letter-spacing: .2px;
}
.qr-card button { margin-top: 14px; }

/* ======================================================
   PAGINAÇÃO (lista de LEADS)
   ====================================================== */
.lead-pagination {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: var(--bg-1);
  position: sticky;
  bottom: 0;
  z-index: 1;
  backdrop-filter: blur(8px);
}
.lead-pagination .btn.small {
  min-width: 32px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 600;
}
.lead-pagination .pagination-info {
  font-size: 11px;
  color: var(--silver-400);
  letter-spacing: .3px;
  font-feature-settings: "tnum";
  text-align: center;
  flex: 1;
}

/* ======================================================
   LEAD LINK (clicável em Acompanhamento)
   ====================================================== */
.lead-link {
  color: var(--silver-50);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: border-color var(--t-base), color var(--t-base);
  position: relative;
  padding-right: 14px;
}
.lead-link::after {
  content: '→';
  position: absolute;
  right: 0; top: 0;
  opacity: 0;
  color: var(--silver-300);
  transition: opacity var(--t-base), transform var(--t-base);
}
.lead-link:hover {
  color: var(--silver-50);
  border-bottom-color: var(--silver-400);
}
.lead-link:hover::after {
  opacity: 1;
  transform: translateX(2px);
}

/* Highlight pulse quando o lead é selecionado vindo de outra aba */
.lead-item.just-selected {
  animation: leadHighlight 1.4s ease-out;
}
@keyframes leadHighlight {
  0%   { box-shadow: 0 0 0 0 rgba(192,192,200,.55); }
  40%  { box-shadow: 0 0 18px 4px rgba(192,192,200,.40); }
  100% { box-shadow: 0 0 0 0 rgba(192,192,200,0); }
}

/* ======================================================
   ONLINE TOGGLE
   ====================================================== */
.online-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
}
.online-toggle input { display: none; }
.online-slider {
  width: 32px; height: 18px;
  background: var(--bg-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  position: relative;
  transition: all var(--t-base);
}
.online-slider::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  background: var(--silver-400);
  border-radius: 50%;
  transition: transform var(--t-base), background var(--t-base);
  box-shadow: var(--shadow-sm);
}
.online-slider.on {
  background: rgba(46,194,126,.20);
  border-color: rgba(46,194,126,.50);
  box-shadow: 0 0 10px rgba(46,194,126,.20);
}
.online-slider.on::after {
  transform: translateX(14px);
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}
.online-label {
  font-size: 10.5px;
  color: var(--silver-400);
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 500;
}

/* ======================================================
   SCROLLBAR
   ====================================================== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb {
  background: var(--bg-4);
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg-1);
}
::-webkit-scrollbar-thumb:hover { background: var(--silver-500); }

/* ======================================================
   UTILITÁRIOS
   ====================================================== */
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.muted { color: var(--silver-400); }
.right { text-align: right; }
.no-data {
  padding: 40px 20px;
  text-align: center;
  color: var(--silver-400);
  font-size: 13px;
}

/* compatibilidade reversa com nomes antigos */
:root {
  --black:        var(--bg-0);
  --black-soft:   var(--bg-1);
  --black-card:   var(--bg-3);
  --silver:       var(--silver-200);
  --silver-dark:  var(--silver-400);
  --silver-light: var(--silver-100);
  --white:        var(--silver-50);
  --line-soft:    var(--line-soft);
  --shadow:       var(--shadow-md);
  --font:         var(--font-ui);
}

/* ===== REFIT-2026-06: polish premium (logo, transicoes de aba, nav) ===== */
@keyframes viewSwitchIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.view:not(.hidden) { animation: viewSwitchIn .28s cubic-bezier(.22,.61,.36,1) both; }
.login-logo img, .sidebar .brand img { object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,.55)) drop-shadow(0 0 18px rgba(201,168,76,.16)); transition: filter .3s ease, transform .3s ease; }
.login-logo img { width: 132px; height: 132px; }
.login-logo img:hover { transform: translateY(-1px); filter: drop-shadow(0 4px 12px rgba(0,0,0,.6)) drop-shadow(0 0 28px rgba(201,168,76,.30)); }
.sidebar .brand img { width: 58px; height: 58px; }
.nav-btn { position: relative; transition: background .22s ease, color .22s ease, transform .18s ease; }
.nav-btn::before { content: ''; position: absolute; left: 0; top: 50%; width: 3px; height: 58%; border-radius: 0 3px 3px 0; background: linear-gradient(180deg, var(--gold) 0%, var(--gold-soft) 100%); transform: translateY(-50%) scaleY(0); transform-origin: center; transition: transform .26s cubic-bezier(.22,.61,.36,1); }
.nav-btn.active::before { transform: translateY(-50%) scaleY(1); }
.nav-btn:hover:not(.active) { transform: translateX(2px); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.btn, input, select, textarea, .lead-item, .icon-btn { transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease, transform .12s ease; }
.btn:active { transform: translateY(1px) scale(.99); }
::-webkit-scrollbar-thumb:hover { background: var(--gold-soft) !important; }
@media (prefers-reduced-motion: reduce) { .view:not(.hidden) { animation: none; } .nav-btn, .nav-btn::before, .login-logo img, .btn { transition: none; } }

.lead-tags { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 6px; }

/* GOLD-2026-06: cabecalho de tabela em ouro champagne + tabela nao vaza da borda do card */
.card:has(.table) { overflow-x: auto; }
