@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap");

:root {
  color-scheme: dark;
  --bg: #0a0b0e;
  --bg-grad: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(255, 98, 0, .12), transparent 55%);
  --surface-1: #12141a;
  --surface-2: #181b23;
  --surface-3: #20242f;
  --control-bg: #0e1015;
  --sidebar-bg: rgba(12, 14, 18, .96);
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #f8fafc;
  --text-2: #cbd5e1;
  --text-3: #94a3b8;
  --accent: #ff6200;
  --accent-soft: rgba(255, 98, 0, .14);
  --accent-line: rgba(255, 98, 0, .38);
  --accent-glow: rgba(255, 98, 0, .26);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, .14);
  --success: #22c55e;
  --warning: #f59e0b;
  --control-h: 44px;
  --radius-sm: 10px;
  --radius: 12px;
  --radius-lg: 16px;
  --pad: 22px;
  --shadow: 0 24px 60px rgba(0, 0, 0, .5);
  --fg: "Space Grotesk", "Inter", system-ui, sans-serif;
  --fs: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  color-scheme: dark;
}

body {
  font-family: var(--fs);
  background: radial-gradient(ellipse 120% 60% at 50% 0%, rgba(255, 98, 0, .08), transparent 50%), var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }

button, input, select, textarea { font-family: inherit; }

/* ---------- Sidebar ---------- */

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(255, 94, 0, .04) 0%, transparent 160px), var(--sidebar-bg);
  border-right: 1px solid rgba(255, 255, 255, .06);
  z-index: 1000;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.sidebar-header {
  padding: 24px 24px 18px;
  display: flex;
  align-items: center;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 2px;
  color: #f4f7f4;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.4px;
  line-height: 1;
  font-family: var(--fg);
}
.sidebar-brand:hover { text-decoration: none; }
.sidebar-brand .brand-emoji { margin-right: 8px; font-size: 22px; }
.sidebar-brand strong { color: var(--accent); font-weight: 700; }

.sidebar-menu {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px;
  scrollbar-width: none;
}
.sidebar-menu::-webkit-scrollbar { display: none; }

.menu-item {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 3px 0;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-2);
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.menu-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.menu-item.active {
  background: linear-gradient(90deg, rgba(255, 98, 0, .2), rgba(255, 98, 0, .06));
  border-color: var(--accent-line);
  color: #fff;
  font-weight: 600;
}
.menu-item.active .menu-icon { color: var(--accent); }

.menu-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
}
.menu-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-badge {
  margin-left: auto;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(255, 94, 0, .9);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.sidebar-section-label {
  padding: 16px 12px 6px;
  color: rgba(255, 255, 255, .35);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.sidebar-bot-item {
  min-height: 38px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  border: 1px solid transparent;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
  padding: 0 12px;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.sidebar-bot-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.sidebar-bot-item.active {
  background: linear-gradient(90deg, rgba(255, 98, 0, .18), rgba(255, 98, 0, .05));
  border-color: var(--accent-line);
  color: #fff;
  font-weight: 600;
}
.sidebar-bot-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 7px;
  background: var(--text-3);
}
.sidebar-bot-dot.on { background: var(--success); box-shadow: 0 0 8px rgba(34, 197, 94, .65); }

.sidebar-footer {
  flex: 0 0 auto;
  display: grid;
  gap: 10px;
  padding: 16px;
}

.sidebar-total {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, .075);
  border-radius: 8px;
  background: rgba(255, 255, 255, .012);
}
.sidebar-total-label {
  color: #667069;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.sidebar-total-value {
  color: #f4f7f5;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.logout-btn {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  color: rgba(255, 255, 255, .6);
  font-size: 13px;
  font-weight: 500;
}
.logout-btn .menu-icon { color: rgba(255, 255, 255, .4); }
.logout-btn:hover {
  border-color: rgba(255, 94, 0, .4);
  background: rgba(255, 94, 0, .12);
  color: #fff;
  text-decoration: none;
}

.sidebar-overlay { display: none; }

.hamburguer {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 1102;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(10, 13, 11, .92);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.hamburguer span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
}

/* ---------- Main ---------- */

.main-content {
  margin-left: 260px;
  min-height: 100vh;
  padding: 38px clamp(24px, 3vw, 48px) 64px;
  max-width: 1480px;
}

body.no-sidebar .main-content {
  margin-left: 0;
  max-width: none;
  padding: 0;
}

.page-eyebrow {
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.page-title {
  color: var(--text);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.6px;
  font-family: var(--fg);
}

.page-subtitle {
  margin-top: 7px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.crumbs { color: var(--text-3); font-size: 12px; margin: -14px 0 22px; }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--accent); }

.muted { color: var(--text-2); font-size: 13px; }

.flash {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 13px;
  font-weight: 500;
}

/* ---------- Cards ---------- */

.card {
  background: linear-gradient(180deg, rgba(255, 94, 0, .06) 0%, transparent 80%), var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--pad);
  margin-bottom: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.card h2 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: -.2px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Forms ---------- */

label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-2);
  margin: 14px 0 6px;
  letter-spacing: .02em;
}

input[type="text"], input[type="password"], input[type="number"],
input[type="email"], input[type="url"],
select, textarea {
  width: 100%;
  min-height: var(--control-h);
  background-color: var(--control-bg);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 13px;
  font-weight: 500;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
input::placeholder, textarea::placeholder { color: var(--text-3); opacity: 1; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 98, 0, .16);
}
textarea { resize: vertical; line-height: 1.5; }

select, .flow-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--control-bg);
  color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 38px;
  cursor: pointer;
}

select option,
select optgroup {
  background-color: #14171f;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 12px;
}

select option:checked {
  background-color: #ff6200;
  color: #ffffff;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-text-fill-color: var(--text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--control-bg) inset !important;
  transition: background-color 5000s ease-in-out 0s;
}

input[type="file"] {
  width: 100%;
  min-height: var(--control-h);
  padding: 6px 10px;
  background-color: var(--control-bg);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
}
input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
input[type="file"]::file-selector-button:hover {
  background: rgba(255, 98, 0, .24);
  border-color: var(--accent);
}

.check-label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  margin-top: 14px;
  cursor: pointer;
  user-select: none;
}
.check-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--control-h);
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:hover { color: #fff; background: var(--surface-3); border-color: rgba(255, 255, 255, .24); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  color: #fff;
  background: radial-gradient(90deg, rgba(255, 255, 255, .12) 0%, transparent 60%), linear-gradient(90deg, #ff6b1a, var(--accent));
  border-color: rgba(255, 94, 0, .4);
  box-shadow: 0 12px 30px var(--accent-glow);
  font-weight: 700;
}
.btn-primary:hover { color: #fff; filter: brightness(1.05); }

.btn-success {
  color: #140900;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 800;
}
.btn-success:hover { color: #140900; background: #ffa033; }

.btn-danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(240, 93, 99, .35);
}
.btn-danger:hover { color: #fff; background: rgba(240, 93, 99, .2); }

.btn-outline-danger {
  color: var(--danger);
  background: transparent;
  border-color: rgba(240, 93, 99, .35);
}
.btn-outline-danger:hover { color: #fff; background: var(--danger); border-color: var(--danger); }

.btn-block { width: 100%; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 11px; }

.row-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.row-btns form { display: inline; }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--text-3);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-on { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.badge-off { color: var(--text-3); }
.badge-type { font-size: 8px; margin-left: 8px; }

/* ---------- Bots grid (home) ---------- */

.bots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
}

.bot-card {
  padding: var(--pad);
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .09);
  transition: background .18s, border-color .18s;
}
.bot-card:hover { background: var(--surface-2); border-color: var(--line-strong); }

.bot-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.bot-info { display: flex; align-items: center; gap: 10px; min-width: 0; }

.bot-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 94, 0, .28), rgba(255, 94, 0, .1));
  border: 1px solid var(--accent-line);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(255, 94, 0, .18);
}
.bot-avatar svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.bot-identity { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.bot-username {
  color: #f3f7f4;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bot-handle {
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bot-card-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 16px;
  padding: 15px 0;
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: 11px;
}
.bot-stat {
  min-width: 0;
  padding: 0 13px;
  text-align: center;
  border-right: 1px solid var(--line);
}
.bot-stat:last-child { border-right: 0; }
.bot-stat .stat-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-3);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.bot-stat .stat-value {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bot-stat.metric-revenue .stat-value { color: var(--accent); }

.bot-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.bot-card-actions .btn { flex: 1 1 auto; }

/* ---------- Stats KPIs ---------- */

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 900px) { .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .stats-row { grid-template-columns: 1fr; } }

.stat {
  position: relative;
  min-height: 126px;
  padding: var(--pad);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 94, 0, .06) 0%, transparent 80%), var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.stat::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -44px;
  width: 110px;
  height: 110px;
  border: 1px solid rgba(255, 94, 0, .14);
  border-radius: 50%;
  filter: blur(40px);
  opacity: .5;
}

.stat-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 94, 0, .24), rgba(255, 94, 0, .08));
  border: 1px solid var(--accent-line);
  border-radius: 12px;
}
.stat-icon svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.stat-body { min-width: 0; }
.stat-label {
  margin: 1px 0 9px;
  color: var(--text-2);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.stat-value {
  color: var(--text);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.5px;
  font-family: var(--fg);
}
.stat-context {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: var(--text-3);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .025em;
  white-space: nowrap;
}
.stat-context-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 138, 0, .12);
}

/* ---------- Tables ---------- */

.table, table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table th {
  color: var(--text-3);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.table td { color: var(--text-2); font-weight: 500; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: rgba(255, 255, 255, .015); }
.status-paid { color: var(--accent) !important; font-weight: 700; }
.status-pending { color: var(--warning) !important; font-weight: 700; }
.status-failed { color: var(--danger) !important; font-weight: 700; }
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 14px; }
code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 11.5px;
  color: var(--accent);
  background: rgba(255, 98, 0, .08);
  border: 1px solid rgba(255, 98, 0, .2);
  padding: 1px 6px;
  border-radius: 4px;
  word-break: break-all;
  overflow-wrap: anywhere;
}

/* ---------- Login ---------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-box {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(180deg, rgba(255, 94, 0, .08) 0%, transparent 100%), var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.4px;
  color: #f4f7f4;
  margin-bottom: 6px;
  font-family: var(--fg);
}
.login-brand strong { color: var(--accent); }
.login-box .muted { text-align: center; display: block; margin-bottom: 8px; }
.login-box form { margin-top: 18px; }

/* ---------- Info box ---------- */

.info-box {
  margin-top: 16px;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 13px;
  font-size: 12px;
  word-break: break-all;
  color: var(--text-2);
  line-height: 1.5;
}
.info-box code { color: var(--accent); font-family: inherit; font-weight: 600; }

/* ---------- Funil / Steps ---------- */

.step-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .15s, background .15s;
}
.step-card:hover { border-color: var(--line-strong); background: var(--surface-2); }

.step-num {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.step-info { flex: 1; min-width: 0; }
.step-name { font-weight: 700; font-size: 14px; color: var(--text); }
.step-sub {
  color: var(--text-3);
  font-size: 12px;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-ops { display: flex; gap: 4px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.step-ops button {
  width: auto;
  min-width: 30px;
  padding: 0 9px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-3);
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  transition: color .15s, border-color .15s;
}
.step-ops button:hover { color: var(--text); border-color: var(--line-strong); }
.step-ops button.op-del:hover { color: var(--danger); border-color: rgba(240, 93, 99, .4); }

.type-message { color: #7ec8ff; }
.type-capture { color: #c792ea; }
.type-offer { color: var(--warning); }
.type-upsell { color: var(--accent); }
.type-downsell { color: #e67e22; }
.type-end { color: var(--text-3); }

.save-status {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: linear-gradient(90deg, #ff6b1a, var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 11px 18px;
  border-radius: 10px;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
  z-index: 50;
  box-shadow: 0 12px 30px var(--accent-glow);
}
.save-status.show { opacity: 1; }
.save-status.error { background: var(--danger); color: #fff; }

/* ---------- Modals ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 9, .78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  z-index: 1200;
  overflow-y: auto;
}
.modal-backdrop[hidden] { display: none; }

.modal {
  background: linear-gradient(180deg, rgba(255, 98, 0, .07) 0%, transparent 120px), var(--surface-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  width: 640px;
  max-width: 100%;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .65);
  color: var(--text);
}
.modal-sm { width: 420px; }

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 18px;
  cursor: pointer;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 10px 20px 16px; max-height: 65vh; overflow-y: auto; }

.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.modal-foot .btn { margin-top: 0; }

/* ---------- Editor de ofertas/botoes (modal) ---------- */

.offers-editor .offer-row {
  display: grid;
  grid-template-columns: 1.2fr 1.6fr .6fr;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.buttons-editor .button-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 36px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.mini-del {
  height: 36px;
  background: var(--danger-soft);
  border: 1px solid rgba(240, 93, 99, .4);
  color: var(--danger);
  border-radius: 7px;
  cursor: pointer;
}
.add-mini {
  background: none;
  border: 1px dashed var(--line-strong);
  color: var(--text-3);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}
.add-mini:hover { color: var(--text); border-color: var(--accent-line); }

.media-row { display: grid; grid-template-columns: 120px 1fr; gap: 8px; }
.media-upload-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 8px; align-items: center; }
.field-hint { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 5px; line-height: 1.45; }

.media-preview-box {
  margin-top: 10px;
  padding: 10px;
  background: var(--control-bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}
.media-preview-el {
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  background: #000;
  object-fit: contain;
}
.media-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
}

/* ---------- Oferta / Order Bump ---------- */

.offer-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, .02);
}
.offer-extra {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 8px;
}
.offer-extra .extra-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  font-weight: 800;
}
.of-del-value { width: 100%; }
.of-bump-fields {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, .2);
}

/* ---------- Relatorios extras ---------- */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 800px) { .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.kpi {
  text-align: left;
  padding: 18px 20px;
}
.kpi-num {
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -.65px;
  line-height: 1;
}
.kpi-label {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 8px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ---------- RubyBot-inspired: topbar, hero, groups ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(11, 11, 11, .75);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px clamp(18px, 3vw, 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.topbar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: -.2px;
}
.topbar-title strong { color: var(--text); }

.hero-greet {
  position: relative;
  overflow: hidden;
  padding: clamp(26px, 4vw, 40px);
  margin-bottom: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse 70% 120% at 90% -30%, rgba(255, 94, 0, .22), transparent 60%),
    radial-gradient(ellipse 50% 100% at 10% 120%, rgba(255, 94, 0, .1), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .015));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.hero-greet::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000, transparent);
  pointer-events: none;
}
.hero-greet-left { position: relative; z-index: 1; }
.hero-greet-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(255, 94, 0, .14);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
}
.hero-greet-kicker .pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(255, 94, 0, .6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 94, 0, .5); }
  70% { box-shadow: 0 0 0 10px rgba(255, 94, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 94, 0, 0); }
}
.hero-greet h1 {
  font-family: var(--fg);
  font-size: clamp(24px, 3.4vw, 36px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.6px;
  margin-bottom: 8px;
}
.hero-greet h1 .grad {
  background: linear-gradient(135deg, #ff8a3d, var(--accent), #ff6b1a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero-greet p {
  color: var(--text-2);
  font-size: 14px;
  max-width: 520px;
  line-height: 1.6;
}
.hero-greet-actions { position: relative; z-index: 1; display: flex; gap: 10px; flex-wrap: wrap; }

.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
}
.kpi-delta.up { background: rgba(34, 197, 94, .12); color: #4ade80; }
.kpi-delta.down { background: rgba(239, 68, 68, .12); color: #f87171; }
.kpi-delta.flat { background: rgba(255, 255, 255, .06); color: var(--text-3); }

.stat-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; width: 100%; }
.stat-value-wrap { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }

.sidebar-group { margin-top: 18px; }
.sidebar-group:first-child { margin-top: 4px; }
.sidebar-group-title {
  padding: 0 12px 6px;
  color: rgba(255, 255, 255, .32);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.bottom-dock {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1102;
  background: rgba(13, 13, 13, .88);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-top: 1px solid var(--line);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
}
.bottom-dock-inner { display: flex; align-items: center; justify-content: space-around; }
.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 10px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, .45);
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
  transition: color .2s;
}
.dock-item svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dock-item.active { color: var(--accent); }
.dock-item.active .dock-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(255, 94, 0, .8);
}
.dock-dot { width: 4px; height: 4px; }

.page-enter { animation: pageIn .4s cubic-bezier(.16, 1, .3, 1); }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Page head ---------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 26px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.page-head .muted {
  margin-top: 6px;
  max-width: 680px;
  line-height: 1.5;
}
.page-kicker {
  font-family: var(--fs);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

/* ---------- Meus Fluxos ---------- */

.flows-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}
.flows-paste label { display: block; margin-bottom: 8px; font-size: 12px; }
.flow-textarea {
  width: 100%;
  background: #080808;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.55;
  padding: 12px;
  resize: vertical;
  min-height: 220px;
}
.flow-textarea:focus { outline: none; border-color: var(--accent-line); color: var(--text); }
.flows-actions { margin-top: 12px; display: flex; gap: 10px; }
.flow-save-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}
.flow-save-form input[type="text"] {
  width: 100%;
  height: var(--control-h);
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0 14px;
  font-size: 13.5px;
}
.flow-save-form input:focus { outline: none; border-color: var(--accent-line); }

.flow-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.flow-sum-item {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  min-width: 92px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.flow-sum-n { font-family: var(--fg); font-weight: 700; font-size: 16px; color: var(--accent); }
.flow-sum-l { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); }

.flow-issues { display: grid; gap: 6px; margin-bottom: 16px; }
.flow-issue {
  background: var(--danger-soft);
  border: 1px solid rgba(239, 68, 68, .3);
  color: #fca5a5;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12.5px;
}

.flow-steps { display: grid; gap: 0; }
.flow-step { display: grid; grid-template-columns: 34px 1fr; gap: 12px; }
.flow-step-rail { display: flex; flex-direction: column; align-items: center; }
.flow-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.flow-step-line { flex: 1; width: 2px; background: var(--line); margin: 4px 0; min-height: 14px; }
.flow-step-body {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
}
.flow-step-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.flow-step-head strong { font-family: var(--fg); font-size: 14px; }
.flow-id {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10px;
  color: var(--text-3);
  background: var(--surface-2);
  border-radius: 5px;
  padding: 2px 6px;
}
.flow-type-tag {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  border: 1px solid var(--line-strong);
}
.flow-step-detail { font-size: 12.5px; color: var(--text-2); margin-top: 6px; line-height: 1.5; }
.flow-step-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.flow-link { font-size: 11.5px; color: var(--text-3); }
.flow-link code { color: var(--accent); font-size: 11px; }
.flow-link.decline code { color: var(--warning); }
.flow-link.decline { color: rgba(245, 158, 11, .7); }

.t-message { border-left-color: #60a5fa !important; }
.t-message .flow-type-tag { color: #93c5fd; border-color: rgba(96, 165, 250, .35); background: rgba(96, 165, 250, .1); }
.t-message .flow-step-num { border-color: rgba(96, 165, 250, .5); color: #93c5fd; }
.t-capture { border-left-color: #a78bfa !important; }
.t-capture .flow-type-tag { color: #c4b5fd; border-color: rgba(167, 139, 250, .35); background: rgba(167, 139, 250, .1); }
.t-capture .flow-step-num { border-color: rgba(167, 139, 250, .5); color: #c4b5fd; }
.t-offer { border-left-color: var(--accent) !important; }
.t-offer .flow-type-tag { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.t-offer .flow-step-num { border-color: var(--accent-line); color: var(--accent); box-shadow: 0 0 12px rgba(255, 94, 0, .25); }
.t-upsell { border-left-color: var(--success) !important; }
.t-upsell .flow-type-tag { color: #86efac; border-color: rgba(34, 197, 94, .35); background: rgba(34, 197, 94, .1); }
.t-upsell .flow-step-num { border-color: rgba(34, 197, 94, .5); color: #86efac; }
.t-downsell { border-left-color: var(--warning) !important; }
.t-downsell .flow-type-tag { color: #fcd34d; border-color: rgba(245, 158, 11, .35); background: rgba(245, 158, 11, .1); }
.t-downsell .flow-step-num { border-color: rgba(245, 158, 11, .5); color: #fcd34d; }
.t-end { border-left-color: var(--text-3) !important; }
.t-end .flow-type-tag { color: var(--text-3); }

.flow-bumps { margin-top: 16px; }
.flow-bumps h3 { font-family: var(--fg); font-size: 13px; margin-bottom: 8px; color: var(--text-2); }
.flow-bump {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--accent-soft);
  border: 1px dashed var(--accent-line);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-size: 13px;
  margin-bottom: 6px;
}
.flow-bump-price { color: var(--accent); font-weight: 700; }

.flow-empty { color: var(--text-3); font-size: 13.5px; padding: 24px 4px; line-height: 1.6; }

.flows-list { margin-top: 4px; }
.flow-cards { display: grid; gap: 10px; }
.flow-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: border-color .2s, background .2s;
}
.flow-card:hover { border-color: var(--accent-line); background: var(--surface-2); }
.flow-card-main strong { font-family: var(--fg); font-size: 14.5px; }
.flow-card-main .muted { font-size: 12px; margin-top: 3px; }
.flow-card-actions { display: flex; gap: 8px; align-items: center; }

@media (max-width: 1100px) {
  .flows-grid { grid-template-columns: 1fr; }
}

/* ---------- Visão editor RubyBot ---------- */

.flow-select {
  width: 100%;
  height: var(--control-h);
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0 12px;
  font-size: 13.5px;
}
.flow-select:focus { outline: none; border-color: var(--accent-line); }

.rb-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.rb-badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 6px;
}
.rb-title { display: block; font-family: var(--fg); font-size: 18px; }
.rb-summary { margin-bottom: 0; }

.rb-section { margin-bottom: 18px; }
.rb-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--fg);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
}
.rb-num {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rb-line { font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.rb-media {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10.5px;
  color: var(--text-3);
  background: var(--surface-2);
  border-radius: 5px;
  padding: 2px 6px;
  word-break: break-all;
}
.rb-chip {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  margin: 0 4px 4px 0;
}
.rb-chip.on { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.rb-chip.accent { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); font-weight: 800; }
.rb-text {
  background: #080808;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--fs);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow-y: auto;
}
.rb-text.small { max-height: 170px; font-size: 12px; }

.rb-plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.rb-plan {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-top: 3px solid #60a5fa;
  border-radius: var(--radius-sm);
  padding: 13px 14px;
}
.rb-plan.c-danger { border-top-color: var(--danger); }
.rb-plan.c-primary { border-top-color: var(--accent); }
.rb-plan-name { font-size: 12.5px; font-weight: 700; min-height: 32px; line-height: 1.35; }
.rb-plan-price { font-family: var(--fg); font-size: 21px; font-weight: 700; color: var(--accent); margin: 6px 0 2px; }
.rb-plan-meta { font-size: 11px; color: var(--text-3); margin-bottom: 6px; }
.rb-plan-entrega { font-family: ui-monospace, Consolas, monospace; font-size: 10px; color: var(--text-3); word-break: break-all; margin-bottom: 6px; }

.rb-bump {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.rb-bump.on { border-color: var(--accent-line); background: linear-gradient(180deg, rgba(255, 94, 0, .06), transparent), var(--surface-1); }
.rb-bump.off { opacity: .55; }
.rb-bump-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; }
.rb-price { color: var(--accent); font-weight: 800; font-family: var(--fg); }

.rb-seq {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-left: 3px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.rb-seq.downsell { border-left-color: var(--warning); }
.rb-seq-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.rb-seq-plan { display: flex; align-items: baseline; gap: 8px; font-size: 13px; margin-bottom: 6px; flex-wrap: wrap; }

.rb-cascade { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.rb-arrow { color: var(--text-3); font-size: 13px; }

.rb-cfg { display: grid; gap: 6px; font-size: 13px; margin-bottom: 10px; }
.rb-cfg .muted { display: inline-block; min-width: 130px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Mobile ---------- */

@media (max-width: 768px) {
  .app-sidebar {
    width: 260px;
    z-index: 1101;
    transform: translateX(-100%);
    transition: transform .28s ease;
  }
  .app-sidebar.active { transform: translateX(0); }
  .app-sidebar.active + .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(6px);
  }
  body.sidebar-open { overflow: hidden; }
  .hamburguer { display: flex; }
  .main-content { margin-left: 0; padding: 72px 18px 96px; }
  .bots-grid { grid-template-columns: 1fr; }
  .bottom-dock { display: block; }
  .topbar-inner { padding: 12px 18px; }
  .hero-greet { padding: 22px; }
  .hero-greet-actions { width: 100%; }
  .hero-greet-actions .btn { flex: 1; }
}

/* ---------- Editor de fluxo: abas ---------- */
.funnel-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 8px 10px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.funnel-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid transparent;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: background .15s, color .15s, border-color .15s;
}
.funnel-tab:hover { color: var(--text); background: var(--surface-3); }
.funnel-tab.tab-active {
  background: linear-gradient(90deg, #ff6b1a, var(--accent));
  border-color: rgba(255, 255, 255, .18);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 18px var(--accent-glow);
}
.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.funnel-tab.tab-active .tab-count { background: rgba(0, 0, 0, .28); color: #fff; }

/* ---------- Editor de fluxo: toolbar (abas + acoes) ---------- */
.funnel-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.funnel-toolbar .funnel-tabs {
  flex: 1 1 420px;
  min-width: 0;
  margin-bottom: 0;
}
.toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}
.tab-hint {
  font-size: 12.5px;
  color: var(--text-3);
  margin: 0 0 14px;
}
.modal-head .badge-type { font-size: 10px; }

.disp-plans-box {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px; margin-bottom: 4px;
  background: rgba(255,255,255,.02); border: 1px solid var(--line); border-radius: 10px;
  max-height: 190px; overflow-y: auto;
}
.disp-plan-item {
  display: flex !important; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-2); cursor: pointer; margin: 0;
}
.disp-plan-item input { width: auto; min-height: auto; margin: 0; }
.disp-plan-tags { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.dash-ranges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.dash-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 18px; align-items: start; }
.dash-grid .card { margin-top: 18px; }
@media (max-width: 980px) { .dash-grid { grid-template-columns: 1fr; } }
.activity-feed { display: flex; flex-direction: column; gap: 4px; }
.activity-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255,255,255,.02); font-size: 13px;
}
.activity-icon { font-size: 15px; line-height: 1; }
.activity-text { flex: 1; color: var(--text-2); }
.activity-when { font-size: 11px; color: var(--text-3); white-space: nowrap; }

/* ---------- Editor de fluxo: secoes do formulario ---------- */
.form-section {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px 14px;
  margin-bottom: 12px;
  background: var(--surface-1);
}
.form-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 2px;
}
.form-section label { margin-top: 12px; }
.form-section label:first-child { margin-top: 8px; }
.of-cell { display: grid; gap: 4px; min-width: 0; }
.of-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  font-weight: 700;
}
.of-cell input { width: 100%; }

/* ---------- Editor de fluxo: mobile ---------- */
@media (max-width: 768px) {
  .funnel-toolbar .funnel-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .funnel-toolbar .funnel-tabs::-webkit-scrollbar { display: none; }
  .funnel-tab { white-space: nowrap; flex: 0 0 auto; }
  .toolbar-actions { width: 100%; margin-left: 0; }
  .toolbar-actions .btn { flex: 1; justify-content: center; }

  .step-card { flex-wrap: wrap; }
  .step-ops { width: 100%; padding-top: 8px; border-top: 1px dashed var(--line); }

  .offers-editor .offer-row { grid-template-columns: 1fr; }
  .offers-editor .offer-row .mini-del { grid-column: 1 / -1; width: 100%; height: 34px; }
  .buttons-editor .button-row { grid-template-columns: 1fr; }
  .media-row { grid-template-columns: 1fr; }

  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal, .modal-sm {
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
  }
  .modal-body { max-height: none; flex: 1 1 auto; overflow-y: auto; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn { flex: 1; justify-content: center; }

  .save-status { bottom: 76px; right: 12px; left: 12px; text-align: center; z-index: 1200; }
}

/* ---------- Editor de fluxo: edicao inline ---------- */
.step-card {
  display: block;
  padding: 0;
  overflow: hidden;
}
.step-card.is-open {
  border-color: var(--accent-line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}
.step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  cursor: pointer;
}
.step-card.is-open .step-head {
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.step-body {
  padding: 14px 16px 16px;
  background: rgba(10, 11, 14, .45);
}

.drag-handle {
  cursor: grab;
  color: var(--text-3);
  font-size: 15px;
  letter-spacing: -2px;
  user-select: none;
  padding: 0 2px;
  flex: 0 0 auto;
}
.step-card.dragging { opacity: .45; }
.step-card.drop-target { outline: 2px dashed var(--accent-line); outline-offset: -2px; }

.step-ops .op-dup { font-size: 14px; }
.step-ops .op-edit { font-weight: 700; color: var(--text-2); }

.var-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.chip {
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.chip:hover { color: var(--text); border-color: var(--accent-line); }

.offer-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.offer-card-ops { display: flex; gap: 6px; }
.of-dup {
  width: 30px;
  height: 30px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-3);
  border-radius: 7px;
  cursor: pointer;
}
.of-dup:hover { color: var(--text); border-color: var(--line-strong); }

.stage-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 14px;
  background: var(--surface-1);
  transition: border-color .2s, box-shadow .2s;
}
.stage-card.stage-card-active {
  border-color: var(--accent-line);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .35);
}
.stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.stage-head .muted { font-size: 12.5px; margin-top: 2px; }
.st-fields { display: grid; gap: 18px; }
.st-fields label { margin: 8px 0 6px; }
.st-fields .field-hint { margin-top: 6px; }

.bump-toggles {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.editor-grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: start;
}

.editor-col-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.editor-col-media {
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  min-width: 0;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.char-counter {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  font-family: ui-monospace, Consolas, monospace;
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.editor-textarea {
  width: 100%;
  min-height: 185px;
  background-color: #0b0d12 !important;
  border: 1px solid var(--line-strong) !important;
  border-radius: var(--radius-sm);
  padding: 13px 15px !important;
  font-size: 13.5px !important;
  line-height: 1.6 !important;
  color: var(--text) !important;
  resize: vertical;
}

.fields-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.fields-row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.deliverable-grid {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 10px;
  align-items: end;
}

.media-empty-state {
  margin-top: 10px;
  padding: 18px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  background: rgba(0, 0, 0, .2);
}

.section-divider-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 22px 0 10px;
}

.offers-sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.offers-sort-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.offer-order-list {
  display: grid;
  gap: 6px;
}

.offer-order-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--control-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.offer-order-num {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 6px;
  padding: 2px 7px;
  flex-shrink: 0;
}

.offer-order-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offer-order-actions {
  display: flex;
  gap: 4px;
}

.of-quick-move, .of-dup:disabled {
  width: 28px;
  height: 28px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  border-radius: 6px;
  cursor: pointer;
}

.of-quick-move:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--accent-line);
}

.of-quick-move:disabled, .of-dup:disabled {
  opacity: .35;
  cursor: not-allowed;
}

@media (max-width: 920px) {
  .editor-grid-2 { grid-template-columns: 1fr; }
  .fields-row-2, .fields-row-3, .deliverable-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .step-head { flex-wrap: wrap; }
  .step-info { flex: 1 1 140px; }
  .step-body { padding: 10px 12px 14px; }
  .stage-card { padding: 14px; }
}
