/**
 * Dashboard CSS - Modern, Silicon Valley Grade
 * AAA Standard Design System
 *
 * NOTE: This file has grown very large (10,832+ lines) for better maintainability.
 * New CSS styles should be added to dashboard2.css instead of this file.
 * Existing styles in this file remain active and functional.
 */

/* Import Admin Panel Styles */
@import url('./admin.css');

/* Import New Styles */
@import url('./dashboard2.css');

/* ==================== DASHBOARD LAYOUT ==================== */

.dashboard-layout {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #f8fafc;
}

html.is-mobile body:has(.dashboard-layout),
html.is-mobile #app:has(.dashboard-layout) {
  overflow: hidden !important;
}

.dashboard-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  margin-left: var(--left-menu-width, 280px);
  transition: margin-left 0.3s ease;
}

@media (max-width: 768px) {
  .dashboard-main {
    margin-left: 0;
  }
}

.dashboard-header {
  position: relative;
  background: var(--bg-component);
  border-bottom: 1px solid var(--border-default);
  padding: 1.375rem 2rem; /* 22px top/bottom - reduced by 4px from 24px (1.5rem) to match menu-header */
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 100;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
  /* Calculated height: 22px (top) + 42.4px (content) + 22px (bottom) = 86.4px */
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 0;
  min-width: 0;
  margin: 0;
  flex-shrink: 0;
  overflow: hidden;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
    width: auto;
    min-width: auto;
    padding: 8px;
  }
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}


.dashboard-title-section {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.dashboard-active-business {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  line-height: 1.2;
  letter-spacing: -0.01em;
  transition: color var(--transition-normal);
}

/* Mobile: Reduce font size and add ellipsis for long business names */
@media (max-width: 768px) {
  .dashboard-active-business {
    font-size: 0.9375rem; /* 15px - reduced from 18px */
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%; /* Ensure it respects container width */
  }
}

.dashboard-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  margin: 0;
  white-space: nowrap;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dashboard-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.user-name {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  transition: color var(--transition-normal);
}

/* Desktop/Mobile visibility utilities */
.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none;
  }
  
  .mobile-only {
    display: block;
  }
}

/* User Avatar (Mobile) */
.user-avatar-container {
  position: relative;
  cursor: pointer;
}

.user-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: var(--font-semibold);
  line-height: 1;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.user-avatar-circle:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.user-avatar-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  border: 2px solid var(--border-subtle);
}

.user-avatar-logo:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.user-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-default);
  z-index: 10000;
  animation: fadeInDown 0.2s ease;
  pointer-events: none;
}

.user-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  right: 12px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--bg-tertiary);
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-content {
  flex: 1;
  padding: 2rem;
  padding-bottom: calc(2rem + 80px); /* Extra 80px for floating action buttons */
  overflow-y: auto;
  overscroll-behavior: none;
  container-type: inline-size;
  container-name: dashboard-content;
}

/* ==================== LEFT MENU ==================== */

/* CSS Custom Property for menu width (can be overridden by JavaScript) */
:root {
  --left-menu-width: 280px;
  --left-menu-min-width: 200px;
  --left-menu-max-width: 280px;
}

.left-menu {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--left-menu-width);
  min-width: var(--left-menu-min-width);
  max-width: var(--left-menu-max-width);
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height — adjusts for mobile browser chrome (address bar) */
  background: var(--bg-component);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  z-index: 200;
  box-shadow: var(--shadow-md);
  transform: translateX(0);
  transition: transform 0.3s ease, width 0.3s ease, background-color var(--transition-normal), border-color var(--transition-normal);
  overflow: visible;
}

html.ios-pwa .left-menu {
  margin-top: env(safe-area-inset-top, 0px);
  height: calc(100dvh - env(safe-area-inset-top, 0px));
}

/* Resize handle for left menu */
.left-menu-resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: ew-resize;
  background: transparent;
  z-index: 210;
  transition: background 0.2s ease;
}

.left-menu-resize-handle:hover,
.left-menu-resize-handle.dragging {
  background: var(--accent-primary);
  opacity: 0.3;
}

.left-menu-resize-handle::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 40px;
  background: var(--border-default);
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.left-menu-resize-handle:hover::after,
.left-menu-resize-handle.dragging::after {
  opacity: 1;
}

/* Collapsed menu state (desktop only) */
@media (min-width: 769px) {
  .left-menu.menu-collapsed {
    --left-menu-width: 64px;
    min-width: 64px;
    max-width: 64px;
    width: 64px;
    overflow: visible;
    /* Remove width transition when collapsed to prevent flash during route changes */
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
  }

  /* Also suppress margin-left transition on main content when menu is collapsed */
  .left-menu.menu-collapsed ~ .dashboard-main {
    margin-left: 64px;
    transition: background-color var(--transition-normal);
  }
  
  .left-menu.menu-collapsed .menu-close {
    display: none;
  }
  
  .left-menu.menu-collapsed .menu-collapse-toggle {
    display: none;
  }
  
  /* Hide business ID when collapsed */
  .left-menu.menu-collapsed .business-id-display {
    display: none;
  }
}

/* Responsive left menu - tablet sizes (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  :root {
    --left-menu-width: 240px;
  }
  
  .dashboard-main {
    margin-left: var(--left-menu-width);
  }
}

/* Mobile - menu slides out */
@media (max-width: 768px) {
  :root {
    --left-menu-width: 280px; /* Full width for mobile overlay */
  }
  
  .left-menu {
    transform: translateX(-100%);
  }
  
  .left-menu.menu-open {
    transform: translateX(0);
  }
  
  /* Hide resize handle on mobile */
  .left-menu-resize-handle {
    display: none;
  }
}

.menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 150;
}

@media (max-width: 768px) {
  .menu-overlay {
    display: block;
  }
}

.menu-header {
  padding: 1.1rem; /* 27.2px all sides - calculated to match dashboard-header total height exactly */
  border-bottom: 1px solid var(--border-default);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  transition: border-color var(--transition-normal);
  /* Calculated height: 27.2px (top) + 32px (content) + 27.2px (bottom) = 86.4px */
  /* Matches dashboard-header total height: 22px + 42.4px + 22px = 86.4px */
}

/* Collapsed menu header - center content */
.left-menu.menu-collapsed .menu-header {
  justify-content: center;
  padding: 1.1rem 0.5rem;
}

.left-menu.menu-collapsed .menu-header-brand {
  justify-content: center;
}

.menu-header-brand {
  display: flex;
  align-items: center;
  gap: 1px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: opacity var(--transition-fast);
  flex: 1;
}

.menu-header-brand:hover {
  opacity: 0.8;
}

/* Collapse toggle button - professional arrow/carrot on right edge */
.menu-collapse-toggle {
  display: none;
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background: var(--bg-component);
  border: 1px solid var(--border-default);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  z-index: 250;
  box-shadow: var(--shadow-sm);
}

.menu-collapse-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.menu-collapse-toggle svg {
  width: 12px;
  height: 12px;
}

@media (min-width: 769px) {
  .menu-collapse-toggle {
    display: flex;
  }
}

/* Hamburger icon for collapsed state */
.menu-header-hamburger {
  width: 24px;
  height: 24px;
  color: var(--text-primary);
  flex-shrink: 0;
}

/* Hide logo and h2 when collapsed */
.left-menu.menu-collapsed .menu-header-logo,
.left-menu.menu-collapsed .menu-header h2 {
  display: none;
}

.menu-header-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.menu-header h2 {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin: 0;
  padding-top: 4px;
  transition: color var(--transition-normal);
}

.menu-close {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.menu-close:hover {
  background: var(--bg-tertiary);
}

@media (max-width: 768px) {
  .menu-close {
    display: block;
  }
}

/* Business ID Display */
.business-id-display {
  padding: 0.5rem 1rem;
  margin: 5px 0.5rem 0 0.5rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
}

.business-id-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.business-id-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.business-id-visibility-btn,
.business-id-copy-btn {
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

.business-id-visibility-btn:hover,
.business-id-copy-btn:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
  opacity: 1;
}

.business-id-copy-btn.copy-success {
  color: var(--success-color);
  opacity: 1;
}

.business-id-copy-btn svg {
  transition: all 0.2s ease;
}

.business-id-label {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.business-id-value {
  font-size: 0.75rem;
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', 'Droid Sans Mono', monospace;
  color: var(--text-secondary);
  word-break: break-all;
  line-height: 1.3;
  background: transparent;
  padding: 0;
}

.business-id-masked {
  letter-spacing: 0.22em;
  font-weight: 700;
}

.left-menu-admin-access-banner {
  margin: 0 0 0.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  min-height: 42px;
  border: 1px solid rgba(245, 158, 11, 0.42);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(251, 191, 36, 0.08));
  color: #92400e;
  border-radius: 0;
  padding: 2px 0.8rem;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.left-menu-admin-access-banner:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(245, 158, 11, 0.18);
  border-color: rgba(217, 119, 6, 0.48);
}

.admin-access-banner-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.46);
  flex-shrink: 0;
}

.admin-access-banner-text {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex: 1 1 auto;
}

.admin-access-banner-action {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.75;
}

.left-menu.menu-collapsed .left-menu-admin-access-banner {
  margin-inline: 0.5rem;
  padding: 0.3rem 0;
  min-height: 52px;
  justify-content: center;
  border-radius: 0 0 12px 12px;
}

.left-menu.menu-collapsed .admin-access-banner-icon {
  width: 32px;
  height: 32px;
}

.left-menu.menu-collapsed .admin-access-banner-icon svg {
  width: 18px;
  height: 18px;
}

[data-theme="dark"] .left-menu-admin-access-banner {
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.38);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(120, 53, 15, 0.25));
}

[data-theme="dark"] .admin-access-banner-icon {
  background: rgba(255, 255, 255, 0.08);
}

.menu-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Allow tooltips to overflow when collapsed */
.left-menu.menu-collapsed .menu-nav {
  overflow: visible;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
  font-size: var(--text-sm);
  position: relative;
}

/* Collapsed menu items - center icons, hide text */
.left-menu.menu-collapsed .menu-item {
  justify-content: center;
  padding: 0.75rem;
  border-left: none;
  border-radius: var(--radius-md);
}

.left-menu.menu-collapsed .menu-item .menu-text {
  display: none;
}

/* Tooltip for collapsed menu items */
.left-menu.menu-collapsed .menu-item::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(30, 30, 30, 0.95);
  color: #ffffff;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  z-index: 10000;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: var(--font-medium);
  backdrop-filter: blur(8px);
}

.left-menu.menu-collapsed .menu-item:hover::after {
  opacity: 1;
}

/* Light theme tooltip adjustments - more opaque */
[data-theme="light"] .left-menu.menu-collapsed .menu-item::after {
  background: rgba(255, 255, 255, 0.98);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(8px);
}

.menu-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.menu-item.active {
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent-primary);
  border-left-color: var(--accent-primary);
  font-weight: var(--font-medium);
}

[data-theme="dark"] .menu-item.active {
  background: rgba(139, 92, 246, 0.2);
}

.menu-item.logout {
  color: var(--color-error);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  font-size: var(--text-sm);
  cursor: pointer;
}

.menu-item.logout:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-error);
}

[data-theme="dark"] .menu-item.logout:hover {
  background: rgba(239, 68, 68, 0.15);
}

.menu-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-block;
  color: currentColor;
  stroke: currentColor;
  fill: none;
}

/* Center icons when collapsed */
.left-menu.menu-collapsed .menu-icon {
  margin: 0 auto;
}

.menu-text {
  font-size: var(--text-sm);
  color: inherit;
}

.menu-footer {
  padding: 1rem 0;
  border-top: 1px solid var(--border-default);
  transition: border-color var(--transition-normal);
  border-top: 1px solid #e5e7eb;
}

/* Admin Menu Item */
/* Admin Panel - Special styling when NOT active (subtle distinction) */
.menu-item-admin {
  position: relative;
  border-left: 2px solid transparent;
}

.menu-item-admin:not(.active) {
  color: var(--text-secondary);
  background: transparent;
}

.menu-item-admin:not(.active):hover {
  background: rgba(139, 92, 246, 0.05);
  color: var(--accent-primary);
}

/* Admin Panel - Active state (matches regular active items but with special indicator) */
.menu-item-admin.active {
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent-primary);
  border-left-color: var(--accent-primary);
  font-weight: var(--font-medium);
}

.menu-item-admin.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  border-radius: 0 2px 2px 0;
}

[data-theme="dark"] .menu-item-admin.active {
  background: rgba(139, 92, 246, 0.2);
}

/* ==================== DASHBOARD PAGES ==================== */

.dashboard-page {
  margin: 0;
  width: 100%;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  margin-left: 0;
  margin-right: 0;
  gap: 1rem;
  padding-left: 0;
  padding-right: 0;
}

.page-header h2 {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--accent-primary);
  margin: 0 0 0.75rem 0;
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  transition: color var(--transition-normal);
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}

/* On very small screens < 400px, reduce font size to fit badge */
@media (max-width: 400px) {
  .page-header h2 {
    font-size: clamp(1.2rem, 6vw, var(--text-3xl));
  }
}

.page-subtitle {
  color: var(--text-secondary);
  transition: color var(--transition-normal);
  font-size: 1rem;
  margin: 0;
  line-height: 1.5;
  position: relative;
  display: inline-block;
  padding-bottom: 0.25rem;
}

.page-subtitle::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.6) 0%, rgba(139, 92, 246, 0.2) 100%);
  border-radius: 2px;
}

/* ==================== CHAT ACTIONS ==================== */

.chat-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* Header Collapse */
.header-content {
  flex: 1;
  transition: all var(--transition-normal);
}

.header-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.header-title-row h2 {
  margin: 0;
  flex: 1;
}

.header-collapse-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  opacity: 0;
  visibility: hidden;
  transform: scale(0.8);
  flex-shrink: 0;
}

.header-collapse-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.header-collapse-btn svg {
  transition: transform var(--transition-normal);
}

.header-collapse-btn svg.rotated {
  transform: rotate(180deg);
}

.page-header.header-collapsed .header-content .page-subtitle {
  display: none;
  opacity: 0;
  transform: translateY(-5px);
  max-height: 0;
  overflow: hidden;
  margin: 0;
}

.page-header.header-collapsed {
  margin-bottom: 1rem;
}

/* Mobile only - show collapse button */
@media (max-width: 768px) {
  .header-collapse-btn {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
  }

  .page-header.header-collapsed .header-content .page-subtitle {
    transition: all var(--transition-normal);
  }

  .page-header.header-collapsed .header-content .header-title-row {
    margin-bottom: 0;
  }

  .page-header.header-collapsed .header-content .header-title-row h2 {
    margin-bottom: 0;
  }

  .page-header:not(.header-collapsed) .header-content {
    margin-bottom: 0.75rem;
  }
}

/* Desktop - hide collapse button */
@media (min-width: 769px) {
  .header-collapse-btn {
    display: none;
  }
}


.btn-text {
  display: inline;
}

/* Mobile: Hide header buttons, show them in chat header instead */
@media (max-width: 768px) {
  .chat-actions {
    display: none; /* Hide header buttons on mobile */
  }
}

/* ==================== BUTTONS ==================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: #2563eb;
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: white;
  color: #374151;
  border: 1px solid #d1d5db;
}

.btn-secondary:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #9ca3af;
}

.btn-danger {
  background: var(--color-error);
  color: white;
  border: none;
  font-weight: var(--font-semibold);
  transition: all var(--transition-fast);
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2);
}

.btn-danger:disabled {
  background: rgba(239, 68, 68, 0.5);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.6;
}

[data-theme="dark"] .btn-danger {
  background: var(--color-error);
}

[data-theme="dark"] .btn-danger:hover:not(:disabled) {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

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

.btn-icon {
  padding: 0.625rem 1rem;
}

.btn-icon-small {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast), color var(--transition-fast);
  font-size: var(--text-base);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

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

.btn-icon-small:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-icon-text {
  background: none;
  border: 1px solid var(--border-default);
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  font-size: var(--text-sm); /* 12px as requested */
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  gap: 5px; /* 5px gap between icon and text as requested */
}

.btn-icon-text:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-emphasis);
}

.btn-icon-text .btn-text {
  font-size: var(--text-xs); /* 12px as requested */
  font-weight: var(--font-medium);
}

/* ==================== ALERTS ==================== */

.alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  position: relative; /* For absolute positioning of close button */
}

.alert svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.alert span {
  flex: 1; /* Allow span to take available space */
}

.alert-close {
  position: absolute;
  right: 12px; /* Position at extreme right edge */
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.alert-close:hover {
  opacity: 1;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ==================== DEPLOYMENT BANNER ==================== */

.deployment-banner {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
  animation: fadeInDown 0.4s ease-out;
}

[data-theme="dark"] .deployment-banner {
  background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
  border-color: #d97706;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.2);
}

.banner-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  position: relative;
  min-height: 60px; /* Ensure minimum height for content */
}

/* For screens 1120px and above, make buttons inline with text content */

.banner-icon-container {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.banner-icon-container .banner-title {
  display: none; /* Hide title in icon container by default (desktop) */
}

.banner-icon-svg {
  width: 20px;
  height: 20px;
  color: #92400e;
  opacity: 0.8;
}

[data-theme="dark"] .banner-icon-svg {
  color: #fbbf24;
}

.banner-text-content {
  flex: 1;
  min-width: 0; /* Allow text to wrap */
  flex-shrink: 1; /* Allow shrinking */
}

.banner-text-content .banner-title {
  margin: 0 0 0.25rem 0;
  color: #92400e;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
}

[data-theme="dark"] .banner-text-content .banner-title {
  color: #fbbf24;
}

.banner-title {
  margin: 0;
  color: #92400e;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
}

[data-theme="dark"] .banner-title {
  color: #fbbf24;
}

.banner-message {
  margin: 0;
  color: #78350f;
  font-size: 0.875rem;
  line-height: 1.4;
}

[data-theme="dark"] .banner-message {
  color: #d1d5db;
}

.banner-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
  margin-top: auto; /* Push actions to bottom */
  padding-top: 0.5rem; /* Add some space above actions */
  border-top: 1px solid rgba(146, 64, 14, 0.1); /* Subtle separator */
}

.banner-btn-learn-more,
.banner-btn-deploy {
  font-size: 0.8rem;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-weight: 500;
}

.banner-btn-deploy {
  margin-right: 1rem; /* Extra space from close button */
}

.banner-close-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: #92400e;
  opacity: 0.6;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: opacity 0.2s ease, background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .banner-close-btn {
  color: #fbbf24;
}

.banner-close-btn:hover {
  opacity: 1;
  background-color: rgba(146, 64, 14, 0.1);
}

[data-theme="dark"] .banner-close-btn:hover {
  background-color: rgba(251, 191, 36, 0.1);
}

.banner-close-svg {
  width: 14px;
  height: 14px;
}

/* Large screen adjustments - move actions adjacent to content */
@media (min-width: 1120px) {
  .banner-content {
    flex-direction: row;
    align-items: flex-start;
    gap: 2rem;
  }

  .banner-icon-container {
    flex-shrink: 0;
    width: auto;
  }

  .banner-text-content {
    flex: 1;
    margin-bottom: 1rem;
  }

  .banner-actions {
    margin-left: auto;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    border-top: none;
    align-self: flex-start;
  }
}

/* Medium screen adjustments - keep title horizontal with icon (641px to 1119px) */
@media (min-width: 641px) and (max-width: 1119px) {
  .banner-icon-container {
    gap: 0.75rem; /* Space between icon and title */
    justify-content: flex-start; /* Left-align */
  }

  .banner-icon-container .banner-title {
    display: block; /* Show title in icon container */
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.2;
  }

  .banner-text-content .banner-title {
    display: none; /* Hide title in text content */
  }
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .banner-content {
    gap: 0.75rem;
    padding: 1rem;
  }

  .banner-icon-container {
    gap: 0.75rem; /* Space between icon and title on mobile */
    justify-content: flex-start; /* Left-align on mobile */
  }

  .banner-icon-container .banner-title {
    display: block; /* Show title in icon container on mobile */
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.2;
  }

  .banner-text-content .banner-title {
    display: none; /* Hide title in text content on mobile */
  }

  .banner-text-content {
    flex: 1;
  }

  .banner-message {
    font-size: 0.8rem;
    margin: 0;
  }

  .banner-actions {
    width: 100%;
    justify-content: flex-end;
    margin-left: 0;
    margin-top: auto; /* Keep actions at bottom */
    padding-top: 0.5rem;
    border-top: 1px solid rgba(146, 64, 14, 0.1);
  }

  .banner-btn-deploy {
    margin-right: 0;
  }

  .banner-close-btn {
    top: 0.5rem;
    right: 0.5rem;
  }
}

.alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* Mobile optimizations for alert close button */
@media screen and (max-width: 768px) {
  .alert-close {
    width: 32px;
    height: 32px;
    font-size: 1.75rem;
    right: 8px;
    /* Ensure touch target is at least 44x44px for accessibility */
    min-width: 44px;
    min-height: 44px;
    padding: 6px;
  }
}

/* ==================== LOADING STATES ==================== */

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  gap: 1rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==================== EMPTY STATES ==================== */

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-component);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-default);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.empty-state h3 {
  color: var(--text-primary);
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  margin: 0 0 0.5rem 0;
  transition: color var(--transition-normal);
}

.empty-state p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin: 0 0 1.5rem 0;
  transition: color var(--transition-normal);
}

.empty-icon-container {
  width: 100px;
  height: 100px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.empty-icon-container svg {
  width: 50px;
  height: 50px;
  color: white;
  stroke: white;
}

.empty-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
  transition: color var(--transition-normal);
}

.empty-icon svg {
  width: 100%;
  height: 100%;
}

/* Note: .empty-state h3 and p are already defined above with theme variables */

/* ==================== CARDS & GRIDS ==================== */

.businesses-grid,
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(316px, 1fr));
  gap: 1.5rem;
}

.services-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.business-card {
  background: var(--bg-component);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  border: 1px solid var(--border-default);
  transition: all var(--transition-fast);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: visible;
}

/* Ribbon badge - subtle pill at top-right */
.business-card .business-card-ribbon {
  position: absolute !important;
  font-size: 12px;
  top: 2px;
  border-radius: 8px;
  border-top-left-radius: 0px;
  border-bottom-right-radius: 0px;
  right: 0px;
  left: auto;
  width: auto;
  padding: 2px 12px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  z-index: 20;
  pointer-events: none;
  height: auto;
}

.business-card-ribbon.ribbon-paid {
  background: #93c5fd; /* match end color of subscription-paid::before */
  color: #1e3a8a;
}

.business-card-ribbon.ribbon-admin {
  background: #6ee7b7; /* match end color of subscription-admin::before */
  color: #065f46;
}

.business-card-ribbon.ribbon-test {
  background: #fde047; /* match end color of subscription-test::before */
  color: #92400e;
}

.business-card-ribbon.ribbon-expired {
  background: #d1d5db; /* match end color of subscription-expired::before */
  color: #374151;
}

/* Subscription visual treatments - Full card gradient background */
.business-card.subscription-paid {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15), 0 0 0 1px rgba(59, 130, 246, 0.1);
  position: relative;
  overflow: visible;
}

.business-card.subscription-paid::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(37, 99, 235, 0.3) 50%, rgba(29, 78, 216, 0.3) 100%);
  pointer-events: none;
  z-index: 0;
}

.business-card.subscription-paid::before {
  content: '';
  position: absolute;
  top: 0;
  left: 3px;
  right: 3px;
  height: 4px;
  background: linear-gradient(90deg, #3b82f6, #60a5fa, #93c5fd);
  border-radius: 999px 999px 0 0;
  z-index: 2;
}

.business-card.subscription-admin {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15), 0 0 0 1px rgba(16, 185, 129, 0.1);
  position: relative;
  overflow: visible;
}

.business-card.subscription-admin::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3) 0%, rgba(5, 150, 105, 0.3) 50%, rgba(4, 120, 87, 0.3) 100%);
  pointer-events: none;
  z-index: 0;
}

.business-card.subscription-admin::before {
  content: '';
  position: absolute;
  top: 0;
  left: 3px;
  right: 3px;
  height: 4px;
  background: linear-gradient(90deg, #10b981, #34d399, #6ee7b7);
  border-radius: 999px 999px 0 0;
  z-index: 2;
}

.business-card.subscription-test {
  border-color: rgba(234, 179, 8, 0.4);
  box-shadow: 0 4px 18px rgba(234, 179, 8, 0.12), 0 0 0 1px rgba(234, 179, 8, 0.1);
  position: relative;
  overflow: visible;
}

.business-card.subscription-test::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.3) 0%, rgba(202, 138, 4, 0.3) 50%, rgba(161, 98, 7, 0.3) 100%);
  pointer-events: none;
  z-index: 0;
}

.business-card.subscription-test::before {
  content: '';
  position: absolute;
  top: 0;
  left: 3px;
  right: 3px;
  height: 4px;
  background: linear-gradient(90deg, #eab308, #facc15, #fde047);
  border-radius: 999px 999px 0 0;
  z-index: 2;
}

.business-card.subscription-expired {
  border-color: rgba(107, 114, 128, 0.4);
  box-shadow: 0 4px 18px rgba(107, 114, 128, 0.12), 0 0 0 1px rgba(107, 114, 128, 0.1);
  position: relative;
  overflow: visible;
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.15) 0%, rgba(75, 85, 99, 0.15) 50%, rgba(55, 65, 81, 0.15) 100%),
              var(--bg-component);
  background-blend-mode: overlay;
}

.business-card.subscription-expired::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.15) 0%, rgba(75, 85, 99, 0.15) 50%, rgba(55, 65, 81, 0.15) 100%);
  pointer-events: none;
  z-index: 0;
}

.business-card.subscription-expired::before {
  content: '';
  position: absolute;
  top: 0;
  left: 3px;
  right: 3px;
  height: 4px;
  background: linear-gradient(90deg, #6b7280, #9ca3af, #d1d5db);
  border-radius: 999px 999px 0 0;
  z-index: 2;
}

.business-card.subscription-none {
  position: relative;
}

.business-card.subscription-paid > div,
.business-card.subscription-admin > div,
.business-card.subscription-test > div,
.business-card.subscription-expired > div,
.business-card.subscription-none > div {
  position: relative;
  z-index: 1;
}

.product-card {
  background: var(--bg-component);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 2px solid var(--border-default);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 1rem;
}

.service-card {
  background: var(--bg-component);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-default);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  width: 100%;
  position: relative;
}

/* Make the clickable content area also a flex container */
.business-card > div {
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1;
}

.business-card:hover,
.service-card:hover,
.product-card:hover {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

[data-theme="dark"] .business-card:hover,
[data-theme="dark"] .service-card:hover,
[data-theme="dark"] .product-card:hover {
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
}

/* ==================== BUSINESS CARD SPECIFIC ==================== */

/* ── Redesigned Business Card: Compact Layout with Chatbot Link ── */

.bcard-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 0.75rem;
}

/* Top: business name + settings gear icon */
.bcard-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  cursor: pointer;
  gap: 0.5rem;
}

.bcard-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bcard-settings-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--border-default);
  background: var(--bg-secondary);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  margin-top: 6px;
}
.bcard-settings-btn:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: rgba(139, 92, 246, 0.08);
}

/* Key-value meta grid */
.bcard-meta-grid {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.bcard-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.bcard-meta-key {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.bcard-meta-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bcard-mono {
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
  font-weight: 500;
}

/* Status badge: published vs draft */
.bcard-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

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

.bcard-status-badge.status-live {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}
.bcard-status-badge.status-live .bcard-status-dot {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

[data-theme="light"] .bcard-status-badge.status-live {
  color: #047857;
}

.bcard-status-badge.status-draft {
  background: rgba(156, 163, 175, 0.12);
  color: var(--text-tertiary);
}
.bcard-status-badge.status-draft .bcard-status-dot {
  background: var(--text-tertiary);
}

/* ── Chatbot Link Section with Animated Border ── */

.bcard-link-section {
  margin-top: auto;
  padding-top: 0.625rem;
  border-top: 1px solid var(--border-default);
}

/* The link box container — has rotating gradient border when published */
.bcard-link-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

[data-theme="light"] .bcard-link-box {
  background: var(--bg-tertiary);
}

/* Animated rotating gradient border for PUBLISHED chatbots */
.bcard-link-box.bcard-link-active {
  border-color: transparent;
  background: var(--bg-secondary);
}

[data-theme="light"] .bcard-link-box.bcard-link-active {
  background: var(--bg-tertiary);
}

.bcard-link-box.bcard-link-active::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 10px;
  background: conic-gradient(
    from var(--bcard-border-angle, 0deg),
    #3b82f6 0%,
    #8b5cf6 25%,
    #06b6d4 50%,
    #3b82f6 75%,
    #8b5cf6 100%
  );
  z-index: -2;
  animation: bcard-border-rotate 3s linear infinite;
}

.bcard-link-box.bcard-link-active::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 7px;
  background: var(--bg-secondary);
  z-index: -1;
}

[data-theme="light"] .bcard-link-box.bcard-link-active::after {
  background: var(--bg-tertiary);
}

@property --bcard-border-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@keyframes bcard-border-rotate {
  from { --bcard-border-angle: 0deg; }
  to { --bcard-border-angle: 360deg; }
}

/* Fallback for browsers without @property support: shimmer instead */
@supports not (background: conic-gradient(from 0deg, red, blue)) {
  .bcard-link-box.bcard-link-active::before {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6, #06b6d4);
    animation: bcard-border-shimmer 2s ease-in-out infinite alternate;
  }
}

@keyframes bcard-border-shimmer {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* Copied flash effect */
.bcard-link-box.bcard-link-copied {
  border-color: var(--color-success);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.bcard-link-text {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.bcard-link-icon {
  flex-shrink: 0;
  color: var(--text-tertiary);
}

.bcard-link-url {
  font-size: 11px;
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
  color: var(--text-secondary);
  word-break: break-all;
  overflow-wrap: break-word;
}

.bcard-link-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.bcard-action-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.bcard-action-btn:hover {
  background: rgba(139, 92, 246, 0.1);
  color: var(--accent-primary);
}

/* Copied check icon */
.bcard-copied-icon {
  color: var(--color-success);
  animation: bcard-check-pop 0.3s ease;
}

@keyframes bcard-check-pop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* Publish Now row */
.bcard-publish-row {
  margin-top: 0.5rem;
}

.bcard-publish-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.45rem 0.75rem;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--gradient-primary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.bcard-publish-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}
.bcard-publish-btn:active {
  transform: translateY(0);
}

/* ── End Redesigned Business Card ── */

.business-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 1rem;
}

.business-card-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.business-subscription-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.business-subscription-chip .chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.business-subscription-chip .chip-days {
  font-weight: 500;
  color: inherit;
}

.business-subscription-chip.variant-paid {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .business-subscription-chip.variant-paid {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.35);
}

.business-subscription-chip.variant-admin {
  background: rgba(16, 185, 129, 0.12);
  color: #0f5132;
  border-color: rgba(16, 185, 129, 0.25);
}

[data-theme="dark"] .business-subscription-chip.variant-admin {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.35);
}

.business-subscription-chip.variant-test {
  background: rgba(234, 179, 8, 0.14);
  color: #92400e;
  border-color: rgba(234, 179, 8, 0.25);
}

[data-theme="dark"] .business-subscription-chip.variant-test {
  background: rgba(234, 179, 8, 0.22);
  color: #fcd34d;
  border-color: rgba(252, 211, 77, 0.35);
}

.business-name {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin: 0;
  line-height: var(--leading-tight);
  flex: 1;
  letter-spacing: var(--tracking-tight);
  transition: color var(--transition-normal);
}

.business-description {
  color: #1f2937;
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  margin: 0 0 1.5rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--transition-normal);
  flex: 1;
  min-height: 0; /* Allow flex item to shrink below content size */
}

[data-theme="dark"] .business-description {
  color: #e5e7eb;
}

.business-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  text-transform: capitalize;
  white-space: nowrap;
  flex-shrink: 0;
}

.business-status-badge.status-approved {
  background: #d1fae5;
  color: #065f46;
}

.business-status-badge.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.business-status-badge.status-rejected {
  background: #fee2e2;
  color: #991b1b;
}

.business-meta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-default);
  margin-top: auto;
  transition: border-color var(--transition-normal);
}

.business-meta .meta-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.business-meta .meta-value {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 600;
  padding-bottom: 3px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: -3px;
}

.meta-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  transition: color var(--transition-normal);
}

.meta-value {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
  transition: color var(--transition-normal);
}

.service-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.service-title {
  margin-bottom: 2px; /* Reduced from 24px (1.5rem) to 2px */
  margin-right: 1rem;
  flex: 1;
}

/* Mobile: Stack vertically */
@media (max-width: 768px) {
  .service-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .service-title {
    margin-bottom: 0.5rem;
    margin-right: 0;
  }

  .service-actions {
    align-self: flex-end;
  }
}

/* ==================== PRODUCT CARD LAYOUT ==================== */

.product-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin: 0 0 0.75rem 0;
  line-height: var(--leading-tight);
  transition: color var(--transition-normal);
}

.product-card-top {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.product-image {
  width: 120px;
  height: 120px;
  min-width: 120px;
  min-height: 120px;
  border-radius: var(--radius-md);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--bg-secondary);
  cursor: pointer;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
  flex-shrink: 0;
}

.product-image:hover {
  transform: scale(1.02);
  opacity: 0.9;
}

.product-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  color: var(--text-tertiary);
  cursor: pointer;
}

.product-image-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.5;
}

.product-description {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  margin: 0;
  transition: color var(--transition-normal);
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  align-self: stretch;
  cursor: pointer;
  position: relative;
}

.product-description:hover {
  color: var(--accent-blue);
}

.product-card-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-default);
  transition: border-color var(--transition-normal);
}

.product-price-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.product-price {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex: 1;
}

.product-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.service-actions {
  display: flex;
  gap: 0.5rem;
}

.service-content p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  margin: 0;
  transition: color var(--transition-normal);
}

.service-footer {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 4px 0;
}

.product-meta {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.product-meta .product-category {
  margin-right: auto; /* Push status and stock to the right */
}

.product-category {
  font-size: var(--text-sm);
  color: var(--accent-primary);
  font-weight: var(--font-medium);
  padding: 0.25rem 0.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  transition: color var(--transition-normal), background var(--transition-normal);
}

.service-date {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  transition: color var(--transition-normal);
}

/* Service content expansion */
.service-content {
  position: relative;
  max-height: 200px;
  overflow: hidden;
  transition: max-height var(--transition-normal);
}

.service-content .markdown-preview {
  min-height: auto;
  padding: 0;
  border: none;
  background: transparent;
  overflow: visible;
  font-size: var(--text-sm);
  line-height: 1.5;
}

.service-content .markdown-preview h1,
.service-content .markdown-preview h2,
.service-content .markdown-preview h3,
.service-content .markdown-preview h4,
.service-content .markdown-preview h5,
.service-content .markdown-preview h6 {
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: inherit;
  font-weight: var(--font-semibold);
}

.service-content .markdown-preview h1 { font-size: 1.1rem; }
.service-content .markdown-preview h2 { font-size: 1rem; }
.service-content .markdown-preview h3 { font-size: 0.95rem; }

.service-content .markdown-preview p {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.service-content .markdown-preview ul,
.service-content .markdown-preview ol {
  margin-bottom: 0.5rem;
  padding-left: 1.25rem;
}

.service-content .markdown-preview li {
  margin-bottom: 0.25rem;
}

.service-content .markdown-preview strong {
  font-weight: var(--font-semibold);
}

.service-content .markdown-preview code {
  font-size: 0.85em;
  padding: 0.15rem 0.3rem;
}

.service-content .markdown-preview blockquote {
  margin: 0.5rem 0;
  padding-left: 0.75rem;
  font-size: 0.9em;
}

.service-content.expanded {
  max-height: none;
}

.service-expand-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  background: var(--bg-component);
  padding: 0.5rem 1rem;
  margin: 0 0 4px 0;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--accent-blue);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  z-index: 10;
}

.service-expand-btn:hover {
  color: var(--accent-blue-hover);
  background: var(--bg-hover);
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-md);
}

.service-content.expanded {
  display: flex;
  flex-direction: column;
}

.service-content.expanded .service-expand-btn {
  position: relative;
  background: var(--bg-component);
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  margin-bottom: 4px;
  border: none;
  box-shadow: none;
  border-radius: 0;
  align-self: flex-end;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-lg);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

.badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

[data-theme="dark"] .badge-active {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

/* ==================== MODALS ==================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

html:has(.modal-overlay),
html:has(.confirmation-dialog-overlay),
html:has(.action-dialog-overlay),
html:has(.services-dialog-overlay),
html:has(.products-dialog-overlay),
html:has(.information-dialog-overlay),
html:has(.theme-dialog-backdrop),
html:has(.service-mode-dialog-backdrop),
html:has(.analytics-page .detail-overlay),
html:has(.date-range-overlay),
body:has(.modal-overlay),
body:has(.confirmation-dialog-overlay),
body:has(.action-dialog-overlay),
body:has(.services-dialog-overlay),
body:has(.products-dialog-overlay),
body:has(.information-dialog-overlay),
body:has(.theme-dialog-backdrop),
body:has(.service-mode-dialog-backdrop),
body:has(.analytics-page .detail-overlay),
body:has(.date-range-overlay) {
  overflow: hidden;
  overscroll-behavior: none;
}

.modal-overlay,
.confirmation-dialog-overlay,
.action-dialog-overlay,
.services-dialog-overlay,
.products-dialog-overlay,
.information-dialog-overlay,
.theme-dialog-backdrop,
.service-mode-dialog-backdrop,
.analytics-page .detail-overlay,
.date-range-overlay {
  overscroll-behavior: contain;
}

.modal-body,
.action-dialog-body,
.services-dialog-content,
.services-table-wrapper,
.products-dialog .products-dialog-content,
.products-dialog .products-grid-wrapper,
.information-dialog-body,
.analytics-page .detail-info,
.analytics-page .messages-container {
  overscroll-behavior: contain;
}

.modal-content {
  background: white;
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  animation: modalSlideIn 0.3s ease;
}

.modal-large {
  max-width: 800px;
}

/* Base modal body padding (desktop and larger screens) */
.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal mobile responsive styles */
@media (max-width: 640px) {
  .modal-overlay {
    padding: 0.5rem !important; /* Reduced from 1rem (16px) to 0.5rem (8px) */
  }

  .modal-content {
    margin: 0.5rem !important; /* Reduced from 1rem (16px) to 0.5rem (8px) */
  }

  .modal-header {
    padding: 0.75rem !important; /* Mobile: 12px all around */
  }

  .modal-body {
    padding: 0.375rem !important; /* Reduced from 1.5rem (24px) to 0.375rem (6px) */
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-tertiary);
}

/* ==================== FORMS ==================== */

.form-group {
  margin-bottom: 10px;
}

/* Visual separation for form groups within settings sections */
.settings-section .form-group,
.config-section .form-group {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  transition: border-color var(--transition-normal);
}

.settings-section .form-group:last-child,
.config-section .form-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.settings-section .form-row .form-group {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.settings-section .form-row {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.form-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  margin-bottom: 2px;
  transition: color var(--transition-normal);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: var(--text-sm);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  font-family: var(--font-family);
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Select dropdown - add extra right padding for caret */
.form-group select {
  padding-right: 1.1875rem; /* 19px = 14px (0.875rem) + 5px for caret spacing */
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 0.75rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-group textarea:focus,
[data-theme="dark"] .form-group select:focus {
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.form-group input.input-error,
.form-group textarea.input-error,
.form-group select.input-error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group input.input-error:focus,
.form-group textarea.input-error:focus,
.form-group select.input-error:focus {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder,
.form-group select::placeholder {
  color: var(--text-tertiary);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  max-height: 200px;
  overflow-y: auto;
}

/* Form label with character counter */
.form-label-with-counter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 0.5rem;
}

.form-label-with-counter > span:first-of-type {
  flex: 1;
}

/* Form label with action buttons */
.form-group label.form-label-with-actions {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 0.5rem;
  margin-bottom: 0.1rem;
}

.form-group label.form-label-with-actions > span:first-of-type {
  flex: 0 0 auto;
  margin: 0;
}

.form-group label.form-label-with-actions .form-label-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
}

/* Icon-only buttons (without btn-primary) */
.btn-icon:not(.btn-primary):not(.btn-new-chat):not(.btn-compact):not(.btn-secondary) {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

/* Buttons with text (btn-primary + btn-icon) */
.btn.btn-primary.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: auto;
  height: auto;
  padding: 0.625rem 1rem;
  min-height: 2.5rem;
}

.btn-icon:not(.btn-primary):not(.btn-new-chat):not(.btn-compact):not(.btn-secondary):hover:not(:disabled) {
  background: var(--bg-tertiary);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

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

.btn-icon-check {
  color: var(--color-success);
  border-color: var(--color-success);
}

.btn-icon-check:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.1);
}

.btn-icon-cancel {
  color: var(--text-secondary);
}

.btn-icon-edit {
  color: var(--accent-primary);
}

.btn-icon-copy {
  color: var(--text-secondary);
}

.btn-icon-copy:hover:not(:disabled) {
  background: var(--bg-tertiary);
  border-color: var(--border-hover);
  color: var(--accent-primary);
}

/* Display slug container */
/* New Chat Button */
.btn-new-chat {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  padding: 0.625rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.btn-new-chat:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn-new-chat svg {
  flex-shrink: 0;
}

.btn-new-chat .btn-text {
  display: inline;
}

/* Desktop: Show desktop text, hide mobile text */
.btn-new-chat .btn-text-desktop,
.btn-secondary .btn-text-desktop {
  display: inline;
}

.btn-new-chat .btn-text-mobile,
.btn-secondary .btn-text-mobile {
  display: none;
}

.display-slug-container {
  display: flex;
  align-items: center;
  width: 100%;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.display-slug-container:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.display-slug-container .display-slug-url-prefix {
  padding: 0.625rem 0.875rem;
  font-size: 13px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: var(--font-medium);
  user-select: none;
  white-space: nowrap;
  border-right: 1px solid var(--border-default);
  flex-shrink: 0;
}

.display-slug-container .display-slug-input {
  flex: 1;
  padding: 0.625rem 0.875rem;
  font-size: 13px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0; /* square left corners to blend with prefix */
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-family);
  outline: none;
  min-width: 0;
}

.display-slug-container .display-slug-input:read-only {
  cursor: default;
  color: var(--text-secondary);
}

.display-slug-container .display-slug-input.display-slug-editable {
  cursor: text;
  color: var(--text-primary);
}

.display-slug-container .display-slug-input.display-slug-valid {
  color: var(--color-success);
}

.display-slug-container .display-slug-input.display-slug-invalid {
  color: var(--color-error);
}

.display-slug-check-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.875rem;
  flex-shrink: 0;
  color: var(--color-success);
}

.display-slug-check-icon.display-slug-checking {
  color: var(--text-tertiary);
}

.display-slug-check-icon svg.spinning {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.character-counter {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-weight: var(--font-normal);
  margin-left: auto;
  flex-shrink: 0;
  text-align: right;
  float: right;
}

.character-counter.near-limit {
  color: var(--color-warning);
  font-weight: var(--font-medium);
}

.character-counter.at-limit {
  color: var(--color-error);
  font-weight: var(--font-semibold);
}

/* Phone input group with country code prefix */
.phone-input-group {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.phone-prefix {
  display: flex;
  align-items: center;
  padding: 0.625rem 0.875rem;
  font-size: var(--text-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  color: var(--text-secondary);
  font-weight: var(--font-medium);
  user-select: none;
  cursor: default;
  white-space: nowrap;
}

.phone-prefix.disabled {
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  border-color: var(--border-subtle);
}

.phone-input-group input {
  flex: 1;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  border-left: none;
}

.phone-input-group input:focus {
  border-left: 1px solid var(--accent-primary);
  margin-left: -1px;
}

.phone-input-group input.input-error {
  border-left: 1px solid var(--color-error);
  margin-left: -1px;
}

.form-group small {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

.validation-error {
  display: block;
  margin-top: 0.5rem;
  color: var(--color-error);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  transition: color var(--transition-normal);
}

/* Password match error - shown in real-time as user types */
.password-match-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  color: #ef4444;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  background-color: rgba(239, 68, 68, 0.1);
  border-left: 3px solid #ef4444;
  border-radius: var(--radius-sm);
  animation: fadeInDown 0.2s ease;
}

.password-match-error svg {
  flex-shrink: 0;
  color: #ef4444;
}

[data-theme="dark"] .password-match-error {
  background-color: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-left-color: #f87171;
}

[data-theme="dark"] .password-match-error svg {
  color: #f87171;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: start; /* Align items to top for better label alignment */
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.settings-form .form-actions {
  border-top: none;
  padding-top: 0;
}

/* Modal footer - fixed at bottom */
.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-default);
  background: var(--bg-primary);
  flex-shrink: 0; /* Prevent footer from shrinking */
}

.modal-footer-buttons {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  justify-content: flex-end;
}

.modal-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9375rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
}

.modal-btn-cancel {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.modal-btn-cancel:hover:not(:disabled) {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.modal-btn-primary {
  background: #3b82f6;
  color: white;
  font-weight: 600;
}

.modal-btn-primary:hover:not(:disabled) {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.modal-btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.35);
  font-weight: 600;
}

.modal-btn-danger:hover:not(:disabled) {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

.modal-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.modal-btn-primary:disabled {
  background: #9ca3af;
  color: white;
  opacity: 0.7;
}

/* Hidden submit button for form validation */
.hidden-submit-btn {
  display: none;
}

/* Modal form - takes full height and scrolls */
.modal-form {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.modal-form .modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

/* Form actions in modal - legacy support */
.modal-content .form-actions {
  margin-top: 0;
  padding: 12px 1.5rem;
  border-top: 1px solid var(--border-default);
  flex-shrink: 0; /* Prevent actions from shrinking */
  background: var(--bg-primary);
}

/* Advanced settings toggle */
.advanced-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  background: transparent;
  border: 1px dashed var(--color-info);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.advanced-toggle:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--bg-tertiary);
}

.advanced-toggle svg {
  width: 16px;
  height: 16px;
}

.advanced-toggle .advanced-toggle-caret {
  width: 14px;
  height: 14px;
  margin-left: auto;
}

.advanced-section {
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.advanced-section-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.advanced-hide-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.advanced-hide-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--bg-component);
}

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

/* Dark mode handled by base styles with variables */

/* ==================== IMAGE UPLOAD ==================== */

.image-upload-area,
.logo-upload-area {
  margin-top: 0.5rem;
}

/* Ensure preview containers have an explicit box so widths don't collapse */
.image-preview,
.logo-preview {
  position: relative;
  display: block;
  width: 200px;
  height: 200px;
  border-radius: 8px;
  overflow: hidden;
}

.image-preview img,
.logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  transition: border-color var(--transition-normal);
}

.logo-preview-bg {
  width: 200px;
  height: 200px;
  max-width: 200px;
  max-height: 200px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: border-color var(--transition-normal);
}

.image-preview-bg {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--bg-secondary);
  transition: border-color var(--transition-normal);
}

.btn-remove-image {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.btn-remove-image:hover {
  background: rgba(0, 0, 0, 0.9);
}

.image-upload-placeholder,
.logo-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem;
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.upload-hint {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  margin: 0;
  transition: color var(--transition-normal);
}

/* Button overlay for image change functionality */
.btn-overlay {
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 0.375rem 0.75rem; /* Smaller padding */
  font-size: 0.75rem; /* Smaller font */
  min-width: 100px; /* Consistent width for both "Change Image" and "Uploading..." */
  white-space: nowrap; /* Prevent text wrapping */
  text-align: center; /* Center text within button */
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* Prevent hover shifting for overlay buttons */
.btn-overlay:hover {
  transform: translateX(-50%) translateY(-1px); /* Maintain centering + subtle lift */
}

/* ==================== CHATBOT TESTER ==================== */

.chatbot-tester {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 400px;
  background: var(--bg-component);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  overflow: hidden;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.chat-header {
  padding: 1rem 1.5rem;
  border-bottom: 2px solid var(--agent-primary-color, var(--accent-blue));
  background: var(--bg-component);
  transition: background-color var(--transition-normal), border-color var(--transition-normal), padding 0.3s ease;
}

.chat-header-content {
  max-width: 100%;
}

.chat-header-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
  line-height: var(--leading-tight);
}

.chat-header-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0;
  line-height: var(--leading-normal);
  max-height: 100px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.25s ease, margin 0.3s ease;
}

.chatbot-tester .chat-header .chat-header-content .chat-header-subtitle.subtitle-collapsed {
  display: none !important;
  max-height: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
}

.chat-header.chat-header-compact {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  transition: padding 0.3s ease;
}

.chat-header.chat-header-compact .chat-header-title {
  margin-bottom: 0;
}

.chat-input-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  font-size: var(--text-xs);
  color: #25D366;
  text-decoration: none;
  font-weight: var(--font-medium);
  transition: opacity var(--transition-fast);
}

.chat-input-whatsapp:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Chatbot subtitle text truncation for both test and public chatbots - Mobile */
/* Subtitle is now a direct child of chat-header-content, not inside title-row */
@media (max-width: 767px) {
  .chatbot-tester .chat-header .chat-header-content .chat-header-subtitle,
  .public-chatbot .chat-header .chat-header-content .chat-header-subtitle {
    display: -webkit-box !important;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    hyphens: auto;
    max-height: calc(var(--leading-normal) * 2);
    line-height: var(--leading-normal);
  }
}

/* Tablet: Allow more text (3 lines max) */
@media (min-width: 768px) and (max-width: 1023px) {
  .chatbot-tester .chat-header .chat-header-content .chat-header-subtitle,
  .public-chatbot .chat-header .chat-header-content .chat-header-subtitle {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    hyphens: auto;
    max-height: calc(var(--leading-normal) * 3);
    line-height: var(--leading-normal);
  }

  /* Keep title row horizontal on tablet - title on left, buttons on right */
  .chatbot-tester .chat-header .chat-header-content .chat-header-title-row,
  .public-chatbot .chat-header .chat-header-content .chat-header-title-row {
    flex-direction: row; /* Keep horizontal */
    align-items: center;
    justify-content: space-between;
  }
}

/* Desktop: Show full subtitle without truncation */
@media (min-width: 1024px) {
  .chatbot-tester .chat-header .chat-header-content .chat-header-subtitle,
  .public-chatbot .chat-header .chat-header-content .chat-header-subtitle {
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: visible;
    text-overflow: unset;
    max-height: unset;
    white-space: normal;
    word-break: normal;
    hyphens: none;
  }

  /* Keep title row horizontal on desktop - title on left, buttons on right */
  .chatbot-tester .chat-header .chat-header-content .chat-header-title-row,
  .public-chatbot .chat-header .chat-header-content .chat-header-title-row {
    flex-direction: row; /* Keep horizontal */
    align-items: center;
    justify-content: space-between;
  }
}

/* Hide subtitle on desktop when inside title-row */
.chat-header-title-row .chat-header-subtitle {
  display: none;
}

/* Chat Header Title Row */
.chat-header-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.chat-header-title {
  margin: 0;
  flex: 1;
}

/* Chat Header Actions (Mobile Only) */
.chat-header-actions.mobile-only {
  display: none; /* Hidden by default on desktop */
}

/* Public chatbot: Show buttons at all screen sizes */
.public-chatbot .chat-header-actions.mobile-only {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0; /* Prevent buttons from shrinking */
}

@media (max-width: 768px) {
  .chat-header-actions.mobile-only {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0; /* Prevent buttons from shrinking */
  }

  /* Keep title row horizontal on mobile - title on left, buttons on right */
  .chat-header-title-row {
    flex-direction: row; /* Keep horizontal layout */
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .chat-header-title {
    margin: 0;
    flex: 1;
    min-width: 0; /* Allow title to truncate if needed */
  }

  /* Subtitle is now outside title-row, below it */
  .chat-header-subtitle {
    margin: 0.25rem 0 0 0; /* Small top margin to separate from title row */
    font-size: var(--text-sm);
    color: var(--text-secondary);
    display: block; /* Show subtitle on mobile */
  }
}

.chat-header-actions .btn-compact {
  padding: 0.25rem 0.625rem; /* Reduced from 0.375rem 0.75rem */
  font-size: 0.75rem;
  min-height: 1.5rem; /* Reduced from 1.75rem */
  min-width: auto; /* Changed from 8rem to auto for more compact buttons */
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-component);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  white-space: nowrap; /* Prevent text wrapping */
}

.chat-header-actions .btn-compact:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.chat-header-actions .btn-compact svg {
  width: 14px;
  height: 14px;
}

.chat-header-actions .btn-compact .btn-text {
  font-size: 0.75rem;
  font-weight: var(--font-medium);
}

/* Mobile: Further reduce button size for smaller screens */
@media (max-width: 450px) {
  .chat-header-actions .btn-compact {
    padding: 0.25rem 0.5rem; /* Reduced padding for smaller screens */
    min-height: 1.5rem; /* Keep reduced height */
    min-width: auto; /* Allow natural width */
  }

  /* Keep horizontal layout even on very small screens */
  .chat-header-title-row {
    flex-direction: row; /* Keep horizontal */
    align-items: center;
    gap: 0.375rem; /* Smaller gap on very small screens */
  }

  .chat-header-title {
    font-size: var(--text-base); /* Slightly smaller title on very small screens */
  }
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 0.5rem; /* Top/bottom: 1.5rem, Left/right: 0.5rem */
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: padding 0.3s ease;
}

.chat-compact .chat-messages {
  padding-top: 0.75rem;
}

/* Mobile: Reduce left/right padding */
@media (max-width: 768px) {
  .chat-messages {
    padding: 1.5rem 0.5rem; /* Top/bottom: 1.5rem, Left/right: 0.5rem (8px) */
  }
}

/* ===== WHATSAPP CHATBOT TOGGLE ===== */

.whatsapp-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.whatsapp-row .form-group {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.whatsapp-row .whatsapp-toggle-col .delivery-checkbox {
  min-height: calc(2 * 0.625rem + 1.25rem + 2px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.75rem;
  gap: 0.5rem;
}

.whatsapp-row .whatsapp-toggle-col .delivery-checkbox .form-checkbox {
  border-radius: 1px;
}

.whatsapp-row .whatsapp-hint-row {
  grid-column: 1 / -1;
}

@media (max-width: 768px) {
  .whatsapp-row {
    position: relative;
    grid-template-columns: 1fr;
  }
  .whatsapp-row .whatsapp-toggle-col {
    position: absolute;
    top: 0;
    right: 0;
  }
  .whatsapp-row .whatsapp-toggle-col > label {
    display: none;
  }
  .whatsapp-row .whatsapp-toggle-col .delivery-checkbox {
    min-height: auto;
    margin-left: 0;
    border: none;
    padding: 0;
  }
}

/* ===== DELIVERY OPTIONS ===== */

.delivery-options {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  align-items: flex-start;
  margin-top: 0.75rem;
}

.delivery-checkbox {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2rem;
}

.delivery-checkbox input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
  border-radius: 0.25rem;
  border: 2px solid var(--border-default);
  transition: all var(--transition-fast);
  /* Override appearance: none from ios-fixes.css to show check marks */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: auto;
  /* Custom check mark styling */
  background: var(--bg-primary);
  position: relative;
}

.delivery-checkbox input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.delivery-checkbox input[type="checkbox"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Custom check mark for checked state */
.delivery-checkbox input[type="checkbox"]:checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.delivery-checkbox input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  line-height: 1;
}

.checkbox-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  line-height: 1.4;
  margin: 0;
}

.checkbox-label:hover {
  color: var(--accent-primary);
}

/* Mobile: Stack vertically */
@media (max-width: 768px) {
  .delivery-options {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .delivery-checkbox {
    width: 100%;
  }

  .checkbox-label {
    flex: 1;
  }
}

/* Dark mode support */
[data-theme="dark"] .delivery-checkbox input[type="checkbox"] {
  border-color: var(--border-default);
  background: var(--bg-secondary);
}

[data-theme="dark"] .delivery-checkbox input[type="checkbox"]:focus {
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.chat-empty h3 {
  color: var(--text-primary);
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  margin: 0 0 0.5rem 0;
  transition: color var(--transition-normal);
}

.chat-empty p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin: 0;
  transition: color var(--transition-normal);
}

.chat-empty-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-normal);
}

.chat-empty-icon svg {
  width: 100%;
  height: 100%;
}

.chat-message {
  display: flex;
  gap: 0.75rem;
  max-width: 80%;
}

.message-user {
  align-self: flex-end;
  flex-direction: row-reverse;
  margin-left: auto;
  align-items: flex-end; /* Align avatar to bottom for user messages */
}

.message-user .message-avatar {
  align-self: flex-end; /* Align avatar to bottom */
  margin-bottom: 0.25rem; /* Match message-text margin-bottom */
  transform: translateY(-0.875rem); /* Shift up: half avatar (18px) - half tail (4px) = 14px (0.875rem) to center with tail */
}

.message-assistant {
  align-self: flex-start;
  align-items: flex-end; /* Align avatar to bottom for assistant messages */
}

.message-assistant .message-avatar {
  align-self: flex-end; /* Align avatar to bottom */
  margin-bottom: 0.25rem; /* Match message-text margin-bottom */
  transform: translateY(-0.875rem); /* Shift up: half avatar (18px) - half tail (4px) = 14px (0.875rem) to center with tail */
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color var(--transition-normal);
}

.message-avatar svg {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  transition: color var(--transition-normal);
}

.message-avatar .business-logo,
.message-avatar .agent-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.message-user .message-avatar {
  background: var(--agent-primary-color, var(--accent-blue));
}

.message-user .message-avatar svg {
  color: white;
}

.message-content {
  flex: 1;
  min-width: 0;
  padding-left: 4px;
}

.message-text {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  transition: background-color var(--transition-normal), color var(--transition-normal);
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  /* Add distinctive chat bubble tail */
  margin-bottom: 0.25rem;
}

.message-text-body {
  position: relative;
}

.message-text-body-scrollable {
  max-height: 27.5rem;
  overflow-y: auto;
  padding-right: 0.125rem;
  scrollbar-width: thin;
}

.message-text-scrollable {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.message-user .message-text {
  background: var(--agent-primary-color, var(--accent-blue));
  color: white;
  /* Add distinctive edge for user messages (right side) */
  border-bottom-right-radius: 4px;
}

/* Ensure nested elements in user bubbles stay readable on blue bg */
.message-user .message-text * {
  color: white !important;
}

.message-user .message-text::after {
  content: '';
  position: absolute;
  bottom: 0px;
  right: -5px;
  width: 0;
  height: 0;
  border-left: 8px solid var(--agent-primary-color, var(--accent-blue));
  border-bottom: 8px solid transparent;
  border-top: 8px solid transparent;
}

.message-assistant .message-text {
  /* Add distinctive edge for assistant messages (left side) */
  border-bottom-left-radius: 4px;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.chat-bubble-nav {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.chat-bubble-nav-btn {
  position: absolute;
  right: 0.6rem;
  width: 1.85rem;
  height: 1.85rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  border: 1px solid color-mix(in srgb, var(--agent-primary-color, var(--accent-blue)) 18%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-primary) 42%, transparent);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
  color: var(--agent-primary-color, var(--accent-blue));
  opacity: 0.82;
  pointer-events: auto;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.chat-bubble-nav-btn:hover {
  transform: translateY(-1px);
  background: color-mix(in srgb, var(--bg-primary) 58%, transparent);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.chat-bubble-nav-btn:focus-visible {
  outline: 2px solid var(--agent-primary-color, var(--accent-blue));
  outline-offset: 2px;
}

.chat-bubble-nav-btn-down {
  top: 0.55rem;
}

.chat-bubble-nav-btn-up {
  bottom: 0.55rem;
}

.chat-bubble-nav-btn-up .chat-bubble-nav-chevron {
  transform: rotate(180deg);
  animation-name: chatBubbleChevronUp;
}

.chat-bubble-nav-chevron {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  animation: chatBubbleChevronDown 1.2s ease-in-out infinite;
}

.chat-bubble-nav-chevron:nth-child(2) {
  animation-delay: 0.16s;
}

.message-assistant .message-text::after {
  content: '';
  position: absolute;
  bottom: -0px;
  left: -7px;
  width: 0;
  height: 0;
  border-right: 8px solid var(--bg-tertiary);
  border-bottom: 8px solid transparent;
  border-top: 8px solid transparent;
  border-left: 1px solid var(--border-subtle);
}

@keyframes chatBubbleChevronDown {
  0%,
  100% {
    opacity: 0.35;
    transform: rotate(45deg) translate(-1px, -1px);
  }
  50% {
    opacity: 1;
    transform: rotate(45deg) translate(1px, 1px);
  }
}

@keyframes chatBubbleChevronUp {
  0%,
  100% {
    opacity: 0.35;
    transform: rotate(225deg) translate(1px, 1px);
  }
  50% {
    opacity: 1;
    transform: rotate(225deg) translate(-1px, -1px);
  }
}

/* Markdown heading spacing in chat bubbles */
.message-text h1,
.message-text h2,
.message-text h3,
.message-text h4,
.message-text h5,
.message-text h6 {
  margin: 1em 0 0.35em 0;
  font-weight: 600;
  line-height: 1.3;
}
.message-text h1:first-child,
.message-text h2:first-child,
.message-text h3:first-child,
.message-text h4:first-child {
  margin-top: 0;
}
.message-text h1 { font-size: 1.2em; }
.message-text h2 { font-size: 1.1em; }
.message-text h3 { font-size: 1.05em; }

/* Paragraphs and lists in chat messages */
.message-text p {
  margin: 0 0 0.6em 0;
}
.message-text p:last-child {
  margin-bottom: 0;
}
.message-text ul,
.message-text ol {
  margin: 0.25em 0 0.75em 0;
  padding-left: 1.5em;
}
.message-text li {
  margin-bottom: 0.25em;
}
.message-text li:last-child {
  margin-bottom: 0;
}
/* Ensure heading after a list has proper space — prevents list from 'touching' next header */
.message-text ul + h1, .message-text ul + h2, .message-text ul + h3,
.message-text ul + h4, .message-text ul + h5, .message-text ul + h6,
.message-text ol + h1, .message-text ol + h2, .message-text ol + h3,
.message-text ol + h4, .message-text ol + h5, .message-text ol + h6,
.message-text p + h1, .message-text p + h2, .message-text p + h3,
.message-text p + h4, .message-text p + h5, .message-text p + h6 {
  margin-top: 1.2em;
}

/* Chat message table formatting */
.message-text table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
  font-size: 0.9em;
}
.message-text thead th {
  text-align: left;
  background: rgba(0, 0, 0, 0.04);
}
.message-text th,
.message-text td {
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 0.35rem 0.5rem;
  vertical-align: top;
}
.message-user .message-text th,
.message-user .message-text td {
  border-color: rgba(255, 255, 255, 0.25);
  color: white;
}
.message-user .message-text thead th {
  background: rgba(255, 255, 255, 0.15);
}
.message-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0 0.5rem;
}

.message-time {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin: 0;
  padding: 0;
  transition: color var(--transition-normal);
}

.chat-resend-btn {
  display: inline-flex;
  align-items: center;
  margin: 0 0 0 auto;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-tertiary);
  font-size: 0.72rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.message-user:hover .chat-resend-btn {
  opacity: 0.55;
}

.chat-resend-btn:hover {
  opacity: 1;
  color: var(--agent-primary-color, var(--accent-blue));
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.action-button {
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.action-button:hover {
  background: var(--bg-tertiary);
  border-color: var(--agent-primary-color, var(--accent-blue));
  color: var(--agent-primary-color, var(--accent-blue));
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 0.75rem 1rem;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--agent-primary-color, var(--text-tertiary));
  animation: typing 1.4s infinite;
  transition: background-color var(--transition-normal);
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

.chat-input-container {
  border-top: 1px solid var(--border-default);
  padding: 1rem;
  background: var(--bg-tertiary);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.chat-input-wrapper {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.chat-input-wrapper .model-selector-container {
  align-self: center;
}

.chat-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-family: var(--font-family);
  resize: none;
  min-height: 44px;
  max-height: 120px;
  line-height: 1.5;
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  transition: all var(--transition-fast);
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Hide scrollbar for Chrome, Safari, Opera */
.chat-input::-webkit-scrollbar {
  display: none;
}

.chat-input:focus {
  outline: none;
  border-color: var(--agent-primary-color, var(--accent-primary));
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

[data-theme="dark"] .chat-input:focus {
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.chat-input::placeholder {
  color: var(--text-tertiary);
}

.btn-send {
  padding: 0.75rem 1.25rem;
  background: var(--agent-primary-color, var(--accent-blue));
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: var(--text-base);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.btn-send:hover:not(:disabled) {
  background: var(--agent-primary-color-hover, var(--agent-primary-color, var(--accent-blue)));
  filter: brightness(0.9);
  transform: scale(1.05);
}

[data-theme="dark"] .btn-send:hover:not(:disabled) {
  background: var(--agent-primary-color-hover, var(--agent-primary-color, var(--accent-blue)));
  filter: brightness(1.1);
}

.btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-hint {
  margin-top: 0.5rem;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  text-align: center;
  transition: color var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-hint-docs {
  font-size: 10px;
  opacity: 0.7;
  padding: 0 0 4px 0;
  text-align: center;
  color: var(--text-tertiary);
  display: block;
}

/* ==================== DEPLOYMENT PAGE ==================== */

.deployment-status-card {
  background: var(--bg-component);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-default);
  margin-bottom: 2rem;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.status-header h3 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin: 0;
  transition: color var(--transition-normal);
}

.status-badge {
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-lg);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
}

.status-published {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

[data-theme="dark"] .status-published {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.status-draft {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

[data-theme="dark"] .status-draft {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.status-message {
  color: var(--text-secondary);
  margin: 0 0 1rem 0;
  transition: color var(--transition-normal);
}

.status-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.deployment-section {
  background: var(--bg-component);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-default);
  margin-bottom: 2rem;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.deployment-section h3 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
  transition: color var(--transition-normal);
}

.section-description {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin: 0 0 1.5rem 0;
  transition: color var(--transition-normal);
}

.preview-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--color-warning);
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: var(--text-sm);
  color: var(--color-warning);
  line-height: var(--leading-normal);
  transition: background-color var(--transition-normal), border-color var(--transition-normal), color var(--transition-normal);
}

.preview-notice svg {
  flex-shrink: 0;
  margin-top: 0.125rem;
  color: var(--color-warning);
}

/* Allowed Websites Section */
.allowed-websites-list {
  margin-bottom: 1.5rem;
}

.empty-allowed-websites {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-default);
}

.deployment-unavailable-state {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
}

.deployment-code-empty-state {
  margin-top: 1rem;
}

.deployment-unavailable-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  color: var(--color-warning);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: var(--radius-sm);
}

.deployment-unavailable-copy h4 {
  margin: 0 0 0.25rem 0;
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
}

.deployment-unavailable-copy p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

.deployment-unavailable-copy .btn {
  margin-top: 0.75rem;
}

.websites-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.website-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-component);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-primary);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.website-tag:hover {
  background: var(--bg-hover);
}

.website-remove-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

.website-remove-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-error);
}

.website-remove-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.business-website-notice {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--color-success);
  border-radius: var(--radius-sm);
}

.website-tag-always-allowed {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--color-success);
  color: var(--color-success);
}

.website-tag-always-allowed svg {
  color: var(--color-success);
}

.always-allowed-badge {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  background: var(--color-success);
  color: white;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-xs);
  margin-left: 0.5rem;
}

.business-website-hint {
  margin: 0.75rem 0 0 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.add-website-form {
  border-top: 1px solid var(--border-default);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}

.add-website-input-group {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.add-website-input-group input {
  flex: 1;
  min-width: 0;
}

.limit-reached-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--color-warning);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--color-warning);
  margin-top: 1rem;
}

.limit-reached-notice svg {
  flex-shrink: 0;
  margin-top: 0.125rem;
  color: var(--color-warning);
}

.url-display {
  display: flex;
  gap: 0.75rem;
}

.url-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: 0.7rem;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.url-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

[data-theme="dark"] .url-input:focus {
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.code-block {
  position: relative;
}

.code-block pre {
  /* Theme-aware so embed code stays visible in both modes */
  background: var(--bg-tertiary);
  color: var(--text-primary);
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0 0 1rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
  border: 1px solid var(--border-default);
}

[data-theme="dark"] .code-block pre {
  background: #1f2937;
  color: #f9fafb;
}

.code-block code {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Syntax highlighting for embed code */
.code-highlighted .code-tag {
  color: #d73a49;
}
.code-highlighted .code-attr {
  color: #e36209;
}
.code-highlighted .code-string {
  color: #032f62;
}

[data-theme="dark"] .code-highlighted .code-tag {
  color: #e06c75;
}
[data-theme="dark"] .code-highlighted .code-attr {
  color: #d19a66;
}
[data-theme="dark"] .code-highlighted .code-string {
  color: #98c379;
}

.preview-container {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-component);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: 3rem 2rem;
  text-align: center;
  background: var(--bg-tertiary);
}

.preview-placeholder-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 1.5rem;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-placeholder-icon svg {
  width: 100%;
  height: 100%;
}

.preview-placeholder h3 {
  color: var(--text-primary);
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  margin: 0 0 0.5rem 0;
}

.preview-placeholder p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin: 0 0 1.5rem 0;
  max-width: 300px;
}

/* ==================== BILLING ORDER SELECTOR ==================== */

.billing-order-selector {
  margin-bottom: 1.25rem;
}

.billing-order-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.625rem;
}

.billing-order-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.billing-order-option {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--bg-primary);
}

.billing-order-option:hover {
  border-color: var(--accent-primary);
  background: var(--bg-tertiary);
}

.billing-order-option.active {
  border-color: var(--accent-primary);
  background: color-mix(in srgb, var(--accent-primary) 8%, var(--bg-primary));
}

.billing-order-option input[type="radio"] {
  display: none;
}

.billing-order-radio {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  margin-top: 2px;
  transition: all 0.15s ease;
  position: relative;
}

.billing-order-option.active .billing-order-radio {
  border-color: var(--accent-primary);
}

.billing-order-option.active .billing-order-radio::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-primary);
}

.billing-order-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.billing-order-name {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.billing-order-desc {
  font-size: 11px;
  color: var(--text-secondary);
}

@media (max-width: 600px) {
  .billing-order-options {
    grid-template-columns: 1fr;
  }
}

/* Dark mode deployment page - now handled by base styles with variables */

/* ==================== DEPLOYMENT PAGE RESPONSIVE ==================== */

@media (max-width: 768px) {
  .deployment-status-card,
  .deployment-section {
    padding: 0.75rem;
  }
  
  .deployment-page .page-header h2 {
    font-size: 1.5rem;
  }
  
  .url-display {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .url-input {
    width: 100%;
    font-size: 0.75rem;
    padding-left: 12px;
    padding-right: 12px;
    word-break: break-all;
  }
  
  .code-block pre {
    padding: 1rem;
    font-size: 0.75rem;
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
  }
  
  .preview-container iframe {
    height: 500px;
  }
  
  .preview-placeholder {
    min-height: 300px;
    padding: 2rem 1rem;
  }

  .deployment-unavailable-state {
    gap: 0.75rem;
    padding: 0.875rem;
  }
  
  .status-header {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }

  .status-header h3 {
    flex: 1;
  }
  
  .status-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .status-actions .btn {
    width: 100%;
    text-align: center;
  }
}

/* Tablet responsive for deployment page */
@media (min-width: 769px) and (max-width: 1024px) {
  .url-input {
    font-size: 0.7rem;
  }
  
  .code-block pre {
    font-size: 0.8rem;
  }
}

/* ==================== CONFIG FORM ==================== */

.config-form,
.settings-form {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  border: 1px solid #e5e7eb;
}

/* Mobile: Reduce padding for config-form and settings-form */
@media (max-width: 768px) {
  .config-form,
  .settings-form {
    padding: 2px;
  }

  /* Mobile: Reduce dashboard content left/right padding when config/settings tabs are active */
  .tab-agent-config-active .dashboard-content,
  .tab-settings-active .dashboard-content {
    padding-left: 0.5rem; /* 8px - reduced from 16px (1rem) */
    padding-right: 0.5rem; /* 8px - reduced from 16px (1rem) */
    padding-top: 1rem; /* Keep top padding */
    padding-bottom: calc(1rem + 160px); /* Extra 80px for FAB clearance */
  }

  /* Mobile: Increase form padding when config/settings tabs are active */
  .tab-agent-config-active .config-form,
  .tab-settings-active .settings-form {
    padding: 10px; /* Increased from 2px to 10px */
  }

  /* Mobile: Reduce dashboard content padding-bottom on test chatbot tab */
  .tab-test-active .dashboard-content {
    padding-bottom: calc(0.75rem + 80px);
  }

  /* Mobile: Reduce spacing between form-groups inside form-row (email/country stacked) */
  .settings-section .form-row .form-group {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: none;
  }

  /* Mobile: Add spacing between form-row and next sibling (country → WhatsApp gap) */
  .settings-section .form-row {
    margin-bottom: 1rem;
    padding-bottom: 0;
    border-bottom: none;
  }
}

[data-theme="dark"] .config-form,
[data-theme="dark"] .settings-form {
  background: #1f2937;
  border-color: #374151;
}

.config-section,
.settings-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-default);
  transition: border-color var(--transition-normal);
}

.config-section:last-child,
.settings-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.config-section h3,
.settings-section h3 {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--accent-primary);
  margin: 0 0 1.5rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--accent-primary);
  display: inline-block;
  letter-spacing: var(--tracking-tight);
  transition: color var(--transition-normal), border-color var(--transition-normal);
}

/* Section header with title and action button */
.section-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.section-header h3 {
  margin: 0 0 0 0;
  border-bottom: 2px solid var(--accent-primary);
}

.section-header .btn {
  flex-shrink: 0;
}

.color-input-group {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.color-input-group input[type="color"] {
  width: 60px;
  height: 40px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.color-input-group input[type="color"]:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.color-text-input {
  flex: 1;
}

.code-editor {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.8125rem;
}

/* ==================== PRODUCT CARDS ==================== */
/* Product image styles are now defined in product-card-top section above */

.price-current {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  transition: color var(--transition-normal);
}

.price-old {
  font-size: 12px;
  color: var(--text-tertiary);
  text-decoration: line-through;
  transition: color var(--transition-normal);
  margin-left: calc(0.5rem - 3px);
}

.stock-info {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: color var(--transition-normal);
}

/* ==================== AUTHENTICATION PAGES ==================== */

/* ==================== AUTH PAGE - MODERN AI THEME ==================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  
  /* Modern AI-themed gradient background - Light mode */
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(120, 119, 198, 0.3), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(139, 92, 246, 0.2), transparent),
    radial-gradient(ellipse 40% 60% at 0% 100%, rgba(79, 70, 229, 0.15), transparent),
    linear-gradient(180deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
}

/* Dark mode auth page */
[data-theme="dark"] .auth-page {
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139, 92, 246, 0.25), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(79, 70, 229, 0.2), transparent),
    radial-gradient(ellipse 40% 60% at 0% 100%, rgba(124, 58, 237, 0.15), transparent),
    linear-gradient(180deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
}

/* Grid pattern overlay */
.auth-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
}

[data-theme="dark"] .auth-page::before {
  background-image: 
    linear-gradient(rgba(139, 92, 246, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.08) 1px, transparent 1px);
}

/* Floating orbs animation */
.auth-page::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  animation: floatOrb 15s ease-in-out infinite;
  pointer-events: none;
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, 50px) scale(1.1); }
}

.auth-container {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 1rem 2.5rem 2.5rem 2.5rem; /* padding-top: 16px (1rem), rest: 40px (2.5rem) */
  width: 100%;
  max-width: 420px;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(139, 92, 246, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  position: relative;
  z-index: 1;
  border: 1px solid rgba(139, 92, 246, 0.15);
}

[data-theme="dark"] .auth-container {
  background: rgba(26, 26, 46, 0.9);
  border: 1px solid rgba(139, 92, 246, 0.25);
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(139, 92, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Shake animation for login errors */
.shake-animation {
  animation: shake 0.6s cubic-bezier(.36,.07,.19,.97) both;
  transform-origin: center;
  backface-visibility: hidden;
  perspective: 1000px;
  animation-iteration-count: 1;
  will-change: transform;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(139, 92, 246, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 0 12px rgba(239, 68, 68, 0.3) !important;
  border: 1px solid rgba(239, 68, 68, 0.5) !important;
}

[data-theme="dark"] .shake-animation {
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(139, 92, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 12px rgba(239, 68, 68, 0.4) !important;
  border: 1px solid rgba(239, 68, 68, 0.6) !important;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-6px); }
  20%, 40%, 60%, 80% { transform: translateX(6px); }
}

/* Professional authentication error banner */
.auth-error-banner {
  display: flex;
  align-items: center;
  background-color: rgba(239, 68, 68, 0.08);
  border-left: 4px solid #ef4444;
  border-top: 1px solid rgba(239, 68, 68, 0.2);
  border-right: 1px solid rgba(239, 68, 68, 0.2);
  border-bottom: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 0.95rem;
  color: #dc2626;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  animation: fadeInDown 0.3s ease;
}

.auth-error-banner svg {
  margin-right: 12px;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: #dc2626;
}

.auth-error-message {
  flex: 1;
  line-height: 1.4;
  font-weight: 500;
}

[data-theme="dark"] .auth-error-banner {
  background-color: rgba(239, 68, 68, 0.15);
  border-top: 1px solid rgba(239, 68, 68, 0.3);
  border-right: 1px solid rgba(239, 68, 68, 0.3);
  border-bottom: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  color: #f87171;
}

[data-theme="dark"] .auth-error-banner svg {
  color: #f87171;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Auth logo container */
.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem; /* 8px instead of 24px (1.5rem) */
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.auth-logo:hover {
  opacity: 0.8;
}

.auth-logo img {
  height: 48px;
  width: auto;
  max-width: 100%;
}

/* Logo switching for light/dark mode
   - logo-dark = dark-colored logo with text (blue) = for LIGHT mode backgrounds
   - logo-light = light-colored logo with text (white) = for DARK mode backgrounds
*/

/* Default (light mode): show dark logo with text, hide light logo */
.auth-logo .logo-light {
  display: none;
}

.auth-logo .logo-dark {
  display: block;
}

/* Dark mode: show light logo with text, hide dark logo */
[data-theme="dark"] .auth-logo .logo-light {
  display: block;
}

[data-theme="dark"] .auth-logo .logo-dark {
  display: none;
}

.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.025em;
}

[data-theme="dark"] .auth-header h1 {
  color: #f9fafb;
}

.auth-header p {
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0;
}

[data-theme="dark"] .auth-header p {
  color: #9ca3af;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* OR Divider with lines on both sides */
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.5rem 0;
  color: #6b7280;
  font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e5e7eb;
}

.auth-divider span {
  padding: 0 1rem;
}

/* Google Sign-In Button Styling */
.google-signin-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: 0.5rem;
}

.google-signin-button {
  width: 100%;
  max-width: 270px;
  height: 42px;
  background-color: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 4px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  outline: none;
  transition: all 0.25s ease;
  font-family: 'Roboto', 'Arial', sans-serif;
  position: relative;
}

.google-signin-button:hover {
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25);
  background-color: #f8f8f8;
}

.google-signin-button:active {
  background-color: #eee;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
}

.google-signin-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.google-icon-wrapper {
  width: 42px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px 0 0 4px;
  background-color: transparent;
}

.google-icon {
  width: 18px;
  height: 18px;
}

.google-btn-text {
  flex-grow: 1;
  text-align: center;
  font-size: 14px;
  letter-spacing: 0.2px;
  font-weight: 500;
  color: #3c4043;
  margin-right: 12px;
}

.google-loading {
  margin-top: 10px;
  text-align: center;
  color: #6b7280;
  font-size: 0.875rem;
}

/* Dark mode support for Google button */
[data-theme="dark"] .google-signin-button {
  background-color: rgba(48, 49, 52, 0.9);
  border-color: rgba(95, 99, 104, 0.6);
}

[data-theme="dark"] .google-signin-button:hover {
  background-color: rgba(60, 64, 67, 0.9);
}

[data-theme="dark"] .google-signin-button:active {
  background-color: rgba(32, 33, 36, 0.9);
}

[data-theme="dark"] .google-btn-text {
  color: #e8eaed;
}

[data-theme="dark"] .auth-divider {
  color: #9ca3af;
}

[data-theme="dark"] .auth-divider::before,
[data-theme="dark"] .auth-divider::after {
  border-bottom-color: rgba(55, 65, 81, 0.5);
}

/* Auth form input dark mode */
[data-theme="dark"] .auth-form .form-group input {
  background: rgba(31, 41, 55, 0.8);
  border-color: rgba(75, 85, 99, 0.6);
  color: #f9fafb;
}

[data-theme="dark"] .auth-form .form-group input:focus {
  border-color: rgba(139, 92, 246, 0.6);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

[data-theme="dark"] .auth-form .form-group input::placeholder {
  color: #6b7280;
}

[data-theme="dark"] .auth-form .form-group label {
  color: #d1d5db;
}

.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.875rem;
}

[data-theme="dark"] .auth-footer {
  color: #9ca3af;
}

.auth-footer a {
  color: #8b5cf6;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.auth-footer a:hover {
  color: #7c3aed;
  text-decoration: underline;
}

[data-theme="dark"] .auth-footer a {
  color: #a78bfa;
}

[data-theme="dark"] .auth-footer a:hover {
  color: #c4b5fd;
}

/* Forgot password link */
.forgot-password-link {
  display: block;
  text-align: right;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.forgot-password-link a {
  color: #6b7280;
  font-size: 0.813rem;
  text-decoration: none;
  transition: color 0.2s ease;
}

.forgot-password-link a:hover {
  color: #8b5cf6;
}

[data-theme="dark"] .forgot-password-link a {
  color: #9ca3af;
}

[data-theme="dark"] .forgot-password-link a:hover {
  color: #a78bfa;
}

/* ==================== OTP INPUT ==================== */
.otp-input-group {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.otp-input {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
  border: 2px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.otp-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.otp-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Verification icon */
.verification-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(59, 130, 246, 0.15) 100%);
  border-radius: 50%;
  color: var(--accent-primary);
}

.verification-icon svg {
  width: 48px;
  height: 48px;
}

/* Auth email display */
.auth-email {
  font-weight: 600;
  color: var(--accent-primary);
  word-break: break-all;
}

/* Resend section */
.resend-section {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-default);
}

.resend-text {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0 0 0.5rem 0;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.5rem 1rem;
  transition: all var(--transition-fast);
}

.btn-link:hover:not(:disabled) {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

.btn-link:disabled {
  color: var(--text-tertiary);
  cursor: not-allowed;
}

/* Success and Error states for auth pages */
.success-state,
.error-state {
  text-align: center;
}

.success-icon,
.error-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.success-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.error-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.success-icon svg,
.error-icon svg {
  width: 64px;
  height: 64px;
}

.success-message,
.error-message {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.success-hint {
  color: var(--text-tertiary);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

/* Loading state */
.loading-state {
  text-align: center;
  padding: 3rem 0;
}

.loading-state p {
  color: var(--text-secondary);
  margin-top: 1rem;
}

.loading-note {
  color: var(--text-muted) !important;
  font-size: 0.875rem;
  margin-top: 0.5rem !important;
}

/* Password input wrapper with toggle */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  padding-right: 44px;
}

.password-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  transition: color 0.2s ease;
}

.password-toggle-btn:hover {
  color: #6b7280;
}

[data-theme="dark"] .password-toggle-btn {
  color: #6b7280;
}

[data-theme="dark"] .password-toggle-btn:hover {
  color: #9ca3af;
}

.password-toggle-btn svg {
  width: 20px;
  height: 20px;
}

/* Email validation styles */
.input-with-feedback {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-feedback input {
  flex: 1;
  padding-right: 40px;
}

.input-status {
  position: absolute;
  right: 12px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-status svg {
  width: 18px;
  height: 18px;
}

.input-status.checking svg {
  color: #6b7280;
  animation: spin 1s linear infinite;
}

.input-status.success svg {
  color: #10b981;
}

.input-status.error svg {
  color: #ef4444;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.form-group.has-error input,
.input-error {
  border-color: #ef4444 !important;
}

.form-group.has-error input:focus,
.input-error:focus {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.form-group.has-success input,
.input-success {
  border-color: #10b981 !important;
}

.form-group.has-success input:focus,
.input-success:focus {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

.field-error {
  color: #ef4444;
  font-size: 0.75rem;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

[data-theme="dark"] .field-error {
  color: #f87171;
}

.field-success {
  color: #10b981;
  font-size: 0.75rem;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

[data-theme="dark"] .field-success {
  color: #34d399;
}

[data-theme="dark"] .input-status.checking svg {
  color: #9ca3af;
}

[data-theme="dark"] .input-status.success svg {
  color: #34d399;
}

[data-theme="dark"] .input-status.error svg {
  color: #f87171;
}

[data-theme="dark"] .form-group.has-error input,
[data-theme="dark"] .input-error {
  border-color: #f87171 !important;
}

[data-theme="dark"] .form-group.has-success input,
[data-theme="dark"] .input-success {
  border-color: #34d399 !important;
}

/* Password Requirements */
.password-requirements {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.75rem;
}

.requirement {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6b7280;
  transition: color 0.2s ease;
}

.requirement svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.requirement.valid {
  color: #10b981;
}

.requirement.valid svg {
  color: #10b981;
}

.requirement:not(.valid) svg {
  color: #9ca3af;
}

[data-theme="dark"] .requirement {
  color: #9ca3af;
}

[data-theme="dark"] .requirement.valid {
  color: #34d399;
}

[data-theme="dark"] .requirement.valid svg {
  color: #34d399;
}

[data-theme="dark"] .requirement:not(.valid) svg {
  color: #64748b;
}

/* ==================== PUBLIC CHATBOT ==================== */

.public-chatbot {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
}

.public-chatbot .chat-container {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  height: 100vh;
  /* Remove border-radius for fixed header/footer */
  border-radius: 0;
}

/* Fixed header for public chatbot */
.public-chatbot .chat-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1200px;
  z-index: 1000;
  /* Remove border-radius for fixed positioning */
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}

/* Public chatbot header content */
.public-chatbot .chat-header-content {
  flex: 1;
  min-width: 0; /* Allow text truncation */
}

/* Public chatbot header actions */
.public-chatbot .chat-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-shrink: 0;
  margin-left: 1rem;
}

/* Fixed footer for public chatbot */
.public-chatbot .chat-input-container {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1200px;
  z-index: 1000;
  /* Remove border-radius for fixed positioning */
  border-radius: 0;
}

/* Position chat messages between fixed header and footer */
.public-chatbot .chat-messages {
  flex: none; /* Override the general flex: 1 */
  position: fixed;
  top: 90px; /* Base header height for new structure */
  bottom: 100px; /* Estimated footer height */
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1200px;
  overflow-y: auto;
  z-index: 1; /* Below header/footer but above background */
}

/* Responsive header height adjustments */
@media (max-width: 767px) {
  .public-chatbot .chat-messages {
    top: 80px; /* Compact header on mobile */
    padding-left: 0.5rem; /* Consistent left padding */
    padding-right: 0.5rem; /* Consistent right padding */
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .public-chatbot .chat-messages {
    top: 85px; /* Shorter header on tablet */
  }
}

/* Subtle left/right borders only on desktop */
@media (min-width: 768px) {
  .public-chatbot .chat-messages {
    border-left: 1px solid var(--border-default);
    border-right: 1px solid var(--border-default);
    border-radius: 8px;
  }
}

.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  text-align: center;
}

.error-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-icon svg {
  width: 100%;
  height: 100%;
}

.error-container h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

.error-container p {
  color: var(--text-secondary);
  margin: 0;
}

/* Chat header responsive styles */
@media (max-width: 640px) {
  .chat-header {
    padding: 0.75rem; /* Mobile: 12px all around */
  }

  .chat-header-title {
    font-size: var(--text-base);
  }

  .chat-header-subtitle {
    font-size: var(--text-xs);
  }

  /* Public chatbot mobile: Horizontal layout with text-only buttons */
  .public-chatbot .chat-header {
    flex-direction: row; /* Keep horizontal layout */
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }

  .public-chatbot .chat-header-content {
    flex: 1;
    min-width: 0; /* Allow text truncation */
  }

  .public-chatbot .chat-actions {
    flex-shrink: 0;
    justify-content: flex-end; /* Right-align buttons in their box */
    margin-left: 0.75rem;
    gap: 0.5rem;
  }

  .public-chatbot .chat-actions .btn {
    flex: 0 0 auto;
  }

  .public-chatbot .chat-actions .btn-new-chat {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }

  .public-chatbot .chat-actions .btn-new-chat svg {
    display: none; /* Hide icon on mobile, show only text */
  }

  .public-chatbot .chat-actions .btn-new-chat .btn-text-desktop {
    display: none; /* Hide desktop text on mobile */
  }

  .public-chatbot .chat-actions .btn-new-chat .btn-text-mobile {
    display: inline; /* Show mobile text */
  }

  .public-chatbot .chat-actions .btn-secondary {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }

  .public-chatbot .chat-actions .btn-secondary svg {
    display: none; /* Hide icon on mobile, show only text */
  }

  .public-chatbot .chat-actions .btn-secondary .btn-text-desktop {
    display: none; /* Hide desktop text on mobile */
  }

  .public-chatbot .chat-actions .btn-secondary .btn-text-mobile {
    display: inline; /* Show mobile text */
  }
}

/* ==================== NAVBAR ACCOUNTS DROPDOWN ==================== */

.accounts-dropdown {
  position: relative;
}

/* Override btn-outline styles for accounts button */
.btn.accounts-button,
button.accounts-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1.5px solid rgba(139, 92, 246, 0.4) !important;
  color: #e5e7eb !important;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn.accounts-button:hover,
button.accounts-button:hover {
  background: rgba(139, 92, 246, 0.15) !important;
  border-color: rgba(139, 92, 246, 0.6) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
  transform: translateY(-1px);
}

.dropdown-arrow {
  font-size: 0.625rem;
  transition: transform 0.2s ease;
  opacity: 0.8;
  margin-left: 0.25rem;
}

.accounts-button:hover .dropdown-arrow {
  opacity: 1;
}

.accounts-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.accounts-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(139, 92, 246, 0.1);
  min-width: 160px;
  z-index: 10000;
  overflow: hidden;
  animation: dropdownSlideIn 0.2s ease;
}

@keyframes dropdownSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

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

.dropdown-item:hover {
  background: rgba(139, 92, 246, 0.15);
  color: #ffffff;
  padding-left: 1.25rem;
}

@media (max-width: 768px) {
  .accounts-dropdown {
    width: 100%;
    margin-top: 1rem;
  }
  
  .accounts-button {
    width: 100%;
    justify-content: center;
  }
  
  .accounts-dropdown-menu {
    right: auto;
    left: 0;
    width: 100%;
  }
}

/* ==================== BUSINESS SETUP PAGE ==================== */

/* .business-setup-page - No max-width constraint, uses full available width */

.setup-selection {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.selection-card {
  flex: 1;
  min-width: 300px;
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.selection-card:hover {
  border-color: #2563eb;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}

.selection-card.selected {
  border-color: #2563eb;
  background: linear-gradient(to bottom, #eff6ff 0%, #ffffff 10%);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
  border-width: 2px;
}

.custom-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  cursor: pointer;
  position: relative;
}

.custom-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: relative;
  height: 24px;
  width: 24px;
  background: var(--bg-secondary);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-md);
  flex-shrink: 0;
  transition: all var(--transition-fast);
  margin-top: 2px;
}

.custom-checkbox:hover .checkmark {
  border-color: var(--accent-primary);
}

.custom-checkbox input:checked ~ .checkmark {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.custom-checkbox input:checked ~ .checkmark::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 12px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-content {
  flex: 1;
}

.selection-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.01em;
}

.selection-subtitle {
  font-size: 0.9375rem;
  color: #4b5563;
  margin: 0;
  line-height: 1.6;
  font-weight: 500;
}

.checkbox-content h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.25rem 0;
}

.checkbox-content p {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
}

.field-hint {
  margin-top: 0.75rem;
  margin-bottom: 4px;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border-left: 3px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  line-height: var(--leading-normal);
  transition: background-color var(--transition-normal), border-color var(--transition-normal), color var(--transition-normal);
}

.selection-card .field-hint {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  border-left: none;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  background: transparent;
  padding: 1.25rem 0 0 0;
  transition: border-color var(--transition-normal), color var(--transition-normal);
}

.selection-card .field-hint strong {
  color: var(--text-primary);
  font-weight: var(--font-semibold);
  display: block;
  margin-bottom: 0.375rem;
  transition: color var(--transition-normal);
}

.setup-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid #e5e7eb;
}

.setup-tabs .tab-button {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: -2px;
}

.setup-tabs .tab-button:hover {
  color: #111827;
  background: #f9fafb;
}

.setup-tabs .tab-button.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  font-weight: 600;
}

.tab-content {
  background: var(--bg-component);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid var(--border-default);
}

/* Mobile: Reduce tab-content padding */
@media (max-width: 768px) {
  .tab-content {
    padding: 0.5rem; /* 8px */
  }
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.content-header h3 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin: 0;
  transition: color var(--transition-normal);
}

.services-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.service-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.service-info h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.5rem 0;
}

.service-info p {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
}

.service-actions {
  display: flex;
  gap: 0.5rem;
}

/* Horizontal Product Cards */
.products-grid-horizontal {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.product-card-horizontal {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  transition: all 0.2s;
}

.product-card-horizontal:hover {
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.product-image-small {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  background: #e5e7eb;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s;
}

.product-image-small:hover {
  transform: scale(1.05);
}

.product-image-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image-placeholder-small {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  background: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
}

.product-image-placeholder-small svg {
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

.product-info-compact {
  flex: 1;
  min-width: 0;
}

.product-info-compact h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin: 0 0 0.25rem 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-price-compact {
  font-size: 1rem;
  font-weight: 600;
  color: #2563eb;
  margin: 0 0 0.25rem 0;
}

.product-description-compact {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-actions-compact {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.image-preview-small {
  position: relative;
  display: inline-block;
  width: 120px;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
}

.image-preview-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Image Modal */
.image-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  background: white;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.image-modal-content .modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.image-modal-content .modal-close:hover {
  background: rgba(0, 0, 0, 0.9);
}

.image-modal-content img {
  width: 100%;
  height: auto;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
}

/* ==================== RESPONSIVE ==================== */

/* Tablet/Medium screens: Stack page header at 1000-1050px breakpoint */
@media (max-width: 1050px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .page-header h2 {
    font-size: 1.75rem; /* Reduced from 2rem */
    margin-bottom: 0.5rem;
  }
  
  .page-subtitle {
    margin-top: 0;
  }
}

@media (max-width: 768px) {
  .dashboard-header {
    padding: 0.875rem 0.75rem; /* Mobile: 14px top/bottom, 12px left/right */
  }

  .dashboard-content {
    padding: 0.75rem;
    padding-bottom: calc(0.75rem + 160px); /* Extra 80px for FAB clearance (0.75rem + 80px for FAB + 80px extra) */
  }
  
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .businesses-grid,
  .services-grid,
  .products-grid {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .chat-message {
    max-width: 90%;
  }
  
  .auth-container {
    padding: 0.75rem; /* Mobile: 12px all around */
  }
  
  .modal-content {
    margin: 1rem;
    max-height: calc(100vh - 2rem);
  }

  .business-card,
  .service-card,
  .product-card {
    padding: 0.75rem; /* Mobile: 12px */
  }

  .service-expand-btn {
    padding: 0.5rem 0.75rem; /* Mobile: 12px left/right */
  }

  .advanced-section {
    padding: 1.25rem 0.75rem; /* Mobile: 12px left/right, 20px top/bottom */
  }
}

/* ==================== FORM CONTAINER ==================== */

.form-container {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.business-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.required {
  color: #ef4444;
  margin-left: 2px;
}

/* ==================== DANGER ZONE ==================== */

.danger-zone {
  margin-top: 3rem;
  padding: 2rem;
  background: rgba(239, 68, 68, 0.1);
  border: 2px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

[data-theme="dark"] .danger-zone {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}

.danger-zone h3 {
  color: var(--color-error);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color var(--transition-normal);
}

.danger-zone h3::before {
  content: '⚠️';
  font-size: 1.25rem;
}

.danger-zone p {
  color: var(--color-error);
  opacity: 0.9;
  font-size: var(--text-base);
  margin: 0 0 1.5rem 0;
  line-height: var(--leading-relaxed);
  transition: color var(--transition-normal);
}

[data-theme="dark"] .danger-zone p {
  opacity: 0.85;
}

.danger-zone .btn-danger {
  background: var(--color-error);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: var(--font-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--text-base);
  align-self: flex-end;
}

.danger-zone .btn-danger:hover {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .danger-zone .btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.danger-zone .btn-danger:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2);
}

.danger-zone .btn-danger:disabled {
  background: rgba(239, 68, 68, 0.5);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.6;
}

.danger-zone-warning {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
  color: var(--color-error);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  transition: background-color var(--transition-normal), border-color var(--transition-normal), color var(--transition-normal);
}

[data-theme="dark"] .danger-zone-warning {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}

.danger-zone-warning strong {
  color: var(--color-error);
  font-weight: var(--font-semibold);
}

.danger-zone-businesses {
  margin-top: 1rem;
}

.danger-zone-businesses-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.danger-zone-business-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #7f1d1d;
}

.danger-zone-settings-btn {
  border: 1px solid rgba(220, 38, 38, 0.24);
  background: rgba(254, 242, 242, 0.9);
  color: #b91c1c;
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.danger-zone-settings-btn:hover {
  transform: translateY(-1px);
  background: #ffffff;
  box-shadow: 0 10px 20px rgba(220, 38, 38, 0.12);
}

.danger-zone-business-card {
  border: 1px solid rgba(220, 38, 38, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(254, 242, 242, 0.92));
  border-radius: 16px;
  padding: 0.95rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.danger-zone-business-card-name {
  font-size: 1rem;
  font-weight: 800;
  color: #7f1d1d;
  text-align: left;
  flex: 1 1 auto;
}

[data-theme="dark"] .danger-zone-business-name,
[data-theme="dark"] .danger-zone-business-card-name {
  color: #fecaca;
}

[data-theme="dark"] .danger-zone-settings-btn {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.2);
  border-color: rgba(248, 113, 113, 0.22);
}

[data-theme="dark"] .danger-zone-business-card {
  background: linear-gradient(180deg, rgba(69, 10, 10, 0.44), rgba(60, 12, 12, 0.7));
  border-color: rgba(248, 113, 113, 0.18);
}

.account-info-value {
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  color: var(--text-primary);
  font-weight: var(--font-medium);
  margin-top: 0.5rem;
  transition: background-color var(--transition-normal), border-color var(--transition-normal), color var(--transition-normal);
}

/* Account Info Grid - Desktop grid layout for account settings */
.account-info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.account-info-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  transition: background-color var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.account-info-card:hover {
  border-color: var(--border-emphasis);
  box-shadow: var(--shadow-sm);
}

.account-info-card label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
  transition: color var(--transition-normal);
}

.account-info-card .account-info-value {
  margin-top: 0;
  margin-bottom: var(--space-xs);
}

.account-info-card .field-hint {
  margin-top: 0;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  line-height: var(--leading-relaxed);
}

.authorization-card {
  position: relative;
  overflow: hidden;
}

.authorization-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(59, 130, 246, 0.05), rgba(14, 165, 233, 0.02));
  pointer-events: none;
}

.authorization-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
  z-index: 1;
}
.account-info-card.authorization-card .authorization-card-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
}

.authorization-card-header-left {
  flex: 1 1 auto;
  min-width: 0;
}

.authorization-card-header-right {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.account-info-card.authorization-card .authorization-card-header-left > label {
  display: block;
  margin-bottom: 0;
}

.authorization-switch-row {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}
.account-info-card.authorization-card .authorization-switch-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  margin-left: auto;
  white-space: nowrap;
}

.authorization-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  min-height: 28px;
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.authorization-status-pill.pill-enabled {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.26);
  color: #0369a1;
}

.authorization-status-pill.pill-disabled {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.26);
  color: var(--text-secondary);
}

.authorization-card .field-hint {
  position: relative;
  z-index: 1;
  margin-top: 0.55rem;
}

.authorization-card-glow {
  animation: authorizationCardGlow 2.2s ease;
}

@keyframes authorizationCardGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0);
    border-color: var(--border-default);
  }
  20% {
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12), 0 16px 32px rgba(14, 165, 233, 0.14);
    border-color: rgba(14, 165, 233, 0.35);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0);
    border-color: var(--border-default);
  }
}

.authorization-switch {
  width: 50px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--border-default);
  background: var(--bg-tertiary);
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.authorization-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.22s ease;
}

.authorization-switch.switch-enabled {
  background: linear-gradient(135deg, #0891b2 0%, #0284c7 100%);
  border-color: #0284c7;
}

.authorization-switch.switch-enabled .authorization-switch-thumb {
  transform: translateX(22px);
}

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

.authorization-error {
  position: relative;
  z-index: 1;
  margin-top: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(220, 38, 38, 0.28);
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  font-size: 0.78rem;
  line-height: 1.35;
}

.admin-tab-filter-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.admin-filter-btn {
  border: 1px solid var(--border-default);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.admin-filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

.admin-filter-btn.active {
  background: rgba(8, 145, 178, 0.12);
  border-color: rgba(8, 145, 178, 0.28);
  color: #0f766e;
}

.admin-email-cell {
  position: relative;
  display: inline-flex;
  align-items: flex-start;
  padding-top: 1rem;
  min-width: 220px;
}

.admin-access-mini-badge {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.12rem 0.48rem;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.28);
  color: #b45309;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-card-email {
  position: relative;
  padding-top: 1.15rem;
}

.admin-card-status-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.admin-access-inline-badge {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.28);
  color: #b45309;
}

[data-theme="dark"] .admin-access-inline-badge {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.32);
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}

.admin-user-actions-card {
  width: 100%;
  justify-content: flex-start;
}

.admin-login-as-modal {
  max-width: 540px;
}

.admin-login-as-hint {
  margin: 0 0 1rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.admin-login-as-error {
  margin-top: 0.75rem;
  border: 1px solid rgba(220, 38, 38, 0.2);
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .authorization-card-header {
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
  }

  .authorization-switch-row {
    width: auto;
    justify-content: flex-end;
    gap: 0.45rem;
    flex-wrap: nowrap;
  }

  .account-info-card.authorization-card .authorization-card-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
  }

  .account-info-card.authorization-card .authorization-card-header-left > label {
    margin-bottom: 0;
    padding-right: 0.5rem;
  }

  .account-info-card.authorization-card .authorization-card-header-right {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
  }

  .account-info-card.authorization-card .authorization-switch-row {
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
    gap: 0.45rem;
    flex-wrap: nowrap;
  }

  .left-menu-admin-access-banner {
    margin: 0 0 0.25rem;
    padding: 2px 4px;
    border-radius: 2px;
    min-height: 0;
    gap: 0.35rem;
  }

  .admin-email-cell {
    min-width: 0;
  }

  .admin-card-status-badges {
    justify-content: flex-end;
    gap: 0.4rem;
  }

  .admin-user-actions,
  .admin-user-actions-card {
    justify-content: flex-start;
  }

  .danger-zone-businesses-grid {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .danger-zone-business-card {
    flex-direction: column;
    align-items: stretch;
    padding: 0.9rem;
  }

  .danger-zone-business-card-name {
    text-align: center;
  }

  .danger-zone-settings-btn {
    width: 100%;
  }

  .danger-zone .btn-danger {
    align-self: center;
  }
}

.authorization-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 19000;
}

.authorization-dialog {
  width: min(560px, 100%);
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: 16px;
  box-shadow: 0 28px 48px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.authorization-dialog-header {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 1rem 1rem 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
}

.authorization-dialog-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.authorization-dialog-icon.enable {
  color: #0e7490;
  background: rgba(14, 116, 144, 0.14);
}

.authorization-dialog-icon.disable {
  color: #9a3412;
  background: rgba(194, 65, 12, 0.14);
}

.authorization-dialog-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-primary);
}

.authorization-dialog-header p {
  margin: 0.25rem 0 0;
  font-size: 0.83rem;
  color: var(--text-secondary);
}

.authorization-dialog-header-stacked {
  display: grid;
  gap: 0.45rem;
}

.authorization-dialog-header-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.authorization-dialog-header-stacked .authorization-dialog-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.authorization-dialog-header-stacked h3 {
  font-size: 1.125rem;
}

.authorization-dialog-header-stacked p {
  margin: 0;
}

.authorization-dialog-body {
  padding: 0.95rem 1rem 1rem;
}

.authorization-dialog-body p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.authorization-dialog-body ul {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  display: grid;
  gap: 0.35rem;
}

.authorization-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  padding: 0.95rem 1rem 1rem;
  border-top: 1px solid var(--border-subtle);
}

/* Desktop: 2 columns for account info cards */
@media (min-width: 1024px) {
  .account-info-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
  }
}

/* Tablet: Keep single column but add more spacing */
@media (min-width: 768px) and (max-width: 1023px) {
  .account-info-grid {
    gap: var(--space-xl);
  }
  
  .account-info-card {
    padding: var(--space-xl);
  }
}

/* Mobile: Reduce padding for form-container, danger-zone, account-info-card */
@media (max-width: 768px) {
  .form-container {
    padding: 0.75rem; /* Mobile: 12px */
  }

  .danger-zone {
    padding: 0.75rem; /* Mobile: 12px */
  }

  .account-info-card {
    padding: 0.75rem; /* Mobile: 12px */
  }
}

/* ==================== CONFIRMATION DIALOG ==================== */

.confirmation-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.confirmation-dialog {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 500px;
  width: 100%;
  padding: 2rem;
  animation: dialogSlideIn 0.2s ease-out;
}

@keyframes dialogSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.confirmation-dialog-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.confirmation-dialog-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fef2f2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.confirmation-dialog-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.confirmation-dialog-body {
  margin-bottom: 1.5rem;
}

.confirmation-dialog-message {
  color: #6b7280;
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0 0 1.5rem 0;
  white-space: pre-line;
}

.confirmation-dialog-message strong {
  color: #dc2626;
  font-weight: 600;
}

.confirmation-dialog-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-default);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  transition: border-color var(--transition-fast);
  margin-top: 1rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.confirmation-dialog-input:focus {
  outline: none;
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

[data-theme="dark"] .confirmation-dialog-input:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.confirmation-dialog-input.error {
  border-color: #dc2626;
  background: #fef2f2;
}

.confirmation-dialog-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.confirmation-dialog-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.confirmation-dialog-btn-cancel {
  background: #f3f4f6;
  color: #374151;
}

.confirmation-dialog-btn-cancel:hover {
  background: #e5e7eb;
}

.confirmation-dialog-btn-confirm {
  background: #dc2626;
  color: white;
}

.confirmation-dialog-btn-confirm:hover {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.confirmation-dialog-btn-confirm:disabled {
  background: #fca5a5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.confirmation-dialog-btn-confirm .button-loading-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.confirmation-dialog-btn-cancel:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.confirmation-dialog-btn-ok {
  min-width: 80px;
}

/* ==================== UNSAVED CHANGES DIALOG ==================== */

.unsaved-changes-dialog {
  max-width: 480px;
}

.unsaved-changes-dialog .confirmation-dialog-icon.warning-icon {
  background: #fef3c7;
  color: #d97706;
}

[data-theme="dark"] .unsaved-changes-dialog .confirmation-dialog-icon.warning-icon {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.unsaved-actions {
  justify-content: space-between !important;
  gap: 0.5rem;
}

.unsaved-actions .confirmation-dialog-btn {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 0.5rem;
  font-size: 0.875rem;
}

.unsaved-actions .confirmation-dialog-btn-save {
  background: #059669;
  color: white;
  order: 3;
}

.unsaved-actions .confirmation-dialog-btn-save:hover {
  background: #047857;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.unsaved-actions .confirmation-dialog-btn-discard {
  background: #dc2626;
  color: white;
  order: 2;
}

.unsaved-actions .confirmation-dialog-btn-discard:hover {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.unsaved-actions .confirmation-dialog-btn-cancel {
  background: #6b7280;
  color: white;
  order: 1;
}

.unsaved-actions .confirmation-dialog-btn-cancel:hover {
  background: #4b5563;
}

/* Responsive design for unsaved changes dialog */
@media (max-width: 640px) {
  .unsaved-actions {
    flex-direction: column;
    gap: 0.5rem;
  }

  .unsaved-actions .confirmation-dialog-btn {
    width: 100%;
    order: initial !important;
  }

  .unsaved-actions .confirmation-dialog-btn-save {
    order: 3 !important;
  }

  .unsaved-actions .confirmation-dialog-btn-discard {
    order: 2 !important;
  }

  .unsaved-actions .confirmation-dialog-btn-cancel {
    order: 1 !important;
  }
}

@media (max-width: 480px) {
  .unsaved-changes-dialog {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
  }

  .unsaved-actions .confirmation-dialog-btn {
    padding: 0.875rem 0.75rem;
    font-size: 0.9375rem;
  }
}

/* ==================== ACTION DIALOG ==================== */
.action-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 11500;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.action-dialog {
  background: white;
  border-radius: 16px;
  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;
  width: 100%;
  padding: 0;
  animation: dialogSlideIn 0.2s ease-out;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}

.action-dialog-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 2rem 2rem 1.5rem 2rem;
  border-bottom: 1px solid var(--border-default);
}

.action-dialog-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.action-dialog-icon-info {
  background: #dbeafe;
  color: #3b82f6;
}

.action-dialog-icon-warning {
  background: #fef3c7;
  color: #f59e0b;
}

.action-dialog-icon-error {
  background: #fee2e2;
  color: #ef4444;
}

.action-dialog-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  flex: 1;
}

.action-dialog-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.action-dialog-body {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-y: auto;
}

.action-dialog-message {
  color: #6b7280;
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0;
  white-space: pre-line;
}

.action-dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem 2rem;
  border-left: 1px solid var(--border-default);
  min-width: 180px;
  max-width: 200px;
  background: var(--bg-secondary);
}

.action-dialog-action-btn {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-align: left;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-dialog-action-btn-info {
  background: #eff6ff;
  color: #1e40af;
}

.action-dialog-action-btn-info:hover {
  background: #dbeafe;
  transform: translateX(2px);
}

.action-dialog-action-btn-warning {
  background: #fffbeb;
  color: #92400e;
}

.action-dialog-action-btn-warning:hover {
  background: #fef3c7;
  transform: translateX(2px);
}

.action-dialog-action-btn-error {
  background: #fef2f2;
  color: #991b1b;
}

.action-dialog-action-btn-error:hover {
  background: #fee2e2;
  transform: translateX(2px);
}

.action-dialog-footer {
  display: flex;
  justify-content: flex-end;
  padding: 1rem 2rem;
  border-top: 1px solid var(--border-default);
  background: var(--bg-secondary);
}

.action-dialog-footer-buttons {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  justify-content: flex-end;
}

.action-dialog-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.action-dialog-btn-cancel {
  background: #f3f4f6;
  color: #374151;
}

.action-dialog-btn-cancel:hover {
  background: #e5e7eb;
}

.action-dialog-btn-confirm {
  background: #3b82f6;
  color: white;
}

.action-dialog-btn-confirm:hover {
  background: #2563eb;
}

.action-dialog-btn-confirm-info {
  background: #3b82f6;
}

.action-dialog-btn-confirm-info:hover {
  background: #2563eb;
}

.action-dialog-btn-confirm-warning {
  background: #f59e0b;
  color: white;
}

.action-dialog-btn-confirm-warning:hover {
  background: #d97706;
}

.action-dialog-btn-confirm-error {
  background: #ef4444;
  color: white;
}

.action-dialog-btn-confirm-error:hover {
  background: #dc2626;
}

/* Dark mode for action dialog */
[data-theme="dark"] .action-dialog {
  background: #1e293b;
  border: 1px solid #334155;
}

[data-theme="dark"] .action-dialog-title {
  color: #f1f5f9;
}

[data-theme="dark"] .action-dialog-message {
  color: #94a3b8;
}

[data-theme="dark"] .action-dialog-header,
[data-theme="dark"] .action-dialog-footer {
  border-color: #334155;
}

[data-theme="dark"] .action-dialog-actions {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .action-dialog-icon-info {
  background: #1e3a8a;
  color: #93c5fd;
}

[data-theme="dark"] .action-dialog-icon-warning {
  background: #78350f;
  color: #fcd34d;
}

[data-theme="dark"] .action-dialog-icon-error {
  background: #7f1d1d;
  color: #fca5a5;
}

[data-theme="dark"] .action-dialog-action-btn-info {
  background: #1e3a8a;
  color: #93c5fd;
}

[data-theme="dark"] .action-dialog-action-btn-info:hover {
  background: #1e40af;
}

[data-theme="dark"] .action-dialog-action-btn-warning {
  background: #78350f;
  color: #fcd34d;
}

[data-theme="dark"] .action-dialog-action-btn-warning:hover {
  background: #92400e;
}

[data-theme="dark"] .action-dialog-action-btn-error {
  background: #7f1d1d;
  color: #fca5a5;
}

[data-theme="dark"] .action-dialog-action-btn-error:hover {
  background: #991b1b;
}

[data-theme="dark"] .action-dialog-btn-cancel {
  background: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .action-dialog-btn-cancel:hover {
  background: #475569;
}

[data-theme="dark"] .action-dialog-btn-confirm {
  background: #3b82f6;
}

[data-theme="dark"] .action-dialog-btn-confirm:hover {
  background: #2563eb;
}

[data-theme="dark"] .action-dialog-btn-confirm-info {
  background: #3b82f6;
}

[data-theme="dark"] .action-dialog-btn-confirm-info:hover {
  background: #2563eb;
}

[data-theme="dark"] .action-dialog-btn-confirm-warning {
  background: #f59e0b;
}

[data-theme="dark"] .action-dialog-btn-confirm-warning:hover {
  background: #d97706;
}

[data-theme="dark"] .action-dialog-btn-confirm-error {
  background: #ef4444;
}

[data-theme="dark"] .action-dialog-btn-confirm-error:hover {
  background: #dc2626;
}

/* Responsive: Stack actions below on mobile */
@media (max-width: 768px) {
  .action-dialog {
    max-width: 90vw;
  }

  .action-dialog-header {
    padding: 1.25rem 1rem 1rem 1rem;
  }

  .action-dialog-body {
    padding: 1rem;
  }

  .action-dialog-footer {
    padding: 0.75rem 1rem;
  }
  
  .action-dialog-content {
    flex-direction: column;
  }
  
  .action-dialog-actions {
    border-left: none;
    border-top: 1px solid var(--border-default);
    min-width: 100%;
    max-width: 100%;
    padding: 0.75rem 1rem;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .action-dialog-action-btn {
    flex: 1;
    min-width: calc(50% - 0.25rem);
    text-align: center;
  }
}

/* ==================== SERVICES DIALOG ==================== */

.services-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.services-dialog {
  background: white;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.services-dialog-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 2rem 2rem 1.5rem 2rem;
  border-bottom: 1px solid var(--border-default);
  position: relative;
}

.services-dialog-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.services-dialog-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  flex: 1;
}

.services-dialog-close {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.services-dialog-close:hover {
  background: #f3f4f6;
  color: #374151;
}

.services-dialog-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.services-loading,
.services-error,
.services-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.services-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e5e7eb;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

.services-loading p,
.services-error p,
.services-empty p {
  color: #6b7280;
  font-size: 1rem;
  margin: 0 0 1rem 0;
}

.services-error-icon,
.services-empty-icon {
  margin-bottom: 1.5rem;
  opacity: 0.6;
}

.services-error-icon svg {
  color: #ef4444;
}

.services-empty-icon svg {
  color: #6b7280;
}

.services-empty h4 {
  color: #374151;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.services-retry-btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.services-retry-btn:hover {
  background: #2563eb;
}

.services-table-container {
  padding: 0;
}

.services-count {
  padding: 1.5rem 2rem 1rem 2rem;
  border-bottom: 1px solid var(--border-default);
}

.services-count-text {
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 500;
}

.services-table-wrapper {
  overflow-x: auto;
}

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

.services-table-header {
  background: #f9fafb;
}

.services-table-th {
  padding: 1rem 2rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: #374151;
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}

.services-th-name {
  min-width: 200px;
  width: 30%;
}

.services-th-description {
  min-width: 400px;
  width: 70%;
}

.services-table-body {
  background: white;
}

[data-theme="dark"] .services-table-body {
  background: #0f172a;
}

.services-table-row {
  border-bottom: 1px solid var(--border-default);
  transition: background 0.15s ease;
}

.services-table-row:hover {
  background: #f9fafb;
}

.services-table-td {
  padding: 1.5rem 2rem;
  vertical-align: top;
}

.services-td-name {
  font-weight: 600;
  color: #111827;
}

.services-td-description {
  color: #6b7280;
}

.service-name {
  font-size: 1rem;
  line-height: 1.5;
}

.service-description {
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 0;
}

[data-theme="dark"] .service-name {
  color: #f1f5f9;
}

[data-theme="dark"] .service-description {
  color: #94a3b8;
}

.service-date {
  font-size: 0.875rem;
  margin: 0;
}

.services-dialog-footer {
  border-top: 1px solid var(--border-default);
  background: var(--bg-secondary);
  padding: 1.5rem 2rem;
}

.services-dialog-footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.services-footer-text {
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0;
  flex: 1;
}

.services-dialog-close-btn {
  background: #f3f4f6;
  color: #374151;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.services-dialog-close-btn:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}

/* Dark mode for services dialog */
[data-theme="dark"] .services-dialog {
  background: #1e293b;
  border: 1px solid #334155;
}

[data-theme="dark"] .services-dialog-header,
[data-theme="dark"] .services-dialog-footer {
  border-color: #334155;
}

[data-theme="dark"] .services-dialog-title {
  color: #f1f5f9;
}

[data-theme="dark"] .services-dialog-close {
  color: #94a3b8;
}

[data-theme="dark"] .services-dialog-close:hover {
  background: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .services-loading p,
[data-theme="dark"] .services-error p,
[data-theme="dark"] .services-empty p {
  color: #94a3b8;
}

[data-theme="dark"] .services-empty h4 {
  color: #f1f5f9;
}

[data-theme="dark"] .services-empty-icon svg {
  color: #94a3b8;
}

[data-theme="dark"] .services-count {
  border-color: #334155;
}

[data-theme="dark"] .services-count-text {
  color: #94a3b8;
}

[data-theme="dark"] .services-table-header {
  background: #0f172a;
}

[data-theme="dark"] .services-table-th {
  color: #f1f5f9;
  border-color: #334155;
}

[data-theme="dark"] .services-table-row {
  border-color: #334155;
}

[data-theme="dark"] .services-table-row:hover {
  background: #0f172a;
}

[data-theme="dark"] .services-td-name {
  color: #f1f5f9;
}

[data-theme="dark"] .services-td-description {
  color: #94a3b8;
}

/* ============================================
   PRODUCTS DIALOG STYLES
   ============================================ */

.products-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.products-dialog {
  background: white;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 1200px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.products-dialog .products-dialog-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 2rem 2rem 1.5rem 2rem;
  border-bottom: 1px solid var(--border-default);
  position: relative;
  flex-shrink: 0;
}

.products-dialog .products-dialog-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.products-dialog .products-dialog-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  flex: 1;
}

.products-dialog .products-dialog-close {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.products-dialog .products-dialog-close:hover {
  background: #f3f4f6;
  color: #374151;
}

.products-dialog .products-dialog-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  min-height: 0;
}

.products-dialog .products-loading,
.products-dialog .products-error,
.products-dialog .products-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.products-dialog .products-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e5e7eb;
  border-top: 4px solid #10b981;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

.products-dialog .products-loading p,
.products-dialog .products-error p,
.products-dialog .products-empty p {
  color: #6b7280;
  font-size: 1rem;
  margin: 0 0 1rem 0;
}

.products-dialog .products-error-icon,
.products-dialog .products-empty-icon {
  margin-bottom: 1.5rem;
  opacity: 0.6;
}

.products-dialog .products-error-icon svg {
  color: #ef4444;
}

.products-dialog .products-empty-icon svg {
  color: #6b7280;
}

.products-dialog .products-empty h4 {
  color: #374151;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.products-dialog .products-retry-btn {
  background: #10b981;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.products-dialog .products-retry-btn:hover {
  background: #059669;
}

.products-dialog .products-grid-container {
  padding: 0;
}

.products-dialog .products-count {
  padding: 1.5rem 2rem 1rem 2rem;
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
}

.products-dialog .products-count-text {
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 500;
}

.products-dialog .products-grid-wrapper {
  padding: 1.5rem 2rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.products-dialog .products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
  padding-bottom: 1rem;
}

.products-dialog .product-card-item {
  background: white;
  border: 1px solid var(--border-default);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.products-dialog .product-card-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #d1d5db;
}

.products-dialog .product-card-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f9fafb;
}

.products-dialog .product-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.products-dialog .product-card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  color: #9ca3af;
}

.products-dialog .product-discount-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: #ef4444;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  z-index: 1;
}

.products-dialog .product-card-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.products-dialog .product-card-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
}

.products-dialog .product-card-price {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.products-dialog .product-price-current {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
}

.products-dialog .product-price-old {
  font-size: 0.875rem;
  color: #6b7280;
  text-decoration: line-through;
}

.products-dialog .product-card-description {
  font-size: 0.8125rem;
  color: #6b7280;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.products-dialog .products-dialog-footer {
  border-top: 1px solid var(--border-default);
  background: var(--bg-secondary);
  padding: 1.5rem 2rem;
  flex-shrink: 0;
}

.products-dialog .products-dialog-footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.products-dialog .products-footer-text {
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0;
  flex: 1;
}

.products-dialog .products-dialog-close-btn {
  background: #f3f4f6;
  color: #374151;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.products-dialog .products-dialog-close-btn:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}

/* Responsive adjustments for products grid */
@media (max-width: 768px) {
  .products-dialog {
    max-width: 100%;
    max-height: 95vh;
    margin: 0.5rem;
  }

  .products-dialog .products-dialog-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
  }

  /* Horizontal scroll on mobile */
  .products-dialog .products-grid-wrapper {
    padding: 1rem 1.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .products-dialog .products-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
    min-width: max-content;
  }

  /* Single item behaves like regular block */
  .products-dialog .products-grid.single-item {
    display: grid;
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .products-dialog .product-card-item {
    min-width: 70vw;
    max-width: 240px;
    flex: 0 0 auto;
  }

  .products-dialog .products-count {
    padding: 1rem 1.5rem 0.75rem 1.5rem;
  }

  .products-dialog .products-dialog-footer {
    padding: 1rem 1.5rem;
  }

  .products-dialog .products-dialog-footer-content {
    flex-direction: column;
    align-items: stretch;
  }

  .products-dialog .products-footer-text {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .products-dialog .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
  }

  .products-dialog .product-card-info {
    padding: 0.75rem;
  }

  .products-dialog .product-card-name {
    font-size: 0.875rem;
  }

  .products-dialog .product-price-current {
    font-size: 0.9375rem;
  }
}

/* Dark mode for products dialog */
[data-theme="dark"] .products-dialog {
  background: #1e293b;
  border: 1px solid #334155;
}

[data-theme="dark"] .products-dialog .products-dialog-header,
[data-theme="dark"] .products-dialog .products-dialog-footer {
  border-color: #334155;
}

[data-theme="dark"] .products-dialog .products-dialog-title {
  color: #f1f5f9;
}

[data-theme="dark"] .products-dialog .products-dialog-close {
  color: #94a3b8;
}

[data-theme="dark"] .products-dialog .products-dialog-close:hover {
  background: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .products-dialog .products-loading p,
[data-theme="dark"] .products-dialog .products-error p,
[data-theme="dark"] .products-dialog .products-empty p {
  color: #94a3b8;
}

[data-theme="dark"] .products-dialog .products-empty h4 {
  color: #f1f5f9;
}

[data-theme="dark"] .products-dialog .products-empty-icon svg {
  color: #94a3b8;
}

[data-theme="dark"] .products-dialog .products-count {
  border-color: #334155;
}

[data-theme="dark"] .products-dialog .products-count-text {
  color: #94a3b8;
}

[data-theme="dark"] .products-dialog .product-card-item {
  background: #0f172a;
  border-color: #334155;
}

[data-theme="dark"] .products-dialog .product-card-item:hover {
  background: #1e293b;
  border-color: #475569;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .products-dialog .product-card-image-wrapper {
  background: #1e293b;
}

[data-theme="dark"] .products-dialog .product-card-image-placeholder {
  background: #1e293b;
  color: #64748b;
}

[data-theme="dark"] .products-dialog .product-card-name {
  color: #f1f5f9;
}

[data-theme="dark"] .products-dialog .product-price-current {
  color: #f1f5f9;
}

[data-theme="dark"] .products-dialog .product-price-old {
  color: #94a3b8;
}

[data-theme="dark"] .products-dialog .product-card-description {
  color: #94a3b8;
}

[data-theme="dark"] .products-dialog .products-footer-text {
  color: #94a3b8;
}

/* ============================================
   END OF PRODUCTS DIALOG STYLES
   ============================================ */

[data-theme="dark"] .services-footer-text {
  color: #94a3b8;
}

[data-theme="dark"] .services-dialog-close-btn {
  background: #334155;
  color: #cbd5e1;
}

[data-theme="dark"] .services-dialog-close-btn:hover {
  background: #475569;
}

/* Responsive: Services dialog mobile/tablet */
@media (max-width: 1024px) {
  .services-dialog {
    align-items: center;
    flex-wrap: nowrap;
  }

  .services-table-th,
    width: auto;
    justify-content: flex-end;
    gap: 0.45rem;
    flex-wrap: nowrap;
  }

  .authorization-status-pill {
    min-width: 70px;
    padding-inline: 0.55rem;
  }

  .services-th-name {
    min-width: 150px;
    width: 30%;
  }

  .services-th-description {
    min-width: 250px;
    width: 70%;
  }
}

@media (max-width: 768px) {
  .services-dialog {
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .services-dialog-overlay {
    padding: 0;
  }

  .services-dialog-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
  }

  .services-dialog-title {
    font-size: 1.25rem;
  }

  .services-dialog-content {
    padding: 0;
  }

  .services-count {
    padding: 1rem 1.5rem;
  }

  .services-table-th,
  .services-table-td {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }

  .services-th-name {
    display: none;
  }

  .services-th-description {
    width: 100%;
    text-align: left;
  }

  .services-table-row {
    display: block;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    margin: 0.5rem 1rem;
    background: white;
  }

  [data-theme="dark"] .services-table-row {
    background: #1e293b;
    border-color: #334155;
  }

  .services-table-row:hover {
    background: #f9fafb;
  }

  [data-theme="dark"] .services-table-row:hover {
    background: #0f172a;
  }

  .services-table-row:not(:last-child) {
    margin-bottom: 0.5rem;
  }

  .services-table-td {
    display: block;
    padding: 0.5rem 1rem;
    border: none;
  }

  .services-td-name {
    font-size: 1rem;
    padding-bottom: 0.25rem;
  }

  .services-td-description {
    display: block;
    padding-top: 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-default);
    font-size: 0.875rem;
    line-height: 1.5;
  }

  [data-theme="dark"] .services-td-description {
    border-color: #334155;
  }

  .services-dialog-footer {
    padding: 1rem 1.5rem;
  }

  .services-dialog-footer-content {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .services-footer-text {
    text-align: center;
    order: 2;
  }

  .services-dialog-close-btn {
    width: 100%;
    order: 1;
  }
}

@media (max-width: 480px) {
  .services-dialog-header {
    padding: 1rem 1rem 0.75rem 1rem;
  }

  .services-dialog-title {
    font-size: 1.125rem;
  }

  .services-count {
    padding: 0.75rem 1rem;
  }

  .services-table-row {
    margin: 0.25rem 0.5rem;
  }

  .services-dialog-footer {
    padding: 0.75rem 1rem;
  }
}

/* ==================== TAGS INPUT ==================== */

.tags-input-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-component);
  transition: border-color var(--transition-fast);
  min-height: 2.75rem;
}

.tags-input-container.focused {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: var(--accent-blue);
  color: white;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}

.tag-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  transition: background var(--transition-fast);
}

.tag-remove:hover {
  background: rgba(255, 255, 255, 0.3);
}

.tag-input {
  flex: 1;
  min-width: 120px;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.875rem;
  color: var(--text-primary);
  padding: 0;
}

.tag-input::placeholder {
  color: var(--text-secondary);
}

/* Dark mode for tags */
[data-theme="dark"] .tag-pill {
  background: var(--accent-blue);
}

/* ==================== CATEGORIES SECTION ==================== */

.empty-categories {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  margin-top: 1rem;
  background: var(--bg-tertiary);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-lg);
  text-align: center;
}

.empty-categories-illustration {
  color: var(--text-tertiary);
  margin-bottom: 1rem;
}

.empty-categories-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
  margin: 0 0 0.5rem 0;
}

.empty-categories-text {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin: 0;
}

.categories-container {
  margin-top: 1.5rem;
}

.categories-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-default);
}

.categories-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.categories-count {
  font-size: 0.875rem;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-weight: 500;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.category-card {
  background: var(--bg-component);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
  overflow: hidden;
}

.category-card:hover {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.category-card-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  gap: 1rem;
}

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

.category-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
  word-break: break-word;
}

.category-id {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  background: var(--bg-secondary);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.category-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.category-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: transparent;
}

.category-edit-btn {
  color: var(--accent-blue);
}

.category-edit-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  transform: scale(1.05);
}

.category-delete-btn {
  color: var(--error-red);
}

.category-delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  transform: scale(1.05);
}

/* Dark mode for categories */
[data-theme="dark"] .category-card:hover {
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
}

/* Responsive: Categories tablet */
@media (max-width: 1024px) {
  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.875rem;
  }

  .category-card-content {
    padding: 1rem;
  }

  .category-name {
    font-size: 0.95rem;
  }
}

/* Label row for inline labels and counters/links */
.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.manage-link,
.currency-link {
  font-size: 0.875rem;
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 500;
}

.currency-link:hover,
.manage-link:hover {
  text-decoration: underline;
}

/* Product form specific alignment for desktop */
@media (min-width: 769px) {
  .form-row .form-group {
    display: flex;
    flex-direction: column;
    height: fit-content;
  }

  .form-row .form-group .label-row {
    min-height: 1.5rem; /* Ensure consistent label row height */
  }

  .form-row .form-group input,
  .form-row .form-group textarea,
  .form-row .form-group select {
    margin-bottom: 0.25rem; /* Reduce bottom margin for tighter alignment */
  }

  .form-row .form-group .field-hint {
    margin-top: 0.25rem;
    min-height: 1rem; /* Ensure consistent hint height */
  }

  /* Special styling for currency display */
  .currency-display-inline {
    font-size: 0.8em;
    color: var(--text-secondary);
    margin-left: 0.5rem;
  }
}

.products-page .form-row .form-group {
  display: flex;
  flex-direction: column;
  height: fit-content;
}

.products-page .form-row .form-group .label-row {
  min-height: 1.5rem;
}

.products-page .form-row .form-group input,
.products-page .form-row .form-group textarea,
.products-page .form-row .form-group select {
  margin-bottom: 0.25rem;
}

.products-page .form-row .form-group .field-hint {
  margin-top: 0.25rem;
  min-height: 1.25rem;
}

.products-page .modal-body form .form-group label {
  font-size: 1rem;
  line-height: 1.4;
  min-height: 1.5rem;
}

.products-page .modal-body form .currency-readonly {
  cursor: not-allowed;
  background-color: var(--bg-secondary);
}

.products-page .inline-modal-overlay {
  z-index: 11000;
}

.products-page .inline-modal {
  max-width: 520px;
  padding-bottom: 0.5rem;
}

.products-page .modal-actions {
  justify-content: flex-end;
  margin-top: 1.5rem;
  margin-bottom: 10px !important;
  padding-bottom: 1.5rem !important;
  border-bottom: 1px solid var(--border-default);
}

.category-modal .modal-actions {
  margin-top: 1.5rem;
  margin-bottom: 1.25rem !important;
  padding-bottom: 0;
  border-bottom: none;
}

.products-page .inline-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 12000;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.products-page .inline-confirm-modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-xl);
}

.products-page .inline-confirm-modal h4 {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.products-page .inline-confirm-modal p {
  margin: 0 0 1.25rem 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

.category-modal .category-list {
  margin-top: 1.25rem;
  padding-top: 0;
  border-top: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.category-modal .category-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.category-modal .category-list-heading {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex: 1;
}

.category-modal .category-list-heading .section-label {
  font-size: 0.95rem;
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.category-modal .category-list-heading .category-count {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: var(--font-normal);
}

.category-modal .category-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.category-modal .btn-icon-text {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.category-modal .btn-icon-text:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(139, 92, 246, 0.05);
}

.category-modal .btn-icon-text:active {
  transform: translateY(0);
}

.category-modal .btn-icon-text svg {
  flex-shrink: 0;
}

.category-modal .category-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: var(--font-normal);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.category-modal .category-toggle-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(139, 92, 246, 0.05);
}

.category-modal .category-toggle-btn .toggle-icon {
  flex-shrink: 0;
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.category-modal .category-toggle-btn:hover .toggle-icon {
  color: var(--accent-primary);
}

.category-modal .btn-text-short {
  display: none;
}

@media (max-width: 640px) {
  .category-modal .category-list-header {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }

  .category-modal .category-header-actions {
    width: auto;
    justify-content: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .category-modal .btn-icon-text,
  .category-modal .category-toggle-btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.7rem;
  }

  .category-modal .btn-text-full {
    display: none;
  }

  .category-modal .btn-text-short {
    display: inline;
  }
}

@media (max-width: 380px) {
  .category-modal .category-list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .category-modal .category-header-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 0.5rem;
  }
}
.products-page .category-list-body {
  margin-top: 0.5rem;
}

.category-modal .category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(257px, 1fr));
  gap: 0.75rem;
}

.category-modal .category-card.compact {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.25rem;
}

.category-modal .category-card.compact .category-card-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.category-modal .category-card.compact .category-name {
  font-size: 0.95rem;
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.category-modal .category-actions.icon-actions {
  display: inline-flex;
  gap: 0.25rem;
}

.category-modal .category-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}

.category-modal .category-action-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: rgba(139, 92, 246, 0.08);
}

.category-modal .category-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.category-modal .small-empty {
  padding: 0.75rem;
  text-align: center;
  font-size: 0.95rem;
}

/* Fix per-field label spacing for alignment */
.products-page .modal-body form .sku-group label {
  margin-bottom: 0.5rem; /* 8px to match Product Name label row */
}

.products-page .modal-body form .currency-group .label-row {
  margin-bottom: 0.125rem; /* 2px to match Price/Old Price labels */
}

.products-page .modal-body form .category-group .label-row {
  margin-bottom: 0.125rem; /* 2px to match Stock Quantity label spacing */
}

.manage-link:hover {
  text-decoration: underline;
}

/* Responsive: Categories mobile */
@media (max-width: 768px) {
  .categories-container {
    margin-top: 1.25rem;
  }

  .categories-header {
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
  }

  .categories-title {
    font-size: 1rem;
  }

  .categories-count {
    font-size: 0.8125rem;
    padding: 0.1875rem 0.625rem;
  }

  .categories-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .category-card {
    border-radius: var(--radius-md);
  }

  .category-card-content {
    padding: 1rem;
    /* Keep horizontal layout even on mobile */
    flex-direction: row;
    align-items: flex-start;
    gap: 0.75rem;
    min-height: 48px; /* Ensure minimum height for touch targets */
  }

  .category-info {
    flex: 1;
    min-width: 0; /* Allow text to wrap */
  }

  .category-name {
    font-size: 1rem;
    margin: 0;
    word-break: break-word;
    line-height: 1.4;
  }

  .category-actions {
    flex-shrink: 0;
    gap: 0.5rem;
  }

  .category-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
  }
}

/* ==================== THEME TOGGLE BUTTON ==================== */
/* Floating Save Button */
.floating-save-button {
  position: fixed;
  bottom: 88px;
  right: 24px;
  z-index: calc(var(--z-theme-toggle) - 1);
  animation: slideUpFadeIn 0.3s ease-out;
}

.floating-save-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(139, 92, 246, 0.2);
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
}

.floating-save-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(139, 92, 246, 0.3);
}

.floating-save-btn svg {
  flex-shrink: 0;
}

@keyframes slideUpFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dark mode floating save button */
[data-theme="dark"] .floating-save-btn {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(139, 92, 246, 0.3);
}

[data-theme="dark"] .floating-save-btn:hover {
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.3), 0 0 0 1px rgba(139, 92, 246, 0.5);
}

/* Responsive floating save button */
@media (max-width: 640px) {
  .floating-save-button {
    bottom: 80px;
    right: 16px;
  }

  .floating-save-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
    font-size: var(--text-xs);
  }

  .floating-save-btn span {
    display: none;
  }
}

.theme-toggle-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: all 0.3s ease;
  
  /* Light mode styling */
  background: linear-gradient(135deg, #ffffff 0%, #f3f4f6 100%);
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(139, 92, 246, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: #6b7280;
}

.theme-toggle-btn:hover {
  transform: scale(1.08);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(139, 92, 246, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: #8b5cf6;
}

.theme-toggle-btn:active {
  transform: scale(0.95);
}

/* Dark mode theme toggle */
[data-theme="dark"] .theme-toggle-btn {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(139, 92, 246, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: #9ca3af;
}

[data-theme="dark"] .theme-toggle-btn:hover {
  box-shadow: 
    0 6px 20px rgba(139, 92, 246, 0.3),
    0 0 0 1px rgba(139, 92, 246, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: #a78bfa;
}

.theme-toggle-btn svg {
  width: 22px;
  height: 22px;
  transition: transform 0.3s ease;
}

.theme-toggle-btn:hover svg {
  transform: rotate(15deg);
}

/* ==================== FAB VISIBILITY TOGGLE ==================== */
.fab-visibility-toggle {
  position: fixed;
  bottom: 24px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10002;
  padding: 0;
  background: rgba(107, 114, 128, 0.3);
  color: rgba(107, 114, 128, 0.8);
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.fab-visibility-toggle:hover {
  background: rgba(107, 114, 128, 0.5);
  color: rgba(107, 114, 128, 1);
  transform: scale(1.1);
}

[data-theme="dark"] .fab-visibility-toggle {
  background: rgba(156, 163, 175, 0.2);
  color: rgba(156, 163, 175, 0.7);
}

[data-theme="dark"] .fab-visibility-toggle:hover {
  background: rgba(156, 163, 175, 0.4);
  color: rgba(156, 163, 175, 1);
}

@media (max-width: 480px) {
  .fab-visibility-toggle {
    bottom: 16px;
    right: 8px;
  }
}

/* ==================== AI CHAT FAB ==================== */
.ai-chat-fab-wrapper {
  position: fixed;
  bottom: 88px; /* Above theme toggle (24px + 48px + 16px gap) */
  right: 24px;
  z-index: 998; /* Below theme toggle (999) */
}

@media (max-width: 480px) {
  .ai-chat-fab-wrapper {
    bottom: 80px;
    right: 16px;
  }
}

.ai-chat-fab-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
  
  /* Light mode styling */
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  box-shadow: 
    0 4px 15px rgba(139, 92, 246, 0.3),
    0 0 0 1px rgba(139, 92, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.ai-chat-fab-btn:hover {
  transform: scale(1.08);
  box-shadow: 
    0 6px 20px rgba(139, 92, 246, 0.4),
    0 0 0 1px rgba(139, 92, 246, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.ai-chat-fab-btn:active {
  transform: scale(0.95);
}

/* Dark mode AI Chat FAB */
[data-theme="dark"] .ai-chat-fab-btn {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  box-shadow: 
    0 4px 15px rgba(139, 92, 246, 0.4),
    0 0 0 1px rgba(139, 92, 246, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .ai-chat-fab-btn:hover {
  box-shadow: 
    0 6px 20px rgba(139, 92, 246, 0.5),
    0 0 0 1px rgba(139, 92, 246, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* FAB Consume Animation */
.ai-chat-fab-wrapper.is-consuming .ai-chat-fab-btn {
  animation: consumeAI 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes consumeAI {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.3) rotate(5deg);
  }
  50% {
    transform: scale(0.85) rotate(-5deg);
  }
  70% {
    transform: scale(1.15) rotate(3deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

/* AI Badge Indicator */
.ai-chat-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
  z-index: 10;
  animation: badgePulse 2s ease-in-out infinite, badgeAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 2px solid white;
}

@keyframes badgeAppear {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes badgePulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.6);
  }
}

/* FAB with consumed state - ripple effect */
.ai-chat-fab-wrapper.has-consumed .ai-chat-fab-btn {
  position: relative;
}

.ai-chat-fab-wrapper.has-consumed .ai-chat-fab-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.2);
  transform: translate(-50%, -50%);
  animation: rippleEffect 1.5s ease-out infinite;
  pointer-events: none;
}

@keyframes rippleEffect {
  0% {
    width: 0;
    height: 0;
    opacity: 0.8;
  }
  100% {
    width: 80px;
    height: 80px;
    opacity: 0;
  }
}

/* Enhanced hover when consumed */
.ai-chat-fab-wrapper.has-consumed .ai-chat-fab-btn:hover {
  transform: scale(1.08);
  box-shadow: 
    0 8px 20px rgba(16, 185, 129, 0.3),
    0 6px 20px rgba(139, 92, 246, 0.4),
    0 0 0 1px rgba(139, 92, 246, 0.3);
}

.ai-chat-fab-icon {
  width: 22px;
  height: 22px;
  transition: transform 0.3s ease;
}

.ai-chat-fab:hover .ai-chat-fab-icon {
  transform: scale(1.1);
}

/* Tooltip for AI Chat FAB (desktop only) */
.ai-chat-fab-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(30, 30, 30, 0.95);
  color: #ffffff;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 500;
  backdrop-filter: blur(8px);
}

.ai-chat-fab-tooltip.show {
  opacity: 1;
}

/* Light theme tooltip */
[data-theme="light"] .ai-chat-fab-tooltip {
  background: rgba(255, 255, 255, 0.98);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Tooltip arrow */
.ai-chat-fab-tooltip::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: rgba(30, 30, 30, 0.95);
}

[data-theme="light"] .ai-chat-fab-tooltip::after {
  border-left-color: rgba(255, 255, 255, 0.98);
}

/* ==================== AI CHAT WIDGET ==================== */
.ai-chat-widget {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  pointer-events: none;
}

.ai-chat-widget-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.ai-chat-widget-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  pointer-events: auto;
}

/* Mobile: Hide overlay, show full screen */
@media (max-width: 767px) {
  .ai-chat-widget-overlay {
    display: none;
  }
}

.ai-chat-widget-container {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background-color: white;
  border-radius: 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  overflow: hidden;
}

/* Mobile: Full screen with rounded top corners */
@media (max-width: 767px) {
  .ai-chat-widget-container {
    border-radius: 20px 20px 0 0;
    height: 95vh; /* Increased from 90vh for more real estate */
    max-height: 95vh; /* Increased from 90vh */
  }
}

/* Desktop: Facebook-style chat widget on right side */
@media (min-width: 768px) {
  .ai-chat-widget-container {
    width: 420px;
    max-width: 90vw;
    height: 85vh;
    max-height: 800px;
    bottom: 20px;
    right: 20px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  }
}

/* Large Desktop: Better positioning */
@media (min-width: 1200px) {
  .ai-chat-widget-container {
    width: 450px;
    height: 90vh;
    max-height: 900px;
  }
}

/* Dark mode chat widget */
[data-theme="dark"] .ai-chat-widget-container {
  background-color: #1f2937;
}

.ai-chat-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  min-height: 60px;
  cursor: grab;
  user-select: none;
}

.ai-chat-widget-header:active {
  cursor: grabbing;
}

.ai-chat-widget-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.ai-chat-widget-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.ai-chat-widget-title svg {
  flex-shrink: 0;
}

.ai-chat-widget-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background-color: transparent;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.ai-chat-widget-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.ai-chat-widget-close:active {
  transform: scale(0.95);
}

.ai-chat-widget-body {
  position: relative;
  flex: 1;
  overflow: hidden;
  background-color: white;
}

[data-theme="dark"] .ai-chat-widget-body {
  background-color: #1f2937;
}

.ai-chat-widget-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.ai-chat-widget-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background-color: white;
  z-index: 1;
}

[data-theme="dark"] .ai-chat-widget-loading {
  background-color: #1f2937;
}

.ai-chat-widget-loading .loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f4f6;
  border-top: 4px solid #8b5cf6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

[data-theme="dark"] .ai-chat-widget-loading .loading-spinner {
  border-color: #374151;
  border-top-color: #8b5cf6;
}

.ai-chat-widget-loading p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.ai-chat-widget-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem;
  text-align: center;
}

.ai-chat-widget-error p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* Chat Widget Transitions */
.ai-chat-widget-enter-active,
.ai-chat-widget-leave-active {
  transition: all 0.3s ease;
}

.ai-chat-widget-enter-active .ai-chat-widget-overlay,
.ai-chat-widget-leave-active .ai-chat-widget-overlay {
  transition: opacity 0.3s ease;
}

.ai-chat-widget-enter-active .ai-chat-widget-container,
.ai-chat-widget-leave-active .ai-chat-widget-container {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.ai-chat-widget-enter-from .ai-chat-widget-overlay,
.ai-chat-widget-leave-to .ai-chat-widget-overlay {
  opacity: 0;
}

.ai-chat-widget-enter-from .ai-chat-widget-container {
  transform: translateY(100%);
  opacity: 0;
}

.ai-chat-widget-leave-to .ai-chat-widget-container {
  transform: translateY(100%);
  opacity: 0;
}

@media (min-width: 768px) {
  .ai-chat-widget-enter-from .ai-chat-widget-container {
    transform: translateX(100%);
    opacity: 0;
  }
  
  .ai-chat-widget-leave-to .ai-chat-widget-container {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Widget wrapper pointer events */
.ai-chat-widget-wrapper {
  pointer-events: auto;
}

/* ==================== AI CHAT PROMPT (First-time visitor) ==================== */
.ai-chat-prompt {
  position: fixed;
  bottom: 88px; /* Above FAB */
  right: 24px;
  z-index: 997; /* Below FAB (998) */
  background: var(--bg-component);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--border-default);
  max-width: 320px;
  overflow: hidden;
  border: 1px solid var(--border-default);
}

@media (min-width: 768px) {
  .ai-chat-prompt {
    bottom: 148px; /* Above FAB (88px) + FAB height (48px) + gap (12px) */
    right: 90px;
  }
}

@media (max-width: 767px) {
  .ai-chat-prompt {
    bottom: 136px;
    left: auto;
    right: 12px;
    transform: none;
    width: auto;
    max-width: calc(100vw - 24px);
    border-radius: 14px;
    cursor: pointer;
    padding: 0;
  }
}

.ai-prompt-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 2;
}

.ai-prompt-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.ai-prompt-content {
  position: relative;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 1;
}

.ai-prompt-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  border-radius: 50%;
  color: white;
  animation: pulse-icon 2s ease-in-out infinite;
}

@keyframes pulse-icon {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.ai-prompt-text h4 {
  font-size: 1.125rem;
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
  line-height: 1.3;
}

.ai-prompt-text p {
  font-size: var(--text-base);
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.ai-prompt-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.ai-prompt-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

.ai-prompt-button:active {
  transform: translateY(0);
}

.ai-prompt-pulse {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-primary);
  opacity: 0;
  animation: pulse-ring 2s ease-out infinite;
  pointer-events: none;
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

/* AI Prompt Animations */
.ai-prompt-enter-active {
  animation: slideInFromRight 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ai-prompt-leave-active {
  animation: slideOutToRight 0.3s ease-in;
}

@keyframes slideInFromRight {
  0% {
    transform: translateX(400px) scale(0.8);
    opacity: 0;
  }
  60% {
    transform: translateX(-10px) scale(1.02);
  }
  100% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes slideOutToRight {
  0% {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateX(400px) scale(0.8);
    opacity: 0;
  }
}

/* Mobile-specific animation for ai-chat-prompt compact bubble */
@media (max-width: 767px) {
  .ai-prompt-enter-active {
    animation: aiPromptFadeInUpMobile 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .ai-prompt-leave-active {
    animation: aiPromptFadeOutMobile 0.3s ease-in;
  }
}

@keyframes aiPromptFadeInUpMobile {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes aiPromptFadeOutMobile {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
}

/* Dark mode prompt */
[data-theme="dark"] .ai-chat-prompt {
  background: var(--bg-component);
  border-color: var(--border-default);
}

/* Mobile compact AI prompt bubble - must come AFTER base styles */
@media (max-width: 767px) {
  .ai-prompt-close {
    position: absolute;
    top: 8px;
    right: 4px;
    width: 22px;
    height: 22px;
    padding: 0;
    z-index: 2;
  }

  .ai-prompt-content {
    flex-direction: row;
    align-items: center;
    padding: 8px 32px 8px 12px;
    gap: 8px;
  }

  .ai-prompt-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    animation: none;
    border-radius: 50%;
  }

  .ai-prompt-icon svg {
    width: 10px;
    height: 10px;
  }

  .ai-prompt-text {
    flex: 1;
    min-width: 0;
  }

  .ai-prompt-text h4 {
    font-size: 0.78rem;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ai-prompt-text p {
    display: none;
  }

  .ai-prompt-button {
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 10px;
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    box-shadow: none;
    flex-shrink: 0;
    order: 2;
    gap: 0;
  }

  .ai-prompt-button svg {
    display: none;
  }

  .ai-prompt-button:hover {
    transform: none;
    box-shadow: none;
  }

  .ai-prompt-pulse {
    display: none;
  }
}

/* Theme Dialog Overlay */
.theme-dialog-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

[data-theme="dark"] .theme-dialog-backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.theme-dialog {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 360px;
  overflow: hidden;
  animation: dialog-scale-in 0.2s ease-out;
}

[data-theme="dark"] .theme-dialog {
  background: #1e293b;
  border: 1px solid #334155;
}

@keyframes dialog-scale-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.theme-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

[data-theme="dark"] .theme-dialog-header {
  border-bottom-color: #334155;
}

.theme-dialog-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #111827;
}

[data-theme="dark"] .theme-dialog-header h3 {
  color: #f1f5f9;
}

.theme-dialog-close {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: all 0.2s ease;
}

.theme-dialog-close:hover {
  background: #f3f4f6;
  color: #111827;
}

[data-theme="dark"] .theme-dialog-close {
  color: #9ca3af;
}

[data-theme="dark"] .theme-dialog-close:hover {
  background: #334155;
  color: #f1f5f9;
}

.theme-dialog-close svg {
  width: 18px;
  height: 18px;
}

.theme-dialog-options {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Service Mode Dialog - Similar to Theme Dialog */
.service-mode-dialog-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

[data-theme="dark"] .service-mode-dialog-backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.service-mode-dialog {
  background: var(--bg-component);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  animation: dialog-scale-in 0.2s ease-out;
  border: 1px solid var(--border-default);
}

.service-mode-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-default);
}

.service-mode-dialog-header h3 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.service-mode-dialog-close {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.service-mode-dialog-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.service-mode-dialog-close svg {
  width: 18px;
  height: 18px;
}

.service-mode-dialog-options {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.service-mode-option {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border: 2px solid var(--border-default);
  border-radius: 12px;
  background: var(--bg-component);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.service-mode-option:hover {
  border-color: var(--accent-blue);
  background: var(--bg-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.service-mode-option-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-secondary);
  color: var(--accent-blue);
  transition: all 0.2s ease;
}

.service-mode-option:hover .service-mode-option-icon {
  background: var(--accent-blue);
  color: white;
}

.service-mode-option-icon svg {
  width: 24px;
  height: 24px;
}

.service-mode-option-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.service-mode-option-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.service-mode-option-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.service-mode-dialog-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-default);
  text-align: center;
}

.service-mode-hint {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 2px solid transparent;
  background: #f9fafb;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.theme-option:hover {
  background: #f3f4f6;
  border-color: #e5e7eb;
}

.theme-option.selected {
  background: rgba(139, 92, 246, 0.1);
  border-color: #8b5cf6;
}

[data-theme="dark"] .theme-option {
  background: #0f172a;
}

[data-theme="dark"] .theme-option:hover {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .theme-option.selected {
  background: rgba(139, 92, 246, 0.15);
  border-color: #8b5cf6;
}

.theme-option-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.theme-option-icon svg {
  width: 24px;
  height: 24px;
}

.theme-option-icon.light-icon {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #b45309;
}

.theme-option-icon.dark-icon {
  background: linear-gradient(135deg, #312e81 0%, #1e1b4b 100%);
  color: #a5b4fc;
}

.theme-option-icon.system-icon {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  color: #4f46e5;
}

[data-theme="dark"] .theme-option-icon.light-icon {
  background: linear-gradient(135deg, #92400e 0%, #78350f 100%);
  color: #fde68a;
}

[data-theme="dark"] .theme-option-icon.dark-icon {
  background: linear-gradient(135deg, #4338ca 0%, #312e81 100%);
  color: #c7d2fe;
}

[data-theme="dark"] .theme-option-icon.system-icon {
  background: linear-gradient(135deg, #3730a3 0%, #312e81 100%);
  color: #c7d2fe;
}

.theme-option-label {
  font-size: 1rem;
  font-weight: 500;
  color: #111827;
  flex: 1;
}

[data-theme="dark"] .theme-option-label {
  color: #f1f5f9;
}

.theme-check {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8b5cf6;
}

.theme-check svg {
  width: 20px;
  height: 20px;
}

.theme-dialog-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  text-align: center;
}

[data-theme="dark"] .theme-dialog-footer {
  border-top-color: #334155;
}

.theme-hint {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  transition: color var(--transition-normal);
}

/* Dialog transitions */
.theme-dialog-enter-active,
.theme-dialog-leave-active {
  transition: opacity 0.2s ease;
}

.theme-dialog-enter-active .theme-dialog,
.theme-dialog-leave-active .theme-dialog {
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.theme-dialog-enter-from,
.theme-dialog-leave-to {
  opacity: 0;
}

.theme-dialog-enter-from .theme-dialog,
.theme-dialog-leave-to .theme-dialog {
  transform: scale(0.95);
  opacity: 0;
}

/* Auth page responsive */
@media (max-width: 480px) {
  .auth-page {
    padding: 1rem;
    overflow-y: auto;
    /* Keep vertical centering — the sign-in form is short enough to center.
       The sign-up form will naturally push to the top when it exceeds viewport height
       because the page scrolls (overflow-y: auto) and min-height: 100vh stretches. */
    align-items: center;
  }
  
  .auth-container {
    padding: 1rem 1.5rem 1.5rem 1.5rem; /* padding-top: 16px (1rem), rest: 24px (1.5rem) */
    border-radius: 16px;
  }
  
  .auth-form {
    gap: 12px;
  }
  
  .auth-divider {
    margin: 0.75rem 0;
  }
  
  .auth-footer {
    margin-top: 0.75rem;
  }
  
  .auth-header h1 {
    font-size: 1.5rem;
  }
  
  .auth-logo img {
    height: 40px;
  }
  
  .theme-toggle-btn {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
  }
  
  .theme-toggle-btn svg {
    width: 20px;
    height: 20px;
  }
}

/* ==================== DASHBOARD DARK MODE ==================== */

/* Dashboard layout */
[data-theme="dark"] .dashboard-layout {
  background: #0f172a;
}

/* Dashboard header dark mode - now handled by base styles with variables */

/* Menu header logo switching */
.menu-header-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}

.menu-header-logo.logo-light { display: none; }
.menu-header-logo.logo-dark { display: block; }
[data-theme="dark"] .menu-header-logo.logo-light { display: block; }
[data-theme="dark"] .menu-header-logo.logo-dark { display: none; }

/* Dashboard content */
[data-theme="dark"] .dashboard-content {
  background: #0f172a;
}

/* Page header dark mode - now handled by base styles with variables */

/* Cards dark mode - now handled by base styles with variables */

/* Card text colors dark mode - now handled by base styles with variables */

/* Empty state dark mode - now handled by base styles with variables */

.empty-icon {
  color: var(--text-tertiary);
  transition: color var(--transition-normal);
}

/* Buttons */
[data-theme="dark"] .btn-secondary {
  background: #334155;
  color: #f1f5f9;
  border-color: #475569;
}

[data-theme="dark"] .btn-secondary:hover {
  background: #475569;
}

[data-theme="dark"] .action-button {
  background: #334155;
  border-color: #475569;
  color: #f1f5f9;
}

[data-theme="dark"] .action-button:hover {
  background: #475569;
}

/* Modal */
[data-theme="dark"] .modal-content {
  background: #1e293b;
  border: 1px solid #334155;
}

[data-theme="dark"] .modal-header {
  border-bottom-color: #334155;
  background: var(--bg-primary, #1e293b);
}

[data-theme="dark"] .modal-header h3 {
  color: #f1f5f9;
}

/* Chat container dark mode - now handled by base styles with variables */

/* Tabs */
[data-theme="dark"] .tab-content {
  background: #1e293b;
  border-color: #334155;
}

/* Selection card */
[data-theme="dark"] .selection-card {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .selection-card:hover,
[data-theme="dark"] .selection-card.selected {
  border-color: #8b5cf6;
}

[data-theme="dark"] .selection-card h3 {
  color: #f1f5f9;
}

[data-theme="dark"] .selection-card p {
  color: #94a3b8;
}

/* Checkbox custom */
[data-theme="dark"] .checkbox-custom {
  background: #334155;
  border-color: #475569;
}

/* Form container */
[data-theme="dark"] .form-container {
  background: #1e293b;
  border: 1px solid #334155;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Image modal content */
[data-theme="dark"] .image-modal-content {
  background: #1e293b;
  border: 1px solid #334155;
}

/* Confirmation dialog */
[data-theme="dark"] .confirmation-dialog {
  background: #1e293b;
  border: 1px solid #334155;
}

[data-theme="dark"] .confirmation-dialog h3 {
  color: #f1f5f9;
}

[data-theme="dark"] .confirmation-dialog p {
  color: #94a3b8;
}

/* Modal footer dark mode */
[data-theme="dark"] .modal-footer {
  background: #1e293b;
  border-top-color: #334155;
}

/* Modal buttons dark mode */
[data-theme="dark"] .modal-btn-cancel {
  background: #334155;
  color: #cbd5e1;
  border-color: #475569;
}

[data-theme="dark"] .modal-btn-cancel:hover:not(:disabled) {
  background: #475569;
  border-color: #64748b;
}

[data-theme="dark"] .modal-btn-primary {
  background: #3b82f6;
  color: white;
}

[data-theme="dark"] .modal-btn-primary:hover:not(:disabled) {
  background: #2563eb;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

[data-theme="dark"] .modal-btn:disabled {
  opacity: 0.5;
  background: #334155;
  color: #64748b;
}

/* Menu items dark mode - now handled by base styles with variables */

/* Business selector */
[data-theme="dark"] .business-selector {
  background: #334155;
  border-color: #475569;
  color: #f1f5f9;
}

[data-theme="dark"] .business-selector:hover {
  border-color: #8b5cf6;
}

/* Dashboard logo */
[data-theme="dark"] .dashboard-logo img {
  filter: brightness(1.1);
}

/* Form inputs dark mode - now handled by base styles with variables */

/* Section titles - now handled by base styles with variables */
.section-title {
  color: var(--text-primary);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  transition: color var(--transition-normal);
}

/* Help text - should use theme variables in base definition */
.help-text {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  transition: color var(--transition-normal);
}

/* Badges dark mode - now handled by base styles with variables */

[data-theme="dark"] .badge-success {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

[data-theme="dark"] .badge-warning {
  background: rgba(234, 179, 8, 0.2);
  color: #facc15;
}

[data-theme="dark"] .badge-error {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* Alerts */
[data-theme="dark"] .alert {
  border-color: #334155;
}

[data-theme="dark"] .alert-success {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
}

[data-theme="dark"] .alert-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Stats cards */
[data-theme="dark"] .stat-card {
  background: #1e293b;
  border-color: #334155;
}

[data-theme="dark"] .stat-value {
  color: #f1f5f9;
}

[data-theme="dark"] .stat-label {
  color: #94a3b8;
}

/* ==================== SUBSCRIPTION PAGE ==================== */

.subscription-page {
  max-width: 1200px;
}

/* Subscription Status Card */
.subscription-status-card {
  margin-bottom: var(--space-xl);
}

.subscription-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.subscription-info-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.subscription-info-item .label {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  font-weight: var(--font-medium);
}

.subscription-info-item .value {
  font-size: var(--text-lg);
  color: var(--text-primary);
  font-weight: var(--font-semibold);
}

.subscription-actions {
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
}

.subscription-actions .btn-danger {
  background: var(--color-error);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: var(--font-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: var(--text-base);
}

.subscription-actions .btn-danger:hover {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .subscription-actions .btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.subscription-actions .btn-danger:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2);
}

.subscription-actions .btn-danger:disabled {
  background: rgba(239, 68, 68, 0.5);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.6;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-transform: capitalize;
}

.status-badge.status-active {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}

.status-badge.status-test {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-primary);
}

.status-badge.status-cancelled,
.status-badge.status-expired {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-error);
}

.status-badge.status-past_due {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
}

/* Plans Grid */
.plans-section {
  margin-top: var(--space-xl);
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  align-items: stretch;
}

@container dashboard-content (max-width: 900px) {
  .plans-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@container dashboard-content (max-width: 560px) {
  .plans-grid {
    grid-template-columns: 1fr;
  }
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--space-xl);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  background: var(--bg-secondary);
  border: 2px solid var(--border-default);
  border-radius: 6px;
  height: 100%;
  min-height: 480px;
  box-sizing: border-box;
}

.plan-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-primary);
  /* Add the same glow effect as popular card */
  box-shadow: 0 0 20px rgba(var(--accent-primary-rgb), 0.15), var(--shadow-lg);
}

.plan-card.plan-popular {
  border: 2px solid var(--accent-primary);
  box-shadow: 0 0 20px rgba(var(--accent-primary-rgb), 0.15);
}

.plan-card.plan-popular:hover {
  box-shadow: 0 0 25px rgba(var(--accent-primary-rgb), 0.25), var(--shadow-lg);
}

.plan-card.plan-current {
  border: 2px solid var(--color-success);
  background: var(--bg-tertiary);
}

.plan-badge {
  position: absolute;
  top: -12px;
  right: var(--space-lg);
  background: var(--accent-primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
}

.plan-badge.plan-badge-current {
  background: var(--color-success);
}

.plan-name {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin: 0 0 var(--space-sm) 0;
}

.plan-description {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0 0 var(--space-lg) 0;
  line-height: var(--leading-relaxed);
}

.plan-price {
  margin-bottom: var(--space-sm);
}

.price-amount {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
}

.price-period {
  font-size: var(--text-base);
  color: var(--text-tertiary);
}

.plan-messages {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-lg) 0; /* Add bottom margin for spacing before button */
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

.feature-check {
  color: var(--color-success);
  flex-shrink: 0;
  margin-top: 2px;
}

/* Plan card button container - pushes button to bottom */
.plan-card .btn-block {
  margin-top: auto;
  transition: all var(--transition-normal);
}

/* Ensure all plan card buttons have consistent styling */
.plan-card .btn-outline {
  border: 2px solid var(--accent-primary);
  color: var(--accent-primary);
  background: transparent;
}

.plan-card .btn-outline:hover {
  background: var(--accent-primary);
  color: white;
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(var(--accent-primary-rgb), 0.3);
}

.plan-card .btn-primary {
  background: var(--accent-primary);
  color: white;
  border: 2px solid var(--accent-primary);
}

.plan-card .btn-primary:hover {
  background: var(--accent-primary-hover, var(--accent-primary));
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(var(--accent-primary-rgb), 0.3);
}

/* Plan card content wrapper */
.plan-content-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Subscription Dialogs */
.subscription-dialog {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  overflow: visible; /* Allow box-shadow to show on button hover */
  display: flex;
  flex-direction: column;
  position: relative; /* For loading overlay positioning */
}

/* Dialog loading overlay */
.dialog-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  backdrop-filter: blur(2px);
}

[data-theme="dark"] .dialog-loading-overlay {
  background: rgba(30, 41, 59, 0.95);
}

.dialog-loading-spinner {
  margin-bottom: var(--space-md);
}

.dialog-loading-spinner svg.spinning {
  animation: spin 0.8s linear infinite;
  color: var(--primary-color, #0066cc);
}

[data-theme="dark"] .dialog-loading-spinner svg.spinning {
  color: #3b82f6;
}

.dialog-loading-text {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: var(--font-medium);
}

.dialog-loading .dialog-body {
  pointer-events: none;
  opacity: 0.6;
}

.dialog-close:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Reduce padding for subscription dialog body */
.subscription-dialog .dialog-body {
  padding: 2px 12px var(--space-lg) 12px; /* top: 2px, right: 12px, bottom: default, left: 12px */
  overflow-y: visible; /* Remove scrolling from body, let content area scroll */
}

/* Payment result content area - scrollable */
.payment-result-content {
  flex: 1;
  overflow-y: auto;
  min-height: 0; /* Allows flex child to shrink and enable scrolling */
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
}

.dialog-header h3 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.dialog-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color var(--transition-fast);
}

.dialog-close:hover {
  color: var(--text-primary);
}

.dialog-body {
  padding: var(--space-lg);
  overflow-y: auto;
  flex: 1;
  min-height: 0; /* Allows flex child to shrink and enable scrolling */
  display: flex;
  flex-direction: column;
}

.dialog-description {
  color: var(--text-secondary);
  margin: 0 0 12px 0;
  font-size: var(--text-sm);
  flex-shrink: 0; /* Prevent description from shrinking */
}

.dialog-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: flex-end;
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0; /* Prevent actions from shrinking */
}

/* Subscription dialog actions - reduced spacing */
.subscription-dialog .dialog-actions {
  margin-top: 8px;
  padding-top: 8px;
}

/* Country List */
.country-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-height: 400px;
  min-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-xs) 0;
  margin: var(--space-sm) 0 var(--space-lg) 0;
  flex: 1;
  /* Custom scrollbar styling for better visibility */
  scrollbar-width: thin;
  scrollbar-color: var(--border-default) transparent;
}

.country-list::-webkit-scrollbar {
  width: 4px;
}

.country-list::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 4px;
  margin: var(--space-xs) 0;
}

.country-list::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 4px;
  transition: background var(--transition-fast);
}

.country-list::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

.country-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-primary);
  flex-shrink: 0; /* Prevent options from shrinking */
  box-sizing: border-box; /* Fix border cut-off on hover */
  position: relative; /* Ensure border stays within bounds */
}

.country-option:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  /* Use inset box-shadow to avoid expanding beyond element bounds */
  box-shadow: inset 0 0 0 1px var(--accent-primary);
}

.country-option:active {
  transform: translateX(0);
  background: var(--bg-primary);
}

.country-option:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.country-name {
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.country-currency {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  font-weight: var(--font-normal);
}

/* Payment Methods List */
.payment-methods-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.payment-method-option {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.payment-method-option:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

.payment-method-option:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.payment-method-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  color: var(--accent-primary);
}

.payment-method-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.payment-method-name {
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.payment-method-desc {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

/* Bank/Network List */
.bank-list,
.network-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-height: 300px;
  overflow-y: auto;
}

.bank-option,
.network-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.bank-option:hover,
.network-option:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

.bank-option:disabled,
.network-option:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bank-name,
.network-name {
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

.bank-ussd {
  font-size: var(--text-sm);
  color: var(--accent-primary);
  font-family: var(--font-mono);
}

/* Payment Result Info */
.payment-result-info {
  background: var(--bg-secondary);
  padding: var(--space-lg);
  border-radius: var(--radius-md);
}

/* Center align loader in payment result info */
.payment-result-info .loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.payment-result-info p {
  margin: 0 0 var(--space-md) 0;
  color: var(--text-secondary);
}

.payment-detail {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.payment-detail:last-of-type {
  border-bottom: none;
}

.payment-detail .label {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

.payment-detail .value {
  color: var(--text-primary);
  font-weight: var(--font-medium);
  width: 100%;
}

.payment-detail .value.copyable {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  cursor: pointer;
  color: var(--accent-primary);
}

.payment-detail .value.copyable:hover {
  text-decoration: underline;
}

.ussd-code {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--accent-primary);
  text-align: center;
  padding: var(--space-lg);
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  margin: var(--space-md) 0;
  font-family: var(--font-mono);
}

.payment-note {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-top: var(--space-md) !important;
  font-style: italic;
}

/* Dialog Overlay */
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: var(--space-lg);
  backdrop-filter: blur(4px);
  /* Dark mode overlay adjustment */
}

[data-theme="dark"] .dialog-overlay {
  background: rgba(0, 0, 0, 0.75);
}

.dialog {
  animation: dialogSlideIn 0.2s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
  .subscription-info {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }
  
  .subscription-info-item {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.75rem 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    gap: 0.25rem;
  }
  
  .subscription-info-item .label {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    font-weight: var(--font-medium);
  }
  
  .subscription-info-item .value {
    font-size: var(--text-base);
    color: var(--text-primary);
    font-weight: var(--font-semibold);
    text-align: center;
  }
  
  .subscription-actions {
    margin-top: var(--space-md);
  }
  
  .subscription-actions .btn-danger {
    width: 100%;
  }
  
  .subscription-dialog {
    max-width: 100%;
    max-height: 90vh;
    margin: var(--space-md);
  }
  
  .dialog-body,
  .subscription-dialog .dialog-body {
    padding: 12px;
  }

  .payment-result-info {
    padding: 12px;
  }

  .country-option {
    padding: var(--space-md) 12px;
  }

  .payment-method-option {
    padding: var(--space-md) 12px;
  }

  .bank-option,
  .network-option {
    padding: var(--space-md) 12px;
  }

  .ussd-code {
    padding: 12px;
  }

  .dialog-overlay {
    padding: 12px;
  }

  .payment-method-desc {
    text-align: left;
  }
  
  .country-list {
    max-height: calc(90vh - 200px); /* Adapt to screen height minus header/description */
    min-height: 150px;
  }
  
  .dialog-actions {
    flex-direction: column;
  }
  
  .dialog-actions .btn {
    width: 100%;
  }
}

/* ==================== ADMIN PAGE ==================== */

.admin-page {
  max-width: 1400px;
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0.25rem;
  background: var(--bg-component);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  overflow-x: auto;
  position: relative;
}

/* Desktop tabs - show all */
/* Note: Scrollability styles are in admin.css */
.admin-tabs-desktop {
  display: flex;
  gap: 0.5rem;
  flex: 1;
}

/* Mobile tabs - hide by default */
.admin-tabs-mobile {
  display: none;
}

.admin-tabs .tab-btn {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.admin-tabs .tab-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.admin-tabs .tab-btn.active {
  background: var(--accent-primary);
  color: white;
}

/* Mobile hamburger button */
.admin-tabs-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.admin-tabs-hamburger:hover {
  background: var(--bg-secondary);
  border-color: var(--border-hover);
}

.admin-tabs-hamburger:active {
  transform: scale(0.95);
}

/* Mobile active tab button */
.tab-btn-active-mobile {
  flex: 1;
  text-align: left;
  background: transparent !important;
  color: var(--text-primary) !important;
  font-weight: 700;
}

/* Mobile dropdown menu */
.admin-tabs-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  left: 0;
  background: var(--bg-component);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

.admin-tabs-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  text-align: left;
  width: 100%;
}

.admin-tabs-dropdown-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.admin-tabs-dropdown-item.active {
  background: var(--accent-primary);
  color: white;
}

.admin-tabs-dropdown-item svg {
  flex-shrink: 0;
  opacity: 0.8;
}

.admin-tabs-dropdown-item.active svg {
  opacity: 1;
}

/* Menu overlay for mobile */
.admin-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 999;
  backdrop-filter: blur(2px);
}

/* Slide transition for dropdown */
.admin-menu-slide-enter-active,
.admin-menu-slide-leave-active {
  transition: all 0.2s ease;
}

.admin-menu-slide-enter-from {
  opacity: 0;
  transform: translateY(-10px);
}

.admin-menu-slide-leave-to {
  opacity: 0;
  transform: translateY(-10px);
}

/* Mobile responsive - hide desktop, show mobile */
@media (max-width: 768px) {
  .admin-tabs-desktop {
    display: none;
  }
  
  .admin-tabs-mobile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
  }
  
  .admin-tabs-hamburger {
    display: flex;
  }
  
  .admin-tabs {
    overflow-x: visible;
  }
}

/* Admin Stats Grid */
.admin-content .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-content .stat-card {
  background: var(--bg-component);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--border-default);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.admin-content .stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.admin-content .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-content .stat-icon.users-icon { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.admin-content .stat-icon.businesses-icon { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.admin-content .stat-icon.subscriptions-icon { background: linear-gradient(135deg, #10b981, #059669); }
.admin-content .stat-icon.test-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.admin-content .stat-icon.pending-icon { background: linear-gradient(135deg, #ec4899, #db2777); }
.admin-content .stat-icon.admin-icon { background: linear-gradient(135deg, #6366f1, #4338ca); }

.admin-content .stat-icon svg {
  color: white;
}

.admin-content .stat-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.admin-content .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  /* Tighten spacing between value and label for admin stats */
  margin-bottom: 0.25rem;
}

.admin-content .stat-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* Recent Activity */
.recent-activity {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
}

.recent-section {
  background: var(--bg-component);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-default);
}

.recent-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-default);
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.recent-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  gap: 1rem;
}

.recent-item-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
}

/* For Recent Businesses: name and badge should be inline (row) */
/* When badge is present, switch to row layout */
.recent-item-info:has(.badge) {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Ensure badge doesn't wrap awkwardly */
.recent-item-info .badge {
  flex-shrink: 0;
}

.recent-item-name {
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

.recent-item-meta {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  line-height: 1.4;
  word-break: break-word;
}

.recent-item-date {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

/* Admin Table */
.table-container {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-component);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-default);
}

.admin-table thead {
  background: var(--bg-tertiary);
}

.admin-table th {
  text-align: left;
  padding: 1rem;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-default);
}

.admin-table td {
  padding: 1rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-default);
  font-size: var(--text-sm);
}

.admin-table tbody tr:hover {
  background: var(--bg-tertiary);
}

.admin-table .business-id {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--bg-tertiary);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

/* Admin Cards (responsive alternative to tables) */
.admin-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-card {
  background: var(--bg-component);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.admin-card-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-card-row--status {
  align-items: center;
}

.admin-card-row--meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.admin-card-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.admin-card-value {
  font-size: 0.85rem;
  color: var(--text-primary);
  text-align: right;
}

.admin-card-email {
  word-break: break-all;
}

.admin-card-business-name {
  font-weight: 500;
}

.admin-card-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.admin-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.badge-info {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

.badge-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.badge-admin {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
  color: #6366f1;
}

[data-theme="dark"] .badge-success {
  background: rgba(16, 185, 129, 0.2);
}

[data-theme="dark"] .badge-danger {
  background: rgba(239, 68, 68, 0.2);
}

[data-theme="dark"] .badge-warning {
  background: rgba(245, 158, 11, 0.2);
}

[data-theme="dark"] .badge-info {
  background: rgba(59, 130, 246, 0.2);
}

/* Grant Subscription Form */
.grant-admin {
  width: 100%;
}

.grant-admin-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.grant-admin-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.grant-admin-header .form-description {
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* Sub-tabs: hidden on desktop, visible on mobile */
.grant-sub-tabs {
  display: none;
  gap: 0;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border-subtle);
}

.grant-sub-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.grant-sub-tab:hover {
  color: var(--text-primary);
}

.grant-sub-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Side-by-side panels on desktop */
.grant-panels {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.grant-panel {
  flex: 1;
  min-width: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.grant-panel-header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.grant-panel-header h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.grant-panel-header .field-hint {
  margin-top: 0;
}

.grant-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.grant-form .form-actions {
  margin-top: 0;
}

.input-with-action {
  display: flex;
  gap: 0.5rem;
}

.input-with-action input {
  flex: 1;
}

/* Business Info Card */
.business-info-card {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  border: 1px solid var(--border-default);
}

.business-info-card h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #059669;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.business-info-card h4::before {
  content: '✓';
  width: 20px;
  height: 20px;
  background: #059669;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.business-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.info-value {
  font-size: 0.875rem;
  color: var(--text-primary);
}

/* Empty state small */
.empty-state-small {
  padding: 2rem;
  text-align: center;
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

/* Text utilities */
.text-muted {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

/* Responsive */
@media (max-width: 768px) {
  .admin-tabs {
    flex-wrap: nowrap;
  }
  
  .admin-tabs .tab-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
  
  .admin-content .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem;
  }
  
  .admin-content .stat-card {
    padding: 12px;
    flex-wrap: wrap;
    gap: 4px 8px;
  }
  
  .admin-content .stat-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
  }
  
  .admin-content .stat-icon svg {
    width: 16px;
    height: 16px;
  }
  
  .admin-content .stat-content {
    display: contents;
  }
  
  .admin-content .stat-value {
    font-size: 1.25rem;
    margin-bottom: 0;
  }
  
  .admin-content .stat-label {
    flex-basis: 100%;
    font-size: 0.75rem;
  }
  
  .recent-activity {
    grid-template-columns: 1fr;
  }
  
  .recent-item {
    gap: 0.75rem;
    padding: 0.65rem;
  }
  
  .recent-item-date {
    font-size: 0.75rem;
  }
  
  .business-info-grid {
    grid-template-columns: 1fr;
  }

  .recent-section {
    padding-left: 8px;
    padding-right: 8px;
  }
}

/* Grant panels: switch to tab mode at 1110px */
@media (max-width: 1110px) {
  .grant-sub-tabs {
    display: flex;
  }

  .grant-panels {
    flex-direction: column;
    align-items: center;
  }

  .grant-panel {
    display: none;
    width: 100%;
    max-width: 750px;
  }

  .grant-panel.grant-panel-active {
    display: block;
  }
}

/* Extra-small screens: prevent admin layout overflow */
@media (max-width: 512px) {
  .admin-page,
  .admin-content,
  .admin-tabs,
  .admin-card-list,
  .admin-card,
  .table-container {
    min-width: 0;
    width: 100%;
  }
  
  .admin-tabs {
    flex-wrap: wrap;
  }
}

@media (max-width: 1200px) {
  /* Prefer card layout on tablet and below */
  .admin-table {
    font-size: 0.8rem;
  }
  
  .admin-table th,
  .admin-table td {
    padding: 0.75rem 0.5rem;
  }
  
  .admin-card {
    padding: 0.75rem 0.85rem;
  }
}

/* Markdown Editor Styles */
.editor-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.editor-tabs .tab-button {
  background: none;
  border: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.editor-tabs .tab-button:hover {
  color: var(--text-primary);
  background: transparent;
}

.editor-tabs .tab-button.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background: transparent;
}

.editor-section {
  margin-top: 0.5rem;
}

.markdown-editor {
  width: 100%;
  min-height: 300px;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
}

.markdown-editor:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.markdown-preview {
  min-height: 300px;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  background: var(--bg-secondary);
  overflow-y: auto;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3,
.markdown-preview h4,
.markdown-preview h5,
.markdown-preview h6 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.markdown-preview h1 { font-size: 1.75rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; }
.markdown-preview h2 { font-size: 1.5rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.25rem; }
.markdown-preview h3 { font-size: 1.25rem; }
.markdown-preview h4 { font-size: 1.1rem; }
.markdown-preview h5 { font-size: 1rem; }
.markdown-preview h6 { font-size: 0.9rem; }

.markdown-preview p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.markdown-preview ul,
.markdown-preview ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.markdown-preview li {
  margin-bottom: 0.25rem;
}

.markdown-preview blockquote {
  border-left: 4px solid var(--primary-color);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-secondary);
  font-style: italic;
}

.markdown-preview code {
  background: var(--bg-tertiary);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}

.markdown-preview pre {
  background: var(--bg-tertiary);
  padding: 1rem;
  border-radius: 0.375rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.markdown-preview pre code {
  background: none;
  padding: 0;
}

.markdown-preview table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.markdown-preview th,
.markdown-preview td {
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  text-align: left;
}

.markdown-preview th {
  background: var(--bg-secondary);
  font-weight: 600;
}

.markdown-preview a {
  color: var(--primary-color);
  text-decoration: none;
}

.markdown-preview a:hover {
  text-decoration: underline;
}

.markdown-preview hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2rem 0;
}

.markdown-preview img {
  max-width: 100%;
  height: auto;
  border-radius: 0.375rem;
}

/* Character Counter Styles */
.character-counter {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 0.25rem;
  font-weight: 500;
}

.character-counter.counter-warning {
  color: var(--warning-color);
}

.field-hint {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Override flex-direction for other_info field hint to allow inline flow */
.settings-section #business-other-info ~ .field-hint {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.25rem;
}

/* Style links in other_info field hint as subtle button-like elements */
.settings-section #business-other-info ~ .field-hint a {
  padding: 2px 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  display: inline-block;
}

.settings-section #business-other-info ~ .field-hint a:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-emphasis);
}

/* Information Dialog Styles - Following existing dialog patterns */
.information-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.information-dialog {
  background: var(--bg-primary);
  border-radius: 0.75rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
}

.information-dialog-info {
  border-left: 4px solid var(--primary-color);
}

.information-dialog-warning {
  border-left: 4px solid #f59e0b;
}

.information-dialog-error {
  border-left: 4px solid #ef4444;
}

.information-dialog-header {
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.information-dialog-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.information-dialog-icon-info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-color);
}

.information-dialog-icon-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.information-dialog-icon-error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.information-dialog-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.information-dialog-body {
  padding: 0 1.5rem;
  flex: 1;
  overflow-y: auto;
  min-height: 0; /* Allow flex shrinking */
}

.information-dialog-content {
  margin-bottom: 1.5rem;
}

.information-dialog-message {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.information-dialog-footer {
  padding: 1rem 1.5rem 1.5rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-shrink: 0;
  border-top: 1px solid var(--border-default);
  margin-top: auto;
}

.information-dialog-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.information-dialog-btn-ok {
  background: #0066cc;
  color: white;
  font-weight: 600;
}

.information-dialog-btn-ok:hover {
  background: #0052a3;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.information-dialog-btn-ok-info {
  background: #0066cc;
  color: white;
}

.information-dialog-btn-ok-warning {
  background: #f59e0b;
  color: white;
}

.information-dialog-btn-ok-warning:hover {
  background: #d97706;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.information-dialog-btn-ok-error {
  background: #ef4444;
  color: white;
}

.information-dialog-btn-ok-error:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.information-dialog-btn-ok:active {
  transform: translateY(0);
}

/* Dark mode support */
[data-theme="dark"] .information-dialog-btn-ok {
  background: #3b82f6;
  color: white;
}

[data-theme="dark"] .information-dialog-btn-ok:hover {
  background: #2563eb;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

[data-theme="dark"] .information-dialog-btn-ok-info {
  background: #3b82f6;
  color: white;
}

[data-theme="dark"] .information-dialog-btn-ok-warning {
  background: #f59e0b;
  color: white;
}

[data-theme="dark"] .information-dialog-btn-ok-error {
  background: #ef4444;
  color: white;
}

/* Dark mode support for information dialog */
[data-theme="dark"] .information-dialog {
  background: #1e293b;
  border: 1px solid #334155;
}

[data-theme="dark"] .information-dialog-title {
  color: #f1f5f9;
}

[data-theme="dark"] .information-dialog-message {
  color: #94a3b8;
}

[data-theme="dark"] .information-dialog-icon-info {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

[data-theme="dark"] .information-dialog-icon-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

[data-theme="dark"] .information-dialog-icon-error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Responsive design */
@media (max-width: 640px) {
  .information-dialog {
    margin: 1rem;
    max-width: none;
    width: calc(100vw - 2rem);
  }

  .information-dialog-header {
    padding: 1rem;
  }

  .information-dialog-body {
    padding: 0 1rem;
  }

  .information-dialog-footer {
    padding: 1rem;
  }
}

/* ==================== DASHBOARD OVERVIEW PAGE ==================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.dashboard-card {
  background: var(--bg-component);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

.dashboard-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.dashboard-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-default);
}

.dashboard-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-primary);
  background: var(--bg-secondary);
  transition: all var(--transition-normal);
}

.dashboard-card-icon svg {
  width: 24px;
  height: 24px;
}

.dashboard-card-icon.business-icon {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
}

.dashboard-card-icon.products-icon {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.dashboard-card-icon.services-icon {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.dashboard-card-icon.agent-icon {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
}

.dashboard-card-icon.docs-icon {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.dashboard-card-icon.chatbot-icon {
  background: rgba(236, 72, 153, 0.1);
  color: #ec4899;
}

.dashboard-card-icon.settings-icon {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.dashboard-card-icon.subscription-icon {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.dashboard-card-icon.model-icon {
  background: rgba(14, 165, 233, 0.1);
  color: #0ea5e9;
}

.dashboard-card-icon.api-credits-icon {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

/* Agent Models Summary Card */
.agent-models-summary {
  gap: 0.75rem;
}

.agent-model-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.agent-model-row:last-of-type {
  border-bottom: none;
}

.agent-model-row-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.agent-model-row-icon {
  font-size: 1rem;
  line-height: 1;
}

.agent-model-row-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.agent-model-row-badge {
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.agent-model-row-badge.badge-standard {
  background: #e0f2fe;
  color: #0369a1;
}

.agent-model-row-badge.badge-advanced {
  background: #fce7f3;
  color: #be185d;
}

[data-theme="dark"] .agent-model-row-badge.badge-standard {
  background: #0c4a6e;
  color: #7dd3fc;
}

[data-theme="dark"] .agent-model-row-badge.badge-advanced {
  background: #831843;
  color: #f9a8d4;
}

.agent-model-row-badge.badge-test {
  background: #dcfce7;
  color: #166534;
}

[data-theme="dark"] .agent-model-row-badge.badge-test {
  background: #14532d;
  color: #86efac;
}

/* ═══ API Completions Card — Redesigned ═══ */
.credits-overview {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.credits-overview > .btn {
  margin-top: auto;
  align-self: flex-end;
}

.credits-section {
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-subtle, #e2e8f0);
}

[data-theme="dark"] .credits-section {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.credits-section-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.credits-env-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.credits-env-dot.credits-env-production {
  background: #22c55e;
  box-shadow: 0 0 4px rgba(34, 197, 94, 0.4);
}

.credits-env-dot.credits-env-test {
  background: #f59e0b;
  box-shadow: 0 0 4px rgba(245, 158, 11, 0.4);
}

.credits-env-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.credits-env-badge {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.08rem 0.3rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-left: auto;
}

.credits-env-badge.badge-production {
  background: #dcfce7;
  color: #166534;
}

[data-theme="dark"] .credits-env-badge.badge-production {
  background: #14532d;
  color: #86efac;
}

.credits-row {
  margin-bottom: 0.35rem;
}

.credits-row:last-of-type {
  margin-bottom: 0;
}

.credits-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.2rem;
}

.credits-tier-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
}

.credits-tier-model {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-tertiary);
}

.credits-row-numbers {
  font-size: 0.725rem;
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.credits-row-bar {
  height: 4px;
  background: var(--border-default, #e2e8f0);
  border-radius: 2px;
  overflow: hidden;
}

.credits-row-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

.credits-row-fill.credits-fill-production {
  background: #22c55e;
}

.credits-row-fill.credits-fill-test {
  background: #f59e0b;
}

.credits-row-fill.credits-fill-universal {
  background: #8b5cf6;
}

.credits-row-fill.usage-warning {
  background: #f59e0b;
}

.credits-row-fill.usage-critical {
  background: #ef4444;
}

.credits-empty-note {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-style: italic;
}

.credits-grants-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(236, 72, 153, 0.08));
  border: 1px solid rgba(168, 85, 247, 0.15);
  font-size: 0.725rem;
  color: #9333ea;
  font-weight: 500;
}

[data-theme="dark"] .credits-grants-badge {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(236, 72, 153, 0.1));
  border-color: rgba(168, 85, 247, 0.25);
  color: #c084fc;
}

.credits-grants-badge svg {
  color: #a855f7;
  flex-shrink: 0;
}

[data-theme="dark"] .credits-grants-badge svg {
  color: #c084fc;
}

.agent-model-row-usage {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.agent-model-row-bar {
  flex: 1;
  height: 5px;
  background: var(--border-default);
  border-radius: 3px;
  overflow: hidden;
}

.agent-model-row-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.agent-model-row-fill.usage-warning {
  background: #f59e0b;
}

.agent-model-row-fill.usage-critical {
  background: #ef4444;
}

.agent-model-row-numbers {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.agent-model-row-locked {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.dashboard-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.4;
}

.dashboard-card-content {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.dashboard-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem 0;
  min-height: 120px;
}

.dashboard-empty-state .empty-icon {
  width: 64px;
  height: 64px;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
  opacity: 0.5;
}

.dashboard-empty-state .empty-message {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.dashboard-empty-state .btn {
  margin-top: auto;
}

.dashboard-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.dashboard-info .info-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dashboard-info .info-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.dashboard-info .info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.dashboard-info .info-value.status-ready {
  color: #10b981;
  font-size: 1.125rem;
}

/* Reduce font size for message usage counter specifically */
.dashboard-card .info-row .info-value {
  font-size: 0.9rem;
}

/* Chatbot card: agent name styling */
.dashboard-card .info-row .chatbot-name-value {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

/* Subscription card: plan name styling */
.dashboard-card .info-row .subscription-plan-value {
  font-weight: 600;
  color: var(--text-primary);
}

/* Subscription card: days left warning colors */
.dashboard-card .info-row .days-warning {
  color: #f59e0b;
  font-weight: 600;
}

.dashboard-card .info-row .days-critical {
  color: #ef4444;
  font-weight: 600;
}

.dashboard-info .btn {
  margin-top: auto;
  align-self: flex-end;
}

/* ── Docs Stats Grid ── */
.docs-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
}

.docs-stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--card-border);
  transition: border-color 0.2s ease;
  overflow: hidden;
}

[data-theme="light"] .docs-stat-item {
  background: var(--bg-tertiary);
}

.docs-stat-item:hover {
  border-color: var(--text-secondary);
}

.docs-stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  flex-shrink: 0;
}

[data-theme="light"] .docs-stat-icon {
  background: var(--bg-primary);
}

.docs-stat-detail {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.docs-stat-value {
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.docs-stat-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.docs-stats-divider {
  width: 100%;
  height: 1px;
  background: var(--card-border);
  margin: -2px 0;
}

.docs-kv-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.docs-kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 0;
}

.docs-kv-left {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.docs-kv-left svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.docs-kv-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* Docs card: border-top divider on kv-list */
.docs-kv-list.docs-kv-list-bordered {
  border-top: 1px solid var(--card-border);
  padding-top: 8px;
}

.docs-item-selected {
  outline: 2px solid #3b82f6;
  outline-offset: -2px;
  background: rgba(59, 130, 246, 0.06);
}

.docs-tree-row.docs-item-selected {
  background: rgba(59, 130, 246, 0.08);
}

[data-theme="dark"] .docs-item-selected {
  background: rgba(59, 130, 246, 0.12);
}

/* Agent Config card: inline count row */
.agent-count-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.agent-count-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Agent Config card: kv-list with divider */
.agent-kv-list {
  border-top: 1px solid var(--card-border);
  padding-top: 8px;
}

/* Agent Config card: larger values */
.agent-kv-value {
  font-size: 0.88rem;
  font-weight: 600;
}

.agents-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.75rem 0;
  flex: 1;
}

.agents-list + .btn {
  margin-top: auto;
}

.agent-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.agent-name {
  font-weight: 500;
  color: var(--text-primary);
}

.agent-business {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.agent-more {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
  font-style: italic;
  padding: 0.25rem 0.5rem;
}

.settings-summary {
  gap: 0.5rem;
  flex: 1;
}

.settings-summary .btn {
  margin-top: auto;
}

.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-default);
  font-size: 0.875rem;
}

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

.settings-label {
  font-weight: 500;
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-right: 1rem;
}

.settings-value {
  color: var(--text-primary);
  text-align: right;
  flex: 1;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge-sm {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

/* Subscription status badges */
.badge-test {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-active {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-expired,
.badge-cancelled,
.badge-inactive {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-pending {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

[data-theme="dark"] .badge-test {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .badge-active {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
}

[data-theme="dark"] .badge-expired,
[data-theme="dark"] .badge-cancelled,
[data-theme="dark"] .badge-inactive {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

[data-theme="dark"] .badge-pending {
  background: rgba(107, 114, 128, 0.2);
  border-color: rgba(107, 114, 128, 0.4);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* ==================== IMAGE VIEWER DIALOG ==================== */

.image-viewer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: pointer;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.image-viewer-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white; /* Always white for better visibility, even in light mode */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10001;
  backdrop-filter: blur(10px);
}

.image-viewer-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.image-viewer-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.image-viewer-image {
  max-width: 90%;
  max-height: 80%;
  width: auto;
  height: auto;
  min-width: 300px;
  min-height: 300px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transition: transform var(--transition-normal);
  background-color: rgba(255, 255, 255, 0.05);
}

.image-viewer-image:hover {
  transform: scale(1.02);
}

.image-viewer-description {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.7), transparent);
  padding: 2rem;
  padding-top: 4rem;
  color: white;
  text-align: center;
  animation: slideUp 0.3s ease-out;
  pointer-events: none;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.image-viewer-description h4 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  margin: 0 0 0.5rem 0;
  color: white;
}

.image-viewer-description p {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  margin: 0 0 1rem 0;
  color: rgba(255, 255, 255, 0.9);
  max-width: 800px;
  margin: 0 auto 1rem auto;
}

.image-viewer-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.image-viewer-price .price-current {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: white;
}

.image-viewer-price .price-old {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: line-through;
}

[data-theme="dark"] .image-viewer-overlay {
  background: rgba(0, 0, 0, 0.98);
}

[data-theme="dark"] .image-viewer-close {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: white;
}

[data-theme="dark"] .image-viewer-close:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Responsive image viewer */
@media (max-width: 768px) {
  .image-viewer-overlay {
    padding: 1rem;
  }
  
  .image-viewer-close {
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
  }
  
  .image-viewer-image {
    max-width: 100%;
    max-height: 70%;
  }
  
  .image-viewer-description {
    padding: 1.5rem;
    padding-top: 3rem;
  }
  
  .image-viewer-description h4 {
    font-size: var(--text-lg);
  }
  
  .image-viewer-description p {
    font-size: var(--text-sm);
  }
}

/* Responsive Design for Product Cards */
@media (max-width: 768px) {
  .product-card-top {
    flex-direction: column;
    position: relative;
  }
  
  .product-image {
    width: 100%;
    height: 250px;
    min-width: 100%;
    min-height: 250px;
    background-size: contain;
    background-position: center;
    margin-bottom: 0.5rem;
  }
  
  .product-description {
    -webkit-line-clamp: 3;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.5), transparent);
    padding: 1rem;
    padding-top: 3rem;
    padding-bottom: 1.5rem; /* Added bottom padding to prevent text from touching edge */
    color: white;
    margin: 0;
    -webkit-line-clamp: 2;
    z-index: 1;
  }
  
  .product-price-section {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }
  
  .product-price {
    flex: 1;
  }
  
  .price-current {
    font-size: var(--text-lg);
  }
  
  .product-actions {
    gap: 0.25rem;
    flex-shrink: 0;
  }
  
  .product-actions .btn-icon-small {
    padding: 0.375rem;
    width: 32px;
    height: 32px;
  }
  
  .product-meta {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.5rem;
  }
  
  .product-meta .product-category {
    margin-right: auto;
  }
}

/* Responsive Design for Dashboard */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
  }
  
  .dashboard-overview {
    padding: 0;
  }
}

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .dashboard-card {
    padding: 1.25rem;
  }
  
  .dashboard-card-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
  }
  
  .dashboard-card-icon {
    width: 36px;
    height: 36px;
  }
  
  .dashboard-card-icon svg {
    width: 20px;
    height: 20px;
  }
  
  .dashboard-card-title {
    font-size: 1rem;
  }
  
  .dashboard-info .info-value {
    font-size: 1.25rem;
  }
  
  .settings-item {
    gap: 0.5rem;
    font-size: 0.8125rem;
  }
  
  .settings-value {
    text-align: right;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  /* No padding needed - dashboard-content handles it */
  
  .dashboard-card {
    padding: 1rem;
  }
  
  .dashboard-empty-state .empty-icon {
    width: 48px;
    height: 48px;
  }
  
  .dashboard-empty-state .empty-message {
    font-size: 0.875rem;
  }
}

/* Dark mode adjustments for dashboard cards */
@media (prefers-color-scheme: dark) {
  .dashboard-card-icon.business-icon {
    background: rgba(99, 102, 241, 0.2);
  }
  
  .dashboard-card-icon.products-icon {
    background: rgba(16, 185, 129, 0.2);
  }
  
  .dashboard-card-icon.services-icon {
    background: rgba(59, 130, 246, 0.2);
  }
  
  .dashboard-card-icon.agent-icon {
    background: rgba(168, 85, 247, 0.2);
  }
  
  .dashboard-card-icon.docs-icon {
    background: rgba(245, 158, 11, 0.2);
  }
  
  .dashboard-card-icon.chatbot-icon {
    background: rgba(236, 72, 153, 0.2);
  }
  
  .dashboard-card-icon.settings-icon {
    background: rgba(107, 114, 128, 0.2);
  }
  
  .dashboard-card-icon.subscription-icon {
    background: rgba(245, 158, 11, 0.2);
  }
}

/* ==================== MOBILE INPUT ZOOM PREVENTION ==================== */
/* Prevent iOS Safari from zooming when users tap on input fields */
/* iOS Safari automatically zooms if input font-size is less than 16px */
/* This override ensures all form inputs use 16px on mobile devices */

@media screen and (max-width: 947px) {
  /* Override any smaller font-sizes for form inputs on mobile */
  .form-group input,
  .form-group textarea,
  .form-group select,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="time"],
  input[type="month"],
  input[type="week"],
  textarea,
  select {
    font-size: 16px !important; /* Prevents iOS zoom on focus - must be 16px or larger */
    touch-action: manipulation; /* Improves touch responsiveness */
  }
}

/* ==================== HELP PAGE STYLES ==================== */
.help-page {
  padding: 0;
}

.help-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  align-items: center;
  margin-top: var(--space-2xl);
}

.help-intro-row {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  width: 100%;
}

.help-text-group {
  flex: 1;
}

.help-left-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.help-right-column {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.help-illustration {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--accent-primary-light, rgba(139, 92, 246, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary, #8b5cf6);
  margin-bottom: 0;
  flex-shrink: 0;
}

.help-illustration svg {
  width: 60px;
  height: 60px;
}

.help-subtitle {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-md);
  margin-top: 0;
  color: var(--text-primary);
  text-align: left;
}

.help-description {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  margin-bottom: 0;
  color: var(--text-secondary);
  text-align: left;
  max-width: none;
}

.contact-options {
  display: flex;
  flex-direction: row;
  gap: var(--space-md);
  width: 100%;
  max-width: 800px;
  margin-top: 32px;
}

.contact-option {
  display: flex;
  align-items: center;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-subtle);
  flex: 1;
}

.contact-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  color: var(--text-primary);
}

.contact-option:active {
  transform: translateY(0);
}

.contact-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: var(--accent-primary-light, rgba(139, 92, 246, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: var(--space-md);
  flex-shrink: 0;
  color: var(--accent-primary, #8b5cf6);
}

.contact-icon-wrapper svg {
  width: 24px;
  height: 24px;
}

.contact-icon-wrapper.whatsapp-icon {
  background-color: rgba(37, 211, 102, 0.1);
  color: #25d366;
}

.contact-details {
  flex: 1;
  text-align: left;
}

.contact-details h4 {
  margin: 0 0 var(--space-xs);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.contact-details p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.contact-arrow {
  margin-left: var(--space-md);
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* Dark mode support for help page */
[data-theme="dark"] .help-illustration {
  background: rgba(139, 92, 246, 0.15);
}

[data-theme="dark"] .contact-option {
  background-color: var(--bg-primary);
  border-color: var(--border-default);
}

[data-theme="dark"] .contact-option:hover {
  background-color: var(--bg-secondary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Mobile optimizations for help page */
@media screen and (max-width: 1120px) {
  .help-content-wrapper {
    flex-direction: column;
    gap: var(--space-xl);
    margin-top: var(--space-lg);
  }
  
  .help-intro-row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .help-text-group {
    text-align: center;
  }
  
  .help-left-column {
    align-items: center;
    text-align: center;
    width: 100%;
  }
  
  .help-right-column {
    width: 100%;
  }
  
  .help-illustration {
    width: 100px;
    height: 100px;
    margin-bottom: var(--space-lg);
  }
  
  .help-illustration svg {
    width: 50px;
    height: 50px;
  }
  
  .help-subtitle {
    font-size: var(--text-xl);
    text-align: center;
    width: 100%;
  }
  
  .help-description {
    text-align: center;
    width: 100%;
  }
  
  .contact-options {
    flex-direction: row;
    gap: var(--space-md);
    width: 100%;
    max-width: none;
    margin-top: 0;
  }
  
  .contact-option {
    padding: var(--space-md);
    flex: 1;
  }
  
  .contact-icon-wrapper {
    width: 44px;
    height: 44px;
  }
  
  .contact-icon-wrapper svg {
    width: 20px;
    height: 20px;
  }
}

/* Very small screens: Stack contact options vertically */
@media screen and (max-width: 600px) {
  .contact-options {
    flex-direction: column;
    gap: var(--space-md);
  }
  
  .contact-option {
    width: 100%;
    flex: none;
  }
}

/* ==================== SUBSCRIPTION HELP LINK STYLES ==================== */
.subscription-actions-group {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.subscription-help-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--accent-primary, #8b5cf6);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  transition: color var(--transition-fast);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  cursor: pointer;
}

.subscription-help-link:hover {
  color: var(--accent-primary-dark, #7c3aed);
  text-decoration: underline;
  background: var(--accent-primary-light, rgba(139, 92, 246, 0.05));
}

.subscription-help-link svg {
  width: 16px;
  height: 16px;
  transition: transform var(--transition-fast);
}

.subscription-help-link:hover svg {
  transform: translateX(2px);
}

[data-theme="dark"] .subscription-help-link {
  color: var(--accent-primary, #8b5cf6);
}

[data-theme="dark"] .subscription-help-link:hover {
  color: var(--accent-primary-light, #a78bfa);
  background: rgba(139, 92, 246, 0.1);
}

/* Mobile: Stack subscription actions vertically */
@media screen and (max-width: 768px) {
  .subscription-actions-group {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
  }
  
  .subscription-actions-group .btn-danger {
    width: 100%;
  }
  
  .subscription-help-link {
    width: 100%;
    justify-content: center;
    padding: var(--space-sm);
  }
}

/* ==================== Scroll to Top Button ==================== */
.scroll-to-top-btn {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-xl);
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 998; /* Below AI chat FAB (999) but above most content */
  animation: scrollToTopFadeIn 0.3s ease-out;
  opacity: 0.9;
}

@keyframes scrollToTopFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.scroll-to-top-btn:hover {
  background: var(--accent-secondary);
  transform: translateX(-50%) scale(1.1);
  box-shadow: var(--shadow-2xl);
  opacity: 1;
}

.scroll-to-top-btn:active {
  transform: translateX(-50%) scale(0.95);
}

/* Mobile: Maintain same distance from viewport bottom as desktop */
@media (max-width: 768px) {
  .scroll-to-top-btn {
    bottom: 16px; /* Match theme toggle mobile positioning */
    opacity: 0.85;
  }
}

/* Dashboard: Adjust position to avoid conflicts */
.dashboard-layout .scroll-to-top-btn {
  z-index: 997; /* Below AI chat FAB */
}

/* ==================== PULL TO REFRESH ==================== */
.pull-to-refresh-container {
  min-height: 100%;
  position: relative;
}

.pull-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  color: var(--accent-primary, #8b5cf6);
  background: var(--bg-component, #ffffff);
  z-index: 100;
  transform: translateY(-60px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
  backdrop-filter: blur(4px);
  font-size: 0.8125rem;
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid var(--border-default, #e5e7eb);
  pointer-events: none;
}

.pull-indicator.visible {
  opacity: 1;
  transition: transform 0.15s ease-out, opacity 0.15s ease-out;
}

.pull-indicator.refreshing {
  transform: translateY(0) !important;
  opacity: 1 !important;
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

[data-theme="dark"] .pull-indicator {
  background: rgba(30, 30, 30, 0.85);
  border-bottom: 1px solid #333;
}

.pull-spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(139, 92, 246, 0.3);
  border-top: 2px solid var(--accent-primary, #8b5cf6);
  margin-right: 8px;
  animation: pull-refresh-spin 1s linear infinite;
}

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

/* ==================== MOBILE DIALOG HEIGHT CONSTRAINT ==================== */
/* Prevents complex dialogs from overextending on ALL platforms (mobile browsers + Android app).
   Caps complex dialog containers (forms with much content) at 75vh.
   Complex dialogs: .modal-content (Create/Edit forms), .products-dialog, .services-dialog
   Simple dialogs (.action-dialog, .confirmation-dialog, .information-dialog) only capped on browsers. */

@media (max-width: 768px) {
  /* Complex dialogs: fixed to 75% of the preserved viewport height */
  .modal-content,
  .products-dialog,
  .services-dialog {
    height: calc(var(--initial-viewport-height, 100vh) * 0.75);
    max-height: none;
    border-radius: 16px;
  }

  /* Simple utility dialogs: 70vh only on browsers (Android app has its own handling) */
  :root:not(.android-webview-app) .action-dialog,
  :root:not(.android-webview-app) .confirmation-dialog,
  :root:not(.android-webview-app) .information-dialog {
    max-height: 70vh;
    border-radius: 16px;
  }

  /* Fix services-dialog going full-screen at 768px (was padding: 0, border-radius: 0) */
  :root:not(.android-webview-app) .services-dialog-overlay {
    padding: 1rem;
  }
}

/* ==================== ANDROID WEBVIEW APP SAFE AREA ==================== */
/* Applied when running inside the SalesCatalog Android app.
   Flutter injects CSS variables: --inset-top, --inset-bottom, --inset-left, --inset-right
   The .android-webview-app class is added by both Flutter and the frontend mobile-viewport.js */

.android-webview-app body {
  overflow: hidden;
}

.android-webview-app .dashboard-header {
  /*padding-top: calc(var(--inset-top, 0px) + 0.875rem);*/
  padding-top: calc(var(--inset-top, 0px) - 12px); /* Negative padding to offset the extra space added by Flutter's SafeArea */
}

.android-webview-app .left-menu {
  padding-top: var(--inset-top, 0px);
  padding-bottom: var(--inset-bottom, 0px);
}

.android-webview-app .theme-toggle-btn {
  bottom: calc(24px + var(--inset-bottom, 0px));
}

.android-webview-app .fab-visibility-toggle {
  bottom: calc(24px + var(--inset-bottom, 0px));
}

.android-webview-app .floating-save-button {
  bottom: calc(88px + var(--inset-bottom, 0px));
}

.android-webview-app .ai-chat-fab-wrapper {
  bottom: calc(88px + var(--inset-bottom, 0px));
}

.android-webview-app .scroll-to-top-btn {
  bottom: calc(24px + var(--inset-bottom, 0px));
}

.android-webview-app .ai-chat-prompt {
  bottom: calc(88px + var(--inset-bottom, 0px));
}

.android-webview-app .confirmation-dialog-overlay,
.android-webview-app .action-dialog-overlay,
.android-webview-app .services-dialog-overlay,
.android-webview-app .products-dialog-overlay,
.android-webview-app .theme-dialog-backdrop,
.android-webview-app .service-mode-dialog-backdrop,
.android-webview-app .dialog-overlay,
.android-webview-app .information-dialog-overlay {
  padding-top: calc(var(--inset-top, 0px) + 16px);
  padding-bottom: calc(var(--inset-bottom, 0px) + 16px);
}

.android-webview-app .analytics-page .detail-overlay {
  padding-top: var(--inset-top, 0px);
}

/* Complex dialogs: fixed to the preserved viewport height even in Android app */
.android-webview-app .modal-content,
.android-webview-app .services-dialog,
.android-webview-app .products-dialog {
  height: calc(var(--initial-viewport-height, 100vh) * 0.75);
  max-height: none;
}

/* Simple/utility dialogs: use safe-area-aware full height in Android app */
.android-webview-app .action-dialog,
.android-webview-app .subscription-dialog,
.android-webview-app .information-dialog {
  max-height: calc(100vh - var(--inset-top, 0px) - var(--inset-bottom, 0px) - 32px);
}

@media (max-width: 480px) {
  .android-webview-app .theme-toggle-btn {
    bottom: calc(16px + var(--inset-bottom, 0px));
  }

  .android-webview-app .fab-visibility-toggle {
    bottom: calc(16px + var(--inset-bottom, 0px));
  }

  .android-webview-app .floating-save-button {
    bottom: calc(80px + var(--inset-bottom, 0px));
  }

  .android-webview-app .ai-chat-fab-wrapper {
    bottom: calc(80px + var(--inset-bottom, 0px));
  }

  .android-webview-app .scroll-to-top-btn {
    bottom: calc(16px + var(--inset-bottom, 0px));
  }

  .android-webview-app .ai-chat-prompt {
    bottom: calc(136px + var(--inset-bottom, 0px));
  }

  .android-webview-app .services-dialog,
  .android-webview-app .products-dialog {
    height: calc(var(--initial-viewport-height, 100vh) * 0.75);
    max-height: none;
  }
}

/* AI Chat Widget safe area adjustments */
.android-webview-app .ai-chat-widget-container {
  padding-bottom: var(--inset-bottom, 0px);
}

/* Toast notification safe area adjustment */
.android-webview-app .toast-container {
  top: calc(var(--inset-top, 0px) + 20px);
}

/* Image Viewer Dialog safe area adjustments */
.android-webview-app .image-viewer-close {
  top: calc(1.5rem + var(--inset-top, 0px));
}

.android-webview-app .image-viewer-description {
  padding-bottom: calc(2rem + var(--inset-bottom, 0px));
}

@media (max-width: 768px) {
  .android-webview-app .image-viewer-close {
    top: calc(1rem + var(--inset-top, 0px));
  }

  .android-webview-app .image-viewer-description {
    padding-bottom: calc(1.5rem + var(--inset-bottom, 0px));
  }
}

/* Auth pages (Login, Signup, etc.) safe area adjustments */
.android-webview-app .auth-page {
  padding: calc(var(--inset-top, 0px) + 12px) 14px calc(var(--inset-bottom, 0px) + 12px) 14px;
  box-sizing: border-box;
  overflow-y: auto;
  align-items: center;
}

.android-webview-app .auth-page {
  padding-bottom: calc(var(--inset-bottom, 0px) + 34px);
}

/* ==================== KEYBOARD OPEN: Remove bottom safe area insets ==================== */
/* When the native keyboard is open, the system navigation bar is hidden,
   so --inset-bottom padding/offsets are no longer needed.
   Flutter toggles the 'native-keyboard-open' class on <html> via _injectKeyboardState(). */

.android-webview-app.native-keyboard-open .left-menu {
  padding-bottom: 0;
}

.android-webview-app.native-keyboard-open .theme-toggle-btn {
  bottom: 24px;
}

.android-webview-app.native-keyboard-open .fab-visibility-toggle {
  bottom: 24px;
}

.android-webview-app.native-keyboard-open .floating-save-button {
  bottom: 88px;
}

.android-webview-app.native-keyboard-open .ai-chat-fab-wrapper {
  bottom: 88px;
}

.android-webview-app.native-keyboard-open .scroll-to-top-btn {
  bottom: 24px;
}

.android-webview-app.native-keyboard-open .ai-chat-prompt {
  bottom: 88px;
}

.android-webview-app.native-keyboard-open .confirmation-dialog-overlay,
.android-webview-app.native-keyboard-open .action-dialog-overlay,
.android-webview-app.native-keyboard-open .services-dialog-overlay,
.android-webview-app.native-keyboard-open .products-dialog-overlay,
.android-webview-app.native-keyboard-open .theme-dialog-backdrop,
.android-webview-app.native-keyboard-open .service-mode-dialog-backdrop,
.android-webview-app.native-keyboard-open .dialog-overlay,
.android-webview-app.native-keyboard-open .information-dialog-overlay {
  padding-bottom: 16px;
}

/* When keyboard is open, make modal overlay scrollable so user can reach footer/action buttons */
.android-webview-app.native-keyboard-open .modal-overlay {
  overflow-y: auto;
  align-items: flex-start;
}

.android-webview-app.native-keyboard-open .modal-content,
.android-webview-app.native-keyboard-open .services-dialog,
.android-webview-app.native-keyboard-open .products-dialog {
  height: calc(var(--initial-viewport-height, 100vh) * 0.75);
  max-height: none;
}

.android-webview-app.native-keyboard-open .action-dialog,
.android-webview-app.native-keyboard-open .subscription-dialog,
.android-webview-app.native-keyboard-open .information-dialog {
  max-height: calc(100vh - var(--inset-top, 0px) - 32px);
}

.android-webview-app.native-keyboard-open .ai-chat-widget-container {
  padding-bottom: 0;
}

.android-webview-app.native-keyboard-open .image-viewer-description {
  padding-bottom: 2rem;
}

@media (max-width: 480px) {
  .android-webview-app.native-keyboard-open .theme-toggle-btn {
    bottom: 16px;
  }

  .android-webview-app.native-keyboard-open .fab-visibility-toggle {
    bottom: 16px;
  }

  .android-webview-app.native-keyboard-open .floating-save-button {
    bottom: 80px;
  }

  .android-webview-app.native-keyboard-open .ai-chat-fab-wrapper {
    bottom: 80px;
  }

  .android-webview-app.native-keyboard-open .scroll-to-top-btn {
    bottom: 16px;
  }

  .android-webview-app.native-keyboard-open .ai-chat-prompt {
    bottom: 136px;
  }

  .android-webview-app.native-keyboard-open .services-dialog,
  .android-webview-app.native-keyboard-open .products-dialog {
    height: calc(var(--initial-viewport-height, 100vh) * 0.75);
    max-height: none;
  }
}

/* ===========================
   NOTIFICATION SYSTEM STYLES
   =========================== */

/* --- Notification Bell (Dashboard Header) --- */
.notification-bell {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.notification-bell:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: var(--font-bold);
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

/* --- Notification Panel --- */
.notification-panel {
  position: fixed;
  top: 80px;
  right: 2rem;
  width: 380px;
  max-height: 480px;
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeInDown 0.2s ease;
}

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.notification-panel-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.notification-mark-all-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--accent-primary);
  padding: 2px 0;
  transition: color var(--transition-fast);
}

.notification-mark-all-btn:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.notification-mark-all-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.notification-panel-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.notification-close-btn:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

/* Drag handle - hidden on desktop, shown on mobile */
.notification-drag-handle {
  display: none;
}

.notification-panel-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* --- Notification Loading & Empty States --- */
.notification-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  gap: 12px;
}

.notification-loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-default);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.notification-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.notification-empty svg {
  opacity: 0.4;
  margin-bottom: 12px;
}

.notification-empty p {
  margin: 0 0 4px 0;
  font-size: 0.9rem;
  font-weight: var(--font-medium);
}

.notification-empty span {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* --- Notification List --- */
.notification-list {
  padding: 0;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-fast);
}

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

.notification-clickable {
  cursor: pointer;
}

.notification-clickable:hover {
  background: var(--bg-secondary);
}

.notification-unread {
  background: rgba(99, 102, 241, 0.04);
}

.notification-item-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  margin-top: 6px;
}

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

.notification-item-title {
  font-size: 0.85rem;
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: 2px;
  line-height: 1.3;
}

.notification-unread .notification-item-title {
  font-weight: var(--font-bold);
}

.notification-item-body {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-item-meta {
  display: flex;
  align-items: center;
  gap: 4px;
}

.notification-item-time {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.notification-item-link-icon {
  color: var(--text-tertiary);
  opacity: 0.6;
}

.notification-load-more {
  width: 100%;
  padding: 10px;
  background: none;
  border: none;
  border-top: 1px solid var(--border-subtle);
  color: var(--accent-primary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.notification-load-more:hover {
  background: var(--bg-secondary);
}

.notification-load-more:disabled {
  opacity: 0.5;
  cursor: default;
}

/* --- Notification Scroll Highlight Animation --- */
.notification-highlight {
  animation: notificationHighlightPulse 3s ease-out;
}

@keyframes notificationHighlightPulse {
  0% { box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.2); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* --- Admin Notification Form (ntf-* scoped) --- */
.ntf-admin {
  width: 100%;
}

.ntf-admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.ntf-form-body {
  max-width: 800px;
  margin: 0 auto;
  padding-top: 20px;
}

.ntf-field {
  margin-bottom: 18px;
}

.ntf-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  margin-bottom: 6px;
}

.ntf-help {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* Help text that follows an input — add top spacing so it doesn't touch */
.ntf-input + .ntf-help,
.ntf-sub-field > .ntf-help,
.ntf-toggles > .ntf-help {
  display: block;
  margin-top: 6px;
}

.ntf-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: var(--text-sm);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  background: var(--bg-secondary);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-sizing: border-box;
}

.ntf-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.ntf-input::placeholder {
  color: var(--text-tertiary);
}

.ntf-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.ntf-select {
  padding-right: 2rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.75rem;
}

/* Two-column row for desktop */
.ntf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Demographics grid: 2-3 columns on desktop, 1 on mobile */
.ntf-demographics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
}

/* Custom checkbox */
.ntf-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 6px 0;
}

.ntf-check:hover .ntf-check-mark {
  border-color: var(--accent-primary);
}

.ntf-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.ntf-check-mark {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 2px solid var(--border-default);
  border-radius: 4px;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  position: relative;
}

.ntf-checkbox:checked + .ntf-check-mark {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.ntf-checkbox:checked + .ntf-check-mark::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

.ntf-check-text {
  font-size: var(--text-sm);
  color: var(--text-primary);
  line-height: 1.3;
}

.ntf-sub-field {
  margin-top: 8px;
  margin-left: 28px;
}

.ntf-toggles {
  margin: 24px 0 8px;
  padding: 16px 0 0;
  border-top: 1px solid var(--border-subtle);
}

.ntf-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* Desktop: 3-column demographics + extra spacing */
@media (min-width: 1024px) {
  .ntf-demographics {
    grid-template-columns: repeat(3, 1fr);
  }
  .ntf-field {
    margin-bottom: 22px;
  }
  .ntf-form-body {
    padding-top: 24px;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .ntf-row {
    grid-template-columns: 1fr;
  }
  .ntf-demographics {
    grid-template-columns: 1fr;
  }
  .ntf-form-body {
    max-width: none;
  }
}

/* Dark mode for ntf- elements */
[data-theme="dark"] .ntf-input {
  background: var(--bg-tertiary);
  border-color: var(--border-default);
}

[data-theme="dark"] .ntf-input:focus {
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

[data-theme="dark"] .ntf-check-mark {
  background: var(--bg-tertiary);
  border-color: var(--border-default);
}

[data-theme="dark"] .ntf-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

/* --- Notification Filter Dropdowns --- */
.ntf-filters {
  display: flex;
  gap: 12px;
  margin: 16px 0;
  flex-wrap: wrap;
}

.ntf-filter {
  padding: 8px 28px 8px 10px;
  font-size: var(--text-sm);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  background: var(--bg-secondary);
  color: var(--text-primary);
  max-width: 160px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 0.75rem;
  cursor: pointer;
  transition: border-color var(--transition-fast);
  box-sizing: border-box;
}

.ntf-filter:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

[data-theme="dark"] .ntf-filter {
  background-color: var(--bg-tertiary);
  border-color: var(--border-default);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
}

/* --- Admin Notification Badges --- */
.badge-all {
  background: rgba(99, 102, 241, 0.1);
  color: #6366f1;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-mobile {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-web {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-demographic {
  background: rgba(168, 85, 247, 0.1);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.3);
  font-size: 0.7rem;
  padding: 2px 6px;
}

.badge-scheduled {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* --- Notification Schedule Radio Buttons --- */
.ntf-radio-group {
  display: flex;
  gap: 20px;
  margin-top: 6px;
}

.ntf-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.ntf-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ntf-radio-mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-default);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color var(--transition-fast);
}

.ntf-radio input[type="radio"]:checked + .ntf-radio-mark {
  border-color: var(--accent-primary);
}

.ntf-radio input[type="radio"]:checked + .ntf-radio-mark::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-primary);
}

.ntf-radio-text {
  font-size: var(--text-sm);
  color: var(--text-primary);
}

[data-theme="dark"] .ntf-radio-mark {
  background: var(--bg-tertiary);
  border-color: var(--border-default);
}

/* --- Dark Mode for Notifications --- */
[data-theme="dark"] .notification-bell:hover {
  background: var(--bg-tertiary);
}

[data-theme="dark"] .notification-panel {
  background: var(--bg-secondary);
  border-color: var(--border-default);
}

[data-theme="dark"] .notification-unread {
  background: rgba(99, 102, 241, 0.08);
}

[data-theme="dark"] .badge-all {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
}

[data-theme="dark"] .badge-mobile {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
}

[data-theme="dark"] .badge-web {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
}

[data-theme="dark"] .badge-demographic {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.4);
}

/* --- Mobile Notification Panel --- */
@media (max-width: 768px) {
  .notification-bell {
    background: var(--bg-tertiary);
    border-radius: 50%;
    padding: 5px;
  }

  .dashboard-header-actions {
    gap: 0.7rem;
  }

  .notification-panel {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    animation: slideUpPanel 0.25s ease;
  }

  .notification-drag-handle {
    display: flex;
    justify-content: center;
    padding: 10px 0 4px;
    cursor: grab;
    touch-action: none;
  }

  .notification-drag-bar {
    width: 36px;
    height: 4px;
    background: var(--border-default);
    border-radius: 2px;
  }

  @keyframes slideUpPanel {
    from {
      transform: translateY(100%);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}

/* Android bottom safe area for notification panel */
.android-webview-app .notification-panel {
  padding-bottom: var(--inset-bottom, 0px);
}

/* ============================================
   Flatpickr Dark Mode Theme
   ============================================ */
.flatpickr-dark {
  background: #1e1e2e;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  border: 1px solid #333;
}
.flatpickr-dark .flatpickr-months .flatpickr-month,
.flatpickr-dark .flatpickr-weekdays,
.flatpickr-dark .flatpickr-weekday {
  background: #1e1e2e;
  color: #ccc;
  fill: #ccc;
}
.flatpickr-dark .flatpickr-months .flatpickr-prev-month,
.flatpickr-dark .flatpickr-months .flatpickr-next-month {
  color: #ccc;
  fill: #ccc;
}
.flatpickr-dark .flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-dark .flatpickr-months .flatpickr-next-month:hover svg {
  fill: #8b5cf6;
}
.flatpickr-dark .flatpickr-day {
  color: #ddd;
}
.flatpickr-dark .flatpickr-day:hover,
.flatpickr-dark .flatpickr-day:focus {
  background: #333;
  border-color: #333;
}
.flatpickr-dark .flatpickr-day.today {
  border-color: #8b5cf6;
}
.flatpickr-dark .flatpickr-day.selected {
  background: #8b5cf6;
  border-color: #8b5cf6;
  color: #fff;
}
.flatpickr-dark .flatpickr-day.prevMonthDay,
.flatpickr-dark .flatpickr-day.nextMonthDay {
  color: #555;
}
.flatpickr-dark .flatpickr-time {
  border-top: 1px solid #333;
}
.flatpickr-dark .flatpickr-time input,
.flatpickr-dark .flatpickr-time .flatpickr-am-pm {
  color: #ddd;
  background: #1e1e2e;
}
.flatpickr-dark .flatpickr-time input:hover,
.flatpickr-dark .flatpickr-time input:focus,
.flatpickr-dark .flatpickr-time .flatpickr-am-pm:hover {
  background: #2a2a3e;
}
.flatpickr-dark .flatpickr-time .numInputWrapper span.arrowUp:after {
  border-bottom-color: #ccc;
}
.flatpickr-dark .flatpickr-time .numInputWrapper span.arrowDown:after {
  border-top-color: #ccc;
}
.flatpickr-dark .flatpickr-current-month .flatpickr-monthDropdown-months {
  background: #1e1e2e;
  color: #ddd;
}
.flatpickr-dark .flatpickr-current-month input.cur-year {
  color: #ddd;
}
.flatpickr-dark::before {
  border-bottom-color: #333;
}
.flatpickr-dark::after {
  border-bottom-color: #1e1e2e;
}

/* Ensure flatpickr altInput matches the ntf-input style */
.ntf-field .flatpickr-input.form-control,
.ntf-sub-field .flatpickr-input.form-control,
.ntf-field input.flatpickr-alt,
.ntf-sub-field input.flatpickr-alt,
.ntf-field input[readonly].active,
.ntf-sub-field input[readonly].active {
  cursor: pointer;
}
.flatpickr-calendar {
  z-index: 99999;
}

/* =============================================
   INLINE PRODUCT GRID (Chat Bubble Embedded)
   ============================================= */

.chat-inline-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 8px;
  padding: 4px;
}

.chat-inline-product-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chat-inline-product-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.chat-inline-product-img {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-tertiary);
}

.chat-inline-product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-inline-product-info {
  padding: 6px 8px;
}

.chat-inline-product-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-inline-product-price {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-primary, #8b5cf6);
  margin-top: 2px;
}

/* =============================================
   INLINE SERVICE CARD (Chat Bubble Embedded)
   ============================================= */

.chat-inline-service-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding: 4px;
}

.chat-inline-service-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chat-inline-service-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.chat-inline-service-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-primary, #8b5cf6);
  border-radius: 6px;
  color: white;
}

.chat-inline-service-info {
  flex: 1;
  min-width: 0;
}

.chat-inline-service-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.chat-inline-service-desc {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.3;
}

/* =============================================
   INLINE DOC RECOMMENDATIONS (Chat Actions)
   ============================================= */

.chat-inline-doc-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  padding: 4px;
}

.chat-inline-doc-card {
  text-align: left;
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.chat-inline-doc-card:focus-visible {
  outline: 2px solid var(--agent-primary-color, var(--accent-blue));
  outline-offset: 2px;
}

.chat-inline-doc-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--agent-primary-color, var(--accent-blue));
}

.chat-inline-doc-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.chat-inline-doc-summary {
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.chat-inline-doc-action {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0;
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--agent-primary-color, var(--accent-blue));
  letter-spacing: 0.01em;
}

.chat-inline-doc-action-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 6px;
}

.chat-inline-doc-toggle {
  border: 1px solid color-mix(in srgb, var(--agent-primary-color, var(--accent-blue)) 14%, var(--border-subtle));
  background: color-mix(in srgb, var(--bg-secondary) 88%, transparent);
  color: var(--agent-primary-color, var(--accent-blue));
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.chat-inline-doc-toggle:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.chat-inline-doc-toggle:focus-visible {
  outline: 2px solid var(--agent-primary-color, var(--accent-blue));
  outline-offset: 2px;
}

/* =============================================
   INLINE CONTACT CARD (Chat Bubble Embedded)
   ============================================= */

.chat-inline-contact-cards {
  margin-top: 8px;
}

.chat-inline-contact-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
}

.chat-inline-contact-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.chat-inline-contact-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.chat-inline-contact-label {
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 45px;
}

.chat-inline-contact-row a {
  color: var(--accent-primary, #8b5cf6);
  text-decoration: none;
}

.chat-inline-contact-row a:hover {
  text-decoration: underline;
}

.chat-inline-whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #25d366;
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
}

.chat-inline-whatsapp-btn:hover {
  background: #20bd5a;
  text-decoration: none;
  color: white;
}

/* =============================================
   PRODUCT DETAIL OVERLAY (Fullscreen Dialog)
   ============================================= */

.product-detail-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.product-detail-dialog {
  background: var(--bg-secondary);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.product-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  color: white;
  transition: background 0.15s ease;
}

.product-detail-close:hover {
  background: rgba(0, 0, 0, 0.6);
}

.product-detail-image {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-tertiary);
  border-radius: 16px 16px 0 0;
}

.product-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-detail-info {
  padding: 1.25rem 1.5rem 1.5rem;
}

.product-detail-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

.product-detail-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-primary, #8b5cf6);
  margin-bottom: 0.75rem;
}

.product-detail-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Mobile responsive adjustments for inline product grid */
@media (max-width: 480px) {
  .chat-inline-product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .chat-resend-btn {
    opacity: 0.4;
  }

  .product-detail-dialog {
    max-width: 100%;
    margin: 0.5rem;
    max-height: 95vh;
  }

  .product-detail-info {
    padding: 1rem 0.75rem 1rem;
  }
}

/* ==================== AGENT MODELS SECTION ==================== */
.agent-models-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.spinner-small {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-default);
  border-top: 2px solid var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.agent-models-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.agent-model-card {
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 1.25rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

.agent-model-card.agent-model-enabled {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 1px var(--accent-primary);
}

.agent-model-card.agent-model-disabled {
  opacity: 0.65;
}

.agent-model-card.agent-model-locked {
  background: var(--bg-secondary);
  opacity: 0.7;
}

.agent-model-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.agent-model-identity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.agent-model-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.agent-model-name {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.15rem 0;
  color: var(--text-primary);
}

.agent-model-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.agent-model-badge-standard {
  background: #e0f2fe;
  color: #0369a1;
}

.agent-model-badge-advanced {
  background: #fce7f3;
  color: #be185d;
}

[data-theme="dark"] .agent-model-badge-standard {
  background: #0c4a6e;
  color: #7dd3fc;
}

[data-theme="dark"] .agent-model-badge-advanced {
  background: #831843;
  color: #f9a8d4;
}

.agent-model-desc {
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 1rem 0;
}

/* Toggle switch */
.agent-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.agent-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.agent-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #d1d5db;
  border-radius: 24px;
  transition: background-color 0.2s;
}

.agent-toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.2s;
}

.agent-toggle input:checked + .agent-toggle-slider {
  background-color: var(--accent-primary);
}

.agent-toggle input:checked + .agent-toggle-slider::before {
  transform: translateX(20px);
}

.agent-toggle.agent-toggle-saving {
  opacity: 0.5;
  pointer-events: none;
}

[data-theme="dark"] .agent-toggle-slider {
  background-color: #4b5563;
}

[data-theme="dark"] .agent-toggle-slider::before {
  background-color: #d1d5db;
}

/* Usage bar */
.agent-model-usage {
  margin-top: 0.5rem;
}

.agent-usage-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.agent-usage-numbers {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.agent-usage-bar {
  height: 6px;
  background: var(--border-default);
  border-radius: 3px;
  overflow: hidden;
}

.agent-usage-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: 3px;
  transition: width 0.3s ease;
  min-width: 0;
}

.agent-usage-fill.agent-usage-warning {
  background: #f59e0b;
}

.agent-usage-fill.agent-usage-critical {
  background: #ef4444;
}

/* Upgrade prompt */
.agent-model-upgrade {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.6rem 0.8rem;
  background: var(--bg-secondary);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.agent-model-upgrade svg {
  flex-shrink: 0;
  color: var(--accent-primary);
}

.agent-model-lock-icon {
  color: var(--text-tertiary);
}

/* Dark theme overrides */
[data-theme="dark"] .agent-model-card {
  border-color: #374151;
}

[data-theme="dark"] .agent-model-card.agent-model-enabled {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 1px var(--accent-primary);
}

[data-theme="dark"] .agent-model-card.agent-model-locked {
  background: #111827;
}

[data-theme="dark"] .agent-model-upgrade {
  background: #111827;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .agent-models-grid {
    grid-template-columns: 1fr;
  }
  
  .agent-model-card {
    padding: 1rem;
  }
}

/* ==================== MODEL SELECTOR (Test Chatbot & Deploy Preview) ==================== */
.model-selector-container {
  position: relative;
  flex-shrink: 0;
}

.model-selector-pill {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  white-space: nowrap;
}

.model-selector-pill:hover {
  border-color: var(--accent-primary);
  background: var(--bg-secondary);
}

.model-selector-pill.model-selector-advanced {
  border-color: #be185d;
  background: #fdf2f8;
}

[data-theme="dark"] .model-selector-pill.model-selector-advanced {
  border-color: #f9a8d4;
  background: #1a0a14;
}

.model-selector-icon {
  font-size: 1rem;
  line-height: 1;
}

.model-selector-name {
  font-size: 0.8rem;
}

.model-selector-caret {
  opacity: 0.5;
}

/* Dropdown */
.model-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  min-width: 230px;
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 100;
  overflow: hidden;
}

[data-theme="dark"] .model-dropdown {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.model-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
  color: var(--text-primary);
}

.model-dropdown-item:hover {
  background: var(--bg-secondary);
}

.model-dropdown-item + .model-dropdown-item {
  border-top: 1px solid var(--border-default);
}

.model-dropdown-item.model-dropdown-active {
  background: var(--bg-secondary);
}

.model-dropdown-item.model-dropdown-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.model-dropdown-icon {
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.model-dropdown-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.model-dropdown-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.model-dropdown-desc {
  font-size: 0.725rem;
  color: var(--text-secondary);
}

.model-dropdown-check {
  flex-shrink: 0;
  color: var(--accent-primary);
}

.model-dropdown-lock {
  flex-shrink: 0;
  color: var(--text-tertiary);
}

/* Mobile: hide text in chat input selector, keep full display in preview */
@media (max-width: 640px) {
  .chat-input-container {
    padding: 0.75rem 0.5rem;
  }
  
  .chat-input-wrapper .model-selector-pill .model-selector-name {
    display: none;
  }
  
  .chat-input-wrapper .model-selector-pill {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
    gap: 0.15rem;
  }
  
  .chat-input-wrapper .model-selector-pill .model-selector-caret {
    width: 10px;
    height: 10px;
  }
  
  .chat-input-wrapper .model-selector-icon {
    font-size: 1.1rem;
  }
  
  .chat-input-wrapper {
    gap: 0.35rem;
  }
}

/* Preview header with model selector */
.preview-header-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.preview-header-row h3 {
  margin: 0;
}

.preview-header-row .model-selector-container {
  margin-bottom: 0;
}

.preview-header-row .model-dropdown {
  bottom: auto;
  top: calc(100% + 6px);
}


/* Move All New CSS to dashboard2.css */