/* ============ LeadHunter — design system ============ */
:root {
  --bg: #08090c;
  --bg-soft: #0c0e13;
  --panel: #101319;
  --panel-2: #151922;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #e9edf4;
  --muted: #8b94a6;
  --accent: #7c6cf8;
  --accent-2: #22d3a6;
  --accent-grad: linear-gradient(135deg, #7c6cf8 0%, #22d3a6 130%);
  --hot: #ff6b57;
  --warm: #f7b955;
  --cold: #6fa8ff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(124, 108, 248, 0.16), transparent 65%),
    radial-gradient(800px 500px at 100% 0%, rgba(34, 211, 166, 0.10), transparent 60%);
  pointer-events: none; z-index: 0;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.02em; }
p { margin: 0; }
button { font-family: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 10px; line-height: 1.5; }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 4px 22px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--accent-grad);
  display: grid; place-items: center; color: #fff; flex: none;
  box-shadow: 0 8px 24px rgba(124, 108, 248, 0.35);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 16px; }
.brand-text span { font-size: 11.5px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }
.brand--lg { padding: 0 0 26px; }
.brand--lg h1 { font-size: 22px; }
.brand--lg p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ---------- login ---------- */
.login-screen {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: radial-gradient(1200px 700px at 50% 0%, #141826 0%, #08090c 60%);
  overflow: hidden;
}
.login-glow {
  position: absolute; width: 700px; height: 700px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 108, 248, 0.22), transparent 65%);
  filter: blur(30px); top: -180px; right: -120px; pointer-events: none;
}
.login-card {
  position: relative; z-index: 1;
  width: min(430px, calc(100vw - 32px));
  background: linear-gradient(180deg, rgba(24, 28, 38, 0.92), rgba(14, 17, 23, 0.96));
  border: 1px solid var(--line-strong);
  border-radius: 22px; padding: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form label { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; color: var(--muted); }
.login-form input {
  background: #0b0e14; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; color: var(--text); font-size: 14px; outline: none;
}
.login-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 108, 248, 0.16); }
.login-hint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 2px; }
.login-hint b { color: var(--text); }
.login-error { color: var(--hot); font-size: 12.5px; text-align: center; min-height: 16px; }

/* ---------- layout ---------- */
.app { position: relative; z-index: 1; display: flex; min-height: 100vh; }

.sidebar {
  width: 244px; flex: none;
  background: rgba(10, 12, 17, 0.75);
  border-right: 1px solid var(--line);
  padding: 20px 16px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  backdrop-filter: blur(10px);
}
.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  background: transparent; border: 0; color: var(--muted);
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  font-size: 13.5px; font-weight: 500; text-align: left; width: 100%;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { width: 17px; height: 17px; fill: currentColor; opacity: 0.85; flex: none; }
.nav-item:hover { background: rgba(255, 255, 255, 0.045); color: var(--text); }
.nav-item.is-active { background: rgba(124, 108, 248, 0.14); color: #cfc7ff; box-shadow: inset 0 0 0 1px rgba(124, 108, 248, 0.25); }
.nav-count {
  margin-left: auto; font-size: 11px; background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px; border-radius: 20px; color: var(--text);
}
.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.user-chip div { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.user-chip strong { font-size: 12.5px; }
.user-chip span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: var(--accent-grad); display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700; color: #fff; text-transform: uppercase;
}

.main { flex: 1; min-width: 0; padding: 26px 30px 60px; max-width: 1560px; }
.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.view-head h2 { font-size: 21px; }
.view-head p { font-size: 13px; margin-top: 4px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- buttons / inputs ---------- */
.btn {
  border: 1px solid transparent; border-radius: 10px; cursor: pointer;
  padding: 10px 16px; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  transition: transform 0.12s, filter 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent-grad); color: #08110e; box-shadow: 0 10px 26px rgba(124, 108, 248, 0.28); }
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost { background: rgba(255, 255, 255, 0.045); border-color: var(--line); color: var(--text); }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--line-strong); }
.btn--danger { background: rgba(255, 107, 87, 0.14); border-color: rgba(255, 107, 87, 0.35); color: #ffb3a7; }
.btn--danger:hover { background: rgba(255, 107, 87, 0.22); }
.btn--sm { padding: 8px 13px; font-size: 12.5px; }
.btn--xs { padding: 5px 9px; font-size: 11.5px; }
.btn--block { width: 100%; justify-content: center; padding: 12px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn--primary:disabled { filter: grayscale(0.5); }

input, select, textarea {
  background: #0b0e14; border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 10px 12px; font-size: 13px; font-family: inherit; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: rgba(124, 108, 248, 0.7); box-shadow: 0 0 0 3px rgba(124, 108, 248, 0.14); }
select { cursor: pointer; }
::placeholder { color: #5c6577; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 11.5px; color: var(--muted); font-weight: 550; letter-spacing: 0.02em; text-transform: uppercase; }
.field--sm { width: 120px; }

/* ---------- cards ---------- */
.card {
  background: linear-gradient(180deg, rgba(21, 25, 34, 0.9), rgba(15, 18, 24, 0.92));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px;
}
.card--danger { border-color: rgba(255, 107, 87, 0.25); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h3 { font-size: 14.5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1080px) { .grid-2 { grid-template-columns: 1fr; } }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 20px;
  border: 1px solid transparent; white-space: nowrap;
}
.tier-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.chip--ghost { background: rgba(255, 255, 255, 0.05); border-color: var(--line); color: var(--muted); }
.chip--click { background: rgba(255, 255, 255, 0.045); border-color: var(--line); color: var(--muted); cursor: pointer; }
.chip--click:hover { color: var(--text); border-color: var(--accent); background: rgba(124, 108, 248, 0.12); }
.chip--hot { background: rgba(255, 107, 87, 0.14); color: #ff9c8d; border-color: rgba(255, 107, 87, 0.3); }
.chip--warm { background: rgba(247, 185, 85, 0.14); color: #ffd08a; border-color: rgba(247, 185, 85, 0.3); }
.chip--cold { background: rgba(111, 168, 255, 0.13); color: #a9c8ff; border-color: rgba(111, 168, 255, 0.28); }
.chip--ok { background: rgba(34, 211, 166, 0.13); color: #74e9c6; border-color: rgba(34, 211, 166, 0.3); }
.chip--no { background: rgba(255, 255, 255, 0.05); color: var(--muted); border-color: var(--line); }

/* ---------- KPIs ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(22, 26, 36, 0.92), rgba(14, 17, 23, 0.94));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 17px;
}
.kpi::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: var(--accent-grad); opacity: 0.65;
}
.kpi-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.kpi-value { font-size: 27px; font-weight: 720; letter-spacing: -0.03em; margin-top: 7px; line-height: 1; }
.kpi-sub { font-size: 11.5px; color: var(--muted); margin-top: 8px; }

/* ---------- oportunidades ---------- */
.opp-list { display: flex; flex-direction: column; gap: 8px; }
.opp {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.022); cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.opp:hover { background: rgba(124, 108, 248, 0.08); border-color: rgba(124, 108, 248, 0.3); }
.opp-main { flex: 1; min-width: 0; }
.opp-main strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp-main span { font-size: 11.5px; color: var(--muted); }
.score-ring {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; background: conic-gradient(var(--accent-2) calc(var(--v) * 1%), rgba(255, 255, 255, 0.09) 0);
  position: relative;
}
.score-ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #111520; }
.score-ring span { position: relative; z-index: 1; }

/* ---------- funil ---------- */
.funnel { display: flex; flex-direction: column; gap: 9px; }
.funnel-row { display: grid; grid-template-columns: 90px 1fr 34px; align-items: center; gap: 10px; font-size: 12.5px; }
.funnel-row .bar { height: 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.funnel-row .bar i { display: block; height: 100%; border-radius: 6px; background: var(--accent-grad); transition: width 0.4s ease; }
.funnel-row b { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- atividade ---------- */
.activity-list { display: flex; flex-direction: column; gap: 2px; max-height: 270px; overflow: auto; }
.activity-item { display: flex; gap: 10px; padding: 9px 2px; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.activity-item:last-child { border-bottom: 0; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; margin-top: 6px; background: var(--accent); }
.dot--import { background: var(--accent-2); }
.dot--status { background: var(--warm); }
.dot--message { background: #6fa8ff; }
.dot--delete, .dot--settings { background: var(--muted); }
.activity-item time { color: var(--muted); font-size: 11px; margin-left: auto; white-space: nowrap; }

/* ---------- search ---------- */
.search-card { padding: 18px; }
.search-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.5fr) minmax(150px, 1.3fr) minmax(140px, 1fr) minmax(120px, 0.9fr) 110px auto;
  gap: 12px; align-items: end;
}
.search-row .field, .search-row select, .search-row input { min-width: 0; }
.search-row .field--sm, .search-row .field--sm2 { width: auto; }
@media (max-width: 1200px) {
  .search-row { grid-template-columns: 1fr 1fr; }
  .search-row button { grid-column: 1 / -1; justify-content: center; }
}
@media (max-width: 700px) { .search-row { grid-template-columns: 1fr; } }
.quick-chips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }

.source-badge {
  font-size: 11.5px; padding: 5px 11px; border-radius: 20px;
  background: rgba(34, 211, 166, 0.1); border: 1px solid rgba(34, 211, 166, 0.28); color: #74e9c6;
  font-weight: 600; align-self: center;
}
.results-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; margin: 16px 0 12px;
}
.results-info { font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.results-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); cursor: pointer; user-select: none; }
.switch input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; padding: 0; }
.warning {
  background: rgba(247, 185, 85, 0.1); border: 1px solid rgba(247, 185, 85, 0.3);
  color: #ffd08a; padding: 10px 14px; border-radius: 10px; font-size: 12.5px; margin-bottom: 12px;
}

.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 12px; }
.lead-card {
  position: relative; border: 1px solid var(--line); border-radius: 14px; padding: 14px;
  background: linear-gradient(180deg, rgba(21, 25, 34, 0.9), rgba(14, 17, 22, 0.9));
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.lead-card:hover { border-color: rgba(124, 108, 248, 0.4); transform: translateY(-1px); }
.lead-card.is-selected { border-color: var(--accent); background: rgba(124, 108, 248, 0.09); }
.lead-card.is-saved { opacity: 0.55; }
.lc-top { display: flex; gap: 10px; align-items: flex-start; }
.lc-check { width: 17px; height: 17px; accent-color: var(--accent); margin-top: 2px; cursor: pointer; flex: none; }
.lc-title { flex: 1; min-width: 0; }
.lc-title strong { font-size: 13.5px; display: block; line-height: 1.3; }
.lc-title span { font-size: 11.5px; color: var(--muted); }
.lc-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 11px 0 10px; }
.lc-line { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); margin-top: 5px; }
.lc-line svg { width: 13px; height: 13px; fill: currentColor; opacity: 0.6; flex: none; }
.lc-line a { color: #a9c8ff; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-line a:hover { text-decoration: underline; }
.lc-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.lc-foot .spacer { flex: 1; }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: 8px; }
.empty p { font-size: 13px; max-width: 460px; margin: 0 auto; line-height: 1.6; }
.empty-icon { font-size: 34px; margin-bottom: 14px; opacity: 0.8; }

/* ---------- tabela ---------- */
.table-card { padding: 0; overflow: hidden; }
.table-toolbar {
  display: flex; gap: 10px; padding: 14px; flex-wrap: wrap; align-items: center;
  border-bottom: 1px solid var(--line);
}
.table-toolbar .input-search { flex: 1; min-width: 200px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); font-weight: 650; padding: 11px 14px; background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table tbody td { padding: 11px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); vertical-align: middle; }
.table tbody tr { cursor: pointer; transition: background 0.12s; }
.table tbody tr:hover { background: rgba(124, 108, 248, 0.07); }
.td-name strong { display: block; font-size: 13px; }
.td-name span { font-size: 11px; color: var(--muted); }
.td-mono { font-variant-numeric: tabular-nums; white-space: nowrap; }
.score-pill {
  display: inline-grid; place-items: center; min-width: 34px; padding: 3px 8px; border-radius: 8px;
  font-size: 11.5px; font-weight: 700;
}
.score-pill.hot { background: rgba(255, 107, 87, 0.15); color: #ff9c8d; }
.score-pill.warm { background: rgba(247, 185, 85, 0.15); color: #ffd08a; }
.score-pill.cold { background: rgba(111, 168, 255, 0.14); color: #a9c8ff; }
.status-select {
  padding: 5px 9px; font-size: 11.5px; border-radius: 8px; background: #0d1017;
  border: 1px solid var(--line); color: var(--text);
}
.table-foot { padding: 12px 14px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.icon-btn {
  background: transparent; border: 0; color: var(--muted); cursor: pointer;
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 4px 7px; border-radius: 8px;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }

/* ---------- kanban ---------- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kcol {
  flex: none; width: 236px; background: rgba(255, 255, 255, 0.022);
  border: 1px solid var(--line); border-radius: 14px; padding: 11px;
  min-height: 140px; transition: background 0.15s, border-color 0.15s;
}
.kcol.drag-over { background: rgba(124, 108, 248, 0.1); border-color: var(--accent); }
.kcol-body { max-height: 68vh; overflow-y: auto; padding-right: 2px; }
.kcol-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding: 0 2px; }
.kcol-head span { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.kcol-head b { font-size: 11px; background: rgba(255, 255, 255, 0.08); padding: 2px 7px; border-radius: 20px; }
.kcard {
  background: linear-gradient(180deg, #171b25, #12151d);
  border: 1px solid var(--line); border-radius: 11px; padding: 11px; margin-bottom: 8px;
  cursor: grab; font-size: 12.5px;
}
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: 0.4; }
.kcard strong { display: block; font-size: 12.5px; margin-bottom: 4px; }
.kcard .kc-sub { font-size: 11px; color: var(--muted); }
.kcard .kc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }

/* ---------- mensagens ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tab {
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); color: var(--muted);
  padding: 6px 12px; border-radius: 8px; font-size: 12px; cursor: pointer; font-weight: 600;
}
.tab.is-active { background: rgba(124, 108, 248, 0.16); color: #cfc7ff; border-color: rgba(124, 108, 248, 0.4); }
.tpl-editor {
  width: 100%; resize: vertical; line-height: 1.65; font-size: 13px; margin-bottom: 10px;
  background: #0a0d13;
}
.vars { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.vars code {
  background: rgba(124, 108, 248, 0.12); border: 1px solid rgba(124, 108, 248, 0.24);
  color: #cfc7ff; padding: 2px 6px; border-radius: 6px; font-size: 11px;
}
.preview-toolbar { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.msg-preview {
  background: #0a0d13; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; font-size: 12.5px; line-height: 1.65; white-space: pre-wrap;
  max-height: 380px; overflow: auto; margin: 0; color: #cdd5e2;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.inline-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* ---------- drawer ---------- */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 40;
  backdrop-filter: blur(2px);
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); z-index: 41;
  background: linear-gradient(180deg, #13161f, #0b0e14);
  border-left: 1px solid var(--line-strong); padding: 20px;
  overflow-y: auto; box-shadow: -30px 0 60px rgba(0, 0, 0, 0.5);
  animation: slideIn 0.22s ease;
}
@keyframes slideIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.drawer-head h3 { font-size: 16px; line-height: 1.3; }
.drawer-body { display: flex; flex-direction: column; gap: 14px; }
.drawer-body label { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail {
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 11px;
}
.detail span { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); display: block; }
.detail strong { font-size: 12.5px; font-weight: 600; display: block; margin-top: 3px; word-break: break-word; }
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; bottom: 22px; right: 22px; z-index: 90; display: flex; flex-direction: column; gap: 9px; }
.toast {
  background: #171b26; border: 1px solid var(--line-strong); border-left: 3px solid var(--accent-2);
  color: var(--text); padding: 11px 16px; border-radius: 10px; font-size: 12.5px;
  box-shadow: var(--shadow); animation: toastIn 0.2s ease; max-width: 340px;
}
.toast--err { border-left-color: var(--hot); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- skeleton / loading ---------- */
.spinner {
  width: 15px; height: 15px; border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #08110e; border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton {
  height: 128px; border-radius: 14px; border: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.07), rgba(255,255,255,0.03));
  background-size: 200% 100%; animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; gap: 10px; padding: 12px; overflow-x: auto; }
  .brand { padding: 0; flex: none; }
  .brand-text { display: none; }
  .nav { flex-direction: row; margin: 0; gap: 2px; }
  .nav-item { width: auto; padding: 8px 10px; font-size: 12px; }
  .nav-item svg { display: none; }
  .sidebar-foot { display: none; }
  .main { padding: 16px; }
  .detail-grid { grid-template-columns: 1fr; }
}

/* ---------- fontes de dados ---------- */
.field--sm2 { min-width: 210px; }
.source-list { display: flex; flex-direction: column; gap: 4px; }
.source-row {
  display: grid; grid-template-columns: 12px 1fr auto 150px;
  align-items: center; gap: 10px; padding: 10px 4px;
  border-bottom: 1px dashed var(--line); font-size: 12.5px;
}
.source-row:last-child { border-bottom: 0; }
.source-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.source-main strong { font-size: 12.5px; }
.source-cost { font-size: 11.5px; color: var(--muted); text-align: right; }
@media (max-width: 760px) { .source-row { grid-template-columns: 12px 1fr auto; } .source-cost { display: none; } }

/* ---------- modal ---------- */
.modal {
  position: fixed; z-index: 45; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(620px, calc(100vw - 32px)); max-height: 88vh; overflow-y: auto;
  background: linear-gradient(180deg, #141822, #0c0f15);
  border: 1px solid var(--line-strong); border-radius: 18px; padding: 20px;
  box-shadow: var(--shadow); animation: slideIn 0.2s ease;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }
#importText { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* ---------- triagem de site ---------- */
.triage { display: flex; gap: 6px; flex-wrap: wrap; }
.triage button {
  flex: 1; min-width: 96px; padding: 8px 6px; font-size: 11.5px; font-weight: 600;
  border-radius: 9px; cursor: pointer; background: rgba(255,255,255,.05);
  border: 1px solid var(--line); color: var(--muted);
}
.triage button:hover { color: var(--text); border-color: var(--line-strong); }
.triage button.is-on { background: rgba(124,108,248,.18); border-color: rgba(124,108,248,.5); color: #cfc7ff; }

/* ---------- chaves da API ---------- */
.key-list { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.key-row {
  display: grid; grid-template-columns: 10px auto 1fr auto auto;
  align-items: center; gap: 10px; padding: 7px 2px;
  border-bottom: 1px dashed var(--line); font-size: 12px;
}
.key-row:last-child { border-bottom: 0; }
.key-row code {
  background: rgba(124,108,248,.12); border: 1px solid rgba(124,108,248,.25);
  color: #cfc7ff; padding: 2px 7px; border-radius: 6px; font-size: 11px;
}
.switch--lock { opacity: .95; }
.switch--lock input:disabled { accent-color: var(--accent-2); }
