:root {
  --navy-900: #ffffff;
  --navy-800: #f9fafb;
  --navy-700: #f3f4f6;
  --navy-600: #e5e7eb;
  --navy-500: #d1d5db;
  --teal-500: #7c3aed;
  --teal-400: #8b5cf6;
  --teal-300: #6d28d9;
  --teal-glow: rgba(124,58,237,0.08);
  --text: #0f0f0f;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --card-shadow: 0 1px 4px rgba(0,0,0,.05), 0 2px 12px rgba(0,0,0,.04);
  --card-shadow-hover: 0 4px 16px rgba(0,0,0,.1);
}

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

html, body {
  margin: 0; padding: 0;
  background: #f7f6fe;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--teal-500); text-decoration: none; }
a:hover { color: var(--teal-300); }

/* ── NAV ─────────────────────────────────────── */
.navbar {
  background: rgba(255,255,255,0.98);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 9999;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.navbar-inner {
  max-width: 1160px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; flex-shrink: 0;
}
.brand-text {
  font-size: 16px; font-weight: 800; letter-spacing: 0.04em; color: #0f0f0f;
}
.brand-text .brand-pipe { color: #7c3aed; }
.brand img { height: 30px; width: 30px; object-fit: contain; }

/* desktop nav links */
.navlinks {
  display: flex; align-items: center; gap: 2px;
  margin-left: 32px; flex: 1;
}
.navlinks a {
  padding: 7px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: #4b5563;
  text-decoration: none; transition: background 0.15s, color 0.15s;
  white-space: nowrap; position: relative;
}
.navlinks a:hover { background: #f5f3ff; color: #7c3aed; }
.navlinks a.active {
  background: #f5f3ff; color: #7c3aed; font-weight: 600;
}
.navlinks a.active::after {
  content: ''; position: absolute; bottom: -1px; left: 12px; right: 12px;
  height: 2px; background: #7c3aed; border-radius: 2px;
}
.navlinks .pill {
  padding: 4px 10px; border-radius: 999px;
  background: #f5f3ff; color: #7c3aed;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  border: 1px solid rgba(124,58,237,.2);
}

/* nav right */
.nav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.btn-ghost-nav {
  padding: 8px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: #4b5563;
  text-decoration: none; transition: background 0.15s;
  border: none; background: none; cursor: pointer; font-family: inherit;
}
.btn-ghost-nav:hover { background: #f3f4f6; color: #0f0f0f; }
.btn-cta-nav {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 9px;
  font-size: 14px; font-weight: 700; color: #fff;
  background: #7c3aed; text-decoration: none;
  border: 1px solid transparent; transition: background 0.15s;
  white-space: nowrap;
}
.btn-cta-nav:hover { background: #6d28d9; color: #fff; }

/* hamburger */
.nav-hamburger {
  display: none; margin-left: auto;
  background: none; border: none; cursor: pointer;
  padding: 8px; border-radius: 8px; color: #374151;
  transition: background 0.15s;
}
.nav-hamburger:hover { background: #f3f4f6; }

/* mobile drawer */
.nav-mobile {
  display: none; position: fixed;
  top: 60px; left: 0; right: 0; bottom: 0;
  background: #fff; z-index: 9998;
  overflow-y: auto; border-top: 1px solid var(--border);
  padding: 16px 20px 40px;
  transform: translateY(-8px); opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
  pointer-events: none;
}
.nav-mobile.open {
  display: block; transform: translateY(0);
  opacity: 1; pointer-events: auto;
}
.mob-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: #9ca3af; padding: 16px 4px 8px;
}
.mob-nav-link {
  display: block; padding: 12px 8px; border-radius: 10px;
  font-size: 15px; font-weight: 500; color: #374151;
  text-decoration: none; transition: background 0.15s;
}
.mob-nav-link:hover { background: #f5f3ff; color: #7c3aed; }
.mob-divider { height: 1px; background: var(--border); margin: 8px 0; }
.mob-cta-row { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.mob-btn-primary {
  display: flex; justify-content: center; align-items: center;
  padding: 14px; border-radius: 10px; font-size: 16px; font-weight: 700;
  color: #fff; background: #7c3aed; text-decoration: none;
}
.mob-btn-secondary {
  display: flex; justify-content: center; align-items: center;
  padding: 14px; border-radius: 10px; font-size: 16px; font-weight: 600;
  color: #374151; text-decoration: none; border: 1px solid var(--border);
}

/* ── LAYOUT ──────────────────────────────────── */
.container {
  max-width: 1180px; margin: 0 auto; padding: 32px 20px;
}
.container-narrow { max-width: 480px; margin: 60px auto; padding: 28px 20px; }

h1, h2, h3 { color: var(--text); margin-top: 0; letter-spacing: -0.02em; }
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 20px; }
.muted { color: var(--text-muted); }

/* ── BUTTONS ─────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 9px;
  border: 1px solid transparent;
  font-weight: 600; cursor: pointer; font-size: 14px;
  text-decoration: none; transition: all 0.15s ease;
  background: transparent; color: var(--text); font-family: inherit;
  white-space: nowrap;
}
.btn-primary {
  background: #7c3aed; color: #fff; border-color: #7c3aed;
  box-shadow: 0 1px 3px rgba(124,58,237,.3);
}
.btn-primary:hover { background: #6d28d9; border-color: #6d28d9; color: #fff; box-shadow: 0 3px 10px rgba(124,58,237,.35); }
.btn-secondary {
  background: #fff; border-color: var(--border); color: #374151;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.btn-secondary:hover { background: #f9f8ff; border-color: #c4b5fd; color: #7c3aed; }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: #f3f4f6; }
.btn-danger { background: transparent; color: var(--danger); border-color: #fca5a5; }
.btn-danger:hover { background: #fef2f2; }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ── CARD ────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--card-shadow);
}
.card + .card { margin-top: 16px; }

/* ── FORM ────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 13px;
  margin-bottom: 6px; color: var(--text-muted); font-weight: 600;
}
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"],
.form-group input[type="file"] {
  width: 100%; padding: 11px 13px; border-radius: 9px;
  border: 1px solid var(--border);
  background: #fff; color: var(--text);
  font-size: 14px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus {
  outline: none; border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}

/* ── FLASH ───────────────────────────────────── */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; }
.flash-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.flash-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.flash-info { background: #f5f3ff; color: #7c3aed; border: 1px solid rgba(124,58,237,0.2); }
.flash-warning { background: #fffbeb; color: var(--warning); border: 1px solid #fde68a; }

/* ── STATS ───────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 28px;
}
.stat {
  background: #fff; border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 22px;
  box-shadow: var(--card-shadow);
  transition: box-shadow .2s;
}
.stat:hover { box-shadow: var(--card-shadow-hover); }
.stat-label {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600;
}
.stat-value { font-size: 32px; font-weight: 800; margin-top: 6px; color: var(--text); letter-spacing: -0.04em; }
.stat-accent {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border-color: rgba(124,58,237,.15);
}
.stat-accent .stat-value { color: #7c3aed; }
.stat-accent .stat-label { color: #8b5cf6; }

/* ── TOOLBAR ─────────────────────────────────── */
.toolbar {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 20px;
  gap: 12px; flex-wrap: wrap;
}
.toolbar .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── FILTER BAR ──────────────────────────────── */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0 14px; }
.filter-bar .f-input {
  background: #fff; color: var(--text); border: 1px solid var(--border);
  border-radius: 9px; padding: 9px 12px; font-size: 14px; font-family: inherit;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.filter-bar .f-input:focus { outline: none; border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,.1); }
.filter-bar #f-search { min-width: 260px; flex: 1 1 260px; }

/* ── DOCS TABLE ──────────────────────────────── */
table.docs {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: #fff; border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
  box-shadow: var(--card-shadow);
}
table.docs th, table.docs td {
  padding: 13px 14px; text-align: left;
  border-bottom: 1px solid var(--border); font-size: 14px;
}
table.docs th {
  background: #fafaf8; color: var(--text-muted);
  font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.7px;
}
table.docs tr:last-child td { border-bottom: none; }
table.docs tbody tr:hover td { background: #faf8ff; }
.docs th.sortable { cursor: pointer; user-select: none; }
.docs th.sortable:hover { color: #7c3aed; }
.docs th .sort-ind { color: #7c3aed; font-size: 11px; }

/* ── BADGES ──────────────────────────────────── */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-processed { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.badge-pending { background: #fffbeb; color: var(--warning); border: 1px solid #fde68a; }
.badge-failed { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.badge-type { background: #f5f3ff; color: #7c3aed; border: 1px solid rgba(124,58,237,.15); }

/* ── EMPTY ───────────────────────────────────── */
.empty {
  text-align: center; padding: 60px 20px;
  background: #fafaf8;
  border: 1px dashed var(--border);
  border-radius: 14px; color: var(--text-muted);
}

/* ── FIELD GRID ──────────────────────────────── */
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 28px; }
.field-grid .label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; font-weight: 600; }
.field-grid .value { font-size: 15px; color: var(--text); word-break: break-word; }

/* ── DROPZONE ────────────────────────────────── */
.dropzone {
  border: 2px dashed #c4b5fd; border-radius: 14px;
  padding: 50px 20px; text-align: center;
  background: #faf8ff; transition: all 0.2s ease;
}
.dropzone:hover { border-color: #7c3aed; background: #f5f3ff; }
.dropzone p { color: var(--text-muted); margin: 8px 0 0; }

/* ── LINE ITEMS ──────────────────────────────── */
.line-items { width: 100%; border-collapse: collapse; margin-top: 12px; }
.line-items th, .line-items td {
  padding: 10px 12px; text-align: left;
  border-bottom: 1px solid var(--border); font-size: 14px;
}
.line-items th { color: var(--text-muted); font-size: 12px; text-transform: uppercase; font-weight: 600; }
.line-items tr.row-short { background: #fef2f2; }
.line-items tr.row-short td { color: var(--danger); }

/* ── SECTION TITLE ───────────────────────────── */
.section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text-muted); margin: 28px 0 14px; font-weight: 700;
}

/* ── PRICING ─────────────────────────────────── */
.pricing {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px; margin-top: 30px;
}
.pricing.pricing-4 { grid-template-columns: repeat(4, 1fr); }
.pricing.pricing-4 .plan { padding: 24px 22px; }
.pricing.pricing-4 .price { font-size: 30px; }
.plan {
  background: #fff; border: 1px solid var(--border);
  border-radius: 14px; padding: 28px;
  display: flex; flex-direction: column;
  box-shadow: var(--card-shadow);
}
.plan.featured {
  border-color: #7c3aed;
  box-shadow: 0 0 0 4px rgba(124,58,237,0.1);
}
.plan h3 { font-size: 20px; margin-bottom: 4px; }
.plan .price { font-size: 36px; font-weight: 800; color: #7c3aed; margin: 14px 0; letter-spacing: -0.03em; }
.plan .price small { font-size: 14px; color: var(--text-muted); font-weight: 400; }
.plan ul { list-style: none; padding: 0; margin: 0 0 22px; }
.plan li { padding: 7px 0; color: var(--text-muted); font-size: 14px; border-bottom: 1px solid var(--border); }
.plan li:last-child { border-bottom: none; }
.plan li::before { content: "✓"; color: #7c3aed; margin-right: 8px; font-weight: 700; }

/* ── CHARTS ──────────────────────────────────── */
.chart-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 18px; }
.chart-grid .chart-wide { grid-column: span 2; }
.chart-card h2 { font-size: 16px; }

/* ── ONBOARDING ──────────────────────────────── */
.onboard {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #faf8ff 100%);
  border: 1.5px solid rgba(124,58,237,.15);
  border-radius: 18px; padding: 36px; margin-top: 8px;
  box-shadow: 0 4px 20px rgba(124,58,237,.06);
}
.onboard-header {
  display: flex; justify-content: space-between;
  align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px;
}
.onboard-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.onboard-step {
  display: block; background: #fff;
  border: 1.5px solid rgba(124,58,237,.1); border-radius: 14px; padding: 22px;
  color: var(--text); transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  text-decoration: none; box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.onboard-step:hover { border-color: #7c3aed; transform: translateY(-3px); color: var(--text); box-shadow: 0 8px 24px rgba(124,58,237,.15); }
.onboard-step-static { cursor: default; }
.onboard-step-static:hover { border-color: rgba(124,58,237,.1); transform: none; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.onboard-num {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
  color: #fff;
  display: grid; place-items: center; font-weight: 800; margin-bottom: 14px;
  font-size: 14px; box-shadow: 0 2px 8px rgba(124,58,237,.35);
}
.onboard-step h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.onboard-step p { margin: 0 0 12px; color: var(--text-muted); font-size: 13px; line-height: 1.55; }
.onboard-link { font-size: 13px; color: #7c3aed; font-weight: 700; }
.onboard-link.muted { color: var(--text-muted); font-weight: 500; }
.onboard-tips { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.onboard-tip {
  background: rgba(255,255,255,.8); border: 1px solid rgba(124,58,237,.12);
  border-radius: 12px; padding: 14px 16px; font-size: 13px; color: var(--text-muted);
  backdrop-filter: blur(4px);
}
.onboard-tip-link { color: #7c3aed; display: block; text-decoration: none; font-weight: 500; }
.onboard-tip-link:hover { color: #6d28d9; border-color: #7c3aed; }

/* ── STANDALONE f-input ──────────────────────── */
.f-input {
  width: 100%; padding: 10px 12px; border-radius: 9px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  font-size: 14px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  appearance: none; -webkit-appearance: none;
}
.f-input:focus { outline: none; border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124,58,237,0.12); }
.f-input[readonly] { background: #f9fafb; color: var(--text-muted); cursor: default; }
.f-input option { background: #fff; }
select.f-input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* ── NAV USER DROPDOWN ───────────────────────── */
.nav-user-dropdown { position: relative; }
.nav-user-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 6px; border-radius: 10px;
  border: 1px solid var(--border); background: #fff;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
  text-decoration: none; font-family: inherit;
}
.nav-user-btn:hover { border-color: #c4b5fd; background: #f9f8ff; }
.nav-user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff; flex-shrink: 0;
  overflow: hidden;
}
.nav-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.nav-user-info { text-align: left; line-height: 1.25; }
.nav-user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.nav-user-company { font-size: 11px; color: var(--text-muted); }
.nav-user-chevron { color: var(--text-muted); transition: transform 0.2s; flex-shrink: 0; }
.nav-user-dropdown.open .nav-user-chevron { transform: rotate(180deg); }
.nav-user-menu {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 210px; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.12);
  padding: 6px; z-index: 9999;
}
.nav-user-dropdown.open .nav-user-menu { display: block; }
.nav-user-menu-header { padding: 8px 10px 10px; }
.nav-user-menu-item {
  display: block; padding: 9px 10px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: #374151;
  text-decoration: none; transition: background 0.12s, color 0.12s;
  cursor: pointer; border: none; background: none; width: 100%;
  text-align: left; font-family: inherit;
}
.nav-user-menu-item:hover { background: #f5f3ff; color: #7c3aed; }
.nav-user-menu-signout { color: var(--danger); }
.nav-user-menu-signout:hover { background: #fef2f2; color: var(--danger); }
.nav-user-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── SETTINGS PAGE ───────────────────────────── */
.settings-layout {
  display: grid; grid-template-columns: 200px 1fr;
  gap: 24px; align-items: start;
}
.settings-sidebar { position: sticky; top: 76px; }
.settings-nav {
  background: #fff; border: 1px solid var(--border);
  border-radius: 14px; padding: 8px;
  box-shadow: var(--card-shadow);
}
.settings-nav-link {
  display: block; padding: 9px 12px; border-radius: 9px;
  font-size: 14px; font-weight: 500; color: #4b5563;
  text-decoration: none; transition: background 0.15s, color 0.15s;
}
.settings-nav-link:hover { background: #f5f3ff; color: #7c3aed; }
.settings-nav-link.active { background: #f5f3ff; color: #7c3aed; font-weight: 600; }
.settings-nav-danger { color: var(--danger) !important; }
.settings-nav-danger:hover { background: #fef2f2 !important; }
.settings-section-header { margin-bottom: 20px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* photo upload */
.photo-upload-row { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.photo-preview {
  width: 72px; height: 72px; border-radius: 50%;
  overflow: hidden; border: 2px solid var(--border);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: #f5f3ff;
}
.logo-preview { border-radius: 12px; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-initials { font-size: 26px; font-weight: 800; color: #7c3aed; line-height: 1; }

/* radio group */
.radio-group { display: flex; gap: 18px; padding-top: 6px; }
.radio-opt { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; color: var(--text); }
.radio-opt input { accent-color: #7c3aed; width: 15px; height: 15px; cursor: pointer; }

/* notification toggles */
.notif-list { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.notif-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--border); gap: 12px;
}
.notif-row:last-child { border-bottom: none; }
.notif-label { font-size: 14px; font-weight: 600; color: var(--text); }
.notif-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: #d1d5db;
  border-radius: 999px; cursor: pointer; transition: background 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute; width: 18px; height: 18px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: #7c3aed; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* connection rows (account settings integrations) */
.conn-list { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.conn-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--border); gap: 16px;
  background: #fff;
}
.conn-row:last-child { border-bottom: none; }
.conn-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.conn-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff; letter-spacing: 0;
}
.conn-name { font-size: 14px; font-weight: 600; color: var(--text); }
.conn-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.conn-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.conn-badge {
  font-size: 11px; font-weight: 600; padding: 3px 9px;
  border-radius: 999px; white-space: nowrap;
}
.conn-badge-off  { background: #f3f4f6; color: #9ca3af; }
.conn-badge-on   { background: #dcfce7; color: #16a34a; }
.conn-badge-soon { background: #ede9fe; color: #7c3aed; }
.conn-badge-ent  { background: #fef3c7; color: #92400e; }
@media (max-width: 640px) {
  .conn-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .conn-right { width: 100%; justify-content: flex-end; }
}

/* danger actions */
.danger-actions { border: 1px solid #fecaca; border-radius: 12px; overflow: hidden; }
.danger-action-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; gap: 12px; background: #fff;
}
.danger-action-title { font-size: 14px; font-weight: 600; color: var(--text); }
.danger-action-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; max-width: 480px; }

@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-sidebar { position: static; }
}
@media (max-width: 600px) {
  .settings-grid { grid-template-columns: 1fr; }
  .settings-grid [style*="span 2"] { grid-column: span 1 !important; }
  .nav-user-info { display: none; }
  .nav-user-chevron { display: none; }
}

/* ── INTEGRATIONS ────────────────────────────── */
.int-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 8px;
}
.int-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 14px; padding: 20px;
  box-shadow: var(--card-shadow);
  display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow 0.18s, border-color 0.18s;
}
.int-card:hover { box-shadow: var(--card-shadow-hover); border-color: #c4b5fd; }
.int-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.int-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; letter-spacing: 0.02em;
  flex-shrink: 0; line-height: 1;
}
.int-badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px;
  white-space: nowrap;
}
.int-badge-available { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.int-badge-soon { background: #f3f4f6; color: #6b7280; border: 1px solid #e5e7eb; }
.int-badge-enterprise { background: #f5f3ff; color: #7c3aed; border: 1px solid rgba(124,58,237,.2); }
.int-name { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.3; }
.int-desc { font-size: 13px; color: var(--text-muted); line-height: 1.55; flex: 1; }
.int-actions { margin-top: auto; padding-top: 4px; }

@media (max-width: 900px) { .int-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .int-grid { grid-template-columns: 1fr; } }

/* ── PREMIUM CARD HEADER ─────────────────────── */
.card-hd {
  display: flex; align-items: center; gap: 14px;
  margin: -24px -24px 22px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  border-radius: 14px 14px 0 0;
  background: linear-gradient(135deg, #fafafa 0%, #f9f8ff 100%);
}
.card-hd-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #f0ebff;
}
.card-hd-body { flex: 1; min-width: 0; }
.card-hd-title { font-size: 15px; font-weight: 700; color: var(--text); margin: 0; line-height: 1.3; }
.card-hd-sub   { font-size: 12px; color: var(--text-muted); margin: 2px 0 0; }
.card-hd-right { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.card-danger .card-hd { background: linear-gradient(135deg, #fef2f2, #fff5f5); border-color: #fecaca; }
.card-danger .card-hd-icon { background: #fee2e2; }
.card-danger .card-hd-title { color: var(--danger); }
.card-danger { border-color: #fecaca !important; }

/* ── MEMBER TABLE ────────────────────────────── */
.member-table { width: 100%; border-collapse: collapse; }
.member-table th {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.7px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  background: #fafafa; text-align: left;
}
.member-table td { padding: 12px 14px; border-bottom: 1px solid #f3f4f6; vertical-align: middle; font-size: 14px; }
.member-table tbody tr:last-child td { border-bottom: none; }
.member-table tbody tr:hover td { background: #faf8ff; }
.member-cell { display: flex; align-items: center; gap: 10px; }
.member-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.member-avatar-pending { background: linear-gradient(135deg, #d1d5db, #9ca3af); }
.member-email { font-size: 14px; font-weight: 500; color: var(--text); }
.member-invite { font-size: 11px; color: var(--text-muted); margin-top: 2px; word-break: break-all; max-width: 320px; }

/* ── INVITE ROW ──────────────────────────────── */
.invite-row {
  display: flex; gap: 10px; align-items: center; margin-top: 18px;
  padding: 14px 16px; background: #f9f8ff;
  border: 1px solid rgba(124,58,237,.12); border-radius: 12px;
}
.invite-row .f-input { flex: 1; }
.seat-info { font-size: 13px; color: var(--text-muted); margin-top: 8px; }

/* ── WEBHOOK FORM ────────────────────────────── */
.webhook-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.webhook-form .f-input { flex: 1; min-width: 280px; }
.webhook-toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; }

/* ── RETENTION FORM ──────────────────────────── */
.retention-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.retention-row label { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; }
.retention-row .f-input { min-width: 200px; }

/* ── DELIVERY TABLE ──────────────────────────── */
.delivery-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.delivery-table th {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.6px;
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  background: #fafafa; text-align: left;
}
.delivery-table td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; font-size: 13px; }
.delivery-table tbody tr:last-child td { border-bottom: none; }

/* ── MODAL ───────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); backdrop-filter: blur(3px);
  align-items: center; justify-content: center; z-index: 1000;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: #fff; border-radius: 16px; padding: 28px; max-width: 480px;
  width: 92%; box-shadow: 0 20px 60px rgba(0,0,0,.2);
  border: 1px solid var(--border); animation: modal-in .18s ease;
}
@keyframes modal-in {
  from { transform: translateY(12px) scale(0.97); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.modal-title { font-size: 18px; font-weight: 800; margin: 0 0 8px; letter-spacing: -0.02em; }
.modal-desc  { font-size: 14px; color: var(--text-muted); margin: 0 0 18px; line-height: 1.55; }

/* ── SEATS PROGRESS ──────────────────────────── */
.seats-bar { height: 4px; background: #f3f4f6; border-radius: 9px; overflow: hidden; margin-top: 10px; }
.seats-bar-fill { height: 100%; border-radius: 9px; background: #7c3aed; transition: width .5s ease; }

/* ── FOOTER ──────────────────────────────────── */
.app-footer {
  text-align: center; padding: 28px 20px;
  color: var(--text-muted); font-size: 13px;
  border-top: 1px solid var(--border); margin-top: 48px;
  background: #fff;
}
.app-footer a { color: var(--text-muted); }
.app-footer a:hover { color: var(--text); }

/* ── PAGE HEADER ─────────────────────────────── */
.page-header {
  margin-bottom: 24px;
}
.page-header h1 { margin-bottom: 3px; }

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 1100px) {
  .pricing.pricing-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .chart-grid { grid-template-columns: 1fr; }
  .chart-grid .chart-wide { grid-column: span 1; }
}
@media (max-width: 768px) {
  .navlinks, .nav-right { display: none; }
  .nav-hamburger { display: flex; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .container { padding: 24px 16px; }
  .container-narrow { margin: 32px auto; padding: 20px 16px; }
}
@media (max-width: 600px) {
  .stats, .features, .pricing, .pricing.pricing-4,
  .field-grid, .onboard-steps, .onboard-tips { grid-template-columns: 1fr; }
  h1 { font-size: 22px; }
  .toolbar { flex-direction: column; align-items: flex-start; }
  .toolbar .actions { width: 100%; }
  table.docs { font-size: 13px; }
}
