  :root {
    --primary-color: #222;
    --secondary-color: #286090;
    --accent-color: #b3e5fc;
    --success-color: #43a047;
    --warning-color: #ffe082;
    --info-color: #5bc0de;
    --error-color: #f44336;
    --background-color: #f5f5f5;
    --container-bg: #fff;
    --text-primary: #333;
    --text-secondary: #666;
    --border-color: #e2e8f0;
    --table-bg: #f8fafd;
    --table-header-bg: #e3eaf5;
    --table-border: #e2e8f0;
    
    /* Theme colors */
    --theme-bg: var(--background-color);
    --theme-surface: var(--container-bg);
    --theme-text: var(--text-primary);
    --theme-text-secondary: var(--text-secondary);
    --theme-border: var(--border-color);
    
    /* Responsive breakpoints */
    --mobile-sm: 480px;
    --mobile-md: 768px;
    --tablet: 1024px;
    --desktop: 1200px;
  }

  /* Dark theme variables */
  [data-theme="dark"] {
    --primary-color: #1a1a1a;
    --background-color: #121212;
    --container-bg: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #404040;
    --table-bg: #2a2a2a;
    --table-header-bg: #333333;
    --table-border: #404040;
    --accent-color: #81d4fa;
    --secondary-color: #3498db;
    
    /* Update theme colors for dark mode */
    --theme-bg: var(--background-color);
    --theme-surface: var(--container-bg);
    --theme-text: var(--text-primary);
    --theme-text-secondary: var(--text-secondary);
    --theme-border: var(--border-color);
  }

  /* Reset and base styles */
  *, *::before, *::after {
    box-sizing: border-box;
  }

  html, body {
    height: 100%;
    margin: 0;
    padding: 0;
  }

  body {
    background: var(--theme-bg);
    color: var(--theme-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    width: 100vw;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
  }

/* v2 2026-06-24 Wed
   v1 — header forced to fixed 60px with overflow:hidden to clip oversized
        logo. Caused random "blank header" at 481-768px (logo clipped to
        empty middle strip).
   v2 — match recoveries.css: let header grow to fit logo. No fixed height,
        no overflow clipping. Behaviour now consistent across all widths. */
.header {
  background: var(--primary-color);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  position: relative;
  min-height: 60px;
  flex-wrap: nowrap;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

  .header .logo {
    display: flex;
    align-items: center;
    font-size: 1.4em;
    font-weight: 600;
    flex: 0 0 auto;
    margin-right: 16px;
  }

  .header .logo img {
    height: 132px;
    width: 132px;
    margin-right: 8px;
    object-fit: contain;
  }

  .header-title-center {
    flex: 1 1 0;
    text-align: center;
    font-size: 1.2em;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: var(--accent-color);
    margin: 0;
    z-index: 1;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header .right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
  }

  .header .welcome {
    font-size: 0.9em;
    margin-right: 8px;
    white-space: nowrap;
  }

  .header .logout {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.9em;
    margin-left: 6px;
    transition: opacity 0.2s;
    cursor: pointer;
  }

  .header .logout:hover {
    opacity: 0.8;
  }

  .header .garage {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 1em;
    white-space: nowrap;
  }

  .header .garage img {
    height: 24px;
    width: 24px;
    margin-right: 6px;
    object-fit: contain;
  }
  /* Theme dropdown in side menu */
  .theme-dropdown {
    position: relative;
    margin: 4px 12px 8px 12px;
    flex-shrink: 0; /* Prevent dropdown from shrinking */
  }

  .theme-toggle {
    color: #fff;
    text-decoration: none;
    padding: 14px 16px;
    font-size: 1em;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
  }

  .theme-toggle:hover,
  .theme-toggle:focus {
    background: #204d74;
    outline: none;
  }

  .theme-toggle .arrow {
    transition: transform 0.2s ease;
    font-size: 0.8em;
  }

  .theme-toggle.active .arrow {
    transform: rotate(180deg);
  }

  .theme-options {
    display: none;
    background: #1a4a6b;
    border-radius: 6px;
    margin-top: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  }

  .theme-options.show {
    display: block;
    animation: slideDown 0.2s ease;
  }

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

  .theme-option {
    color: #fff;
    text-decoration: none;
    padding: 12px 20px;
    font-size: 0.95em;
    font-weight: 500;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    min-height: 40px;
  }

  .theme-option:hover,
  .theme-option:focus {
    background: #204d74;
    outline: none;
  }

  .theme-option.active {
    background: #204d74;
    position: relative;
  }

  .theme-option.active::after {
    content: '✓';
    margin-left: auto;
    font-weight: bold;
    color: var(--accent-color);
  }

  .theme-icon {
    font-size: 1.1em;
    width: 16px;
    text-align: center;
  }

  /* Enhanced container */
  .container {
    max-width: var(--desktop);
    margin: 24px auto;
    background: var(--theme-surface);
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    padding: 24px;
    min-height: 60vh;
    flex: 1 0 auto;
    width: calc(100% - 32px);
    transition: background-color 0.3s ease;
  }

  .topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
  }

  .topbar h2 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
    color: var(--theme-text);
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
  }

  .topbar .top-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
  }

  .topbar .top-actions button {
    background: var(--warning-color);
    color: #444;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95em;
    min-height: 40px;
    white-space: nowrap;
  }

  .topbar .top-actions button:last-child {
    background: var(--success-color);
    color: #fff;
  }

  .topbar .top-actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  }

  /* Search dropdown styling */
  .search-container {
    position: relative;
    display: none;
    margin-top: 16px;
    max-width: 400px;
  }

  .search-container.active {
    display: block;
  }

  .search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--secondary-color);
    border-radius: 8px;
    background: var(--theme-surface);
    color: var(--theme-text);
    font-size: 1em;
    outline: none;
    transition: all 0.2s ease;
  }

  .search-input:focus {
    border-color: var(--success-color);
    box-shadow: 0 0 0 2px rgba(67, 160, 71, 0.2);
  }

  .search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--theme-surface);
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    margin-top: 4px;
  }

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

  .search-dropdown-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--theme-border);
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
  }

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

  .search-dropdown-item:hover,
  .search-dropdown-item.highlighted {
    background: var(--secondary-color);
    color: white;
  }

  .search-dropdown-item .customer-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--success-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.9em;
    flex-shrink: 0;
  }

  .search-dropdown-item .customer-info {
    flex: 1;
  }

  .search-dropdown-item .customer-name {
    font-weight: 600;
    margin-bottom: 2px;
  }

  .search-dropdown-item .customer-details {
    font-size: 0.85em;
    opacity: 0.8;
  }

  .search-no-results {
    padding: 16px;
    text-align: center;
    color: var(--theme-text-secondary);
    font-style: italic;
  }

  .search-close-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--theme-text-secondary);
    cursor: pointer;
    font-size: 1.2em;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
  }

  .search-close-btn:hover {
    color: var(--error-color);
    background: rgba(244, 67, 54, 0.1);
  }

  /* Enhanced table styling */
  .table-container {
    overflow-x: auto;
    margin-top: 16px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    /* Enhanced mobile scrolling */
    -webkit-overflow-scrolling: touch;
  }

  .customers-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--table-bg);
    font-size: 0.95em;
    min-width: 800px; /* Reduced width since we removed Actions column */
    transition: background-color 0.3s ease;
  }

  .customers-table th,
  .customers-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--table-border);
    text-align: left;
    vertical-align: middle;
  }

  .customers-table th {
    background: var(--table-header-bg);
    color: var(--theme-text);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    transition: background-color 0.3s ease;
  }

  .customers-table td {
    color: var(--theme-text);
    transition: color 0.3s ease;
  }

  .customers-table td a {
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
  }

  .customers-table td a:hover {
    text-decoration: underline;
  }

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

  /* Enhanced clickable row styling */
  .customers-table tbody tr {
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .customers-table tbody tr:hover {
    background: rgba(33, 150, 243, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }

  .customers-table tbody tr:active {
    transform: translateY(0);
    background: rgba(33, 150, 243, 0.12);
  }

  /* Delete button styling (only for demo rows) */
  .delete-btn {
    background: var(--error-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background 0.2s ease;
    font-weight: 500;
  }

  .delete-btn:hover {
    background: #d32f2f;
    transform: translateY(-1px);
  }

  .delete-btn:active {
    transform: translateY(0);
  }

  /* Status indicators */
  .status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
  }

  .status.active {
    background: #d4edda;
    color: #155724;
  }

  .status.inactive {
    background: #f8d7da;
    color: #721c24;
  }

  /* Loading and empty states */
  .loading, .empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--theme-text-secondary);
    font-style: italic;
  }

  .loading::before {
    content: "⏳ ";
  }

  .empty-state::before {
    content: "📭 ";
  }

  /* Click indicator tooltip */
  .click-hint {
    position: relative;
  }

  .click-hint::after {
    content: "Click to view details";
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
  }

  .click-hint:hover::after {
    opacity: 1;
  }

  /* Enhanced footer */
  .footer {
    background: var(--primary-color);
    color: var(--accent-color);
    font-size: 0.9em;
    text-align: center;
    padding: 20px 16px;
    margin-top: auto;
    letter-spacing: 0.3px;
    border-top: 1px solid #2c5070;
    width: 100%;
  }

  .footer a {
    color: var(--accent-color);
    text-decoration: none;
    margin: 0 8px;
    font-weight: 500;
    transition: opacity 0.2s;
  }

  .footer a:hover {
    opacity: 0.8;
    text-decoration: underline;
  }

  .footer .sep {
    color: #4fc3f7;
    font-weight: 700;
    margin: 0 8px;
  }
    .error-state {
      text-align: center;
      padding: 40px 20px;
      color: var(--error-color);
      font-style: italic;
      font-weight: 500;
    }

    .empty-state {
      text-align: center;
      padding: 60px 20px;
      color: var(--theme-text-secondary);
      font-size: 1.1em;
    }

    .empty-state::before {
      content: "📋 ";
      font-size: 2em;
      display: block;
      margin-bottom: 10px;
    }
  /* Responsive Design */
  
  /* Large tablets and small desktops */
  @media (max-width: 1024px) {
    .container {
      margin: 16px auto;
      padding: 20px;
      width: calc(100% - 24px);
    }
    
    .header-title-center {
      font-size: 1.1em;
    }
    
    .side-menu {
      width: 280px;
      max-width: 80vw;
    }
  }

  /* Tablets */
  @media (max-width: 768px) {
    .header {
      padding: 10px 12px;
      min-height: 56px;
    }
    
    .header .logo {
      font-size: 1.2em;
      margin-right: 12px;
    }
    
    .header-title-center {
      font-size: 1em;
    }
    
    .header .welcome {
      font-size: 0.85em;
    }
    
    .header .garage {
      font-size: 0.9em;
    }
    
    .container {
      margin: 12px auto;
      padding: 16px;
      width: calc(100% - 16px);
      border-radius: 6px;
    }
    
    .topbar {
      flex-direction: column;
      align-items: stretch;
      gap: 12px;
    }
    
    .topbar h2 {
      font-size: 1.3em;
    }
    
    .customers-table {
      font-size: 0.9em;
    }
    
    .customers-table th,
    .customers-table td {
      padding: 10px 8px;
    }
    
    .side-menu {
      width: 300px;
      max-width: 85vw;
    }

    .search-container {
      max-width: none;
    }
  }

  /* Mobile phones */
  @media (max-width: 480px) {
    body {
      font-size: 14px;
    }
    
    .header {
      padding: 8px 12px;
      min-height: 52px;
    }
    
    .header .logo {
      font-size: 1.1em;
      margin-right: 8px;
    }
    .header-title-center {
      font-size: 0.9em;
      letter-spacing: 0.2px;
    }
    
    .header .welcome {
      display: none;
    }
    
    .header .garage {
      font-size: 0.85em;
    }
    
    .header .garage img {
      height: 20px;
      width: 20px;
    }
    
    .burger {
      width: 40px;
      height: 40px;
      margin-left: 8px;
    }
    
    .container {
      margin: 8px auto;
      padding: 12px;
      width: calc(100% - 12px);
      border-radius: 4px;
    }
    
    .topbar h2 {
      font-size: 1.2em;
    }
    
    .topbar .top-actions {
      width: 100%;
    }
    
    .topbar .top-actions button {
      flex: 1;
      font-size: 0.9em;
      padding: 8px 12px;
    }
    
    .customers-table {
      font-size: 0.85em;
      min-width: 700px;
    }
    
    .customers-table th,
    .customers-table td {
      padding: 8px 6px;
    }
    
    .side-menu {
      width: 280px;
      max-width: 90vw;
      /* Enhanced mobile scrolling */
      height: calc(100vh - env(safe-area-inset-top));
      height: calc(100dvh - env(safe-area-inset-top));
    }
    
    .side-menu .side-links {
      /* Extra padding for mobile scrolling */
      padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
    
    .footer {
      padding: 16px 12px;
      font-size: 0.85em;
    }
    
    .footer a {
      display: inline-block;
      margin: 4px 6px;
    }
  }

  /* Very small phones */
  @media (max-width: 360px) {
    .header-title-center {
      font-size: 0.8em;
    }
    
    .side-menu {
      width: 260px;
      max-width: 95vw;
    }
    
    .container {
      padding: 10px;
      width: calc(100% - 8px);
    }
    
    .customers-table {
      min-width: 600px;
    }
  }

  /* iOS specific fixes for menu scrolling */
  @supports (-webkit-touch-callout: none) {
    .side-menu {
      /* Fix for iOS Safari viewport units */
      height: -webkit-fill-available;
    }
    
    /* Prevent bounce scrolling on body when menu is open */
    body.menu-open {
      position: fixed;
      width: 100%;
      overflow: hidden;
    }
  }

  /* Print styles */
  @media print {
    .header,
    .burger,
    .side-menu,
    .side-menu-backdrop,
    .footer,
    .topbar .top-actions,
    .search-container {
      display: none !important;
    }
    
    .container {
      margin: 0;
      padding: 0;
      box-shadow: none;
      max-width: none;
      width: 100%;
    }
    
    .customers-table {
      font-size: 12px;
    }
  }

  /* High contrast mode support */
  @media (prefers-contrast: high) {
    .header,
    .side-menu,
    .footer {
      border: 1px solid;
    }
    
    .customers-table th,
    .customers-table td {
      border: 1px solid;
    }
  }

  /* Reduced motion support */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
      scroll-behavior: auto !important;
    }
  }
