:root {
  --bg: #08080a;
  --panel: #131316;
  --panel-alt: #18181c;
  --border: #262629;
  --text: #f3f3f5;
  --text-muted: #9d9da5;
  --red: #ef1f36;
  --red-bright: #ff3b52;
  --red-dark: #6e0f1c;
  --red-glow: rgba(239, 31, 54, 0.45);
  --success: #2ecc71;
  --gold: #f5c518;
  --radius: 14px;
  --radius-sm: 9px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

/* ---------- Fundo com gradientes vermelhos ---------- */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(700px circle at 12% -5%, var(--red-glow), transparent 60%),
    radial-gradient(600px circle at 110% 15%, rgba(239, 31, 54, 0.28), transparent 55%),
    radial-gradient(900px circle at 50% 120%, rgba(110, 15, 28, 0.4), transparent 60%),
    var(--bg);
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  row-gap: 12px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.3px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--red-bright), var(--red-dark));
  box-shadow: 0 0 22px var(--red-glow);
  font-size: 17px;
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
}

.user-chip img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.user-chip span {
  font-size: 14px;
  font-weight: 600;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--red-bright), var(--red));
  color: #fff;
  box-shadow: 0 8px 24px var(--red-glow);
}

.btn-primary:hover {
  box-shadow: 0 10px 32px var(--red-glow);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--red);
  color: var(--red-bright);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ---------- Hero ---------- */
.hero {
  padding: 108px 0 90px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 28px;
}

.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.hero h1 {
  font-size: 58px;
  line-height: 1.08;
  font-weight: 800;
  margin: 0 0 22px;
  letter-spacing: -1px;
}

.hero h1 .accent {
  background: linear-gradient(135deg, var(--red-bright), #ff8a63);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  font-size: 19px;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 38px;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---------- Stats strip ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 80px;
}

.stat {
  text-align: center;
  padding: 22px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.stat b {
  display: block;
  font-size: 30px;
  background: linear-gradient(135deg, #fff, #ffb3ba);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat span {
  color: var(--text-muted);
  font-size: 13px;
}

/* ---------- Sections ---------- */
.section {
  padding: 90px 0;
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 52px;
}

.section-head .tag {
  color: var(--red-bright);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
  display: block;
}

.section-head h2 {
  font-size: 34px;
  margin: 0 0 14px;
  font-weight: 800;
}

.section-head p {
  color: var(--text-muted);
  font-size: 16px;
}

/* ---------- Cards de feature ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: var(--red-dark);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: linear-gradient(135deg, rgba(239, 31, 54, 0.25), rgba(239, 31, 54, 0.05));
  border: 1px solid var(--red-dark);
  margin-bottom: 18px;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14.5px;
}

/* ---------- Planos ---------- */
.plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.plan {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 30px 26px;
  position: relative;
}

.plan.featured {
  border-color: var(--red);
  background: linear-gradient(180deg, rgba(239, 31, 54, 0.1), var(--panel) 40%);
  box-shadow: 0 20px 50px var(--red-glow);
}

.plan .badge {
  position: absolute;
  top: -12px;
  right: 24px;
  background: linear-gradient(135deg, var(--red-bright), var(--red));
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plan h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.plan .price {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 20px;
}

.plan ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.plan li {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.plan li .ok {
  color: var(--red-bright);
  font-weight: 800;
}

/* ---------- CTA final ---------- */
.cta {
  text-align: center;
  border: 1px solid var(--red-dark);
  background: linear-gradient(160deg, rgba(239, 31, 54, 0.14), var(--panel));
  border-radius: 22px;
  padding: 70px 30px;
}

.cta h2 {
  font-size: 32px;
  margin: 0 0 14px;
  font-weight: 800;
}

.cta p {
  color: var(--text-muted);
  margin: 0 0 30px;
}

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  padding: 34px 0;
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Dashboard ---------- */
.page-head {
  padding: 56px 0 30px;
}

.page-head h1 {
  font-size: 32px;
  margin: 0 0 8px;
  font-weight: 800;
}

.page-head p {
  color: var(--text-muted);
  margin: 0;
}

/* ---------- Tira de estatísticas do dashboard ---------- */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.dash-stat {
  border: 1px solid var(--border);
  background: linear-gradient(160deg, var(--panel), var(--panel-alt));
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-stat-value {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, #ffb3ba);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dash-stat-value.accent-success {
  background: linear-gradient(135deg, #fff, #7ce8a4);
  -webkit-background-clip: text;
  background-clip: text;
}

.dash-stat-value.accent-muted {
  background: none;
  -webkit-text-fill-color: initial;
  color: var(--text-muted);
}

.dash-stat-label {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.guild-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding-bottom: 80px;
}

.guild-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, var(--panel), var(--panel-alt));
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.guild-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red-bright), var(--red-dark));
  opacity: 0.7;
}

.guild-card.is-managed:hover {
  transform: translateY(-3px);
  border-color: #3a3a40;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(239, 31, 54, 0.12);
}

.guild-card.is-missing {
  opacity: 0.55;
}

.guild-card.is-missing::before {
  background: var(--border);
  opacity: 1;
}

.guild-card.is-missing:hover {
  opacity: 0.8;
}

.guild-card.expiring {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(245, 197, 24, 0.25);
}

/* ---------- Barra de ações em lote ---------- */
.bulk-bar {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 12px 10px 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  z-index: 80;
  max-width: calc(100vw - 32px);
  flex-wrap: wrap;
}

.bulk-bar.visible {
  display: flex;
}

.bulk-bar span[data-bulk-count] {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.guild-card .head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.guild-card .head-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guild-icon {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: linear-gradient(150deg, var(--panel-alt), #212126);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 17px;
  color: var(--red-bright);
  overflow: hidden;
  flex-shrink: 0;
}

.guild-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guild-card.is-missing .guild-icon img {
  filter: grayscale(0.6);
}

.guild-card .name {
  font-weight: 700;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-tag {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(245, 197, 24, 0.15);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  width: fit-content;
}

.badge-active {
  background: rgba(46, 204, 113, 0.15);
  color: var(--success);
}

.badge-inactive {
  background: rgba(157, 157, 165, 0.15);
  color: var(--text-muted);
}

.badge-missing {
  background: rgba(239, 31, 54, 0.15);
  color: var(--red-bright);
}

.guild-card .row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.guild-card .row .btn {
  flex: 1 1 auto;
  justify-content: center;
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  padding: 70px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}

/* ---------- Tabelas / listas de transcript ---------- */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 14px 18px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: var(--panel-alt);
}

tr:last-child td {
  border-bottom: none;
}

.status-open {
  color: var(--success);
  font-weight: 700;
}

.status-closed {
  color: var(--text-muted);
  font-weight: 700;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 30px 0 10px;
}

.pagination a,
.pagination span {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.pagination a:hover {
  border-color: var(--red);
  color: var(--red-bright);
}

/* ---------- Visualizador de transcript ---------- */
.transcript-box {
  background: #0b0b0d;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  font-family: 'Cascadia Code', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  color: #d7d7db;
  max-height: 70vh;
  overflow-y: auto;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.meta-item {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.meta-item span {
  display: block;
  color: var(--text-muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.meta-item b {
  font-size: 14.5px;
}

.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--red-dark);
  background: rgba(239, 31, 54, 0.1);
  color: #ffb3ba;
  margin-bottom: 24px;
  font-size: 14px;
}

/* ---------- Log de mensagens (transcript em bolhas de chat, estilo conversa) ---------- */
.chat-log {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 75vh;
  overflow-y: auto;
  padding: 10px 4px 10px 0;
  background: #0e0e10;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.chat-day-separator {
  display: flex;
  justify-content: center;
  margin: 16px 0 10px;
}

.chat-day-separator span {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 4px 12px;
  border-radius: 999px;
}

.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 3px 16px;
}

.chat-row.grouped {
  padding-top: 1px;
}

.chat-row.out {
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--panel-alt);
  object-fit: cover;
}

.chat-row.grouped .chat-avatar {
  visibility: hidden;
}

.chat-bubble-col {
  display: flex;
  flex-direction: column;
  max-width: min(72%, 560px);
}

.chat-row.out .chat-bubble-col {
  align-items: flex-end;
}

.chat-bubble-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 4px 3px;
}

.chat-name {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--text-muted);
}

.chat-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.chat-badge.bot {
  background: rgba(239, 31, 54, 0.18);
  color: var(--red-bright);
}

.chat-badge.author {
  background: rgba(245, 197, 24, 0.18);
  color: var(--gold);
}

.chat-bubble {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  padding: 8px 12px 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 14px;
}

.chat-row.out .chat-bubble {
  background: linear-gradient(135deg, var(--red-bright), var(--red));
  border-color: transparent;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 4px;
}

.chat-content {
  font-size: 14px;
  color: #dcdce0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
  flex: 1 1 auto;
}

.chat-row.out .chat-content {
  color: #fff;
}

.chat-time {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

.chat-row.out .chat-time {
  color: rgba(255, 255, 255, 0.75);
}

/* ============================================================
   Painel de configuração
   ============================================================ */

.icon {
  flex-shrink: 0;
}

.config-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--radius);
  margin: 32px 0 24px;
}

.config-header .guild-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 18px;
}

.config-header .meta h1 {
  font-size: 19px;
  font-weight: 800;
  margin: 0 0 4px;
}

.config-header .meta .sub {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.config-header .spacer {
  flex: 1;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--success);
}

.live-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.config-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
  padding-bottom: 90px;
}

.config-nav {
  position: sticky;
  top: 22px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 8px;
}

.config-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 0;
  background: transparent;
  text-align: left;
  width: 100%;
  font-family: inherit;
  transition: background 0.12s ease, color 0.12s ease;
}

.config-nav-item:hover {
  background: var(--panel-alt);
  color: var(--text);
}

.config-nav-item.active {
  background: rgba(239, 31, 54, 0.14);
  color: var(--red-bright);
}

.config-main {
  min-width: 0;
}

.config-section {
  display: none;
}

.config-section.active {
  display: block;
  animation: section-in 0.18s ease;
}

@keyframes section-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.config-card {
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 20px;
}

.config-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.config-card-head h2 {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.config-card-head h2 .icon {
  color: var(--red-bright);
}

.config-card-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.field-row.single {
  grid-template-columns: 1fr;
}

.field label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

.field .hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.input,
.textarea {
  width: 100%;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 13px;
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.12s ease;
}

.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--red);
}

.textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.5;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 18px;
}

.save-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- Combobox pesquisável (canais/cargos) ---------- */
.combo {
  position: relative;
}

.combo-input {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 13px;
  border-radius: 9px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.combo-input:hover {
  border-color: #3a3a3f;
}

.combo.open .combo-input {
  border-color: var(--red);
}

.combo-input .placeholder {
  color: var(--text-muted);
}

.combo-input .val {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.combo-input .chevron {
  margin-left: auto;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.combo.open .combo-input .chevron {
  transform: rotate(180deg);
}

.combo-clear {
  color: var(--text-muted);
  padding: 2px;
  border-radius: 4px;
  flex-shrink: 0;
}

.combo-clear:hover {
  color: var(--red-bright);
}

.combo-dropdown {
  display: none;
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.combo.open .combo-dropdown {
  display: block;
}

.combo-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.combo-search input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
}

.combo-search input:focus {
  outline: none;
}

.combo-options {
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
}

.combo-group {
  padding: 8px 10px 4px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.combo-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 13.5px;
  cursor: pointer;
  color: var(--text);
}

.combo-option:hover,
.combo-option.highlighted {
  background: rgba(239, 31, 54, 0.14);
}

.combo-option .icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.combo-option .role-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-muted);
}

.combo-empty {
  padding: 18px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ---------- Multi-select de canais (anti-link) ---------- */
.chip-field {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 46px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 6px 5px 10px;
  border-radius: 999px;
}

.chip button {
  display: flex;
  color: var(--text-muted);
  border-radius: 50%;
  padding: 2px;
}

.chip button:hover {
  color: var(--red-bright);
  background: rgba(239, 31, 54, 0.15);
}

.chip-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.chip-add:hover {
  border-color: var(--red);
  color: var(--red-bright);
}

/* ---------- Subcabeçalho dentro de um card (agrupa um bloco de configs relacionadas) ---------- */
.config-subhead {
  margin: 8px 0 16px;
}

.config-subhead h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 800;
  margin: 0 0 4px;
  color: var(--text);
}

.config-subhead h3 .icon {
  color: var(--red-bright);
}

.config-subhead p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12.5px;
}

.field.is-disabled,
[data-close-roles-field].is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ---------- Toggle switch ---------- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.toggle-row .label {
  font-weight: 700;
  font-size: 14.5px;
  margin-bottom: 3px;
}

.toggle-row .desc {
  font-size: 12.5px;
  color: var(--text-muted);
}

.switch {
  position: relative;
  width: 44px;
  height: 25px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.15s ease, background 0.15s ease;
}

.switch.on {
  background: rgba(239, 31, 54, 0.25);
  border-color: var(--red);
}

.switch.on::after {
  transform: translateX(19px);
  background: var(--red-bright);
}

/* ---------- Painéis (lista + gestão) ---------- */
.panel-item {
  border: 1px solid var(--border);
  background: var(--panel-alt);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 14px;
}

.panel-item-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.panel-item-head .name {
  font-weight: 700;
  font-size: 15px;
}

.panel-item-head .spacer {
  flex: 1;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.on {
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.status-dot.off {
  background: var(--text-muted);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-muted);
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--text);
  border-color: #3a3a3f;
}

.icon-btn.danger:hover {
  color: var(--red-bright);
  border-color: var(--red-dark);
}

.icon-btn.spinning .icon {
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.panel-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--text-muted);
  font-size: 12.5px;
  margin-bottom: 12px;
}

.panel-item-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.panel-item-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ---------- Listas simples (bloqueados, respostas rápidas) ---------- */
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  background: var(--panel-alt);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 10px;
}

.list-row-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.list-row-main .name {
  font-weight: 700;
  font-size: 14px;
}

.list-row-main .muted {
  color: var(--text-muted);
  font-size: 12.5px;
}

/* ---------- Estatísticas ---------- */
.stats-loading {
  color: var(--text-muted);
  font-size: 13.5px;
  padding: 24px 0;
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  border: 1px solid var(--border);
  background: var(--panel-alt);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-card .stat-label {
  color: var(--text-muted);
  font-size: 12px;
}

.stat-card .stat-value {
  font-size: 22px;
  font-weight: 800;
}

.stats-block {
  margin-bottom: 26px;
}

.stats-block h3 {
  font-size: 13.5px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stats-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 140px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
}

.chart-bar-group {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  height: 100%;
  min-width: 0;
}

.chart-bar {
  flex: 1;
  max-width: 10px;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
}

.chart-bar.opened {
  background: var(--red-bright);
}

.chart-bar.closed {
  background: var(--text-muted);
}

.chart-legend {
  display: flex;
  gap: 18px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.chart-legend .dot.opened {
  background: var(--red-bright);
}

.chart-legend .dot.closed {
  background: var(--text-muted);
}

.stats-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stats-table-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-alt);
}

.stats-table-row .name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-table-row .value {
  color: var(--text-muted);
  flex-shrink: 0;
  font-size: 12px;
}

.stats-empty {
  color: var(--text-muted);
  font-size: 12.5px;
  padding: 10px 0;
}

.type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.type-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 6px 5px 12px;
  font-size: 12.5px;
  font-weight: 600;
}

.type-chip button {
  color: var(--text-muted);
  border-radius: 50%;
  padding: 2px;
  display: flex;
}

.type-chip button:hover {
  color: var(--red-bright);
  background: rgba(239, 31, 54, 0.15);
}

.type-chip-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.type-chip-add:hover {
  border-color: var(--red);
  color: var(--red-bright);
}

/* ---------- Toasts ---------- */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--success);
  border-radius: 10px;
  padding: 13px 18px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  min-width: 240px;
  animation: toast-in 0.2s ease;
}

.toast.error {
  border-left-color: var(--red);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Modal ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 5, 0.7);
  backdrop-filter: blur(3px);
  z-index: 90;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  width: 100%;
  max-width: 440px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.modal h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 800;
}

.modal p {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 13.5px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.modal-wide {
  max-width: 760px;
}

.modal-split,
.config-split {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.modal-split-form,
.config-split-form {
  flex: 1 1 280px;
  min-width: 0;
}

.modal-split-preview,
.config-split-preview {
  flex: 1 1 260px;
  min-width: 0;
}

.config-split {
  margin-bottom: 18px;
}

.preview-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ---------- Prévia de mensagem do Discord ---------- */
.discord-preview {
  background: #313338;
  border-radius: 10px;
  padding: 16px;
  border: 1px solid var(--border);
}

.discord-preview-msg {
  display: flex;
  gap: 12px;
}

.discord-preview-avatar {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red-bright), var(--red));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 15px;
}

.discord-preview-body {
  min-width: 0;
  flex: 1;
}

.discord-preview-author {
  color: #f2f3f5;
  font-weight: 600;
  font-size: 13.5px;
  margin-bottom: 6px;
}

.discord-preview-badge {
  background: #5865f2;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  vertical-align: middle;
}

.discord-preview-time {
  color: #949ba4;
  font-weight: 400;
  font-size: 11px;
}

.discord-preview-embed {
  border-left: 4px solid var(--red-bright);
  background: #2b2d31;
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.discord-preview-embed-title {
  color: #f2f3f5;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
  word-break: break-word;
}

.discord-preview-embed-desc {
  color: #dbdee1;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.discord-preview-embed-desc:empty {
  display: none;
}

.discord-preview-embed-image {
  display: none;
  max-width: 100%;
  border-radius: 4px;
  margin-top: 8px;
}

.discord-preview-embed-image.visible {
  display: block;
}

.discord-preview-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.discord-preview-btn {
  background: #4e5058;
  color: #f2f3f5;
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  display: inline-block;
}

.discord-preview-btn.muted {
  opacity: 0.6;
  font-style: italic;
}

.discord-preview-btn.primary {
  background: #248046;
  color: #fff;
}

.discord-preview-footer {
  color: #949ba4;
  font-size: 11px;
}

/* ---------- Info grid (sistema) ---------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.info-cell {
  border: 1px solid var(--border);
  background: var(--panel-alt);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.info-cell span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.info-cell b {
  font-size: 17px;
  font-weight: 800;
}

.warn-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--red-dark);
  background: rgba(239, 31, 54, 0.08);
  color: #ffb3ba;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .hero h1 {
    font-size: 40px;
  }
  .stats,
  .grid,
  .plans {
    grid-template-columns: 1fr 1fr;
  }
  .config-shell {
    grid-template-columns: 1fr;
  }
  .config-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .stats,
  .grid,
  .plans {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 34px;
  }
  footer {
    flex-direction: column;
    text-align: center;
  }
  .container {
    padding: 0 18px;
  }
  .dash-stats {
    grid-template-columns: 1fr;
  }
}
