:root {
/* Brand */
--gold-primary: #f9cb00;
--gold-dark: #cca600;
--gold: #f9cb00;
--primary: #f9cb00;
--primary-hover: #e6b800;
--accent: #f9cb00;
--accent-hover: #e6b800;

/* Dark theme */
--dark-primary: #1a1a2e;
--dark-deep: #0a0a12;
--dark-surface: #12121a;
--dark-elevated: #1e1e2d;
--dark: #1a1a2e;
--surface: #1e1e2d;

/* Text */
--text-primary: #fff;
--text-secondary: rgba(255,255,255,.75);
--text-muted: rgba(255,255,255,.5);

/* Border */
--border-subtle: rgba(255,255,255,.1);
--border-light: rgba(255,255,255,.15);

/* Status */
--success: #10b981;
--warning: #f59e0b;
--error: #ef4444;
--info: #3b82f6;

/* Background */
--dark-bg: #0a0a12;
--bg-primary: #0a0a12;
--bg-secondary: #12121a;
--bg-card: #1a1a24;

/* Layout */
--unified-nav-height: 140px;
--sidebar-width: 260px;
--sidebar-collapsed-width: 72px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Global micro-interactions */
button, .btn, .btn-modern, .toolbar-btn, .nav-item, .filter-pill, .view-btn {
      transition: all 0.2s ease;
}

/* Smooth scroll behavior */
html {
      scroll-behavior: smooth;
}

/* Focus visible styling for accessibility */
:focus-visible {
      outline: 2px solid var(--gold-primary);
      outline-offset: 2px;
}

/* Remove focus outline for mouse users */
:focus:not(:focus-visible) {
      outline: none;
}

/* Selection styling */
::selection {
      background: rgba(249, 203, 0, 0.3);
      color: var(--text-primary);
}

/* Subtle pulse animation for important elements */
@keyframes subtlePulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.7; }
}

/* Loading shimmer effect */
@keyframes shimmer {
      0% { background-position: -200% 0; }
      100% { background-position: 200% 0; }
}

.loading-shimmer {
      background: linear-gradient(90deg, var(--dark-elevated) 25%, var(--dark-surface) 50%, var(--dark-elevated) 75%);
      background-size: 200% 100%;
      animation: shimmer 1.5s infinite;
}

/* Loading spinner component */
.loading-spinner {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
}

.loading-spinner::before {
      content: '';
      width: 20px;
      height: 20px;
      border: 2px solid var(--border-light);
      border-top-color: var(--gold-primary);
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
}

.loading-spinner.large::before {
      width: 32px;
      height: 32px;
      border-width: 3px;
}

.loading-spinner.small::before {
      width: 14px;
      height: 14px;
}

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

/* Full page loading overlay */
.loading-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.7);
      backdrop-filter: blur(4px);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      gap: 16px;
      z-index: 99999;
}

.loading-overlay .loading-spinner::before {
      width: 40px;
      height: 40px;
      border-width: 3px;
}

@media (max-width: 991px) {
:root { --unified-nav-height: 64px; }
}

body {
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
      background: var(--dark-deep);
      min-height: 100vh;
      color: var(--text-primary);
      padding-top: var(--unified-nav-height); /* Space for fixed unified nav */
}

/* Custom scrollbar styling */
::-webkit-scrollbar {
      width: 8px;
      height: 8px;
}

::-webkit-scrollbar-track {
      background: var(--dark-deep);
      border-radius: 4px;
}

::-webkit-scrollbar-thumb {
      background: var(--border-light);
      border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
      background: var(--text-muted);
}

/* Firefox scrollbar */
* {
      scrollbar-width: thin;
      scrollbar-color: var(--border-light) var(--dark-deep);
}

/* Sidebar */
.sidebar {
      position: fixed;
      left: 0;
      top: var(--unified-nav-height);
      bottom: 0;
      width: var(--sidebar-width);
      background: var(--dark-surface);
      border-right: 1px solid var(--border-subtle);
      padding: 24px 0;
      display: flex;
      flex-direction: column;
      z-index: 100;
      transition: width 0.3s ease, transform 0.3s ease;
      overflow-x: hidden;
      /* Position context for toggle button */
      isolation: isolate;
}

/* Collapsed Sidebar State */
.sidebar.collapsed {
      width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-header {
      padding: 0 12px 24px;
}

.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .sidebar-logo-sub {
      display: none;
}

.sidebar.collapsed .nav-section-title {
      opacity: 0;
      height: 0;
      margin: 0;
      padding: 0;
      overflow: hidden;
}

.sidebar.collapsed #god-mode-nav {
      margin: 4px !important;
      padding: 4px 0 !important;
      border: none !important;
      background: none !important;
}

.sidebar.collapsed .nav-item {
      justify-content: center;
      padding: 12px;
}

.sidebar.collapsed .nav-item-text {
      display: none;
}

.sidebar.collapsed .nav-badge {
      position: absolute;
      top: 4px;
      right: 4px;
      min-width: 16px;
      padding: 2px 5px;
      font-size: 9px;
}

.sidebar.collapsed .nav-item {
      position: relative;
}

.sidebar.collapsed .sidebar-footer {
      padding: 16px 12px;
}

.sidebar.collapsed .user-info,
.sidebar.collapsed .logout-btn {
      display: none;
}

.sidebar.collapsed .user-menu {
      justify-content: center;
}

/* Hide zero badges */
.nav-badge.empty,
.nav-badge[data-count="0"] {
      display: none;
}

.sidebar-header {
      padding: 20px 24px 24px;
      border-bottom: 1px solid var(--border-subtle);
      margin-bottom: 24px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
}

.sidebar-logo {
      display: flex;
      align-items: center;
      gap: 12px;
      text-decoration: none;
      color: var(--text-primary);
      flex: 1;
      min-width: 0;
}

/* Sidebar Collapse Button */
.sidebar-collapse-btn {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid var(--border-subtle);
      color: var(--text-muted);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
      flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
      background: rgba(249, 203, 0, 0.1);
      border-color: var(--gold-primary);
      color: var(--gold-primary);
}

.sidebar.collapsed .sidebar-collapse-btn {
      transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-header {
      justify-content: center;
}

.sidebar.collapsed .sidebar-logo {
      display: none;
}

.sidebar-logo-icon {
      width: 40px;
      height: 40px;
      background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 800;
      font-size: 18px;
      color: var(--dark-primary);
}

.sidebar-logo-text {
      font-weight: 700;
      font-size: 16px;
}

.sidebar-logo-sub {
      font-size: 11px;
      color: var(--gold-primary);
      text-transform: uppercase;
      letter-spacing: 1px;
}

/* FORCE SIDEBAR NAV VISIBILITY - Override any interference */
.sidebar-nav,
nav.sidebar-nav,
.sidebar .sidebar-nav,
#sidebar .sidebar-nav {
      flex: 1;
      padding: 0 12px;
      overflow-y: auto;
      display: block !important;
      visibility: visible !important;
      opacity: 1 !important;
      height: auto !important;
      max-height: none !important;
      position: relative !important;
      transform: none !important;
      left: auto !important;
      top: auto !important;
}

.nav-section,
.sidebar-nav .nav-section {
      margin-bottom: 24px;
}

.nav-section.hidden,
.sidebar-nav .nav-section.hidden {
      display: none !important;
}

.nav-item,
.sidebar-nav .nav-item {
      display: flex;
}

.nav-item.hidden,
.sidebar-nav .nav-item.hidden {
      display: none !important;
}

.nav-section-title {
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 1px;
      color: var(--text-muted);
      padding: 0 12px;
      margin-bottom: 8px;
}

.nav-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 16px;
      border-radius: 8px;
      color: var(--text-secondary);
      text-decoration: none;
      font-size: 14px;
      font-weight: 500;
      transition: all 0.2s;
      cursor: pointer;
      overflow: hidden;
}

.nav-item-text {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      min-width: 0;
}

.nav-item:hover {
      background: rgba(255, 255, 255, 0.05);
      color: var(--text-primary);
}

.nav-item.active {
      background: rgba(249, 203, 0, 0.1);
      color: var(--gold-primary);
      position: relative;
}

.nav-item.active::before {
      content: '';
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      width: 3px;
      height: 24px;
      background: var(--gold-primary);
      border-radius: 0 2px 2px 0;
}

.nav-item svg {
      width: 20px;
      height: 20px;
      opacity: 0.7;
      flex-shrink: 0;
}

.nav-item.active svg {
      opacity: 1;
}

.nav-badge {
      margin-left: auto;
      background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
      color: var(--dark-primary);
      font-size: 11px;
      font-weight: 800;
      padding: 3px 10px;
      border-radius: 100px;
      box-shadow: 0 2px 8px rgba(249, 203, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
      border: 1px solid rgba(255, 255, 255, 0.1);
      min-width: 20px;
      text-align: center;
}

.nav-badge.empty {
      background: var(--border-subtle);
      color: var(--text-muted);
      box-shadow: none;
      border: none;
}

/* Shepherd.js Tour Theme Overrides - pulse-new keyframe removed */
@keyframes pulse-new {
      0%, 100% { opacity: 1; transform: scale(1); }
      50% { opacity: 0.8; transform: scale(1.05); }
}


/* Shepherd.js Tour Theme Overrides */
.shepherd-element {
      background: #1e293b !important;
      border: 1px solid var(--gold-primary) !important;
      border-radius: 12px !important;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
      max-width: 380px !important;
}
.shepherd-arrow:before {
      background: #1e293b !important;
      border-color: var(--gold-primary) !important;
}
.shepherd-content { padding: 0 !important; }
.shepherd-header {
      background: transparent !important;
      padding: 16px 20px 8px !important;
      border-bottom: none !important;
}
.shepherd-title {
      color: #fff !important;
      font-size: 16px !important;
      font-weight: 700 !important;
      font-family: 'Inter', sans-serif !important;
}
.shepherd-cancel-icon { color: rgba(255,255,255,0.5) !important; }
.shepherd-cancel-icon:hover { color: #fff !important; }
.shepherd-text {
      color: rgba(255,255,255,0.75) !important;
      font-size: 14px !important;
      line-height: 1.6 !important;
      padding: 0 20px 16px !important;
      font-family: 'Inter', sans-serif !important;
}
.shepherd-footer {
      padding: 12px 20px 16px !important;
      border-top: 1px solid rgba(255,255,255,0.1) !important;
}
.shepherd-button {
      background: transparent !important;
      border: 1px solid rgba(255,255,255,0.2) !important;
      color: rgba(255,255,255,0.75) !important;
      border-radius: 8px !important;
      padding: 8px 16px !important;
      font-size: 13px !important;
      font-weight: 600 !important;
      font-family: 'Inter', sans-serif !important;
      transition: all 0.2s !important;
}
.shepherd-button:hover {
      background: rgba(255,255,255,0.1) !important;
      color: #fff !important;
}
.shepherd-button.shepherd-button-primary {
      background: linear-gradient(135deg, #f9cb00 0%, #cca600 100%) !important;
      border: none !important;
      color: #1a1a2e !important;
}
.shepherd-button.shepherd-button-primary:hover {
      transform: translateY(-1px) !important;
      box-shadow: 0 4px 12px rgba(249, 203, 0, 0.4) !important;
}
.shepherd-modal-overlay-container { fill: rgba(0, 0, 0, 0.75) !important; }

/* Enhanced Navigation Section Styles */
.nav-section:first-child {
      margin-top: 0;
}

.nav-section:first-child .nav-item {
      background: rgba(249, 203, 0, 0.05);
      border: 1px solid var(--border-subtle);
      margin-bottom: 4px;
}

.nav-section:first-child .nav-item.active {
      background: rgba(249, 203, 0, 0.15);
      border-color: var(--gold-primary);
}

.nav-section-title {
      position: relative;
      padding-left: 12px;
}

.nav-section-title::before {
      content: '';
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      width: 3px;
      height: 12px;
      background: var(--gold-primary);
      border-radius: 2px;
      opacity: 0.6;
}

/* Quick Links section styling */
.nav-section-links {
      margin-top: auto;
      padding-top: 16px;
      border-top: 1px solid var(--border-subtle);
}

.nav-section-links .nav-item-link {
      color: var(--text-muted);
      font-size: 13px;
      padding: 10px 16px;
}

.nav-section-links .nav-item-link:hover {
      color: var(--gold-primary);
}

.nav-section-links .nav-item-link svg {
      width: 18px;
      height: 18px;
}

/* Business sections visual grouping */
#sales-nav,
#operations-nav,
#finance-nav {
      position: relative;
}

#sales-nav .nav-section-title::before {
      background: #3b82f6;
}

#operations-nav .nav-section-title::before {
      background: #8b5cf6;
}

#finance-nav .nav-section-title::before {
      background: #22c55e;
}

#admin-nav .nav-section-title::before {
      background: #ef4444;
}

#vendor-nav .nav-section-title::before {
      background: #f59e0b;
}

/* GOD MODE section - ensure items are visible */
#god-mode-nav .nav-item {
      display: flex !important;
      opacity: 1 !important;
      visibility: visible !important;
      height: auto !important;
      padding: 10px 12px;
      margin: 2px 0;
      border-radius: 6px;
      color: var(--text-primary);
}

#god-mode-nav .nav-item:hover {
      background: rgba(139, 92, 246, 0.2);
}

#god-mode-nav .nav-item.active {
      background: rgba(139, 92, 246, 0.3);
      color: #a855f7;
}

#god-mode-nav .nav-item svg {
      width: 18px;
      height: 18px;
      margin-right: 10px;
      flex-shrink: 0;
}

#god-mode-nav .nav-item-text {
      /* Only force-show text when sidebar is expanded, not collapsed */
      opacity: 1;
}
.sidebar.collapsed #god-mode-nav .nav-item-text {
      display: none !important;
}

/* ==================== GOD MODE MOBILE RESPONSIVE ==================== */

/* GOD MODE page headers */
[id^="page-god-"] .page-header {
      flex-direction: column;
      align-items: stretch !important;
      gap: 16px;
}

[id^="page-god-"] .page-header > div:last-child {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
}

/* GOD MODE stat cards grid */
[id^="page-god-"] .stat-card-mini {
      min-width: 120px;
}

/* GOD MODE tabs - horizontal scroll on mobile */
.tabs-modern {
      display: flex;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      -ms-overflow-style: none;
      gap: 4px;
      padding-bottom: 8px;
}

.tabs-modern::-webkit-scrollbar {
      display: none;
}

.tabs-modern .tab-modern {
      flex-shrink: 0;
      white-space: nowrap;
      padding: 10px 16px;
      font-size: 13px;
}

/* GOD MODE tables - responsive wrapper */
[id^="page-god-"] .card-body table {
      min-width: 600px;
}

[id^="page-god-"] .card-body {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
}

/* Mobile-specific GOD MODE styles */
@media (max-width: 768px) {
      /* GOD MODE nav section on mobile */
      #god-mode-nav {
        margin: 4px !important;
        padding: 6px !important;
      }

      #god-mode-nav .nav-item {
        padding: 12px 10px;
        font-size: 14px;
        min-height: 44px; /* Touch target */
      }

      #god-mode-nav .nav-item svg {
        width: 20px;
        height: 20px;
      }

      #god-mode-nav .nav-section-title {
        font-size: 12px;
        padding: 8px 10px;
      }
}

/* GOD Mode View Links */
.god-view-link:hover {
      border-color: rgba(139, 92, 246, 0.5) !important;
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

@media (max-width: 768px) {
      /* GOD MODE page titles */
      [id^="page-god-"] .page-title {
        font-size: 20px !important;
      }

      [id^="page-god-"] .page-subtitle {
        font-size: 13px !important;
      }

      /* GOD MODE stat cards - 2 columns on mobile */
      [id^="page-god-"] > div[style*="grid-template-columns"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
      }

      .stat-card-mini {
        padding: 12px !important;
      }

      .stat-card-mini .stat-card-value {
        font-size: 20px !important;
      }

      .stat-card-mini .stat-card-label {
        font-size: 11px !important;
      }

      /* GOD MODE buttons */
      [id^="page-god-"] .btn-modern {
        padding: 10px 14px !important;
        font-size: 13px !important;
        min-height: 44px;
      }

      /* GOD MODE cards */
      [id^="page-god-"] .card {
        border-radius: 12px;
      }

      [id^="page-god-"] .card-header {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
      }

      [id^="page-god-"] .card-header .card-title {
        font-size: 15px;
      }

      /* GOD MODE tables on mobile */
      [id^="page-god-"] table th,
      [id^="page-god-"] table td {
        padding: 10px 12px !important;
        font-size: 12px !important;
      }

      [id^="page-god-"] table th {
        font-size: 11px !important;
      }

      /* GOD MODE search/filter inputs */
      [id^="page-god-"] input[type="text"],
      [id^="page-god-"] select {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 12px !important;
        min-height: 44px;
      }

      /* GOD MODE Analytics specific */
      #page-god-analytics .tabs-modern {
        margin: 0 -16px 16px;
        padding: 0 16px 8px;
      }

      #page-god-analytics [style*="grid-template-columns: repeat(auto-fit, minmax(400px"] {
        grid-template-columns: 1fr !important;
      }

      #page-god-analytics [style*="grid-template-columns: repeat(auto-fit, minmax(180px"] {
        grid-template-columns: repeat(3, 1fr) !important;
      }

      /* GOD MODE Customer Hub tabs */
      .god-customer-tab .card {
        margin-bottom: 16px;
      }

      /* GOD MODE Database textarea */
      #god-sql-query {
        font-size: 14px !important;
        min-height: 100px !important;
      }

      /* GOD MODE API Tester */
      #god-api-body {
        font-size: 14px !important;
      }

      /* GOD MODE Config page */
      #page-god-config [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
      }

      /* GOD MODE Site Manager */
      #page-god-site [style*="grid-template-columns: repeat(auto-fit, minmax(280px"] {
        grid-template-columns: 1fr !important;
      }

      /* GA Status indicator */
      #god-ga-status {
        font-size: 11px !important;
        padding: 6px 10px !important;
      }

      #god-ga-connect-btn {
        font-size: 12px !important;
        padding: 8px 12px !important;
      }
}

/* Small mobile (< 480px) */
@media (max-width: 480px) {
      [id^="page-god-"] > div[style*="grid-template-columns"] {
        grid-template-columns: repeat(2, 1fr) !important;
      }

      #page-god-analytics [style*="grid-template-columns: repeat(auto-fit, minmax(180px"] {
        grid-template-columns: repeat(2, 1fr) !important;
      }

      .tabs-modern .tab-modern {
        padding: 8px 12px;
        font-size: 12px;
      }

      [id^="page-god-"] .page-header > div:last-child {
        flex-direction: column;
      }

      [id^="page-god-"] .page-header > div:last-child > * {
        width: 100%;
      }
}

/* ==================== END GOD MODE MOBILE ==================== */

/* Account type badges */
.account-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 4px 12px;
      border-radius: 100px;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
}

.account-badge.homeowner {
      background: rgba(77, 255, 130, 0.15);
      color: var(--success);
}

.account-badge.pro {
      background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
      color: var(--dark-primary);
      box-shadow: 0 2px 8px rgba(249, 203, 0, 0.3);
}

.account-badge.pro::before {
      content: '\2605';
      font-size: 10px;
}

.account-badge.admin {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      color: #fff;
      box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.account-badge.admin::before {
      content: '\2699';
      font-size: 10px;
}

/* Stat value styling */
.stat-value {
      font-size: 28px;
      font-weight: 800;
      color: var(--gold-primary);
      text-shadow: 0 0 20px rgba(249, 203, 0, 0.3);
}

.stat-card:hover .stat-value {
      text-shadow: 0 0 30px rgba(249, 203, 0, 0.5);
}

.sidebar-footer {
      padding: 16px 24px;
      border-top: 1px solid var(--border-subtle);
}

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

.user-avatar {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 16px;
      color: var(--dark-primary);
}

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

.user-name {
      font-size: 14px;
      font-weight: 600;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
}

.user-role {
      font-size: 11px;
      color: var(--gold-primary);
      text-transform: uppercase;
}

/* Page Toolbar (Quick Actions) - Desktop only */
.page-toolbar {
      position: fixed;
      left: var(--sidebar-width);
      top: calc(var(--unified-nav-height) + 140px);
      bottom: 0;
      width: 56px;
      background: var(--dark-surface);
      border-right: 1px solid var(--border-subtle);
      display: none; /* Hidden by default, shown on large screens */
      flex-direction: column;
      padding: 16px 8px;
      gap: 8px;
      z-index: 99;
      transition: left 0.3s ease;
}

/* Only show toolbar on large desktop screens */
@media (min-width: 1200px) {
      .page-toolbar {
        display: flex;
      }
}

body.sidebar-collapsed .page-toolbar {
      left: var(--sidebar-collapsed-width);
}

.toolbar-section {
      display: flex;
      flex-direction: column;
      gap: 4px;
}

.toolbar-divider {
      height: 1px;
      background: var(--border-subtle);
      margin: 8px 0;
}

.toolbar-btn {
      width: 40px;
      height: 40px;
      border-radius: 10px;
      background: transparent;
      border: 1px solid transparent;
      color: var(--text-muted);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
      position: relative;
}

.toolbar-btn:hover {
      background: rgba(249, 203, 0, 0.1);
      border-color: rgba(249, 203, 0, 0.3);
      color: var(--gold-primary);
      transform: scale(1.05);
}

.toolbar-btn:active {
      transform: scale(0.95);
}

.toolbar-btn.active {
      background: rgba(249, 203, 0, 0.15);
      border-color: var(--gold-primary);
      color: var(--gold-primary);
}

.toolbar-btn.active::before {
      content: '';
      position: absolute;
      left: -1px;
      top: 50%;
      transform: translateY(-50%);
      width: 3px;
      height: 24px;
      background: var(--gold-primary);
      border-radius: 0 2px 2px 0;
}

/* Tooltip on hover */
.toolbar-btn::after {
      content: attr(title);
      position: absolute;
      left: 100%;
      top: 50%;
      transform: translateY(-50%);
      margin-left: 8px;
      padding: 6px 10px;
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 6px;
      font-size: 12px;
      font-weight: 500;
      color: var(--text-primary);
      white-space: nowrap;
      opacity: 0;
      visibility: hidden;
      transition: all 0.2s;
      pointer-events: none;
      z-index: 1000;
}

.toolbar-btn:hover::after {
      opacity: 1;
      visibility: visible;
}

/* General purpose tooltip utility */
[data-tooltip] {
      position: relative;
}

[data-tooltip]::after {
      content: attr(data-tooltip);
      position: absolute;
      bottom: 100%;
      left: 50%;
      transform: translateX(-50%);
      margin-bottom: 6px;
      padding: 6px 10px;
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 6px;
      font-size: 12px;
      font-weight: 500;
      color: var(--text-primary);
      white-space: nowrap;
      opacity: 0;
      visibility: hidden;
      transition: all 0.2s;
      pointer-events: none;
      z-index: 1000;
}

[data-tooltip]:hover::after {
      opacity: 1;
      visibility: visible;
}

[data-tooltip-pos="right"]::after {
      bottom: auto;
      left: 100%;
      top: 50%;
      transform: translateY(-50%);
      margin-bottom: 0;
      margin-left: 8px;
}

[data-tooltip-pos="left"]::after {
      bottom: auto;
      left: auto;
      right: 100%;
      top: 50%;
      transform: translateY(-50%);
      margin-bottom: 0;
      margin-right: 8px;
}

[data-tooltip-pos="bottom"]::after {
      bottom: auto;
      top: 100%;
      margin-bottom: 0;
      margin-top: 6px;
}

/* Adjust main content for toolbar */
.main-content {
      margin-left: calc(var(--sidebar-width) + 56px) !important;
      transition: margin-left 0.3s ease;
}

body.sidebar-collapsed .main-content {
      margin-left: calc(var(--sidebar-collapsed-width) + 56px) !important;
}

.logout-btn {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      padding: 8px;
      border-radius: 6px;
      transition: all 0.2s;
}

.logout-btn:hover {
      background: rgba(255, 107, 107, 0.1);
      color: var(--error);
}

/* Main Content */
.main-content {
      margin-left: var(--sidebar-width);
      min-height: 100vh;
      transition: margin-left 0.3s ease;
      padding-top: 24px; /* Slight offset below sidebar logo */
}

body.sidebar-collapsed .main-content {
      margin-left: var(--sidebar-collapsed-width);
}

.topbar {
      background: var(--dark-surface);
      border-bottom: 1px solid var(--border-subtle);
      padding: 20px 40px; /* Increased padding for better spacing */
      display: flex;
      align-items: center;
      justify-content: space-between;
      position: sticky;
      top: var(--unified-nav-height); /* Stick below unified nav */
      z-index: 50;
}

.topbar-title {
      font-size: 20px;
      font-weight: 700;
}

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

.mobile-menu-btn {
      display: none;
      background: none;
      border: none;
      color: var(--text-primary);
      padding: 8px;
      cursor: pointer;
}

.btn {
      padding: 10px 20px;
      border-radius: 8px;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      border: none;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      text-decoration: none;
}

.btn-primary {
      background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
      color: var(--dark-primary);
}

.btn-primary:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 20px rgba(249, 203, 0, 0.3);
}

.btn-secondary {
      background: rgba(255, 255, 255, 0.05);
      color: var(--text-primary);
      border: 1px solid var(--border-light);
}

.btn-secondary:hover {
      background: rgba(255, 255, 255, 0.1);
}

/* Modern Button System */
.btn-modern {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 12px 20px;
      font-size: 14px;
      font-weight: 500;
      border-radius: 8px;
      border: none;
      cursor: pointer;
      transition: all 0.2s ease;
      text-decoration: none;
      white-space: nowrap;
      min-height: 44px; /* Touch-friendly */
}

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

.btn-modern.primary {
      background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
      color: var(--dark-primary);
}

.btn-modern.primary:hover:not(:disabled) {
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(249, 203, 0, 0.3);
}

.btn-modern.primary:active:not(:disabled) {
      transform: translateY(0);
      box-shadow: 0 2px 6px rgba(249, 203, 0, 0.2);
}

.btn-modern.secondary {
      background: rgba(255, 255, 255, 0.05);
      color: var(--text-primary);
      border: 1px solid var(--border-light);
}

.btn-modern.secondary:hover:not(:disabled) {
      background: rgba(255, 255, 255, 0.1);
      border-color: rgba(255, 255, 255, 0.2);
}

.btn-modern.secondary:active:not(:disabled) {
      background: rgba(255, 255, 255, 0.15);
}

.btn-modern.success {
      background: var(--success);
      color: white;
}

.btn-modern.success:hover:not(:disabled) {
      filter: brightness(1.1);
}

.btn-modern.danger {
      background: var(--error);
      color: white;
}

.btn-modern.danger:hover:not(:disabled) {
      filter: brightness(1.1);
}

.btn-modern.small {
      padding: 8px 12px;
      font-size: 13px;
      min-height: 36px;
}

.btn-modern.large {
      padding: 16px 28px;
      font-size: 16px;
      min-height: 52px;
}

.btn-modern.ghost {
      background: transparent;
      color: var(--text-secondary);
}

.btn-modern.ghost:hover:not(:disabled) {
      background: rgba(255, 255, 255, 0.05);
      color: var(--text-primary);
}

.btn-modern.outline {
      background: transparent;
      color: var(--gold-primary);
      border: 1px solid var(--gold-primary);
}

.btn-modern.outline:hover:not(:disabled) {
      background: rgba(249, 203, 0, 0.1);
}

.btn-modern.loading {
      pointer-events: none;
      position: relative;
      color: transparent;
}

.btn-modern.loading::after {
      content: '';
      position: absolute;
      width: 18px;
      height: 18px;
      border: 2px solid currentColor;
      border-right-color: transparent;
      border-radius: 50%;
      animation: btnSpin 0.6s linear infinite;
}

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

/* Notification Panel Styles */
.notification-item:hover {
      background: rgba(255, 255, 255, 0.05) !important;
}

.notification-item.unread {
      background: rgba(59, 130, 246, 0.08);
      border-left: 3px solid var(--info);
}

.notification-badge {
      animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
      0%, 100% { transform: scale(1); }
      50% { transform: scale(1.1); }
}

.notification-panel {
      animation: slideIn 0.2s ease-out;
}

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

/* Filter Pills */
.filter-pills {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      padding: 4px 0;
}

.filter-pill {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 8px 16px;
      font-size: 13px;
      font-weight: 500;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid var(--border-subtle);
      border-radius: 20px;
      color: var(--text-secondary);
      cursor: pointer;
      transition: all 0.2s ease;
      white-space: nowrap;
}

.filter-pill:hover {
      background: rgba(255, 255, 255, 0.1);
      color: var(--text-primary);
}

.filter-pill.active {
      background: var(--gold-primary);
      color: var(--dark-primary);
      border-color: var(--gold-primary);
}

.filter-pill:active {
      transform: scale(0.98);
}

.filter-pill span {
      font-size: 11px;
      padding: 2px 6px;
      background: rgba(0, 0, 0, 0.2);
      border-radius: 10px;
}

.filter-pill.active span {
      background: rgba(0, 0, 0, 0.15);
}

.content-area {
      padding: 32px 40px; /* Match topbar horizontal padding */
      max-width: none; /* Use full width */
      width: 100%;
}

/* Page Sections */
.page-section {
      display: none;
}

.page-section.active {
      display: block;
      animation: pageIn 0.25s ease-out;
}

@keyframes pageIn {
      from {
        opacity: 0;
        transform: translateY(8px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
}

/* Stats Grid */
/* Accessibility - Focus States */
:focus-visible {
      outline: 2px solid var(--gold-primary);
      outline-offset: 2px;
}

.btn-modern:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.filter-pill:focus-visible,
.filter-btn:focus-visible,
.nav-item:focus-visible {
      outline: 2px solid var(--gold-primary);
      outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
      outline: none;
      border-color: var(--gold-primary);
      box-shadow: 0 0 0 3px rgba(249, 203, 0, 0.2);
}

/* Skip to main content link (accessibility) */
.skip-link {
      position: absolute;
      top: -40px;
      left: 0;
      background: var(--gold-primary);
      color: var(--dark-primary);
      padding: 8px 16px;
      z-index: 10000;
      transition: top 0.3s;
}

.skip-link:focus {
      top: 0;
}

.stats-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap: 16px;
      margin-bottom: 32px;
}

.stat-card {
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 16px;
      padding: 24px;
      transition: all 0.3s;
}

.stat-card:hover {
      border-color: var(--border-light);
      transform: translateY(-2px);
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.stat-card.clickable {
      cursor: pointer;
}

.stat-card.clickable:hover {
      border-color: rgba(249, 203, 0, 0.3);
}

.stat-label {
      font-size: 13px;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 8px;
}

.stat-value {
      font-size: 32px;
      font-weight: 800;
      color: var(--text-primary);
}

/* Cards - Standardized (14px radius, 24px padding) */
.card {
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 14px;
      overflow: hidden;
      margin-bottom: 24px;
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
      border-color: var(--border-light);
}

.card.highlight {
      border-left: 3px solid var(--gold-primary);
}

.card-header {
      padding: 16px 24px;
      border-bottom: 1px solid var(--border-subtle);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
}

.card-title {
      font-size: 16px;
      font-weight: 700;
}

.card-body {
      padding: 24px;
}

/* Leads Grid Spacing */
#leads-table {
      margin-top: 16px;
}

#leads-table .leads-grid {
      padding: 4px;
}

#leads-table .lead-card {
      margin-bottom: 0;
}

/* Calendar Events Container Spacing */
.calendar-events {
      margin-top: 4px;
      padding-bottom: 4px;
}

/* Vendor Onboarding Banner */
.vendor-onboarding-banner {
      background: linear-gradient(135deg, rgba(212,175,55,0.15), rgba(212,175,55,0.05));
      border: 1px solid rgba(212,175,55,0.3);
      border-radius: 12px;
      padding: 20px 24px;
      margin-bottom: 24px;
      display: flex;
      align-items: center;
      gap: 16px;
}
.vendor-onboarding-banner .banner-text h3 { margin: 0 0 4px; font-size: 16px; color: var(--text-primary); }
.vendor-onboarding-banner .banner-text p { margin: 0; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.vendor-onboarding-banner .banner-dismiss { background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; padding: 4px 8px; line-height: 1; align-self: flex-start; }
.vendor-onboarding-banner .banner-dismiss:hover { color: var(--text-primary); }
@media (max-width: 600px) {
      .vendor-onboarding-banner { flex-direction: column; text-align: center; padding: 16px; }
}

/* Quick Actions */
.quick-actions {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      gap: 16px;
}

.action-card {
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--border-subtle);
      border-radius: 14px;
      padding: 20px;
      text-decoration: none;
      color: var(--text-primary);
      transition: all 0.3s;
      display: flex;
      align-items: center;
      gap: 16px;
}

.action-card:hover {
      background: rgba(249, 203, 0, 0.1);
      border-color: var(--gold-primary);
      transform: translateY(-2px);
}

/* Highlighted Action Card */
.action-card.action-highlight {
      background: linear-gradient(135deg, rgba(249, 203, 0, 0.15) 0%, rgba(249, 203, 0, 0.08) 100%);
      border-color: var(--gold-primary);
}

.action-card.action-highlight:hover {
      background: linear-gradient(135deg, rgba(249, 203, 0, 0.25) 0%, rgba(249, 203, 0, 0.15) 100%);
      transform: translateY(-3px);
      box-shadow: 0 8px 24px rgba(249, 203, 0, 0.2);
}

.action-icon {
      width: 48px;
      height: 48px;
      border-radius: 12px;
      background: rgba(249, 203, 0, 0.1);
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--gold-primary);
      flex-shrink: 0;
}

.action-icon.action-icon-gold {
      background: var(--gold-primary);
      color: #1a1a2e;
}

.action-icon svg {
      width: 24px;
      height: 24px;
}

.action-text h4 {
      font-size: 14px;
      font-weight: 600;
      margin-bottom: 4px;
}

.action-text p {
      font-size: 12px;
      color: var(--text-muted);
}

/* Stat Cards with icons */
.stat-card {
      position: relative;
}

.stat-card.clickable {
      cursor: pointer;
      transition: all 0.3s ease;
}

.stat-card.clickable:hover {
      transform: translateY(-2px);
      border-color: var(--gold-primary);
      background: rgba(249, 203, 0, 0.08);
}

.stat-icon {
      width: 48px;
      height: 48px;
      border-radius: 12px;
      background: rgba(249, 203, 0, 0.1);
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 12px;
}

.stat-icon svg {
      width: 24px;
      height: 24px;
}

/* Profile Form */
.form-group {
      margin-bottom: 20px;
}

.form-group label {
      display: block;
      font-size: 13px;
      font-weight: 600;
      margin-bottom: 8px;
      color: var(--text-secondary);
      text-transform: uppercase;
      letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
      width: 100%;
      padding: 14px 18px;
      background: var(--dark-surface);
      border: 1px solid var(--border-subtle);
      border-radius: 10px;
      font-size: 15px;
      color: var(--text-primary);
      transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
      outline: none;
      border-color: var(--gold-primary);
      background: var(--dark-elevated);
      box-shadow: 0 0 0 3px rgba(249, 203, 0, 0.1);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
      border-color: var(--error);
}

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

.form-error {
      color: var(--error);
      font-size: 12px;
      margin-top: 6px;
}

.form-hint {
      color: var(--text-muted);
      font-size: 12px;
      margin-top: 6px;
}

.form-group input::placeholder {
      color: var(--text-muted);
}

/* Fix select dropdowns to be visible and match input styling */
select,
.form-section select,
.estimate-line-item select,
#create-estimate-modal select {
      background: var(--dark-elevated) !important;
      color: var(--text-primary) !important;
      border: 1px solid var(--border-subtle) !important;
      border-radius: 10px !important;
      padding: 14px 18px !important;
      font-size: 15px !important;
      cursor: pointer;
      -webkit-appearance: none;
      -moz-appearance: none;
      appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23f9cb00' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E") !important;
      background-repeat: no-repeat !important;
      background-position: right 14px center !important;
      padding-right: 40px !important;
      transition: all 0.3s;
}

select option,
.form-section select option,
#create-estimate-modal select option {
      background: #1e1e2d !important;
      color: #ffffff !important;
      padding: 12px !important;
}

select:focus {
      outline: none;
      border-color: var(--gold-primary) !important;
      box-shadow: 0 0 0 2px rgba(249, 203, 0, 0.2);
}

/* Estimate form specific input styling */
#create-estimate-modal input,
#create-estimate-modal textarea {
      background: var(--dark-elevated) !important;
      border: 1px solid var(--border-subtle) !important;
      color: var(--text-primary) !important;
}

#create-estimate-modal input:focus,
#create-estimate-modal textarea:focus {
      border-color: var(--gold-primary) !important;
      box-shadow: 0 0 0 2px rgba(249, 203, 0, 0.2);
}

.form-row {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 20px;
}

.form-row.cols-3 {
      grid-template-columns: repeat(3, 1fr);
}

.form-row.cols-4 {
      grid-template-columns: repeat(4, 1fr);
}

.form-inline {
      display: flex;
      align-items: flex-end;
      gap: 12px;
}

.form-inline .form-group {
      flex: 1;
      margin-bottom: 0;
}

.form-inline .btn-modern {
      flex-shrink: 0;
}

/* Required field indicator */
.form-group label.required::after {
      content: ' *';
      color: var(--error);
}

/* Saved Floors Grid */
.saved-floors-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 20px;
}

.saved-floor-item {
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
      overflow: hidden;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.saved-floor-item:hover {
      transform: translateY(-4px);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.saved-floor-image {
      width: 100%;
      height: 140px;
      object-fit: cover;
}

.saved-floor-content {
      padding: 12px;
}

.saved-floor-title {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-primary);
      margin-bottom: 4px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
}

.saved-floor-material {
      font-size: 11px;
      color: var(--primary);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 8px;
}

.saved-floor-specs {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 12px;
}

.saved-floor-spec {
      font-size: 11px;
      color: var(--text-secondary);
      background: rgba(255, 255, 255, 0.05);
      padding: 3px 8px;
      border-radius: 4px;
}

.saved-floor-actions {
      display: flex;
      gap: 8px;
}

.saved-floor-actions a,
.saved-floor-actions button {
      flex: 1;
      padding: 8px 12px;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 600;
      text-align: center;
      text-decoration: none;
      cursor: pointer;
      transition: all 0.2s ease;
}

.saved-floor-view {
      background: var(--primary);
      color: var(--dark);
}

.saved-floor-remove {
      background: transparent;
      border: 1px solid var(--border-subtle);
      color: var(--text-secondary);
}

.saved-floor-remove:hover {
      background: rgba(239, 68, 68, 0.1);
      border-color: #ef4444;
      color: #ef4444;
}

/* My Designs Grid */
.designs-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 20px;
}

.design-card {
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
      overflow: hidden;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.design-card:hover {
      transform: translateY(-4px);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.design-preview {
      width: 100%;
      height: 160px;
      background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
}

.design-preview svg {
      width: 48px;
      height: 48px;
      color: var(--text-muted);
      opacity: 0.5;
}

.design-preview-badge {
      position: absolute;
      top: 10px;
      right: 10px;
      padding: 4px 10px;
      border-radius: 20px;
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
}

.design-preview-badge.shared {
      background: rgba(34, 197, 94, 0.2);
      color: #22c55e;
}

.design-preview-badge.private {
      background: rgba(156, 163, 175, 0.2);
      color: #9ca3af;
}

.design-message-badge {
      position: absolute;
      top: 10px;
      left: 10px;
      min-width: 22px;
      height: 22px;
      padding: 0 6px;
      background: linear-gradient(135deg, #ef4444, #dc2626);
      border-radius: 11px;
      font-size: 11px;
      font-weight: 700;
      color: white;
      display: flex;
      align-items: center;
      justify-content: center;
      animation: pulse 2s infinite;
}

.design-customer {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 13px;
      color: var(--gold-primary);
      margin-bottom: 8px;
      padding: 6px 10px;
      background: rgba(249, 203, 0, 0.1);
      border-radius: 6px;
      border-left: 3px solid var(--gold-primary);
}

.design-customer svg {
      flex-shrink: 0;
}

.design-customer span {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
}

.design-btn-messages {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(239, 68, 68, 0.15) !important;
      color: #ef4444 !important;
      border-color: rgba(239, 68, 68, 0.3) !important;
}

.design-btn-messages .btn-badge {
      position: absolute;
      top: -6px;
      right: -6px;
      min-width: 16px;
      height: 16px;
      padding: 0 4px;
      background: #ef4444;
      border-radius: 8px;
      font-size: 10px;
      font-weight: 700;
      color: white;
}

.design-content {
      padding: 16px;
}

.design-title {
      font-size: 16px;
      font-weight: 600;
      color: var(--text-primary);
      margin-bottom: 4px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
}

.design-meta {
      display: flex;
      gap: 12px;
      font-size: 12px;
      color: var(--text-muted);
      margin-bottom: 12px;
}

.design-meta span {
      display: flex;
      align-items: center;
      gap: 4px;
}

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

.design-actions button,
.design-actions a {
      flex: 1;
      padding: 10px 12px;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 600;
      text-align: center;
      text-decoration: none;
      cursor: pointer;
      transition: all 0.2s ease;
      border: none;
}

.design-btn-open {
      background: var(--primary);
      color: var(--dark);
}

.design-btn-open:hover {
      background: var(--primary-hover);
}

.design-btn-share {
      background: transparent;
      border: 1px solid var(--primary) !important;
      color: var(--primary);
}

.design-btn-share:hover {
      background: rgba(249, 203, 0, 0.1);
}

.design-btn-delete {
      background: transparent;
      border: 1px solid var(--border-subtle) !important;
      color: var(--text-secondary);
      flex: 0 0 auto;
      padding: 10px 12px;
}

.design-btn-delete:hover {
      background: rgba(239, 68, 68, 0.1);
      border-color: #ef4444 !important;
      color: #ef4444;
}

/* Quote Request Modal */
.quote-modal {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.8);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      padding: 20px;
}

.quote-modal-content {
      background: var(--dark-elevated);
      border-radius: 16px;
      max-width: 500px;
      width: 100%;
      max-height: 80vh;
      overflow-y: auto;
}

.quote-modal-header {
      padding: 20px;
      border-bottom: 1px solid var(--border-subtle);
      display: flex;
      justify-content: space-between;
      align-items: center;
}

.quote-modal-body {
      padding: 20px;
}

.quote-items-list {
      margin-bottom: 20px;
}

.quote-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px;
      background: rgba(255, 255, 255, 0.03);
      border-radius: 8px;
      margin-bottom: 8px;
}

.quote-item img {
      width: 60px;
      height: 60px;
      object-fit: cover;
      border-radius: 6px;
}

.quote-item-info {
      flex: 1;
}

.quote-item-title {
      font-size: 14px;
      font-weight: 600;
}

.quote-item-material {
      font-size: 12px;
      color: var(--text-secondary);
}

/* Leads Table */
.table-container {
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 16px;
      overflow: hidden;
}

.table-header {
      padding: 20px 24px;
      border-bottom: 1px solid var(--border-subtle);
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 16px;
}

.table-title {
      font-size: 16px;
      font-weight: 700;
}

.table-filters {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
}

.filter-btn {
      padding: 8px 16px;
      border-radius: 20px;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s;
      border: 1px solid var(--border-subtle);
      background: transparent;
      color: var(--text-secondary);
}

.filter-btn:hover {
      border-color: var(--border-light);
      color: var(--text-primary);
}

.filter-btn.active {
      background: var(--gold-primary);
      color: var(--dark-primary);
      border-color: var(--gold-primary);
}

.tab-btn {
      padding: 10px 20px;
      background: transparent;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 14px;
      font-weight: 500;
      border-bottom: 2px solid transparent;
      transition: all 0.2s ease;
}

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

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

.search-box {
      display: flex;
      align-items: center;
      gap: 8px;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid var(--border-subtle);
      border-radius: 8px;
      padding: 8px 16px;
}

.search-box input {
      background: transparent;
      border: none;
      outline: none;
      color: var(--text-primary);
      font-size: 14px;
      width: 200px;
}

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

.search-box svg {
      width: 18px;
      height: 18px;
      color: var(--text-muted);
}

table {
      width: 100%;
      border-collapse: collapse;
}

th {
      text-align: left;
      padding: 16px 24px;
      font-size: 12px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--text-muted);
      background: rgba(255, 255, 255, 0.02);
      border-bottom: 1px solid var(--border-subtle);
}

td {
      padding: 16px 24px;
      font-size: 14px;
      border-bottom: 1px solid var(--border-subtle);
      vertical-align: middle;
      transition: background-color 0.15s ease;
}

tr:hover td {
      background: rgba(255, 255, 255, 0.03);
}

tr.clickable {
      cursor: pointer;
}

tr.clickable:hover td {
      background: rgba(249, 203, 0, 0.05);
}

tr.selected {
      background: rgba(249, 203, 0, 0.05);
}

tr.selected td {
      background: rgba(249, 203, 0, 0.1);
}

tr:last-child td {
      border-bottom: none;
}

.lead-name {
      font-weight: 600;
      color: var(--text-primary);
}

.lead-email {
      font-size: 13px;
      color: var(--text-muted);
}

.lead-project {
      display: inline-block;
      padding: 4px 10px;
      background: rgba(255, 255, 255, 0.05);
      border-radius: 6px;
      font-size: 12px;
      color: var(--text-secondary);
}

.status-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 6px 14px;
      border-radius: 20px;
      font-size: 11px;
      font-weight: 600;
      text-transform: capitalize;
      white-space: nowrap;
      letter-spacing: 0.3px;
      line-height: 1.2;
      vertical-align: middle;
}

.status-badge::before {
      content: '';
      width: 6px;
      height: 6px;
      border-radius: 50%;
      flex-shrink: 0;
}

/* Job Status Styles */
.status-badge.job-new { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.status-badge.job-new::before { background: #f59e0b; }

.status-badge.job-reviewing { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.status-badge.job-reviewing::before { background: #f59e0b; }

.status-badge.job-material_ordered { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }
.status-badge.job-material_ordered::before { background: #06b6d4; }

.status-badge.job-material_received { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }
.status-badge.job-material_received::before { background: #06b6d4; }

.status-badge.job-assigned { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.status-badge.job-assigned::before { background: #3b82f6; }

.status-badge.job-scheduled { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.status-badge.job-scheduled::before { background: #3b82f6; }

.status-badge.job-measured { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.status-badge.job-measured::before { background: #8b5cf6; }

.status-badge.job-in_production { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.status-badge.job-in_production::before { background: #8b5cf6; }

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

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

.status-badge.job-completed { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.status-badge.job-completed::before { background: #22c55e; }

.status-badge.job-on_hold { background: rgba(107, 114, 128, 0.15); color: #6b7280; }
.status-badge.job-on_hold::before { background: #6b7280; }

.status-badge.job-cancelled { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.status-badge.job-cancelled::before { background: #ef4444; }

.status-new { background: rgba(77, 166, 255, 0.15); color: var(--info); }
.status-new::before { background: var(--info); }

.status-contacted { background: rgba(255, 184, 77, 0.15); color: var(--warning); }
.status-contacted::before { background: var(--warning); }

.status-qualified { background: rgba(249, 203, 0, 0.15); color: var(--gold-primary); }
.status-qualified::before { background: var(--gold-primary); }

.status-quoted { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.status-quoted::before { background: #a855f7; }

.status-won { background: rgba(77, 255, 130, 0.15); color: var(--success); }
.status-won::before { background: var(--success); }

.status-lost { background: rgba(255, 107, 107, 0.15); color: var(--error); }
.status-lost::before { background: var(--error); }

.status-archived { background: rgba(107, 114, 128, 0.15); color: #6b7280; }
.status-archived::before { background: #6b7280; }

/* Estimate statuses */
.status-draft { background: rgba(156, 163, 175, 0.15); color: #9ca3af; }
.status-draft::before { background: #9ca3af; }

.status-sent { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.status-sent::before { background: #3b82f6; }

.status-approved { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.status-approved::before { background: #22c55e; }

.status-rejected { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.status-rejected::before { background: #ef4444; }

.status-converted { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.status-converted::before { background: #a855f7; }

/* Invoice/Payment statuses */
.status-open { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.status-open::before { background: #3b82f6; }

.status-viewed { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.status-viewed::before { background: #8b5cf6; }

.status-paid { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.status-paid::before { background: #22c55e; }

.status-void { background: rgba(107, 114, 128, 0.15); color: #6b7280; }
.status-void::before { background: #6b7280; }

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

.status-overdue { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.status-overdue::before { background: #ef4444; }

.status-refunded { background: rgba(107, 114, 128, 0.15); color: #6b7280; }
.status-refunded::before { background: #6b7280; }

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

.status-fulfilled { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.status-fulfilled::before { background: #22c55e; }

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

.status-partial_fulfillment { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }
.status-partial_fulfillment::before { background: #06b6d4; }

.status-scheduled { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.status-scheduled::before { background: #3b82f6; }

.status-in_progress { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }
.status-in_progress::before { background: #06b6d4; }

.status-completed { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.status-completed::before { background: #22c55e; }

.status-cancelled { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.status-cancelled::before { background: #ef4444; }

.lead-date {
      font-size: 13px;
      color: var(--text-muted);
}

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

.action-btn {
      width: 32px;
      height: 32px;
      border-radius: 6px;
      border: none;
      background: rgba(255, 255, 255, 0.05);
      color: var(--text-muted);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
      text-decoration: none;
}

.action-btn:hover {
      background: rgba(255, 255, 255, 0.1);
      color: var(--text-primary);
}

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

/* Empty State */
.empty-state {
      text-align: center;
      padding: 60px 24px;
      color: var(--text-muted);
      background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.1) 100%);
      border-radius: 12px;
}

.empty-state svg {
      width: 64px;
      height: 64px;
      margin-bottom: 16px;
      opacity: 0.5;
      color: var(--gold-primary);
}

.empty-state h3 {
      font-size: 18px;
      color: var(--text-primary);
      margin-bottom: 8px;
}

.empty-state p {
      font-size: 14px;
      color: var(--text-muted);
      max-width: 320px;
      margin: 0 auto;
      line-height: 1.5;
}

/* Coming Soon */
.coming-soon {
      text-align: center;
      padding: 80px 24px;
}

.coming-soon-icon {
      width: 80px;
      height: 80px;
      margin: 0 auto 24px;
      border-radius: 20px;
      background: rgba(249, 203, 0, 0.1);
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--gold-primary);
}

.coming-soon-icon svg {
      width: 40px;
      height: 40px;
}

.coming-soon h2 {
      font-size: 24px;
      margin-bottom: 12px;
}

.coming-soon p {
      color: var(--text-muted);
      max-width: 400px;
      margin: 0 auto;
}

/* Modal - base styles, visibility controlled by .active class */
.modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.7);
      backdrop-filter: blur(4px);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 10000;
      padding: 20px;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal {
      background: var(--dark-elevated);
      border: 1px solid var(--border-light);
      border-radius: 20px;
      width: 100%;
      max-width: 600px;
      max-height: 90vh;
      overflow-y: auto;
      animation: modalIn 0.3s ease;
}

/* Modal Modern Styles - Base (Desktop) */
.modal-modern-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.7);
      backdrop-filter: blur(4px);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 10000;
      padding: 20px;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal-modern {
      background: var(--dark-elevated);
      border: 1px solid var(--border-light);
      border-radius: 20px;
      width: 100%;
      max-width: 500px;
      max-height: 90vh;
      overflow-y: auto;
      animation: modalIn 0.3s ease;
      display: flex;
      flex-direction: column;
}

.modal-modern-header {
      padding: 20px 24px;
      border-bottom: 1px solid var(--border-subtle);
      display: flex;
      align-items: center;
      justify-content: space-between;
      background: var(--dark-surface);
      position: sticky;
      top: 0;
      z-index: 5;
}

.modal-modern-header h2 {
      font-size: 18px;
      font-weight: 700;
      margin: 0;
}

.modal-modern-body {
      padding: 20px 24px;
      overflow-y: auto;
      flex: 1;
      min-height: 300px;
      max-height: 50vh;
}

.modal-modern-footer {
      padding: 16px 24px;
      border-top: 1px solid var(--border-subtle);
      display: flex;
      gap: 12px;
      justify-content: flex-end;
      background: var(--dark-surface);
      position: sticky;
      bottom: 0;
      z-index: 5;
}

.modal-drag-handle {
      display: none;
}

.detail-section {
      margin-bottom: 8px;
}

.detail-section-title {
      font-size: 12px;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 12px;
}

@keyframes modalIn {
      from { opacity: 0; transform: scale(0.95); }
      to { opacity: 1; transform: scale(1); }
}

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

.modal-title {
      font-size: 18px;
      font-weight: 700;
}

.modal-close {
      width: 36px;
      height: 36px;
      border-radius: 8px;
      border: none;
      background: rgba(255, 255, 255, 0.05);
      color: var(--text-muted);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
}

.modal-close:hover {
      background: rgba(255, 107, 107, 0.1);
      color: var(--error);
}

.modal-body {
      padding: 24px;
}

.detail-row {
      display: flex;
      padding: 12px 0;
      border-bottom: 1px solid var(--border-subtle);
}

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

.detail-label {
      width: 120px;
      font-size: 13px;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
}

.detail-value {
      flex: 1;
      font-size: 14px;
      color: var(--text-primary);
}

.modal-footer {
      padding: 16px 24px;
      border-top: 1px solid var(--border-subtle);
      display: flex;
      gap: 12px;
      justify-content: flex-end;
      flex-wrap: wrap;
}

/* Invoice Template Selector */
.template-selector {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 12px;
}

.template-option {
      cursor: pointer;
}

.template-option input {
      display: none;
}

.template-preview {
      border: 2px solid var(--border-subtle);
      border-radius: 12px;
      padding: 12px;
      text-align: center;
      transition: all 0.3s;
      background: var(--dark-surface);
}

.template-option input:checked + .template-preview {
      border-color: var(--gold-primary);
      background: rgba(249, 203, 0, 0.1);
}

.template-preview:hover {
      border-color: var(--border-light);
}

.template-header-preview {
      height: 24px;
      border-radius: 4px;
      margin-bottom: 8px;
}

.template-body-preview {
      height: 40px;
      border-radius: 4px;
      margin-bottom: 8px;
}

.classic-preview .template-header-preview {
      background: linear-gradient(135deg, #1a1a2e, #16213e);
}
.classic-preview .template-body-preview {
      background: #f4f4f4;
}

.modern-preview .template-header-preview {
      background: linear-gradient(90deg, #000, #333);
}
.modern-preview .template-body-preview {
      background: #ffffff;
      border: 1px solid #eee;
}

.premium-preview .template-header-preview {
      background: linear-gradient(135deg, #0a0a12, #12121a);
}
.premium-preview .template-body-preview {
      background: linear-gradient(135deg, #f9cb00, #d4a800);
}

.template-name {
      display: block;
      font-weight: 600;
      font-size: 13px;
      color: var(--text-primary);
      margin-bottom: 2px;
}

.template-desc {
      display: block;
      font-size: 11px;
      color: var(--text-muted);
}

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

/* Template Preview Modal */
.template-tabs {
      display: flex;
      background: var(--dark-surface);
      border-bottom: 1px solid var(--border-subtle);
}

.template-tab {
      flex: 1;
      padding: 20px;
      background: transparent;
      border: none;
      cursor: pointer;
      text-align: center;
      transition: all 0.3s;
      border-bottom: 3px solid transparent;
}

.template-tab:hover {
      background: rgba(255, 255, 255, 0.05);
}

.template-tab.active {
      background: rgba(249, 203, 0, 0.1);
      border-bottom-color: var(--gold-primary);
}

.template-tab .tab-icon {
      display: block;
      font-size: 24px;
      margin-bottom: 8px;
}

.template-tab .tab-label {
      display: block;
      font-weight: 700;
      font-size: 14px;
      color: var(--text-primary);
      margin-bottom: 4px;
}

.template-tab .tab-desc {
      display: block;
      font-size: 12px;
      color: var(--text-muted);
}

.template-tab.active .tab-label {
      color: var(--gold-primary);
}

.template-preview-container {
      background: #888;
      height: 500px;
      overflow: hidden;
}

.template-preview-frame {
      width: 100%;
      height: 100%;
}

.template-preview-frame iframe {
      width: 100%;
      height: 100%;
      border: none;
      background: #f4f4f4;
}

@media (max-width: 768px) {
      .template-tabs {
        flex-direction: column;
      }

      .template-tab {
        padding: 12px;
        display: flex;
        align-items: center;
        gap: 12px;
        text-align: left;
      }

      .template-tab .tab-icon {
        margin-bottom: 0;
        font-size: 20px;
      }

      .template-preview-container {
        height: 400px;
      }
}

.status-select {
      padding: 8px 16px;
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid var(--border-subtle);
      color: var(--text-primary);
      font-size: 14px;
      cursor: pointer;
}

.status-select:focus {
      outline: none;
      border-color: var(--gold-primary);
}

/* Auth Screens */
.auth-screen {
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--dark-deep);
      padding: 20px;
}

.auth-card {
      background: var(--dark-elevated);
      border: 1px solid var(--border-light);
      border-radius: 24px;
      padding: 48px 40px;
      width: 100%;
      max-width: 440px;
}

.auth-header {
      text-align: center;
      margin-bottom: 32px;
}

.auth-logo {
      width: 64px;
      height: 64px;
      background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
      border-radius: 16px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 20px;
      font-weight: 800;
      font-size: 24px;
      color: var(--dark-primary);
}

.auth-header h1 {
      font-size: 24px;
      margin-bottom: 8px;
}

.auth-header p {
      color: var(--text-muted);
      font-size: 14px;
}

.auth-tabs {
      display: flex;
      background: rgba(255, 255, 255, 0.05);
      border-radius: 10px;
      padding: 4px;
      margin-bottom: 24px;
}

.auth-tab {
      flex: 1;
      padding: 10px;
      text-align: center;
      background: transparent;
      border: none;
      border-radius: 6px;
      cursor: pointer;
      font-weight: 600;
      font-size: 14px;
      color: var(--text-muted);
      transition: all 0.2s;
}

.auth-tab.active {
      background: var(--gold-primary);
      color: var(--dark-primary);
}

.auth-message {
      padding: 12px 16px;
      border-radius: 10px;
      margin-bottom: 20px;
      font-size: 14px;
      display: none;
}

.auth-message.visible {
      display: block;
}

.auth-message.error {
      background: rgba(255, 107, 107, 0.1);
      border: 1px solid rgba(255, 107, 107, 0.3);
      color: var(--error);
}

.auth-message.success {
      background: rgba(77, 255, 130, 0.1);
      border: 1px solid rgba(77, 255, 130, 0.3);
      color: var(--success);
}

.auth-form {
      display: none;
}

.auth-form.active {
      display: block;
}

.auth-submit {
      width: 100%;
      padding: 14px;
      background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
      border: none;
      border-radius: 10px;
      font-size: 16px;
      font-weight: 700;
      color: var(--dark-primary);
      cursor: pointer;
      transition: all 0.3s;
}

.auth-submit:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 20px rgba(249, 203, 0, 0.3);
}

.auth-submit:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      transform: none;
}

.auth-divider {
      display: flex;
      align-items: center;
      margin: 20px 0;
      color: var(--text-muted);
      font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
      content: '';
      flex: 1;
      height: 1px;
      background: var(--border-subtle);
}

.auth-divider span {
      padding: 0 12px;
}

.btn-google {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      padding: 12px 16px;
      background: #fff;
      border: 1px solid #dadce0;
      border-radius: 10px;
      font-size: 15px;
      font-weight: 500;
      color: #3c4043;
      cursor: pointer;
      transition: all 0.2s;
}

.btn-google:hover {
      background: #f8f9fa;
      border-color: #c6c6c6;
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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

.btn-google svg {
      flex-shrink: 0;
}

/* Signup Steps */
.signup-step {
      animation: fadeIn 0.3s ease;
}

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

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

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

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

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

.step-header {
      text-align: center;
      margin-bottom: 24px;
}

.step-title {
      font-size: 20px;
      font-weight: 700;
      color: var(--text-primary);
      margin: 0 0 8px 0;
}

.step-subtitle {
      font-size: 14px;
      color: var(--text-muted);
      margin: 0;
}

.step-back {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: transparent;
      border: none;
      color: var(--text-secondary);
      font-size: 14px;
      cursor: pointer;
      padding: 8px 0;
      margin-bottom: 16px;
      transition: color 0.2s;
}

.step-back:hover {
      color: var(--gold-primary);
}

.step-back svg {
      color: inherit;
}

/* Account Type Cards */
.account-type-grid {
      display: flex;
      flex-direction: column;
      gap: 16px;
      margin-bottom: 24px;
}

.account-type-card {
      position: relative;
      background: var(--dark-elevated);
      border: 2px solid var(--border-subtle);
      border-radius: 16px;
      padding: 20px;
      cursor: pointer;
      transition: all 0.3s ease;
}

.account-type-card:hover {
      border-color: var(--border-light);
      transform: translateY(-2px);
}

.account-type-card.selected {
      border-color: var(--gold-primary);
      background: rgba(249, 203, 0, 0.05);
}

.account-type-card.selected::before {
      content: '';
      position: absolute;
      top: 12px;
      right: 70px;
      width: 24px;
      height: 24px;
      background: var(--gold-primary);
      border-radius: 50%;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%231a1a2e'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
      background-size: 16px;
      background-position: center;
      background-repeat: no-repeat;
}

.type-icon {
      width: 48px;
      height: 48px;
      background: rgba(255, 255, 255, 0.05);
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 12px;
}

.type-icon svg {
      width: 28px;
      height: 28px;
      color: var(--text-secondary);
}

.type-icon.pro {
      background: rgba(249, 203, 0, 0.1);
}

.type-icon.pro svg {
      color: var(--gold-primary);
}

.type-name {
      font-size: 18px;
      font-weight: 700;
      color: var(--text-primary);
      margin-bottom: 6px;
}

.type-desc {
      font-size: 13px;
      color: var(--text-muted);
      margin-bottom: 16px;
      line-height: 1.4;
}

.type-features {
      list-style: none;
      padding: 0;
      margin: 0;
      display: flex;
      flex-direction: column;
      gap: 8px;
}

.type-features li {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      color: var(--text-secondary);
}

.type-features .check-icon {
      width: 16px;
      height: 16px;
      flex-shrink: 0;
      color: var(--success);
}

.type-features .check-icon.gold {
      color: var(--gold-primary);
}

.type-badge {
      position: absolute;
      top: 16px;
      right: 16px;
      padding: 4px 10px;
      border-radius: 20px;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
}

.type-badge.free {
      background: rgba(77, 255, 130, 0.15);
      color: var(--success);
}

.type-badge.pro {
      background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
      color: var(--dark-primary);
}

/* Signup Terms */
.signup-terms {
      margin-bottom: 20px;
}

.checkbox-label {
      display: flex !important;
      align-items: center !important;
      gap: 12px !important;
      cursor: pointer;
      font-size: 14px !important;
      color: var(--text-secondary) !important;
      line-height: 1.5;
      text-transform: none !important;
      margin-bottom: 0 !important;
}

.checkbox-label input[type="checkbox"] {
      width: 20px !important;
      height: 20px !important;
      padding: 0 !important;
      margin: 0 !important;
      accent-color: var(--gold-primary);
      flex-shrink: 0;
      cursor: pointer;
}

.checkbox-label span {
      text-transform: none !important;
      font-weight: 400 !important;
}

.checkbox-label a {
      color: var(--gold-primary);
      text-decoration: none;
}

.checkbox-label a:hover {
      text-decoration: underline;
}

/* Pro Note */
.pro-note {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      background: rgba(249, 203, 0, 0.1);
      border: 1px solid rgba(249, 203, 0, 0.2);
      border-radius: 10px;
      padding: 12px 14px;
      margin-top: 16px;
      font-size: 12px;
      color: var(--text-secondary);
      line-height: 1.5;
}

.pro-note svg {
      color: var(--gold-primary);
      flex-shrink: 0;
      margin-top: 1px;
}

/* Responsive adjustments */
@media (min-width: 600px) {
      .account-type-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
      }

      .account-type-card {
        padding: 24px 20px;
      }
}

/* Loading */
.loading-screen {
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      gap: 20px;
}

.spinner {
      width: 48px;
      height: 48px;
      border: 3px solid var(--border-subtle);
      border-top-color: var(--gold-primary);
      border-radius: 50%;
      animation: spin 1s linear infinite;
}

.spin {
      animation: spin 1s linear infinite;
}

.spinner-modern {
      width: 24px;
      height: 24px;
      border: 2px solid var(--border-subtle);
      border-top-color: var(--gold-primary);
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
}

@keyframes slideOut {
      from { transform: translateX(0); opacity: 1; }
      to { transform: translateX(100%); opacity: 0; }
}

/* Product Grid */
.products-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 20px;
}

.product-card {
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 16px;
      overflow: hidden;
      transition: all 0.3s;
}

.product-card:hover {
      border-color: var(--border-light);
      transform: translateY(-2px);
}

.product-image {
      height: 180px;
      background: rgba(255, 255, 255, 0.02);
      position: relative;
      overflow: hidden;
}

.product-image img {
      width: 100%;
      height: 100%;
      object-fit: cover;
}

.product-placeholder {
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
}

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

.product-info {
      padding: 16px;
}

.product-status {
      display: inline-block;
      padding: 4px 10px;
      border-radius: 12px;
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 8px;
}

.product-status.status-active {
      background: rgba(77, 255, 130, 0.15);
      color: var(--success);
}

.product-status.status-draft {
      background: rgba(255, 255, 255, 0.1);
      color: var(--text-muted);
}

.product-status.status-sold {
      background: rgba(168, 85, 247, 0.15);
      color: #a855f7;
}

.product-name {
      font-size: 16px;
      font-weight: 600;
      margin-bottom: 4px;
      color: var(--text-primary);
}

.product-category {
      font-size: 13px;
      color: var(--text-muted);
      margin-bottom: 8px;
}

.product-price {
      font-size: 20px;
      font-weight: 700;
      color: var(--gold-primary);
}

.product-dims {
      font-size: 12px;
      color: var(--text-muted);
      margin-top: 4px;
}

.product-actions {
      display: flex;
      gap: 8px;
      padding: 12px 16px;
      border-top: 1px solid var(--border-subtle);
      background: rgba(255, 255, 255, 0.02);
}

/* Calendar Styles */
.calendar-container {
      background: var(--dark-elevated);
      border-radius: 0 0 12px 12px;
      overflow: visible;
}

.calendar-header-row {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      background: var(--dark-surface);
      border-bottom: 1px solid var(--border-subtle);
}

.calendar-header-cell {
      padding: 16px 8px;
      text-align: center;
      font-weight: 600;
      font-size: 12px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--text-muted);
}

.calendar-grid {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
      min-height: 120px;
      padding: 10px;
      border-right: 1px solid rgba(255, 255, 255, 0.08);
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      background: linear-gradient(180deg, rgba(30, 30, 45, 0.8) 0%, rgba(26, 26, 46, 0.9) 100%);
      transition: all 0.2s;
      cursor: pointer;
      position: relative;
}

.calendar-day:nth-child(7n) {
      border-right: none;
}

.calendar-day:hover {
      background: linear-gradient(180deg, rgba(40, 40, 60, 0.9) 0%, rgba(35, 35, 55, 1) 100%);
      box-shadow: inset 0 0 0 1px rgba(249, 203, 0, 0.2);
}

.calendar-day.other-month {
      background: rgba(15, 15, 25, 0.6);
}

.calendar-day.other-month .calendar-day-number {
      opacity: 0.4;
}

.calendar-day.today {
      background: linear-gradient(180deg, rgba(249, 203, 0, 0.12) 0%, rgba(249, 203, 0, 0.06) 100%);
      box-shadow: inset 0 0 0 2px rgba(249, 203, 0, 0.3);
}

.calendar-day.today .calendar-day-number {
      background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
      color: var(--dark-primary);
      border-radius: 50%;
      width: 30px;
      height: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      box-shadow: 0 2px 8px rgba(249, 203, 0, 0.4);
}

.calendar-day-number {
      font-weight: 600;
      font-size: 14px;
      margin-bottom: 8px;
      color: var(--text-primary);
}

.calendar-events {
      display: flex;
      flex-direction: column;
      gap: 4px;
}

.calendar-event {
      position: relative;
      padding: 4px 8px;
      border-radius: 4px;
      font-size: 11px;
      font-weight: 500;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      cursor: grab;
      user-select: none;
      transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.calendar-event:hover {
      transform: translateX(2px);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.calendar-event:active {
      cursor: grabbing;
}

.calendar-event.job {
      background: linear-gradient(135deg, rgba(59, 130, 246, 0.35) 0%, rgba(59, 130, 246, 0.2) 100%);
      color: #93c5fd;
      border-left: 3px solid #3b82f6;
      box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.3);
}

.calendar-event.install {
      background: linear-gradient(135deg, rgba(16, 185, 129, 0.35) 0%, rgba(16, 185, 129, 0.2) 100%);
      color: #6ee7b7;
      border-left: 3px solid #10b981;
      box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.3);
}

.calendar-event.measure {
      background: linear-gradient(135deg, rgba(245, 158, 11, 0.35) 0%, rgba(245, 158, 11, 0.2) 100%);
      color: #fcd34d;
      border-left: 3px solid #f59e0b;
      box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.3);
}

.calendar-event.production {
      background: linear-gradient(135deg, rgba(139, 92, 246, 0.35) 0%, rgba(139, 92, 246, 0.2) 100%);
      color: #c4b5fd;
      border-left: 3px solid #8b5cf6;
      box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.3);
}

.calendar-event.appointment {
      background: linear-gradient(135deg, rgba(249, 203, 0, 0.35) 0%, rgba(249, 203, 0, 0.2) 100%);
      color: #fde047;
      border-left: 3px solid #f9cb00;
      box-shadow: inset 0 0 0 1px rgba(249, 203, 0, 0.3);
}

.calendar-event.consultation {
      background: linear-gradient(135deg, rgba(99, 102, 241, 0.35) 0%, rgba(99, 102, 241, 0.2) 100%);
      color: #a5b4fc;
      border-left: 3px solid #6366f1;
      box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.3);
}

.calendar-event.followup {
      background: linear-gradient(135deg, rgba(236, 72, 153, 0.35) 0%, rgba(236, 72, 153, 0.2) 100%);
      color: #f9a8d4;
      border-left: 3px solid #ec4899;
      box-shadow: inset 0 0 0 1px rgba(236, 72, 153, 0.3);
}

.calendar-event.delivery {
      background: linear-gradient(135deg, rgba(6, 182, 212, 0.35) 0%, rgba(6, 182, 212, 0.2) 100%);
      color: #67e8f9;
      border-left: 3px solid #06b6d4;
      box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.3);
}

.calendar-event.other {
      background: linear-gradient(135deg, rgba(107, 114, 128, 0.35) 0%, rgba(107, 114, 128, 0.2) 100%);
      color: #d1d5db;
      border-left: 3px solid #6b7280;
      box-shadow: inset 0 0 0 1px rgba(107, 114, 128, 0.3);
}

/* Calendar Drag & Drop Styles */
.calendar-event {
      will-change: transform, opacity;
}

.calendar-event.dragging {
      opacity: 0.5;
      transform: scale(0.95);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
      z-index: 1000;
      pointer-events: none;
}

.calendar-day {
      transition: background-color 0.1s ease-out, border-color 0.1s ease-out;
      will-change: background-color, border-color;
}

.calendar-day.drop-target-ready {
      background: rgba(249, 203, 0, 0.03);
}

.calendar-day.drag-over {
      background: rgba(249, 203, 0, 0.12) !important;
      border: 2px dashed var(--gold-primary) !important;
      border-radius: 6px;
      transform: scale(1.01);
}

.calendar-day.drag-over .calendar-day-number {
      color: var(--gold-primary);
      font-weight: 700;
}

/* Ensure child elements don't intercept drop events during drag */
.calendar-day.drop-target-ready > *,
.calendar-day.drag-over > * {
      pointer-events: none;
}

/* Ensure calendar allows drag and drop - override mobile styles during drag */
body.dragging-active .calendar-container,
body.dragging-active .calendar-grid,
body.dragging-active .card:has(.calendar-grid) {
      overflow: visible !important;
}

/* Quick Add Toolbar */
.quick-add-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
      gap: 10px;
}

.quick-add-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 10px 14px;
      border-radius: 6px;
      cursor: grab;
      user-select: none;
      font-size: 13px;
      font-weight: 500;
      color: var(--text-primary);
      background: color-mix(in srgb, var(--item-color) 15%, transparent);
      border-left: 3px solid var(--item-color);
      transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
      will-change: transform;
}

.quick-add-item i {
      font-size: 14px;
      color: var(--item-color);
      width: 18px;
      text-align: center;
}

.quick-add-item:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
      background: color-mix(in srgb, var(--item-color) 22%, transparent);
}

.quick-add-item:active,
.quick-add-item.dragging {
      cursor: grabbing;
      transform: scale(0.98);
      opacity: 0.7;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Smooth drag ghost */
.quick-add-item[draggable="true"] {
      -webkit-user-drag: element;
}

/* Fix: Allow drag overflow for Quick Add container */
.card:has(.quick-add-grid) {
      overflow: visible;
}

/* Also fix calendar event dragging */
.card:has(.calendar-grid),
.calendar-grid {
      overflow: visible;
}

.calendar-event-dot {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      display: inline-block;
}

/* Context Menu Styles */
.context-menu {
      position: fixed;
      z-index: 10000;
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
      padding: 8px 0;
      min-width: 200px;
      max-width: 280px;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
      display: none;
}

.context-menu.visible {
      display: block;
}

.context-menu-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 9999;
      background: transparent;
}

.context-menu-header {
      padding: 12px 16px;
      border-bottom: 1px solid var(--border-subtle);
      margin-bottom: 8px;
}

.context-menu-header .title {
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--text-muted);
}

.context-menu-header .subtitle {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-primary);
      margin-top: 4px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
}

.context-menu-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 16px;
      font-size: 13px;
      color: var(--text-primary);
      background: none;
      border: none;
      width: 100%;
      text-align: left;
      cursor: pointer;
      transition: background 0.15s;
}

.context-menu-item:hover {
      background: rgba(255, 255, 255, 0.05);
}

.context-menu-item i {
      width: 18px;
      font-size: 14px;
      color: var(--text-secondary);
      text-align: center;
}

.context-menu-item svg {
      width: 16px;
      height: 16px;
      color: var(--text-secondary);
}

.context-menu-item.primary {
      color: var(--gold-primary);
}

.context-menu-item.primary i,
.context-menu-item.primary svg {
      color: var(--gold-primary);
}

.context-menu-item.success {
      color: #10b981;
}

.context-menu-item.success i,
.context-menu-item.success svg {
      color: #10b981;
}

.context-menu-item.warning {
      color: #f59e0b;
}

.context-menu-item.warning i,
.context-menu-item.warning svg {
      color: #f59e0b;
}

.context-menu-item.danger {
      color: #ef4444;
}

.context-menu-item.danger i,
.context-menu-item.danger svg {
      color: #ef4444;
}

.context-menu-divider {
      height: 1px;
      background: var(--border-subtle);
      margin: 8px 0;
}

.context-menu-item.has-submenu {
      position: relative;
}

.context-submenu {
      display: none;
      position: absolute;
      left: 100%;
      top: 0;
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 8px;
      padding: 8px 0;
      min-width: 160px;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.context-menu-item.has-submenu:hover .context-submenu {
      display: block;
}

.context-active {
      background: rgba(249, 203, 0, 0.1) !important;
}

/* Trust Score Badge */
.trust-score-badge {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 12px 20px;
      background: linear-gradient(135deg, var(--dark-elevated) 0%, var(--dark-surface) 100%);
      border: 2px solid var(--border-subtle);
      border-radius: 12px;
      min-width: 80px;
}

.trust-score-badge.verified {
      border-color: var(--gold-primary);
      background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, var(--dark-surface) 100%);
}

.trust-score-value {
      font-size: 28px;
      font-weight: 800;
      color: var(--gold-primary);
      line-height: 1;
}

.trust-score-label {
      font-size: 10px;
      text-transform: uppercase;
      color: var(--text-muted);
      letter-spacing: 0.5px;
      margin-top: 4px;
}

/* Verification Checklist Item */
.verification-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 16px;
      background: var(--dark-elevated);
      border-radius: 8px;
      border: 1px solid var(--border-subtle);
}

.verification-item.completed {
      border-color: rgba(34, 197, 94, 0.3);
      background: rgba(34, 197, 94, 0.05);
}

.verification-item.pending {
      border-color: rgba(245, 158, 11, 0.3);
      background: rgba(245, 158, 11, 0.05);
}

.verification-icon {
      width: 24px;
      height: 24px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
}

.verification-icon.completed {
      background: rgba(34, 197, 94, 0.2);
      color: #22c55e;
}

.verification-icon.pending {
      background: rgba(107, 114, 128, 0.2);
      color: #6b7280;
}

.verification-item-text {
      flex: 1;
}

.verification-item-title {
      font-weight: 500;
      font-size: 13px;
}

.verification-item-subtitle {
      font-size: 11px;
      color: var(--text-muted);
}

.verification-item-points {
      font-size: 11px;
      font-weight: 600;
      color: var(--gold-primary);
}

/* Document Card */
.document-card {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px;
      background: var(--dark-elevated);
      border-radius: 8px;
      border: 1px solid var(--border-subtle);
      margin-bottom: 8px;
}

.document-card .doc-icon {
      width: 40px;
      height: 40px;
      border-radius: 8px;
      background: var(--dark-surface);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
}

.document-card .doc-info {
      flex: 1;
      min-width: 0;
}

.document-card .doc-name {
      font-weight: 500;
      font-size: 13px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
}

.document-card .doc-meta {
      font-size: 11px;
      color: var(--text-muted);
}

.document-card .doc-status {
      padding: 4px 8px;
      border-radius: 12px;
      font-size: 10px;
      font-weight: 600;
}

.document-card .doc-status.approved {
      background: rgba(34, 197, 94, 0.15);
      color: #22c55e;
}

.document-card .doc-status.pending {
      background: rgba(245, 158, 11, 0.15);
      color: #f59e0b;
}

.document-card .doc-status.expired {
      background: rgba(239, 68, 68, 0.15);
      color: #ef4444;
}

.calendar-event-more {
      font-size: 10px;
      color: var(--text-muted);
      padding: 2px 4px;
      cursor: pointer;
}

.calendar-event-more:hover {
      color: var(--gold-primary);
}

/* Upcoming Events List */
.upcoming-event-item {
      display: flex;
      align-items: flex-start;
      gap: 16px;
      padding: 16px;
      border-bottom: 1px solid var(--border-subtle);
      transition: background 0.2s;
      cursor: pointer;
}

.upcoming-event-item:last-child {
      border-bottom: none;
}

.upcoming-event-item:hover {
      background: var(--dark-surface);
}

.upcoming-event-date {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      min-width: 60px;
      padding: 8px 12px;
      background: var(--dark-surface);
      border-radius: 8px;
      border: 1px solid var(--border-subtle);
}

.upcoming-event-date .day {
      font-size: 24px;
      font-weight: 700;
      color: var(--gold-primary);
      line-height: 1;
}

.upcoming-event-date .month {
      font-size: 11px;
      text-transform: uppercase;
      color: var(--text-muted);
      letter-spacing: 0.5px;
}

.upcoming-event-info {
      flex: 1;
}

.upcoming-event-title {
      font-weight: 600;
      margin-bottom: 4px;
}

.upcoming-event-details {
      font-size: 13px;
      color: var(--text-muted);
}

.upcoming-event-type {
      display: inline-block;
      padding: 4px 10px;
      border-radius: 12px;
      font-size: 11px;
      font-weight: 600;
}

/* Wallet Balance Cards */
.wallet-balance-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      gap: 20px;
      margin-bottom: 24px;
}

.balance-card {
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 16px;
      padding: 24px;
      position: relative;
      overflow: hidden;
}

.balance-card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 4px;
}

.balance-card.available::before {
      background: linear-gradient(90deg, var(--success), #2dd4bf);
}

.balance-card.pending::before {
      background: linear-gradient(90deg, var(--warning), #fb923c);
}

.balance-card.total::before {
      background: linear-gradient(90deg, var(--gold-primary), var(--gold-dark));
}

.balance-label {
      font-size: 13px;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 8px;
}

.balance-amount {
      font-size: 32px;
      font-weight: 700;
      color: var(--text-primary);
      margin-bottom: 4px;
}

.balance-card.available .balance-amount {
      color: var(--success);
}

.balance-card.pending .balance-amount {
      color: var(--warning);
}

.balance-card.total .balance-amount {
      color: var(--gold-primary);
}

.balance-sub {
      font-size: 12px;
      color: var(--text-muted);
}

.transaction-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 16px 0;
      border-bottom: 1px solid var(--border-subtle);
}

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

.transaction-info {
      display: flex;
      align-items: center;
      gap: 12px;
}

.transaction-icon {
      width: 40px;
      height: 40px;
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
}

.transaction-icon.income {
      background: rgba(77, 255, 130, 0.15);
      color: var(--success);
}

.transaction-icon.payout {
      background: rgba(77, 166, 255, 0.15);
      color: var(--info);
}

.transaction-icon.fee {
      background: rgba(255, 107, 107, 0.15);
      color: var(--error);
}

.transaction-details h4 {
      font-size: 14px;
      font-weight: 600;
      margin-bottom: 2px;
}

.transaction-details p {
      font-size: 12px;
      color: var(--text-muted);
}

.transaction-amount {
      text-align: right;
}

.transaction-amount .amount {
      font-size: 16px;
      font-weight: 600;
}

.transaction-amount .amount.positive {
      color: var(--success);
}

.transaction-amount .amount.negative {
      color: var(--error);
}

.transaction-amount .date {
      font-size: 11px;
      color: var(--text-muted);
}

/* Fees Grid */
.fees-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 16px;
      margin-bottom: 24px;
}

.fee-item {
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
      padding: 16px;
}

.fee-header {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      color: var(--text-secondary);
      margin-bottom: 8px;
}

.fee-header svg {
      color: var(--gold-primary);
}

.fee-rate {
      font-size: 20px;
      font-weight: 700;
      color: var(--text-primary);
      margin-bottom: 4px;
}

.fee-desc {
      font-size: 12px;
      color: var(--text-muted);
}

.fee-note {
      display: flex;
      gap: 12px;
      padding: 16px;
      background: rgba(249, 203, 0, 0.05);
      border: 1px solid rgba(249, 203, 0, 0.2);
      border-radius: 12px;
      font-size: 13px;
      color: var(--text-secondary);
      line-height: 1.5;
}

.fee-note svg {
      flex-shrink: 0;
      color: var(--gold-primary);
      margin-top: 2px;
}

.fee-note strong {
      color: var(--text-primary);
}

/* Responsive */
@media (max-width: 991px) {
      .sidebar {
        transform: translateX(-100%);
        top: var(--unified-nav-height);
        width: 85%;
        max-width: 320px;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
      }

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

      /* Make nav items larger for touch */
      .sidebar .nav-item {
        padding: 14px 20px;
        min-height: 48px;
        font-size: 15px;
      }

      .sidebar .nav-item svg {
        width: 22px;
        height: 22px;
      }

      /* Section titles */
      .sidebar .nav-section-title {
        padding: 12px 20px 8px;
        font-size: 11px;
      }

      /* User menu at bottom */
      .sidebar .sidebar-footer {
        padding: 16px 20px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
      }

      .sidebar .user-menu {
        padding: 12px;
      }

      /* Disable collapsed state on mobile */
      .sidebar.collapsed {
        width: 85%;
        max-width: 320px;
      }

      .sidebar.collapsed .sidebar-logo-text,
      .sidebar.collapsed .sidebar-logo-sub,
      .sidebar.collapsed .nav-section-title,
      .sidebar.collapsed .nav-item-text,
      .sidebar.collapsed .user-info,
      .sidebar.collapsed .logout-btn {
        display: block;
        opacity: 1;
        height: auto;
      }

      .sidebar.collapsed .nav-item {
        justify-content: flex-start;
        padding: 14px 20px;
      }

      .sidebar.collapsed .nav-badge {
        position: static;
        min-width: 20px;
        padding: 3px 10px;
        font-size: 11px;
      }

      /* Hide page toolbar on tablet/mobile */
      .page-toolbar {
        display: none !important;
        visibility: hidden !important;
      }

      /* Reset main content margin without toolbar */
      .main-content {
        margin-left: 0 !important;
      }

      /* Hide sidebar collapse button on mobile */
      .sidebar-collapse-btn {
        display: none;
      }

      /* Enhanced mobile navigation */
      .sidebar .nav-section {
        margin-bottom: 16px;
        padding-bottom: 16px;
        border-bottom: 1px solid var(--border-subtle);
      }

      .sidebar .nav-section:last-child {
        border-bottom: none;
        margin-bottom: 0;
      }

      .sidebar .nav-section-title {
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 1.5px;
        color: var(--text-muted);
        margin-bottom: 10px;
        padding-left: 20px;
      }

      .sidebar .nav-section-title::before {
        left: 8px;
      }

      /* Dashboard item prominent on mobile */
      .sidebar .nav-section:first-child .nav-item {
        background: linear-gradient(135deg, rgba(249, 203, 0, 0.1) 0%, rgba(249, 203, 0, 0.05) 100%);
        border: 1px solid rgba(249, 203, 0, 0.2);
        border-radius: 12px;
        margin: 0 8px 8px;
        padding: 16px 16px;
      }

      .sidebar .nav-section:first-child .nav-item.active {
        background: linear-gradient(135deg, rgba(249, 203, 0, 0.2) 0%, rgba(249, 203, 0, 0.1) 100%);
        border-color: var(--gold-primary);
      }

      /* Quick Links compact on mobile */
      .sidebar .nav-section-links {
        padding-top: 12px;
        margin-top: auto;
      }

      .sidebar .nav-section-links .nav-item {
        padding: 12px 20px;
        min-height: 44px;
        font-size: 13px;
        color: var(--text-muted);
      }

      /* Smooth scroll for nav */
      .sidebar .sidebar-nav {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
      }

      /* Active state visual feedback */
      .sidebar .nav-item:active {
        transform: scale(0.98);
        opacity: 0.9;
      }

      .main-content {
        margin-left: 0;
      }

      body.sidebar-collapsed .main-content {
        margin-left: 0;
      }

      .sidebar-overlay {
        display: none;
        position: fixed;
        top: var(--unified-nav-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
      }

      .sidebar-overlay.active {
        display: block;
      }
}

@media (max-width: 768px) {
      .stats-grid {
        grid-template-columns: repeat(2, 1fr);
      }

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

      .content-area {
        padding: 20px;
      }

      .topbar {
        padding: 16px 20px;
      }

      .auth-card {
        padding: 32px 24px;
      }

      th, td {
        padding: 12px 16px;
      }

      /* Estimate Modal Mobile Optimization */
      #create-estimate-modal .modal {
        max-width: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        border-radius: 0;
        margin: 0;
      }

      #create-estimate-modal .modal > div[style*="grid-template-columns: 1fr 1fr"] {
        display: flex !important;
        flex-direction: column !important;
      }

      #create-estimate-modal .form-section {
        border-right: none !important;
        border-bottom: 1px solid var(--border-subtle);
        padding: 16px !important;
      }

      #create-estimate-modal .form-section:last-child {
        border-bottom: none;
      }

      #create-estimate-modal .modal-header {
        padding: 16px !important;
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--dark-surface);
      }

      #create-estimate-modal .modal-header > div {
        gap: 12px !important;
      }

      #create-estimate-modal .modal-header > div > div:first-child {
        width: 40px !important;
        height: 40px !important;
      }

      #create-estimate-modal .modal-title {
        font-size: 18px !important;
      }

      #create-estimate-modal .modal-footer {
        position: sticky;
        bottom: 0;
        background: var(--dark-surface);
        padding: 16px !important;
        border-top: 1px solid var(--border-subtle);
        flex-direction: column;
        gap: 8px !important;
      }

      #create-estimate-modal .modal-footer .btn {
        width: 100%;
        justify-content: center;
        padding: 14px !important;
      }

      /* Line items table mobile */
      #estimate-line-items {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }

      .estimate-line-item {
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 12px !important;
      }

      .estimate-line-item > div {
        flex: 1 1 45% !important;
        min-width: 100px !important;
      }

      .estimate-line-item > div:first-child {
        flex: 1 1 100% !important;
      }

      /* Invoice modal mobile */
      #invoice-modal .invoice-item .form-row {
        flex-direction: column;
      }

      #invoice-modal .invoice-item .form-group {
        flex: 1 1 100% !important;
      }

      /* General modal mobile improvements */
      .modal-overlay .modal,
      .modal-overlay .modal {
        max-width: 100% !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        border-radius: 16px 16px 0 0 !important;
        margin: 0 !important;
        margin-top: auto !important;
      }

      .modal-overlay {
        align-items: flex-end !important;
      }

      .modal-overlay .modal-header {
        position: sticky;
        top: 0;
        background: var(--dark-surface);
        z-index: 5;
        padding: 16px 20px !important;
      }

      .modal-overlay .modal-footer {
        position: sticky;
        bottom: 0;
        background: var(--dark-surface);
        z-index: 5;
        padding: 16px 20px !important;
        padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important;
      }

      .modal-overlay .modal-body {
        padding: 16px 20px !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
      }

      /* Touch-friendly inputs */
      .modal-overlay input,
      .modal-overlay select,
      .modal-overlay textarea {
        min-height: 48px;
        font-size: 16px !important;
      }

      .modal-overlay .btn {
        min-height: 48px;
        font-size: 15px;
      }

      /* Modal Modern styles for mobile */
      .modal-modern-overlay {
        align-items: flex-end !important;
      }

      .modal-modern {
        max-width: 100% !important;
        width: 100% !important;
        max-height: 90vh !important;
        max-height: 90dvh !important;
        border-radius: 20px 20px 0 0 !important;
        margin: 0 !important;
      }

      .modal-modern-header {
        position: sticky;
        top: 0;
        background: var(--dark-surface);
        z-index: 5;
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-subtle);
      }

      .modal-modern-body {
        padding: 16px 20px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
      }

      .modal-modern-footer {
        position: sticky;
        bottom: 0;
        background: var(--dark-surface);
        z-index: 5;
        padding: 16px 20px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border-subtle);
      }

      .modal-modern-footer .btn,
      .modal-modern-footer .btn-modern {
        flex: 1;
        justify-content: center;
      }

      /* Drag handle for modals */
      .modal-drag-handle {
        width: 40px;
        height: 4px;
        background: var(--border-light);
        border-radius: 2px;
        margin: 8px auto 0;
      }

      /* Keep Add Lead modal centered/floating instead of bottom-anchored */
      #add-lead-modal.modal-overlay {
        align-items: center !important;
        padding: 20px !important;
      }

      #add-lead-modal .modal {
        max-width: 600px !important;
        max-height: 85vh !important;
        border-radius: 16px !important;
        margin: auto !important;
      }
}

/* ============================================
       ENHANCED MOBILE OPTIMIZATION
       ============================================ */

/* Mobile-specific: 480px and below */
@media (max-width: 480px) {
      /* Stats grid single column on small phones */
      .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
      }

      .stat-card {
        padding: 16px;
      }

      .stat-value {
        font-size: 24px;
      }

      /* Topbar mobile adjustments - clean single row */
      .topbar {
        padding: 12px 16px;
        gap: 12px;
      }

      .topbar-title {
        font-size: 18px;
        flex: 1;
      }

      .topbar-actions {
        flex-shrink: 0;
      }

      /* Compact button on mobile - icon only */
      .topbar-actions .btn-modern {
        padding: 12px;
        min-width: 44px;
        min-height: 44px;
      }

      .topbar-actions .btn-modern .btn-text {
        display: none;
      }

      .topbar-actions .btn-modern svg {
        width: 20px;
        height: 20px;
      }

      /* Content area tighter padding */
      .content-area {
        padding: 16px;
      }

      /* Card headers stack on mobile */
      .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
      }

      .card-header .btn-modern,
      .card-header button {
        width: 100%;
        justify-content: center;
      }
}

/* Touch-friendly targets for all mobile */
@media (max-width: 991px) {
      /* Minimum touch target sizes (44x44px per Apple/Google guidelines) */
      .btn,
      .btn-modern,
      .filter-btn,
      .filter-pill,
      .tab-btn,
      .nav-item {
        min-height: 44px;
        min-width: 44px;
      }

      /* Filter buttons larger on mobile */
      .filter-btn,
      .filter-pill {
        padding: 12px 18px;
        font-size: 14px;
      }

      .table-filters {
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        flex-wrap: nowrap;
      }

      .table-filters::-webkit-scrollbar {
        display: none;
      }

      /* Mobile hamburger menu button */
      .mobile-menu-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border-radius: 10px;
        background: var(--dark-elevated);
        border: 1px solid var(--border-subtle);
        color: var(--text-primary);
        cursor: pointer;
        transition: all 0.2s ease;
        flex-shrink: 0;
      }

      .mobile-menu-btn:hover {
        background: var(--dark-surface);
        border-color: var(--gold-primary);
      }

      .mobile-menu-btn:active {
        background: var(--gold-primary);
        color: var(--dark-primary);
        transform: scale(0.95);
      }

      .mobile-menu-btn svg {
        width: 22px;
        height: 22px;
      }

      /* Table horizontal scroll */
      .table-container {
        overflow: visible;
      }

      .table-container table,
      table.data-table,
      .leads-table,
      .customers-table,
      .estimates-table,
      .invoices-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
      }

      /* Table cell minimum widths for readability */
      th, td {
        min-width: 100px;
        padding: 14px 16px;
      }

      th:first-child, td:first-child {
        min-width: 150px;
        position: sticky;
        left: 0;
        background: var(--dark-elevated);
        z-index: 1;
      }

      /* Lead/Customer cards as stacked cards on mobile */
      .lead-row,
      .customer-row,
      .estimate-row {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 16px;
        border-bottom: 1px solid var(--border-subtle);
      }

      .lead-row > *,
      .customer-row > *,
      .estimate-row > * {
        white-space: normal;
      }

      /* Mobile Form Inputs - Touch Optimized */
      input[type="text"],
      input[type="email"],
      input[type="tel"],
      input[type="number"],
      input[type="password"],
      input[type="date"],
      input[type="datetime-local"],
      select,
      textarea {
        min-height: 48px;
        font-size: 16px !important; /* Prevents iOS zoom on focus */
        padding: 12px 16px;
        border-radius: 10px;
      }

      textarea {
        min-height: 100px;
      }

      /* Form groups spacing */
      .form-group {
        margin-bottom: 16px;
      }

      .form-group label {
        font-size: 14px;
        margin-bottom: 8px;
        display: block;
      }

      /* Form rows stack on mobile */
      .form-row {
        flex-direction: column;
        gap: 16px;
      }

      .form-row .form-group {
        width: 100%;
        margin-bottom: 0;
      }

      /* Checkbox and radio touch targets */
      input[type="checkbox"],
      input[type="radio"] {
        width: 24px;
        height: 24px;
        margin-right: 12px;
      }

      /* Select dropdown */
      select {
        background-position: right 16px center;
        padding-right: 44px;
      }

      /* Search inputs */
      .search-box {
        width: 100%;
      }

      .search-box input {
        width: 100%;
        font-size: 16px;
      }

      /* Calendar & Collaboration - Extra Small Mobile */
      #calendar-event-modal .modal-body,
      #invite-to-network-modal .modal-body {
        padding: 16px !important;
      }

      .collab-tabs {
        gap: 6px !important;
      }

      .collab-tab {
        padding: 10px 12px !important;
        font-size: 13px !important;
      }

      /* Event participants compact view */
      #event-participants-list {
        max-height: 150px !important;
      }

      .participant-item {
        flex-wrap: wrap !important;
      }

      .participant-item > * {
        flex: 1 1 45% !important;
        min-width: 120px !important;
      }

      /* Modal footer buttons stack */
      .modal-footer {
        flex-direction: column-reverse !important;
        gap: 10px !important;
      }

      .modal-footer button {
        width: 100% !important;
      }
}

/* Calendar Mobile Optimization */
@media (max-width: 768px) {
      /* Calendar switches to agenda/list view on mobile */
      .calendar-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }

      .calendar-header-row,
      .calendar-grid {
        min-width: 700px; /* Force horizontal scroll */
      }

      .calendar-day {
        min-height: 80px;
        padding: 6px;
      }

      .calendar-day-number {
        font-size: 12px;
      }

      .calendar-event {
        font-size: 10px;
        padding: 3px 6px;
      }

      /* Alternative: Mobile calendar agenda view */
      .calendar-mobile-view {
        display: block;
      }

      .calendar-desktop-view {
        display: none;
      }

      /* Calendar Event Modal - Mobile */
      #calendar-event-modal .modal {
        max-width: 100% !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        margin: 0 !important;
      }

      /* Form rows stack on mobile */
      .form-row-modern {
        flex-direction: column !important;
        gap: 12px !important;
      }

      .form-row-modern .form-group {
        width: 100% !important;
      }

      /* Collaboration tabs - horizontal scroll */
      .collab-tabs {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
        padding-bottom: 8px;
        margin-bottom: 16px !important;
      }

      .collab-tabs::-webkit-scrollbar {
        display: none;
      }

      .collab-tab {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 12px 16px !important;
        font-size: 14px !important;
      }

      /* Network/Invite modals - full screen on mobile */
      #invite-to-network-modal .modal,
      #calendar-event-detail-modal .modal {
        max-width: 100% !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        margin: 0 !important;
      }

      /* Participant list items - more touch friendly */
      .participant-item {
        padding: 12px !important;
        gap: 12px !important;
      }

      .participant-item input,
      .participant-item select {
        min-height: 44px !important;
        font-size: 16px !important;
      }

      /* Network cards - stack content */
      .network-card,
      .collaborator-card {
        padding: 16px !important;
      }

      .network-card .card-actions,
      .collaborator-card .card-actions {
        flex-direction: column !important;
        gap: 8px !important;
      }

      .network-card .card-actions button,
      .collaborator-card .card-actions button {
        width: 100% !important;
        justify-content: center !important;
      }
}

@media (min-width: 769px) {
      .calendar-mobile-view {
        display: none;
      }

      .calendar-desktop-view {
        display: block;
      }
}

/* Quick Actions mobile grid */
@media (max-width: 600px) {
      .quick-actions {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
      }

      .quick-action-card {
        padding: 16px !important;
      }

      .quick-action-card svg {
        width: 28px !important;
        height: 28px !important;
      }

      .quick-action-card span {
        font-size: 12px !important;
      }
}

/* Estimate/Invoice Card Mobile Optimizations */
@media (max-width: 768px) {
      .estimate-card,
      .invoice-card,
      .job-card {
        padding: 16px !important;
      }

      /* Stack card header on mobile */
      .estimate-card > div:first-child,
      .invoice-card > div:first-child,
      .job-card > div:first-child {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
      }

      /* Full width price/meta on mobile */
      .estimate-card > div:first-child > div:last-child,
      .invoice-card > div:first-child > div:last-child,
      .job-card > div:first-child > div:last-child {
        text-align: left !important;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 8px;
        border-top: 1px solid var(--border-subtle);
      }

      /* Action buttons wrap and fill width */
      .estimate-card > div:last-child,
      .invoice-card > div:last-child,
      .job-card > div:last-child {
        flex-wrap: wrap !important;
      }

      .estimate-card .btn-modern,
      .invoice-card .btn-modern,
      .job-card .btn-modern {
        flex: 1 1 auto !important;
        min-width: 80px;
        justify-content: center;
      }

      /* Button text wrap */
      .estimate-card .btn-modern.small,
      .invoice-card .btn-modern.small,
      .job-card .btn-modern.small {
        padding: 10px 14px !important;
        font-size: 13px !important;
      }

      /* Filter pills scroll horizontally */
      .filter-pills {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 8px;
        padding-bottom: 8px;
        flex-wrap: nowrap;
      }

      .filter-pills::-webkit-scrollbar {
        display: none;
      }

      .filter-pill {
        flex-shrink: 0;
        white-space: nowrap;
      }

      /* Stat grid responsive */
      .stat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
      }

      .stat-grid .stat-card {
        padding: 14px !important;
      }

      .stat-grid .stat-value {
        font-size: 20px !important;
      }

      .stat-grid .stat-label {
        font-size: 11px !important;
      }
}

/* Small phones - single column cards */
@media (max-width: 480px) {
      .stat-grid {
        grid-template-columns: 1fr 1fr !important;
      }

      /* Estimate card buttons stack */
      .estimate-card > div:last-child {
        flex-direction: column !important;
      }

      .estimate-card .btn-modern {
        width: 100% !important;
      }

      /* Sync button full width */
      #sync-stripe-btn {
        width: 100%;
        justify-content: center;
      }

      /* Card header button groups stack on small screens */
      .card-header > div[style*="display: flex"],
      .card-header > div[style*="flex"] {
        width: 100%;
      }

      .card-header .btn-modern,
      .card-header button.btn-modern {
        flex: 1 1 100%;
        width: 100%;
        justify-content: center;
      }

      /* Invoice page specific */
      #page-invoices .card-header > div {
        width: 100%;
      }

      #page-invoices .card-header .btn-modern {
        flex: 1;
        min-width: 0;
      }

      /* Table filters scroll */
      .table-filters {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
        margin-bottom: 16px;
      }

      .table-filters .filter-btn {
        flex-shrink: 0;
        white-space: nowrap;
      }
}

/* Ensure good tap targets on all mobile */
@media (max-width: 768px) {
      /* All clickable elements should have proper tap targets */
      .clickable,
      [onclick],
      button,
      a,
      .btn,
      .btn-modern,
      .filter-btn,
      .filter-pill,
      .nav-item {
        -webkit-tap-highlight-color: rgba(249, 203, 0, 0.2);
      }

      /* Prevent text selection on tap */
      button,
      .btn,
      .btn-modern,
      .filter-btn,
      .filter-pill {
        -webkit-user-select: none;
        user-select: none;
      }

      /* Add active state feedback */
      button:active,
      .btn:active,
      .btn-modern:active,
      .filter-btn:active,
      .filter-pill:active {
        opacity: 0.8;
        transform: scale(0.98);
      }

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

      .empty-state svg {
        width: 48px;
        height: 48px;
        margin-bottom: 16px;
        opacity: 0.5;
      }

      .empty-state h3 {
        font-size: 18px;
        margin-bottom: 8px;
      }

      .empty-state p {
        font-size: 14px;
        line-height: 1.5;
      }

      .empty-state .btn-modern {
        margin-top: 16px;
      }
}

/* Lead detail panel mobile */
@media (max-width: 768px) {
      .lead-detail-panel,
      .estimate-detail-panel,
      .customer-detail-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 0 !important;
        z-index: 200;
      }

      .panel-header {
        position: sticky;
        top: 0;
        z-index: 5;
        background: var(--dark-surface);
      }

      .panel-content {
        padding-bottom: 100px;
      }

      .panel-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 16px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
        background: var(--dark-surface);
        border-top: 1px solid var(--border-subtle);
        display: flex;
        gap: 12px;
      }

      .panel-actions .btn {
        flex: 1;
        justify-content: center;
      }
}

/* Search box mobile */
@media (max-width: 600px) {
      .search-box {
        width: 100%;
      }

      .search-box input {
        width: 100%;
      }

      .table-header {
        padding: 16px;
      }
}

/* ============================================
       COMPREHENSIVE MOBILE SCREEN OPTIMIZATIONS
       ============================================ */

/* === DASHBOARD PAGE MOBILE === */
@media (max-width: 768px) {
      #page-dashboard .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
      }

      #page-dashboard .stat-card {
        padding: 16px;
      }

      #page-dashboard .stat-card.clickable {
        min-height: 100px;
      }

      #page-dashboard .stat-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 8px;
      }

      #page-dashboard .stat-icon svg {
        width: 20px;
        height: 20px;
      }

      #page-dashboard .stat-value {
        font-size: 22px;
      }

      #page-dashboard .stat-label {
        font-size: 12px;
      }

      /* Quick actions grid */
      #page-dashboard .quick-actions {
        grid-template-columns: 1fr !important;
        gap: 12px;
      }

      #page-dashboard .action-card {
        padding: 16px;
        flex-direction: row;
        align-items: center;
        gap: 16px;
      }

      #page-dashboard .action-card .action-icon {
        width: 48px;
        height: 48px;
        flex-shrink: 0;
      }

      #page-dashboard .action-card .action-text h4 {
        font-size: 15px;
        margin-bottom: 4px;
      }

      #page-dashboard .action-card .action-text p {
        font-size: 13px;
      }
}

@media (max-width: 480px) {
      #page-dashboard .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
      }

      #page-dashboard .stat-card {
        padding: 14px;
      }

      #page-dashboard .stat-value {
        font-size: 20px;
      }
}

/* === PROFILE PAGE MOBILE === */
@media (max-width: 768px) {
      #page-profile .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
      }

      #page-profile .card-header .btn-modern {
        width: 100%;
        justify-content: center;
      }

      #page-profile .form-row {
        display: flex;
        flex-direction: column;
        gap: 0;
      }

      #page-profile .form-group {
        margin-bottom: 16px;
      }

      #page-profile input,
      #page-profile select,
      #page-profile textarea {
        width: 100%;
      }
}

/* === FAVORITES & DESIGNS PAGES MOBILE === */
@media (max-width: 768px) {
      #page-favorites .favorites-grid,
      #page-my-designs .designs-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
      }

      .favorite-card,
      .design-card {
        border-radius: 10px;
      }

      .favorite-card img,
      .design-card img {
        height: 120px;
      }

      .favorite-card-body,
      .design-card-body {
        padding: 12px;
      }

      .favorite-card-title,
      .design-card-title {
        font-size: 14px;
        line-height: 1.3;
      }

      .favorite-card-actions,
      .design-card-actions {
        padding: 8px 12px;
      }
}

@media (max-width: 480px) {
      #page-favorites .favorites-grid,
      #page-my-designs .designs-grid {
        grid-template-columns: 1fr !important;
      }

      .favorite-card img,
      .design-card img {
        height: 160px;
      }
}

/* === LISTINGS PAGE MOBILE === */
@media (max-width: 768px) {
      #page-listings .listings-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
      }

      .listing-card {
        border-radius: 10px;
      }

      .listing-image {
        height: 140px;
      }

      .listing-details {
        padding: 12px;
      }

      .listing-price {
        font-size: 16px;
      }

      .listing-actions {
        flex-direction: column;
        gap: 8px;
      }

      .listing-actions .btn-modern {
        width: 100%;
        justify-content: center;
      }
}

@media (max-width: 480px) {
      #page-listings .listings-grid {
        grid-template-columns: 1fr !important;
      }
}

/* === TOOLS PAGE MOBILE === */
@media (max-width: 768px) {
      #page-tools .tools-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
      }

      .tool-card {
        padding: 16px;
        text-align: center;
      }

      .tool-card-icon {
        width: 48px;
        height: 48px;
        margin: 0 auto 12px;
      }

      .tool-card-title {
        font-size: 14px;
      }

      .tool-card-desc {
        font-size: 12px;
        display: none;
      }
}

@media (max-width: 480px) {
      #page-tools .tools-grid {
        grid-template-columns: 1fr 1fr !important;
      }
}

/* === LEADS PAGE MOBILE === */
@media (max-width: 768px) {
      #page-leads .table-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
      }

      #page-leads .table-header > div {
        width: 100%;
      }

      #page-leads .search-bar-modern {
        max-width: 100% !important;
        margin: 0 !important;
      }

      #page-leads .filter-pills {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
      }

      #page-leads .filter-pill {
        flex-shrink: 0;
      }

      /* Lead cards instead of table rows */
      #leads-table .lead-row {
        display: flex;
        flex-direction: column;
        background: var(--dark-elevated);
        border-radius: 12px;
        padding: 16px;
        margin-bottom: 12px;
        border: 1px solid var(--border-subtle);
      }

      #leads-table .lead-row > * {
        padding: 4px 0;
      }
}

/* === CUSTOMERS PAGE MOBILE === */
@media (max-width: 768px) {
      #page-customers .table-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
      }

      #page-customers .table-header > div {
        width: 100%;
        flex-direction: column !important;
        align-items: stretch !important;
      }

      #page-customers .search-bar-modern {
        max-width: 100% !important;
      }

      #page-customers .btn-modern {
        width: 100%;
        justify-content: center;
      }

      /* Customers list as cards */
      #customers-list .customer-card {
        display: flex;
        flex-direction: column;
        padding: 16px;
        background: var(--dark-elevated);
        border-radius: 12px;
        margin-bottom: 12px;
        border: 1px solid var(--border-subtle);
      }
}

/* === ESTIMATES PAGE MOBILE === */
@media (max-width: 768px) {
      #page-estimates .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
      }

      #page-estimates .card-header > div {
        width: 100%;
      }

      #page-estimates .btn-modern {
        width: 100%;
        justify-content: center;
      }

      /* Stat row for estimates */
      #page-estimates .estimates-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
      }

      #page-estimates .stat-mini {
        padding: 12px;
        text-align: center;
      }

      /* Estimate cards mobile */
      .estimate-card {
        padding: 14px !important;
      }

      .estimate-card > div:first-child {
        flex-direction: column !important;
        gap: 10px !important;
      }

      .estimate-card .status-badge {
        align-self: flex-start;
      }

      .estimate-card > div:last-child {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--border-subtle);
      }

      .estimate-card .btn-modern.small {
        padding: 10px 12px !important;
        font-size: 12px !important;
        flex: 1;
        justify-content: center;
      }
}

@media (max-width: 480px) {
      .estimate-card > div:last-child {
        flex-direction: column !important;
      }

      .estimate-card .btn-modern.small {
        width: 100% !important;
      }
}

/* === INVOICES PAGE MOBILE === */
@media (max-width: 768px) {
      #page-invoices .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
      }

      #page-invoices .card-header > div {
        width: 100%;
        flex-direction: column !important;
      }

      #page-invoices .btn-modern {
        width: 100%;
        justify-content: center;
      }

      #page-invoices .table-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
      }

      #page-invoices .filter-btn {
        flex-shrink: 0;
        white-space: nowrap;
      }
}

/* === JOBS PAGE MOBILE === */
@media (max-width: 768px) {
      #page-jobs .stat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
      }

      #page-jobs .stat-card {
        padding: 14px !important;
      }

      #page-jobs .stat-value {
        font-size: 18px !important;
      }

      #page-jobs .stat-label {
        font-size: 11px !important;
      }

      #page-jobs .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
      }

      #page-jobs .card-header > div {
        width: 100%;
        flex-direction: column !important;
        gap: 10px !important;
      }

      /* View toggle full width */
      #page-jobs .view-toggle {
        width: 100%;
        justify-content: center;
      }

      #page-jobs .view-toggle .view-btn {
        flex: 1;
        justify-content: center;
      }

      #page-jobs .btn-modern {
        width: 100%;
        justify-content: center;
      }

      /* Kanban board horizontal scroll */
      #page-jobs .kanban-board {
        padding: 0 0 16px 0 !important;
        margin: 0 -16px;
        padding-left: 16px !important;
      }

      #page-jobs .kanban-column {
        min-width: 280px !important;
        padding: 12px !important;
      }

      #page-jobs .kanban-column:last-child {
        margin-right: 16px;
      }

      /* Job cards */
      .job-card {
        padding: 14px !important;
      }
}

/* === PROJECTS PAGE STYLES === */
#page-projects .stat-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 16px;
      margin-bottom: 24px;
}
#page-projects .stat-card {
      background: var(--dark-card);
      border: 1px solid var(--dark-border);
      border-radius: 12px;
      padding: 20px;
      text-align: center;
}
#page-projects .stat-value {
      font-size: 24px;
      font-weight: 700;
      color: var(--gold-primary);
}
#page-projects .stat-label {
      font-size: 12px;
      color: var(--text-secondary);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-top: 4px;
}

/* === PROJECTS PAGE MOBILE === */
@media (max-width: 768px) {
      #page-projects .stat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
      }
      #page-projects .stat-card {
        padding: 14px !important;
      }
      #page-projects .stat-value {
        font-size: 18px !important;
      }
      #page-projects .stat-label {
        font-size: 11px !important;
      }
      #page-projects .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
      }
      #page-projects .card-header > div {
        width: 100%;
        flex-direction: column !important;
        gap: 10px !important;
      }
      #page-projects .view-toggle {
        width: 100%;
        justify-content: center;
      }
      #page-projects .view-toggle .view-btn {
        flex: 1;
        justify-content: center;
      }
      #page-projects .btn-modern {
        width: 100%;
        justify-content: center;
      }
      #page-projects .kanban-board {
        padding: 0 0 16px 0 !important;
        margin: 0 -16px;
        padding-left: 16px !important;
      }
      #page-projects .kanban-column {
        min-width: 280px !important;
        padding: 12px !important;
      }
      #page-projects .kanban-column:last-child {
        margin-right: 16px;
      }
}

/* === DESIGN HANDOFF STYLES === */
.handoff-stage-tracker {
      display: flex;
      gap: 2px;
      margin: 16px 0;
      overflow-x: auto;
      padding: 4px 0;
      -webkit-overflow-scrolling: touch;
}
.handoff-stage {
      flex: 1;
      min-width: 58px;
      text-align: center;
      padding: 6px 3px;
      border-radius: 6px;
      font-size: 9px;
      line-height: 1.3;
      white-space: nowrap;
      transition: all 0.2s;
}
.handoff-stage.completed { background: rgba(34,197,94,0.15); color: #22c55e; }
.handoff-stage.current { background: rgba(212,175,55,0.2); color: var(--gold-primary); font-weight: 700; border: 1px solid var(--gold-primary); }
.handoff-stage.future { background: var(--dark-elevated); color: var(--text-muted); }
.handoff-participant {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px;
      background: var(--dark-elevated);
      border-radius: 8px;
      margin-bottom: 8px;
}
.handoff-participant-avatar {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: var(--gold-primary);
      color: #000;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 13px;
}
@media (max-width: 768px) {
      .handoff-stage-tracker { padding-bottom: 8px; }
      .handoff-stage { min-width: 50px; font-size: 8px; }
}

/* === CONTRACTORS PAGE MOBILE === */
@media (max-width: 768px) {
      #page-collaborators .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
      }

      #page-collaborators .btn-modern {
        width: 100%;
        justify-content: center;
      }

      /* Contractor cards */
      .contractor-card {
        padding: 16px;
        flex-direction: column;
        gap: 12px;
      }

      .contractor-card .contractor-avatar {
        align-self: center;
      }

      .contractor-card .contractor-info {
        text-align: center;
      }

      .contractor-card .contractor-actions {
        width: 100%;
        justify-content: center;
      }
}

/* === CALENDAR PAGE MOBILE === */
@media (max-width: 768px) {
      #page-calendar .card-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
      }

      #page-calendar .card-header > div {
        width: 100%;
        justify-content: center;
      }

      /* Calendar navigation */
      #page-calendar #calendar-month-year {
        min-width: 120px !important;
        font-size: 15px;
      }

      /* Calendar grid scrollable */
      #page-calendar .calendar-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -16px;
        padding: 0 16px;
      }

      #page-calendar .calendar-header-row,
      #page-calendar .calendar-grid {
        min-width: 560px;
      }

      #page-calendar .calendar-header-cell {
        padding: 8px 4px;
        font-size: 11px;
      }

      #page-calendar .calendar-day {
        min-height: 70px;
        padding: 4px;
      }

      #page-calendar .calendar-day-number {
        font-size: 12px;
      }

      #page-calendar .calendar-event {
        font-size: 9px;
        padding: 2px 4px;
        margin-bottom: 2px;
      }

      /* Legend inline */
      #page-calendar .card-body > div {
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 12px !important;
      }

      .calendar-event-dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        display: inline-block;
      }
}

@media (max-width: 480px) {
      /* On very small phones, make upcoming events more prominent */
      #page-calendar > .card:first-child {
        margin-bottom: 16px;
      }

      /* Smaller calendar grid for very small phones */
      #page-calendar .calendar-header-row,
      #page-calendar .calendar-grid {
        min-width: 480px;
      }

      #page-calendar .calendar-day {
        min-height: 60px;
        padding: 2px;
      }

      #page-calendar .calendar-event {
        font-size: 8px;
        padding: 1px 3px;
      }

      /* Make upcoming events more visible as primary view */
      #page-calendar > .card:last-child {
        order: -1;
        margin-top: 0;
        margin-bottom: 16px;
        border: 2px solid var(--gold-primary);
      }
}

/* === WALLET PAGE MOBILE === */
@media (max-width: 768px) {
      #page-wallet .wallet-balance-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
      }

      #page-wallet .balance-card {
        padding: 20px;
        text-align: center;
      }

      #page-wallet .balance-amount {
        font-size: 28px;
      }

      /* Transaction list */
      #page-wallet .transaction-list {
        padding: 0;
      }

      #page-wallet .transaction-item {
        padding: 14px;
        flex-wrap: wrap;
        gap: 8px;
      }

      #page-wallet .transaction-item > div:last-child {
        width: 100%;
        display: flex;
        justify-content: space-between;
        padding-top: 8px;
        border-top: 1px solid var(--border-subtle);
      }

      /* Payout card */
      #page-wallet .payout-card {
        flex-direction: column;
        text-align: center;
        gap: 12px;
      }
}

/* === ADMIN USERS PAGE MOBILE === */
@media (max-width: 768px) {
      #page-admin-users .admin-list {
        display: flex;
        flex-direction: column;
        gap: 12px;
      }

      .admin-user-card {
        display: flex;
        flex-direction: column;
        padding: 16px;
        background: var(--dark-elevated);
        border-radius: 12px;
        border: 1px solid var(--border-subtle);
        gap: 12px;
      }

      .admin-user-card .user-actions {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
      }

      .admin-user-card .btn-modern {
        flex: 1;
        justify-content: center;
      }
}

/* === PRODUCTS PAGE MOBILE === */
@media (max-width: 768px) {
      #page-products .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
      }

      .product-card {
        border-radius: 10px;
      }

      .product-card-image {
        height: 120px;
      }

      .product-card-body {
        padding: 12px;
      }

      .product-card-title {
        font-size: 14px;
      }

      .product-card-price {
        font-size: 16px;
      }
}

@media (max-width: 480px) {
      #page-products .products-grid {
        grid-template-columns: 1fr !important;
      }

      .product-card-image {
        height: 160px;
      }
}

/* === ORDERS PAGE === */
.orders-container {
      display: flex;
      flex-direction: column;
      gap: 16px;
}

.order-card {
      background: var(--dark-elevated);
      border-radius: 12px;
      border: 1px solid var(--border-subtle);
      overflow: hidden;
      transition: border-color 0.2s ease;
}

.order-card:hover {
      border-color: var(--border-light);
}

.order-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      padding: 16px 20px;
      border-bottom: 1px solid var(--border-subtle);
      gap: 16px;
      flex-wrap: wrap;
}

.order-info {
      display: flex;
      flex-direction: column;
      gap: 4px;
}

.order-number {
      font-size: 16px;
      font-weight: 600;
      color: var(--text-primary);
}

.order-date {
      font-size: 13px;
      color: var(--text-muted);
}

.order-status {
      display: flex;
      gap: 8px;
      align-items: center;
}

.status-badge {
      padding: 4px 10px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 500;
      text-transform: capitalize;
}

.status-badge.paid {
      background: rgba(77, 255, 130, 0.15);
      color: var(--success);
}

.status-badge.pending {
      background: rgba(255, 184, 77, 0.15);
      color: var(--warning);
}

.status-badge.refunded {
      background: rgba(255, 107, 107, 0.15);
      color: var(--error);
}

.status-badge.fulfilled {
      background: rgba(77, 166, 255, 0.15);
      color: var(--info);
}

.status-badge.unfulfilled {
      background: rgba(255, 255, 255, 0.1);
      color: var(--text-secondary);
}

.order-items {
      padding: 16px 20px;
}

.order-item {
      display: flex;
      gap: 12px;
      padding: 8px 0;
      align-items: flex-start;
}

.order-item + .order-item {
      border-top: 1px solid var(--border-subtle);
}

.order-item-image {
      width: 60px;
      height: 60px;
      border-radius: 8px;
      background: var(--dark-surface);
      overflow: hidden;
      flex-shrink: 0;
}

.order-item-image img {
      width: 100%;
      height: 100%;
      object-fit: cover;
}

.order-item-details {
      flex: 1;
      min-width: 0;
}

.order-item-name {
      font-size: 14px;
      font-weight: 500;
      color: var(--text-primary);
      margin-bottom: 2px;
}

.order-item-meta {
      font-size: 13px;
      color: var(--text-muted);
}

.order-item-price {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-primary);
      text-align: right;
}

.order-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 16px 20px;
      border-top: 1px solid var(--border-subtle);
      background: var(--dark-surface);
}

.order-total {
      font-size: 18px;
      font-weight: 700;
      color: var(--gold-primary);
}

.order-total-label {
      font-size: 13px;
      color: var(--text-muted);
      margin-bottom: 2px;
}

.stat-card-mini {
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
      padding: 16px;
      text-align: center;
}

.stat-card-value {
      font-size: 24px;
      font-weight: 700;
      color: var(--text-primary);
}

.stat-card-label {
      font-size: 12px;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-top: 4px;
}

/* === PRODUCTS PAGE MOBILE === */
@media (max-width: 768px) {
      #page-products .page-header {
        flex-direction: column;
        align-items: stretch;
      }

      #page-products .page-header > div:last-child {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
      }

      #page-products .page-header .btn-modern {
        padding: 10px 12px;
        font-size: 13px;
        justify-content: center;
      }

      #page-products .stats-row {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
      }

      #page-products .stat-card-mini {
        padding: 12px;
      }

      #page-products .stat-card-value {
        font-size: 20px;
      }

      #page-products .stat-card-label {
        font-size: 10px;
      }

      /* Mobile filters */
      #page-products .table-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
      }

      #page-products .filter-btn {
        padding: 8px 12px;
        font-size: 12px;
        flex: 1;
        min-width: calc(50% - 6px);
        text-align: center;
        justify-content: center;
      }

      /* Hide table on mobile, show cards */
      #page-products #products-table-container table {
        display: none;
      }

      #page-products #products-table-container {
        background: transparent;
        border: none;
      }

      #page-products #products-table-body {
        display: flex;
        flex-direction: column;
        gap: 12px;
      }

      /* Bulk actions mobile */
      #page-products #products-bulk-actions {
        flex-wrap: wrap;
        padding: 12px;
        gap: 8px;
      }

      #page-products #products-bulk-actions .btn-modern {
        flex: 1;
        min-width: calc(50% - 8px);
        justify-content: center;
      }

      /* Pagination mobile */
      #page-products #products-pagination {
        flex-direction: column;
        gap: 12px;
        text-align: center;
      }

      #page-products #products-pagination > div:last-child {
        display: flex;
        width: 100%;
      }

      #page-products #products-pagination .btn-modern {
        flex: 1;
      }
}

/* Product card mobile view */
.product-card-mobile {
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
      padding: 16px;
      display: none;
}

@media (max-width: 768px) {
      .product-card-mobile {
        display: block;
      }
}

.product-card-mobile-header {
      display: flex;
      gap: 12px;
      margin-bottom: 12px;
}

.product-card-mobile-image {
      width: 60px;
      height: 60px;
      border-radius: 8px;
      object-fit: cover;
      background: var(--dark-surface);
      flex-shrink: 0;
}

.product-card-mobile-info {
      flex: 1;
      min-width: 0;
}

.product-card-mobile-name {
      font-weight: 600;
      font-size: 14px;
      margin-bottom: 4px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
}

.product-card-mobile-meta {
      font-size: 12px;
      color: var(--text-muted);
}

.product-card-mobile-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px 0;
      border-top: 1px solid var(--border-subtle);
}

.product-card-mobile-row:first-of-type {
      margin-top: 8px;
}

.product-card-mobile-label {
      font-size: 12px;
      color: var(--text-muted);
}

.product-card-mobile-value {
      font-size: 14px;
      font-weight: 500;
}

.product-card-mobile-actions {
      display: flex;
      gap: 8px;
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px solid var(--border-subtle);
}

.product-card-mobile-actions button {
      flex: 1;
      padding: 10px;
      border-radius: 8px;
      border: 1px solid var(--border-subtle);
      background: var(--dark-surface);
      color: var(--text-primary);
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
}

.product-card-mobile-actions button.danger {
      color: var(--error);
      border-color: rgba(239, 68, 68, 0.3);
}

/* Import modal mobile */
@media (max-width: 768px) {
      #import-modal .modal {
        max-width: 100%;
        margin: 10px;
        max-height: calc(100vh - 20px);
      }

      #import-modal .modal-body {
        padding: 16px;
      }

      #import-dropzone {
        padding: 24px 16px;
      }

      #import-dropzone h3 {
        font-size: 16px;
      }

      #import-mapping-grid {
        grid-template-columns: 1fr !important;
      }

      #import-preview-table {
        font-size: 11px;
      }

      #import-preview-table th,
      #import-preview-table td {
        padding: 6px 8px;
      }

      /* Product modal mobile */
      #product-modal .modal {
        max-width: 100%;
        margin: 10px;
        max-height: calc(100vh - 20px);
      }

      #product-modal .modal-body {
        padding: 16px;
        max-height: calc(100vh - 180px);
        overflow-y: auto;
      }

      #product-modal .form-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0;
      }

      #product-modal .form-group {
        margin-bottom: 16px;
      }

      #product-modal .form-group label {
        font-size: 13px;
      }

      #product-modal .form-group input,
      #product-modal .form-group select,
      #product-modal .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px;
      }

      #product-modal .modal-footer {
        padding: 12px 16px;
        flex-direction: column;
        gap: 8px;
      }

      #product-modal .modal-footer .btn-modern {
        width: 100%;
        justify-content: center;
      }
}

/* === ORDERS PAGE MOBILE === */
@media (max-width: 768px) {
      #page-orders .orders-list {
        display: flex;
        flex-direction: column;
        gap: 12px;
      }

      .order-card {
        display: flex;
        flex-direction: column;
        padding: 16px;
        background: var(--dark-elevated);
        border-radius: 12px;
        border: 1px solid var(--border-subtle);
        gap: 12px;
      }

      .order-card .order-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
      }

      .order-card .order-items {
        border-top: 1px solid var(--border-subtle);
        padding-top: 12px;
      }

      .order-card .order-actions {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        padding-top: 12px;
        border-top: 1px solid var(--border-subtle);
      }

      .order-card .btn-modern {
        flex: 1;
        justify-content: center;
      }
}

/* === MESSAGES PAGE STYLES === */
.messages-container {
      display: flex;
      height: calc(100vh - 200px);
      min-height: 500px;
      background: var(--surface-elevated);
      border-radius: 16px;
      border: 1px solid var(--border-subtle);
      overflow: hidden;
}

.conversations-list {
      width: 320px;
      min-width: 280px;
      border-right: 1px solid var(--border-subtle);
      display: flex;
      flex-direction: column;
      background: var(--surface);
}

.conversations-header {
      padding: 16px;
      border-bottom: 1px solid var(--border-subtle);
}

.search-input-modern {
      width: 100%;
      padding: 10px 14px;
      border-radius: 8px;
      border: 1px solid var(--border-subtle);
      background: var(--surface-elevated);
      color: var(--text);
      font-size: 14px;
      transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input-modern:focus {
      outline: none;
      border-color: var(--gold);
      box-shadow: 0 0 0 3px rgba(249, 203, 0, 0.1);
}

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

.conversations-items {
      flex: 1;
      overflow-y: auto;
}

.conversation-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 14px 16px;
      cursor: pointer;
      border-bottom: 1px solid var(--border-subtle);
      transition: background 0.15s;
}

.conversation-item:hover {
      background: rgba(255, 255, 255, 0.03);
}

.conversation-item.active {
      background: rgba(249, 203, 0, 0.08);
      border-left: 3px solid var(--gold);
}

.conversation-item .avatar-modern {
      width: 44px;
      height: 44px;
      flex-shrink: 0;
}

.conversation-details {
      flex: 1;
      min-width: 0;
}

.conversation-name {
      font-weight: 600;
      font-size: 14px;
      margin-bottom: 2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
}

.conversation-preview {
      font-size: 13px;
      color: var(--text-muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
}

.conversation-meta {
      text-align: right;
      flex-shrink: 0;
}

.conversation-time {
      font-size: 11px;
      color: var(--text-muted);
      margin-bottom: 4px;
}

.conversation-unread {
      background: var(--gold);
      color: var(--dark);
      font-size: 11px;
      font-weight: 700;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-left: auto;
}

.message-thread {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-width: 0;
}

.thread-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 16px 20px;
      border-bottom: 1px solid var(--border-subtle);
      background: var(--surface);
}

.thread-contact {
      display: flex;
      align-items: center;
      gap: 12px;
}

.thread-info h3 {
      font-size: 16px;
      font-weight: 600;
      margin: 0;
}

.thread-status {
      font-size: 12px;
      color: var(--text-muted);
}

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

.thread-messages {
      flex: 1;
      overflow-y: auto;
      padding: 20px;
      display: flex;
      flex-direction: column;
      gap: 12px;
}

.empty-thread {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
      text-align: center;
      padding: 40px;
}

.empty-thread svg {
      margin-bottom: 16px;
      opacity: 0.3;
}

.empty-thread h3 {
      font-size: 18px;
      margin-bottom: 8px;
      color: var(--text);
}

.message-bubble {
      max-width: 70%;
      padding: 12px 16px;
      border-radius: 16px;
      font-size: 14px;
      line-height: 1.5;
      position: relative;
}

.message-bubble.outbound {
      background: var(--gold);
      color: var(--dark);
      margin-left: auto;
      border-bottom-right-radius: 4px;
}

.message-bubble.inbound {
      background: var(--surface-elevated);
      border: 1px solid var(--border-subtle);
      margin-right: auto;
      border-bottom-left-radius: 4px;
}

.message-time {
      font-size: 10px;
      color: var(--text-muted);
      margin-top: 4px;
      display: block;
}

.message-bubble.outbound .message-time {
      color: rgba(0, 0, 0, 0.5);
      text-align: right;
}

.message-channel-badge {
      font-size: 9px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      padding: 2px 6px;
      border-radius: 4px;
      background: rgba(255, 255, 255, 0.1);
      margin-left: 8px;
}

.message-bubble.outbound .message-channel-badge {
      background: rgba(0, 0, 0, 0.1);
}

.message-input-area {
      padding: 16px 20px;
      border-top: 1px solid var(--border-subtle);
      background: var(--surface);
}

.message-input-wrapper {
      display: flex;
      align-items: flex-end;
      gap: 12px;
      background: var(--surface-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
      padding: 8px 12px;
}

.message-input {
      flex: 1;
      background: transparent;
      border: none;
      color: var(--text);
      font-size: 14px;
      resize: none;
      min-height: 24px;
      max-height: 120px;
      font-family: inherit;
      padding: 4px 0;
}

.message-input:focus {
      outline: none;
}

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

.attachment-btn {
      color: var(--text-muted);
}

.send-btn {
      padding: 8px 16px !important;
      border-radius: 8px !important;
}

.message-channel-selector {
      display: flex;
      gap: 16px;
      margin-top: 12px;
      padding-left: 4px;
}

.channel-option {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      color: var(--text-muted);
      cursor: pointer;
}

.channel-option input[type="radio"] {
      accent-color: var(--gold);
}

.channel-option:has(input:checked) {
      color: var(--gold);
}

.date-divider {
      display: flex;
      align-items: center;
      gap: 16px;
      color: var(--text-muted);
      font-size: 12px;
      margin: 16px 0;
}

.date-divider::before,
.date-divider::after {
      content: '';
      flex: 1;
      height: 1px;
      background: var(--border-subtle);
}

.loading-state {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 12px;
      padding: 40px;
      color: var(--text-muted);
      font-size: 14px;
}

/* Filter Chips */
.filter-chips {
      display: flex;
      gap: 6px;
      margin-top: 10px;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      padding-bottom: 2px;
}

.filter-chip {
      padding: 6px 12px;
      border-radius: 16px;
      border: 1px solid var(--border-subtle);
      background: transparent;
      color: var(--text-muted);
      font-size: 12px;
      font-weight: 500;
      cursor: pointer;
      white-space: nowrap;
      transition: all 0.2s;
}

.filter-chip.active {
      background: var(--gold);
      color: var(--dark);
      border-color: var(--gold);
}

.filter-chip:hover:not(.active) {
      border-color: var(--gold);
      color: var(--text);
}

/* Notification Avatar */
.notif-avatar {
      width: 44px;
      height: 44px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
}

.notif-avatar.gold { background: rgba(249, 203, 0, 0.15); color: var(--gold); }
.notif-avatar.green { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.notif-avatar.blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.notif-avatar.purple { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.notif-avatar.pink { background: rgba(236, 72, 153, 0.15); color: #ec4899; }
.notif-avatar.gray { background: rgba(255, 255, 255, 0.1); color: var(--text-muted); }

.notif-unread-dot {
      display: inline-block;
      width: 8px;
      height: 8px;
      background: var(--gold);
      border-radius: 50%;
      margin-right: 6px;
}

.conversation-item.unread .conversation-name {
      font-weight: 700;
}

.conversation-item.unread .conversation-preview {
      color: var(--text);
}

/* Notification Detail Card */
.notif-detail-card {
      background: var(--surface-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 16px;
      margin: 20px;
      overflow: hidden;
}

.notif-detail-header {
      padding: 20px;
      border-bottom: 1px solid var(--border-subtle);
      display: flex;
      justify-content: space-between;
      align-items: center;
}

.notif-detail-header h3 {
      font-size: 16px;
      margin: 0;
}

.notif-time {
      font-size: 12px;
      color: var(--text-muted);
}

.notif-detail-body {
      padding: 20px;
}

.notif-detail-body p {
      margin: 0;
      line-height: 1.6;
      white-space: pre-wrap;
}

.notif-detail-body .detail-row {
      padding: 8px 0;
      border-bottom: 1px solid var(--border-subtle);
}

.notif-detail-body .detail-row:last-child {
      border-bottom: none;
}

.notif-detail-contact {
      padding: 16px 20px;
      border-top: 1px solid var(--border-subtle);
      display: flex;
      gap: 16px;
      flex-wrap: wrap;
}

.contact-link {
      display: flex;
      align-items: center;
      gap: 6px;
      color: var(--gold);
      text-decoration: none;
      font-size: 14px;
}

.contact-link:hover {
      text-decoration: underline;
}

.notif-detail-actions {
      padding: 16px 20px;
      border-top: 1px solid var(--border-subtle);
      display: flex;
      gap: 12px;
}

.notif-detail-actions .btn-modern {
      flex: 1;
      justify-content: center;
}

/* === COMPOSE MESSAGE MODAL === */
.compose-modal {
      max-width: 500px;
      width: 100%;
      display: flex;
      flex-direction: column;
      max-height: 90vh;
}

.compose-section {
      padding: 12px 20px;
      border-bottom: 1px solid var(--border-subtle);
}

.compose-section:last-of-type {
      border-bottom: none;
}

.compose-label {
      display: block;
      font-size: 12px;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 8px;
}

.compose-input {
      width: 100%;
      padding: 12px 14px;
      border-radius: 10px;
      border: 1px solid var(--border-subtle);
      background: var(--surface-elevated);
      color: var(--text);
      font-size: 15px;
}

.compose-input:focus {
      outline: none;
      border-color: var(--gold);
}

.compose-textarea {
      width: 100%;
      padding: 14px;
      border-radius: 10px;
      border: 1px solid var(--border-subtle);
      background: var(--surface-elevated);
      color: var(--text);
      font-size: 15px;
      resize: none;
      min-height: 120px;
      font-family: inherit;
}

.compose-textarea:focus {
      outline: none;
      border-color: var(--gold);
}

/* Chip/Tag component */
.chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 10px;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 16px;
      font-size: 12px;
      font-weight: 500;
      color: var(--text-secondary);
      white-space: nowrap;
}

.chip.primary {
      background: rgba(249, 203, 0, 0.15);
      color: var(--gold-primary);
}

.chip.success {
      background: rgba(34, 197, 94, 0.15);
      color: #22c55e;
}

.chip.warning {
      background: rgba(245, 158, 11, 0.15);
      color: #f59e0b;
}

.chip.danger {
      background: rgba(239, 68, 68, 0.15);
      color: #ef4444;
}

.chip.info {
      background: rgba(59, 130, 246, 0.15);
      color: #3b82f6;
}

.chip .chip-close {
      background: none;
      border: none;
      color: inherit;
      opacity: 0.7;
      cursor: pointer;
      font-size: 14px;
      line-height: 1;
      padding: 0;
}

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

.chip-group {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
}

.compose-recipient-chip {
      display: flex;
      align-items: center;
      gap: 8px;
      background: var(--gold);
      color: var(--dark);
      padding: 8px 12px;
      border-radius: 20px;
      font-size: 14px;
      font-weight: 500;
      width: fit-content;
}

.chip-remove {
      background: none;
      border: none;
      color: var(--dark);
      font-size: 18px;
      cursor: pointer;
      line-height: 1;
      opacity: 0.7;
}

.chip-remove:hover {
      opacity: 1;
}

.compose-suggestions {
      background: var(--surface-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
      margin-top: 8px;
      max-height: 240px;
      overflow-y: auto;
      display: none;
}

.suggestion-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 14px;
      cursor: pointer;
      border-bottom: 1px solid var(--border-subtle);
      transition: background 0.15s;
}

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

.suggestion-item:hover, .suggestion-item:active {
      background: rgba(255, 255, 255, 0.05);
}

.suggestion-item.manual {
      background: rgba(249, 203, 0, 0.05);
}

.suggestion-icon {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: var(--gold);
      color: var(--dark);
      display: flex;
      align-items: center;
      justify-content: center;
}

.suggestion-avatar {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: var(--surface);
      color: var(--text);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      font-weight: 600;
}

.suggestion-details {
      flex: 1;
      min-width: 0;
}

.suggestion-name {
      font-weight: 500;
      font-size: 14px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
}

.suggestion-meta {
      font-size: 12px;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      gap: 8px;
}

.suggestion-badge {
      background: rgba(255, 255, 255, 0.1);
      padding: 2px 6px;
      border-radius: 4px;
      font-size: 10px;
      text-transform: uppercase;
}

.suggestion-empty {
      padding: 20px;
      text-align: center;
      color: var(--text-muted);
      font-size: 13px;
}

.compose-channels {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
}

.channel-chip {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 10px 16px;
      border-radius: 20px;
      border: 1px solid var(--border-subtle);
      background: var(--surface-elevated);
      color: var(--text-muted);
      font-size: 13px;
      cursor: pointer;
      transition: all 0.2s;
}

.channel-chip input {
      display: none;
}

.channel-chip.selected {
      background: var(--gold);
      color: var(--dark);
      border-color: var(--gold);
}

.channel-chip:hover:not(.selected) {
      border-color: var(--gold);
      color: var(--text);
}

.quick-templates {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
}

.template-chip {
      padding: 8px 14px;
      border-radius: 16px;
      border: 1px solid var(--border-subtle);
      background: transparent;
      color: var(--text-muted);
      font-size: 12px;
      cursor: pointer;
      transition: all 0.2s;
}

.template-chip:hover {
      border-color: var(--gold);
      color: var(--gold);
}

.compose-footer {
      display: flex;
      gap: 12px;
      padding: 16px 20px;
      border-top: 1px solid var(--border-subtle);
      background: var(--surface);
}

.compose-footer .btn-modern {
      flex: 1;
      justify-content: center;
}

/* === MESSAGES PAGE MOBILE === */
@media (max-width: 768px) {
      #page-messages .messages-container {
        flex-direction: column;
        height: calc(100vh - 160px);
      }

      #page-messages .conversations-list {
        width: 100%;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        transition: max-height 0.3s ease;
      }

      #page-messages .conversations-list.collapsed {
        max-height: 70px;
        overflow: hidden;
      }

      #page-messages .conversations-list.collapsed .conversations-items {
        display: none;
      }

      #page-messages .message-thread {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
      }

      #page-messages .thread-messages {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 16px;
        padding-bottom: 8px;
      }

      #page-messages .message-input-area {
        position: sticky;
        bottom: 0;
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
        background: var(--surface);
        border-top: 1px solid var(--border-subtle);
      }

      .message-bubble {
        max-width: 85%;
      }

      /* Better touch targets on mobile */
      .conversation-item {
        padding: 16px;
        min-height: 72px;
      }

      .conversation-item .avatar-modern {
        width: 48px;
        height: 48px;
      }

      .thread-actions button {
        min-width: 44px;
        min-height: 44px;
      }

      /* Mobile conversation toggle */
      .conversations-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        background: var(--surface-elevated);
        cursor: pointer;
        border-bottom: 1px solid var(--border-subtle);
      }

      .conversations-toggle h4 {
        font-size: 14px;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 8px;
      }

      .conversations-toggle .toggle-icon {
        transition: transform 0.2s;
      }

      .conversations-toggle.collapsed .toggle-icon {
        transform: rotate(180deg);
      }
}

/* Message Bubble Actions */
.message-bubble-wrapper {
      position: relative;
      display: flex;
      flex-direction: column;
      max-width: 70%;
}

.message-bubble-wrapper.outbound {
      margin-left: auto;
      align-items: flex-end;
}

.message-bubble-wrapper.inbound {
      margin-right: auto;
      align-items: flex-start;
}

.message-bubble-wrapper:hover .message-actions {
      opacity: 1;
      visibility: visible;
}

.message-actions {
      display: flex;
      gap: 4px;
      margin-top: 4px;
      opacity: 0;
      visibility: hidden;
      transition: opacity 0.2s, visibility 0.2s;
}

.message-bubble-wrapper.outbound .message-actions {
      justify-content: flex-end;
}

.message-action-btn {
      background: rgba(255, 255, 255, 0.05);
      border: none;
      border-radius: 4px;
      padding: 4px 8px;
      font-size: 11px;
      color: var(--text-muted);
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 4px;
      transition: all 0.2s;
}

.message-action-btn:hover {
      background: rgba(255, 255, 255, 0.1);
      color: var(--text);
}

.message-action-btn.delete:hover {
      background: rgba(244, 67, 54, 0.15);
      color: var(--error);
}

.message-action-btn svg {
      width: 12px;
      height: 12px;
}

/* Mobile: always show actions */
@media (max-width: 768px) {
      .message-actions {
        opacity: 1;
        visibility: visible;
      }

      .message-action-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-height: 32px;
      }
}

/* Message status indicator */
.message-status {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      margin-left: 6px;
}

.message-status svg {
      width: 12px;
      height: 12px;
}

.message-status.sent { color: var(--text-muted); }
.message-status.delivered { color: var(--info); }
.message-status.read { color: var(--success); }

/* Notification detail card improvements */
.notif-detail-card {
      background: var(--surface-elevated);
      border-radius: 16px;
      border: 1px solid var(--border-subtle);
      overflow: hidden;
      margin: 20px;
}

.notif-detail-header {
      padding: 20px;
      border-bottom: 1px solid var(--border-subtle);
      display: flex;
      justify-content: space-between;
      align-items: center;
}

.notif-detail-header h3 {
      font-size: 18px;
      font-weight: 600;
}

.notif-time {
      font-size: 12px;
      color: var(--text-muted);
}

.notif-detail-body {
      padding: 20px;
}

.notif-detail-body p {
      color: var(--text-secondary);
      line-height: 1.6;
}

.detail-row {
      padding: 8px 0;
      border-bottom: 1px solid var(--border-subtle);
      font-size: 14px;
}

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

.detail-row strong {
      color: var(--text-muted);
      min-width: 80px;
      display: inline-block;
}

.notif-detail-contact {
      padding: 16px 20px;
      background: rgba(255, 255, 255, 0.02);
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
}

.contact-link {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      color: var(--gold);
      text-decoration: none;
      font-size: 13px;
      padding: 8px 12px;
      background: rgba(249, 203, 0, 0.1);
      border-radius: 8px;
      transition: all 0.2s;
}

.contact-link:hover {
      background: rgba(249, 203, 0, 0.2);
}

.notif-detail-actions {
      padding: 16px 20px;
      display: flex;
      gap: 12px;
      border-top: 1px solid var(--border-subtle);
}

.notif-detail-actions .btn-modern {
      flex: 1;
      justify-content: center;
}

/* Unread dot indicator */
.notif-unread-dot {
      width: 8px;
      height: 8px;
      background: var(--gold);
      border-radius: 50%;
      display: inline-block;
      margin-right: 6px;
      animation: pulse-dot 2s infinite;
}

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

.conversation-item.unread .conversation-name {
      font-weight: 700;
}

.conversation-item.unread .conversation-preview {
      color: var(--text-secondary);
}

/* Notif avatar colors */
.notif-avatar {
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 12px;
}

.notif-avatar.gold { background: rgba(249, 203, 0, 0.15); color: var(--gold); }
.notif-avatar.green { background: rgba(76, 175, 80, 0.15); color: #4caf50; }
.notif-avatar.blue { background: rgba(33, 150, 243, 0.15); color: #2196f3; }
.notif-avatar.purple { background: rgba(156, 39, 176, 0.15); color: #9c27b0; }
.notif-avatar.pink { background: rgba(233, 30, 99, 0.15); color: #e91e63; }
.notif-avatar.gray { background: rgba(158, 158, 158, 0.15); color: #9e9e9e; }

/* Message content styling */
.message-content {
      white-space: pre-wrap;
      word-break: break-word;
      line-height: 1.5;
}

.message-meta {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-top: 6px;
      flex-wrap: wrap;
}

.message-bubble.outbound .message-meta {
      justify-content: flex-end;
}

/* Show mobile toggle only on small screens */
@media (max-width: 768px) {
      .conversations-toggle {
        display: flex !important;
      }

      .conversations-list.collapsed .conversations-header,
      .conversations-list.collapsed .conversations-items {
        display: none;
      }
}

@media (min-width: 769px) {
      .conversations-toggle {
        display: none !important;
      }
}

      /* Compose Modal - Bottom Sheet on Mobile */
      #compose-message-modal {
        align-items: flex-end;
        padding: 0;
      }

      .compose-modal {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 20px 20px 0 0;
        margin: 0;
      }

      .compose-modal .modal-header {
        position: sticky;
        top: 0;
        background: var(--surface-elevated);
        z-index: 5;
        border-radius: 20px 20px 0 0;
      }

      .compose-modal .modal-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        background: var(--border-subtle);
        border-radius: 2px;
      }

      .compose-section {
        padding: 14px 16px;
      }

      .compose-input,
      .compose-textarea {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 14px;
      }

      .compose-channels {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
      }

      .channel-chip {
        justify-content: center;
        padding: 12px 8px;
        font-size: 12px;
      }

      .quick-templates {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
      }

      .template-chip {
        flex-shrink: 0;
        white-space: nowrap;
      }

      .compose-footer {
        padding: 16px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
      }

      .compose-suggestions {
        max-height: 200px;
      }
}

/* === GLOBAL SEARCH BAR MOBILE STYLES === */
@media (max-width: 768px) {
      .search-bar-modern {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
      }

      .search-bar-modern input {
        width: 100%;
        min-height: 44px;
        font-size: 16px !important;
      }

      /* Input groups full width */
      .input-group,
      .form-group {
        width: 100%;
      }

      /* Button groups stack on mobile */
      .btn-group,
      .button-group {
        flex-direction: column;
        width: 100%;
      }

      .btn-group .btn,
      .btn-group .btn-modern,
      .button-group .btn,
      .button-group .btn-modern {
        width: 100%;
        justify-content: center;
      }

      /* Table header layouts */
      .table-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
      }

      .table-header > div {
        width: 100%;
      }

      .table-header .btn-modern {
        width: 100%;
        justify-content: center;
      }

      .table-title {
        margin-bottom: 8px;
      }
}

/* === GLOBAL MOBILE MODAL IMPROVEMENTS === */
@media (max-width: 768px) {
      /* All modals bottom sheet style */
      .modal-overlay,
      .modal-modern-overlay {
        align-items: flex-end !important;
      }

      .modal,
      .modal-modern,
      .modal {
        max-width: 100% !important;
        width: 100% !important;
        max-height: 90vh !important;
        max-height: 90dvh !important;
        margin: 0 !important;
        border-radius: 20px 20px 0 0 !important;
        animation: slideUp 0.3s ease;
      }

      @keyframes slideUp {
        from {
          transform: translateY(100%);
        }
        to {
          transform: translateY(0);
        }
      }

      /* Modal drag handle indicator */
      .modal-header::before,
      .modal-modern-header::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: var(--border-light);
        border-radius: 2px;
        margin: 0 auto 12px;
      }

      /* Sticky headers and footers */
      .modal-header,
      .modal-modern-header {
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--dark-surface);
      }

      .modal-footer,
      .modal-modern-footer {
        position: sticky;
        bottom: 0;
        z-index: 10;
        background: var(--dark-surface);
        padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important;
      }

      .modal-footer .btn,
      .modal-footer .btn-modern,
      .modal-modern-footer .btn,
      .modal-modern-footer .btn-modern {
        flex: 1;
        justify-content: center;
        min-height: 48px;
      }
}

/* === GLOBAL TABLE MOBILE STYLES === */
@media (max-width: 768px) {
      /* Convert tables to card-like rows */
      table.data-table,
      .table-container table {
        display: block;
      }

      table.data-table thead,
      .table-container thead {
        display: none;
      }

      table.data-table tbody,
      .table-container tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
      }

      table.data-table tr,
      .table-container tr {
        display: flex;
        flex-direction: column;
        background: var(--dark-elevated);
        border-radius: 12px;
        padding: 16px;
        border: 1px solid var(--border-subtle);
      }

      table.data-table td,
      .table-container td {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border: none;
        border-bottom: 1px solid var(--border-subtle);
      }

      table.data-table td:last-child,
      .table-container td:last-child {
        border-bottom: none;
      }

      table.data-table td::before,
      .table-container td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 12px;
        text-transform: uppercase;
      }
}

/* === MOBILE FLOATING ACTION BUTTON === */
@media (max-width: 768px) {
      .fab-modern {
        position: fixed;
        bottom: calc(20px + env(safe-area-inset-bottom));
        right: 20px;
        width: 56px;
        height: 56px;
        border-radius: 16px;
        background: var(--gold-primary);
        color: var(--dark-primary);
        border: none;
        box-shadow: 0 4px 16px rgba(249, 203, 0, 0.4);
        z-index: 100;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s ease;
      }

      .fab-modern:active {
        transform: scale(0.95);
      }

      .fab-modern svg {
        width: 24px;
        height: 24px;
      }
}

/* === GLOBAL MOBILE POLISH === */
@media (max-width: 991px) {
      /* Smooth scrolling for all scrollable areas */
      html, body {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
      }

      /* Prevent horizontal overflow */
      body {
        overflow-x: hidden;
      }

      /* Better focus states for accessibility */
      input:focus,
      select:focus,
      textarea:focus,
      button:focus,
      .btn:focus,
      .btn-modern:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(249, 203, 0, 0.3);
      }

      /* Prevent text selection on interactive elements */
      button,
      .btn,
      .btn-modern,
      .nav-item,
      .filter-btn,
      .filter-pill,
      .tab-btn {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
      }

      /* Loading states */
      .loading,
      .skeleton {
        background: linear-gradient(90deg, var(--dark-elevated) 25%, var(--dark-surface) 50%, var(--dark-elevated) 75%);
        background-size: 200% 100%;
        animation: shimmer 1.5s infinite;
      }

      /* Better spacing for content areas */
      .content-area {
        padding: 16px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
      }

      /* Card spacing on mobile */
      .card {
        margin-bottom: 16px;
        border-radius: 12px;
      }

      .card-header {
        padding: 14px 16px;
      }

      .card-body {
        padding: 16px;
      }

      /* Pull to refresh indicator area */
      .main-content {
        padding-top: 0;
      }

      /* Toast notifications mobile positioning */
      .toast,
      .toast-notification {
        left: 16px !important;
        right: 16px !important;
        bottom: calc(20px + env(safe-area-inset-bottom)) !important;
        max-width: none !important;
        border-radius: 12px !important;
      }

      /* Context menu mobile */
      .context-menu {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        max-width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        padding-bottom: env(safe-area-inset-bottom);
        animation: slideUp 0.2s ease;
      }

      .context-menu-item {
        padding: 16px 20px;
        min-height: 52px;
        font-size: 15px;
      }

      /* Dropdown menus mobile */
      .dropdown-menu {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        max-width: 100% !important;
        max-height: 60vh !important;
        border-radius: 20px 20px 0 0 !important;
        padding-bottom: env(safe-area-inset-bottom);
      }

      /* Spinner sizing */
      .spinner,
      .loading-spinner {
        width: 32px;
        height: 32px;
        border-width: 3px;
      }

      /* Status badges */
      .status-badge,
      .badge-modern {
        padding: 5px 10px;
        font-size: 11px;
        border-radius: 20px;
      }

      /* Action buttons consistent sizing */
      .actions-row,
      .action-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }

      .actions-row .btn-modern,
      .action-buttons .btn-modern {
        flex: 1 1 auto;
        min-width: 80px;
        justify-content: center;
      }

      /* Transitions for smoother animations */
      * {
        -webkit-tap-highlight-color: transparent;
      }

      /* Safe area padding for fixed elements */
      .fixed-bottom {
        padding-bottom: env(safe-area-inset-bottom);
      }

      .fixed-top {
        padding-top: env(safe-area-inset-top);
      }
}

/* Very small phones adjustments */
@media (max-width: 360px) {
      .content-area {
        padding: 12px;
      }

      .card-header,
      .card-body {
        padding: 12px;
      }

      .btn-modern {
        padding: 10px 14px;
        font-size: 13px;
      }

      .stats-grid {
        gap: 8px;
      }

      .stat-card {
        padding: 12px;
      }

      .stat-value {
        font-size: 18px;
      }

      .stat-label {
        font-size: 11px;
      }
}

/* ============================================
       SKELETON LOADING STATES
       ============================================ */
.skeleton {
      background: linear-gradient(90deg,
        var(--dark-elevated) 0%,
        rgba(255, 255, 255, 0.08) 50%,
        var(--dark-elevated) 100%);
      background-size: 200% 100%;
      animation: shimmer 1.5s ease-in-out infinite;
      border-radius: 6px;
}

.skeleton-text {
      height: 14px;
      margin-bottom: 8px;
}

.skeleton-text.short { width: 40%; }
.skeleton-text.medium { width: 70%; }
.skeleton-text.long { width: 100%; }

.skeleton-avatar {
      width: 44px;
      height: 44px;
      border-radius: 50%;
}

.skeleton-card {
      padding: 16px;
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
}

.skeleton-row {
      display: flex;
      gap: 16px;
      align-items: center;
      padding: 16px;
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
      margin-bottom: 8px;
}

.skeleton-row .skeleton-content {
      flex: 1;
}

.skeleton-badge {
      width: 80px;
      height: 24px;
      border-radius: 20px;
}

.skeleton-stat {
      height: 32px;
      width: 60px;
      margin-bottom: 8px;
}

/* Mobile horizontal scroll for filter pills */
@media (max-width: 480px) {
      .filter-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 8px;
        margin: 0 -16px;
        padding-left: 16px;
        padding-right: 16px;
      }

      .filter-pills::-webkit-scrollbar {
        display: none;
      }

      .filter-pill {
        flex-shrink: 0;
      }

      /* Search filters stack vertically on mobile */
      .search-filters-row {
        flex-direction: column !important;
      }

      .search-filters-row > * {
        width: 100% !important;
        min-width: unset !important;
      }

      /* Selects take full width on small screens */
      select {
        min-width: unset !important;
        width: 100%;
      }
}

/* ============================================
       MODERN LIST STYLES
       ============================================ */
.list-modern {
      display: flex;
      flex-direction: column;
      gap: 8px;
}

.list-item-modern {
      display: flex;
      align-items: center;
      gap: 16px;
      padding: 16px;
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
      cursor: pointer;
      transition: all 0.2s ease;
}

.list-item-modern:hover {
      background: var(--dark-surface);
      border-color: var(--border-light);
      transform: translateX(4px);
}

.list-item-modern:active {
      transform: scale(0.98);
}

.list-item-icon {
      width: 44px;
      height: 44px;
      min-width: 44px;
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(249, 203, 0, 0.1);
}

.list-item-content {
      flex: 1;
      min-width: 0;
}

.list-item-title {
      font-weight: 600;
      font-size: 15px;
      color: var(--text-primary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
}

.list-item-subtitle {
      font-size: 13px;
      color: var(--text-muted);
      margin-top: 2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
}

.list-item-meta {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 6px;
      flex-shrink: 0;
}

.list-item-date {
      font-size: 12px;
      color: var(--text-muted);
}

/* Badge Modern Styles - Enhanced for dark mode */
.badge-modern {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 5px 12px;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.3px;
}

.badge-modern.badge-new,
.badge-new {
      background: linear-gradient(135deg, rgba(249, 203, 0, 0.25) 0%, rgba(249, 203, 0, 0.12) 100%);
      color: #fcd34d;
      box-shadow: inset 0 0 0 1px rgba(249, 203, 0, 0.35);
}

.badge-modern.badge-contacted,
.badge-contacted {
      background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(59, 130, 246, 0.12) 100%);
      color: #93c5fd;
      box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.badge-modern.badge-qualified,
.badge-qualified {
      background: linear-gradient(135deg, rgba(139, 92, 246, 0.25) 0%, rgba(139, 92, 246, 0.12) 100%);
      color: #c4b5fd;
      box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.35);
}

.badge-modern.badge-quoted,
.badge-quoted {
      background: linear-gradient(135deg, rgba(6, 182, 212, 0.25) 0%, rgba(6, 182, 212, 0.12) 100%);
      color: #67e8f9;
      box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.35);
}

.badge-modern.badge-won,
.badge-modern.badge-approved,
.badge-modern.badge-paid,
.badge-modern.badge-completed,
.badge-won, .badge-approved, .badge-paid, .badge-completed {
      background: linear-gradient(135deg, rgba(34, 197, 94, 0.25) 0%, rgba(34, 197, 94, 0.12) 100%);
      color: #86efac;
      box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.35);
}

.badge-modern.badge-lost,
.badge-modern.badge-cancelled,
.badge-modern.badge-overdue,
.badge-lost, .badge-cancelled, .badge-overdue {
      background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(239, 68, 68, 0.12) 100%);
      color: #fca5a5;
      box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.35);
}

.badge-modern.badge-archived,
.badge-modern.badge-draft,
.badge-archived, .badge-draft {
      background: linear-gradient(135deg, rgba(107, 114, 128, 0.25) 0%, rgba(107, 114, 128, 0.12) 100%);
      color: #d1d5db;
      box-shadow: inset 0 0 0 1px rgba(107, 114, 128, 0.35);
}

.badge-modern.badge-sent,
.badge-sent {
      background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(59, 130, 246, 0.12) 100%);
      color: #93c5fd;
      box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.badge-modern.badge-scheduled,
.badge-scheduled {
      background: linear-gradient(135deg, rgba(139, 92, 246, 0.25) 0%, rgba(139, 92, 246, 0.12) 100%);
      color: #c4b5fd;
      box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.35);
}

.badge-modern.badge-in_progress,
.badge-in_progress {
      background: linear-gradient(135deg, rgba(6, 182, 212, 0.25) 0%, rgba(6, 182, 212, 0.12) 100%);
      color: #67e8f9;
      box-shadow: inset 0 0 0 1px rgba(6, 182, 212, 0.35);
}

.badge-modern.badge-lead,
.badge-lead {
      background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(245, 158, 11, 0.12) 100%);
      color: #fcd34d;
      box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.35);
}

.badge-modern.badge-on_hold,
.badge-on_hold {
      background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(239, 68, 68, 0.12) 100%);
      color: #fca5a5;
      box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.35);
}

/* Button Modern Styles */
.btn-modern {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 12px 20px;
      border-radius: 10px;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      border: none;
      transition: all 0.2s ease;
      text-decoration: none;
      white-space: nowrap;
}

.btn-modern.primary {
      background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
      color: var(--dark-primary);
}

.btn-modern.primary:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 16px rgba(249, 203, 0, 0.3);
}

.btn-modern.secondary {
      background: rgba(255, 255, 255, 0.05);
      color: var(--text-primary);
      border: 1px solid var(--border-light);
}

.btn-modern.secondary:hover {
      background: rgba(255, 255, 255, 0.1);
      border-color: var(--gold-primary);
}

.btn-modern.ghost {
      background: transparent;
      color: var(--text-secondary);
}

.btn-modern.ghost:hover {
      background: rgba(255, 255, 255, 0.05);
      color: var(--text-primary);
}

.btn-modern.danger {
      background: rgba(239, 68, 68, 0.15);
      color: #ef4444;
      border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-modern.danger:hover {
      background: rgba(239, 68, 68, 0.25);
}

.btn-modern:disabled {
      opacity: 0.5;
      cursor: not-allowed;
      transform: none !important;
}

/* List Item Mobile Responsive */
@media (max-width: 480px) {
      .list-item-modern {
        flex-wrap: wrap;
        gap: 12px;
      }

      .list-item-content {
        flex: 1 1 calc(100% - 60px);
      }

      .list-item-meta {
        flex: 1 1 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding-top: 8px;
        border-top: 1px solid var(--border-subtle);
      }
}

/* ============================================
       LISTINGS GRID & CARDS
       ============================================ */
.listings-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 20px;
}

.listing-card {
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
      overflow: hidden;
      transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.listing-card:hover {
      transform: translateY(-4px);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.listing-image {
      position: relative;
      width: 100%;
      height: 160px;
      background: var(--dark-surface);
}

.listing-image img {
      width: 100%;
      height: 100%;
      object-fit: cover;
}

.listing-status-badge {
      position: absolute;
      top: 10px;
      right: 10px;
      padding: 4px 10px;
      border-radius: 12px;
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
}

.listing-status-badge.active {
      background: rgba(77, 255, 130, 0.2);
      color: var(--success);
}

.listing-status-badge.sold {
      background: rgba(255, 71, 87, 0.2);
      color: var(--error);
}

/* ============================================
       ENHANCED PROJECT MANAGEMENT UI
       ============================================ */

/* Dashboard Stats - Enhanced */
.stats-dashboard {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 20px;
      margin-bottom: 32px;
}

.stat-card-enhanced {
      background: linear-gradient(145deg, var(--dark-elevated), var(--dark-surface));
      border: 1px solid var(--border-subtle);
      border-radius: 16px;
      padding: 24px;
      position: relative;
      overflow: hidden;
      transition: all 0.3s ease;
}

.stat-card-enhanced::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 3px;
      background: linear-gradient(90deg, var(--gold-primary), transparent);
      opacity: 0;
      transition: opacity 0.3s;
}

.stat-card-enhanced:hover {
      transform: translateY(-4px);
      box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
      border-color: var(--gold-primary);
}

.stat-card-enhanced:hover::before {
      opacity: 1;
}

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

.stat-card-enhanced .stat-icon-wrapper {
      width: 48px;
      height: 48px;
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
}

.stat-card-enhanced .stat-icon-wrapper.gold { background: rgba(249, 203, 0, 0.15); color: var(--gold-primary); }
.stat-card-enhanced .stat-icon-wrapper.blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.stat-card-enhanced .stat-icon-wrapper.green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.stat-card-enhanced .stat-icon-wrapper.purple { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }
.stat-card-enhanced .stat-icon-wrapper.red { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.stat-card-enhanced .stat-trend {
      display: flex;
      align-items: center;
      gap: 4px;
      font-size: 12px;
      font-weight: 500;
}

.stat-card-enhanced .stat-trend.up { color: #10b981; }
.stat-card-enhanced .stat-trend.down { color: #ef4444; }

.stat-card-enhanced .stat-value-large {
      font-size: 36px;
      font-weight: 800;
      color: var(--text-primary);
      line-height: 1.1;
      margin-bottom: 4px;
}

.stat-card-enhanced .stat-label-enhanced {
      font-size: 13px;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
}

/* Project Card - Enhanced */
.project-card {
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 16px;
      overflow: hidden;
      transition: all 0.3s ease;
}

.project-card:hover {
      transform: translateY(-4px);
      box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
      border-color: rgba(249, 203, 0, 0.3);
}

.project-card-header {
      padding: 20px;
      border-bottom: 1px solid var(--border-subtle);
      display: flex;
      align-items: flex-start;
      gap: 16px;
}

.project-avatar {
      width: 56px;
      height: 56px;
      border-radius: 14px;
      background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 20px;
      color: var(--dark-primary);
      flex-shrink: 0;
}

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

.project-title {
      font-size: 18px;
      font-weight: 700;
      color: var(--text-primary);
      margin-bottom: 4px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
}

.project-client {
      font-size: 14px;
      color: var(--text-secondary);
      display: flex;
      align-items: center;
      gap: 8px;
}

.project-card-body {
      padding: 20px;
}

.project-meta-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 16px;
      margin-bottom: 16px;
}

.project-meta-item {
      display: flex;
      flex-direction: column;
      gap: 4px;
}

.project-meta-label {
      font-size: 11px;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
}

.project-meta-value {
      font-size: 15px;
      font-weight: 600;
      color: var(--text-primary);
}

/* Progress Bar - Enhanced */
.progress-bar-container {
      margin-top: 16px;
}

.progress-bar-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
}

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

.progress-bar-percent {
      font-size: 14px;
      font-weight: 600;
      color: var(--gold-primary);
}

.progress-bar-track {
      height: 8px;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 4px;
      overflow: hidden;
}

.progress-bar-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--gold-primary), var(--gold-dark));
      border-radius: 4px;
      transition: width 0.5s ease;
      position: relative;
}

.progress-bar-fill::after {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
      animation: shimmer 2s infinite;
}

/* Kanban Board - Enhanced */
.kanban-board {
      display: flex;
      gap: 16px;
      overflow-x: auto;
      padding: 8px 0 24px;
      scroll-behavior: smooth;
      -webkit-overflow-scrolling: touch;
}

.kanban-board::-webkit-scrollbar {
      height: 8px;
}

.kanban-board::-webkit-scrollbar-track {
      background: rgba(255, 255, 255, 0.05);
      border-radius: 4px;
}

.kanban-board::-webkit-scrollbar-thumb {
      background: var(--gold-primary);
      border-radius: 4px;
}

.kanban-column {
      flex: 0 0 280px;
      min-width: 280px;
      background: var(--dark-surface);
      border: 1px solid var(--border-subtle);
      border-radius: 16px;
      overflow: hidden;
}

.kanban-column-header {
      padding: 16px 20px;
      background: rgba(255, 255, 255, 0.02);
      border-bottom: 1px solid var(--border-subtle);
      display: flex;
      align-items: center;
      justify-content: space-between;
}

.kanban-column-title {
      display: flex;
      align-items: center;
      gap: 10px;
      font-weight: 600;
      font-size: 14px;
}

.kanban-column-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
}

.kanban-column-dot.lead { background: #f59e0b; }
.kanban-column-dot.approved { background: #3b82f6; }
.kanban-column-dot.scheduled { background: #8b5cf6; }
.kanban-column-dot.in-progress { background: #06b6d4; }
.kanban-column-dot.completed { background: #10b981; }

.kanban-column-count {
      background: rgba(255, 255, 255, 0.1);
      padding: 4px 10px;
      border-radius: 12px;
      font-size: 12px;
      font-weight: 600;
}

.kanban-cards {
      padding: 16px;
      max-height: 500px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 12px;
}

.kanban-cards::-webkit-scrollbar {
      width: 4px;
}

.kanban-cards::-webkit-scrollbar-track {
      background: transparent;
}

.kanban-cards::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.2);
      border-radius: 2px;
}

.kanban-card {
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
      padding: 16px;
      cursor: pointer;
      transition: all 0.2s ease;
}

.kanban-card:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
      border-color: var(--gold-primary);
}

.kanban-card-title {
      font-weight: 600;
      font-size: 14px;
      margin-bottom: 8px;
      color: var(--text-primary);
}

.kanban-card-client {
      font-size: 13px;
      color: var(--text-secondary);
      margin-bottom: 12px;
}

.kanban-card-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-top: 12px;
      border-top: 1px solid var(--border-subtle);
}

.kanban-card-amount {
      font-weight: 700;
      font-size: 15px;
      color: var(--gold-primary);
}

.kanban-card-date {
      font-size: 12px;
      color: var(--text-muted);
}

/* Workflow Timeline */
.workflow-timeline {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 24px;
      background: var(--dark-elevated);
      border-radius: 16px;
      border: 1px solid var(--border-subtle);
      margin-bottom: 24px;
      position: relative;
}

.workflow-timeline::before {
      content: '';
      position: absolute;
      top: 50%;
      left: 80px;
      right: 80px;
      height: 2px;
      background: var(--border-subtle);
      transform: translateY(-50%);
      z-index: 0;
}

.workflow-step {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      position: relative;
      z-index: 1;
}

.workflow-step-icon {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--dark-surface);
      border: 2px solid var(--border-subtle);
      transition: all 0.3s;
}

.workflow-step.active .workflow-step-icon {
      background: var(--gold-primary);
      border-color: var(--gold-primary);
      color: var(--dark-primary);
      box-shadow: 0 0 20px rgba(249, 203, 0, 0.4);
}

.workflow-step.completed .workflow-step-icon {
      background: #10b981;
      border-color: #10b981;
      color: white;
}

.workflow-step-label {
      font-size: 12px;
      font-weight: 500;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
}

.workflow-step.active .workflow-step-label {
      color: var(--gold-primary);
}

.workflow-step.completed .workflow-step-label {
      color: #10b981;
}

/* Quick Action Bar */
.quick-action-bar {
      display: flex;
      gap: 12px;
      padding: 16px 24px;
      background: var(--dark-elevated);
      border-radius: 14px;
      border: 1px solid var(--border-subtle);
      margin-bottom: 24px;
      flex-wrap: wrap;
}

.quick-action-btn {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 10px 16px;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid var(--border-subtle);
      border-radius: 10px;
      color: var(--text-secondary);
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s;
}

.quick-action-btn:hover {
      background: rgba(249, 203, 0, 0.1);
      border-color: var(--gold-primary);
      color: var(--gold-primary);
}

.quick-action-btn svg {
      width: 18px;
      height: 18px;
}

/* Lead card quick action buttons - compact version */
.lead-quick-actions {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      border-top: 1px solid var(--border-subtle);
      padding-top: 12px;
      margin-top: auto;
}

.lead-quick-actions .btn-action {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      padding: 6px 10px;
      background: var(--dark-surface);
      border: 1px solid var(--border-subtle);
      border-radius: 6px;
      color: var(--text-secondary);
      font-size: 11px;
      cursor: pointer;
      transition: all 0.15s;
      white-space: nowrap;
}

.lead-quick-actions .btn-action:hover {
      transform: translateY(-1px);
}

.lead-quick-actions .btn-action.call:hover {
      background: rgba(34, 197, 94, 0.15);
      color: #22c55e;
      border-color: rgba(34, 197, 94, 0.4);
}

.lead-quick-actions .btn-action.email:hover {
      background: rgba(59, 130, 246, 0.15);
      color: #3b82f6;
      border-color: rgba(59, 130, 246, 0.4);
}

.lead-quick-actions .btn-action.status:hover {
      background: rgba(245, 158, 11, 0.15);
      color: #f59e0b;
      border-color: rgba(245, 158, 11, 0.4);
}

.lead-quick-actions .btn-action.project:hover {
      background: rgba(139, 92, 246, 0.15);
      color: #8b5cf6;
      border-color: rgba(139, 92, 246, 0.4);
}

.lead-quick-actions .btn-action.archive:hover {
      background: rgba(107, 114, 128, 0.15);
      color: #9ca3af;
      border-color: rgba(107, 114, 128, 0.4);
}

.lead-quick-actions .btn-action.delete:hover {
      background: rgba(239, 68, 68, 0.15);
      color: #ef4444;
      border-color: rgba(239, 68, 68, 0.4);
}

/* Project quick actions on list items */
.project-quick-actions {
      display: flex;
      gap: 4px;
      opacity: 0;
      transition: opacity 0.15s;
}

.list-item-modern:hover .project-quick-actions {
      opacity: 1;
}

.project-quick-actions button {
      width: 28px;
      height: 28px;
      border-radius: 6px;
      border: 1px solid var(--border-subtle);
      background: var(--dark-surface);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
      transition: all 0.15s;
}

.project-quick-actions button:hover {
      transform: scale(1.1);
}

.project-quick-actions button.status:hover {
      background: var(--gold-primary);
      color: var(--dark-primary);
}

.project-quick-actions button.schedule:hover {
      background: #3b82f6;
      color: #fff;
}

.project-quick-actions button.task:hover {
      background: #22c55e;
      color: #fff;
}

/* Kanban card quick actions */
.kanban-quick-actions {
      display: none;
      gap: 4px;
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px solid var(--dark-border);
}

.kanban-card:hover .kanban-quick-actions {
      display: flex;
}

.kanban-quick-actions button {
      flex: 1;
      padding: 6px;
      border: none;
      border-radius: 4px;
      font-size: 11px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      transition: all 0.15s;
}

.kanban-quick-actions button.schedule {
      background: rgba(59, 130, 246, 0.15);
      color: #3b82f6;
}

.kanban-quick-actions button.task {
      background: rgba(34, 197, 94, 0.15);
      color: #22c55e;
}

.kanban-quick-actions button:hover {
      transform: scale(1.02);
      filter: brightness(1.1);
}

/* Empty State - Enhanced */
.empty-state-enhanced {
      text-align: center;
      padding: 60px 40px;
      background: var(--dark-elevated);
      border: 2px dashed var(--border-subtle);
      border-radius: 20px;
      margin: 24px 0;
}

.empty-state-enhanced svg {
      width: 80px;
      height: 80px;
      color: var(--text-muted);
      margin-bottom: 20px;
      opacity: 0.5;
}

.empty-state-enhanced h3 {
      font-size: 20px;
      font-weight: 700;
      color: var(--text-primary);
      margin-bottom: 8px;
}

.empty-state-enhanced p {
      font-size: 14px;
      color: var(--text-muted);
      max-width: 400px;
      margin: 0 auto 24px;
      line-height: 1.6;
}

/* Data Table - Enhanced */
.data-table-wrapper {
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 16px;
      overflow: hidden;
}

.data-table {
      width: 100%;
      border-collapse: collapse;
}

.data-table th {
      padding: 16px 20px;
      text-align: left;
      font-size: 11px;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      background: rgba(255, 255, 255, 0.02);
      border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
      padding: 16px 20px;
      font-size: 14px;
      color: var(--text-primary);
      border-bottom: 1px solid var(--border-subtle);
}

.data-table tr:last-child td {
      border-bottom: none;
}

.data-table tr:hover td {
      background: rgba(255, 255, 255, 0.02);
}

/* Priority Indicators */
.priority-indicator {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      font-weight: 500;
}

.priority-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
}

.priority-high .priority-dot { background: #ef4444; }
.priority-medium .priority-dot { background: #f59e0b; }
.priority-low .priority-dot { background: #10b981; }

.priority-high { color: #ef4444; }
.priority-medium { color: #f59e0b; }
.priority-low { color: #10b981; }

/* Due Date Styling */
.due-date {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 13px;
      padding: 4px 10px;
      border-radius: 6px;
}

.due-date.overdue {
      background: rgba(239, 68, 68, 0.15);
      color: #ef4444;
}

.due-date.due-soon {
      background: rgba(245, 158, 11, 0.15);
      color: #f59e0b;
}

.due-date.on-track {
      background: rgba(16, 185, 129, 0.15);
      color: #10b981;
}

/* Activity Feed */
.activity-feed {
      display: flex;
      flex-direction: column;
      gap: 0;
}

.activity-item {
      display: flex;
      gap: 16px;
      padding: 16px 0;
      border-bottom: 1px solid var(--border-subtle);
}

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

.activity-icon {
      width: 36px;
      height: 36px;
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
}

.activity-icon.create { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.activity-icon.update { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.activity-icon.delete { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.activity-icon.payment { background: rgba(249, 203, 0, 0.15); color: var(--gold-primary); }
.activity-icon.message { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }

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

.activity-text {
      font-size: 14px;
      color: var(--text-primary);
      margin-bottom: 4px;
}

.activity-text strong {
      font-weight: 600;
      color: var(--gold-primary);
}

.activity-time {
      font-size: 12px;
      color: var(--text-muted);
}

/* Filter Tabs - Enhanced */
.filter-tabs {
      display: flex;
      gap: 4px;
      padding: 4px;
      background: rgba(255, 255, 255, 0.03);
      border-radius: 12px;
      margin-bottom: 20px;
}

.filter-tab {
      flex: 1;
      padding: 10px 16px;
      font-size: 13px;
      font-weight: 500;
      color: var(--text-muted);
      background: transparent;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.2s;
      text-align: center;
}

.filter-tab:hover {
      color: var(--text-primary);
      background: rgba(255, 255, 255, 0.05);
}

.filter-tab.active {
      background: var(--gold-primary);
      color: var(--dark-primary);
      font-weight: 600;
}

/* Responsive Grid Utilities */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

@media (max-width: 1024px) {
      .grid-4 { grid-template-columns: repeat(2, 1fr); }
      .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
      .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
      .workflow-timeline { flex-direction: column; gap: 16px; padding: 20px; }
      .workflow-timeline::before { display: none; }
      .kanban-column { flex: 0 0 280px; min-width: 280px; }
}

.listing-status-badge.expired {
      background: rgba(255, 255, 255, 0.1);
      color: var(--text-muted);
}

.listing-content {
      padding: 16px;
}

.listing-title {
      font-size: 15px;
      font-weight: 600;
      color: var(--text-primary);
      margin-bottom: 6px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
}

.listing-stone {
      font-size: 12px;
      color: var(--gold-primary);
      margin-bottom: 10px;
}

.listing-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 12px;
}

.listing-meta-item {
      font-size: 11px;
      color: var(--text-secondary);
      background: rgba(255, 255, 255, 0.05);
      padding: 4px 8px;
      border-radius: 4px;
}

.listing-price {
      font-size: 18px;
      font-weight: 700;
      color: var(--gold-primary);
      margin-bottom: 12px;
}

.listing-price.contact {
      font-size: 13px;
      color: var(--text-muted);
}

.listing-stats {
      display: flex;
      gap: 16px;
      font-size: 12px;
      color: var(--text-muted);
      margin-bottom: 12px;
      padding-top: 12px;
      border-top: 1px solid var(--border-subtle);
}

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

.listing-actions button {
      flex: 1;
      padding: 8px 12px;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
}

.listing-actions .btn-edit {
      background: rgba(255, 255, 255, 0.1);
      border: none;
      color: var(--text-primary);
}

.listing-actions .btn-edit:hover {
      background: rgba(255, 255, 255, 0.15);
}

.listing-actions .btn-delete {
      background: transparent;
      border: 1px solid var(--error);
      color: var(--error);
}

.listing-actions .btn-delete:hover {
      background: rgba(255, 71, 87, 0.1);
}

/* Listing Category Grid */
.listing-category-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 12px;
      margin-bottom: 8px;
}

@media (max-width: 600px) {
      .listing-category-grid {
        grid-template-columns: repeat(2, 1fr);
      }
}

.listing-category-option {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 16px 12px;
      background: var(--dark-elevated);
      border: 2px solid var(--border-subtle);
      border-radius: 12px;
      cursor: pointer;
      transition: all 0.2s ease;
      text-align: center;
      gap: 6px;
}

.listing-category-option:hover {
      border-color: var(--text-muted);
      background: var(--dark-surface);
}

.listing-category-option.selected {
      border-color: var(--gold-primary);
      background: rgba(249, 203, 0, 0.1);
}

.listing-category-option svg {
      color: var(--text-muted);
      transition: color 0.2s;
}

.listing-category-option.selected svg {
      color: var(--gold-primary);
}

.listing-category-option span {
      font-size: 13px;
      font-weight: 600;
      color: var(--text-primary);
}

.listing-category-option small {
      font-size: 10px;
      color: var(--text-muted);
      line-height: 1.2;
}

.listing-category-option.selected span {
      color: var(--gold-primary);
}

/* Category badge on listing cards */
.listing-category-badge {
      position: absolute;
      top: 10px;
      left: 10px;
      padding: 4px 10px;
      border-radius: 12px;
      font-size: 10px;
      font-weight: 600;
      text-transform: uppercase;
      background: rgba(0, 0, 0, 0.7);
      color: var(--text-primary);
      backdrop-filter: blur(4px);
}

.listing-category-badge.countertops { color: #60a5fa; }
.listing-category-badge.tile { color: #f472b6; }
.listing-category-badge.flooring { color: #4ade80; }
.listing-category-badge.cabinets { color: #fb923c; }
.listing-category-badge.supplies { color: #a78bfa; }
.listing-category-badge.other { color: #94a3b8; }

/* ============================================
       DESIGN TOOLS GRID
       ============================================ */
.tools-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 20px;
}

.tools-grid.calculators-grid {
      grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.tool-card {
      display: flex;
      align-items: flex-start;
      gap: 16px;
      padding: 20px;
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
      text-decoration: none;
      transition: all 0.2s ease;
}

.tool-card:hover {
      transform: translateY(-4px);
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
      border-color: var(--border-light);
}

.tool-card.featured {
      background: linear-gradient(135deg, rgba(249, 203, 0, 0.1) 0%, rgba(249, 203, 0, 0.05) 100%);
      border-color: rgba(249, 203, 0, 0.3);
}

.tool-card.featured:hover {
      border-color: var(--gold-primary);
      box-shadow: 0 8px 24px rgba(249, 203, 0, 0.15);
}

.tool-card.calculator {
      padding: 16px;
}

.tool-icon {
      width: 48px;
      height: 48px;
      min-width: 48px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(255, 255, 255, 0.05);
      border-radius: 12px;
}

.tool-icon.small {
      width: 40px;
      height: 40px;
      min-width: 40px;
}

.tool-icon svg {
      width: 26px;
      height: 26px;
      color: var(--gold-primary);
}

.tool-icon.small svg {
      width: 22px;
      height: 22px;
      color: var(--text-secondary);
}

.tool-card.featured .tool-icon {
      background: rgba(249, 203, 0, 0.15);
}

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

.tool-info h4 {
      font-size: 15px;
      font-weight: 600;
      color: var(--text-primary);
      margin: 0 0 4px 0;
}

.tool-info p {
      font-size: 13px;
      color: var(--text-muted);
      margin: 0;
      line-height: 1.4;
}

.tool-badge {
      display: inline-block;
      margin-top: 8px;
      padding: 3px 8px;
      border-radius: 4px;
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
}

.tool-badge.featured {
      background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
      color: var(--dark-primary);
}

@media (max-width: 600px) {
      .tools-grid {
        grid-template-columns: 1fr;
      }
      .tools-grid.calculators-grid {
        grid-template-columns: 1fr;
      }
}

/* Inquiry Items */
.inquiry-item {
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
      padding: 16px;
      margin-bottom: 12px;
      transition: background 0.2s;
}

.inquiry-item.unread {
      border-left: 3px solid var(--gold-primary);
}

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

.inquiry-listing {
      font-size: 13px;
      color: var(--gold-primary);
      margin-bottom: 4px;
}

.inquiry-sender {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-primary);
}

.inquiry-contact {
      font-size: 12px;
      color: var(--text-secondary);
}

.inquiry-date {
      font-size: 11px;
      color: var(--text-muted);
}

.inquiry-message {
      font-size: 13px;
      color: var(--text-secondary);
      line-height: 1.5;
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px solid var(--border-subtle);
}

.inquiry-actions {
      display: flex;
      gap: 10px;
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px solid var(--border-subtle);
}

.inquiry-actions .btn {
      padding: 8px 14px;
      font-size: 12px;
}

.inquiry-actions .btn-email {
      background: rgba(59, 130, 246, 0.15);
      color: #60a5fa;
      border: 1px solid rgba(59, 130, 246, 0.3);
}

.inquiry-actions .btn-email:hover {
      background: rgba(59, 130, 246, 0.25);
}

.inquiry-actions .btn-payment {
      background: rgba(16, 185, 129, 0.15);
      color: #34d399;
      border: 1px solid rgba(16, 185, 129, 0.3);
}

.inquiry-actions .btn-payment:hover {
      background: rgba(16, 185, 129, 0.25);
}

/* Payment Request Modal */
.payment-modal {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.8);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 10000;
      padding: 20px;
}

.payment-modal-content {
      background: var(--dark-surface);
      border-radius: 16px;
      max-width: 420px;
      width: 100%;
      overflow: hidden;
}

.payment-modal-header {
      background: linear-gradient(135deg, var(--dark-primary) 0%, #16213e 100%);
      padding: 20px 24px;
      display: flex;
      justify-content: space-between;
      align-items: center;
}

.payment-modal-header h3 {
      margin: 0;
      font-size: 18px;
      color: var(--text-primary);
}

.payment-modal-close {
      background: none;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 24px;
      padding: 4px;
}

.payment-modal-body {
      padding: 24px;
}

.payment-modal-body .form-group {
      margin-bottom: 16px;
}

.payment-modal-body label {
      display: block;
      font-size: 13px;
      font-weight: 600;
      margin-bottom: 6px;
      color: var(--text-secondary);
}

.payment-modal-body input,
.payment-modal-body textarea {
      width: 100%;
      padding: 12px;
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 8px;
      color: var(--text-primary);
      font-size: 14px;
}

.payment-modal-body input:focus,
.payment-modal-body textarea:focus {
      outline: none;
      border-color: var(--gold-primary);
}

.payment-modal-info {
      background: rgba(59, 130, 246, 0.1);
      border: 1px solid rgba(59, 130, 246, 0.2);
      border-radius: 8px;
      padding: 12px;
      margin-bottom: 20px;
}

.payment-modal-info p {
      margin: 0;
      font-size: 12px;
      color: #60a5fa;
}

.payment-modal-footer {
      padding: 16px 24px;
      background: var(--dark-elevated);
      display: flex;
      gap: 12px;
      justify-content: flex-end;
}


/* Workflow Schedule Modal Styles */
.workflow-event-toggle:has(input:checked) {
      border-color: var(--primary);
      background: rgba(99, 102, 241, 0.1);
}

.workflow-event-toggle:hover {
      border-color: var(--primary);
}

#workflow-dates-container input[type="date"],
#workflow-dates-container input[type="time"] {
      background: var(--dark-tertiary);
      border: 1px solid var(--border-color);
}

#workflow-contractors-list::-webkit-scrollbar {
      width: 6px;
}

#workflow-contractors-list::-webkit-scrollbar-thumb {
      background: var(--border-color);
      border-radius: 3px;
}

.modal-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 16px 24px;
      border-bottom: 1px solid var(--border-subtle);
      position: sticky;
      top: 0;
      background: var(--dark-surface);
      z-index: 1;
      gap: 12px;
}

.modal-title {
      font-size: 18px;
      font-weight: 700;
      color: var(--text-primary);
}

.modal-close {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.1);
      border: none;
      color: var(--text-primary);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
}

.modal-close:hover {
      background: rgba(255, 255, 255, 0.15);
}

.modal-body {
      padding: 24px;
}

.form-section {
      margin-bottom: 24px;
}

/* Contact Preferences Checkboxes */
.contact-pref-item {
      display: flex !important;
      flex-direction: row !important;
      align-items: center !important;
      gap: 12px !important;
      margin-bottom: 12px !important;
      cursor: pointer !important;
}
.contact-pref-item input[type="checkbox"] {
      width: 20px !important;
      height: 20px !important;
      min-width: 20px !important;
      padding: 0 !important;
      margin: 0 !important;
      accent-color: var(--gold-primary) !important;
      flex-shrink: 0 !important;
}
.contact-pref-item span {
      font-size: 14px !important;
      color: #ccc !important;
      text-transform: none !important;
      font-weight: 400 !important;
      display: inline !important;
}

.form-section-title {
      font-size: 14px;
      font-weight: 600;
      color: var(--gold-primary);
      margin-bottom: 16px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
}

.form-row {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 16px;
}

@media (max-width: 500px) {
      .form-row {
        grid-template-columns: 1fr;
      }
}

/* Stone Autocomplete */
.stone-autocomplete {
      position: relative;
}

.stone-autocomplete-results {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      background: var(--dark-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: 8px;
      max-height: 200px;
      overflow-y: auto;
      z-index: 100;
      display: none;
}

.stone-autocomplete-results.active {
      display: block;
}

.stone-result-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px 12px;
      cursor: pointer;
      transition: background 0.2s;
}

.stone-result-item:hover {
      background: rgba(255, 255, 255, 0.05);
}

.stone-result-thumb {
      width: 40px;
      height: 40px;
      border-radius: 6px;
      object-fit: cover;
}

.stone-result-info {
      flex: 1;
}

.stone-result-name {
      font-size: 13px;
      font-weight: 600;
      color: var(--text-primary);
}

.stone-result-meta {
      font-size: 11px;
      color: var(--text-muted);
}

/* Image Upload Grid */
.image-upload-section {
      margin-top: 8px;
}

.image-upload-grid {
      display: grid;
      grid-template-columns: 1.5fr 1fr 1fr 1fr;
      gap: 12px;
}

@media (max-width: 600px) {
      .image-upload-grid {
        grid-template-columns: 1fr 1fr;
      }
}

.image-upload-slot {
      position: relative;
      aspect-ratio: 1;
      border-radius: 12px;
      overflow: hidden;
      background: var(--dark-elevated);
      border: 2px dashed var(--border-light);
      cursor: pointer;
      transition: all 0.3s ease;
}

.image-upload-slot:first-child {
      aspect-ratio: 4/3;
}

@media (max-width: 600px) {
      .image-upload-slot:first-child {
        grid-column: span 2;
      }
}

.image-upload-slot:hover {
      border-color: var(--gold-primary);
      background: rgba(249, 203, 0, 0.05);
}

.image-upload-slot.has-image {
      border-style: solid;
      border-color: var(--gold-primary);
}

.upload-placeholder {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 8px;
      color: var(--text-muted);
}

.upload-placeholder svg {
      color: var(--gold-primary);
      opacity: 0.7;
}

.upload-placeholder span {
      font-size: 12px;
      font-weight: 500;
}

.upload-preview {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
}

.remove-image-btn {
      position: absolute;
      top: 8px;
      right: 8px;
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: rgba(255, 71, 87, 0.95);
      border: none;
      color: white;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
      font-weight: 600;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
      transition: all 0.2s;
      z-index: 10;
}

.remove-image-btn:hover {
      background: #ff4747;
      transform: scale(1.1);
}

.upload-progress {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 4px;
      background: rgba(0, 0, 0, 0.5);
}

.upload-progress-bar {
      height: 100%;
      background: var(--gold-primary);
      width: 0%;
      transition: width 0.3s ease;
}

/* Legacy image preview for backward compatibility */
.image-preview-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 8px;
      margin-top: 12px;
}

.image-preview-item {
      position: relative;
      aspect-ratio: 1;
      border-radius: 8px;
      overflow: hidden;
      background: var(--dark-elevated);
      border: 1px dashed var(--border-light);
}

.image-preview-item img {
      width: 100%;
      height: 100%;
      object-fit: cover;
}

.image-preview-item .remove-btn {
      position: absolute;
      top: 4px;
      right: 4px;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background: rgba(255, 71, 87, 0.9);
      border: none;
      color: white;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
}

.modal-footer {
      padding: 16px 24px;
      border-top: 1px solid var(--border-subtle);
      display: flex;
      gap: 12px;
      justify-content: flex-end;
}

/* ============================================
       COMPREHENSIVE MOBILE OPTIMIZATIONS
       All screens optimized for mobile users
       ============================================ */

/* Mobile-first touch targets (44x44px minimum) */
@media (max-width: 768px) {
      /* Global touch-friendly sizing */
      .btn-modern, .filter-pill, .tab-btn, .nav-item {
        min-height: 44px;
        min-width: 44px;
      }

      /* Sidebar - Full screen overlay on mobile */
      .sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 280px;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
      }

      .sidebar.open {
        left: 0;
      }

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

      .sidebar.open + .sidebar-overlay,
      body.sidebar-open .sidebar-overlay {
        display: block;
      }

      /* Main content full width */
      .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 16px !important;
        padding-bottom: 80px !important; /* Space for FAB */
      }

      /* Mobile header with hamburger */
      .topbar {
        padding: 12px 16px;
        gap: 12px;
      }

      .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: var(--dark-elevated);
        border: 1px solid var(--border-subtle);
        border-radius: 8px;
        color: var(--text-primary);
        cursor: pointer;
      }

      .page-title {
        font-size: 18px !important;
      }

      /* Cards - Full width, reduced padding */
      .card, .table-container {
        border-radius: 12px;
        padding: 0;
      }

      .card-header, .table-header {
        padding: 16px;
        flex-direction: column;
        align-items: stretch !important;
        gap: 12px;
      }

      .card-body {
        padding: 16px;
      }

      /* Stat cards - 2 column grid */
      .stat-grid, .dashboard-stats, #dashboard-stats {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
      }

      .stat-card {
        padding: 16px 12px !important;
        min-height: auto;
      }

      .stat-value {
        font-size: 24px !important;
      }

      .stat-label {
        font-size: 11px !important;
      }

      /* Filter pills - horizontal scroll */
      .filter-pills {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
      }

      .filter-pills::-webkit-scrollbar {
        display: none;
      }

      .filter-pill {
        flex-shrink: 0;
        padding: 10px 16px;
        font-size: 13px;
      }

      /* Tables - Card-based layout */
      table {
        display: block;
        width: 100%;
      }

      table thead {
        display: none;
      }

      table tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
      }

      table tr {
        display: flex;
        flex-direction: column;
        background: var(--dark-elevated);
        border: 1px solid var(--border-subtle);
        border-radius: 12px;
        padding: 16px;
        gap: 8px;
      }

      table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px 0;
        border: none !important;
        font-size: 14px;
      }

      table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 12px;
        text-transform: uppercase;
      }

      /* Buttons - Stack vertically */
      .btn-group, .modal-footer, .card-actions {
        flex-direction: column;
        gap: 8px;
      }

      .btn-modern {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 15px;
      }

      /* Forms - Full width inputs */
      .form-group, .input-group {
        width: 100%;
      }

      input, select, textarea {
        width: 100%;
        padding: 14px 16px;
        font-size: 16px; /* Prevents iOS zoom */
        border-radius: 10px;
      }

      /* Search bar */
      .search-bar-modern {
        width: 100% !important;
        max-width: none !important;
      }

      .search-bar-modern input {
        padding: 14px 16px 14px 44px;
      }

      /* Modals - Bottom sheet style */
      .modal-overlay {
        align-items: flex-end;
        padding: 0;
      }

      .modal {
        max-width: 100% !important;
        width: 100% !important;
        max-height: 90vh;
        border-radius: 20px 20px 0 0;
        margin: 0;
        animation: slideUp 0.3s ease;
      }

      .modal-header {
        padding: 20px 16px 16px;
        position: relative;
      }

      .modal-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: var(--border-light);
        border-radius: 2px;
      }

      .modal-body {
        padding: 16px;
        max-height: 60vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
      }

      .modal-footer {
        padding: 16px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
      }

      /* Keep Add Lead modal floating/centered */
      #add-lead-modal.modal-overlay {
        align-items: center !important;
        padding: 16px !important;
      }

      #add-lead-modal .modal {
        max-width: 100% !important;
        width: calc(100% - 32px) !important;
        max-height: 80vh !important;
        border-radius: 16px !important;
        margin: auto !important;
        animation: modalFadeIn 0.3s ease !important;
      }

      @keyframes modalFadeIn {
        from { opacity: 0; transform: scale(0.95); }
        to { opacity: 1; transform: scale(1); }
      }

      /* Customer tabs - scrollable */
      .customer-tabs {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
      }

      .customer-tabs .tab-btn {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 12px 16px;
      }

      /* Lead/Customer cards */
      .lead-card, .customer-card, .estimate-card, .invoice-card, .job-card {
        padding: 16px;
      }

      .lead-header, .customer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
      }

      /* Quick actions - 2 column grid */
      .quick-actions, #quick-actions {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
      }

      .action-card {
        flex-direction: column;
        padding: 16px;
        text-align: center;
        gap: 8px;
      }

      .action-icon {
        width: 48px;
        height: 48px;
        margin: 0 auto;
      }

      .action-text h4 {
        font-size: 13px;
      }

      .action-text p {
        font-size: 11px;
        display: none; /* Hide description on mobile */
      }

      /* Listings grid - single column */
      .listings-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
      }

      /* Favorites grid - 2 columns */
      .favorites-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
      }

      .favorite-card {
        padding: 12px;
      }

      .favorite-card img {
        height: 100px;
      }

      /* Calendar mobile */
      .calendar-grid {
        font-size: 12px;
      }

      .calendar-day {
        min-height: 60px;
        padding: 4px;
      }

      /* Detail rows - stack */
      .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
      }

      .detail-label {
        font-size: 11px;
      }

      .detail-value {
        font-size: 14px;
      }

      /* Topbar actions */
      .topbar-actions {
        gap: 8px;
      }

      .topbar-actions .btn-modern .btn-text {
        display: none;
      }

      .topbar-actions .btn-modern {
        width: 44px;
        height: 44px;
        padding: 0;
        min-width: 44px;
      }

      /* Role switcher */
      #role-switcher {
        display: none !important; /* Hide on mobile - use settings instead */
      }

      /* User menu in sidebar footer */
      .sidebar-footer {
        padding: 16px;
      }

      .user-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
      }

      /* Estimate/Invoice items */
      .line-item {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
      }

      .line-item-details {
        width: 100%;
      }

      .line-item-actions {
        width: 100%;
        justify-content: flex-end;
      }

      /* Empty states */
      .empty-state {
        padding: 40px 20px;
      }

      .empty-state svg {
        width: 48px;
        height: 48px;
      }

      .empty-state h3 {
        font-size: 16px;
      }

      .empty-state p {
        font-size: 13px;
      }
}

/* Extra small screens (phones in portrait) */
@media (max-width: 480px) {
      /* Even smaller text */
      .page-title {
        font-size: 16px !important;
      }

      /* Single column stats on very small screens */
      .stat-grid, .dashboard-stats, #dashboard-stats {
        grid-template-columns: 1fr !important;
      }

      /* Quick actions single column */
      .quick-actions, #quick-actions {
        grid-template-columns: 1fr !important;
      }

      .action-card {
        flex-direction: row;
        text-align: left;
        padding: 14px;
      }

      .action-icon {
        width: 40px;
        height: 40px;
        margin: 0;
      }

      .action-text p {
        display: block;
      }

      /* Favorites single column */
      .favorites-grid {
        grid-template-columns: 1fr !important;
      }

      /* Modal even more compact */
      .modal-header {
        padding: 16px 12px 12px;
      }

      .modal-title {
        font-size: 18px;
      }

      .modal-body {
        padding: 12px;
      }

      /* Smaller buttons */
      .btn-modern {
        padding: 12px 16px;
        font-size: 14px;
      }

      /* Table cards more compact */
      table tr {
        padding: 12px;
      }

      table td {
        font-size: 13px;
      }
}

/* Mobile FAB (Floating Action Button) */
.mobile-fab {
      display: none;
      position: fixed;
      bottom: calc(20px + env(safe-area-inset-bottom));
      right: 20px;
      width: 56px;
      height: 56px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
      color: var(--dark-primary);
      border: none;
      box-shadow: 0 4px 20px rgba(249, 203, 0, 0.4);
      cursor: pointer;
      z-index: 100;
      align-items: center;
      justify-content: center;
      transition: transform 0.2s, box-shadow 0.2s;
}

.mobile-fab:active {
      transform: scale(0.95);
}

.mobile-fab svg {
      width: 24px;
      height: 24px;
}

@media (max-width: 768px) {
      .mobile-fab {
        display: flex;
      }
}

/* Pull to refresh indicator */
.pull-indicator {
      display: none;
      position: fixed;
      top: 0;
      left: 50%;
      transform: translateX(-50%);
      padding: 12px 24px;
      background: var(--dark-elevated);
      border-radius: 0 0 12px 12px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
      z-index: 1000;
      color: var(--text-secondary);
      font-size: 13px;
}

/* Swipe actions hint */
.swipe-hint {
      display: none;
      text-align: center;
      padding: 8px;
      font-size: 12px;
      color: var(--text-muted);
}

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

/* Safe area padding for notched phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
      @media (max-width: 768px) {
        .main-content {
          padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
        }

        .modal-footer {
          padding-bottom: calc(16px + env(safe-area-inset-bottom));
        }

        .sidebar {
          padding-bottom: env(safe-area-inset-bottom);
        }
      }
}

/* Smooth scrolling on iOS */
@media (max-width: 768px) {
      .modal-body,
      .sidebar-nav,
      .table-container,
      .card-body {
        -webkit-overflow-scrolling: touch;
      }

      /* Prevent body scroll when modal open */
      body.modal-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
      }

      /* Disable hover effects on touch */
      @media (hover: none) {
        .btn-modern:hover,
        .nav-item:hover,
        .filter-pill:hover,
        .card:hover,
        .listing-card:hover {
          transform: none;
          box-shadow: none;
        }
      }
}

/* Landscape phone adjustments */
@media (max-width: 768px) and (orientation: landscape) {
      .modal {
        max-height: 85vh;
      }

      .modal-body {
        max-height: 50vh;
      }

      .stat-grid, .dashboard-stats, #dashboard-stats {
        grid-template-columns: repeat(4, 1fr) !important;
      }
}

/* Kanban Drag-and-Drop */
.kanban-card[draggable="true"] { cursor: grab; }
.kanban-card[draggable="true"]:active { cursor: grabbing; }
.kanban-column.drag-over { outline: 2px solid var(--gold-primary) !important; }

/* =============================================
       PROFILE SLIDE-OVER PANEL - ENHANCED
       ============================================= */
.profile-panel-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.85);
      backdrop-filter: blur(12px);
      z-index: 99999;
      opacity: 0;
      visibility: hidden;
      transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.profile-panel-overlay.active {
      opacity: 1;
      visibility: visible;
}
.profile-panel {
      position: fixed;
      top: 0;
      right: 0;
      width: 100%;
      max-width: 900px;
      height: 100vh;
      height: 100dvh;
      background: #0a0a12;
      box-shadow: -8px 0 50px rgba(0, 0, 0, 0.5);
      transform: translateX(100%);
      transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
      display: flex;
      flex-direction: column;
      z-index: 100000;
      overflow: hidden;
}
.profile-panel-overlay.active .profile-panel {
      transform: translateX(0);
}
.profile-panel-header {
      padding: 0;
      border-bottom: 1px solid var(--border-subtle);
      background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
      position: relative;
      overflow: hidden;
}
.profile-panel-header::before {
      content: '';
      position: absolute;
      top: -50%;
      right: -20%;
      width: 60%;
      height: 200%;
      background: radial-gradient(ellipse, rgba(249, 203, 0, 0.15) 0%, transparent 70%);
      pointer-events: none;
}
.profile-header-top {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 16px 24px 0;
      position: relative;
      z-index: 1;
}
.profile-header-actions {
      display: flex;
      gap: 8px;
}
.profile-header-btn {
      width: 36px;
      height: 36px;
      border-radius: 10px;
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.1);
      color: rgba(255, 255, 255, 0.8);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
}
.profile-header-btn:hover {
      background: rgba(255, 255, 255, 0.2);
      color: #fff;
}
.profile-header-btn.close:hover {
      background: rgba(239, 68, 68, 0.4);
}
.profile-header-main {
      display: flex;
      align-items: flex-end;
      gap: 20px;
      padding: 20px 24px 24px;
      position: relative;
      z-index: 1;
}
.profile-avatar {
      width: 88px;
      height: 88px;
      border-radius: 20px;
      background: linear-gradient(135deg, var(--primary) 0%, #e6b800 50%, var(--accent) 100%);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 34px;
      font-weight: 800;
      color: #000;
      flex-shrink: 0;
      box-shadow: 0 8px 32px rgba(249, 203, 0, 0.3);
      border: 3px solid rgba(255, 255, 255, 0.1);
      position: relative;
}
.profile-avatar-badge {
      position: absolute;
      bottom: -4px;
      right: -4px;
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: #22c55e;
      border: 3px solid var(--dark-bg);
      display: flex;
      align-items: center;
      justify-content: center;
}
.profile-avatar-badge svg {
      width: 14px;
      height: 14px;
      color: #fff;
}
.profile-header-info {
      flex: 1;
      min-width: 0;
}
.profile-name {
      font-size: 26px;
      font-weight: 800;
      color: #fff;
      margin-bottom: 6px;
      text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.profile-meta {
      font-size: 14px;
      color: rgba(255, 255, 255, 0.7);
      display: flex;
      flex-wrap: wrap;
      gap: 16px;
      margin-bottom: 12px;
}
.profile-meta-item {
      display: flex;
      align-items: center;
      gap: 6px;
}
.profile-meta-item svg {
      opacity: 0.6;
}
.profile-meta-item a {
      color: rgba(255, 255, 255, 0.7);
      text-decoration: none;
      transition: color 0.2s;
}
.profile-meta-item a:hover {
      color: var(--primary);
}
.profile-badges {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
}
.profile-status-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 14px;
      border-radius: 20px;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
}
.profile-status-badge.new { background: rgba(249, 203, 0, 0.25); color: #f9cb00; border: 1px solid rgba(249, 203, 0, 0.3); }
.profile-status-badge.contacted { background: rgba(59, 130, 246, 0.25); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.profile-status-badge.qualified { background: rgba(139, 92, 246, 0.25); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }
.profile-status-badge.quoted { background: rgba(6, 182, 212, 0.25); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.3); }
.profile-status-badge.won { background: rgba(34, 197, 94, 0.25); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
.profile-status-badge.lost { background: rgba(239, 68, 68, 0.25); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.profile-status-badge.archived { background: rgba(107, 114, 128, 0.25); color: #9ca3af; border: 1px solid rgba(107, 114, 128, 0.3); }
.profile-tag {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 4px 10px;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 600;
      background: rgba(255, 255, 255, 0.1);
      color: rgba(255, 255, 255, 0.8);
      border: 1px solid rgba(255, 255, 255, 0.1);
}
.profile-close-btn {
      width: 40px;
      height: 40px;
      border-radius: 10px;
      background: rgba(255, 255, 255, 0.1);
      border: none;
      color: var(--text-primary);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
}
.profile-close-btn:hover {
      background: rgba(239, 68, 68, 0.3);
}

/* Quick Stats Bar */
.profile-stats-bar {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 1px;
      background: var(--border-subtle);
      border-bottom: 1px solid var(--border-subtle);
}
.profile-stat {
      background: var(--dark-elevated);
      padding: 14px 16px;
      text-align: center;
      transition: background 0.2s;
      cursor: default;
}
.profile-stat:hover {
      background: var(--dark-surface);
}
.profile-stat-value {
      font-size: 20px;
      font-weight: 700;
      color: var(--text-primary);
      margin-bottom: 2px;
}
.profile-stat-value.highlight {
      color: var(--primary);
}
.profile-stat-label {
      font-size: 11px;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
}

/* Tabs with badges */
.profile-tabs {
      display: flex;
      gap: 0;
      padding: 0 16px;
      background: var(--dark-surface);
      border-bottom: 1px solid var(--border-subtle);
      overflow-x: auto;
      scrollbar-width: none;
}
.profile-tabs::-webkit-scrollbar { display: none; }
.profile-tab {
      padding: 16px 20px;
      font-size: 13px;
      font-weight: 600;
      color: var(--text-muted);
      cursor: pointer;
      border: none;
      background: none;
      white-space: nowrap;
      border-bottom: 3px solid transparent;
      transition: all 0.2s;
      display: flex;
      align-items: center;
      gap: 8px;
      position: relative;
}
.profile-tab:hover {
      color: var(--text-primary);
      background: rgba(255, 255, 255, 0.03);
}
.profile-tab.active {
      color: var(--primary);
      border-bottom-color: var(--primary);
      background: rgba(249, 203, 0, 0.05);
}
.profile-tab .tab-icon {
      width: 18px;
      height: 18px;
      opacity: 0.7;
}
.profile-tab.active .tab-icon {
      opacity: 1;
}
.tab-badge {
      background: var(--primary);
      color: #000;
      font-size: 10px;
      font-weight: 700;
      padding: 2px 6px;
      border-radius: 10px;
      min-width: 18px;
      text-align: center;
}
.tab-badge.muted {
      background: var(--dark-elevated);
      color: var(--text-muted);
}

/* Content area */
.profile-content {
      flex: 1;
      overflow-y: auto;
      padding: 24px;
      background: var(--dark-bg);
}
.profile-section {
      margin-bottom: 28px;
}
.profile-section-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 16px;
}
.profile-section-title {
      font-size: 13px;
      font-weight: 700;
      color: var(--text-secondary);
      margin-bottom: 0;
      text-transform: uppercase;
      letter-spacing: 0.8px;
      display: flex;
      align-items: center;
      gap: 8px;
}
.profile-section-title svg {
      width: 16px;
      height: 16px;
      color: var(--primary);
}
.profile-info-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
}
.profile-info-item {
      background: var(--dark-surface);
      padding: 16px 18px;
      border-radius: 12px;
      border: 1px solid var(--border-subtle);
      transition: all 0.2s;
}
.profile-info-item:hover {
      border-color: var(--primary);
      background: var(--dark-elevated);
}
.profile-info-item.clickable {
      cursor: pointer;
}
.profile-info-label {
      font-size: 11px;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 6px;
      display: flex;
      align-items: center;
      gap: 6px;
}
.profile-info-value {
      font-size: 15px;
      color: var(--text-primary);
      font-weight: 600;
      word-break: break-word;
}
.profile-info-value.muted {
      color: var(--text-muted);
      font-weight: 400;
}

/* Quick Actions Grid */
.profile-quick-actions {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 10px;
}
.profile-quick-action {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 14px 16px;
      background: var(--dark-surface);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
      cursor: pointer;
      transition: all 0.2s;
      text-align: left;
}
.profile-quick-action:hover {
      background: var(--dark-elevated);
      border-color: var(--primary);
      transform: translateY(-2px);
}
.profile-quick-action .action-icon {
      width: 42px;
      height: 42px;
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
}
.profile-quick-action .action-icon.gold {
      background: linear-gradient(135deg, rgba(249, 203, 0, 0.2), rgba(249, 203, 0, 0.1));
      color: var(--primary);
}
.profile-quick-action .action-icon.blue {
      background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.1));
      color: #3b82f6;
}
.profile-quick-action .action-icon.green {
      background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
      color: #22c55e;
}
.profile-quick-action .action-icon.purple {
      background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.1));
      color: #8b5cf6;
}
.profile-quick-action .action-text {
      flex: 1;
}
.profile-quick-action .action-title {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-primary);
      margin-bottom: 2px;
}
.profile-quick-action .action-desc {
      font-size: 12px;
      color: var(--text-muted);
}

/* Footer Actions */
.profile-actions {
      padding: 16px 24px;
      border-top: 1px solid var(--border-subtle);
      display: flex;
      gap: 12px;
      background: var(--dark-surface);
}
.profile-actions .btn-modern {
      flex: 1;
      justify-content: center;
}

/* Activity Timeline */
.activity-timeline {
      position: relative;
      padding-left: 28px;
}
.activity-timeline::before {
      content: '';
      position: absolute;
      left: 8px;
      top: 8px;
      bottom: 8px;
      width: 2px;
      background: var(--border-subtle);
      border-radius: 2px;
}
.activity-item {
      position: relative;
      padding: 12px 0;
      padding-left: 20px;
}
.activity-item::before {
      content: '';
      position: absolute;
      left: -20px;
      top: 18px;
      width: 10px;
      height: 10px;
      border-radius: 50%;
      background: var(--dark-elevated);
      border: 2px solid var(--primary);
}
.activity-item.completed::before {
      background: var(--primary);
}
.activity-content {
      background: var(--dark-surface);
      padding: 14px 16px;
      border-radius: 10px;
      border: 1px solid var(--border-subtle);
}
.activity-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 6px;
}
.activity-title {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-primary);
}
.activity-time {
      font-size: 11px;
      color: var(--text-muted);
}
.activity-desc {
      font-size: 13px;
      color: var(--text-secondary);
}

/* Appointment Cards */
.appointment-card {
      background: var(--dark-surface);
      border: 1px solid var(--border-subtle);
      border-radius: 12px;
      padding: 16px;
      margin-bottom: 12px;
      display: flex;
      gap: 16px;
      transition: all 0.2s;
}
.appointment-card:hover {
      border-color: var(--primary);
}
.appointment-date-box {
      width: 56px;
      text-align: center;
      flex-shrink: 0;
}
.appointment-month {
      font-size: 11px;
      font-weight: 700;
      color: var(--primary);
      text-transform: uppercase;
      letter-spacing: 1px;
}
.appointment-day {
      font-size: 28px;
      font-weight: 800;
      color: var(--text-primary);
      line-height: 1;
}
.appointment-weekday {
      font-size: 11px;
      color: var(--text-muted);
      text-transform: uppercase;
}
.appointment-info {
      flex: 1;
}
.appointment-title {
      font-size: 15px;
      font-weight: 600;
      color: var(--text-primary);
      margin-bottom: 4px;
}
.appointment-time {
      font-size: 13px;
      color: var(--text-secondary);
      margin-bottom: 8px;
      display: flex;
      align-items: center;
      gap: 6px;
}
.appointment-meta {
      display: flex;
      gap: 12px;
      font-size: 12px;
      color: var(--text-muted);
}
.appointment-status {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 4px 10px;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
}
.appointment-status.scheduled {
      background: rgba(59, 130, 246, 0.15);
      color: #60a5fa;
}
.appointment-status.completed {
      background: rgba(34, 197, 94, 0.15);
      color: #4ade80;
}
.appointment-status.cancelled {
      background: rgba(239, 68, 68, 0.15);
      color: #f87171;
}

/* =============================================
       JOB PHASE SCHEDULER (Full Width) - ENHANCED
       ============================================= */
.job-scheduler-panel {
      position: fixed;
      inset: 0;
      background: #0a0a12;
      z-index: 99998;
      opacity: 0;
      visibility: hidden;
      transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
      display: flex;
      flex-direction: column;
      overflow: hidden;
}
.job-scheduler-panel.active {
      opacity: 1;
      visibility: visible;
}
.job-scheduler-header {
      padding: 0 24px;
      background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
      display: flex;
      align-items: center;
      justify-content: space-between;
      height: 70px;
      border-bottom: 1px solid rgba(249, 203, 0, 0.2);
      position: relative;
}
.job-scheduler-header::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 3px;
      background: linear-gradient(90deg, var(--primary) 0%, #e6b800 50%, var(--primary) 100%);
}
.job-scheduler-header h1 {
      color: #fff;
      font-size: 18px;
      font-weight: 700;
      margin: 0;
      display: flex;
      align-items: center;
      gap: 12px;
}
.job-scheduler-header h1 svg {
      color: var(--primary);
}
.scheduler-header-right {
      display: flex;
      align-items: center;
      gap: 16px;
}
.scheduler-customer-badge {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 16px;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 30px;
      border: 1px solid rgba(255, 255, 255, 0.1);
}
.scheduler-customer-badge .avatar {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: var(--primary);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      font-weight: 700;
      color: #000;
}
.scheduler-customer-badge .name {
      color: #fff;
      font-weight: 600;
      font-size: 14px;
}
.job-scheduler-close {
      width: 40px;
      height: 40px;
      border-radius: 10px;
      background: rgba(255, 255, 255, 0.1);
      border: 1px solid rgba(255, 255, 255, 0.1);
      color: rgba(255, 255, 255, 0.8);
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
}
.job-scheduler-close:hover {
      background: rgba(239, 68, 68, 0.3);
      color: #fff;
}
.job-scheduler-body {
      flex: 1;
      display: grid;
      grid-template-columns: 320px 1fr 300px;
      overflow: hidden;
}
@media (max-width: 1200px) {
      .job-scheduler-body {
        grid-template-columns: 280px 1fr;
      }
      .job-scheduler-timeline {
        display: none;
      }
}
.job-scheduler-sidebar {
      background: var(--dark-surface);
      border-right: 1px solid var(--border-subtle);
      padding: 24px;
      overflow-y: auto;
}
.job-scheduler-main {
      padding: 24px 32px;
      overflow-y: auto;
      background: var(--dark-bg);
}
.job-scheduler-timeline {
      background: var(--dark-surface);
      border-left: 1px solid var(--border-subtle);
      padding: 24px;
      overflow-y: auto;
}

/* Phase Cards - Enhanced */
.phase-card {
      background: var(--dark-surface);
      border: 2px solid var(--border-subtle);
      border-radius: 14px;
      padding: 18px;
      margin-bottom: 12px;
      cursor: pointer;
      transition: all 0.25s ease;
      position: relative;
      overflow: hidden;
}
.phase-card::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 4px;
      height: 100%;
      background: var(--border-subtle);
      transition: all 0.25s ease;
}
.phase-card:hover {
      border-color: var(--primary);
      transform: translateX(4px);
}
.phase-card:hover::before {
      background: var(--primary);
}
.phase-card.selected {
      border-color: var(--primary);
      background: rgba(249, 203, 0, 0.08);
}
.phase-card.selected::before {
      background: var(--primary);
      width: 5px;
}
.phase-card.completed {
      border-color: #22c55e;
      background: rgba(34, 197, 94, 0.08);
}
.phase-card.completed::before {
      background: #22c55e;
}
.phase-header {
      display: flex;
      align-items: center;
      gap: 14px;
}
.phase-icon {
      width: 48px;
      height: 48px;
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 24px;
      background: linear-gradient(135deg, var(--dark-elevated), var(--dark-surface));
      border: 1px solid var(--border-subtle);
      flex-shrink: 0;
}
.phase-card.selected .phase-icon {
      background: linear-gradient(135deg, rgba(249, 203, 0, 0.2), rgba(249, 203, 0, 0.1));
      border-color: rgba(249, 203, 0, 0.3);
}
.phase-info {
      flex: 1;
      min-width: 0;
}
.phase-title {
      font-size: 16px;
      font-weight: 700;
      color: var(--text-primary);
      margin-bottom: 4px;
}
.phase-subtitle {
      font-size: 12px;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      gap: 8px;
}
.phase-date-row {
      display: flex;
      gap: 10px;
      margin-top: 14px;
      padding-top: 14px;
      border-top: 1px solid var(--border-subtle);
}

/* Timeline Preview */
.timeline-preview-item {
      display: flex;
      gap: 16px;
      padding: 16px 0;
      position: relative;
}
.timeline-preview-item:not(:last-child)::after {
      content: '';
      position: absolute;
      left: 19px;
      top: 48px;
      bottom: 0;
      width: 2px;
      background: var(--border-subtle);
}
.timeline-preview-dot {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: var(--dark-elevated);
      border: 3px solid var(--border-subtle);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      flex-shrink: 0;
      z-index: 1;
}
.timeline-preview-dot.active {
      border-color: var(--primary);
      background: rgba(249, 203, 0, 0.1);
}
.timeline-preview-content {
      flex: 1;
      padding-top: 8px;
}
.timeline-preview-date {
      font-size: 11px;
      font-weight: 700;
      color: var(--primary);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 4px;
}
.timeline-preview-title {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-primary);
}

/* Scheduler Info Cards */
.scheduler-info-card {
      background: var(--dark-elevated);
      border-radius: 12px;
      padding: 16px;
      margin-bottom: 16px;
      border: 1px solid var(--border-subtle);
}
.scheduler-info-card .label {
      font-size: 11px;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 6px;
}
.scheduler-info-card .value {
      font-size: 15px;
      font-weight: 600;
      color: var(--text-primary);
}
.scheduler-date-input {
      background: var(--dark-bg);
      border: 2px solid var(--primary);
      border-radius: 12px;
      padding: 16px;
      margin-bottom: 20px;
}
.scheduler-date-input label {
      font-size: 12px;
      font-weight: 700;
      color: var(--primary);
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 10px;
      display: block;
}
.scheduler-date-input input[type="date"] {
      font-size: 18px;
      font-weight: 700;
      padding: 12px;
      width: 100%;
}
.scheduler-lead-time {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 14px;
      background: var(--dark-elevated);
      border-radius: 10px;
      margin-bottom: 10px;
      border: 1px solid var(--border-subtle);
}
.scheduler-lead-time:hover {
      border-color: var(--primary);
}
.scheduler-lead-time label {
      font-size: 13px;
      color: var(--text-secondary);
}
.scheduler-lead-time input {
      width: 70px;
      text-align: center;
      font-weight: 600;
}
.scheduler-notification {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 14px;
      background: var(--dark-elevated);
      border-radius: 10px;
      cursor: pointer;
      margin-bottom: 10px;
      border: 1px solid var(--border-subtle);
      transition: all 0.2s;
}
.scheduler-notification:hover {
      border-color: var(--primary);
      background: var(--dark-surface);
}
.scheduler-notification input[type="checkbox"] {
      width: 20px;
      height: 20px;
      accent-color: var(--primary);
}
.scheduler-notification span {
      font-size: 14px;
      color: var(--text-primary);
}
.phase-date-row {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px solid var(--border-subtle);
}
.timeline-item {
      position: relative;
      padding-left: 32px;
      padding-bottom: 24px;
}
.timeline-item::before {
      content: '';
      position: absolute;
      left: 8px;
      top: 8px;
      bottom: 0;
      width: 2px;
      background: var(--border-subtle);
}
.timeline-item:last-child::before {
      display: none;
}
.timeline-dot {
      position: absolute;
      left: 0;
      top: 4px;
      width: 18px;
      height: 18px;
      border-radius: 50%;
      background: var(--dark-surface);
      border: 3px solid var(--primary);
}
.timeline-dot.completed {
      background: #22c55e;
      border-color: #22c55e;
}
.timeline-content {
      background: var(--dark-surface);
      border-radius: 8px;
      padding: 12px;
      border: 1px solid var(--border-subtle);
}
.timeline-date {
      font-size: 12px;
      color: var(--primary);
      font-weight: 600;
      margin-bottom: 4px;
}
.timeline-title {
      font-size: 14px;
      font-weight: 500;
      color: var(--text-primary);
}

/* Notes Component */
.note-card {
      background: var(--dark-elevated);
      border-radius: 10px;
      padding: 14px;
      margin-bottom: 12px;
      border-left: 3px solid var(--primary);
}
.note-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
}
.note-author {
      font-size: 13px;
      font-weight: 500;
      color: var(--text-primary);
}
.note-time {
      font-size: 11px;
      color: var(--text-muted);
}
.note-content {
      font-size: 14px;
      color: var(--text-secondary);
      line-height: 1.5;
}

/* Activity Timeline */
.activity-item {
      display: flex;
      gap: 12px;
      padding: 12px 0;
      border-bottom: 1px solid var(--border-subtle);
}
.activity-icon {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      background: var(--dark-elevated);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      flex-shrink: 0;
}
.activity-content {
      flex: 1;
}
.activity-text {
      font-size: 13px;
      color: var(--text-primary);
}
.activity-time {
      font-size: 11px;
      color: var(--text-muted);
      margin-top: 2px;
}

@media (max-width: 1200px) {
      .job-scheduler-body {
        grid-template-columns: 1fr;
      }
      .job-scheduler-sidebar,
      .job-scheduler-timeline {
        display: none;
      }
}
@media (max-width: 768px) {
      .profile-panel {
        max-width: 100%;
      }
      .profile-info-grid {
        grid-template-columns: 1fr;
      }
}
