:root {
  --bg-dark: #080c14;
  --bg-sidebar: #0e1424;
  --bg-card: #141c30;
  --bg-card-hover: #19243d;
  --bg-alt: #1c2742;
  --border: #22304f;
  --border-light: #2d3f66;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --primary: #25d366;
  --primary-glow: rgba(37, 211, 102, 0.25);
  --primary-hover: #1ebd58;
  --accent-cyan: #38bdf8;
  --accent-purple: #c084fc;
  --accent-orange: #fb923c;
  --danger: #ef4444;
  --warning: #f59e0b;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --sidebar-w: 270px;
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* =========================================
   TELA DE LOGIN
========================================= */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: radial-gradient(circle at top right, rgba(37, 211, 102, 0.08), transparent 40%),
              radial-gradient(circle at bottom left, rgba(56, 189, 248, 0.08), transparent 40%),
              var(--bg-dark);
}

.login-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.3s ease-out;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo {
  font-size: 2.2rem;
  background: linear-gradient(135deg, #10b981, #047857);
  width: 60px;
  height: 60px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
  margin-bottom: 14px;
}

.login-header h1 {
  font-size: 1.55rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--danger);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  text-align: center;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* =========================================
   LAYOUT DO PAINEL COM SIDEBAR LATERAL
========================================= */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
  }
}

/* SIDEBAR LATERAL */
.sidebar {
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 20px 16px;
  z-index: 100;
}

.sidebar-header {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-emoji {
  font-size: 1.6rem;
  background: linear-gradient(135deg, #10b981, #047857);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-pro {
  font-size: 0.65rem;
  font-weight: 800;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  color: #0b1120;
  padding: 2px 7px;
  border-radius: 6px;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar-user-preview {
  margin: 16px 0;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary);
  color: #061c10;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.business-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-alt);
  color: var(--accent-cyan);
}

/* Sidebar Navigation Items */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  padding: 12px 10px 6px;
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
  text-align: left;
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
}

.nav-item.active {
  background: rgba(37, 211, 102, 0.1);
  color: var(--primary);
  font-weight: 700;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 4px;
  background: var(--primary);
  border-radius: 4px;
}

.nav-icon {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
}

.nav-badge-pill {
  margin-left: auto;
  font-size: 0.6rem;
  color: var(--text-dim);
}

.nav-badge-pill.connected { color: var(--primary); text-shadow: 0 0 6px var(--primary); }
.nav-badge-pill.qrcode { color: var(--warning); text-shadow: 0 0 6px var(--warning); }
.nav-badge-pill.disconnected { color: var(--danger); }

.new-pill {
  margin-left: auto;
  font-size: 0.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #061c10;
  padding: 2px 6px;
  border-radius: 6px;
}

.nav-admin {
  background: rgba(192, 132, 252, 0.06);
  color: var(--accent-purple);
}

.nav-admin:hover {
  background: rgba(192, 132, 252, 0.12);
  color: #e9d5ff;
}

.nav-admin.active {
  background: rgba(192, 132, 252, 0.18);
  color: var(--accent-purple);
}

.nav-admin.active::before {
  background: var(--accent-purple);
}

.sidebar-footer {
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.btn-logout {
  color: #f87171 !important;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.1) !important;
}

/* =========================================
   ÁREA DE CONTEÚDO PRINCIPAL
========================================= */
.main-content {
  padding: 24px 32px 60px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-x: hidden;
}

@media (max-width: 900px) {
  .main-content {
    padding: 18px 16px 40px;
  }
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  flex-wrap: wrap;
  gap: 16px;
}

.header-titles h2 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.header-titles p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 12px;
}

.active-bot-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(37, 211, 102, 0.1);
  border: 1px solid rgba(37, 211, 102, 0.3);
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
}

.active-bot-pill strong {
  color: var(--primary);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 20px;
  background-color: var(--bg-alt);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
}

.status-ping {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-dim);
}

.status-badge.connected .status-ping {
  background-color: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

.status-badge.qrcode .status-ping {
  background-color: var(--warning);
  box-shadow: 0 0 10px var(--warning);
}

.status-badge.disconnected .status-ping {
  background-color: var(--danger);
}

/* Panes */
.content-pane {
  display: none;
}

.content-pane.active {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 18px 20px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
}

.stat-icon {
  font-size: 1.6rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.stat-icon.icon-green { background: rgba(37, 211, 102, 0.12); }
.stat-icon.icon-cyan { background: rgba(56, 189, 248, 0.12); }
.stat-icon.icon-purple { background: rgba(192, 132, 252, 0.12); }
.stat-icon.icon-orange { background: rgba(251, 146, 60, 0.12); }

.stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.card-body {
  padding: 22px;
}

.card-body.no-padding {
  padding: 0;
}

.center-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 280px;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 800px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
}

/* WhatsApp Layout */
.wa-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 850px) {
  .wa-layout {
    grid-template-columns: 1fr;
  }
}

.qr-steps {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
  text-align: left;
  background: var(--bg-alt);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.qr-frame {
  background: white;
  padding: 12px;
  border-radius: var(--radius-md);
  display: inline-block;
  margin-bottom: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.qr-frame img {
  width: 220px;
  height: 220px;
  display: block;
}

.success-bubble {
  width: 64px;
  height: 64px;
  background: rgba(37, 211, 102, 0.15);
  border: 2px solid var(--primary);
  color: var(--primary);
  font-size: 2rem;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.phone-chip {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  margin: 16px 0;
}

.badge-status {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}

.badge-status.green {
  background: rgba(37, 211, 102, 0.15);
  color: var(--primary);
}

/* Tip List */
.tip-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tip-item {
  display: flex;
  gap: 14px;
}

.tip-num {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--bg-alt);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.tip-item p {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 3px;
}

/* Bots Grid */
.section-top-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.actions-group {
  display: flex;
  gap: 10px;
}

.section-top-actions h3 {
  font-size: 1.25rem;
  font-weight: 800;
}

.bots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.bot-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  transition: all 0.25s;
}

.bot-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.bot-card.is-active {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(37, 211, 102, 0.05) 0%, var(--bg-card) 45%);
}

.active-ribbon {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--primary);
  color: #061c10;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 20px;
}

.bot-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bot-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 800;
  color: #061c10;
}

.bot-card-info h4 {
  font-size: 1.05rem;
  font-weight: 700;
}

.bot-slug {
  font-size: 0.78rem;
  color: var(--accent-cyan);
  font-family: 'JetBrains Mono', monospace;
}

.bot-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.45;
  min-height: 36px;
}

.bot-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.bot-actions-right {
  display: flex;
  gap: 6px;
}

/* =========================================
   PAINEL DE TEMPLATES & CRIADOR TYPEBOT (.JSON)
========================================= */
.banner-tutorial {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.1), rgba(56, 189, 248, 0.08));
  border: 1px solid rgba(37, 211, 102, 0.3);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
}

.tutorial-badge {
  display: inline-block;
  background: var(--primary);
  color: #061c10;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.banner-tutorial h3 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 18px;
}

.tutorial-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.t-step {
  display: flex;
  gap: 12px;
  background: rgba(14, 20, 36, 0.6);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.t-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #061c10;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.t-step p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 4px;
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.template-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.2s;
}

.template-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.template-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.template-icon {
  font-size: 2rem;
  background: var(--bg-alt);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}

.template-info h4 {
  font-size: 1.05rem;
  font-weight: 700;
}

.template-tag {
  font-size: 0.72rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.template-desc {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.45;
  min-height: 38px;
}

.template-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Criador Personalizado */
.custom-creator-card {
  margin-top: 8px;
}

.options-creator-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 10px;
}

.options-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.custom-options-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.option-row {
  display: flex;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: var(--radius-md);
  align-items: flex-start;
  flex-wrap: wrap;
}

@media (max-width: 700px) {
  .option-row {
    flex-direction: column;
  }
}

.custom-bot-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* Botão de Corretor Ortográfico */
.btn-spell {
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.15), rgba(56, 189, 248, 0.15)) !important;
  color: #c084fc !important;
  border: 1px solid rgba(192, 132, 252, 0.4) !important;
  font-weight: 700;
  transition: all 0.2s;
}

.btn-spell:hover {
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.25), rgba(56, 189, 248, 0.25)) !important;
  border-color: var(--accent-purple) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(192, 132, 252, 0.2);
}

/* Terminal */
.terminal-screen {
  background: #070a12;
  height: 420px;
  overflow-y: auto;
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-row {
  line-height: 1.45;
  word-break: break-all;
}

.log-info { color: #94a3b8; }
.log-error { color: #f87171; font-weight: 600; }
.log-in { color: #38bdf8; }
.log-out { color: #4ade80; }

.live-pill {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(37, 211, 102, 0.15);
  padding: 3px 8px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.4; }
  100% { transform: scale(1); opacity: 1; }
}

.header-with-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.terminal-actions {
  display: flex;
  gap: 8px;
}

/* Tabelas (Admin) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  background: var(--bg-alt);
  padding: 14px 18px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.status-dot-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.8rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot.connected { background: var(--primary); box-shadow: 0 0 8px var(--primary); }
.dot.qrcode { background: var(--warning); }
.dot.disconnected { background: var(--danger); }
.dot.offline { background: var(--text-dim); }

/* Forms */
.form-field {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

label {
  font-size: 0.85rem;
  font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
}

.input-with-suffix {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-suffix input {
  width: 100%;
  padding-right: 70px;
}

.input-with-suffix .suffix {
  position: absolute;
  right: 14px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.muted {
  font-size: 0.78rem;
  color: var(--text-muted);
}

code {
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-cyan);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
}

/* Buttons */
.btn {
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #061c10;
  box-shadow: 0 4px 14px var(--primary-glow);
}

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

.btn-secondary {
  background: var(--bg-alt);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border-light);
}

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

.btn-ghost:hover {
  background: var(--bg-alt);
  color: var(--text-main);
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-outline-danger:hover {
  background: var(--danger);
  color: white;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Modais */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalScale 0.2s ease-out;
}

@keyframes modalScale {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
}

.modal-close:hover { color: var(--text-main); }

.modal-body {
  padding: 22px;
}

.modal-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
}

/* Color Palette */
.color-palette {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.color-opt input {
  display: none;
}

.color-opt span {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s;
}

.color-opt input:checked + span {
  border-color: white;
  transform: scale(1.15);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--primary);
  color: var(--text-main);
  padding: 14px 22px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 2000;
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.hidden {
  display: none !important;
}
