/* Shared base styles */
:root {
  /* Typography */
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1f2937;

  /* Colors */
  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-text-light: #94a3b8;
  --color-background: #f5f7fa;
  --color-background-subtle: #f8fafc;
  --color-border: #e5e7eb;
  --color-border-subtle: #e2e8f0;
  --color-white: #ffffff;

  /* Status Colors */
  --color-success: #16a34a;
  --color-success-bg: #dcfce7;
  --color-success-border: #bbf7d0;
  --color-error: #dc2626;
  --color-error-bg: #fee2e2;
  --color-error-border: #fecaca;
  --color-warning: #d97706;
  --color-warning-bg: #fef3c7;
  --color-warning-border: #fcd34d;

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 24px;
  --spacing-2xl: 32px;

  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Container */
  --container-max-width: 1200px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl:
    0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
  --transition-slow: 0.3s ease;
}
body {
  margin: 0;
  min-height: 100vh;
}

.global-nav .container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-xl);
}

.global-nav .header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 0;
  position: relative;
  z-index: 50;
}

.global-nav .header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.global-nav .header-brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.global-nav .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  text-decoration: none;
}

.global-nav .logo:hover {
  color: #111827;
}

.global-nav .nav-separator {
  color: #9ca3af;
  font-weight: 600;
}

.global-nav .nav-title {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
}

.global-nav .user-menu {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.global-nav .user-info {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.global-nav .bb-org-switcher {
  position: relative;
  display: inline-block;
}

.global-nav .bb-org-switcher-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 6px 12px;
  background: #f3f4f6;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: #374151;
  transition: var(--transition-normal);
}

.global-nav .bb-org-switcher-btn:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
}

.global-nav .bb-org-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.global-nav .bb-org-chevron {
  font-size: 10px;
  color: #6b7280;
  transition: transform 0.2s ease;
}

.global-nav .bb-org-switcher.open .bb-org-chevron {
  transform: rotate(180deg);
}

.global-nav .bb-org-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 240px;
  max-height: 320px;
  z-index: 1000;
  display: none;
}

.global-nav .bb-org-switcher.open .bb-org-dropdown {
  display: block;
}

.global-nav .bb-org-dropdown-header {
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  font-size: 13px;
  color: #374151;
}

.global-nav .bb-org-list {
  max-height: 220px;
  overflow-y: auto;
}

.global-nav .bb-org-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  color: #374151;
}

.global-nav .bb-org-item:hover {
  background: #f3f4f6;
}

.global-nav .bb-org-item.active {
  background: #eff6ff;
  color: #1d4ed8;
}

.global-nav .bb-org-item.active::after {
  content: "✓";
  color: #1d4ed8;
  font-weight: bold;
}

.global-nav .bb-org-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-nav .bb-org-divider {
  color: #d1d5db;
  margin: 0 4px;
}

.global-nav .bb-org-single {
  padding: 6px 12px;
  font-size: 13px;
  color: #374151;
  font-weight: 500;
}

.global-nav .bb-org-dropdown-footer {
  border-top: 1px solid #e5e7eb;
  padding: 8px;
}

.global-nav .bb-org-create-btn {
  width: 100%;
  padding: 10px 12px;
  background: #f3f4f6;
  border: 1px dashed #d1d5db;
  border-radius: 6px;
  color: #4b5563;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.global-nav .bb-org-create-btn:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
  color: #374151;
}

.global-nav .bb-dropdown {
  position: relative;
  display: inline-block;
}

.global-nav .bb-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  min-width: 160px;
  z-index: 1000;
  display: none;
}

.global-nav .bb-dropdown-menu.show {
  display: block;
}

.global-nav .bb-dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 16px;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
  transition: background-color 0.2s;
}

.global-nav .bb-dropdown-item:hover {
  background-color: #f3f4f6;
}

.global-nav .bb-dropdown-item:first-child {
  border-radius: 5px 5px 0 0;
}

.global-nav .bb-dropdown-item:last-child {
  border-radius: 0 0 5px 5px;
}

.global-nav .bb-dropdown-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 6px 0;
}

.global-nav .user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.25);
}

.global-nav .user-avatar:hover {
  background: var(--color-primary-hover);
}

.global-nav .user-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  object-fit: cover;
}

.global-nav .bb-notifications-container {
  position: relative;
  display: inline-block;
}

.global-nav .bb-notifications-btn {
  position: relative;
}

.global-nav .bb-notifications-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--color-error);
  color: var(--color-white);
  font-size: 10px;
  font-weight: 600;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.global-nav .bb-notifications-badge:empty,
.global-nav .bb-notifications-badge[data-count="0"] {
  display: none;
}

.global-nav .bb-notifications-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 360px;
  max-height: 480px;
  z-index: 1000;
  display: none;
  overflow: hidden;
}

.global-nav .bb-notifications-container.open .bb-notifications-dropdown {
  display: block;
}

.global-nav .bb-notifications-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.global-nav .bb-notifications-title {
  font-weight: 600;
  color: #111827;
  font-size: 14px;
}

.global-nav .bb-notifications-mark-read {
  font-size: 12px;
  color: var(--color-primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.global-nav .bb-notifications-mark-read:hover {
  background: #eff6ff;
}

.global-nav .bb-notifications-list {
  max-height: 320px;
  overflow-y: auto;
}

.global-nav .bb-notifications-empty {
  padding: 32px 16px;
  text-align: center;
  color: #6b7280;
}

.global-nav .bb-notifications-empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.global-nav .bb-notification-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background 0.15s ease;
}

.global-nav .bb-notification-item:hover {
  background: #f9fafb;
}

.global-nav .bb-notification-item.unread {
  background: #eff6ff;
}

.global-nav .bb-notification-item.unread:hover {
  background: #dbeafe;
}

.global-nav .bb-notification-item-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.global-nav .bb-notification-item-content {
  flex: 1;
  min-width: 0;
}

.global-nav .bb-notification-item-subject {
  font-weight: 500;
  color: #111827;
  font-size: 13px;
  margin-bottom: 2px;
}

.global-nav .bb-notification-item-preview {
  color: #6b7280;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.global-nav .bb-notification-item-time {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 4px;
}

.global-nav .bb-notifications-footer {
  border-top: 1px solid #e5e7eb;
  padding: 8px;
  display: flex;
  gap: 8px;
}

.global-nav .bb-notifications-footer-btn {
  flex: 1;
  padding: 8px;
  font-size: 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease;
}

.global-nav .bb-notifications-settings-btn {
  background: #f3f4f6;
  color: #374151;
}

.global-nav .bb-notifications-settings-btn:hover {
  background: #e5e7eb;
}

.global-nav .bb-quota-display {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: 6px 12px;
  background: var(--color-background-subtle);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #475569;
}

.global-nav .bb-quota-plan {
  font-weight: 600;
  color: var(--color-primary);
}

.global-nav .bb-quota-usage {
  color: #64748b;
}

.global-nav .bb-quota-usage-count {
  font-weight: 600;
  color: #1e293b;
}

.global-nav .bb-quota-reset {
  color: #94a3b8;
  font-size: 12px;
}

.global-nav .bb-quota-display.quota-warning {
  background: #fef3c7;
  border-color: #fcd34d;
}

.global-nav .bb-quota-display.quota-warning .bb-quota-usage-count {
  color: #b45309;
}

.global-nav .bb-quota-display.quota-exhausted {
  background: #fee2e2;
  border-color: #fca5a5;
}

.global-nav .bb-quota-display.quota-exhausted .bb-quota-usage-count {
  color: #dc2626;
}

/* Shared component styles */
.bb-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.bb-modal.show {
  display: flex;
}

.bb-modal-content {
  background: white;
  border-radius: 16px;
  padding: 28px;
  max-width: 520px;
  width: 90%;
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.bb-modal-header {
  display: block;
  margin-bottom: 18px;
  padding-bottom: 0;
  border-bottom: none;
  position: relative;
}

.bb-modal-title {
  font-size: 2.7rem;
  line-height: 1.05;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.bb-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #6b7280;
  position: absolute;
  right: 0;
  top: 0;
  width: 34px;
  height: 34px;
  border-radius: 999px;
}

.bb-modal-close:hover {
  color: #111827;
  background: #f3f4f6;
}

.bb-auth-form {
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bb-auth-form > .bb-social-buttons {
  order: 1;
}

.bb-auth-form > .bb-auth-divider {
  order: 2;
}

.bb-auth-form > form {
  order: 3;
}

.bb-auth-form > .bb-auth-links {
  order: 4;
}

.bb-form-group {
  margin-bottom: 12px;
}

.bb-form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #374151;
  font-size: 14px;
}

.bb-form-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 17px;
  background: white;
  color: #374151;
}

.bb-form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.bb-button {
  padding: 12px 24px;
  border-radius: 6px;
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: 14px;
}

.bb-button-primary {
  background: var(--color-primary);
  color: var(--color-white);
}

.bb-button-primary:hover {
  background: var(--color-primary-hover);
}

.bb-button-outline {
  background: transparent;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.bb-button-outline:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.bb-button-full {
  width: 100%;
  justify-content: center;
  margin-bottom: 0;
}

.bb-auth-divider {
  text-align: center;
  margin: 8px 0 2px;
  position: relative;
  color: #6b7280;
  font-size: 17px;
}

.bb-auth-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #d1d5db;
  z-index: 1;
}

.bb-auth-divider span {
  background: white;
  padding: 0 16px;
  position: relative;
  z-index: 2;
}

.bb-social-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 4px;
}

.bb-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  border-radius: 10px;
  border-color: #d1d5db;
  color: #111827;
  background: #ffffff;
  font-size: 17px;
  min-height: 54px;
  font-weight: 500;
}

.bb-social-btn.bb-button-full {
  margin-bottom: 0;
}

.bb-social-btn .bb-social-icon {
  position: absolute;
  left: 16px;
}

.bb-social-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d1d5db;
  background: #ffffff;
  overflow: hidden;
}

.bb-social-icon img {
  width: 16px;
  height: 16px;
  display: block;
}

.bb-social-icon-microsoft img {
  width: 17px;
  height: 17px;
}

.bb-social-icon-sso {
  font-size: 14px;
}

.bb-social-btn-coming-soon {
  opacity: 0.68;
  cursor: not-allowed;
}

.bb-social-badge {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 2px 8px;
}

.bb-auth-links {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bb-auth-links a {
  color: var(--color-primary);
  text-decoration: none;
  font-size: 15px;
  display: block;
  margin-bottom: 0;
}

.bb-auth-links a:hover {
  text-decoration: underline;
}

/* Route-level auth gate: keep URL, hide page content, show only auth modal */
body.bb-auth-route-gated > *:not(#authModalContainer) {
  display: none !important;
}

body.bb-auth-route-gated #authModalContainer {
  display: block !important;
}

@media (width <= 640px) {
  .bb-modal-content {
    padding: 22px;
    width: 94%;
  }

  .bb-modal-title {
    font-size: 2rem;
  }
}

.bb-auth-loading {
  text-align: center;
  padding: 40px 20px;
}

.bb-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--color-border);
  border-top: 3px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

.bb-auth-error {
  background: var(--color-error-bg);
  color: var(--color-error);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  border: 1px solid var(--color-error-border);
}

.bb-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  max-width: 400px;
  z-index: 10000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  opacity: 0;
}

.bb-notification-show {
  transform: translateX(0);
  opacity: 1;
}

.bb-notification-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 14px;
  font-weight: 500;
}

.bb-notification-error .bb-notification-content {
  background: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid var(--color-error-border);
}

.bb-notification-success .bb-notification-content {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

.bb-btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.bb-btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
}

.bb-btn-primary:hover {
  background: var(--color-primary-hover);
}

.bb-btn-secondary {
  background: #f3f4f6;
  color: #374151;
}

.bb-btn-secondary:hover {
  background: #e5e7eb;
}

.bb-status-running {
  background: #dbeafe;
  color: #1d4ed8;
}

.bb-status-completed {
  background: #dcfce7;
  color: #16a34a;
}

.bb-status-failed {
  background: #fee2e2;
  color: #dc2626;
}

.bb-status-pending {
  background: #fef3c7;
  color: #d97706;
}

.bb-status-cancelled {
  background: #f3f4f6;
  color: #6b7280;
}

.bb-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.bb-stat-card {
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  text-align: center;
  border: 1px solid #f0f0f0;
}

.bb-stat-value {
  font-size: 2.5em;
  font-weight: 700;
  margin-bottom: 8px;
  color: #1a1a1a;
}

.bb-stat-label {
  color: #666;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bb-jobs-section {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 30px;
}

.bb-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 0 24px;
  margin-bottom: 20px;
}

.bb-section-header h3 {
  margin: 0;
  font-size: 1.25em;
  font-weight: 600;
}

.bb-section-actions {
  display: flex;
  gap: 12px;
}

.bb-jobs-list {
  padding: 0 24px 24px 24px;
}

.bb-job-card {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.bb-job-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.bb-job-domain {
  font-weight: 600;
  font-size: 1.1em;
  color: #1a1a1a;
}

.bb-job-status {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.bb-job-progress {
  margin-bottom: 16px;
}

.bb-progress-bar {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.bb-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  transition: width 0.3s ease;
}

.bb-job-details {
  font-size: 14px;
  color: #6b7280;
}

.bb-job-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.bb-job-started {
  color: #6b7280;
}

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

.bb-job-link {
  background: none;
  border: none;
  color: #3b82f6;
  cursor: pointer;
  text-decoration: underline;
  font-size: 14px;
  margin-right: 12px;
}

.bb-job-link:hover {
  color: #2563eb;
}

.bb-job-link[data-bb-show-if] {
  display: none;
}

.bb-job-link[bbb-show] {
  display: none;
}

.bb-job-link[bbb-hide] {
  display: none;
}

.bb-job-link[bbb-if] {
  display: none;
}

.bb-modal-section {
  margin-bottom: 24px;
}

.bb-modal-section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: #374151;
}

.bb-job-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.bb-info-item {
  background: #f9fafb;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.bb-info-label {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.bb-info-value {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
}

.bb-tasks-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.bb-tasks-table th {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.bb-tasks-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.bb-task-path {
  font-family: "Monaco", "Menlo", monospace;
  background: #f3f4f6;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.bb-task-status {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.bb-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #6b7280;
}

.bb-error {
  color: #dc2626;
  background: #fee2e2;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 16px 0;
}

.bb-password-strength {
  margin-top: 8px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
}

.bb-strength-meter {
  width: 100%;
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.bb-strength-fill {
  height: 100%;
  transition: all 0.3s ease;
  border-radius: 4px;
}

.bb-strength-fill.weak {
  width: 25%;
  background: #ef4444;
}

.bb-strength-fill.fair {
  width: 50%;
  background: #f59e0b;
}

.bb-strength-fill.good {
  width: 75%;
  background: #eab308;
}

.bb-strength-fill.strong {
  width: 100%;
  background: #22c55e;
}

.bb-strength-text {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.bb-strength-text.weak {
  color: #ef4444;
}

.bb-strength-text.fair {
  color: #f59e0b;
}

.bb-strength-text.good {
  color: #eab308;
}

.bb-strength-text.strong {
  color: #22c55e;
}

.bb-strength-feedback {
  font-size: 11px;
  color: #6b7280;
  line-height: 1.4;
}

.bb-field-valid {
  border-color: #22c55e !important;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1) !important;
}

.bb-field-invalid {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.bb-field-error {
  color: #dc2626;
  font-size: 12px;
  margin-top: 4px;
}

.bb-notification-info .bb-notification-content {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.bb-notification-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.bb-notification-message {
  flex: 1;
  line-height: 1.4;
}

.bb-notification-close {
  background: none;
  border: none;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bb-notification-close:hover {
  opacity: 1;
}

.bb-dropdown {
  position: relative;
  display: inline-block;
}

.bb-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  min-width: 160px;
  z-index: 10;
  display: none;
}

.bb-dropdown-menu.show {
  display: block;
}

.bb-dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 16px;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
  transition: background-color 0.2s;
}

.bb-dropdown-item:hover {
  background-color: #f3f4f6;
}

.bb-dropdown-item:first-child {
  border-radius: 5px 5px 0 0;
}

.bb-dropdown-item:last-child {
  border-radius: 0 0 5px 5px;
}

.bb-dropdown-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 6px 0;
}

.bb-analysis-section {
  background: white;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.bb-analysis-card {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 12px;
  background: #fafbfc;
}

.bb-analysis-card:last-child {
  margin-bottom: 0;
}

.bb-analysis-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.bb-analysis-url {
  font-family: "Monaco", "Consolas", monospace;
  font-size: 0.9rem;
  font-weight: 500;
  color: #1f2937;
  word-break: break-all;
}

.bb-analysis-metric {
  font-size: 0.9rem;
  color: #6b7280;
  white-space: nowrap;
}

.bb-analysis-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #9ca3af;
}

.bb-analysis-domain {
  color: #059669;
  font-weight: 500;
}

.bb-redirect-url {
  font-family: "Monaco", "Consolas", monospace;
  font-size: 0.85rem;
  color: #dc2626;
  word-break: break-all;
  margin-top: 4px;
}

.bb-analysis-empty {
  text-align: center;
  color: #6b7280;
  font-style: italic;
  padding: 32px 16px;
}

.bb-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  margin-left: 0.2em;
  margin-top: -0.7em;
  color: #6b7280;
  cursor: help;
  user-select: none;
  transition: color 0.2s;
  vertical-align: middle;
  line-height: 0;
}

.bb-info-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  fill: currentColor;
}

.bb-info-icon:hover {
  color: #2563eb;
}

.bb-tooltip-popup {
  position: fixed;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  max-width: 360px;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  z-index: 10000;
  font-size: 14px;
  line-height: 1.6;
  color: #374151;
}

.bb-tooltip-popup a {
  color: #2563eb;
  text-decoration: underline;
}

.bb-tooltip-popup a:hover {
  color: #1d4ed8;
}

.bb-tooltip-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
}

.bb-tooltip-close:hover {
  color: #374151;
}

.bb-btn:hover {
  background: #f3f4f6;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes progressPulse {
  0%,
  100% {
    opacity: 1;
    transform: scaleY(1);
  }
  50% {
    opacity: 0.8;
    transform: scaleY(0.95);
  }
}

/* CLI Login */
body.page-cli-auth {
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  color: #e5ecff;
  background: radial-gradient(circle at top, #101a32 0%, #050913 60%);
}

body.page-cli-auth * {
  box-sizing: border-box;
}

body.page-cli-auth {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

body.page-cli-auth main {
  width: min(720px, 100%);
  background: rgba(7, 11, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 32px;
  box-shadow: 0 30px 80px rgba(5, 9, 19, 0.5);
}

body.page-cli-auth h1 {
  margin-top: 0;
  font-size: 1.75rem;
}

body.page-cli-auth ol {
  margin: 16px 0 0;
  padding-left: 20px;
  color: rgba(229, 236, 255, 0.8);
}

body.page-cli-auth .status {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 12px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #a5ffc3;
}

body.page-cli-auth .status.error {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.3);
  color: #ffc0c0;
}

body.page-cli-auth #authModalContainer {
  margin-top: 28px;
}

body.page-cli-auth .reopen-button {
  margin-top: 16px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #cfe0ff;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.95rem;
}

body.page-cli-auth .reopen-button:hover {
  background: rgba(59, 130, 246, 0.25);
}

/* Homepage */
body.page-homepage * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.page-homepage {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

body.page-homepage .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

body.page-homepage .header {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

body.page-homepage .header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

body.page-homepage .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
}

body.page-homepage .logo:hover {
  color: white;
}

body.page-homepage .header-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

body.page-homepage .nav-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

body.page-homepage .nav-link:hover {
  color: white;
}

body.page-homepage .hero {
  padding: 80px 0 120px;
  text-align: center;
  color: white;
}

body.page-homepage .hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 24px;
  line-height: 1.1;
}

body.page-homepage .hero .subtitle {
  font-size: 1.5rem;
  margin-bottom: 16px;
  opacity: 0.9;
}

body.page-homepage .hero .description {
  font-size: 1.125rem;
  margin-bottom: 48px;
  opacity: 0.8;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

body.page-homepage .conversion-form {
  background: white;
  border-radius: 16px;
  padding: 48px;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 600px;
  margin: 0 auto 80px;
}

body.page-homepage .form-title {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #1a1a1a;
  text-align: center;
}

body.page-homepage .form-subtitle {
  color: #6b7280;
  text-align: center;
  margin-bottom: 32px;
  font-size: 1.125rem;
}

body.page-homepage .domain-form {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}

body.page-homepage .domain-input {
  flex: 1;
  padding: 16px 20px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-size: 18px;
  background: #f9fafb;
  transition: all 0.2s ease;
}

body.page-homepage .domain-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: white;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

body.page-homepage .cta-button {
  padding: 16px 32px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

body.page-homepage .cta-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

body.page-homepage .form-note {
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}

body.page-homepage .form-note a {
  color: #3b82f6;
  text-decoration: none;
}

body.page-homepage .form-note a:hover {
  text-decoration: underline;
}

body.page-homepage .features {
  background: white;
  padding: 80px 0;
}

body.page-homepage .features h2 {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: #1a1a1a;
}

body.page-homepage .features-subtitle {
  text-align: center;
  font-size: 1.125rem;
  color: #6b7280;
  margin-bottom: 64px;
}

body.page-homepage .features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 48px;
}

body.page-homepage .feature {
  text-align: center;
}

body.page-homepage .feature-icon {
  font-size: 3rem;
  margin-bottom: 24px;
}

body.page-homepage .feature h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: #1a1a1a;
}

body.page-homepage .feature p {
  color: #6b7280;
  line-height: 1.7;
}

body.page-homepage .social-proof {
  background: #f9fafb;
  padding: 64px 0;
  text-align: center;
}

body.page-homepage .social-proof h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 32px;
  color: #1a1a1a;
}

body.page-homepage .stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  max-width: 800px;
  margin: 0 auto;
}

body.page-homepage .stat {
  background: white;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body.page-homepage .stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: #3b82f6;
  margin-bottom: 8px;
}

body.page-homepage .stat-label {
  color: #6b7280;
  font-weight: 500;
}

body.page-homepage .final-cta {
  background: linear-gradient(135deg, #1f2937, #111827);
  padding: 80px 0;
  text-align: center;
  color: white;
}

body.page-homepage .final-cta h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 24px;
}

body.page-homepage .final-cta p {
  font-size: 1.25rem;
  margin-bottom: 48px;
  opacity: 0.9;
}

@media (max-width: 768px) {
  body.page-homepage .hero h1 {
    font-size: 2.5rem;
  }

  body.page-homepage .hero .subtitle {
    font-size: 1.25rem;
  }

  body.page-homepage .conversion-form {
    padding: 32px 24px;
    margin: 0 16px 60px;
  }

  body.page-homepage .domain-form {
    flex-direction: column;
  }

  body.page-homepage .domain-input,
  body.page-homepage .cta-button {
    width: 100%;
  }

  body.page-homepage .features-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  body.page-homepage .stats {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Dashboard */
body.page-dashboard {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--color-background);
  min-height: 100vh;
}

body.page-dashboard .page-header {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 24px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body.page-dashboard .page-header .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

body.page-dashboard .page-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
}

body.page-dashboard .bee-icon {
  font-size: 1.8rem;
}

body.page-dashboard .page-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}

body.page-dashboard .nav-link {
  color: #6b7280;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

body.page-dashboard .nav-link:hover,
body.page-dashboard .nav-link.active {
  color: #3b82f6;
}

body.page-dashboard .user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.global-nav .auth-buttons {
  display: flex;
  gap: 8px;
}

body.page-dashboard .user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

body.page-dashboard .user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #3b82f6;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

body.page-dashboard .main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

body.page-dashboard .dashboard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.page-dashboard .dashboard-filters {
  display: flex;
  gap: 16px;
  align-items: center;
}

body.page-dashboard .filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

body.page-dashboard .filter-label {
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

body.page-dashboard .filter-select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  color: #374151;
}

body.page-dashboard .filter-select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

body.page-dashboard .filter-tabs {
  display: flex;
  gap: 8px;
  align-items: center;
}

body.page-dashboard .filter-tab {
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  color: #6b7280;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid #d1d5db;
}

body.page-dashboard .filter-tab:hover {
  background-color: #f3f4f6;
  border-color: #9ca3af;
}

body.page-dashboard .filter-tab.active {
  background-color: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

body.page-dashboard .page-actions {
  display: flex;
  gap: 12px;
}

body.page-dashboard .status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #6b7280;
}

body.page-dashboard .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse 2s infinite;
}

body.page-dashboard .job-running {
  border-left: 4px solid #3b82f6;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

body.page-dashboard .job-completed {
  border-left: 4px solid #22c55e;
}

body.page-dashboard .job-failed {
  border-left: 4px solid #ef4444;
}

body.page-dashboard .job-cancelled {
  border-left: 4px solid #6b7280;
  opacity: 0.7;
}

body.page-dashboard .progress-pulsing {
  animation: progressPulse 2s ease-in-out infinite;
}

body.page-dashboard .loading {
  color: #6b7280;
  font-style: italic;
}

@media (max-width: 768px) {
  body.page-dashboard .page-header .container {
    padding: 0 16px;
  }

  body.page-dashboard .page-nav {
    display: none;
  }

  body.page-dashboard .main-content {
    padding: 16px;
  }

  body.page-dashboard .dashboard-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  body.page-dashboard .dashboard-filters {
    justify-content: space-between;
  }

  body.page-dashboard .page-actions {
    justify-content: center;
  }
}

/* Settings */

body.page-settings .bb-button {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

body.page-settings .bb-button-primary {
  background: #3b82f6;
  color: white;
}

body.page-settings .bb-button-primary:hover {
  background: #2563eb;
}

body.page-settings .bb-button-outline {
  background: transparent;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

body.page-settings .bb-button-outline:hover {
  border-color: #9ca3af;
  color: #374151;
}

body.page-settings .bb-button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

body.page-settings .bb-org-switcher {
  position: relative;
  display: inline-flex;
}

body.page-settings .bb-org-button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
}

body.page-settings .bb-org-button:hover {
  border-color: #cbd5f5;
  color: #1d4ed8;
}

body.page-settings .bb-org-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  min-width: 220px;
  display: none;
  z-index: 200;
}

body.page-settings .bb-org-switcher.open .bb-org-dropdown {
  display: block;
}

body.page-settings .bb-org-dropdown-header {
  padding: 10px 12px;
  font-size: 12px;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

body.page-settings .bb-org-list {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.page-settings .bb-org-item {
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  color: #374151;
}

body.page-settings .bb-org-item:hover {
  background: #f8fafc;
  border-color: #e5e7eb;
}

body.page-settings .bb-org-item.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

body.page-settings .bb-org-dropdown-footer {
  border-top: 1px solid #e5e7eb;
  padding: 8px;
}

body.page-settings .bb-org-create-btn {
  width: 100%;
  background: #f3f4f6;
  border: 1px dashed #d1d5db;
  color: #374151;
  padding: 8px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

body.page-settings .bb-org-divider {
  color: #cbd5e1;
}

.settings-main {
  padding: 32px 0 48px;
}

.settings-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}

.settings-nav {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  height: fit-content;
  position: sticky;
}

.settings-group {
  margin-bottom: 24px;
}

.settings-group-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin-bottom: 12px;
}

.settings-org-switcher {
  width: 100%;
  text-align: left;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  margin-bottom: 12px;
}

.settings-link {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 4px;
}

.settings-link:hover,
.settings-link.active {
  background: #eff6ff;
  color: #1d4ed8;
}

.settings-link--danger {
  color: var(--color-error);
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  width: 100%;
  text-align: left;
}

.settings-link--danger:hover {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.settings-section {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
}

html[data-settings-section] .settings-section {
  display: none;
}

html[data-settings-section="account"] #account,
html[data-settings-section="team"] #team,
html[data-settings-section="plans"] #plans,
html[data-settings-section="billing"] #billing,
html[data-settings-section="notifications"] #notifications,
html[data-settings-section="analytics"] #analytics,
html[data-settings-section="automated-jobs"] #automated-jobs {
  display: block;
}

.settings-section-title {
  margin: 0 0 6px 0;
  font-size: 20px;
  color: #1f2937;
}

.settings-section-subtitle {
  margin: 0 0 20px 0;
  color: #6b7280;
  font-size: 14px;
}

.settings-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  background: #f9fafb;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-muted {
  color: #6b7280;
  font-size: 13px;
}

.settings-profile-edit {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.settings-profile-edit .settings-input {
  min-width: 260px;
}

.settings-member-row,
.settings-invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #e5e7eb;
}

.settings-member-row:last-child,
.settings-invite-row:last-child {
  border-bottom: none;
}

.settings-member-details {
  display: flex;
  gap: 10px;
  align-items: center;
}

.settings-invite-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-member-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-member-name,
.settings-invite-email {
  font-weight: 600;
  color: #1f2937;
}

.settings-member-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #dbeafe;
  color: #1d4ed8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}

.settings-member-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.settings-member-email,
.settings-invite-date {
  font-size: 12px;
  color: #6b7280;
}

.settings-member-role,
.settings-invite-role {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1d4ed8;
}

.settings-member-role-select {
  width: 120px;
  text-transform: capitalize;
}

.settings-auth-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.settings-auth-method-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px 12px;
}

.settings-auth-method-details {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-auth-method-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settings-auth-provider-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid #d1d5db;
  background: #ffffff;
  overflow: hidden;
}

.settings-auth-provider-icon img {
  width: 18px;
  height: 18px;
  display: block;
}

.settings-auth-provider-azure img {
  width: 19px;
  height: 19px;
}

.settings-auth-fallback-icon {
  font-size: 14px;
  line-height: 1;
  color: #6b7280;
}

.settings-invite-actions {
  display: flex;
  gap: var(--spacing-sm);
  flex-shrink: 0;
}

.settings-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.settings-tabs {
  display: inline-flex;
  gap: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 4px;
  background: #f9fafb;
  margin-bottom: 16px;
}

.settings-tab {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: #4b5563;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.settings-tab.active {
  background: #111827;
  color: #f9fafb;
}

.settings-tab-panel {
  display: none;
}

.settings-tab-panel.active {
  display: block;
}

.settings-plan-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  background: #ffffff;
}

.settings-plan-card.current {
  border-color: #93c5fd;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.15);
}

.settings-plan-name {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 4px;
}

.settings-plan-price {
  font-size: 14px;
  color: #2563eb;
  margin-bottom: 8px;
}

.settings-plan-limit {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 12px;
}

.settings-usage-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #e5e7eb;
  font-size: 13px;
  color: #374151;
}

.settings-usage-row:last-child {
  border-bottom: none;
}

body.page-settings .bb-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

body.page-settings .bb-modal.show {
  display: flex;
}

body.page-settings .bb-modal-content {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

body.page-settings .bb-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

body.page-settings .bb-modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

body.page-settings .bb-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #6b7280;
  cursor: pointer;
}

body.page-settings .bb-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 24px 0;
}

body.page-settings .bb-form-input,
body.page-settings .settings-input {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

body.page-settings .bb-auth-error {
  margin: 12px 24px 20px;
  color: #dc2626;
  font-size: 13px;
}

/* Toggle switch base styles */
body.page-settings .bb-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

body.page-settings .bb-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

body.page-settings .bb-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 22px;
}

body.page-settings .bb-toggle input:checked + .bb-toggle-slider {
  background-color: var(--color-primary);
}

body.page-settings .bb-toggle input:checked + .bb-toggle-slider:before {
  transform: translateX(18px);
}

body.page-settings .bb-toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

/* Settings utility classes */
.settings-hidden {
  display: none;
}

.settings-row--borderless {
  border-bottom: none;
}

/* Settings invite form grid */
.settings-invite-grid {
  display: grid;
  grid-template-columns: 1fr 140px auto;
  gap: 12px;
  align-items: end;
}

@media (width <= 900px) {
  .settings-profile-edit {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-profile-edit .settings-input {
    min-width: 0;
  }

  .settings-member-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }
}

.settings-spacing-top {
  margin-top: 12px;
}

.settings-spacing-top-md {
  margin-top: 16px;
}

/* Settings section header with icon */
.settings-section-header {
  margin-top: 0;
  display: flex;
  gap: 8px;
  align-items: center;
}

.settings-section-icon {
  font-size: 20px;
}

/* Settings empty state */
.settings-empty-state {
  text-align: center;
  padding: 24px;
  background: #f9fafb;
  border-radius: 8px;
  border: 2px dashed var(--color-border);
}

.settings-empty-state--compact {
  padding: 16px 24px;
  margin-bottom: 16px;
}

.settings-empty-text {
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.settings-empty-text--no-margin {
  margin: 0;
}

/* Settings notification banners */
.settings-notification {
  display: none;
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
}

.settings-notification--success {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

.settings-notification--error {
  background: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid var(--color-error-border);
}

.settings-notification--compact {
  padding: 12px;
}

/* Settings button with icon */
.settings-btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.settings-btn-icon--spaced {
  margin-bottom: 16px;
}

/* Settings connection row */
.settings-connection-name {
  font-weight: 600;
}

.settings-connection-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Settings property selection panel */
.settings-property-panel {
  display: none;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  padding: 16px;
  margin-bottom: 16px;
}

.settings-property-title {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #374151;
}

.settings-property-subtitle {
  color: var(--color-text-muted);
  font-size: 13px;
  margin-bottom: 12px;
}

/* Settings sites config panel */
.settings-sites-panel {
  display: none;
  margin-top: 20px;
  background: #f9fafb;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 16px;
}

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

.settings-sites-title {
  margin: 0;
  font-size: 15px;
  color: #374151;
}

.settings-sites-search {
  display: none;
  margin-bottom: 12px;
}

.settings-sites-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

/* Settings site row */
.settings-site-row {
  display: none;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
}

.settings-site-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-site-info {
  flex: 1;
  min-width: 150px;
}

.settings-site-name {
  font-weight: 500;
  font-size: 14px;
}

.settings-site-domain {
  color: var(--color-text-muted);
  font-size: 12px;
  margin-left: 8px;
}

.settings-site-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-site-control-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-site-label {
  font-size: 12px;
  color: var(--color-text-muted);
}

.settings-site-select {
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 13px;
  background: var(--color-white);
  cursor: pointer;
}

.settings-site-status {
  display: none;
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* Settings sites loading/empty states */
.settings-sites-loading,
.settings-sites-empty {
  text-align: center;
  padding: 20px;
  color: var(--color-text-muted);
}

.settings-sites-empty {
  display: none;
}

/* Settings sites pagination */
.settings-sites-pagination {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.settings-pagination-btn {
  font-size: 12px;
  padding: 4px 12px;
}

.settings-pagination-btn--prev {
  margin-right: 8px;
}

.settings-pagination-btn--next {
  margin-left: 8px;
}

.settings-pagination-info {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0 8px;
}

/* Settings small button */
.settings-btn-sm {
  font-size: 12px;
  padding: 4px 10px;
}

/* Settings modal actions */
.settings-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding: 0 24px 20px;
}

/* Settings modal narrow variant */
.settings-modal-narrow {
  max-width: 440px;
}

@media (max-width: 960px) {
  .settings-container {
    grid-template-columns: 1fr;
  }

  .settings-nav {
    position: static;
  }
}

/* Shared page base styles */
body.page-dashboard,
body.page-settings,
body.page-job-details {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--color-background);
  min-height: 100vh;
}

/* Job Details */
body.page-job-details {
  color-scheme: light;
}

body.page-job-details {
  color: #1f2937;
}

body.page-job-details a {
  color: inherit;
}

body.page-job-details .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #6b7280;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

body.page-job-details .back-link:hover {
  color: #2563eb;
}

body.page-job-details .user-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

body.page-job-details .share-panel {
  margin: 16px 0 0;
  padding: 16px 18px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

body.page-job-details .share-panel .share-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

body.page-job-details .share-panel .share-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #1d4ed8;
  font-weight: 600;
}

body.page-job-details .share-panel a {
  color: #1d4ed8;
  font-weight: 600;
  word-break: break-word;
}

body.page-job-details main {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

body.page-job-details section {
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  padding: 24px;
}

body.page-job-details section header {
  border: none;
  position: static;
  padding: 0;
}

body.page-job-details .section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

body.page-job-details .section-title h2 {
  margin: 0;
  font-size: 20px;
}

body.page-job-details .overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

body.page-job-details .info-card {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  background: #f9fafb;
}

body.page-job-details .info-card h3 {
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
}

body.page-job-details .info-card p {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  word-break: break-word;
}

body.page-job-details .stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

body.page-job-details .stats-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.page-job-details .stats-group h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

body.page-job-details .stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 13px;
}

body.page-job-details .tasks-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

body.page-job-details .filter-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  background: #f3f4f6;
  padding: 4px;
}

body.page-job-details .filter-tabs button {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  color: #6b7280;
}

body.page-job-details .filter-tabs button.active {
  background: white;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
  color: #1f2937;
}

body.page-job-details table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

body.page-job-details .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

body.page-job-details .page-header-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

body.page-job-details thead th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #6b7280;
  text-align: left;
  padding: 12px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  cursor: pointer;
  user-select: none;
}

body.page-job-details tbody td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  vertical-align: top;
}

body.page-job-details tbody tr:hover {
  background: #f8fafc;
}

body.page-job-details code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
}

body.page-job-details .status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

body.page-job-details .status-pill.completed {
  background: #dcfce7;
  color: #15803d;
}

body.page-job-details .status-pill.failed {
  background: #fee2e2;
  color: #dc2626;
}

body.page-job-details .status-pill.pending,
body.page-job-details .status-pill.running {
  background: #dbeafe;
  color: #1d4ed8;
}

body.page-job-details .status-pill.cancelled {
  background: #f3f4f6;
  color: #4b5563;
}

body.page-job-details .pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
}

body.page-job-details .toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #111827;
  color: white;
  padding: 12px 16px;
  border-radius: 6px;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.15);
  z-index: 1000;
  font-size: 14px;
}

@media (max-width: 768px) {
  body.page-job-details main {
    padding: 0 16px 32px;
  }
}
