/* Layout do painel admin: sidebar + topbar + conteúdo */

.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

.sidebar {
  background: linear-gradient(180deg, #0d1117 0%, #080808 100%);
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sb-brand {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; border-bottom: 1px solid var(--border); margin-bottom: 14px;
}
.sb-brand-logo {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, var(--green-1), var(--green-2));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 18px;
  box-shadow: 0 4px 12px rgba(22, 163, 74, .35);
}
.sb-brand-text { line-height: 1.1; }
.sb-brand-text .t1 { font-weight: 800; font-size: 14px; }
.sb-brand-text .t2 { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

.sb-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sb-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-md);
  color: var(--muted); font-weight: 500; font-size: 14px;
  transition: color var(--t-fast), background var(--t-fast);
  position: relative;
}
.sb-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sb-link:hover { color: var(--text); background: var(--card-2); }
.sb-link.active {
  color: var(--green-2); background: var(--green-soft);
  font-weight: 600;
}
.sb-link.active::before {
  content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px;
  background: var(--green-1); border-radius: 0 3px 3px 0;
  animation: slideInUp var(--t-med) var(--ease-out);
}

.sb-foot {
  border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px;
  display: flex; align-items: center; gap: 10px;
}
.sb-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--green-1); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px;
}
.sb-user { line-height: 1.2; flex: 1; min-width: 0; }
.sb-user .n { font-size: 13px; font-weight: 600; }
.sb-user .r { font-size: 11px; color: var(--muted); }
.sb-logout { background: none; border: none; color: var(--muted); padding: 6px; border-radius: var(--r-sm); }
.sb-logout:hover { color: var(--error); background: var(--card-2); }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 60px; background: rgba(8, 8, 8, .75); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 32px; gap: 16px;
  position: sticky; top: 0; z-index: 40;
}
.tb-crumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.tb-crumb .sep { opacity: .5; }
.tb-crumb .cur { color: var(--text); font-weight: 600; }
.tb-search {
  flex: 1; max-width: 420px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 7px 12px; display: flex; align-items: center; gap: 8px; color: var(--muted);
  margin: 0 auto 0 16px;
}
.tb-search input { flex: 1; background: transparent; border: none; color: var(--text); outline: none; font-size: 13px; }
.tb-search kbd {
  font-size: 10px; padding: 2px 5px; border-radius: 4px;
  background: var(--card-2); color: var(--muted); border: 1px solid var(--border); font-family: ui-monospace, monospace;
}
.tb-actions { display: flex; align-items: center; gap: 10px; }
.tb-ws { width: 10px; height: 10px; border-radius: 50%; background: var(--error); transition: background var(--t-fast); }
.tb-ws.on { background: var(--success); box-shadow: 0 0 8px rgba(46,160,67,.7); }

.content { padding: 28px 32px; flex: 1; min-width: 0; }
.page-title { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.02em; }
.page-sub { color: var(--muted); margin-top: 4px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head-actions { display: flex; gap: 10px; align-items: center; }

/* Grids */
.metric-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  margin-bottom: 22px;
}
.col-grid { display: grid; gap: 16px; }
.col-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.col-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1100px) {
  .col-grid.cols-2, .col-grid.cols-3 { grid-template-columns: 1fr; }
}

/* Feed em tempo real */
.live-feed {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px; max-height: 380px; overflow-y: auto;
}
.feed-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-md);
  border: 1px solid var(--border); margin-bottom: 6px;
  animation: slideInUp var(--t-med) var(--ease-out);
  background: var(--card-2);
}
.feed-item.brand-new {
  border-color: var(--green-1);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .15);
  animation: slideInUp var(--t-med) var(--ease-out), ringPulse 1.6s var(--ease-out) 1;
}
.feed-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--green-1); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.feed-info { flex: 1; min-width: 0; }
.feed-name { font-size: 13px; font-weight: 600; }
.feed-meta { font-size: 11px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.feed-time { font-size: 11px; color: var(--muted); }

/* Lead detail drawer */
.drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); z-index: 900; display: none; }
.drawer-bg.open { display: block; animation: fadeIn var(--t-fast) var(--ease-out); }
.drawer {
  position: fixed; right: 0; top: 0; height: 100%; width: 520px;
  background: var(--card); border-left: 1px solid var(--border);
  z-index: 950; padding: 22px; overflow-y: auto;
  transform: translateX(100%); transition: transform var(--t-med) var(--ease-out);
}
.drawer.open { transform: translateX(0); }
.drawer-close {
  background: none; border: none; color: var(--muted); padding: 6px; border-radius: var(--r-sm);
}
.drawer-close:hover { color: var(--text); background: var(--card-2); }

.timeline { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.timeline-item {
  padding: 10px 12px; background: var(--card-2); border: 1px solid var(--border);
  border-radius: var(--r-md); font-size: 13px;
  border-left: 3px solid var(--green-1);
}
.timeline-item .ti-type { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--green-2); margin-bottom: 2px; }
.timeline-item .ti-time { font-size: 11px; color: var(--muted); }

/* Settings */
.settings-section {
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--card); padding: 20px; margin-bottom: 16px;
}
.settings-section h3 { font-size: var(--fs-lg); margin-bottom: 4px; }
.settings-section .desc { color: var(--muted); margin-bottom: 14px; font-size: var(--fs-sm); }

/* Login page */
.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(ellipse at top, rgba(22, 163, 74, .18), transparent 60%), var(--bg);
}
.login-card {
  width: 100%; max-width: 420px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--r-xl); padding: 32px;
  box-shadow: var(--shadow-lg);
  animation: slideInUp var(--t-slow) var(--ease-out);
}
.login-logo {
  width: 56px; height: 56px; border-radius: 14px; margin: 0 auto 14px;
  background: linear-gradient(135deg, var(--green-1), var(--green-2));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 24px;
  box-shadow: 0 8px 24px rgba(22, 163, 74, .45);
}
.login-title { text-align: center; font-size: 22px; font-weight: 800; }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin-top: 4px; margin-bottom: 22px; }
