/* style.css - LocalWorks brand theme */

/* Performance optimizations for smooth UI */
*, *::before, *::after {
  box-sizing: border-box;
}

/* Enable GPU acceleration for animations */
.animate, .transition, [class*="animate-"], .modal, .dropdown, .toast, .card:hover {
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:root { 
  /* LocalWorks Brand Colors */
  --brand-navy: #1A1464; /* Deep Navy - Primary */
  --brand-navy-hover: #120e4d; 
  --brand-navy-light: #2a1f7a;
  --brand-navy-dark: #0D0A32;
  --brand-orange: #FF8C00; /* Bright Orange - Accent */
  --brand-orange-hover: #e67e00;
  --brand-orange-light: #ffa033;
  --brand-peach-light: #FFD4A3; /* Light Peach */
  --brand-peach: #FFC080; /* Medium Peach */
  
  /* Legacy aliases for compatibility */
  --brand-purple: #1A1464;
  --brand-purple-hover: #120e4d;
  --brand-purple-light: #2a1f7a;
  --brand-blue: #1A1464;
  --brand-blue-hover: #120e4d;
  --brand-blue-light: #2a1f7a;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-sm: 4px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --transition: all 0.2s ease;
}
/* Global DPI/Scaling Enhancement - Desktop Only */
@media (min-width: 1024px) {
  html {
    zoom: 0.85; /* Equivalent to 85% zoom - slightly smaller than your 80% preference */
    transform-origin: 0 0;
  }
  
  /* Ensure scroll containers work properly with zoom */
  body {
    overflow-x: auto;
  }
  
  /* Adjust fixed/sticky elements visually rather than counter-zooming */
  .topbar {
    font-size: 18px; /* Reduced from 20px to match scale */
    padding: 14px 20px; /* Reduced from 16px 24px to match scale */
  }
  
  /* Ensure overlays and modals work correctly with zoom */
  .modal-overlay,
  .modal,
  .dropdown-menu,
  .tooltip,
  .notification,
  .popup {
    /* Don't counter-zoom - let them scale naturally but ensure proper positioning */
    position: fixed; /* Ensure they're positioned relative to viewport */
  }
}

/* Fallback for browsers that don't support zoom */
@media (min-width: 1024px) {
  @supports not (zoom: 1) {
    body {
      transform: scale(0.85);
      transform-origin: 0 0;
      width: 117.65%; /* 100% / 0.85 to fill viewport */
      height: 117.65%;
      overflow-x: auto;
    }
    
    /* Adjust topbar for transform scale */
    .topbar {
      font-size: 18px;
      padding: 14px 20px;
    }
  }
}

@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css');
* { box-sizing: border-box; }
body { font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif; margin:0; color:var(--gray-800); background:#f8f9fc; line-height: 1.5; }
.topbar { display:flex; justify-content:space-between; align-items:center; padding:16px 24px; background:var(--brand-purple); color:#fff; position:sticky; top:0; z-index:100; box-shadow:var(--shadow-md); }
.topbar h1 { margin:0; font-size:20px; }
.container { max-width: 1400px; width: 95%; margin: 24px auto; }
.panel { background:#fff; border-radius:var(--radius-md); padding:24px; margin-bottom:24px; box-shadow:var(--shadow-md); }
.panel h2 { margin: 0 0 20px; font-size:22px; font-weight:600; color:var(--brand-purple); }
.actions { display:flex; gap:8px; }

.btn { 
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  height:40px; padding:0 16px; border-radius:var(--radius); text-decoration:none; cursor:pointer;
  background:var(--brand-purple); color:#fff; border:1px solid var(--brand-purple); font-weight:500;
  transition:var(--transition);
  box-shadow:var(--shadow-sm);
  position: relative; /* allow corner badges to be positioned */
}
.btn:hover { background:var(--brand-purple-hover); border-color:var(--brand-purple-hover); color:#fff; box-shadow:0 0 0 3px rgba(45,27,105,0.25); transform:translateY(-1px); }
.btn[aria-disabled="true"], .btn:disabled { opacity:0.6; pointer-events:none; }
.btn.primary { background:var(--brand-purple); color:#fff; border-color:var(--brand-purple); }
.btn.orange { background:var(--brand-orange); color:#fff; border-color:var(--brand-orange); }
.btn.orange:hover { background:var(--brand-orange-hover); border-color:var(--brand-orange-hover); box-shadow:0 0 0 3px rgba(255,122,0,0.25); }
/* Ghost variant to match header toolbar buttons when needed */
.btn.ghost { background:transparent; color:#e5e7eb; border:1px solid rgba(255,255,255,0.2); }
.btn.ghost:hover { background:rgba(255,255,255,0.12); border-color:rgba(255,255,255,0.3); color:#fff; box-shadow:none; }

/* Secondary button style */
.btn.secondary { background:white; color:var(--brand-purple); border:1px solid var(--gray-300); }
.btn.secondary:hover { background:var(--gray-50); border-color:var(--gray-400); box-shadow:0 0 0 3px rgba(45,27,105,0.1); }
/* Header toolbar buttons: force ghost style within the topbar */
.topbar .btn { background:transparent; color:#e5e7eb; border:1px solid rgba(255,255,255,0.15); }
.topbar .btn:hover { background:rgba(255,255,255,0.08); border-color:rgba(255,255,255,0.25); color:#fff; box-shadow:none; }
/* Ensure native buttons look the same even without .btn class in legacy code */
button, input[type="button"], input[type="submit"] {
  appearance:none; -webkit-appearance:none;
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  height:40px; padding:0 16px; border-radius:var(--radius); border:1px solid var(--brand-purple);
  background:var(--brand-purple); color:#fff; cursor:pointer; font:inherit; font-weight:500;
  transition:var(--transition); box-shadow:var(--shadow-sm);
}
button:hover, input[type="button"]:hover, input[type="submit"]:hover { background:var(--brand-purple-hover); border-color:var(--brand-purple-hover); transform:translateY(-1px); box-shadow:var(--shadow-md); }

/* Filter controls: neutral style independent from global .btn */
.filter-btn { 
  display:inline-flex; align-items:center; gap:6px; height:36px; padding:0 12px; border-radius:var(--radius); 
  background:#ffffff; color:var(--gray-800); border:1px solid var(--gray-300); cursor:pointer; text-decoration:none; font:inherit;
  transition:var(--transition);
}
.filter-btn:hover { background:var(--gray-50); border-color:var(--gray-400); box-shadow:0 0 0 3px rgba(45,27,105,0.1); }
.filter-select, .filter-input {
  height:36px; padding:0 12px; border-radius:var(--radius); border:1px solid var(--gray-300); background:#fff; color:var(--gray-800); font:inherit;
  transition:var(--transition);
}
.filter-input { width: 260px; }
.filter-input::placeholder { color:#9ca3af; }
.filter-select-container {
  position: relative;
  width: 100%;
}

.filter-select-container::after {
  content: '\f078'; /* Font Awesome chevron-down icon */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
  font-size: 12px;
}

.filter-select, .filter-select-container select, .filter-select-container .filter-select {
  padding: 8px 12px;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  font-size: 14px;
  transition: var(--transition);
  height: 38px;
  background-color: white;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  color: var(--gray-700);
  padding-right: 30px; /* Make room for the chevron */
}

.filter-select:focus, .filter-input:focus, .filter-btn:focus,
.filter-select-container select:focus {
  outline: none;
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 3px rgba(45,27,105,0.15);
}
.toolbar .filter-btn, .toolbar .filter-select, .toolbar .filter-input,
.filters .filter-btn, .filters .filter-select, .filters .filter-input { vertical-align:middle; }

/* Modern search interface */
.modern-search {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 16px;
}

.search-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 200px;
}

.search-group label {
  font-weight: 500;
  color: var(--gray-700);
  font-size: 14px;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
}

.search-input-wrapper input {
  padding: 8px 12px 8px 36px;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  font-size: 14px;
  transition: var(--transition);
  height: 38px;
}

.search-input-wrapper input:focus {
  outline: none;
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 3px rgba(45,27,105,0.15);
}

.search-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  margin-top: 8px;
}

.search-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  height: 38px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.search-actions .btn.primary {
  background: var(--brand-purple);
  color: white;
  border-color: var(--brand-purple);
}

.search-actions .btn.primary:hover {
  background: #3b2a7e;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(45, 27, 105, 0.2);
}

.search-actions .btn.secondary {
  background: white;
  color: var(--gray-700);
  border-color: var(--gray-300);
}

.search-actions .btn.secondary:hover {
  background: var(--gray-50);
  color: var(--brand-purple);
  border-color: var(--brand-purple);
}

/* Original search styles (kept for backward compatibility) */
.search { display:flex; gap:8px; align-items:center; margin-bottom:12px; }
.search input[type="text"] { flex:1; padding:8px 12px; border-radius:var(--radius); border:1px solid var(--gray-300); transition:var(--transition); }
.search select { padding:8px 12px; border-radius:var(--radius); border:1px solid var(--gray-300); transition:var(--transition); }

.table-wrap { width:100%; overflow:auto; border:1px solid var(--gray-200); border-radius:var(--radius); box-shadow:var(--shadow-sm); }
.grid { width:100%; border-collapse: collapse; font-size:14px; background:white; }
.grid th, .grid td { border-bottom:1px solid var(--gray-200); padding:12px 16px; text-align:left; white-space:nowrap; }
.grid thead th { position:sticky; top:0; background:var(--gray-50); color:var(--brand-purple); font-weight:600; z-index:1; }
.grid.compact th, .grid.compact td { padding:6px 8px; }
.muted { color:#6b7280; }

/* Modern pagination */
.modern-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  flex-wrap: wrap;
  gap: 16px;
}

.pagination-info {
  color: var(--gray-600);
  font-size: 14px;
}

.pagination-summary strong {
  color: var(--gray-800);
}

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

.pagination-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  background: white;
  color: var(--gray-700);
  transition: var(--transition);
  text-decoration: none;
}

.pagination-btn:hover {
  background: var(--gray-50);
  color: var(--brand-purple);
  border-color: var(--brand-purple);
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px rgba(45,27,105,0.1);
}

.pagination-btn[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
  cursor: default;
}

.pagination-pages {
  display: flex;
  gap: 4px;
  align-items: center;
  margin: 0 4px;
}

.pagination-page {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  background: white;
  color: var(--gray-700);
  transition: var(--transition);
  text-decoration: none;
  padding: 0 8px;
}

.pagination-page:hover {
  background: var(--gray-50);
  color: var(--brand-purple);
  border-color: var(--brand-purple);
}

.pagination-page.active {
  background: var(--brand-purple);
  color: white;
  border-color: var(--brand-purple);
}

.pagination-ellipsis {
  color: var(--gray-500);
  padding: 0 4px;
}

/* Original pagination (kept for backward compatibility) */
.pagination { display:flex; justify-content:space-between; align-items:center; padding-top:8px; }
.pages { display:flex; gap:8px; align-items:center; }

/* Empty state */
.empty-state {
  padding: 40px 20px !important;
  text-align: center;
}

.empty-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-message i {
  font-size: 32px;
  color: var(--gray-400);
}

.empty-message p {
  margin: 0;
  color: var(--gray-600);
  font-size: 16px;
}

/* Status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 20px;
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: 12px;
  font-weight: 500;
}

.status-badge.success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.status-badge.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Data summary */
.data-summary {
  display: flex;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--brand-purple);
  color: white;
  font-size: 12px;
  font-weight: 500;
}

/* Small orange step badges for workflow buttons */
.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-orange);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  position: absolute;
  top: -8px;
  left: -8px;
  pointer-events: none; /* ensure clicks go to the button */
}

/* Ensure consistent spacing when used inside .btn */
.btn .btn-label { display: inline-block; }

/* Checkbox container */
.checkbox-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--gray-700);
  font-size: 14px;
}

.checkbox-container input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--brand-purple);
}

/* Modern footer */
.modern-footer {
  padding: 24px;
  background: var(--brand-purple);
  color: white;
  margin-top: 40px;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 16px;
}

.footer-info,
.footer-tip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-info i,
.footer-tip i {
  color: var(--brand-orange);
}

.footer-info code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.footer-version {
  font-size: 12px;
  opacity: 0.7;
}

/* Original footer (kept for backward compatibility) */
.footer { padding:16px 24px; color:#6b7280; }

/* Global bottom-right footer badge */
.app-footer-badge {
  position: fixed;
  right: env(safe-area-inset-right, 0px);
  bottom: env(safe-area-inset-bottom, 0px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--gray-200);
  border-right: 0;
  border-bottom: 0;
  border-top-left-radius: var(--radius);
  border-top-right-radius: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background: rgba(255, 255, 255, 0.80);
  color: var(--gray-600);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap; /* keep compact on small screens */
  box-shadow: var(--shadow);
  z-index: 900; /* keep below help panel (z-index:1000) */
  cursor: pointer;
  backdrop-filter: saturate(120%) blur(6px);
  -webkit-backdrop-filter: saturate(120%) blur(6px);
}

.app-footer-badge .version-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--brand-purple);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}

.app-footer-badge .chev {
  display: none;
  color: var(--gray-500);
  font-size: 10px;
}

.app-footer-badge a {
  color: var(--brand-purple);
  text-decoration: none;
}

.app-footer-badge a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .app-footer-badge {
    right: env(safe-area-inset-right, 0px);
    bottom: env(safe-area-inset-bottom, 0px);
    gap: 4px;
    padding: 4px 6px;
  }
  .app-footer-badge .chev { display: inline; }
}

/* Responsive visibility helpers */
.mobile-only { display: none; }
.desktop-only { display: inline; }
@media (max-width: 640px) {
  .mobile-only { display: inline; }
  .desktop-only { display: none; }
}

/* Expanded state (tap to expand on mobile) */
.app-footer-badge.expanded {
  background: rgba(255, 255, 255, 0.95);
  white-space: normal;
  flex-wrap: wrap;
  max-width: 92vw;
  border-right: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  border-radius: var(--radius);
}

@media (max-width: 640px) {
  .app-footer-badge.expanded .desktop-only { display: inline; }
  .app-footer-badge.expanded .mobile-only { display: none; }
}

.app-footer-badge.expanded .chev {
  transform: rotate(180deg);
}

/* Nav */
.brand { display:flex; align-items:center; gap:8px; }
.brand .brand-link { display:inline-flex; align-items:center; height:36px; color:#fff; text-decoration:none; }
.brand .brand-logo { height:100%; width:auto; display:block; }

/* Desktop Navigation - Icon Based */
.nav { display:flex; margin-left:auto; gap:6px; align-items:center; }

/* Icon-only nav links */
.nav-link-icon { 
  color:#e5e7eb; 
  width:44px; height:44px; 
  display:inline-flex; align-items:center; justify-content:center;
  border-radius:var(--radius); 
  border:1px solid rgba(255,255,255,0.15); 
  background:transparent;
  transition:var(--transition);
  cursor:pointer;
  font-size:18px;
}

.nav-link-icon:hover { 
  background:rgba(255,255,255,0.15); 
  border-color:rgba(255,255,255,0.3); 
  color:#fff; 
  transform:translateY(-1px);
  box-shadow:0 4px 12px rgba(0,0,0,0.2);
}

.nav-link-icon.active { 
  background:rgba(255,255,255,0.2); 
  border-color:rgba(255,255,255,0.4); 
  color:#fff; 
}

/* Text + Icon nav link (Onboard New Supplier) */
.nav-link-text { 
  color:#e5e7eb; text-decoration:none; 
  padding:0 16px; height:44px;
  display:inline-flex; align-items:center; gap:8px;
  border-radius:var(--radius); 
  border:1px solid rgba(255,255,255,0.15); 
  background:transparent;
  transition:var(--transition);
  white-space:nowrap;
  font-size:14px;
  font-weight:500;
  margin-right:12px;
}

.nav-link-text i { font-size:16px; }

.nav-link-text:hover { 
  background:rgba(255,255,255,0.15); 
  border-color:rgba(255,255,255,0.3); 
  color:#fff; 
  transform:translateY(-1px);
  box-shadow:0 4px 12px rgba(0,0,0,0.2);
}

.nav-link-text.active { 
  background:rgba(255,255,255,0.2); 
  border-color:rgba(255,255,255,0.4); 
  color:#fff; 
}

/* Legacy support */
.nav-link { 
  color:#e5e7eb; text-decoration:none; 
  width:44px; height:44px; display:inline-flex; align-items:center; justify-content:center;
  border-radius:var(--radius); border:1px solid rgba(255,255,255,0.15); background:transparent;
  transition:var(--transition);
}
.nav-link:hover { background:rgba(255,255,255,0.15); border-color:rgba(255,255,255,0.3); color:#fff; }
.nav-link i { font-size:18px; line-height:1; }
/* Preflight button - ghost purple style */
.preflight-btn:hover { background:var(--brand-purple) !important; color:#fff !important; border-color:var(--brand-purple) !important; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* View toggle (In-Store / Online) */
.view-toggle {
  margin-left: 16px;
}

.view-toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  padding: 4px 6px;
  height: 40px;
  min-width: 200px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.3);
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: none;
}

.view-toggle-option {
  position: relative;
  z-index: 2;
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: #e5e7eb;
  transition: color 0.2s ease;
}

.view-toggle-option-left {
  padding-left: 4px;
}

.view-toggle-option-right {
  padding-right: 4px;
}

.view-toggle-option.active {
  color: #111827;
}

.view-toggle-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.4);
  transition: transform 0.2s ease;
}

.view-toggle-switch[data-mode="online"] .view-toggle-thumb {
  transform: translateX(100%);
}

.view-toggle-switch[data-mode="online"] .view-toggle-option-left {
  color: #d1d5db;
}

.view-toggle-switch[data-mode="online"] .view-toggle-option-right {
  color: #111827;
}

/* Topbar dropdown menus */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  position: relative;
}

.nav-dropdown-trigger-link {
  position: relative;
  cursor: pointer;
}

.nav-dropdown-trigger-link:hover + .nav-dropdown-menu,
.nav-dropdown-menu:hover {
  display: block;
}

.nav-dropdown-caret {
  font-size: 11px;
  margin-left: auto;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 240px;
  padding: 0;
  background: var(--brand-navy);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.2);
  display: none;
  z-index: 120;
  overflow: hidden;
}

.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: var(--brand-navy);
  border-left: 1px solid rgba(255,255,255,0.2);
  border-top: 1px solid rgba(255,255,255,0.2);
}

.nav-dropdown.open .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-header {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  color: #e5e7eb;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition);
}

.nav-dropdown-item i {
  width: 18px;
  font-size: 14px;
  opacity: 0.7;
}

.nav-dropdown-item:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.nav-dropdown-item:hover i {
  opacity: 1;
}

.nav-dropdown-separator {
  height: 1px;
  margin: 6px 0;
  background: rgba(255,255,255,0.1);
}

.nav-dropdown-item-danger {
  color: #fecaca;
}

.nav-dropdown-item-danger:hover {
  background: rgba(220,38,38,0.9);
  color: #fff;
}

/* Show hamburger button */
.mobile-menu-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  transition: var(--transition);
}

.mobile-menu-toggle:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
}

.mobile-menu-toggle i {
  font-size: 20px;
}

.desktop-nav {
  display: none !important;
}

/* Fixed Right Side Icon Toolbar - Hidden by default */
.icon-toolbar {
  position: fixed;
  right: -100%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 8px;
  background: var(--brand-navy);
  border-radius: 16px 0 0 16px;
  box-shadow: -4px 0 20px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-right: none;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: auto;
  max-width: 80px;
}

.icon-toolbar.open {
  right: 0;
}

.icon-toolbar .nav-dropdown {
  position: relative;
}

.icon-toolbar .nav-link-text,
.icon-toolbar .nav-link-icon {
  width: 48px;
  height: 48px;
  font-size: 20px;
  margin: 0;
  padding: 0;
}

.icon-toolbar .nav-link-text {
  width: auto;
  padding: 0 12px;
}

.icon-toolbar .nav-dropdown-menu {
  position: absolute;
  right: calc(100% + 12px);
  top: 0;
  left: auto;
  transform: none;
  margin: 0;
  min-width: 240px;
}

.icon-toolbar .nav-dropdown-menu::before {
  left: auto;
  right: -6px;
  top: 20px;
  transform: rotate(45deg);
  border-left: 1px solid rgba(255,255,255,0.2);
  border-top: 1px solid rgba(255,255,255,0.2);
  border-right: none;
  border-bottom: none;
}

/* Ensure dropdowns appear on top */
.icon-toolbar .nav-dropdown.open .nav-dropdown-menu {
  display: block;
  z-index: 1001;
}

.mobile-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-navy));
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -2px 0 24px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
}

.mobile-sidebar.open {
  transform: translateX(0);
}

.mobile-sidebar-header {
  padding: 16px 20px 8px;
  display: flex;
  justify-content: flex-end;
}

/* Ensure close button matches nav icon size */
.mobile-sidebar .mobile-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}
.mobile-sidebar .mobile-menu-toggle i { font-size: 18px; }

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 20px 24px;
  overflow-y: auto;
  flex: 1;
  /* Styled scrollbar for mobile nav */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

/* WebKit scrollbar styles for mobile nav */
.mobile-nav::-webkit-scrollbar {
  width: 4px;
}

.mobile-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.mobile-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.mobile-nav::-webkit-scrollbar-track {
  background: transparent;
}

/* Mobile accordion-style menu */
.mobile-accordion {
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.mobile-accordion + .mobile-accordion {
  margin-top: 6px;
}

.mobile-accordion-header-wrapper {
  display: flex;
  align-items: center;
  gap: 0;
}

.mobile-accordion-icon-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  color: var(--brand-orange);
  font-size: 18px;
  text-decoration: none;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.mobile-accordion-icon-link:hover {
  color: #fff;
  background: rgba(255, 122, 0, 0.2);
}

.mobile-accordion-header {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 14px 0;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #e5e7eb;
}

.mobile-accordion-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
}

.mobile-accordion-title i {
  font-size: 18px;
  color: var(--brand-orange);
}

.mobile-accordion-chevron {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.mobile-accordion.open .mobile-accordion-chevron {
  transform: rotate(180deg);
}

.mobile-accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  padding: 0 14px 0 44px;
}

.mobile-accordion.open .mobile-accordion-panel {
  max-height: 600px;
  padding-bottom: 10px;
}

.mobile-accordion-link {
  display: block;
  padding: 6px 0;
  font-size: 13px;
  color: #e5e7eb;
  text-decoration: none;
}

.mobile-accordion-link:hover {
  color: #fff;
}

.mobile-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-sidebar-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Responsive styles */
@media (max-width: 768px) {
  .desktop-nav, .actions {
    display: none;
  }
  
  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  .topbar {
    padding: 12px 16px;
  }
}

/* Ghost purple scrollbars (global) */
/* Firefox */
* { scrollbar-width: thin; scrollbar-color: rgba(45, 27, 105, 0.4) transparent; }
/* WebKit */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgba(45, 27, 105, 0.4); border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(45, 27, 105, 0.55); }
*::-webkit-scrollbar-track { background: transparent; }

/* Modern card styles for control panel */
.modern-cards { display:grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap:24px; }
.modern-card { 
  background:#fff; border-radius:var(--radius-md); padding:20px; 
  display:flex; flex-direction:column; gap:14px; 
  box-shadow:var(--shadow); transition:var(--transition); 
  border:1px solid var(--gray-200); 
  min-width: 360px; /* Ensure minimum width for buttons to fit */
}

/* Side-by-side cards container */
.cards-container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 24px;
  width: 100%;
}

/* Flex card for side-by-side layout */
.flex-card {
  flex: 1;
  min-width: 400px; /* Minimum width before wrapping */
  max-width: calc(50% - 12px); /* Ensure cards take up roughly half the container width */
  display: flex;
  flex-direction: column;
}

/* Card content container */
.card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Form group styling for settings page */
.card-content .form-group {
  margin-bottom: 20px;
}

.card-content .form-group:last-child {
  margin-bottom: 0;
}

/* API configuration card specific styling */
.card-content .form-group + .form-group {
  margin-top: 0;
}

/* Specific fix for the gap between API key and model inputs */
.modern-card .card-content {
  gap: 0;
}

/* Settings page specific styling */
.modern-card.half .card-content .form-group {
  margin-bottom: 10px;
}

.modern-card.half .card-content .form-group:last-child {
  margin-bottom: 0;
}

.modern-card.half .card-content .help-text {
  margin-bottom: 0;
}

/* Help text styling */
.help-text {
  font-size: 13px;
  color: var(--gray-600);
  margin-top: 6px;
}

.form-group .help-text:last-child {
  margin-bottom: 0;
}

/* Action row styling */
.action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.info-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  font-size: 13px;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .flex-card {
    max-width: 100%; /* On smaller screens, cards take full width */
    min-width: 100%;
  }
}
.modern-card:hover { box-shadow:var(--shadow-md); transform:translateY(-2px); }
.modern-card h3 { 
  margin:0; font-size:18px; font-weight:600; color:var(--brand-purple);
  display:flex; align-items:center; gap:8px;
}
.modern-card h3 i { color:var(--brand-orange); }

/* Admin theme wrappers (shared across dashboard + endpoints) */
.admin-page { background: #f8f9fc; min-height: 100vh; }
.admin-page .dashboard-container { padding: 24px; }
.admin-page .dashboard-header {
  background: #1f2937;
  color: white;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.35);
}
.admin-page .dashboard-header .header-icon { background: rgba(255,255,255,0.12); }
.admin-page .dashboard-header .header-text h1 { color: white; }
.admin-page .dashboard-header .header-text p { color: rgba(255,255,255,0.7); }
.admin-page .dashboard-header .ghost-btn { color: rgba(255,255,255,0.9); border-color: rgba(255,255,255,0.2); }
.admin-page .dashboard-header .ghost-btn:hover {
  border-color: rgba(255,255,255,0.4);
  color: white;
  background: rgba(255,255,255,0.12);
}
.card-surface {
  background: #eef0f4;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}
.card-surface .modern-card {
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18);
  padding: 24px;
}
.card-surface .modern-card .card-header {
  font-size: 16px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-surface .modern-card .card-header i { color: #6366f1; }
.card-surface .modern-card .card-content { padding: 0; }
.admin-divider {
  border: none;
  height: 1px;
  background: rgba(148, 163, 184, 0.35);
  margin: 32px 0;
  width: 100%;
}
.card-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Modern toolbar with utility buttons */
.modern-toolbar { 
  display:flex; 
  flex-wrap:wrap; 
  gap:8px; 
  margin:16px 0; 
  position: relative;
  z-index: 5;
  overflow: visible !important;
}

/* Utility buttons - make pause and reset more subtle */
.modern-icon-btn.action-pause,
.modern-icon-btn.action-reset {
  background: var(--gray-100);
  color: var(--gray-600);
  border-color: var(--gray-300);
}

.modern-icon-btn.action-pause:hover,
.modern-icon-btn.action-reset:hover {
  background: var(--gray-200);
  color: var(--gray-800);
  border-color: var(--gray-400);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

/* Icon button for actions like delete */
.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--gray-600);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  padding: 0;
}

.icon-btn:hover {
  background-color: var(--gray-100);
  color: var(--gray-900);
  transform: translateY(-1px);
}

.icon-btn.delete-record {
  color: var(--gray-500);
}

.icon-btn.delete-record:hover {
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.1);
}

.modern-toolbar::-webkit-scrollbar {
  display: none; /* Hide scrollbar in Chrome, Safari and Opera */
}

/* Modern icon button */
.modern-icon-btn { 
  width:32px; height:32px; display:inline-flex; align-items:center; justify-content:center; 
  border-radius:var(--radius); border:1px solid var(--gray-300); 
  background:white; color:var(--gray-700); transition:var(--transition); 
  flex-shrink: 0; /* Prevent buttons from shrinking */
}
.modern-icon-btn[disabled] { opacity:.6; cursor:not-allowed; }
.modern-icon-btn:hover:not([disabled]) { 
  background:var(--gray-50); color:var(--brand-purple); 
  border-color:var(--brand-purple); transform:translateY(-1px); 
  box-shadow:0 0 0 2px rgba(45,27,105,0.1); 
}

/* Action buttons with specific colors */
.modern-icon-btn.action-check { color:var(--brand-purple); }
.modern-icon-btn.action-cat { color:#3b82f6; }
.modern-icon-btn.action-enrich { color:#8b5cf6; }
.modern-icon-btn.action-norm { color:#10b981; }
.modern-icon-btn.action-imgs { color:var(--brand-orange); }
.modern-icon-btn.action-pause { color:#ef4444; }
.modern-icon-btn.action-reset { color:#f59e0b; }
.modern-icon-btn.action-copy { color:#6366f1; }

/* Modern meter */
.modern-meter {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 140px;
  margin: 16px 0;
  position: relative;
  overflow: visible;
}
.modern-meter svg {
  width: 100%;
  height: 110px;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.1));
}
.modern-meter .track {
  stroke: var(--gray-100);
  stroke-width: 8;
  opacity: 0.7;
}
.modern-meter .progress {
  stroke: url(#meter-gradient);
  stroke-width: 8;
  stroke-linecap: round;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
  transition: stroke-dasharray 0.5s ease;
}
.modern-meter .value {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -30%);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 8px 16px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.modern-meter .percentage {
  font-size: 28px;
  font-weight: 700;
  color: var(--brand-purple);
  line-height: 1.2;
}
.modern-meter .details {
  font-size: 13px;
  color: var(--gray-600);
  margin-top: 2px;
  white-space: nowrap;
}

/* Modern log */
.modern-log { 
  background:var(--gray-50); color:var(--gray-800); 
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size:13px; 
  border-radius:var(--radius); padding:12px; max-height:140px; overflow:auto; 
  border:1px solid var(--gray-200); line-height:1.5; 
}

/* Options panels for control panel buttons */
.options-panel {
  position: absolute;
  width: 360px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  z-index: 1000;
  overflow: hidden;
  animation: panel-fade-in 0.2s ease;
}

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

.options-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.options-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 8px;
}

.options-header h4 i {
  color: var(--brand-purple);
}

.options-header .close-options {
  background: transparent;
  border: none;
  color: var(--gray-600);
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
}

.options-header .close-options:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}

.options-body {
  padding: 16px;
  max-height: 400px;
  overflow-y: auto;
  background: white;
}

.options-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

/* Form elements in option panels */
.options-panel .form-group {
  margin-bottom: 16px;
}

.options-panel .form-group:last-child {
  margin-bottom: 0;
}

.options-panel label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--gray-700);
}

.options-panel .field-help {
  font-size: 12px;
  color: var(--gray-600);
  margin-top: 4px;
  margin-bottom: 0;
}

/* Style select boxes in option panels */
.options-panel select,
.options-panel select.modern-select {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  background-color: #fff;
  color: var(--gray-800);
  font-size: 14px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  transition: var(--transition);
}

.options-panel select:focus,
.options-panel select.modern-select:focus {
  outline: none;
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 3px rgba(45, 27, 105, 0.1);
}

/* Style text inputs in option panels */
.options-panel input[type="text"] {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--gray-300);
  background-color: #fff;
  color: var(--gray-800);
  font-size: 14px;
  transition: var(--transition);
}

.options-panel input[type="text"]:focus {
  outline: none;
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 3px rgba(45, 27, 105, 0.1);
}

/* Style checkboxes in option panels */
.options-panel .checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  cursor: pointer;
}

.options-panel .checkbox-container:last-child {
  margin-bottom: 0;
}

.options-panel .modern-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--brand-purple);
  border-radius: 3px;
}

/* Style radio buttons in option panels */
.options-panel input[type="radio"] {
  accent-color: var(--brand-purple);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* API endpoints radio styling */
.api-endpoints {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.api-endpoint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.api-endpoint input[type="radio"] {
  margin-top: 4px;
}

.api-endpoint label {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.endpoint-desc {
  font-size: 12px;
  color: var(--gray-600);
  font-weight: normal;
}
.modern-log .timestamp { color:var(--brand-purple); font-weight:500; }
.modern-log .success { color:#10b981; }
.modern-log .warning { color:#f59e0b; }
.modern-log .error { color:#ef4444; }

/* Modern tooltips */
.tooltip { position:relative; display:inline-flex; }
.tooltip-content { 
  display:none; 
  position:absolute; 
  bottom:calc(100% + 10px); 
  left:50%; 
  transform:translateX(-50%); 
  background:#fff; 
  border:1px solid var(--gray-200); 
  border-radius:var(--radius); 
  padding:8px 12px; 
  width:240px; 
  box-shadow:var(--shadow); 
  z-index:10; 
  font-size:13px; 
  color:var(--gray-700);
  pointer-events: none; /* Prevent tooltip from blocking mouse events */
}
.tooltip-content::after { content:''; position:absolute; top:100%; left:50%; transform:translateX(-50%); border-width:8px; border-style:solid; border-color:white transparent transparent transparent; }
.tooltip-content::before { content:''; position:absolute; top:100%; left:50%; transform:translateX(-50%); border-width:9px; border-style:solid; border-color:var(--gray-200) transparent transparent transparent; z-index:-1; }
.tooltip:hover .tooltip-content { 
  display:block; 
}
.tooltip-icon { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; border-radius:50%; background:var(--gray-200); color:var(--gray-600); font-size:12px; margin-left:6px; cursor:help; }

/* Control panel specific tooltip fixes */
.modern-toolbar .tooltip {
  position: relative;
}

.modern-toolbar .tooltip .tooltip-content {
  width: 220px;
  bottom: calc(100% + 12px);
  font-size: 12px;
  line-height: 1.4;
  z-index: 1000;
}

/* Ensure tooltips are visible even when scrolling */
.modern-toolbar {
  position: relative;
  z-index: 5;
  overflow: visible !important;
}

/* Help panel */
.help-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
}

.help-toggle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--brand-purple);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  border: none;
}

.help-toggle:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  background: var(--brand-purple-hover);
}

.help-content {
  position: absolute;
  bottom: 70px;
  right: 0;
  width: 320px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  transform: translateY(20px);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  border: 1px solid var(--gray-200);
  max-height: 80vh;
  overflow-y: auto;
}

.help-content.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.help-content h3 {
  margin-top: 0;
  color: var(--brand-purple);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
}

.help-content h4 {
  margin: 16px 0 8px;
  color: var(--brand-orange);
  font-size: 16px;
}

.help-content p {
  margin: 8px 0;
  color: var(--gray-700);
  font-size: 14px;
  line-height: 1.5;
}

.help-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  padding: 4px;
  height: auto;
  width: auto;
  box-shadow: none;
}

.help-close:hover {
  color: var(--gray-800);
  transform: none;
  box-shadow: none;
}

/* Contextual help indicators */
.help-indicator {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-orange);
  color: white;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  opacity: 0.9;
  transition: var(--transition);
}

.help-indicator:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Progress modal */
.progress-modal,
.confirmation-modal {
  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: 9999;
}

/* Confirmation modal */
.confirmation-content {
  background: white;
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modal-appear 0.3s ease;
}

.confirmation-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
}

.confirmation-header h3 {
  margin: 0;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gray-800);
}

.confirmation-header h3 i {
  color: var(--brand-purple);
}

.confirmation-body {
  padding: 20px;
}

.confirmation-body p {
  margin: 0 0 16px;
  line-height: 1.5;
}

.confirmation-body ul {
  margin: 0 0 16px;
  padding-left: 20px;
}

.confirmation-body li {
  margin-bottom: 8px;
}

.confirmation-body .warning {
  color: #ef4444;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.confirmation-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Danger button */
.btn.danger {
  background-color: #ef4444;
  color: white;
  border-color: #ef4444;
}

.btn.danger:hover {
  background-color: #dc2626;
  border-color: #dc2626;
}

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

/* Onboarding steps */
.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.onboarding-overlay.active {
  opacity: 1;
  visibility: visible;
}

.onboarding-step {
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  max-width: 500px;
  width: 90%;
  position: relative;
}

.onboarding-step h3 {
  margin-top: 0;
  color: var(--brand-purple);
  font-size: 20px;
}

.onboarding-step p {
  color: var(--gray-700);
  line-height: 1.6;
  margin-bottom: 20px;
}

.onboarding-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

.onboarding-progress {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  justify-content: center;
}

.onboarding-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-300);
}

.onboarding-dot.active {
  background: var(--brand-purple);
  transform: scale(1.2);
}

/* Feature highlight */
.feature-highlight {
  position: relative;
  z-index: 2;
}

.feature-highlight::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border: 2px solid var(--brand-orange);
  border-radius: calc(var(--radius) + 2px);
  animation: pulse 2s infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 122, 0, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(255, 122, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 122, 0, 0); }
}

/* Success animation */
@keyframes success-pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.success-animation {
  animation: success-pulse 1s 1;
}

/* Card focus state */
.modern-card.focus {
  box-shadow: 0 0 0 2px var(--brand-purple), var(--shadow-md);
  transform: translateY(-2px);
}

/* Keyboard shortcut display */
.keyboard-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  margin-left: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Toast notification */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: white;
  border-left: 4px solid var(--brand-purple);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 400px;
  transform: translateX(120%);
  transition: transform 0.3s ease;
  pointer-events: all;
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  border-left-color: #10b981;
}

.toast.warning {
  border-left-color: #f59e0b;
}

.toast.error {
  border-left-color: #ef4444;
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #10b981;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast.warning .toast-icon {
  background: #f59e0b;
}

.toast.error .toast-icon {
  background: #ef4444;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  margin: 0;
  font-size: 14px;
}

.toast-message {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--gray-600);
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0;
  height: auto;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

.toast-close:hover {
  color: var(--gray-600);
  transform: none;
  box-shadow: none;
}

/* Workflow explanation card - Ghost style compact accordion */
.workflow-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.workflow-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin-bottom: 0;
  cursor: pointer;
  transition: var(--transition);
}

.workflow-header:hover {
  background: var(--gray-100);
}

.workflow-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.workflow-toggle {
  background: transparent;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  padding: 4px;
  height: auto;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: var(--transition);
}

.workflow-toggle:hover {
  color: var(--brand-purple);
  background-color: var(--gray-100);
  transform: none;
  box-shadow: none;
  border-radius: var(--radius-sm);
}

.workflow-content {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 0;
  opacity: 0;
  padding: 0 16px;
  border-top: 1px solid var(--gray-200);
  background: white;
}

.workflow-content.show {
  max-height: 1000px;
  opacity: 1;
  padding: 16px;
}

.workflow-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}

.workflow-step {
  display: flex;
  gap: 12px;
  position: relative;
  flex: 1;
  min-width: 200px;
}

.workflow-step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand-purple);
  color: white;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.workflow-step:nth-child(2) .workflow-step-number {
  background: #3b82f6;
}

.workflow-step:nth-child(3) .workflow-step-number {
  background: #8b5cf6;
}

.workflow-step:nth-child(4) .workflow-step-number {
  background: #10b981;
}

.workflow-step:nth-child(5) .workflow-step-number {
  background: var(--brand-orange);
}

.workflow-step-content {
  flex: 1;
}

.workflow-step-title {
  font-weight: 600;
  margin: 0 0 2px;
  color: var(--gray-800);
  font-size: 14px;
}

.workflow-step-description {
  margin: 0;
  color: var(--gray-600);
  line-height: 1.4;
  font-size: 13px;
}

.workflow-connector {
  position: absolute;
  top: 24px;
  left: 12px;
  width: 1px;
  height: calc(100% - 12px);
  background: var(--gray-200);
  z-index: 0;
}

.workflow-footer {
  font-size: 13px;
  color: var(--gray-600);
  padding: 16px;
  margin-top: 16px;
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}

.workflow-footer i {
  color: var(--brand-orange);
  font-size: 14px;
  margin-top: 2px;
  flex-shrink: 0;
}

.workflow-intro {
  font-size: 14px;
  color: var(--gray-700);
  margin: 0 0 20px;
  line-height: 1.6;
}

.workflow-step-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(255, 140, 0, 0.06) 0%, rgba(255, 140, 0, 0.12) 100%);
  border-left: 3px solid var(--brand-orange);
  border-radius: 6px;
  font-size: 12px;
  color: var(--gray-800);
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(255, 140, 0, 0.1);
  transition: all 0.2s ease;
}

.workflow-step-hint:hover {
  background: linear-gradient(135deg, rgba(255, 140, 0, 0.1) 0%, rgba(255, 140, 0, 0.15) 100%);
  box-shadow: 0 2px 6px rgba(255, 140, 0, 0.15);
  transform: translateX(2px);
}

.workflow-step-hint i {
  color: var(--brand-orange);
  font-size: 14px;
  margin-top: 2px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(255, 140, 0, 0.3));
}

.workflow-step-hint span {
  font-weight: 500;
}

.workflow-link {
  color: var(--brand-purple);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.workflow-link:hover {
  border-bottom-color: var(--brand-purple);
}

.workflow-step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-purple);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(26, 20, 100, 0.2);
}

.workflow-step-number i {
  font-size: 18px;
}

/* Smart Search Suggestions */
.clear-search-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: var(--gray-200);
  color: var(--gray-600);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 5;
}

.clear-search-btn:hover {
  background: var(--gray-300);
  color: var(--gray-900);
}

.search-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #ffffff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  z-index: 99999;
  max-height: 320px;
  overflow-y: auto;
  display: none;
  padding: 4px 0;
}

.search-suggestions.show {
  display: block;
}

.search-suggestions-header {
  padding: 8px 18px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--gray-500);
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-suggestion {
  padding: 12px 18px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--gray-100);
}

.search-suggestion:last-child {
  border-bottom: none;
}

.search-suggestion:hover,
.search-suggestion.active {
  background: var(--gray-50);
  box-shadow: inset 2px 0 0 var(--brand-purple);
}

.suggestion-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  background: var(--gray-100);
  color: var(--gray-500);
}

.suggestion-icon.title { 
  background: rgba(26, 20, 100, 0.12); 
  color: var(--brand-purple); 
}

.suggestion-icon.brand { 
  background: rgba(255, 140, 0, 0.12); 
  color: var(--brand-orange); 
}

.suggestion-icon.supplier { 
  background: rgba(59, 130, 246, 0.12); 
  color: #2563eb; 
}

.suggestion-icon.sku { 
  background: rgba(16, 185, 129, 0.12); 
  color: #0f766e; 
}

.suggestion-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.suggestion-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1.3;
}

.suggestion-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.suggestion-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--gray-200);
}

.suggestion-badge.primary {
  background: rgba(26, 20, 100, 0.15);
  color: var(--brand-purple);
  border-color: rgba(26, 20, 100, 0.3);
}

.suggestion-badge i {
  font-size: 11px;
}

/* Mobile responsive styles for workflow cards */
@media (max-width: 768px) {
  .workflow-card {
    margin-bottom: 16px;
  }
  
  .workflow-steps {
    flex-direction: column;
    gap: 20px;
  }
  
  .workflow-step {
    min-width: 100%;
    flex-direction: column;
    gap: 8px;
  }
  
  .workflow-step-number {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  
  .workflow-connector {
    display: none; /* Hide connectors on mobile for cleaner look */
  }
  
  .workflow-step-hint {
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    margin-top: 8px;
    align-items: flex-start;
  }
  
  .workflow-step-hint i {
    font-size: 16px;
    margin-top: 0;
  }
  
  .workflow-step-hint span {
    font-size: 13px;
    line-height: 1.5;
  }
  
  .workflow-intro {
    font-size: 13px;
    margin-bottom: 16px;
  }
  
  .workflow-footer {
    padding: 12px;
    font-size: 12px;
  }
  
  .workflow-content.show {
    padding: 12px;
  }
}
