/* ================================================================
   SwiftbuildAI Admin — Global Styles
   Font: Inter (Google Fonts)
   ================================================================ */

:root {
  --sidebar-w:   240px;
  --primary:     #4F46E5;
  --primary-dk:  #4338CA;
  --primary-lt:  #EEF2FF;
  --danger:      #EF4444;
  --success:     #22C55E;
  --warning:     #F59E0B;
  --text:        #1F2937;
  --text-muted:  #6B7280;
  --border:      #E5E7EB;
  --bg:          #F9FAFB;
  --white:       #FFFFFF;
  --sidebar-bg:  #111827;
  --sidebar-txt: #D1D5DB;
  --radius:      10px;
  --shadow:      0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 16px rgba(0,0,0,.1);
}

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

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ================================================================
   LAYOUT
   ================================================================ */
.sbai-admin {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.25s ease;
}

.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.content {
  flex: 1;
  padding: 24px;
  max-width: 1400px;
}

/* ---- Sidebar Brand -------------------------------------------- */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-icon { width: 32px; height: 32px; flex-shrink: 0; }
.brand-name { color: #fff; font-weight: 700; font-size: 16px; }

/* ---- Bot Switcher --------------------------------------------- */
.bot-switcher { padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.bot-switcher select {
  width: 100%;
  background: rgba(255,255,255,.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  cursor: pointer;
}
.bot-switcher select option { background: #1f2937; }

/* ---- Nav ----------------------------------------------------- */
.sidebar-nav { flex: 1; padding: 8px 0; }
.nav-section-label {
  padding: 10px 16px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6B7280;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--sidebar-txt);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  border-radius: 6px;
  margin: 1px 8px;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-label { font-size: 10px; color: #6B7280; text-transform: uppercase; letter-spacing: .05em; display: block; }

/* ---- Sidebar Footer ------------------------------------------- */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-info { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.user-av {
  width: 32px; height: 32px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.user-name  { color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { color: #6B7280; font-size: 11px; }
.logout-btn {
  color: #6B7280;
  background: none; border: none; cursor: pointer;
  padding: 4px;
  display: flex;
}
.logout-btn:hover { color: #EF4444; }
.logout-btn svg { width: 18px; height: 18px; }

/* ================================================================
   TOPBAR
   ================================================================ */
.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.menu-toggle {
  display: none;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.menu-toggle svg { width: 22px; height: 22px; stroke: var(--text); }
.page-title { font-size: 18px; font-weight: 600; }
.topbar-right { margin-left: auto; }
.bot-badge {
  background: var(--primary-lt);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.15s, opacity 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover  { filter: brightness(1.08); text-decoration: none; }
.btn:active { filter: brightness(0.95); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 13px; border-radius: 6px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  padding: 2px 6px; font-size: 14px;
}
.btn-icon:hover { color: var(--danger); }
.btn-copy {
  background: none; border: 1px solid var(--border); border-radius: 5px;
  cursor: pointer; padding: 2px 6px; color: var(--text-muted);
}
.btn-copy svg { width: 14px; height: 14px; }
.btn-copy:hover { color: var(--primary); }

/* ================================================================
   FORMS
   ================================================================ */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 5px; font-weight: 500; font-size: 13px; }
.form-control, .form-control-sm {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
  transition: border-color 0.15s;
  outline: none;
}
.form-control:focus, .form-control-sm:focus { border-color: var(--primary); }
.form-control-sm { font-size: 12px; padding: 5px 8px; border-radius: 6px; }
textarea.form-control { resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.form-check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.form-check input { width: 16px; height: 16px; cursor: pointer; }
.form-check label { cursor: pointer; font-weight: 500; }
.check-inline { display: flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 13px; cursor: pointer; }
.help-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
small { font-size: 12px; color: var(--text-muted); }

/* Color picker */
.color-pick { display: flex; gap: 8px; align-items: center; }
.color-pick input[type=color] { width: 40px; height: 38px; padding: 2px; border: 1.5px solid var(--border); border-radius: 8px; cursor: pointer; }
.color-pick .form-control { flex: 1; }

/* Input with copy button */
.input-copy { display: flex; gap: 8px; }
.input-copy .form-control { flex: 1; }

/* Password field */
.input-pw { position: relative; }
.input-pw .form-control { padding-right: 40px; }
.pw-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-muted); }
.pw-toggle svg { width: 18px; height: 18px; }

/* Lead form field rows */
.field-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.field-row .form-control { flex: 1; }

/* ================================================================
   CARDS
   ================================================================ */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--bg); }
.mt-4 { margin-top: 24px; }
.mb-3 { margin-bottom: 16px; }

/* ================================================================
   TABLES
   ================================================================ */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  background: var(--bg);
  padding: 10px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 13px;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #FAFAFA; }

/* ================================================================
   BADGES
   ================================================================ */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}
.badge-active    { background: #DCFCE7; color: #15803D; }
.badge-inactive  { background: #F3F4F6; color: #6B7280; }
.badge-new       { background: #EEF2FF; color: #4F46E5; }
.badge-contacted { background: #FFF7ED; color: #C2410C; }
.badge-qualified { background: #ECFDF5; color: #065F46; }
.badge-converted { background: #DCFCE7; color: #15803D; }
.badge-lost      { background: #FEF2F2; color: #991B1B; }
.badge-returning { background: #F0F9FF; color: #0369A1; }
.badge-closed    { background: #F3F4F6; color: #6B7280; }
.badge-archived  { background: #FFF7ED; color: #92400E; }
.badge-source    { background: var(--primary-lt); color: var(--primary); }

/* Status select in table */
.status-select {
  border: none; background: transparent; cursor: pointer; font-size: 12px;
  font-weight: 600; padding: 2px 4px; border-radius: 20px;
}

/* ================================================================
   STATS GRID
   ================================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 24px; height: 24px; }
.stat-num   { font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.stat-sub   { font-size: 12px; color: var(--success); font-weight: 500; margin-top: 2px; }

/* Charts */
.charts-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.chart-wrap { height: 220px; position: relative; }
canvas { max-height: 220px; }

/* ================================================================
   BOTS GRID
   ================================================================ */
.bots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.bot-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.bot-card-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.bot-avatar {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px; font-weight: 700; flex-shrink: 0;
  overflow: hidden;
}
.bot-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bot-name { font-size: 16px; font-weight: 600; }
.bot-stats {
  display: flex; gap: 20px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-bottom: 12px;
}
.bot-stats div { text-align: center; flex: 1; }
.bot-stats strong { display: block; font-size: 18px; font-weight: 700; }
.bot-stats span   { font-size: 11px; color: var(--text-muted); }
.bot-key {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg); border-radius: 6px; padding: 6px 10px;
  margin-bottom: 12px;
}
.bot-key code { font-size: 12px; font-family: monospace; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ================================================================
   ALERTS
   ================================================================ */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}
.alert-success { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.alert-error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }

/* ================================================================
   FILTERS BAR
   ================================================================ */
.filters-bar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap;
}
.filters-bar .form-control { min-width: 140px; flex: 1; }
.page-actions { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }

/* ================================================================
   PAGINATION
   ================================================================ */
.pagination { display: flex; gap: 4px; margin-top: 20px; justify-content: center; }
.page-btn {
  padding: 6px 12px; border: 1.5px solid var(--border); border-radius: 6px;
  font-size: 13px; color: var(--text); text-decoration: none;
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ================================================================
   MODALS
   ================================================================ */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 200;
  align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white); border-radius: 14px;
  padding: 28px; width: 500px; max-width: 95vw;
  box-shadow: var(--shadow-md);
  animation: modal-in 0.2s ease;
}
.modal-lg { width: 680px; }
.modal h2 { font-size: 18px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }
@keyframes modal-in { from { opacity:0; transform: scale(.96) translateY(8px); } to { opacity:1; transform:none; } }

/* ================================================================
   TABS
   ================================================================ */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab {
  padding: 10px 16px; border: none; background: none;
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  font-family: inherit; transition: color 0.15s;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ================================================================
   SETTINGS FORM (bot-edit)
   ================================================================ */
.settings-form { max-width: 800px; }
.code-block {
  background: #1e1e2e; color: #cdd6f4;
  border-radius: 8px; padding: 16px;
  font-size: 13px; white-space: pre-wrap; overflow-x: auto;
  font-family: monospace; line-height: 1.6;
}
.role-info { background: var(--bg); padding: 10px 14px; border-radius: 8px; font-size: 12px; line-height: 1.8; }

/* ================================================================
   CONVERSATION VIEW
   ================================================================ */
.conv-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.messages-preview { padding: 16px; max-height: 600px; overflow-y: auto; }
.prev-msg { margin-bottom: 12px; }
.prev-msg-user .prev-bubble { margin-left: auto; max-width: 80%; }
.prev-msg-assistant .prev-bubble { max-width: 80%; }
.prev-bubble {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px;
}
.prev-msg-user .prev-bubble { background: var(--primary-lt); }
.prev-role { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.prev-text { font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.prev-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.meta-list { padding: 12px 16px; }
.meta-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 7px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.meta-row:last-child { border: none; }
.meta-row span { color: var(--text-muted); min-width: 100px; }
.meta-row strong { text-align: right; word-break: break-all; }
.truncate-link { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; font-size: 11px; }

/* ================================================================
   LEAD SCORE BAR
   ================================================================ */
.score-bar {
  height: 6px; background: var(--border);
  border-radius: 3px; overflow: hidden; margin-bottom: 2px;
}
.score-bar div { height: 100%; background: var(--primary); border-radius: 3px; }

/* ================================================================
   LOGIN PAGE
   ================================================================ */
.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
}
.login-wrap { width: 400px; max-width: 95vw; }
.login-card {
  background: var(--white); border-radius: 16px; padding: 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand svg { margin-bottom: 10px; }
.login-brand h1 { font-size: 22px; font-weight: 700; }
.login-brand p  { color: var(--text-muted); margin-top: 4px; }
.login-form { margin-top: 16px; }
.login-form .btn { margin-top: 8px; }
.login-hint { text-align: center; color: var(--text-muted); font-size: 12px; margin-top: 16px; }
.d-none { display: none !important; }

/* ================================================================
   FLOW BUILDER
   ================================================================ */
.flow-builder-layout { display: flex; height: calc(100vh - 100px); gap: 0; overflow: hidden; }

.flow-sidebar {
  width: 220px; flex-shrink: 0; background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
}
.flow-sidebar-header { display: flex; gap: 6px; padding: 10px; border-bottom: 1px solid var(--border); }
.flow-sidebar-header select { flex: 1; }
#flow-list { flex: 1; overflow-y: auto; }
.flow-item {
  padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.flow-item:hover { background: var(--bg); }
.flow-item.active { background: var(--primary-lt); }
.flow-item-name { font-size: 13px; font-weight: 500; }
.flow-item-meta { display: flex; gap: 8px; align-items: center; margin-top: 4px; font-size: 11px; color: var(--text-muted); }

.flow-canvas-area {
  flex: 1; display: flex; flex-direction: column; margin: 0 12px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.flow-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  background: var(--bg); gap: 12px;
}
.toolbar-left  { display: flex; gap: 8px; flex: 1; align-items: center; }
.toolbar-right { display: flex; gap: 6px; align-items: center; }
.flow-name-input {
  padding: 5px 10px; border: 1.5px solid var(--border); border-radius: 6px;
  font-size: 14px; font-weight: 600; width: 200px; font-family: inherit;
}
.flow-name-input:focus { outline: none; border-color: var(--primary); }
#zoom-level { font-size: 12px; color: var(--text-muted); min-width: 40px; text-align: center; }

.node-palette {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
  padding: 6px 12px; border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.palette-label { font-size: 11px; color: var(--text-muted); }
.palette-node {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 6px; border: 1.5px solid;
  font-size: 12px; font-weight: 500; cursor: grab; user-select: none;
  background: var(--white); transition: transform 0.1s;
}
.palette-node:active { cursor: grabbing; transform: scale(0.97); }

.canvas-container {
  flex: 1; position: relative; overflow: hidden;
  background-color: #F8F9FF;
  background-image: radial-gradient(circle, #d0d3e8 1px, transparent 1px);
  background-size: 24px 24px;
}
.canvas-svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1;
}
.canvas-nodes { position: absolute; inset: 0; transform-origin: 0 0; z-index: 2; }
.canvas-hint { padding: 4px 12px; font-size: 11px; color: var(--text-muted); border-top: 1px solid var(--border); text-align: center; }

/* Flow nodes */
.flow-node {
  position: absolute; min-width: 160px; max-width: 200px;
  background: var(--white); border: 2px solid;
  border-radius: 10px; cursor: pointer; user-select: none;
  box-shadow: var(--shadow);
  transition: box-shadow 0.15s;
}
.flow-node:hover, .flow-node.selected { box-shadow: 0 4px 20px rgba(79,70,229,.25); }
.flow-node.selected { outline: 2px solid var(--primary); outline-offset: 2px; }
.flow-node-header {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px; border-bottom: 1px solid rgba(0,0,0,.06);
  font-size: 12px; font-weight: 600;
}
.flow-node-body { padding: 6px 10px; font-size: 12px; color: var(--text-muted); min-height: 30px; }
.node-port {
  position: absolute; width: 12px; height: 12px;
  border-radius: 50%; border: 2px solid var(--primary);
  background: var(--white); cursor: crosshair;
}
.node-port-in  { top: 50%; left: -7px; transform: translateY(-50%); }
.node-port-out { top: 50%; right: -7px; transform: translateY(-50%); }
.node-port:hover { background: var(--primary); }

/* Properties panel */
.node-props-panel {
  width: 260px; flex-shrink: 0; background: var(--white);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; overflow-y: auto;
}
.node-props-panel h4 { font-size: 14px; margin-bottom: 8px; }

/* ================================================================
   EMPTY STATE
   ================================================================ */
.empty-state { text-align: center; color: var(--text-muted); padding: 24px; font-size: 13px; }
.empty-state-big {
  grid-column: 1 / -1; text-align: center;
  padding: 48px 24px; color: var(--text-muted);
}
.empty-state-big svg { width: 72px; height: 72px; margin: 0 auto 16px; display: block; }
.empty-state-big h3 { font-size: 18px; color: var(--text); margin-bottom: 8px; }
.empty-state-big p  { margin-bottom: 20px; }

/* ================================================================
   TOAST
   ================================================================ */
#toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  background: #1F2937; color: #fff;
  padding: 10px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  animation: toast-in 0.2s ease;
  display: none;
}
@keyframes toast-in { from { opacity:0; transform: translateY(10px); } to { opacity:1; transform:none; } }

/* ================================================================
   MISC UTILITIES
   ================================================================ */
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.py-4        { padding: 16px 0; }
.mt-2        { margin-top: 8px; }
.d-flex      { display: flex; }
.gap-2       { gap: 8px; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; }
  .menu-toggle { display: flex; }
  .charts-grid { grid-template-columns: 1fr; }
  .conv-layout { grid-template-columns: 1fr; }
  .flow-builder-layout { flex-direction: column; height: auto; }
  .form-row { grid-template-columns: 1fr; }
}
