:root {
  --bg: #060914;
  --bg-2: #0a0f22;
  --bg-3: #0f1530;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-solid: #0e1428;
  --panel-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --ink: #f5f7ff;
  --ink-2: #c5cce0;
  --muted: #7b8299;
  --accent: #ff7a1a;
  --accent-2: #ff9b4d;
  --accent-ink: #1a0a00;
  --blue: #3d8bff;
  --blue-2: #1e5fe0;
  --ok: #2bd17e;
  --warn: #ffb020;
  --danger: #e5447f;
  --purple: #8e6cff;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-soft: 0 24px 60px -28px rgba(0, 8, 40, 0.65);
  --shadow-orange: 0 0 0 1px rgba(255, 122, 26, 0.35), 0 20px 50px -18px rgba(255, 122, 26, 0.35);
  --font-display: "Instrument Serif", "Times New Roman", Georgia, serif;
  --font-body: "Geist", -apple-system, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-body);
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(61, 139, 255, 0.18) 0%, transparent 55%),
    radial-gradient(800px 420px at 100% 0%, rgba(255, 122, 26, 0.14) 0%, transparent 50%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.auth-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}
.auth-card {
  width: min(420px, 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-soft);
}
.brand {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.35rem;
  margin: 0;
  letter-spacing: -0.02em;
  background: linear-gradient(100deg, var(--blue) 0%, #6fa9ff 40%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-block .muted { margin: 4px 0 0; }
.brand-lockup { display: flex; align-items: center; gap: 11px; width: fit-content; padding: 8px 11px; border-radius: 13px; background: #fff; }
.brand-lockup img { width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 8px 18px rgba(255,122,26,.28)); }
.brand-lockup .brand { line-height: 1; }
.sidebar .brand {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: #111318;
}
.sidebar .brand-lockup .muted { color: #666b76; }

.channel-results { display: grid; gap: 10px; margin: 14px 0; }
.channel-result { display: grid; grid-template-columns: 38px 1fr auto auto; gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.04); }
.channel-result-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: rgba(61,139,255,.13); font-weight: 700; }
.channel-result strong, .channel-result span { display: block; }
.channel-result-status { font-size: .76rem; font-weight: 700; padding: 5px 8px; border-radius: 999px; white-space: nowrap; }
.channel-result-status.sent { color: #1d6d44; background: #dff7e9; }
.channel-result-status.draft { color: #725111; background: #fff0c9; }
.channel-result-status.failed { color: #9b2d2d; background: #ffe0e0; }

.kanban-toolbar { margin-bottom: 14px; }
.kanban-toolbar p { margin: 0; }
.kanban-board { display: grid; grid-template-columns: repeat(7, minmax(250px, 1fr)); gap: 12px; overflow-x: auto; padding: 2px 2px 18px; scroll-snap-type: x proximity; }
.kanban-column { min-height: 520px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.025); scroll-snap-align: start; transition: border-color .16s, background .16s; }
.kanban-column.drop-target { border-color: var(--accent); background: rgba(255,122,26,.08); }
.kanban-column > header { display: flex; justify-content: space-between; align-items: center; padding: 5px 4px 12px; font-size: .82rem; font-weight: 700; }
.kanban-column > header b { min-width: 24px; padding: 3px 7px; text-align: center; border-radius: 999px; color: var(--ink-2); background: var(--panel-2); }
.kanban-cards { display: grid; gap: 9px; }
.kanban-card { display: grid; gap: 9px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-solid); box-shadow: 0 10px 24px -20px #000; cursor: grab; }
.kanban-card.dragging { opacity: .45; }
.kanban-card strong { font-size: .88rem; line-height: 1.25; }
.kanban-rating { font-size: .78rem; color: #ffbe47; }
.kanban-rating span { color: var(--muted); }
.kanban-alert, .kanban-prepared { width: fit-content; padding: 4px 7px; border-radius: 999px; font-size: .66rem; font-weight: 700; }
.kanban-alert { color: #1c1010; background: #ffb7a6; }
.kanban-prepared { color: #1d3557; background: #cfe3ff; }
.kanban-response { margin: 0; padding: 8px; border-radius: 8px; color: #bcebd0; background: rgba(43,209,126,.09); font-size: .75rem; }
.kanban-move { min-width: 0; max-width: 132px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); background: var(--bg-3); font: 500 .72rem var(--font-body); }
.kanban-empty { padding: 24px 8px; text-align: center; color: var(--muted); font-size: .76rem; border: 1px dashed var(--line); border-radius: 10px; }
.followup-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 24px; border: 1px solid rgba(255,176,32,.24); border-radius: 18px; background: linear-gradient(135deg, rgba(255,176,32,.12), rgba(255,122,26,.04)); }
.followup-hero h2 { margin: 5px 0 8px; font-family: var(--font-body); font-size: 1.45rem; font-weight: 700; }
.followup-hero p { max-width: 660px; margin: 0; color: var(--muted); font-size: .86rem; }
.eyebrow { color: var(--warn); font: 700 .68rem var(--font-mono); letter-spacing: .12em; }
.followup-list { display: grid; gap: 10px; margin-top: 14px; }
.followup-card { display: grid; grid-template-columns: minmax(220px,1fr) minmax(220px,1fr) auto; align-items: center; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.followup-card p { margin: 5px 0 0; }
.followup-channels { display: flex; flex-wrap: wrap; gap: 7px; }
.followup-channels span { padding: 6px 8px; border-radius: 8px; color: var(--ink-2); background: rgba(255,255,255,.06); font-size: .73rem; }

h1, h2 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
}
h1 { margin: 0 0 4px; font-size: 2rem; }
h2 { margin: 0; font-size: 1.45rem; }
h3 {
  font-family: var(--font-body);
  font-weight: 600;
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.error { color: var(--danger); }
.ok { color: var(--ok); }
.stack { display: grid; gap: 14px; }

label {
  display: grid;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: 0.01em;
}
.field-hint {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 400;
  margin-top: -2px;
}

input, select, textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line-2);
  color: var(--ink);
  border-radius: 12px;
  padding: 11px 13px;
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:hover, select:hover, textarea:hover {
  border-color: rgba(255, 255, 255, 0.22);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(255, 122, 26, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.15);
}
input::placeholder, textarea::placeholder { color: #5a6178; }
textarea { resize: vertical; min-height: 72px; }

.select-wrap {
  position: relative;
}
.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  cursor: pointer;
}
.select-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-60%) rotate(45deg);
  pointer-events: none;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:not(:disabled):active { transform: scale(0.98); }
.btn.primary {
  background: linear-gradient(180deg, #ff8c3b 0%, var(--accent) 100%);
  color: var(--accent-ink);
  box-shadow: var(--shadow-orange);
}
.btn.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffa04f 0%, #ff7a1a 100%);
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border: 1px solid var(--line-2);
}
.btn.ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.25);
}
.btn.danger { background: var(--danger); color: #fff; }
.btn.sm { padding: 7px 12px; font-size: 0.8rem; }

.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; width: 100%; overflow-x: hidden; }
.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(6, 9, 20, 0.88);
  backdrop-filter: blur(16px);
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.sidebar nav { display: grid; gap: 4px; }
.nav {
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 12px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav.active {
  background: rgba(255, 122, 26, 0.12);
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav:hover { background: rgba(255, 255, 255, 0.05); color: var(--ink); }
.sidebar-hint { line-height: 1.45; margin: 0; padding: 0 8px; }
.logout {
  color: var(--muted);
  text-decoration: none;
  margin-top: auto;
  font-size: 0.88rem;
  padding: 8px 12px;
}
.logout:hover { color: var(--ink); }

.content { padding: 28px 32px 56px; max-width: 1120px; min-width: 0; }
.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.badge {
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.76rem;
  color: var(--ink-2);
  max-width: 100%;
  overflow-wrap: anywhere;
}
.hidden { display: none !important; }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  backdrop-filter: blur(8px);
}
.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.85rem;
  margin-top: 4px;
  color: var(--ink);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 14px;
  box-shadow: var(--shadow-soft);
}
.prospect-layout { display:grid; grid-template-columns:minmax(0, 1fr) minmax(320px, .9fr); gap:14px; }
.location-results { display:grid; gap:6px; margin-top:6px; }
.location-result { width:100%; text-align:left; border:1px solid var(--line); background:rgba(0,0,0,.22); color:var(--ink); padding:9px 11px; border-radius:10px; cursor:pointer; font:inherit; font-size:.82rem; }
.location-result:hover { border-color:rgba(255,122,26,.55); background:rgba(255,122,26,.08); }
.prospect-map { height:420px; border-radius:var(--radius-lg); overflow:hidden; border:1px solid var(--line); background:var(--panel-solid); }
.map-caption { display:flex; justify-content:space-between; gap:10px; margin-top:10px; color:var(--muted); font-size:.78rem; }
.range-value { min-width:44px; color:var(--accent-2); font-family:var(--font-mono); }
@media (max-width: 860px) { .prospect-layout { grid-template-columns:1fr; } .prospect-map { height:300px; } }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row.between { justify-content: space-between; align-items: center; }

.funnel {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 4px;
}
.funnel-step {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.funnel-step:hover {
  border-color: rgba(255, 122, 26, 0.45);
  transform: translateY(-1px);
  box-shadow: var(--shadow-orange);
}
.funnel-step .n {
  font-family: var(--font-display);
  font-size: 1.9rem;
  color: var(--accent);
  line-height: 1;
}
.funnel-step .lbl { margin-top: 8px; font-size: 0.9rem; font-weight: 600; }
.funnel-step .hint { margin-top: 4px; font-size: 0.74rem; color: var(--muted); line-height: 1.35; }

.integ { display: grid; gap: 8px; }
.integ-row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 5px;
  background: var(--danger);
}
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(43, 209, 126, 0.18); }

.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 8px;
  text-align: left;
  vertical-align: top;
}
.table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: rgba(255, 122, 26, 0.04); }

.pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 600;
}
.pill.novo { color: var(--blue); border-color: rgba(61, 139, 255, 0.35); background: rgba(61, 139, 255, 0.1); }
.pill.redesenhado { color: var(--warn); border-color: rgba(255, 176, 32, 0.35); background: rgba(255, 176, 32, 0.1); }
.pill.publicado, .pill.succeeded { color: var(--ok); border-color: rgba(43, 209, 126, 0.35); background: rgba(43, 209, 126, 0.1); }
.pill.proposta { color: var(--accent-2); border-color: rgba(255, 122, 26, 0.4); background: rgba(255, 122, 26, 0.12); }
.pill.respondeu { color: #63d9c1; border-color: rgba(99,217,193,.35); background: rgba(99,217,193,.1); }
.pill.fechado { color: var(--purple); border-color: rgba(142, 108, 255, 0.35); background: rgba(142, 108, 255, 0.1); }
.pill.failed, .pill.descartado { color: var(--danger); }
.pill.queued, .pill.running { color: var(--warn); }

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
}
.seg button.active {
  background: rgba(255, 122, 26, 0.18);
  color: var(--ink);
}
.seg button:hover:not(.active) { color: var(--ink); }

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}
.search-wrap { flex: 1; min-width: 180px; }
.search-wrap input { margin: 0; }

.suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.suggest button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 5px 10px;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}
.suggest button:hover,
.suggest button.active {
  border-color: rgba(255, 122, 26, 0.5);
  color: var(--accent-2);
  background: rgba(255, 122, 26, 0.1);
}

.next-hint {
  font-size: 0.78rem;
  color: var(--accent-2);
  margin-top: 6px;
}

.log {
  background: #04070f;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  height: 260px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  white-space: pre-wrap;
  color: var(--ink-2);
}
.run-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}
.steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0.5;
}
.step.active {
  opacity: 1;
  border-color: rgba(255, 122, 26, 0.5);
  background: rgba(255, 122, 26, 0.08);
}
.step.done { opacity: 1; border-color: rgba(43, 209, 126, 0.25); }
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 600;
}
.step.active .step-num {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}
.step.done .step-num {
  background: rgba(43, 209, 126, 0.2);
  color: var(--ok);
}
.counters { margin-bottom: 14px; }
.summary {
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}
.summary ul.clean { margin: 0 0 12px; padding-left: 18px; }
.log-wrap { margin-top: 8px; }
.log-wrap summary { cursor: pointer; color: var(--muted); margin-bottom: 8px; }

/* Config */
.cfg-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 4px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.cfg-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 14px;
  border-radius: 10px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}
.cfg-tabs button.active {
  background: rgba(255, 122, 26, 0.16);
  color: var(--ink);
}
.cfg-pane.hidden { display: none !important; }

.provider-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.provider-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.provider-card:hover { border-color: var(--line-2); }
.provider-card.selected {
  border-color: rgba(255, 122, 26, 0.55);
  background: rgba(255, 122, 26, 0.08);
  box-shadow: var(--shadow-orange);
}
.provider-card.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.provider-card .pc-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: start;
}
.provider-card .pc-name { font-weight: 600; font-size: 0.92rem; }
.provider-card .pc-detail {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
  word-break: break-word;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.status-pill.live {
  color: var(--ok);
  background: rgba(43, 209, 126, 0.12);
  border-color: rgba(43, 209, 126, 0.3);
}
.status-pill.dead {
  color: var(--warn);
  background: rgba(255, 176, 32, 0.1);
  border-color: rgba(255, 176, 32, 0.28);
}
.status-pill .sdot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.cfg-card h3 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cfg-card .tag {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.cfg-card .tag.on { color: var(--ok); border-color: rgba(43, 209, 126, 0.35); }
.cfg-card .tag.off { color: var(--warn); border-color: rgba(255, 176, 32, 0.35); }

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.empty strong { display: block; color: var(--ink); margin-bottom: 6px; font-size: 1rem; }

.drawer { position: fixed; inset: 0; z-index: 40; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(2, 4, 12, 0.72); }
.drawer-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(440px, 100%);
  background: linear-gradient(180deg, #0c1226, #080d1a);
  border-left: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.45);
  animation: slideIn 0.2s ease;
}
@keyframes slideIn {
  from { transform: translateX(24px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}
.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.drawer-body {
  padding: 16px 20px;
  overflow: auto;
  flex: 1;
  display: grid;
  gap: 14px;
}
.drawer-actions {
  padding: 14px 20px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.kv { display: grid; gap: 8px; }
.kv div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  font-size: 0.88rem;
}
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.kv a { color: var(--blue); }
.pipeline-mini { display:grid; grid-template-columns:repeat(5,1fr); gap:0; padding:10px 4px 18px; }
.pipeline-step { position:relative; display:grid; gap:7px; justify-items:center; text-align:center; color:var(--muted); font-size:.68rem; line-height:1.2; }
.pipeline-step:not(:last-child)::after { content:""; position:absolute; top:8px; left:57%; width:86%; height:1px; background:var(--line-2); }
.pipeline-dot { width:17px; height:17px; border-radius:50%; border:3px solid var(--panel-solid); background:var(--line-2); z-index:1; }
.pipeline-step.done { color:var(--ok); }.pipeline-step.done .pipeline-dot { background:var(--ok); }
.pipeline-step.done::after { background:var(--ok); }.pipeline-step.now { color:var(--accent-2); font-weight:700; }.pipeline-step.now .pipeline-dot { background:var(--accent); box-shadow:0 0 0 5px rgba(255,122,26,.14); }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #121a33;
  border: 1px solid var(--line-2);
  color: var(--ink);
  padding: 12px 18px;
  border-radius: 12px;
  z-index: 50;
  box-shadow: var(--shadow-soft);
  max-width: min(520px, 92vw);
}

.email-layout {
  display: grid;
  grid-template-columns: minmax(240px, 340px) 1fr;
  gap: 12px;
  min-height: 420px;
}
.email-list {
  display: grid;
  gap: 6px;
  align-content: start;
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}
.email-item {
  text-align: left;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.email-item:hover { border-color: var(--line-2); }
.email-item.active {
  border-color: rgba(255, 122, 26, 0.55);
  background: rgba(255, 122, 26, 0.08);
  box-shadow: var(--shadow-orange);
}
.email-item-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 4px;
}
.email-item-top strong {
  font-size: 0.88rem;
  line-height: 1.3;
}
.email-item-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.email-preview {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 420px;
}
.email-preview-head {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.email-frame {
  flex: 1;
  width: 100%;
  min-height: 320px;
  border: 0;
  border-radius: 10px;
  background: #fff;
}

@media (max-width: 900px) {
  .email-layout { grid-template-columns: 1fr; }
  .email-list { max-height: 220px; }
  .channel-result { grid-template-columns: 38px 1fr; }
  .channel-result-status, .channel-result .btn { grid-column: 2; justify-self: start; }
  .kanban-board { grid-template-columns: repeat(7, minmax(82vw, 1fr)); }
  .followup-hero { align-items: flex-start; flex-direction: column; }
  .followup-card { grid-template-columns: 1fr; }
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 6px;
}

@media (max-width: 980px) {
  .funnel { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .logout { margin-top: 0; }
  .content { padding: 20px 16px 48px; }
  .top { flex-direction: column; }
}
