/* ==========================================================================
   SmallWorld Settings Prototype — Shared Styles
   Pulled from frontend/user-settings.html and extended for the rest of the
   settings surface. Aligned with frontend/docs/style-guide.md.
   ========================================================================== */

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

body {
  font-family: 'Montserrat', sans-serif;
  background: #FBFCFE;
  color: #222;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ========== APP HEADER ========== */
.app-header { width: 100%; background: #fff; z-index: 999; padding: 1rem 0; }
.app-header-inner { display: flex; align-items: center; max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.app-header-logo { display: flex; align-items: center; margin-right: 1.5rem; flex-shrink: 0; text-decoration: none; }
.app-header-nav { display: flex; align-items: center; gap: 0; }
.app-header-nav-item-wrap { position: relative; margin-right: 1.5rem; }
.app-header-nav-item { display: inline-flex; align-items: center; gap: 6px; font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: 500; color: #222; cursor: pointer; white-space: nowrap; padding: 4px 0; text-decoration: none; transition: color 0.15s; }
.app-header-nav-item:hover { color: #3f84e5; }
.app-header-nav-arrow { display: inline-block; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid #999; margin-left: 2px; transition: border-top-color 0.15s; }
.app-header-nav-item:hover .app-header-nav-arrow { border-top-color: #3f84e5; }
.app-header-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #e53e3e; color: #fff; font-size: 11px; font-weight: 700; font-family: 'Montserrat', sans-serif; }
.app-header-spacer { flex: 1; }
.app-header-actions { display: flex; align-items: center; gap: 1.75rem; flex-shrink: 0; }
.app-header-ai-btn { font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: 700; padding: 0.5rem 1rem; color: #fff; background: #3f84e5; border: none; border-radius: 4px; cursor: pointer; transition: background 0.15s; }
.app-header-ai-btn:hover { background: #2d6fd6; }
.app-header-search { display: flex; align-items: center; cursor: pointer; color: #555; transition: color 0.15s; }
.app-header-search:hover { color: #3f84e5; }
.app-header-search svg { width: 22px; height: 22px; }
.app-header-notifications { display: flex; align-items: center; cursor: pointer; position: relative; }
.app-header-notifications svg { width: 22px; height: 22px; color: #555; transition: color 0.15s; }
.app-header-notifications:hover svg { color: #3f84e5; }
.app-header-notif-badge { position: absolute; top: -6px; right: -8px; display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #e53e3e; color: #fff; font-size: 10px; font-weight: 700; font-family: 'Montserrat', sans-serif; }

/* ========== APP FOOTER ========== */
.app-footer { margin-top: 0; border-top: 1px solid #e5e7eb; padding: 1.5rem 0; background: #f9fafb; }
.app-footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 1rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.app-footer-links { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.5rem; }
.app-footer-links a { font-family: 'Montserrat', sans-serif; font-size: 13px; color: #77797b; text-decoration: none; transition: color 0.15s; }
.app-footer-links a:hover { color: #3f84e5; }
.app-footer-dev { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1rem; width: 100%; border-top: 1px dashed #d1d5db; padding-top: 0.75rem; margin-top: 0.25rem; }
.app-footer-dev li { font-family: 'Montserrat', sans-serif; font-size: 11px; color: #9ca3af; }
.app-footer-dev strong { color: #6b7280; }

/* ========== SETTINGS LAYOUT ========== */
.settings-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 1rem 32px;
  display: flex;
  gap: 28px;
  min-height: calc(100vh - 180px);
}

.settings-nav {
  width: 200px;
  flex-shrink: 0;
}

.settings-nav-pagetitle {
  font-size: 26px;
  font-weight: 700;
  color: #222;
  letter-spacing: -0.4px;
  padding: 0 10px;
  margin-bottom: 22px;
}

.settings-nav-section { margin-bottom: 22px; }

.settings-nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #9DA1A5;
  padding: 0 10px;
  margin-bottom: 6px;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: #444;
  padding: 6px 10px;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.35;
}

.settings-nav-item svg { width: 14px; height: 14px; flex-shrink: 0; color: #9DA1A5; transition: color 0.15s; }
.settings-nav-item:hover { color: #3f84e5; background: #F1F7FF; }
.settings-nav-item:hover svg { color: #3f84e5; }

.settings-nav-item.active {
  color: #3f84e5;
  background: #F1F7FF;
  font-weight: 600;
}
.settings-nav-item.active svg { color: #3f84e5; }

.settings-nav-footer {
  font-size: 11px;
  color: #77797B;
  padding: 12px 10px 0;
  margin-top: 4px;
  border-top: 1px solid #e1e5e9;
  line-height: 1.5;
}
.settings-nav-footer strong { color: #222; font-weight: 600; }

/* ========== MAIN CONTENT ========== */
.settings-main {
  flex: 1;
  min-width: 0;
}

.view { display: none; }
.view.active { display: block; }

.settings-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-page-title {
  font-size: 22px;
  font-weight: 700;
  color: #222;
  letter-spacing: -0.3px;
}

.settings-page-subtitle {
  font-size: 13px;
  color: #57595B;
  line-height: 1.5;
  margin-top: 6px;
  max-width: 720px;
}

.settings-page-subtitle a { color: #3f84e5; text-decoration: none; }
.settings-page-subtitle a:hover { text-decoration: underline; }

.settings-section { margin-top: 28px; }

.settings-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e8ebef;
  margin-bottom: 16px;
}

.settings-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #222;
  letter-spacing: -0.1px;
}

.settings-section-link {
  font-size: 12px;
  font-weight: 600;
  color: #3f84e5;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.settings-section-link:hover { text-decoration: underline; }

/* ========== TEAMS LAYOUT ========== */
.teams-split {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.teams-list-panel {
  width: 280px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid #e8ebef;
  border-radius: 10px;
  overflow: hidden;
}

.teams-list-header {
  padding: 12px 16px;
  background: #fafbfc;
  border-bottom: 1px solid #e8ebef;
  font-size: 11px;
  font-weight: 600;
  color: #9DA1A5;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.team-list-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f2f5;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}
.team-list-item:last-child { border-bottom: none; }
.team-list-item:hover { background: #fafbfc; }

.team-list-item.active {
  background: #F1F7FF;
  border-left-color: #3f84e5;
}

.team-list-name {
  font-size: 13px;
  font-weight: 600;
  color: #222;
}

.team-list-meta {
  font-size: 11px;
  color: #77797B;
  margin-top: 3px;
}

.team-detail {
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 1px solid #e8ebef;
  border-radius: 10px;
  overflow: hidden;
}

.team-detail-header {
  padding: 18px 20px;
  border-bottom: 1px solid #f0f2f5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.team-detail-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.team-detail-name {
  font-size: 18px;
  font-weight: 700;
  color: #222;
  letter-spacing: -0.2px;
}

.team-detail-meta {
  font-size: 12px;
  color: #77797B;
}
.team-detail-meta a { color: #3f84e5; text-decoration: none; }
.team-detail-meta a:hover { text-decoration: underline; }

.team-detail-actions { display: flex; gap: 6px; flex-shrink: 0; }

.team-members-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #9DA1A5;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #fafbfc;
  border-bottom: 1px solid #e1e5e9;
}

.team-member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid #f0f2f5;
  transition: background 0.15s;
}
.team-member-row:hover { background: #fafbfc; }
.team-member-row:last-child { border-bottom: none; }

.team-member-identity { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }

.lead-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  background: #f0fdf4;
  color: #16a34a;
  border-radius: 10px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.team-member-actions { display: flex; gap: 4px; }

.team-empty {
  padding: 60px 20px;
  text-align: center;
}

.team-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  margin-bottom: 6px;
}

.team-empty-sub {
  font-size: 12px;
  color: #77797B;
  margin-bottom: 16px;
}

/* ========== TEAM CARDS (rebuild) ========== */
.team-card {
  background: #fff;
  border: 1px solid #e8ebef;
  border-radius: 10px;
  margin-bottom: 18px;
  overflow: hidden;
}

.team-card-head {
  padding: 18px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.team-card-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.team-card-name {
  font-size: 18px;
  font-weight: 700;
  color: #222;
  letter-spacing: -0.2px;
}

.team-card-meta {
  font-size: 12px;
  color: #77797B;
}
.team-card-meta a { color: #3f84e5; text-decoration: none; }
.team-card-meta a:hover { text-decoration: underline; }

.team-card-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}

.team-card-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  color: #3f84e5;
  padding: 4px 2px;
  transition: color 0.15s;
}
.team-card-action svg { width: 14px; height: 14px; }
.team-card-action:hover { color: #2563eb; }

.team-card-members {
  border-top: 1px solid #f0f2f5;
}

.team-card-member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid #f0f2f5;
  background: #fafbfc;
}
.team-card-member-row:last-child { border-bottom: none; }
.team-card-member-row .team-card-member-name {
  font-size: 14px;
  font-weight: 700;
  color: #222;
}

.team-card-member-meta {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-card-member-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.team-card-member-link {
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #3f84e5;
  text-decoration: underline;
  padding: 0;
  transition: color 0.15s;
}
.team-card-member-link:hover { color: #2563eb; }
.team-card-member-link.danger { color: #dc2626; }
.team-card-member-link.danger:hover { color: #b91c1c; }

.team-card-empty {
  padding: 22px 20px;
  font-size: 12px;
  color: #77797B;
  text-align: center;
  background: #fafbfc;
  border-top: 1px solid #f0f2f5;
}

/* ========== MEMBER PICKER ========== */
.user-picker {
  position: relative;
}

.user-picker-input {
  width: 100%;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  padding: 9px 12px;
  border: 1px solid #e1e5e9;
  border-radius: 4px;
  color: #222;
  outline: none;
  background: #fff;
}
.user-picker-input:focus { border-color: #3f84e5; }

.user-picker-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e1e5e9;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  max-height: 240px;
  overflow-y: auto;
  z-index: 20;
  display: none;
}
.user-picker-results.visible { display: block; }

.user-picker-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #f0f2f5;
}
.user-picker-option:last-child { border-bottom: none; }
.user-picker-option:hover { background: #F1F7FF; }
.user-picker-option .user-avatar { width: 26px; height: 26px; font-size: 10px; }
.user-picker-option-info { min-width: 0; }
.user-picker-option-name { font-size: 12px; font-weight: 600; color: #222; }
.user-picker-option-email { font-size: 11px; color: #77797B; }

.picked-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 6px;
  background: #F1F7FF;
  border: 1px solid #d6e6fb;
  border-radius: 999px;
}
.picked-user-chip .user-avatar { width: 22px; height: 22px; font-size: 9px; }
.picked-user-chip-name { font-size: 12px; font-weight: 600; color: #222; }
.picked-user-chip-remove {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #77797B;
  padding: 2px;
  border-radius: 50%;
  display: inline-flex;
}
.picked-user-chip-remove:hover { color: #dc2626; background: #fef2f2; }

/* ========== BUTTONS ========== */
.btn {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-sm { font-size: 11px; padding: 5px 14px; }
.btn-md { font-size: 12px; padding: 7px 16px; }
.btn-lg { font-size: 14px; padding: 10px 20px; }

.btn-primary { background: #3f84e5; color: #fff; }
.btn-primary:hover { background: #2e6ec5; }

.btn-secondary { background: #F1F5F9; color: #57595B; }
.btn-secondary:hover { background: #e1e5e9; }

.btn-danger { background: #ff0007; color: #fff; }
.btn-danger:hover { opacity: 0.85; }

.btn-ghost { background: transparent; color: #3f84e5; border: 1px solid #3f84e5; }
.btn-ghost:hover { background: #F1F7FF; }

.btn-disabled, .btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Anchor styled as link button (used for 'Skip for now' etc.) */
.text-link {
  color: #3f84e5;
  text-decoration: underline;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.text-link:hover { color: #2563eb; }

/* ========== TOOLBAR ========== */
.toolbar {
  background: #fff;
  border: 1px solid #e8ebef;
  border-radius: 10px 10px 0 0;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar.toolbar-stack {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.toolbar-actions-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.toolbar-links {
  display: flex;
  align-items: center;
  gap: 18px;
}
.toolbar-links a {
  font-size: 12px;
  font-weight: 600;
  color: #3f84e5;
  text-decoration: underline;
}
.toolbar-links a:hover { color: #2563eb; }

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.search-input-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #9DA1A5;
}

.search-input {
  width: 100%;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 400;
  padding: 7px 12px 7px 32px;
  border: 1px solid #e1e5e9;
  border-radius: 4px;
  color: #222;
  outline: none;
  transition: border-color 0.15s;
}

.search-input::placeholder { color: #9DA1A5; }
.search-input:focus { border-color: #3f84e5; }

/* Filter tabs */
.filter-tabs {
  display: flex;
  gap: 0;
}

.filter-tab {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  background: #fff;
  border: 1px solid #e1e5e9;
  color: #77797B;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-tab:first-child { border-radius: 4px 0 0 4px; }
.filter-tab:last-child { border-radius: 0 4px 4px 0; }
.filter-tab:not(:first-child) { margin-left: -1px; }

.filter-tab:hover { color: #222; border-color: #ccd1d6; z-index: 1; }

.filter-tab.active {
  color: #3f84e5;
  border-color: #3f84e5;
  background: #F1F7FF;
  z-index: 2;
}

/* Multi-select role chips */
.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #9DA1A5;
}

.role-chips { display: flex; gap: 6px; flex-wrap: wrap; }

.role-chip {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px 5px 10px;
  background: #fff;
  border: 1px solid #e1e5e9;
  color: #77797B;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.role-chip:hover { color: #222; border-color: #ccd1d6; }

.role-chip .chip-check {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid #ccd1d6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.role-chip.active {
  color: #3f84e5;
  border-color: #3f84e5;
  background: #F1F7FF;
}

.role-chip.active .chip-check {
  background: #3f84e5;
  border-color: #3f84e5;
}

.role-chip.active .chip-check::after {
  content: '';
  width: 6px;
  height: 4px;
  border-left: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

.role-chip.clear {
  color: #dc2626;
  border-color: transparent;
  background: transparent;
  font-weight: 500;
  padding: 5px 8px;
}

.role-chip.clear:hover { background: #fef2f2; }

.toolbar-divider {
  width: 1px;
  align-self: stretch;
  background: #e1e5e9;
  margin: 2px 4px;
}

.toolbar-spacer { flex: 1; }

.user-count {
  font-size: 12px;
  font-weight: 500;
  color: #77797B;
}

/* ========== BULK ACTIONS ========== */
.bulk-bar {
  background: #F1F7FF;
  border-left: 1px solid #e8ebef;
  border-right: 1px solid #e8ebef;
  padding: 10px 20px;
  display: none;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 500;
  color: #3f84e5;
}

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

.bulk-bar .bulk-count { font-weight: 600; }

.bulk-actions { display: flex; gap: 8px; margin-left: auto; }

/* ========== TABLE ========== */
.users-table-wrap {
  background: #fff;
  border: 1px solid #e8ebef;
  border-top: none;
  overflow: hidden;
}

.users-table-wrap.standalone {
  border-top: 1px solid #e8ebef;
  border-radius: 10px;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.users-table th {
  font-size: 11px;
  font-weight: 600;
  color: #9DA1A5;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid #e1e5e9;
  background: #fafbfc;
  white-space: nowrap;
}

.users-table th:first-child { padding-left: 20px; }
.users-table th:last-child, .users-table td:last-child { padding-right: 20px; }

.users-table td {
  font-size: 12px;
  color: #222;
  padding: 12px 10px;
  border-bottom: 1px solid #f0f2f5;
  vertical-align: middle;
}

.users-table td:first-child { padding-left: 20px; }

.users-table tbody tr { transition: background 0.15s; }
.users-table tbody tr:hover { background: #fafbfc; }
.users-table tbody tr:last-child td { border-bottom: none; }

/* Plain table (no toolbar attached) */
.plain-table-wrap {
  background: #fff;
  border: 1px solid #e8ebef;
  border-radius: 10px;
  overflow: hidden;
}

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

.plain-table th {
  font-size: 11px;
  font-weight: 600;
  color: #9DA1A5;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid #e1e5e9;
  background: #fafbfc;
  white-space: nowrap;
}

.plain-table td {
  font-size: 12.5px;
  color: #222;
  padding: 14px 14px;
  border-bottom: 1px solid #f0f2f5;
  vertical-align: middle;
}
.plain-table tbody tr:last-child td { border-bottom: none; }
.plain-table tbody tr:hover { background: #fafbfc; }
.plain-table .actions-col { text-align: right; }

/* Checkbox */
.checkbox-cell { width: 36px; }

.custom-checkbox {
  width: 16px;
  height: 16px;
  border: 1.5px solid #ccd1d6;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  flex-shrink: 0;
}

.custom-checkbox:hover { border-color: #3f84e5; }

.custom-checkbox.checked {
  background: #3f84e5;
  border-color: #3f84e5;
}

.custom-checkbox.checked::after {
  content: '';
  width: 8px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

/* Name cell */
.user-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.user-name {
  font-weight: 600;
  color: #222;
  line-height: 1.3;
}

.user-identity { display: flex; flex-direction: column; min-width: 0; }

.user-email-sub {
  font-size: 11px;
  color: #77797B;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}

/* Badges */
.type-badge {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  white-space: nowrap;
}

.role-requester { background: #dbeafe; color: #2563eb; }
.role-connector { background: #fef3c7; color: #d97706; }
.role-admin { background: #f0fdf4; color: #16a34a; }
.role-connector-ne { background: #fce7f3; color: #be185d; }

.status-badge {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.status-active { background: #f0fdf4; color: #16a34a; }
.status-disabled { background: #F1F5F9; color: #77797B; }
.status-pending { background: #fef3c7; color: #d97706; }
.status-clicked { background: #dbeafe; color: #2563eb; }
.status-invited { background: #ede9fe; color: #6d28d9; }

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

.status-active .status-dot { background: #16a34a; }
.status-disabled .status-dot { background: #9DA1A5; }
.status-pending .status-dot { background: #d97706; }
.status-clicked .status-dot { background: #2563eb; }
.status-invited .status-dot { background: #6d28d9; }

/* Date cells */
.date-cell { color: #57595B; font-size: 12px; white-space: nowrap; }
.muted-cell { color: #9DA1A5; font-size: 12px; }

/* Actions */
.actions-cell {
  display: flex;
  align-items: center;
  gap: 4px;
}

.action-btn {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9DA1A5;
  transition: all 0.15s;
}

.action-btn:hover { background: #F1F5F9; color: #3f84e5; }
.action-btn.danger:hover { background: #fef2f2; color: #dc2626; }

.action-btn svg { width: 16px; height: 16px; }

/* ========== PAGINATION ========== */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #fafbfc;
  border: 1px solid #e8ebef;
  border-top: none;
  border-radius: 0 0 10px 10px;
}

.pagination-info { font-size: 12px; color: #77797B; }
.pagination-info strong { color: #222; font-weight: 600; }

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.pagination-btn {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 500;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid #e1e5e9;
  background: #fff;
  color: #57595B;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.pagination-btn:hover { border-color: #ccd1d6; color: #222; }

.pagination-btn.active {
  background: #3f84e5;
  border-color: #3f84e5;
  color: #fff;
  font-weight: 700;
}

.pagination-btn:disabled { opacity: 0.4; cursor: default; }
.pagination-btn:disabled:hover { border-color: #e1e5e9; color: #57595B; }

.pagination-btn svg { width: 14px; height: 14px; }

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  font-size: 12px;
  color: #9DA1A5;
  user-select: none;
}

.pagination-per-page {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #77797B;
}

.pagination-per-page select {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  color: #222;
  padding: 4px 24px 4px 8px;
  border: 1px solid #e1e5e9;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%239DA1A5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
}

.pagination-per-page select:hover { border-color: #ccd1d6; }

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

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

.modal {
  background: #fff;
  border-radius: 10px;
  width: 520px;
  max-width: 95vw;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.modal-sm { width: 420px; }

.modal-user-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: #fafbfc;
  border-bottom: 1px solid #f0f2f5;
}

.modal-user-banner .user-avatar { width: 40px; height: 40px; font-size: 13px; }
.modal-user-banner .banner-name { font-size: 14px; font-weight: 600; color: #222; }
.modal-user-banner .banner-email { font-size: 12px; color: #77797B; margin-top: 2px; }

.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.form-helper {
  font-size: 11px;
  color: #77797B;
  margin-top: 6px;
  line-height: 1.4;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 12px;
  border-top: 1px dashed #f0f2f5;
}
.meta-row:first-child { border-top: none; }
.meta-row .meta-label { color: #77797B; font-weight: 500; }
.meta-row .meta-value { color: #222; font-weight: 500; }

.modal-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #9DA1A5;
  margin: 20px 0 10px;
}
.modal-section-title:first-child { margin-top: 0; }

.danger-zone {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}
.danger-zone-text { font-size: 12px; color: #7f1d1d; font-weight: 500; }
.danger-zone-sub { font-size: 11px; color: #b91c1c; margin-top: 2px; }

/* CSV drop zone */
.or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #9DA1A5;
}
.or-divider::before, .or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #f0f2f5;
}

.csv-drop {
  display: block;
  border: 1.5px dashed #d4d8dd;
  border-radius: 6px;
  padding: 16px;
  text-align: center;
  transition: all 0.15s;
  cursor: pointer;
  background: #fafbfc;
  margin-top: 4px;
}
.csv-drop:hover { border-color: #3f84e5; background: #F1F7FF; }

.csv-drop-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #F1F7FF;
  color: #3f84e5;
  margin-bottom: 8px;
}
.csv-drop-icon svg { width: 16px; height: 16px; }

.csv-drop-text {
  font-size: 12px;
  font-weight: 600;
  color: #222;
}
.csv-drop-text .link { color: #3f84e5; }

.csv-drop-sub {
  font-size: 11px;
  color: #77797B;
  margin-top: 2px;
}

.csv-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #F1F7FF;
  border: 1px solid #d6e6fb;
  border-radius: 6px;
  margin-top: 8px;
  font-size: 12px;
}
.csv-selected .csv-file { display: flex; align-items: center; gap: 8px; color: #222; font-weight: 500; }
.csv-selected .csv-count { color: #3f84e5; font-weight: 600; font-size: 11px; }
.csv-remove {
  background: transparent;
  border: none;
  color: #77797B;
  cursor: pointer;
  padding: 2px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
}
.csv-remove:hover { color: #dc2626; background: #fef2f2; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f0f2f5;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #222;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9DA1A5;
  transition: all 0.15s;
}

.modal-close:hover { background: #F1F5F9; color: #222; }
.modal-close svg { width: 18px; height: 18px; }

.modal-body { padding: 24px; }

.form-group { margin-bottom: 18px; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #9DA1A5;
  margin-bottom: 6px;
}

.form-label .required { color: #dc2626; }

.form-input {
  width: 100%;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 400;
  padding: 9px 12px;
  border: 1px solid #e1e5e9;
  border-radius: 4px;
  color: #222;
  outline: none;
  transition: border-color 0.15s;
  background: #fff;
}

.form-input:focus { border-color: #3f84e5; }
.form-input:disabled { background: #fafbfc; color: #9DA1A5; cursor: not-allowed; }

.form-input.code { font-family: 'JetBrains Mono', 'Menlo', monospace; font-size: 12px; }

.form-select {
  width: 100%;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 400;
  padding: 9px 12px;
  border: 1px solid #e1e5e9;
  border-radius: 4px;
  color: #222;
  outline: none;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s;
  appearance: none;
  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='%239DA1A5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-select:focus { border-color: #3f84e5; }

.form-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #444;
  cursor: pointer;
  user-select: none;
}

.form-checkbox-row input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid #ccd1d6;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.form-checkbox-row input[type="checkbox"]:checked {
  background: #3f84e5;
  border-color: #3f84e5;
}

.form-checkbox-row input[type="checkbox"]:checked::after {
  content: '';
  width: 8px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

/* Toggle switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toggle-label-text {
  font-size: 13px;
  font-weight: 500;
  color: #222;
}

.toggle-switch {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: #ccd1d6;
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
  flex-shrink: 0;
}

.toggle-switch.active { background: #3f84e5; }

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-switch.active::after { transform: translateX(18px); }

.toggle-switch.disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px 20px;
  border-top: 1px solid #f0f2f5;
}

/* ========== CONFIRM POPOVER ========== */
.confirm-popover {
  position: absolute;
  z-index: 900;
  width: 280px;
  background: #fff;
  border: 1px solid #e8ebef;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  padding: 14px;
  display: none;
}

.confirm-popover.visible { display: block; }

.confirm-popover-title {
  font-size: 12px;
  font-weight: 600;
  color: #222;
  margin-bottom: 4px;
}

.confirm-popover-desc {
  font-size: 11px;
  font-weight: 400;
  color: #77797B;
  line-height: 1.45;
  margin-bottom: 12px;
}

.confirm-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 899;
  display: none;
}

.confirm-backdrop.visible { display: block; }

/* ========== STANDALONE CARDS / FORM PAGES ========== */
.settings-card {
  background: #fff;
  border: 1px solid #e8ebef;
  border-radius: 10px;
  padding: 22px 24px;
}

.settings-card + .settings-card { margin-top: 18px; }

.settings-card-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #3f84e5;
  margin-bottom: 14px;
}

.settings-stack { display: flex; flex-direction: column; gap: 18px; }

.settings-stack-narrow {
  max-width: 720px;
}

/* Radio selection cards (Email App Default) */
.radio-cards { display: flex; flex-direction: column; gap: 10px; max-width: 640px; }

.radio-card {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #e8ebef;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.radio-card:hover { border-color: #c5d6ee; }

.radio-card.selected {
  border-color: #3f84e5;
  background: #F8FBFF;
  box-shadow: inset 0 0 0 1px #3f84e5;
}

.radio-card-bullet {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #ccd1d6;
  flex-shrink: 0;
  margin-top: 2px;
  position: relative;
  transition: all 0.15s;
}
.radio-card.selected .radio-card-bullet {
  border-color: #3f84e5;
}
.radio-card.selected .radio-card-bullet::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3f84e5;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.radio-card-body { flex: 1; min-width: 0; }
.radio-card-title { font-size: 13.5px; font-weight: 700; color: #222; margin-bottom: 4px; }
.radio-card-desc { font-size: 12px; color: #57595B; line-height: 1.5; }

/* Toggle row that lives directly on a settings page (not inside a modal) */
.settings-toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  max-width: 720px;
}

.settings-toggle-copy { flex: 1; min-width: 0; }
.settings-toggle-title { font-size: 14px; font-weight: 700; color: #222; margin-bottom: 6px; }
.settings-toggle-desc { font-size: 12.5px; color: #57595B; line-height: 1.55; }
.settings-toggle-desc a { color: #3f84e5; text-decoration: none; }
.settings-toggle-desc a:hover { text-decoration: underline; }

.settings-toggle-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.settings-toggle-status {
  font-size: 12px;
  color: #77797B;
}

/* ========== SALESFORCE PAGE ========== */
.sf-step {
  padding: 22px 0 26px;
  border-top: 1px solid #e8ebef;
}
.sf-step:first-child { border-top: none; padding-top: 4px; }

.sf-step-title {
  font-size: 13px;
  font-weight: 700;
  color: #3f84e5;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.sf-step-desc {
  font-size: 13px;
  color: #57595B;
  line-height: 1.55;
  max-width: 720px;
  margin-bottom: 14px;
}
.sf-step-desc a { color: #3f84e5; text-decoration: underline; }

.sf-status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #57595B;
  margin-bottom: 8px;
}

.sf-status-line .check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
}
.sf-status-line .check svg { width: 11px; height: 11px; stroke-width: 3.5; }

.sf-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 560px;
}

.sf-status-block {
  background: #fafbfc;
  border: 1px solid #e8ebef;
  border-radius: 8px;
  padding: 14px 18px;
  max-width: 720px;
}

.sf-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #222;
}
.sf-status-row + .sf-status-row { margin-top: 4px; }
.sf-status-row strong { font-weight: 600; }

.sf-step-pills {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  color: #444;
}

.sf-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.sf-pill.done { background: #f0fdf4; color: #16a34a; }
.sf-pill.pending { background: #fef3c7; color: #d97706; }
.sf-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ========== TARGET COMPANY SYNC ========== */
.tcs-card {
  background: #fff;
  border: 1px solid #e8ebef;
  border-radius: 10px;
  padding: 22px 24px;
  margin-top: 18px;
}

.tcs-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.tcs-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #222;
  letter-spacing: -0.1px;
}

.tcs-card-desc {
  font-size: 12.5px;
  color: #57595B;
  margin-top: 4px;
  line-height: 1.5;
}

.tcs-mapping-row {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(160px, 200px) 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.tcs-mapping-row .tcs-col-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #9DA1A5;
}

.tcs-values-stack { display: flex; flex-direction: column; gap: 6px; }

.tcs-value-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tcs-or {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #9DA1A5;
  padding-left: 6px;
}

.tcs-mini-btn {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid #e1e5e9;
  background: #fff;
  cursor: pointer;
  color: #57595B;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.tcs-mini-btn:hover { color: #3f84e5; border-color: #3f84e5; background: #F1F7FF; }
.tcs-mini-btn.danger:hover { color: #dc2626; border-color: #fecaca; background: #fef2f2; }
.tcs-mini-btn svg { width: 14px; height: 14px; }

.tcs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 4px;
}

.tcs-cat {
  background: #fafbfc;
  border: 1px solid #e8ebef;
  border-radius: 8px;
  padding: 14px 16px;
}

.tcs-cat-title {
  font-size: 12px;
  font-weight: 700;
  color: #222;
  margin-bottom: 2px;
}

.tcs-cat-meta {
  font-size: 11px;
  color: #77797B;
  margin-bottom: 12px;
}

.tcs-cat .tcs-mapping-row {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 8px;
}

.tcs-cat .tcs-values-stack { margin-top: 4px; }

.tcs-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  flex-wrap: wrap;
}

/* ========== EMAIL TEMPLATES ========== */
.template-card {
  background: #fff;
  border: 1px solid #e8ebef;
  border-radius: 10px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.15s;
}
.template-card + .template-card { margin-top: 12px; }
.template-card:hover { border-color: #c5d6ee; transform: translateY(-1px); box-shadow: 0 2px 12px rgba(0,0,0,0.04); }

.template-card-info { flex: 1; min-width: 0; }
.template-card-type {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #3f84e5;
  margin-bottom: 4px;
}
.template-card-name { font-size: 14px; font-weight: 700; color: #222; }
.template-card-desc { font-size: 12px; color: #77797B; margin-top: 4px; }

.template-card-actions { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }

/* New Template page split layout */
.template-form-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 24px;
  align-items: start;
}

.template-form-card {
  background: #fff;
  border: 1px solid #e8ebef;
  border-radius: 10px;
  padding: 24px 26px;
}

.template-form-card .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.template-form-card .form-grid.full-row { grid-template-columns: 1fr; }

.template-form-card textarea.form-input { min-height: 120px; resize: vertical; line-height: 1.5; }

.template-form-card .form-question {
  font-size: 12.5px;
  color: #444;
  margin-top: 12px;
  margin-bottom: 8px;
  line-height: 1.5;
}

.template-form-card .form-radio-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.form-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12.5px;
  color: #222;
  user-select: none;
}

.form-radio input[type="radio"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid #ccd1d6;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: all 0.15s;
  margin: 0;
}

.form-radio input[type="radio"]:checked {
  border-color: #3f84e5;
}

.form-radio input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3f84e5;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.template-protip-card {
  background: #FBFCFE;
  border: 1px solid #e8ebef;
  border-radius: 10px;
  padding: 18px 20px;
  position: sticky;
  top: 28px;
}

.template-protip-card .protip-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #3f84e5;
  margin-bottom: 8px;
}

.template-protip-card p {
  font-size: 12px;
  color: #57595B;
  line-height: 1.55;
  margin-bottom: 12px;
}

.template-protip-card .var-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: 'JetBrains Mono', 'Menlo', monospace;
  font-size: 11.5px;
  color: #444;
}

.template-protip-card .var-list code {
  background: #F1F5F9;
  padding: 2px 6px;
  border-radius: 3px;
  color: #2563eb;
  cursor: pointer;
  transition: background 0.15s;
}
.template-protip-card .var-list code:hover { background: #dbeafe; }

/* Connector approval mode helper */
.approval-table {
  background: #fff;
  border: 1px solid #e8ebef;
  border-radius: 10px;
  overflow: hidden;
}

/* Invitations toolbar links */
.invitations-toolbar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 0 6px;
  border-bottom: 1px solid #e8ebef;
  margin-bottom: 16px;
}

.invitations-toolbar a {
  font-size: 12.5px;
  font-weight: 600;
  color: #3f84e5;
  text-decoration: underline;
}
.invitations-toolbar a:hover { color: #2563eb; }

/* Disabled-but-styled "Send Invitations" footer button (bottom-right of table) */
.send-invites-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  background: #16a34a;
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}
.send-invites-cta:hover { background: #15803d; }
.send-invites-cta:disabled, .send-invites-cta.disabled { opacity: 0.5; cursor: not-allowed; background: #16a34a; }

/* Big green "send invites" hero button (Invite Connectors / Requesters pages) */
.btn-success {
  background: #16a34a;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.btn-success:hover { background: #15803d; }

/* ========== INDEX PAGE ========== */
.proto-index { max-width: 1200px; margin: 0 auto; padding: 28px 1rem 64px; }
.proto-index h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: #222;
  margin-bottom: 6px;
}
.proto-index .lede {
  font-size: 14px;
  color: #57595B;
  margin-bottom: 28px;
  max-width: 720px;
  line-height: 1.55;
}
.proto-index .group { margin-bottom: 28px; }
.proto-index .group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #9DA1A5;
  margin-bottom: 10px;
}
.proto-index .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.proto-index a.proto-card {
  display: block;
  background: #fff;
  border: 1px solid #e8ebef;
  border-radius: 8px;
  padding: 14px 16px;
  text-decoration: none;
  color: #222;
  transition: all 0.15s;
}
.proto-index a.proto-card:hover { border-color: #3f84e5; transform: translateY(-1px); box-shadow: 0 2px 12px rgba(0,0,0,0.05); }
.proto-index a.proto-card .pc-name { font-size: 13.5px; font-weight: 700; }
.proto-index a.proto-card .pc-path { font-size: 11px; color: #77797B; margin-top: 4px; font-family: 'JetBrains Mono', 'Menlo', monospace; }

/* ========== NOTIFICATIONS PAGE ========== */
.notif-page { max-width: 980px; }

.notif-master-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  background: #F8FBFF;
  border: 1px solid #d6e4f7;
  border-radius: 10px;
  margin-bottom: 18px;
}
.notif-master-card .nm-copy { flex: 1; }
.notif-master-card .nm-title { font-size: 13.5px; font-weight: 700; color: #222; }
.notif-master-card .nm-desc { font-size: 12px; color: #57595B; line-height: 1.5; margin-top: 3px; }

.notif-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.notif-filter-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #9DA1A5;
  margin-right: 4px;
}
.notif-filter-chip {
  font-family: 'Montserrat', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid #e0e3e7;
  background: #fff;
  color: #444;
  cursor: pointer;
  transition: all 0.12s;
}
.notif-filter-chip:hover { border-color: #c5d6ee; color: #222; }
.notif-filter-chip.active {
  background: #3f84e5;
  border-color: #3f84e5;
  color: #fff;
}

.notif-section { margin-bottom: 22px; }
.notif-section-card {
  background: #fff;
  border: 1px solid #e8ebef;
  border-radius: 10px;
  overflow: hidden;
}

.notif-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px 14px;
  border-bottom: 1px solid #f1f3f5;
}
.notif-section-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #222;
  letter-spacing: -0.2px;
}
.notif-section-desc { font-size: 12px; color: #77797B; margin-top: 2px; line-height: 1.5; }

.notif-channel-head {
  display: grid;
  grid-template-columns: 1fr 80px 80px 80px;
  align-items: center;
  gap: 0;
  padding: 8px 22px;
  background: #fafbfc;
  border-bottom: 1px solid #f1f3f5;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #9DA1A5;
}
.notif-channel-head .nch-channel { text-align: center; }

.notif-row {
  display: grid;
  grid-template-columns: 1fr 80px 80px 80px;
  align-items: center;
  gap: 0;
  padding: 14px 22px;
  border-bottom: 1px solid #f5f6f8;
}
.notif-row:last-child { border-bottom: 0; }
.notif-row:hover { background: #fbfcfd; }

.notif-row-meta { padding-right: 16px; min-width: 0; }
.notif-row-title {
  font-size: 13px;
  font-weight: 600;
  color: #222;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}
.notif-row-desc { font-size: 12px; color: #57595B; line-height: 1.5; }

.notif-row-channel {
  display: flex;
  justify-content: center;
}

.audience-pill {
  display: inline-flex;
  align-items: center;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 6px;
  border-radius: 3px;
  background: #f1f3f5;
  color: #57595B;
  white-space: nowrap;
}
.audience-pill.connector { background: #e6f4ea; color: #1f7a3d; }
.audience-pill.requester { background: #e8f0fe; color: #1a56b8; }
.audience-pill.admin     { background: #fef3e2; color: #92560b; }
.audience-pill.gatekeeper{ background: #f3e8fd; color: #6b21a8; }
.audience-pill.everyone  { background: #f1f3f5; color: #57595B; }

.notif-row.is-disabled { opacity: 0.55; }
.notif-row.is-disabled .toggle-switch { pointer-events: none; }

.notif-required-badge {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 6px;
  border-radius: 3px;
  background: #f1f3f5;
  color: #77797B;
}

/* ========== USER PROFILE PAGE ========== */
.profile-stack { display: flex; flex-direction: column; gap: 18px; max-width: 880px; }

.profile-identity-card {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 22px 24px;
}

.profile-avatar-wrap {
  position: relative;
  width: 84px;
  height: 84px;
  flex-shrink: 0;
}

.profile-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3f84e5 0%, #2e6ec5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  font-family: 'Montserrat', sans-serif;
}

.profile-avatar-camera {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #e8ebef;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #57595B;
  transition: all 0.15s;
}
.profile-avatar-camera:hover { color: #3f84e5; border-color: #3f84e5; }
.profile-avatar-camera svg { width: 14px; height: 14px; }

.profile-identity-meta { flex: 1; min-width: 0; }
.profile-identity-name {
  font-size: 19px;
  font-weight: 700;
  color: #222;
  letter-spacing: -0.3px;
  margin-bottom: 2px;
}
.profile-identity-role {
  font-size: 12.5px;
  color: #57595B;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.profile-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #F1F7FF;
  color: #3f84e5;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: 4px;
}
.profile-identity-email { font-size: 12.5px; color: #77797B; margin-top: 6px; }

.profile-identity-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.profile-identity-actions .upload-link {
  font-size: 11.5px;
  color: #3f84e5;
  text-decoration: none;
  font-weight: 600;
}
.profile-identity-actions .upload-link:hover { text-decoration: underline; }
.profile-identity-actions .remove-link {
  font-size: 11.5px;
  color: #77797B;
  text-decoration: none;
}
.profile-identity-actions .remove-link:hover { color: #dc2626; }

/* Generic section header inside a profile card */
.profile-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.profile-section-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #222;
  letter-spacing: -0.2px;
}
.profile-section-desc { font-size: 12px; color: #77797B; margin-top: 2px; line-height: 1.5; }

/* Connected accounts */
.connected-account-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid #f1f3f5;
}
.connected-account-row:first-child { border-top: 0; padding-top: 0; }
.connected-account-row:last-child { padding-bottom: 0; }

.connected-account-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #f6f8fb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.connected-account-icon svg { width: 20px; height: 20px; }

.connected-account-meta { flex: 1; min-width: 0; }
.connected-account-name { font-size: 13px; font-weight: 600; color: #222; }
.connected-account-state { font-size: 11.5px; color: #77797B; margin-top: 2px; }
.connected-account-state.is-connected { color: #15803d; }
.connected-account-state .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 5px;
  vertical-align: middle;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}
.profile-form-grid .form-group { margin-bottom: 0; }
.profile-form-grid .full-row { grid-column: 1 / -1; }

.profile-card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #f1f3f5;
}

.profile-danger-card {
  border-color: #fcd9d9;
  background: #fff8f8;
}
.profile-danger-card .profile-section-title { color: #dc2626; }
.profile-danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid #f7d6d6;
}
.profile-danger-row:first-of-type { border-top: 0; }
.profile-danger-row p { font-size: 12.5px; color: #57595B; line-height: 1.5; max-width: 540px; }
.profile-danger-row p strong { color: #222; }
