/* ================================================================
   app.css — Agency Brain V0.1
   App-specific styles that build ON TOP of style.css tokens.
   style.css is loaded first, so all --variables are available here.
   ================================================================ */

/* ── Body override: remove the marketing-page background canvas ── */
.app-body {
  background-color: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

.app-body.workspace-auth-pending .app-shell {
  pointer-events: none;
}

.app-body.workspace-auth-redirecting .app-shell {
  visibility: hidden;
  pointer-events: none;
}

/* ── Shell: full-height flex column ─────────────────────────────── */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ════════════════════════════════════════════════════════════
   TOP NAV
════════════════════════════════════════════════════════════ */
.app-topnav {
  position: sticky;
  top: 0;
  z-index: 999;
  background-color: rgba(7, 4, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.app-topnav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 100%;
  margin: 0;
  padding: 0 16px;
  gap: 16px;
}

.app-logo { flex-shrink: 0; }

.app-topnav-brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* Conventional compact sidebar toggle, matching the controls used by most web apps. */
.workspace-sidebar-toggle {
  display: none;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.workspace-sidebar-toggle svg { display: none; }

.workspace-sidebar-toggle::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 -6px currentColor, 0 6px currentColor;
}

.workspace-sidebar-toggle:hover,
.workspace-sidebar-toggle:focus-visible {
  color: var(--text-primary);
  background: rgba(139, 92, 246, .08);
  border-color: var(--accent);
  outline: none;
}

/* Desktop nav buttons in the centre */
.app-topnav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.app-nav-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.app-nav-btn:hover {
  color: var(--text-primary);
  background-color: rgba(139, 92, 246, 0.08);
}

.app-nav-btn.active {
  color: var(--text-primary);
  background-color: rgba(139, 92, 246, 0.12);
}

/* Right side: user avatar + hamburger */
.app-topnav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.app-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: var(--accent);
  background-image: linear-gradient(135deg, var(--accent-light), var(--accent));
  border: 1px solid rgba(221, 214, 254, 0.55);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  cursor: default;
  flex-shrink: 0;
}

.app-user-avatar-dropdown {
  width: 36px;
  height: 36px;
  font-size: 12px;
  cursor: default;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  color: #fff;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}
.profile-menu-item:hover { background: rgba(255,255,255,0.1); }

/* Personalization is temporarily disabled until its content is implemented. */
.profile-menu-item[onclick*="openVoxPersonalization"] { display: none !important; }
.profile-menu-divider { height: 1px; margin: 8px 0; background: rgba(167,139,250,0.18); }

/* Hamburger button — only shown on smaller screens */
.app-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

/* Mobile dropdown nav */
.app-mobile-nav {
  display: none;
  flex-direction: column;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background-color: rgba(7, 4, 15, 0.98);
  border-top: 1px solid rgba(139, 92, 246, 0.1);
}

.app-mobile-nav.is-open {
  max-height: 300px;
}

.app-mobile-nav-link {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(139, 92, 246, 0.07);
  padding: 16px 24px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.app-mobile-nav-link:last-child { border-bottom: none; }

.app-mobile-nav-link:hover,
.app-mobile-nav-link.active {
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.06);
}

/* ════════════════════════════════════════════════════════════
   MAIN CONTENT AREA
════════════════════════════════════════════════════════════ */
.app-main {
  flex: 1;
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

/* ════════════════════════════════════════════════════════════
   PAGE HEADER (used on Home, Workspace, Profile pages)
════════════════════════════════════════════════════════════ */
.ab-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.ab-page-header-left { flex: 1; min-width: 0; }

.ab-greeting {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 6px;
}

.ab-subheading {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.ab-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════
   STAT CARDS (Home overview)
════════════════════════════════════════════════════════════ */
.ab-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.ab-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  transition: border-color 0.2s ease;
}

.ab-stat-card:hover { border-color: var(--border-mid); }

.ab-stat-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 8px;
}

.ab-stat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ab-stat-icon {
  font-size: 20px;
  margin-bottom: 12px;
  display: block;
}

/* ════════════════════════════════════════════════════════════
   SECTION CARD (generic labelled card wrapper)
════════════════════════════════════════════════════════════ */
.ab-section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.ab-section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.ab-section-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.ab-section-card-body { padding: 20px 24px; }

/* ════════════════════════════════════════════════════════════
   RECENT ACTIVITY LIST (Home)
════════════════════════════════════════════════════════════ */
.ab-activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ab-activity-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.ab-activity-item:last-child { border-bottom: none; }

.ab-activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.ab-activity-dot.fuchsia { background: var(--fuchsia); }
.ab-activity-dot.green   { background: #22c55e; }

.ab-activity-text {
  flex: 1;
  min-width: 0;
}

.ab-activity-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.ab-activity-action {
  font-size: 13px;
  color: var(--text-secondary);
}

.ab-activity-time {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════
   SEARCH BAR (Workspace)
════════════════════════════════════════════════════════════ */
.ab-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.ab-search-input-wrap {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.ab-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  pointer-events: none;
  color: var(--text-muted);
}

.ab-search-input {
  width: 100%;
  padding: 11px 16px 11px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease;
}

.ab-search-input::placeholder { color: var(--text-muted); }

.ab-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ════════════════════════════════════════════════════════════
   CLIENT CARDS GRID (Workspace)
════════════════════════════════════════════════════════════ */
.ab-clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.ab-client-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  cursor: default;
}

.ab-client-card:hover {
  border-color: var(--border-mid);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.08);
  transform: translateY(-2px);
}

.ab-client-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ab-client-initials {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.ab-client-info { flex: 1; min-width: 0; }

.ab-client-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ab-client-industry {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.ab-client-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ab-client-meta-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border-mid);
  flex-shrink: 0;
}

/* Empty state */
.ab-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 15px;
  grid-column: 1 / -1;
}

.ab-empty-state-icon {
  font-size: 40px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* ════════════════════════════════════════════════════════════
   CLIENT PROFILE
════════════════════════════════════════════════════════════ */
.ab-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-bottom: 28px;
  transition: color 0.15s ease;
}

.ab-back-btn:hover { color: var(--text-primary); }


.ab-profile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.ab-profile-header-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.ab-profile-initials {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.ab-profile-name {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.ab-profile-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.ab-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: var(--accent-light);
}

/* Two-column profile layout on desktop */
.ab-profile-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

.ab-profile-left { display: flex; flex-direction: column; gap: 20px; }
.ab-profile-right { display: flex; flex-direction: column; gap: 20px; }

/* Info row inside a card */
.ab-info-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.ab-info-row:last-child { border-bottom: none; padding-bottom: 0; }

.ab-info-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.ab-info-value {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

.ab-info-value a {
  color: var(--accent-light);
  text-decoration: underline;
  text-decoration-color: rgba(139,92,246,0.3);
}

/* Content sample cards */
.ab-sample-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ab-sample-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.ab-sample-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.ab-sample-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.ab-sample-type {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(217, 70, 239, 0.1);
  border: 1px solid rgba(217, 70, 239, 0.2);
  color: #d946ef;
  white-space: nowrap;
  flex-shrink: 0;
}

.ab-sample-preview {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Placeholder / coming soon box */
.ab-placeholder-box {
  background: var(--surface-2);
  border: 1px dashed var(--border-mid);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
}

.ab-placeholder-box-icon {
  font-size: 28px;
  margin-bottom: 10px;
  opacity: 0.5;
}

.ab-placeholder-box-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.ab-placeholder-box-sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* ════════════════════════════════════════════════════════════
   SETTINGS PAGE
════════════════════════════════════════════════════════════ */
.ab-settings-layout {
  max-width: 600px;
}

.ab-settings-section {
  margin-bottom: 32px;
}

.ab-settings-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ════════════════════════════════════════════════════════════
   MODALS
════════════════════════════════════════════════════════════ */
.app-shell .ab-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.app-shell .ab-modal-backdrop.is-open {
  display: flex;
}

.app-shell .ab-modal {
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(139, 92, 246, 0.1);
}

.app-shell .ab-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
}

.app-shell .ab-modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.app-shell .ab-modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.15);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.app-shell .ab-modal-close:hover {
  background: rgba(139, 92, 246, 0.15);
  color: var(--text-primary);
}

.app-shell .ab-modal-body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.app-shell .ab-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
}

/* ════════════════════════════════════════════════════════════
   FORM ELEMENTS
════════════════════════════════════════════════════════════ */
.app-shell .ab-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-shell .ab-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.ab-required { color: var(--fuchsia); }

.app-shell .ab-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 44px;
}

.app-shell .ab-input::placeholder { color: var(--text-muted); }

.app-shell .ab-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: var(--surface);
}

.ab-textarea { resize: vertical; min-height: 88px; height: auto; line-height: 1.5; }
.ab-textarea-lg { min-height: 160px; }

.ab-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23A78BFA' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.ab-form-error {
  font-size: 13px;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .ab-profile-body {
    grid-template-columns: 1fr;
  }
  .ab-profile-right {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .ab-profile-right > * { flex: 1; min-width: 260px; }
}

@media (max-width: 768px) {
  /* Show hamburger, hide desktop nav */
  .app-topnav-links { display: none; }
  .app-hamburger { display: flex; }
  .app-mobile-nav { display: flex; }

  .app-main { padding: 28px 16px 48px; }

  .ab-stats-row { grid-template-columns: 1fr 1fr; }

  .ab-page-header { flex-direction: column; align-items: flex-start; }
  .ab-page-actions { width: 100%; }
  .ab-page-actions .btn { flex: 1; justify-content: center; }

  .ab-profile-header { flex-direction: column; }
  .ab-profile-header .ab-page-actions { width: 100%; }

  .app-shell .ab-modal { border-radius: var(--radius-lg); }
  .app-shell .ab-modal-header,
  .app-shell .ab-modal-body { padding-left: 20px; padding-right: 20px; }
}

@media (max-width: 480px) {
  .ab-stats-row { grid-template-columns: 1fr; }
  .ab-clients-grid { grid-template-columns: 1fr; }
  .ab-greeting { font-size: 22px; }
  .ab-stat-value { font-size: 28px; }
  .ab-profile-right { flex-direction: column; }
  .ab-profile-right > * { min-width: 0; }
}

/* ================================================================
   LIGHT MODE OVERRIDES FOR WORKSPACE
   ================================================================ */
[data-theme="light"] .app-topnav {
  background-color: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .app-mobile-nav {
  background-color: #F8F9FA;
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .app-nav-btn:hover {
  background-color: rgba(139, 92, 246, 0.1);
}
[data-theme="light"] .app-nav-btn.active {
  background-color: rgba(139, 92, 246, 0.15);
}
[data-theme="light"] .ab-search-input {
  background-color: var(--surface);
}

/* ================================================================
   WORKSPACE LAYERED FEEL (Dark & Light Mode 3D Elevation)
   ================================================================ */

/* 1. DARK MODE: Gradient surface + Inner rim + Deep outer shadows */
.ab-client-card, .ab-stat-card, .app-shell .ab-modal, .ab-activity-feed {
  background: linear-gradient(180deg, rgba(30, 25, 45, 0.8) 0%, rgba(14, 10, 26, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.4),
    0 20px 40px -10px rgba(0, 0, 0, 0.6),
    inset 0 1px 1px rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateY(0);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* 2. LIGHT MODE: Crisp gradient + White inner bevel + Soft large shadows */
[data-theme="light"] .ab-client-card, 
[data-theme="light"] .ab-stat-card, 
[data-theme="light"] .app-shell .ab-modal,
[data-theme="light"] .ab-activity-feed {
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 
    0 10px 30px -10px rgba(15, 23, 42, 0.08),
    0 4px 10px rgba(15, 23, 42, 0.04),
    inset 0 2px 4px rgba(255, 255, 255, 1); /* Premium 3D Bevel */
}

/* 3. HOVER ELEVATION (Both Modes) - only apply hover to interactive elements */
.ab-client-card:hover {
  transform: translateY(-6px);
  border-color: rgba(139, 92, 246, 0.3);
}

/* Dark Mode Hover Shadows */
.ab-client-card:hover {
  box-shadow: 
    0 10px 15px -3px rgba(0, 0, 0, 0.5),
    0 30px 60px -15px rgba(0, 0, 0, 0.8),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

/* Light Mode Hover Shadows */
[data-theme="light"] .ab-client-card:hover {
  box-shadow: 
    0 20px 40px -10px rgba(15, 23, 42, 0.12),
    0 8px 16px rgba(15, 23, 42, 0.06),
    inset 0 2px 4px rgba(255, 255, 255, 1);
  border-color: rgba(139, 92, 246, 0.3);
}

/* -----------------------------------------------------------------------------
   LIGHT MODE OVERRIDES FOR WORKSPACE
----------------------------------------------------------------------------- */
[data-theme="light"] .app-topnav {
  background-color: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}
[data-theme="light"] .app-mobile-nav-panel {
  background-color: rgba(255, 255, 255, 0.98);
  border-top: 1px solid rgba(15, 23, 42, 0.1);
}
[data-theme="light"] .app-sidebar {
  background: rgba(255, 255, 255, 0.5);
  border-right: 1px solid rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .ab-layout-left::after {
  background: linear-gradient(to right, rgba(248, 250, 252, 1) 0%, rgba(248, 250, 252, 0) 100%);
}
[data-theme="light"] .ab-layout-right::before {
  background: linear-gradient(to left, rgba(248, 250, 252, 1) 0%, rgba(248, 250, 252, 0) 100%);
}
[data-theme="light"] .app-shell .ab-modal-backdrop {
  background: rgba(15, 23, 42, 0.4);
}
[data-theme="light"] .app-shell .ab-modal {
  background: #FFFFFF;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.1);
}
[data-theme="light"] .app-shell .ab-input,
[data-theme="light"] .app-shell .ab-select,
[data-theme="light"] .app-shell .ab-textarea {
  background: rgba(15, 23, 42, 0.02);
  border: 1px solid rgba(15, 23, 42, 0.15);
  color: #020617;
}

/* The shared auth component stays unchanged; workspace only gives it a lifted layer. */
body.app-body #modal-public-login .ab-modal {
  background: linear-gradient(180deg, #30234d 0%, #181127 100%) !important;
  border: 1px solid rgba(167, 139, 250, 0.48) !important;
  box-shadow: 0 32px 72px rgba(0, 0, 0, 0.68), 0 0 0 1px rgba(139, 92, 246, 0.18), 0 0 28px rgba(139, 92, 246, 0.16) !important;
}

body.app-body #modal-public-login {
  background: rgba(7, 4, 15, 0.24);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

body.app-body #modal-public-login .ab-input {
  background: rgba(78, 52, 120, 0.42) !important;
  border-color: rgba(196, 181, 253, 0.38) !important;
}

#modal-public-login #btn-public-cancel,
#modal-public-login #btn-public-cancel:hover,
#modal-public-login #btn-public-cancel:active,
#modal-public-login #btn-public-cancel:focus,
#modal-public-login #btn-public-cancel:focus-visible {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  color: #111827 !important;
  border-color: rgba(255, 255, 255, 0.8) !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
  filter: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
[data-theme="light"] .app-shell .ab-input:focus,
[data-theme="light"] .app-shell .ab-select:focus,
[data-theme="light"] .app-shell .ab-textarea:focus {
  background: #FFFFFF;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}
[data-theme="light"] .ab-info-row {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
[data-theme="light"] .ab-client-card {
  background: #FFFFFF;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.03);
}
[data-theme="light"] .ab-client-card-top {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
[data-theme="light"] .ab-stat-card {
  background: #FFFFFF;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.02);
}
[data-theme="light"] .app-nav-btn {
  color: var(--text-secondary);
}
[data-theme="light"] .app-nav-btn:hover {
  color: var(--text-primary);
  background-color: rgba(15, 23, 42, 0.04);
}
[data-theme="light"] .app-nav-btn.active {
  color: var(--text-primary);
  background-color: rgba(139, 92, 246, 0.1);
}

/* ─────────────────────────────────────────────────────────────────────────────
   TOAST NOTIFICATIONS
───────────────────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 32px;
  right: 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 16px;
  z-index: 9999;
}

.ab-toast {
  padding: 16px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ab-toast.show {
  opacity: 1;
  transform: translateX(0);
}

.ab-toast-success {
  background: linear-gradient(135deg, #10b981, #059669);
  border: 1px solid #047857;
}

.ab-toast-error {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border: 1px solid #b91c1c;
}

[data-theme="light"] .ab-toast {
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.2);
}
