/**
 * 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;
  min-height: 100vh;
  background: #f8fafc;
}

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

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

.dashboard-header {
  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;
  position: sticky;
  top: 0;
  z-index: 100;
  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-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;
  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;
  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;
}

/* 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;
    overflow: visible;
  }
  
  .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: 1rem 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-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-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;
}

.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);
}

.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 {
  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: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: 1.5rem;
  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 ==================== */

.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;
}

.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;
  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 .service-expand-btn {
  position: relative;
  background: var(--bg-component);
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

.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);
}

.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 1rem !important;
  }

  .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;
}

.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: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-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);
}

/* 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;
  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);
}

.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);
}

/* 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;
}

/* 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) */
  }
}

/* ===== 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;
}

.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-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;
}

.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);
}

/* Chat message table formatting */
.message-text table {
  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-time {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: 0.25rem;
  padding: 0 0.5rem;
  transition: color var(--transition-normal);
}

.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(--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 {
  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(--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);
}

/* ==================== 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;
}

.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);
}

.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: var(--text-sm);
  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;
}

.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;
}

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

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

@media (max-width: 768px) {
  .deployment-status-card,
  .deployment-section {
    padding: 1rem;
  }
  
  .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;
    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: 400px;
  }
  
  .preview-placeholder {
    min-height: 300px;
    padding: 2rem 1rem;
  }
  
  .status-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .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.8rem;
  }
  
  .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 */
  }
}

[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: #f8fafc;
}

.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: 120px; /* 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: 140px; /* Taller header on mobile due to stacked layout */
    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: 110px; /* Shorter header on tablet */
  }
}

/* Subtle left/right borders only on desktop */
@media (min-width: 768px) {
  .public-chatbot .chat-messages {
    border-left: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
    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: #111827;
  margin: 0 0 0.5rem 0;
}

.error-container p {
  color: #6b7280;
  margin: 0;
}

/* Chat header responsive styles */
@media (max-width: 640px) {
  .chat-header {
    padding: 0.75rem 1rem;
  }

  .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;
}

.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;
}

.tab-button:hover {
  color: #111827;
  background: #f9fafb;
}

.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-content {
    padding: 1rem;
    padding-bottom: calc(1rem + 160px); /* Extra 80px for FAB clearance (1rem + 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: 1rem 1.5rem 1.5rem 1.5rem; /* padding-top: 16px (1rem), rest: 24px (1.5rem) */
  }
  
  .modal-content {
    margin: 1rem;
    max-height: calc(100vh - 2rem);
  }
  
  .form-container {
    padding: 1.5rem;
  }
}

/* ==================== 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);
  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);
}

.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);
}

.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);
}

/* 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);
  }
}

/* ==================== 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-content {
    flex-direction: column;
  }
  
  .action-dialog-actions {
    border-left: none;
    border-top: 1px solid var(--border-default);
    min-width: 100%;
    max-width: 100%;
    padding: 1rem 2rem;
    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 {
    max-width: 95vw;
    max-height: 95vh;
  }

  .services-table-th,
  .services-table-td {
    padding: 1rem 1.5rem;
  }

  .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 ==================== */

.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);
}

/* ==================== 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: 144px; /* Above FAB - positioned to not cover the FAB */
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: calc(100vw - 32px);
    max-width: 320px;
  }
}

.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 that preserves centering */
@media (max-width: 767px) {
  .ai-prompt-enter-active {
    animation: aiPromptFadeInUpMobile 0.6s 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: translateX(-50%) translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes aiPromptFadeOutMobile {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(20px) scale(0.95);
  }
}

/* Dark mode prompt */
[data-theme="dark"] .ai-chat-prompt {
  background: var(--bg-component);
  border-color: var(--border-default);
}

/* 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;
  }
  
  .auth-container {
    padding: 1rem 1.5rem 1.5rem 1.5rem; /* padding-top: 16px (1rem), rest: 24px (1.5rem) */
    border-radius: 16px;
  }
  
  .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;
}

@media (max-width: 1024px) {
  .plans-grid {
    grid-template-columns: repeat(2, 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) {
  .plans-grid {
    grid-template-columns: 1fr;
  }
  
  .subscription-info {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
  
  .subscription-info-item {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    gap: var(--space-sm);
  }
  
  .subscription-info-item .label {
    font-size: var(--text-sm);
    color: var(--text-tertiary);
    font-weight: var(--font-medium);
    flex-shrink: 0;
  }
  
  .subscription-info-item .value {
    font-size: var(--text-base);
    color: var(--text-primary);
    font-weight: var(--font-semibold);
    text-align: right;
    flex: 1;
  }
  
  .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;
}

/* 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-form-container {
  max-width: 600px;
  background: var(--bg-component);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid var(--border-default);
}

.grant-form-container h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.grant-form-container .form-description {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.grant-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.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);
  }
  
  .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;
  }
}

/* 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;
}

.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;
}

.tab-button:hover {
  color: var(--text-primary);
}

.tab-button.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.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: 1.5rem;
  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.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-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;
}

.dashboard-info .btn {
  margin-top: auto;
  align-self: flex-end;
}

.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 {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .settings-value {
    text-align: left;
    justify-content: flex-start;
  }
}

@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.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;
  gap: var(--space-3xl);
  align-items: flex-start;
  margin-top: var(--space-2xl);
}

.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: var(--space-xl);
}

.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: column;
  gap: var(--space-md);
  width: 100%;
}

.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);
}

.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-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%;
  }
  
  .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: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 50px;
  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: 30px; /* Same as desktop - maintain consistent viewport distance */
    opacity: 0.85;
  }
}

/* Dashboard: Adjust position to avoid conflicts */
.dashboard-layout .scroll-to-top-btn {
  z-index: 997; /* Below AI chat FAB */
}

