/* ═══════════════════════════════════════════
   NexusFlow AI — app.css
   App UI Styles: Sidebar, Header, Components
═══════════════════════════════════════════ */

/* ─── CSS CUSTOM PROPERTIES ─── */
:root {
  --sidebar-w: 224px;
  --header-h: 56px;
  --indigo: #4F46E5;
  --indigo-dark: #4338CA;
  --indigo-soft: #EEF2FF;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-tertiary: #94A3B8;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);
  --bg-page: #F8FAFC;
  --bg-white: #FFFFFF;
  --shadow-xs: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-sm: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 16px rgba(15,23,42,0.07), 0 1px 4px rgba(15,23,42,0.04);
  --shadow-lg: 0 8px 32px rgba(15,23,42,0.09), 0 2px 8px rgba(15,23,42,0.04);
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --t: 180ms cubic-bezier(0.4,0,0.2,1);
}

/* ─── GLOBAL ─── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--bg-page);
  color: var(--text-primary);
  margin: 0; padding: 0;
}
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(15,23,42,0.12); border-radius: 4px; }
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; border-radius: 4px; }

/* ═══════════════════════════════════════════
   APP LAYOUT
═══════════════════════════════════════════ */
.app-body { display: flex; min-height: 100vh; }

/* ─── SIDEBAR ─── */
.app-sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform var(--t);
}

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

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--text-primary);
}
.sidebar-logo-mark {
  width: 30px; height: 30px;
  background: var(--indigo);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sidebar-logo-text {
  font-size: 14px; font-weight: 700;
  letter-spacing: -0.02em;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 0 8px 6px;
  display: block;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background-color var(--t), color var(--t);
  position: relative;
}
.sidebar-link:hover { color: var(--text-primary); background: var(--bg-page); }
.sidebar-link.active {
  color: var(--indigo);
  background: var(--indigo-soft);
  font-weight: 600;
}

.sidebar-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
}

.sidebar-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  background: var(--indigo-soft);
  color: var(--indigo);
  padding: 1px 6px;
  border-radius: 100px;
  min-width: 18px;
  text-align: center;
}
.sidebar-badge:empty { display: none; }

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

.sidebar-status {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 10px;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22C55E;
  animation: pulse-green 2.5s infinite;
}
@keyframes pulse-green {
  0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
  50% { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}
.status-text { font-size: 11px; color: var(--text-tertiary); }

.sidebar-back-link {
  font-size: 12px;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color var(--t);
}
.sidebar-back-link:hover { color: var(--text-secondary); }

/* ─── MAIN CONTENT ─── */
.app-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── APP HEADER ─── */
.app-header {
  height: var(--header-h);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mobile-sidebar-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background var(--t);
}
.mobile-sidebar-toggle:hover { background: var(--bg-page); }

.header-page-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: 0;
}
.header-page-subtitle {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0;
}

.header-right {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}

.header-icon-btn {
  position: relative;
  width: 34px; height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-white);
  cursor: pointer;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--t), color var(--t);
}
.header-icon-btn:hover { border-color: var(--border-strong); color: var(--text-primary); }

.notif-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #EF4444;
  border: 1.5px solid white;
}

.header-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4F46E5, #7C3AED);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  user-select: none;
}

/* ─── APP CONTENT ─── */
.app-content {
  flex: 1;
  padding: 28px;
  max-width: 1280px;
  width: 100%;
}

/* ═══════════════════════════════════════════
   COMMON COMPONENTS
═══════════════════════════════════════════ */

/* ─── PAGE SECTION HEADER ─── */
.page-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.page-section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
}
.page-section-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 4px 0 0;
}

/* ─── CARDS ─── */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: box-shadow var(--t), transform var(--t);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-p { padding: 24px; }

.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  transition: box-shadow var(--t), transform var(--t);
}
.stat-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }

.stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.stat-value {
  font-size: 30px;
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.stat-change {
  font-size: 11.5px;
  font-weight: 600;
  display: flex; align-items: center; gap: 3px;
}
.stat-change.up { color: #16A34A; }
.stat-change.down { color: #DC2626; }
.stat-change.neutral { color: var(--text-tertiary); }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background-color var(--t), border-color var(--t), transform var(--t), box-shadow var(--t);
  white-space: nowrap;
  border-radius: var(--radius);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.btn-sm  { font-size: 12.5px; padding: 6px 12px; }
.btn-md  { font-size: 13.5px; padding: 9px 16px; }
.btn-lg  { font-size: 14px;   padding: 11px 22px; }

.btn-primary {
  background: var(--indigo);
  color: white;
  box-shadow: 0 1px 3px rgba(79,70,229,0.25);
}
.btn-primary:hover:not(:disabled) {
  background: var(--indigo-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79,70,229,0.28);
}

.btn-secondary {
  background: var(--bg-white);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-page);
  border-color: var(--border-strong);
}

.btn-danger {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid rgba(220,38,38,0.15);
}
.btn-danger:hover:not(:disabled) {
  background: #FEE2E2;
  border-color: rgba(220,38,38,0.25);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}
.btn-ghost:hover:not(:disabled) { color: var(--text-primary); background: var(--bg-page); }

.btn-icon {
  width: 34px; height: 34px;
  padding: 0;
  background: var(--bg-white);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 9px;
}
.btn-icon:hover:not(:disabled) {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* ─── BADGES / STATUS PILLS ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 100px;
}
.badge-green  { background: #F0FDF4; color: #16A34A; border: 1px solid rgba(22,163,74,0.15); }
.badge-red    { background: #FEF2F2; color: #DC2626; border: 1px solid rgba(220,38,38,0.15); }
.badge-indigo { background: var(--indigo-soft); color: var(--indigo); border: 1px solid rgba(79,70,229,0.15); }
.badge-amber  { background: #FFFBEB; color: #B45309; border: 1px solid rgba(180,83,9,0.15); }
.badge-gray   { background: #F1F5F9; color: #64748B; border: 1px solid rgba(100,116,139,0.15); }
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ─── TOGGLE SWITCH ─── */
.toggle-wrap { display: flex; align-items: center; gap: 8px; }
.toggle {
  position: relative;
  width: 40px; height: 22px;
  background: var(--border-strong);
  border-radius: 100px;
  cursor: pointer;
  border: none;
  transition: background-color var(--t);
  flex-shrink: 0;
}
.toggle.on { background: var(--indigo); }
.toggle-knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform var(--t);
}
.toggle.on .toggle-knob { transform: translateX(18px); }
.toggle-label { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

/* ─── FORM ELEMENTS ─── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 12.5px; font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.form-sublabel { font-size: 11.5px; color: var(--text-tertiary); margin-top: 1px; }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--t), box-shadow var(--t);
  -webkit-appearance: none;
}
.form-input::placeholder { color: var(--text-tertiary); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.55; }
.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394A3B8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
.form-input.error, .form-select.error { border-color: #EF4444; }
.form-error-msg { font-size: 11.5px; color: #DC2626; margin-top: 2px; }

/* ─── TABLE ─── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--bg-page);
}
.data-table td {
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr {
  transition: background-color var(--t);
}
.data-table tbody tr:hover { background: #FAFBFC; }

/* ─── SEARCH / FILTER BAR ─── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}
.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--t), box-shadow var(--t);
}
.search-input::placeholder { color: var(--text-tertiary); }
.search-input:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }

/* ─── EMPTY STATE ─── */
.empty-state {
  padding: 64px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.empty-icon {
  width: 48px; height: 48px;
  border-radius: 14px;
  background: var(--indigo-soft);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
  color: var(--indigo);
}
.empty-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.empty-desc { font-size: 13px; color: var(--text-secondary); max-width: 320px; line-height: 1.6; }

/* ─── LOADING SKELETON ─── */
.skeleton {
  background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── TOAST ─── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  background: var(--text-primary);
  color: white;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transition: opacity 250ms ease, transform 250ms ease;
  pointer-events: all;
  max-width: 340px;
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast-success { background: #0F172A; }
.toast-error   { background: #DC2626; }
.toast-info    { background: var(--indigo); }
.toast-icon    { font-size: 12px; opacity: 0.8; }

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.4);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 200ms ease;
}
.modal-overlay.visible { opacity: 1; pointer-events: all; }
.modal-box {
  background: var(--bg-white);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 400px;
  width: calc(100% - 40px);
  box-shadow: var(--shadow-lg);
  transform: scale(0.97) translateY(8px);
  transition: transform 200ms ease;
  text-align: center;
}
.modal-overlay.visible .modal-box { transform: scale(1) translateY(0); }
.modal-icon {
  width: 48px; height: 48px;
  background: #FEF2F2;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.modal-title { font-size: 17px; font-weight: 700; color: var(--text-primary); margin: 0 0 8px; }
.modal-body  { font-size: 13.5px; color: var(--text-secondary); line-height: 1.6; margin: 0 0 24px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.btn-modal-cancel  { padding: 9px 20px; font-size: 13.5px; font-weight: 600; background: var(--bg-page); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; font-family: inherit; color: var(--text-secondary); transition: background var(--t); }
.btn-modal-cancel:hover { background: #E2E8F0; }
.btn-modal-confirm { padding: 9px 20px; font-size: 13.5px; font-weight: 600; background: #DC2626; border: none; border-radius: var(--radius); cursor: pointer; font-family: inherit; color: white; transition: background var(--t); }
.btn-modal-confirm:hover { background: #B91C1C; }

/* ─── PAGINATION ─── */
.pagination {
  display: flex; align-items: center; gap: 4px;
  padding: 16px 16px 0;
}
.page-btn {
  min-width: 32px; height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 12.5px; font-weight: 500;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t), border-color var(--t), color var(--t);
}
.page-btn:hover { background: var(--bg-page); color: var(--text-primary); }
.page-btn.active { background: var(--indigo-soft); color: var(--indigo); border-color: rgba(79,70,229,0.2); font-weight: 700; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── TABS (inline) ─── */
.tab-group {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.tab-btn {
  padding: 10px 16px;
  font-size: 13.5px; font-weight: 500;
  color: var(--text-secondary);
  background: transparent; border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer; font-family: inherit;
  transition: color var(--t), border-color var(--t);
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--indigo); border-bottom-color: var(--indigo); font-weight: 600; }

/* ═══════════════════════════════════════════
   AUTOMATION CARD (list view)
═══════════════════════════════════════════ */
.automation-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  transition: background-color var(--t);
}
.automation-row:last-child { border-bottom: none; }
.automation-row:hover { background: #FAFBFC; }

.automation-row-left { display: flex; align-items: center; gap: 14px; min-width: 0; }

.auto-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.auto-name {
  font-size: 14px; font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.auto-meta {
  display: flex; align-items: center; gap: 10px;
  margin-top: 3px;
}
.auto-meta-item {
  font-size: 11.5px;
  color: var(--text-tertiary);
  display: flex; align-items: center; gap: 4px;
}

.automation-row-right { display: flex; align-items: center; gap: 10px; }

/* ─── FLOW STEP (builder) ─── */
.flow-connector-line {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin-left: 20px;
}

/* ═══════════════════════════════════════════
   INTEGRATION CARD (grid view)
═══════════════════════════════════════════ */
.integration-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow var(--t), transform var(--t);
}
.integration-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.integration-card.connected { border-color: rgba(22,163,74,0.25); }

.integration-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.integration-logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800;
  color: white;
  flex-shrink: 0;
}
.integration-name {
  font-size: 14px; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.integration-category {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: capitalize;
}
.integration-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}
.integration-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.integration-automations-count {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════
   PRICING ADMIN CARD
═══════════════════════════════════════════ */
.pricing-admin-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  transition: box-shadow var(--t);
}
.pricing-admin-card.featured {
  border-color: var(--indigo);
  box-shadow: 0 0 0 1px rgba(79,70,229,0.1);
}
.pricing-admin-card:hover { box-shadow: var(--shadow-md); }

.price-editable {
  font-size: 36px;
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  background: transparent;
  border: none;
  border-bottom: 2px dashed var(--border);
  width: 100px;
  text-align: left;
  transition: border-color var(--t);
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.price-editable:focus { outline: none; border-color: var(--indigo); }

.feature-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.feature-toggle-row:last-child { border-bottom: none; }
.feature-text { font-size: 13px; color: var(--text-secondary); }
.feature-text.off { opacity: 0.4; text-decoration: line-through; }

/* ═══════════════════════════════════════════
   ANALYTICS / CHARTS
═══════════════════════════════════════════ */
.chart-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
}
.chart-card-title {
  font-size: 14px; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.chart-card-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}
.chart-container { position: relative; }

/* ═══════════════════════════════════════════
   STEP WIZARD (automation builder)
═══════════════════════════════════════════ */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
}
.step-item {
  display: flex; align-items: center; gap: 10px;
  flex: 1;
}
.step-item:last-child { flex: none; }
.step-num {
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-page);
  border: 2px solid var(--border);
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: all var(--t);
}
.step-item.active   .step-num { background: var(--indigo); border-color: var(--indigo); color: white; }
.step-item.complete .step-num { background: #16A34A; border-color: #16A34A; color: white; }

.step-label {
  font-size: 12.5px; font-weight: 600;
  color: var(--text-tertiary);
  transition: color var(--t);
  white-space: nowrap;
}
.step-item.active   .step-label { color: var(--text-primary); }
.step-item.complete .step-label { color: #16A34A; }

.step-connector {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 8px;
}
.step-item.complete + .step-item .step-connector,
.step-connector.done { background: #16A34A; }

/* App select cards (trigger/action pickers) */
.app-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.app-select-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  background: var(--bg-white);
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
  text-align: center;
}
.app-select-card:hover { border-color: rgba(79,70,229,0.25); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.app-select-card.selected { border-color: var(--indigo); background: var(--indigo-soft); box-shadow: 0 0 0 1px rgba(79,70,229,0.1); }
.app-select-logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800;
  color: white;
}
.app-select-name { font-size: 12px; font-weight: 600; color: var(--text-primary); }

/* ═══════════════════════════════════════════
   SETTINGS PAGE
═══════════════════════════════════════════ */
.settings-section {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}
.settings-section-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-page);
}
.settings-section-title {
  font-size: 14px; font-weight: 700; color: var(--text-primary);
}
.settings-section-desc {
  font-size: 12px; color: var(--text-tertiary); margin-top: 2px;
}
.settings-row {
  padding: 16px 22px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-left { min-width: 0; }
.settings-row-title { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.settings-row-desc  { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }

/* API key box */
.api-key-box {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.api-key-value {
  flex: 1;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12.5px;
  color: var(--text-primary);
  word-break: break-all;
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .app-sidebar {
    transform: translateX(-100%);
    z-index: 300;
  }
  .app-sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .app-main { margin-left: 0; }
  .mobile-sidebar-toggle { display: flex; }
  .app-content { padding: 16px; }
  .stepper .step-label { display: none; }
  .app-select-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
  .filter-bar { flex-direction: column; align-items: stretch; }
  .search-input-wrap { max-width: 100%; }
}
