/*!
 * Service Report System - Centralized CSS
 * Based on EXACT styling patterns from example files
 * Features glassmorphism navigation and precise component matching
 */

/* =============================================================================
   CSS CUSTOM PROPERTIES (CSS Variables) - EXACT from Examples
   ============================================================================= */

:root {
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --danger-color: #ef4444;
  --danger-hover: #dc2626;
  --success-color: #16a34a;
  --warning-color: #f59e0b;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-12: 48px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: 0.2s;
}

/* =============================================================================
   RESET AND BASE STYLES - EXACT from Examples
   ============================================================================= */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =============================================================================
   LOGIN PAGE STYLES - EXACT from Examples
   ============================================================================= */

.page-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.footer-container {
  margin-top: auto;
  padding-top: 40px;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}

.login-container {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  width: 100%;
  max-width: 420px;
}

.logo {
  text-align: center;
  margin-bottom: 30px;
}

.logo img {
  max-width: 200px;
  height: auto;
}

.title {
  font-size: 24px;
  font-weight: 600;
  color: #1a202c;
  text-align: center;
  margin-bottom: 8px;
}

.subtitle {
  color: #718096;
  text-align: center;
  margin-bottom: 30px;
}

.footer {
  text-align: center;
  margin-top: 30px;
  color: #9ca3af;
  font-size: 14px;
}

/* =============================================================================
   ENHANCED DESKTOP LOGIN PAGE - Professional Business Styling
   ============================================================================= */

/* Enhanced login container for desktop */
@media (min-width: 769px) {
  .page-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
  }

  .login-container {
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 450px;
    transition: all 0.3s ease;
  }

  .login-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
  }

  .logo {
    margin-bottom: 35px;
  }

  .logo img {
    max-width: 220px;
    height: auto;
  }

  .title {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #3b82f6, #0057b7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
  }

  .subtitle {
    color: #64748b;
    text-align: center;
    margin-bottom: 35px;
    font-size: 16px;
    font-weight: 500;
  }

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

  .form-label {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
    display: block;
  }

  .form-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    box-sizing: border-box;
  }

  .form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    background: white;
    transform: scale(1.02);
  }

  .btn {
    width: auto;
    padding: 12px 20px;
    background: linear-gradient(135deg, #3b82f6 0%, #0057b7 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box;
    line-height: 1.4;
  }

  .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  }

  .btn:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
  }

  /* Button size variations */
  .btn-full {
    width: 100%;
  }

  .btn-large {
    padding: 18px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
    margin-top: 15px;
  }

  .btn-small {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 6px;
    min-height: auto;
  }

  .message {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    backdrop-filter: blur(10px);
  }

  .message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
  }

  .message.success {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.2);
  }

  .footer {
    margin-top: 30px;
    font-size: 13px;
    color: #000000;
    text-align: center;
    font-weight: 500;
  }

  .footer-container {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    text-align: center;
    padding: 20px;
    margin-top: 20px;
  }
}

/* =============================================================================
   HEADER SYSTEM - EXACT from Examples
   ============================================================================= */

.header {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-left img {
  height: 180px;
  width: 180px;
  max-width: 180px;
  object-fit: contain;
}

.header-title-container {
  display: flex;
  flex-direction: column;
}

.header-title {
  color: var(--primary-color);
  font-size: 32px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.5px;
  background: #1e293b;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
}

.header-subtitle {
  color: var(--gray-600);
  font-size: 15px;
  font-weight: 500;
  margin: 0;
  margin-top: 4px;
  opacity: 0.85;
  letter-spacing: 0.25px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-badge {
  background: var(--primary-color);
  color: white;
  padding: 8px 16px;
  border-radius: 25px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.user-name {
  color: var(--gray-700);
  font-weight: 500;
}

.logout-btn {
  background: var(--danger-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s;
}

.logout-btn:hover {
  background: var(--danger-hover);
}

/* =============================================================================
   GLASSMORPHISM NAVIGATION SYSTEM - EXACT from Examples
   ============================================================================= */

.nav-menu {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-bottom: none;
  padding: 16px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  display: block;
  position: relative;
  z-index: 10001;
}

.nav-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 16px;
  padding: 12px 24px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

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

/* Two navigation styles from examples - Admin style with cards */
.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  margin: 0;
  border-radius: 8px;
  color: var(--gray-600);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  min-width: 120px;
  background: white;
  border: 2px solid transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-height: auto;
}

.nav-item:hover {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
  border-color: var(--primary-hover);
  text-decoration: none;
}

.nav-item.active {
  background: linear-gradient(135deg, #f5930b, #e6840a);
  color: white;
  font-weight: 600;
  box-shadow: 0 8px 25px rgba(245, 147, 11, 0.4);
  border-color: #e6840a;
}

/* Alternative navigation style (for pages like customers.php) */
.nav-item-simple {
  display: block;
  padding: 16px 24px;
  color: var(--gray-600);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  font-weight: 500;
}

.nav-item-simple:hover {
  color: var(--primary-color);
  background: var(--gray-50);
  text-decoration: none;
}

.nav-item-simple.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background: var(--gray-50);
}

/* Navigation Dropdowns */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.dropdown-arrow {
  font-size: 12px;
  transition: transform 0.2s;
}

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

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  z-index: 9999;
  display: none;
  padding: 8px 0;
}

.dropdown-menu.open,
.dropdown-menu.show {
  display: block;
}

.nav-sub-item {
  display: block;
  padding: 12px 16px;
  color: var(--gray-700);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
}

.nav-sub-item:hover {
  background: #16a34a;
  color: white;
  text-decoration: none;
}

.nav-sub-item.active {
  background: var(--primary-color);
  color: white;
}

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

.sub-dropdown-menu {
  position: absolute;
  top: 0;
  left: 100%;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  z-index: 10000;
  display: none;
  padding: 8px 0;
  margin-left: 8px;
}

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

/* Mobile Navigation */
.mobile-menu-wrapper {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: #f59e0b;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
  transition: all 0.3s ease;
}

.mobile-menu-wrapper:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  width: 24px;
  height: 24px;
  justify-content: center;
  align-items: center;
  transition: all 0.3s ease;
}

.mobile-menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: white;
  margin: 2px 0;
  transition: 0.3s;
  border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-4px, 4px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(45deg) translate(-4px, -4px);
}

.mobile-menu-label {
  color: white;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mobile-menu-panel {
  position: fixed;
  top: 0;
  left: -100%;
  width: 85%;
  max-width: 320px;
  height: 100vh;
  background: white;
  z-index: 9999;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.mobile-menu-panel.open {
  left: 0;
}

.mobile-backdrop {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
}

.mobile-backdrop.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Desktop Navigation - Always visible by default */
.nav-items {
  display: flex !important;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

/* Mobile menu - Hidden by default */
.mobile-menu-wrapper {
  display: none !important;
}

/* Hide mobile elements on desktop */
.mobile-menu-panel,
.mobile-menu-overlay,
.mobile-menu-close {
  display: none !important;
}

/* Hide mobile backdrop on desktop */
.mobile-backdrop {
  display: none;
}

/* =============================================================================
   MAIN CONTAINER - EXACT from Examples
   ============================================================================= */

.main-container {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 40px 30px;
}

/* Alternative main content container (some pages use 1200px) */
.main-content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 30px 20px;
}

/* =============================================================================
   SECTION AND CARD SYSTEM - EXACT from Examples
   ============================================================================= */

.section {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  margin-bottom: 30px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.section:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.section-header {
  background: var(--gray-100);
  padding: 20px 30px;
  border-bottom: 1px solid var(--gray-200);
}

.section-header h2 {
  color: var(--primary-color);
  font-size: 20px;
  font-weight: 600;
}

.section-content {
  padding: 40px;
}

/* Stats Grid - EXACT from admin.php example */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: white;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  border-left: 4px solid;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-card.primary {
  border-left-color: var(--primary-color);
}

.stat-card.success {
  border-left-color: var(--success-color);
}

.stat-card.warning {
  border-left-color: var(--warning-color);
}

.stat-card.danger {
  border-left-color: var(--danger-color);
}

/* Random colored borders for stat cards using nth-child */
.quick-stats .stat-card:nth-child(1) {
  border-left-color: #3b82f6 !important;
}

.quick-stats .stat-card:nth-child(2) {
  border-left-color: #16a34a !important;
}

.quick-stats .stat-card:nth-child(3) {
  border-left-color: #dc2626 !important;
}

.quick-stats .stat-card:nth-child(4) {
  border-left-color: #2563eb !important;
}

.quick-stats .stat-card:nth-child(5) {
  border-left-color: #3b82f6 !important;
}

.quick-stats .stat-card:nth-child(6) {
  border-left-color: #16a34a !important;
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: var(--space-2);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* Features Grid - EXACT from admin.php example */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
  max-width: 100%;
}

/* Force single row for typical 2-feature layout on larger screens */
@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

/* Ensure single row for 2 features on desktop */
@media (min-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  }
}

/* Optimize for exactly 2 features (most common case) */
.features-grid:has(.feature-card:nth-child(2):last-child) {
  grid-template-columns: 1fr 1fr;
  max-width: 800px;
  margin: 0 auto;
}

/* Fallback for browsers that don't support :has() */
@supports not selector(:has(*)) {
  @media (min-width: 800px) {
    .features-grid {
      grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
      max-width: 800px;
      margin: 0 auto;
    }
  }
}

.feature-card {
  background: white;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  color: inherit;
}

.feature-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: var(--space-4);
  font-weight: bold;
  color: white;
}

.feature-icon.reports {
  background: var(--primary-color);
}

.feature-icon.estimates {
  background: var(--success-color);
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: var(--space-2);
}

.feature-description {
  color: var(--gray-600);
  line-height: 1.5;
  font-size: 0.875rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

/* Client Management Cards */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.client-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.client-card h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
}

.client-stats {
  margin: 15px 0;
  text-align: left;
  font-size: 14px;
  color: var(--gray-600);
}

.client-stats div {
  margin: 5px 0;
}

.client-card .btn {
  margin-top: 15px;
}

.hidden {
  display: none;
}

.edit-form {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 20px;
  margin-top: 15px;
}

.edit-form .form-grid {
  margin-bottom: 15px;
}

/* Super Admin Management Card */
.super-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.super-admin-card {
  padding: 20px;
  border-radius: 12px;
  color: white;
  position: relative;
  overflow: hidden;
}

.super-admin-card h3 {
  margin: 0 0 10px 0;
  font-size: 1.2rem;
}

.super-admin-card p {
  margin: 5px 0 0 0;
  opacity: 0.9;
  font-size: 0.9rem;
}

.super-admin-card ul {
  margin: 15px 0;
  padding-left: 20px;
  opacity: 0.9;
  font-size: 0.9rem;
}

.super-admin-card .btn {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
  text-align: center;
  margin-top: 10px;
}

.card-icon {
  font-size: 2rem;
  margin-right: 15px;
  float: left;
}

/* =============================================================================
   BUTTON SYSTEM - EXACT from Examples
   ============================================================================= */

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  text-decoration: none;
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  color: white;
}

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

.btn-secondary:hover {
  background: var(--gray-400);
  color: var(--gray-700);
}

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

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

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

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

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
  min-height: 36px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
  min-height: 52px;
}

/* =============================================================================
   FORM SYSTEM - EXACT from Examples
   ============================================================================= */

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

.form-label {
  display: block;
  margin-bottom: 8px;
  color: var(--gray-700);
  font-weight: 600;
  font-size: 14px;
}

.form-input, .form-select, .form-textarea, .form-control {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
  min-height: 44px;
}

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

.form-control:disabled {
  background-color: var(--gray-100);
  color: var(--gray-500);
  cursor: not-allowed;
}

.form-textarea, textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 8px center;
  background-repeat: no-repeat;
  background-size: 16px 12px;
  padding-right: 40px;
}

/* =============================================================================
   TABLE SYSTEM - Enhanced for Responsiveness
   ============================================================================= */

.table-container {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.table-responsive {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.table th {
  background: var(--gray-100);
  font-weight: 600;
  color: var(--gray-700);
}

.table tbody tr:hover {
  background: var(--gray-50);
}

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

/* Mobile Table Cards */
.table-card {
  display: none;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.table-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
}

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

.table-card-label {
  font-weight: 600;
  color: var(--gray-700);
  font-size: 12px;
}

.table-card-value {
  color: var(--gray-600);
  font-size: 14px;
}

/* =============================================================================
   TYPOGRAPHY - EXACT from Examples
   ============================================================================= */

.page-title {
  font-size: 32px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  position: relative;
}

.page-description {
  color: #475569;
  margin-bottom: 24px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.25px;
  line-height: 1.5;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  opacity: 0.9;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 40px;
  gap: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
  position: relative;
}

.page-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(135deg, var(--primary-color) 0%, #0057b7 100%);
  border-radius: 1px;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  align-items: end;
}

h1, h2, h3, h4, h5, h6 {
  color: #94a3b8
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 16px;
}

h1 { font-size: 28px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; }
h5 { font-size: 16px; }
h6 { font-size: 14px; }

p {
  margin-bottom: 16px;
  color: #16a34a;
  line-height: 1.6;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* =============================================================================
   MESSAGE SYSTEM
   ============================================================================= */

.message {
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid;
  font-size: 14px;
}

.message.success, .message-success {
  background: #f0fdf4;
  color: #16a34a;
  border-left-color: #16a34a;
}

.message.error, .message-error {
  background: #fef2f2;
  color: #dc2626;
  border-left-color: #dc2626;
}

.message.warning, .message-warning {
  background: #fef3c7;
  color: #f59e0b;
  border-left-color: #f59e0b;
}

.message.info, .message-info {
  background: #dbeafe;
  color: #3b82f6;
  border-left-color: #3b82f6;
}

/* =============================================================================
   MODAL SYSTEM
   ============================================================================= */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

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

.modal {
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

/* Large modal for forms with many fields */
.modal.modal-large {
  max-width: 800px;
  max-height: 95vh;
}

.modal.modal-large .modal-body {
  max-height: 75vh;
  padding: 25px;
}

/* Services grid layout for customer modal */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 16px;
  margin-top: 8px;
}

.service-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  background: var(--gray-50);
  transition: all 0.2s ease;
  cursor: pointer;
}

.service-checkbox-item:hover {
  border-color: var(--primary-color);
  background: rgba(59, 130, 246, 0.05);
}

.service-checkbox-item input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.service-checkbox-item label {
  margin: 0;
  font-size: 14px;
  cursor: pointer;
  flex: 1;
}

/* Responsive large modal */
@media (max-width: 1024px) {
  .modal.modal-large {
    max-width: 90vw;
    margin: 20px;
  }
  
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 12px;
  }
}

@media (max-width: 768px) {
  .modal.modal-large {
    max-width: 95vw;
    max-height: 90vh;
    margin: 10px;
  }
  
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 10px;
  }
  
  .service-checkbox-item {
    padding: 6px 10px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .services-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* Services Configuration in Settings */
.services-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 15px 20px;
  align-items: start;
}

.service-config-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0; /* Prevent overflow */
}

.service-config-item .service-input {
  flex: 1;
  min-width: 0; /* Prevent overflow */
}

.service-config-item .remove-service {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
}

/* Responsive behavior for services config */
@media (max-width: 1024px) {
  .services-config-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px 15px;
  }
}

@media (max-width: 768px) {
  .services-config-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--primary-color);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

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

.modal-body {
  padding: 20px;
  overflow-y: auto;
  max-height: 60vh;
}

.modal-actions {
  padding: 20px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* =============================================================================
   CLIENT MANAGEMENT SPECIFIC STYLES
   ============================================================================= */

.back-link {
  margin-bottom: 20px;
}

.tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 20px;
}

.tab {
  padding: 12px 24px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-weight: 500;
}

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

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.smtp-indicator {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.smtp-global {
  background: #dbeafe;
  color: #1e40af;
}

.smtp-custom {
  background: #dcfce7;
  color: #15803d;
}

.status-badge {
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-enabled {
  background: #dcfce7;
  color: #166534;
}

.status-disabled {
  background: #fee2e2;
  color: #991b1b;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
}

.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.notes-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 15px;
  background: white;
}

.note-item {
  padding: 10px;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 10px;
}

.note-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.note-meta {
  font-size: 12px;
  color: var(--gray-600);
  margin-bottom: 5px;
}

.activity-log {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 15px;
  background: white;
}

.activity-item {
  padding: 10px;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 10px;
}

.activity-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.activity-meta {
  font-size: 12px;
  color: var(--gray-600);
  margin-bottom: 5px;
}

.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 25px;
}

.client-stats {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.client-stats div {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.client-stats span:first-child {
  color: var(--gray-600);
}

.client-stats span:last-child {
  color: var(--gray-800);
  font-weight: 500;
}

.client-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.smtp-config-section {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
  background: var(--gray-50);
}

.test-email-section {
  background: var(--gray-50);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  margin-top: 20px;
}

.test-email-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 15px;
  align-items: end;
}

/* =============================================================================
   ESTIMATE CREATION SPECIFIC STYLES
   ============================================================================= */

.customer-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.items-table th,
.items-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.items-table th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-700);
}

.items-table input {
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  padding: 8px;
  width: 100%;
  font-size: 14px;
}

.add-item {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 20px;
  min-height: 44px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.add-item:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.remove-item {
  background: var(--danger-color);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.3s ease;
}

.remove-item:hover {
  background: var(--danger-hover);
}

.totals-section {
  background: var(--gray-50);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
}

.total-row.grand-total {
  font-weight: 600;
  font-size: 16px;
  padding-top: 8px;
  border-top: 2px solid var(--gray-300);
  margin-top: 8px;
}

.item-total {
  background: var(--gray-50) !important;
  color: var(--gray-700) !important;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* =============================================================================
   CUSTOMER PROFILE SPECIFIC STYLES
   ============================================================================= */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--gray-600);
}

.breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.info-card {
  background: var(--gray-50);
  border-radius: 8px;
  padding: 20px;
  border: 1px solid var(--gray-200);
}

.info-card h3 {
  color: var(--gray-800);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
}

.info-item {
  display: flex;
  margin-bottom: 10px;
}

.info-label {
  font-weight: 500;
  color: var(--gray-700);
  min-width: 120px;
}

.info-value {
  color: var(--gray-600);
  flex: 1;
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.service-tag, .customer-tag {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.customer-tag {
  background: var(--warning-color);
}

.map-container {
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--gray-200);
  margin-top: 15px;
}

.reports-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.reports-table th,
.reports-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.reports-table th {
  background: var(--gray-100);
  font-weight: 600;
  color: var(--gray-700);
}

.note-item {
  background: var(--gray-50);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  border-left: 4px solid var(--primary-color);
}

.note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.note-meta {
  font-size: 12px;
  color: var(--gray-600);
}

.note-text {
  color: var(--gray-800);
  line-height: 1.5;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--gray-50);
  border-radius: 8px;
  margin-bottom: 10px;
  border: 1px solid var(--gray-200);
  transition: all 0.2s;
}

.file-item:hover {
  background: var(--gray-100);
  border-color: var(--gray-300);
}

.file-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.file-name {
  font-weight: 500;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 8px;
}

.file-type-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  color: white;
}

.file-meta {
  font-size: 12px;
  color: var(--gray-600);
  margin-top: 4px;
}

.file-actions {
  display: flex;
  gap: 5px;
  align-items: center;
}

.address-display {
  background: var(--gray-50);
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--gray-200);
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--gray-700);
}

/* =============================================================================
   DOCUMENT VIEWER MODAL STYLES
   ============================================================================= */

.doc-viewer-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.doc-viewer-content {
  position: relative;
  background: white;
  margin: 2% auto;
  border-radius: 12px;
  width: 95%;
  max-width: 1200px;
  height: 90vh;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.doc-viewer-header {
  background: var(--primary-color);
  color: white;
  padding: 20px;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.doc-viewer-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  flex: 1;
  word-break: break-word;
}

.doc-viewer-close {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

.doc-viewer-close:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.doc-viewer-body {
  flex: 1;
  background: var(--gray-50);
  overflow: hidden;
  position: relative;
}

.doc-viewer-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

.doc-viewer-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: white;
}

.doc-viewer-text {
  padding: 20px;
  background: white;
  height: 100%;
  overflow-y: auto;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.doc-viewer-unsupported {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: white;
  color: var(--gray-600);
  text-align: center;
  padding: 40px;
}

/* Responsive adjustments for document viewer */
@media (max-width: 768px) {
  .doc-viewer-content {
    width: 98%;
    height: 95vh;
    margin: 1% auto;
  }
  
  .doc-viewer-header {
    padding: 15px;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
  
  .doc-viewer-title {
    font-size: 16px;
  }
  
  .doc-viewer-close {
    align-self: flex-end;
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .doc-viewer-text {
    padding: 15px;
    font-size: 13px;
  }
  
  .doc-viewer-unsupported {
    padding: 20px;
  }
}

/* =============================================================================
   ESTIMATE APPROVAL WORKFLOW STYLES
   ============================================================================= */

.approval-section {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
}

.approval-section h3.section-title {
  margin-top: 0;
  color: var(--gray-800);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 10px;
}

.approval-history {
  margin: 20px 0;
}

.approval-item {
  background: white;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 15px;
  border-left: 4px solid var(--gray-300);
}

.approval-item.approval-approved {
  border-left-color: var(--success-color);
  background: #f0fdf4;
}

.approval-item.approval-rejected {
  border-left-color: var(--danger-color);
  background: #fef2f2;
}

.approval-item.approval-changes_requested {
  border-left-color: var(--warning-color);
  background: #fffbeb;
}

.approval-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.approval-date {
  color: var(--gray-600);
  font-size: 14px;
  font-weight: normal;
}

.approval-comments {
  background: white;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid var(--gray-200);
  font-style: italic;
  color: var(--gray-700);
  margin-top: 10px;
}

.approval-status {
  background: white;
  border-radius: 6px;
  padding: 20px;
  text-align: center;
  margin: 20px 0;
  border: 2px solid var(--gray-200);
}

.status-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}

.status-icon {
  font-size: 24px;
}

.status-text {
  font-size: 16px;
}

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

.customer-comments {
  background: white;
  border-radius: 6px;
  padding: 15px;
  margin: 20px 0;
  border: 1px solid var(--gray-200);
}

.customer-comments h4 {
  margin-top: 0;
  color: var(--gray-800);
}

.comments-content {
  color: var(--gray-700);
  line-height: 1.6;
}

.customer-signature {
  background: white;
  border-radius: 6px;
  padding: 15px;
  margin: 20px 0;
  border: 1px solid var(--gray-200);
}

.customer-signature h4 {
  margin-top: 0;
  color: var(--gray-800);
}

.signature-display {
  text-align: center;
}

.signature-image {
  max-width: 300px;
  height: auto;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  background: white;
  padding: 10px;
  margin-bottom: 10px;
}

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

.approval-actions {
  background: white;
  border-radius: 6px;
  padding: 20px;
  margin: 20px 0;
  border: 1px solid var(--gray-200);
}

.approval-actions h4 {
  margin-top: 0;
  color: var(--gray-800);
}

.approval-link-section {
  background: var(--gray-50);
  border-radius: 6px;
  padding: 15px;
  margin: 15px 0;
}

.approval-link-section label {
  color: var(--gray-700);
}

.approval-link-section input[readonly] {
  background: white;
  border: 1px solid var(--gray-300);
}

.approval-link-section small {
  line-height: 1.4;
}

/* Responsive approval section */
@media (max-width: 768px) {
  .approval-section {
    padding: 15px;
    margin: 15px 0;
  }
  
  .approval-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
  
  .status-display {
    flex-direction: column;
    gap: 5px;
  }
  
  .approval-link-section > div {
    flex-direction: column;
    gap: 10px;
  }
  
  .approval-link-section input {
    font-size: 11px;
  }
  
  .approval-actions > div:last-child {
    flex-direction: column;
    gap: 10px;
  }
  
  .approval-actions .btn {
    width: 100%;
    text-align: center;
  }
}

/* =============================================================================
   ESTIMATE STATUS BADGES
   ============================================================================= */

.status-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  display: inline-block;
}

.status-badge.status-pending {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
}

.status-badge.status-approved {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #16a34a;
}

.status-badge.status-rejected {
  background: #fecaca;
  color: #dc2626;
  border: 1px solid #ef4444;
}

.status-badge.status-changes_requested {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #4f46e5;
}

.status-badge.status-converted {
  background: #f3e8ff;
  color: #7c2d12;
  border: 1px solid #a855f7;
}

.status-badge.status-invoice {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #10b981;
}

.status-badge.status-paid {
  background: #f0f9ff;
  color: #0c4a6e;
  border: 1px solid #0ea5e9;
}

.status-badge.status-void {
  background: #f9fafb;
  color: #6b7280;
  border: 1px solid #9ca3af;
}

.type-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  display: inline-block;
}

.type-badge.type-estimate {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #3b82f6;
}

.type-badge.type-invoice {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #16a34a;
}

/* =============================================================================
   CUSTOMER MANAGEMENT SPECIFIC STYLES
   ============================================================================= */

.actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 15px;
}

.search-container {
  flex: 1;
  max-width: 400px;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
  min-height: auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.customers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.customer-card {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.customer-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-color);
}

.customer-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 5px;
}

.customer-company {
  font-size: 14px;
  color: var(--gray-600);
  margin-bottom: 15px;
}

.customer-details {
  margin-bottom: 15px;
}

.customer-detail {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--gray-600);
}

.customer-detail strong {
  min-width: 80px;
  color: var(--gray-700);
}

.services-tags {
  margin-bottom: 15px;
}

.customer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.no-customers {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-600);
}

.no-customers-icon {
  font-size: 64px;
  margin-bottom: 20px;
}

/* =============================================================================
   UTILITY CLASSES
   ============================================================================= */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-12 { margin-top: 48px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-12 { margin-bottom: 48px; }

.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }
.text-muted { color: var(--gray-500); }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.flex-col { flex-direction: column; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.w-full { width: 100%; }
.h-full { height: 100%; }

/* =============================================================================
   MOBILE APP INTERFACE - Professional Mobile-First Design
   ============================================================================= */

@media (max-width: 768px) {
  /* Hide desktop navigation */
  .nav-menu {
    display: none !important;
  }
  
  .nav-items {
    display: none !important;
  }
  
  .mobile-menu-wrapper {
    display: flex !important;
  }

  /* Mobile Login Page Optimization */
  .page-container {
    padding: 20px 16px;
    min-height: 100vh;
    justify-content: center;
  }

  .login-container {
    padding: 24px 20px;
    margin: 0 auto;
    max-width: 100%;
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: none;
    background: white;
  }

  .logo {
    margin-bottom: 24px;
  }

  .logo img {
    max-width: 120px;
    height: auto;
  }

  .title {
    font-size: 20px;
    margin-bottom: 6px;
    color: #1a202c;
  }

  .subtitle {
    font-size: 14px;
    margin-bottom: 24px;
    color: #718096;
  }

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

  .form-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    display: block;
  }

  .form-input {
    font-size: 16px; /* Prevent iOS zoom */
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
    width: 100%;
    min-height: 52px;
    box-sizing: border-box;
  }

  .form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
  }

  .btn {
    font-size: 16px;
    font-weight: 600;
    padding: 16px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 52px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #0057b7 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
    margin-top: 8px;
  }

  .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
  }

  .btn:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
  }

  .message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    text-align: center;
  }

  .message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
  }

  .message.success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
  }

  .footer {
    margin-top: 24px;
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
  }

  .footer-container {
    margin-top: 20px;
    padding: 16px;
    font-size: 12px;
  }

  /* Mobile App Header Styling */
  .header {
    background: linear-gradient(135deg, #3b82f6 0%, #0057b7 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 10000;
    backdrop-filter: blur(10px);
  }

  .header-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    gap: 16px;
    min-height: 70px;
  }

  .header-left {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    flex: 1;
  }

  .header-left img {
    height: 50px;
    width: 50px;
    max-width: 50px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    padding: 4px;
  }

  .header-title-container {
    flex: 1;
  }

  .header-title {
    font-size: 18px;
    font-weight: 700;
    color: white;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }

  .header-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    margin-top: 2px;
  }

  .user-info {
    display: none; /* Hide desktop user info */
  }

  /* Mobile Menu Button Styling */
  .mobile-menu-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .mobile-menu-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 10px;
    width: 44px;
    height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
  }

  .mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
  }

  .mobile-menu-toggle span {
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: all 0.3s ease;
  }

  .mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }

  .mobile-menu-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  /* Mobile App Content Area */
  .main-container {
    padding: 20px 16px;
    background: #f8fafc;
    min-height: calc(100vh - 70px);
  }

  /* Mobile App Page Title */
  .page-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 8px;
    text-align: center;
  }

  .page-description {
    color: #64748b;
    text-align: center;
    margin-bottom: 24px;
    font-size: 14px;
  }

  /* Mobile App Sections */
  .section {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    overflow: hidden;
    border: none;
  }

  .section-header {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
  }

  .section-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
  }

  .section-content {
    padding: 24px 20px;
  }

  /* Mobile App Forms */
  .form-group {
    margin-bottom: 20px;
  }

  .form-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    display: block;
  }

  .form-input, .form-control, .form-select {
    font-size: 16px; /* Prevent iOS zoom */
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
    width: 100%;
    min-height: 52px;
  }

  .form-input:focus, .form-control:focus, .form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
  }

  /* Mobile App Buttons */
  .btn {
    font-size: 16px;
    font-weight: 600;
    padding: 16px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  }

  .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
  }

  .btn-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
  }

  .btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
  }

  .btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
  }

  /* Mobile App Messages */
  .message {
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .message.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #10b981;
  }

  .message.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #ef4444;
  }

  /* Mobile App Stats Cards */
  .stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
  }

  .stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: none;
  }

  .stat-number {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
  }

  .stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: #64748b;
  }

  /* Mobile App Navigation Menu */
  .mobile-menu-overlay {
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

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

  .mobile-menu-panel {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: -100%;
    width: 320px;
    max-width: 85%;
    height: 100%;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    z-index: 10002;
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
  }

  .mobile-menu-panel.open {
    right: 0;
  }

  .mobile-menu-header {
    background: linear-gradient(135deg, #3b82f6 0%, #0057b7 100%);
    padding: 24px 20px;
    color: white;
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 120px;
  }

  .mobile-menu-header img {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  }

  .mobile-header-user {
    flex: 1;
  }

  .mobile-header-user h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  }

  .mobile-header-user p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    text-transform: capitalize;
  }

  .mobile-logout-header-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
  }

  .mobile-logout-header-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
  }

  .mobile-logout-header-btn span {
    font-size: 20px;
  }

  .mobile-menu-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    color: white;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
  }

  .mobile-menu-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
  }

  .mobile-menu-content {
    padding: 24px 0;
  }

  .mobile-nav-section {
    margin-bottom: 32px;
  }

  .mobile-nav-section h4 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin: 0 0 16px 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
  }

  .mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    position: relative;
  }

  .mobile-nav-item:hover {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.04) 100%);
    border-left-color: #3b82f6;
    color: #1e293b;
    transform: translateX(4px);
  }

  .mobile-nav-item.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.08) 100%);
    border-left-color: #3b82f6;
    color: #1e293b;
    font-weight: 600;
  }

  .mobile-nav-item .icon {
    font-size: 20px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 8px;
    transition: all 0.3s ease;
  }

  .mobile-nav-item:hover .icon,
  .mobile-nav-item.active .icon {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    transform: scale(1.1);
  }

  /* Mobile App Grid Layouts */
  .form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Mobile App Responsive Tables */
  .table-responsive .table {
    display: none;
  }
  
  .table-card {
    display: block;
  }
  
  .form-input, .form-control {
    font-size: 16px; /* Prevent iOS zoom */
  }
  
  .test-email-grid {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
  }
  
  .customer-info-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .items-table input {
    font-size: 16px;
    padding: 10px;
    min-height: 44px;
  }
  
  .add-item {
    min-height: 44px;
    font-size: 16px;
    padding: 12px 20px;
    border-radius: 8px;
  }
  
  .remove-item {
    min-height: 36px;
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 6px;
  }
  
  .totals-section {
    padding: 20px 15px;
  }
  
  .total-row {
    font-size: 15px;
  }
  
  .customer-info-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .breadcrumb {
    font-size: 12px;
    flex-wrap: wrap;
  }
  
  .info-card {
    padding: 15px;
  }
  
  .info-label {
    min-width: 100px;
  }
  
  .tags-container {
    justify-content: center;
  }
  
  .service-tag,
  .customer-tag {
    margin-bottom: 8px;
  }
  
  .actions-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 15px;
  }
  
  .search-container {
    max-width: none;
    order: 1;
  }
  
  .search-input {
    min-height: auto;
    font-size: 16px;
  }
  
  .customers-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .customer-card {
    padding: 20px 15px;
    border-radius: 8px;
  }
  
  .customer-name {
    font-size: 20px;
    margin-bottom: 8px;
  }
  
  .customer-company {
    font-size: 15px;
    margin-bottom: 15px;
  }
  
  .customer-actions {
    flex-direction: column;
    gap: 10px;
  }
  
  .no-customers {
    padding: 40px 20px;
  }
  
  .no-customers-icon {
    font-size: 48px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .btn {
    padding: 16px 24px;
    min-height: 48px;
  }
  
  .login-container {
    padding: 24px;
  }
  
  .modal-body {
    padding: 20px 15px;
  }
  
  .modal-actions {
    padding: 20px 15px;
    flex-direction: column;
    gap: 12px;
  }
}

@media (max-width: 640px) {
  .header-left img {
    height: 100px;
    width: 100px;
    max-width: 100px;
  }
  
  .page-title, .header-title {
    font-size: 24px;
  }
  
  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  h3 { font-size: 18px; }
}

@media (max-width: 480px) {
  .header {
    padding: 12px;
  }
  
  .header-left img {
    height: 80px;
    width: 80px;
    max-width: 80px;
  }
  
  .mobile-menu-panel {
    width: 280px;
  }
  
  .main-container {
    padding: 15px 10px;
  }
  
  .section-content {
    padding: 16px;
  }
  
  .btn {
    font-size: 12px;
  }
  
  .login-container {
    padding: 20px;
  }
}

/* =============================================================================
   PRINT STYLES
   ============================================================================= */

@media print {
  body {
    background: white;
    font-size: 12pt;
    line-height: 1.4;
  }
  
  .header,
  .nav-menu,
  .btn,
  .mobile-menu-wrapper,
  .mobile-menu-panel,
  .mobile-backdrop {
    display: none !important;
  }
  
  .section {
    border: 1px solid #ccc;
    box-shadow: none;
    page-break-inside: avoid;
  }
  
  .table {
    border-collapse: collapse;
  }
  
  .table th,
  .table td {
    border: 1px solid #ccc;
    padding: 8px;
  }
}

/* =============================================================================
   ESTIMATES LIST PAGE STYLES - EXACT from Examples
   ============================================================================= */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  align-items: end;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  -webkit-overflow-scrolling: touch;
}

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

th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-700);
  font-size: 14px;
}

td {
  font-size: 14px;
  color: var(--gray-900);
}

tr:hover {
  background: var(--gray-50);
  transition: background-color 0.2s ease;
}

.status-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
}

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

.status-approved {
  background: #dcfce7;
  color: #166534;
}

.status-invoice {
  background: #dbeafe;
  color: #1e40af;
}

.status-paid {
  background: #dcfce7;
  color: #166534;
}

.status-void {
  background: #fee2e2;
  color: #991b1b;
}

.type-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.type-estimate {
  background: #fef3c7;
  color: #92400e;
}

.type-invoice {
  background: #dbeafe;
  color: #1e40af;
}

.actions-cell {
  display: flex;
  gap: 8px;
  align-items: center;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-500);
}

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

/* Mobile responsive styles for estimates list */
@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }

  .page-header > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .filters-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .quick-stats {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .stat-card {
    padding: 20px 15px;
    text-align: center;
  }

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

  .stat-label {
    font-size: 13px;
  }

  .table-container {
    border-radius: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--gray-200);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: white;
  }

  table {
    min-width: 700px;
    font-size: 13px;
    background: white;
  }

  th, td {
    padding: 12px 8px;
    white-space: nowrap;
    border-bottom: 1px solid var(--gray-200);
  }

  th {
    background: var(--gray-50);
    position: sticky;
    top: 0;
    z-index: 1;
  }

  .actions-cell {
    flex-direction: column;
    gap: 8px;
    min-width: 140px;
  }

  .actions-cell .btn {
    font-size: 12px;
    padding: 6px 12px;
  }

  .status-badge, .type-badge {
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 6px;
  }

  .empty-state {
    padding: 40px 20px;
  }

  .empty-state h3 {
    font-size: 20px;
  }
}

@media (max-width: 640px) {
  .quick-stats {
    gap: 10px;
  }

  .stat-card {
    padding: 15px 10px;
  }

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

  .stat-label {
    font-size: 12px;
  }

  .filters-grid {
    gap: 12px;
  }

  .page-header > div:last-child {
    gap: 10px;
  }

  table {
    font-size: 12px;
    min-width: 650px;
  }

  th, td {
    padding: 8px 6px;
  }

  .table-container {
    margin: 0 -10px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .table-container::before {
    content: "← Scroll horizontally to see all columns →";
    display: block;
    text-align: center;
    padding: 8px;
    background: var(--warning-color);
    color: white;
    font-size: 12px;
    font-weight: 600;
  }

  .actions-cell {
    min-width: 120px;
  }

  .actions-cell .btn {
    font-size: 11px;
    padding: 4px 8px;
  }
}

@media (max-width: 480px) {
  .stat-value {
    font-size: 16px;
  }

  .stat-label {
    font-size: 11px;
  }

  table {
    font-size: 11px;
  }

  th, td {
    padding: 6px 4px;
  }

  .actions-cell {
    min-width: 100px;
  }
}

@media (max-width: 360px) {
  .stat-value {
    font-size: 14px;
  }

  .stat-label {
    font-size: 10px;
  }
}

/* =============================================================================
   SERVICE REPORTS FORM STYLES - EXACT from Examples
   ============================================================================= */

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

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

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-6);
}

.form-group-full {
  width: 100%;
}

.form-group-third {
  width: calc(33.33% - 8px);
}

.form-group-quarter {
  width: calc(25% - 12px);
}

.form-group label {
  margin-bottom: 8px;
  color: var(--gray-700);
  font-weight: 600;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 12px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group textarea {
  min-height: auto;
  resize: vertical;
}

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

.form-group input[readonly] {
  background-color: var(--gray-100);
  color: var(--gray-700);
  cursor: not-allowed;
  border-color: var(--gray-200);
}

.signature-container {
  border: 2px solid var(--gray-300);
  border-radius: 8px;
  height: 120px;
  position: relative;
  background: white;
  margin-bottom: var(--space-4);
  width: 100%;
  margin-top: 20px;
  padding: 8px;
}

.signature-container canvas {
  width: 100%;
  height: 104px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  background: white;
  cursor: crosshair;
  display: block;
}

.signature-controls {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
  flex-wrap: wrap;
}

.signature-controls .btn {
  font-size: 12px;
  padding: 8px 16px;
  flex: 1;
  min-width: 100px;
}

.static-text-field {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.static-text-field h3 {
  margin-bottom: 12px;
  color: var(--gray-800);
  font-size: 16px;
  font-weight: 600;
}

.static-text-field div {
  line-height: 1.6;
  color: var(--gray-700);
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-group input[type="checkbox"] {
  margin: 0;
  width: auto;
}

.checkbox-group span {
  color: var(--gray-700);
  font-weight: 600;
}

.terms-section {
  background: var(--gray-50);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  margin: 20px 0;
}

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 30px;
}

/* Service Reports Mobile Responsive */
@media (max-width: 768px) {
  /* Enhanced Form Layout for Mobile */
  .form-row {
    flex-direction: column;
    gap: 0;
    margin-bottom: 20px;
  }

  .form-group,
  .form-group-third,
  .form-group-quarter,
  .form-group-full {
    width: 100% !important;
    margin-bottom: 20px;
    padding: 0;
  }

  .time-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  /* Mobile-Optimized Form Controls */
  .form-group label {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
    color: var(--gray-800);
  }

  .form-group input,
  .form-group select,
  .form-group textarea,
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px !important; /* Prevents zoom on iOS */
    padding: 14px 16px;
    min-height: 50px;
    border-radius: 8px;
    border: 2px solid var(--gray-300);
    width: 100%;
    box-sizing: border-box;
    background: white;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
  }

  .form-group input:focus,
  .form-group select:focus,
  .form-group textarea:focus,
  .form-input:focus,
  .form-select:focus,
  .form-textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
    transform: translateY(-1px);
  }

  /* Textarea Specific */
  .form-group textarea,
  .form-textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
    font-family: inherit;
  }

  /* Select Dropdown */
  .form-group select,
  .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 45px;
  }

  /* Enhanced Checkbox Styling */
  .checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 8px;
    border: 2px solid var(--gray-200);
    transition: all 0.2s ease;
  }

  .checkbox-group:hover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
  }

  .checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-height: 20px;
    margin: 0;
    cursor: pointer;
  }

  .checkbox-group span {
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-800);
    cursor: pointer;
    flex: 1;
  }

  /* Static Text Fields */
  .static-text-field {
    padding: 16px !important;
    margin-bottom: 20px !important;
    background: var(--gray-50) !important;
    border: 2px solid var(--gray-200) !important;
    border-radius: 8px !important;
  }

  .static-text-field h3 {
    font-size: 16px !important;
    margin-bottom: 10px !important;
    color: var(--gray-800) !important;
    font-weight: 600 !important;
  }

  .static-text-field div {
    font-size: 15px !important;
    line-height: 1.6 !important;
    color: var(--gray-700) !important;
  }

  /* Enhanced Signature Container */
  .signature-container {
    height: 150px;
    margin-bottom: 20px;
    margin-top: 20px;
    padding: 12px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    background: white;
    position: relative;
  }

  .signature-container canvas {
    border-radius: 6px;
    touch-action: none;
  }

  /* Signature Controls */
  .signature-controls {
    flex-direction: row;
    gap: 10px;
    justify-content: space-between;
    margin-top: 15px;
  }

  .signature-controls .btn {
    flex: 1;
    min-height: 48px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
  }

  /* Enhanced Form Actions */
  .form-actions {
    flex-direction: column;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
  }

  .form-actions .btn {
    width: 100%;
    min-height: 52px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    padding: 16px 24px;
    transition: all 0.2s ease;
  }

  .form-actions .btn:active {
    transform: translateY(1px);
  }

  /* Better spacing for mobile */
  #reportForm {
    padding: 20px 16px;
  }

  /* Improve touch targets */
  .form-group label,
  .checkbox-group {
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.1);
  }
}

/* Additional Mobile Optimizations for Smaller Screens */
@media (max-width: 480px) {
  .form-group input,
  .form-group select,
  .form-group textarea,
  .form-input,
  .form-select,
  .form-textarea {
    padding: 12px 14px;
    min-height: 48px;
  }

  .form-actions .btn {
    min-height: 50px;
    font-size: 15px;
  }

  .signature-container {
    height: 120px;
    padding: 10px;
  }

  #reportForm {
    padding: 16px 12px;
  }

  .static-text-field {
    padding: 14px !important;
  }

  .checkbox-group {
    padding: 14px;
  }
}

  .terms-section {
    margin: 15px 0;
    padding: 15px;
  }
}

@media (max-width: 640px) {
  .form-group {
    margin-bottom: 16px;
  }
}

@media (max-width: 480px) {
  .form-group {
    margin-bottom: 12px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 12px;
  }

  .signature-container {
    height: 120px;
    margin-top: 20px;
    padding: 8px;
  }
  
  .signature-container canvas {
    width: 100%;
    height: 104px;
  }

  .static-text-field {
    padding: 10px !important;
  }
}

@media (max-width: 360px) {
  .form-group input,
  .form-group select,
  .form-group textarea {
    padding: 10px;
  }
}

/* =============================================================================
   USER MANAGEMENT PAGE STYLES - EXACT from Examples
   ============================================================================= */

.form-label {
  margin-bottom: 8px;
  color: var(--gray-700);
  font-weight: 600;
  font-size: 14px;
}

.form-input, .form-select {
  padding: 12px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.users-table th,
.users-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.users-table th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-700);
}

.users-table tr:hover {
  background: var(--gray-50);
}

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

.user-badge {
  background: var(--primary-color);
  color: white;
  padding: 8px 16px;
  border-radius: 25px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

/* Default mobile users view (hidden on desktop) */
.users-mobile {
  display: none;
}

.user-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.user-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.user-card-info {
  flex: 1;
}

.user-card-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 4px;
  word-break: break-word;
}

.user-card-email {
  font-size: 14px;
  color: var(--gray-600);
  margin-bottom: 8px;
  word-break: break-word;
}

.user-card-role {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.user-card-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--gray-50);
  border-radius: 8px;
}

.user-card-detail {
  font-size: 14px;
}

.user-card-detail-label {
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 2px;
}

.user-card-detail-value {
  color: var(--gray-600);
}

.user-card-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* User Management Mobile Responsive */
@media (max-width: 768px) {
  .users-table {
    display: none;
  }

  .users-mobile {
    display: block;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

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

  .form-label {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-800);
  }

  .form-input, .form-select {
    padding: 16px;
    font-size: 16px;
    border-radius: 12px;
    border: 2px solid var(--gray-300);
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: auto;
  }

  .form-input:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: scale(1.02);
  }

  .user-card-actions .btn {
    padding: 16px 24px;
    font-size: 15px;
    min-height: auto;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
  }

  .user-card-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  .user-card-actions .btn:active {
    transform: translateY(0);
    transition: transform 0.1s ease;
  }

  .btn-small {
    padding: 12px 20px;
    font-size: 14px;
    min-height: auto;
  }

  .modal-content {
    margin: 5% auto;
    padding: 24px;
    width: 95%;
    max-width: 500px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  }

  .modal {
    z-index: 1002;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

@media (max-width: 480px) {
  .user-card {
    padding: 16px;
    margin-bottom: 12px;
  }

  .user-card-name {
    font-size: 16px;
  }

  .user-card-details {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
  }

  .modal-content {
    margin: 2% auto;
    padding: 20px;
    width: 98%;
    border-radius: 12px;
  }
}

/* =============================================================================
   VIEW ESTIMATE/INVOICE PAGE STYLES - EXACT from Examples
   ============================================================================= */

.document-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.conversion-info {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  border-left: 4px solid var(--primary-color);
}

.conversion-info h4 {
  color: var(--primary-color);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.conversion-info p {
  color: var(--gray-700);
  font-size: 14px;
  margin: 0;
}

.document-container {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.document-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 30px;
  border-bottom: 2px solid var(--gray-200);
  background: var(--gray-50);
}

.company-info {
  flex: 1;
}

.company-logo {
  height: 80px;
  width: auto;
  margin-bottom: 16px;
  object-fit: contain;
}

.company-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.company-details {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.5;
}

.document-info {
  text-align: right;
  flex-shrink: 0;
}

.document-type {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 4px;
}

.document-number {
  font-size: 20px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 12px;
}

.document-meta {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.5;
  margin-bottom: 12px;
}

.customer-section {
  padding: 30px;
  border-bottom: 1px solid var(--gray-200);
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 16px;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 8px;
}

.customer-info {
  background: var(--gray-50);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
}

.customer-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.customer-details {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.6;
}

.job-description {
  padding: 30px;
  border-bottom: 1px solid var(--gray-200);
}

.job-description-text {
  background: var(--gray-50);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.6;
}

.items-section {
  padding: 30px;
  border-bottom: 1px solid var(--gray-200);
}

.items-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.items-table th,
.items-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.items-table th {
  background: var(--gray-100);
  font-weight: 600;
  color: var(--gray-700);
  font-size: 14px;
}

.items-table .text-right {
  text-align: right;
}

.items-table tbody tr:hover {
  background: var(--gray-50);
}

.totals-section {
  padding: 30px;
  background: var(--gray-50);
  border-top: 2px solid var(--gray-200);
}

.totals-table {
  width: 100%;
  max-width: 400px;
  margin-left: auto;
  border-collapse: collapse;
}

.totals-table td {
  padding: 8px 0;
  font-size: 16px;
}

.totals-table .label {
  text-align: right;
  padding-right: 20px;
  font-weight: 500;
  color: var(--gray-700);
}

.totals-table .value {
  text-align: right;
  font-weight: 600;
  color: var(--gray-900);
}

.totals-table .total-row {
  border-top: 2px solid var(--gray-300);
}

.totals-table .total-row td {
  padding-top: 12px;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
}

.notes-section {
  padding: 30px;
  border-top: 1px solid var(--gray-200);
}

.notes-content {
  background: var(--gray-50);
  padding: 20px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.6;
}

/* Document View Mobile Responsive */
@media (max-width: 768px) {
  .document-actions {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
    padding: 16px;
  }

  .action-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .action-buttons .btn {
    width: 100%;
    justify-content: center;
  }

  .document-header {
    flex-direction: column;
    gap: 24px;
    padding: 20px;
    text-align: left;
  }

  .document-info {
    text-align: left;
  }

  .document-type {
    font-size: 24px;
  }

  .document-number {
    font-size: 18px;
  }

  .company-logo {
    height: 60px;
  }

  .company-name {
    font-size: 20px;
  }

  .customer-section,
  .job-description,
  .items-section,
  .totals-section,
  .notes-section {
    padding: 20px;
  }

  .section-title {
    font-size: 16px;
  }

  .customer-name {
    font-size: 18px;
  }

  .items-table {
    font-size: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .items-table th,
  .items-table td {
    padding: 10px 8px;
    white-space: nowrap;
  }

  .totals-table {
    max-width: 100%;
  }

  .totals-table .total-row td {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .document-actions {
    padding: 12px;
  }

  .document-header {
    padding: 16px;
  }

  .company-logo {
    height: 50px;
  }

  .company-name {
    font-size: 18px;
  }

  .document-type {
    font-size: 20px;
  }

  .document-number {
    font-size: 16px;
  }

  .customer-section,
  .job-description,
  .items-section,
  .totals-section,
  .notes-section {
    padding: 16px;
  }

  .section-title {
    font-size: 15px;
  }

  .customer-name {
    font-size: 16px;
  }

  .items-table th,
  .items-table td {
    padding: 8px 6px;
    font-size: 13px;
  }

  .totals-table .total-row td {
    font-size: 16px;
  }
}

/* =============================================================================
   VIEW REPORT PAGE STYLES - EXACT from Examples
   ============================================================================= */

.page-title {
  font-size: 28px;
  font-weight: 700;
  color: #94a3b8
  margin-bottom: 8px;
}

.print-button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.print-button:hover {
  background: var(--primary-hover);
}

.form-field {
  padding: 12px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 14px;
  background: var(--gray-50);
  min-height: auto;
  color: var(--gray-800);
}

.form-field.large {
  min-height: auto;
  white-space: pre-wrap;
  line-height: 1.5;
}

.readonly-field {
  background: var(--gray-100);
  color: var(--gray-700);
  border-color: var(--gray-200);
}

.signature-section {
  margin: 20px 0;
}

.signature-section label {
  font-weight: 600;
  margin-bottom: var(--space-3);
  display: block;
  color: var(--gray-700);
}

.signature-image {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
}

.no-signature {
  color: var(--gray-500);
  font-style: italic;
}

/* Print Styles for View Report */
@media print {
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  .print-button {
    display: none;
  }
  
  body {
    background: white;
    margin: 0;
    padding: 0;
    font-size: 12px;
  }
  
  .header {
    box-shadow: none;
    padding: 5px 10px;
    margin: 0;
    page-break-after: avoid;
    break-after: avoid;
  }
  
  .header-content {
    max-width: none;
    margin: 0;
  }
  
  .header-left {
    gap: 10px;
  }
  
  .header-left img {
    height: 80px;
    max-width: 140px;
  }
  
  .header-title {
    font-size: 16px;
    margin: 0;
  }
  
  .header-subtitle {
    font-size: 10px;
    margin: 0;
  }
  
  .main-container {
    padding: 5px 10px;
    margin: 0;
    page-break-before: avoid;
    break-before: avoid;
  }
  
  .section {
    box-shadow: none;
    border: none;
    margin: 0;
    page-break-inside: auto;
    break-inside: auto;
    border-radius: 0;
  }
  
  .section-header {
    padding: 5px 0;
    background: transparent;
    border-bottom: 1px solid #ccc;
  }
  
  .section-header h2 {
    font-size: 14px;
    color: #333;
  }
  
  .section-content {
    padding: 10px 0;
  }
  
  .form-row {
    gap: 8px;
    margin-bottom: 8px;
  }
  
  .form-group {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  
  .form-group label {
    font-size: 10px;
    margin-bottom: 2px;
    font-weight: bold;
  }
  
  .form-field {
    padding: 4px;
    font-size: 10px;
    min-height: auto;
    border: 1px solid #ccc;
    background: white;
  }
  
  .form-field.large {
    min-height: auto;
    line-height: 1.2;
  }
  
  .terms-section {
    padding: 8px;
    margin: 8px 0;
    border: 1px solid #ccc;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  
  .terms-section h3 {
    font-size: 12px;
    margin-bottom: 6px;
  }
  
  .terms-content {
    font-size: 9px;
    line-height: 1.3;
  }
  
  .signature-section {
    margin: 8px 0;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  
  .signature-container {
    height: 100px;
    border: 1px solid #ccc;
    margin-top: 15px;
    padding: 6px;
  }
}

/* View Report Mobile Responsive */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

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

/* =============================================================================
   REPORT LIST PAGE STYLES - EXACT from Examples
   ============================================================================= */

.search-container {
  margin-bottom: var(--space-6);
}

.search-form {
  display: flex;
  gap: var(--space-3);
  max-width: 400px;
}

.search-form input {
  flex: 1;
}

.reports-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.reports-table th {
  background: var(--primary-color);
  color: white;
  padding: var(--space-4);
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
}

.reports-table th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 30px;
}

.reports-table th.sortable:hover {
  background: var(--primary-hover);
}

.reports-table th.sortable::after {
  content: '↕';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.7;
  font-size: 12px;
}

.reports-table th.sortable.asc::after {
  content: '↑';
  opacity: 1;
}

.reports-table th.sortable.desc::after {
  content: '↓';
  opacity: 1;
}

.reports-table td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.875rem;
}

.reports-table tbody tr:hover {
  background: var(--gray-50);
}

.download-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  transition: background-color var(--transition);
}

.download-link:hover {
  background: rgba(59, 130, 246, 0.1);
}

.export-actions {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.no-reports {
  text-align: center;
  padding: var(--space-12);
  color: var(--gray-600);
}

.no-reports-icon {
  font-size: 4rem;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.customer-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.customer-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Mobile card layout for reports table */
.mobile-card {
  display: none;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-200);
}

.mobile-card-title {
  font-weight: 600;
  color: var(--gray-900);
  font-size: 16px;
  margin-bottom: 4px;
}

.mobile-card-date {
  font-size: 14px;
  color: var(--gray-600);
}

.mobile-card-content {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.mobile-card-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-card-label {
  font-size: 12px;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.mobile-card-value {
  font-size: 14px;
  color: var(--gray-900);
}

.mobile-card-description {
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.4;
  max-height: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mobile-card-actions .btn {
  padding: 8px 16px;
  font-size: 12px;
  flex: 1;
  min-width: 100px;
}

/* Mobile responsive styles for report list */
@media (max-width: 768px) {
  .search-form {
    max-width: 100%;
    flex-direction: column;
    gap: 12px;
  }

  .search-form .btn {
    width: 100%;
    margin-bottom: 8px;
  }

  /* Hide desktop table and show mobile cards */
  .table-container {
    display: none;
  }

  .mobile-card {
    display: block;
  }

  .export-actions {
    flex-direction: column;
    gap: 12px;
  }

  .export-actions .btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .mobile-card {
    padding: 16px;
    margin-bottom: 12px;
  }

  .mobile-card-actions {
    flex-direction: column;
  }

  .mobile-card-actions .btn {
    width: 100%;
    flex: none;
  }
}

@media (max-width: 480px) {
  .mobile-card {
    padding: 12px;
    border-radius: 8px;
  }

  .mobile-card-title {
    font-size: 15px;
  }

  .mobile-card-actions .btn {
    padding: 10px 12px;
    font-size: 11px;
  }

  .no-reports {
    padding: 24px 12px;
  }

  .no-reports-icon {
    font-size: 3rem;
  }
}

@media (max-width: 360px) {
  .mobile-card {
    padding: 10px;
  }
}

/* =============================================================================
   CLIENT DASHBOARD PAGE STYLES - EXACT from admin.php Example
   ============================================================================= */

.welcome-message {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
  padding: 0.75rem 2.5rem;
  border-radius: 16px;
  margin-bottom: var(--space-6);
  text-align: center;
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.welcome-message::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.welcome-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.025em;
  position: relative;
  z-index: 1;
  color: white;
}

.welcome-subtitle {
  color: #cbd5e1;
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.5;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.no-features {
  text-align: center;
  padding: var(--space-12);
  color: var(--gray-600);
}

.no-features-icon {
  font-size: 4rem;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}

.no-features h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-3);
  color: var(--gray-700);
}

.no-features p {
  font-size: 0.875rem;
  line-height: 1.6;
}

.feature-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: var(--space-4);
}

.feature-icon.reports {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-color);
}

.feature-icon.estimates {
  background: rgba(16, 163, 74, 0.1);
  color: var(--success-color);
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: var(--gray-900);
}

.feature-description {
  color: var(--gray-600);
  line-height: 1.6;
  font-size: 0.875rem;
}

/* Mobile responsive styles for dashboard */
@media (max-width: 768px) {
  .welcome-message {
    padding: 1.75rem 1.5rem;
    border-radius: 14px;
    margin-bottom: 1.5rem;
  }

  .welcome-title {
    font-size: 1.5rem;
    margin-bottom: 0.625rem;
    letter-spacing: -0.02em;
  }

  .welcome-subtitle {
    font-size: 1rem;
    line-height: 1.4;
    opacity: 0.92;
  }
}

@media (max-width: 480px) {
  .welcome-message {
    padding: 1.5rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.25rem;
  }

  .welcome-title {
    font-size: 1.375rem;
    margin-bottom: 0.5rem;
  }

  .welcome-subtitle {
    font-size: 0.95rem;
    line-height: 1.4;
  }
}

  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .feature-card {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .feature-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  }

  .feature-card:active {
    transform: translateY(-3px) scale(1.01);
    transition: transform 0.1s ease;
  }

  .no-features {
    padding: 40px 20px;
  }

  .no-features-icon {
    font-size: 3rem;
  }
}

/* =============================================================================
   FORM BUILDER PAGE STYLES - Complete Implementation
   ============================================================================= */

/* Form builder container with grid layout */
.form-builder-container {
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  gap: 20px;
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  padding: 30px 20px;
}

.panel {
  background: white;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  overflow: hidden;
  height: fit-content;
}

.panel-header {
  background: var(--gray-100);
  padding: 16px;
  border-bottom: 1px solid var(--gray-200);
  font-weight: 600;
  color: var(--gray-800);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-content {
  padding: 16px;
  max-height: 70vh;
  overflow-y: auto;
}

.field-types {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-type {
  padding: 12px 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  cursor: grab;
  transition: all 0.2s;
  font-size: 14px;
  user-select: none;
}

.field-type:hover {
  background: var(--primary-color);
  color: white;
  transform: translateX(4px);
}

.field-type:active {
  cursor: grabbing;
  transform: scale(0.98);
}

.form-preview {
  min-height: 400px;
  background: var(--gray-50);
  border: 2px dashed var(--gray-300);
  border-radius: 8px;
  padding: 20px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  min-height: 60px;
  padding: 8px;
  border: 1px dashed transparent;
  border-radius: 4px;
  transition: all 0.2s;
}

.form-row:hover {
  border-color: var(--primary-color);
  background: rgba(59, 130, 246, 0.05);
}

.empty-row {
  text-align: center;
  color: var(--gray-500);
  font-style: italic;
  padding: 40px 20px;
  border: 2px dashed var(--gray-300);
  border-radius: 8px;
  background: white;
}

.form-field {
  position: relative;
  padding: 8px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: all 0.2s;
}

.form-field:hover {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.form-field.selected {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.field-controls {
  position: absolute;
  top: -8px;
  right: -8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.form-field:hover .field-controls {
  opacity: 1;
}

.control-btn {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.edit-btn {
  background: var(--warning-color);
}

.delete-btn {
  background: var(--danger-color);
}

.form-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--gray-700);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 12px;
  pointer-events: none;
}

.static-text {
  padding: 8px;
  background: var(--gray-50);
  border-radius: 4px;
  font-size: 12px;
  color: var(--gray-700);
}

.property-group {
  margin-bottom: 16px;
}

.property-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--gray-700);
}

.property-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 13px;
  transition: border-color 0.2s;
}

.property-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.width-selector {
  display: flex;
  gap: 4px;
}

.width-option {
  flex: 1;
  padding: 8px;
  text-align: center;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.width-option:hover {
  border-color: var(--primary-color);
}

.width-option.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.form-list {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.form-item {
  padding: 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.form-item:hover {
  border-color: var(--primary-color);
  background: rgba(59, 130, 246, 0.05);
}

.form-item.active {
  border-color: var(--success-color);
  background: rgba(16, 163, 74, 0.05);
}

.form-item-name {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 14px;
  color: var(--gray-800);
}

.form-item-desc {
  font-size: 12px;
  color: var(--gray-600);
  margin-bottom: 6px;
}

.form-item-meta {
  font-size: 11px;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.form-item-actions {
  display: flex;
  gap: 6px;
}

.form-item-actions .btn {
  padding: 4px 8px;
  font-size: 11px;
}

.save-form-section {
  border-top: 1px solid var(--gray-200);
  padding-top: 16px;
  margin-top: 16px;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.action-buttons .btn {
  padding: 8px 12px;
  font-size: 12px;
}

#messageContainer .message {
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 13px;
}

#messageContainer .message.success {
  background: rgba(16, 163, 74, 0.1);
  color: var(--success-color);
  border: 1px solid rgba(16, 163, 74, 0.2);
}

#messageContainer .message.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Mobile responsive for form builder */
@media (max-width: 1200px) {
  .form-builder-container {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .panel {
    margin-bottom: 20px;
    order: initial;
  }

  /* Reorder panels for better mobile UX */
  .panel:nth-child(2) { order: 1; } /* Form Builder first */
  .panel:nth-child(1) { order: 2; } /* Field Types second */
  .panel:nth-child(3) { order: 3; } /* Forms Management last */
}

@media (max-width: 768px) {
  .form-builder-container {
    padding: 20px 15px;
  }
  
  .panel {
    max-height: 400px;
  }
  
  .panel-content {
    padding: 16px;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .action-buttons .btn {
    width: 100%;
  }
}

/* =============================================================================
   PRINT STYLES - Optimize for single page layout
   ============================================================================= */

@media print {
  /* Hide non-essential elements for printing */
  .main-nav,
  .mobile-nav,
  .print-button,
  .section-header h2,
  .page-description,
  footer {
    display: none !important;
  }
  
  /* Remove margins and padding for more space */
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: white !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
  }
  
  .main-container {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }
  
  .section {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
  }
  
  .section-content {
    padding: 0 !important;
  }
  
  /* Optimize form layout for printing */
  .form-row {
    margin-bottom: 8px !important;
    page-break-inside: avoid;
  }
  
  .form-group {
    margin-bottom: 6px !important;
  }
  
  .form-group label {
    font-size: 11px !important;
    font-weight: 600 !important;
    margin-bottom: 2px !important;
    color: #333 !important;
  }
  
  .form-field {
    border: 1px solid #ccc !important;
    padding: 4px 6px !important;
    font-size: 11px !important;
    background: white !important;
    color: #333 !important;
    min-height: 16px !important;
  }
  
  .form-field.large {
    min-height: 40px !important;
    padding: 6px !important;
  }
  
  /* Static text fields */
  .static-text-field {
    border: 1px solid #ccc !important;
    background: #f8f9fa !important;
    padding: 8px !important;
    margin-bottom: 8px !important;
    font-size: 11px !important;
    color: #333 !important;
  }
  
  .static-text-field h3 {
    font-size: 12px !important;
    margin-bottom: 4px !important;
    color: #333 !important;
  }
  
  /* Signature container optimization */
  .signature-container {
    margin-bottom: 8px !important;
    page-break-inside: avoid;
  }
  
  .signature-image {
    max-width: 300px !important;
    max-height: 100px !important;
    border: 1px solid #ccc !important;
  }
  
  .no-signature {
    border: 1px solid #ccc !important;
    padding: 20px !important;
    text-align: center !important;
    color: #666 !important;
    font-size: 11px !important;
    background: #f8f9fa !important;
  }
  
  /* Try to keep content on one page */
  .section-content {
    page-break-inside: avoid;
  }
  
  /* If content must break, do it between form rows */
  .form-row {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  
  /* Ensure proper page margins */
  @page {
    margin: 0.5in;
    size: letter;
  }
  
  /* Compress spacing for better fit */
  * {
    line-height: 1.2 !important;
  }
  
  h1, h2, h3 {
    margin-top: 0 !important;
    margin-bottom: 8px !important;
  }
  
  /* Optimize checkbox display */
  .checkbox-indicator {
    font-size: 14px !important;
    margin-right: 4px !important;
  }
}

/* =============================================================================
   SEARCH FORM STYLES - Fix search field sizing
   ============================================================================= */

.search-container {
  margin-bottom: 20px;
}

.search-form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.search-form .form-input {
  flex: 1;
  min-width: 300px;
  max-width: 600px;
  width: auto;
  padding: 12px 16px;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid var(--gray-300);
  background: white;
  transition: all 0.2s ease;
}

.search-form .form-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  transform: none;
}

.search-form .btn {
  min-width: 80px;
  flex-shrink: 0;
}

/* Export actions styling */
.export-actions {
  margin-bottom: 15px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.export-actions .btn-small {
  padding: 8px 16px;
  font-size: 13px;
}

/* Responsive search form */
@media (max-width: 768px) {
  .search-form {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-form .form-input {
    min-width: auto;
    width: 100%;
  }
  
  .search-form .btn.btn-full {
    width: 100%;
  }
}

/* =============================================================================
   CUSTOMER PAGE BUTTON FIXES - Make buttons symmetrical
   ============================================================================= */

/* Actions bar buttons - make them uniform height */
.actions-bar .btn {
  min-height: 40px;
  white-space: nowrap;
}

/* Customer card action buttons - make them symmetrical */
.customer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: stretch;
}

.customer-actions .btn {
  flex: 1;
  min-height: 36px;
  min-width: 100px;
}

/* Ensure consistent button appearance in actions bar */
.actions-bar > div:last-child {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

/* Mobile responsive for customer buttons */
@media (max-width: 480px) {
  .customer-actions {
    flex-direction: column;
  }
  
  .customer-actions .btn.btn-full {
    min-width: auto;
    width: 100%;
  }
  
  .actions-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .actions-bar > div:last-child {
    flex-direction: column;
    width: 100%;
  }
  
  .actions-bar .btn.btn-full {
    min-width: auto;
    width: 100%;
  }
}

/* =============================================================================
   PAYMENT TRACKING STYLES
   ============================================================================= */

.payment-container {
  max-width: 1200px;
  margin: 0 auto;
}

.payment-summary {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  overflow: hidden;
  margin-bottom: 30px;
}

.payment-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
  color: white;
  padding: 25px 30px;
  position: relative;
}

.payment-header::before {
  content: '💰';
  font-size: 24px;
  position: absolute;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.7;
}

.payment-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding: 30px;
  background: #f8fafc;
}

.payment-stats .stat-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  border-left: 4px solid;
}

.payment-stats .stat-card:nth-child(1) {
  border-left-color: #3b82f6;
}

.payment-stats .stat-card:nth-child(2) {
  border-left-color: #16a34a;
}

.payment-stats .stat-card:nth-child(3) {
  border-left-color: #dc2626;
}

.payment-stats .stat-card:nth-child(4) {
  border-left-color: #2563eb;
}

.payments-section {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  margin-bottom: 30px;
}

.payment-form {
  background: #f8fafc;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 30px;
  border: 1px solid #e2e8f0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.payments-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.payments-table th,
.payments-table td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.payments-table th {
  background: #f1f5f9;
  font-weight: 600;
  color: #475569;
  font-size: 14px;
}

.payments-table tbody tr:hover {
  background: #f8fafc;
}

.payment-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-paid {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #16a34a;
}

.status-partial {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
}

.status-overdue {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #ef4444;
}

.status-pending {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #94a3b8;
}

.overdue-notice {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  border: 1px solid #ef4444;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  border-left: 4px solid #ef4444;
}

.due-date-form {
  background: #fffbeb;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
}

@media (max-width: 768px) {
  .payment-container {
    margin: 20px;
  }
  
  .payment-stats {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================================================
   PRODUCT CATALOG STYLES
   ============================================================================= */

.product-catalog-container {
  max-width: 1400px;
  margin: 0 auto;
}

.product-modal {
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
}

.pricing-section {
  background: #f8fafc;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  border: 1px solid #e2e8f0;
}

.pricing-section h4 {
  margin: 0 0 15px 0;
  color: #1e293b;
  font-size: 16px;
  font-weight: 600;
}

.pricing-fields {
  margin-top: 15px;
}

.tiered-pricing-container {
  margin-bottom: 15px;
}

.tier-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 15px;
  align-items: end;
  margin-bottom: 15px;
  padding: 15px;
  background: white;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  margin: 0;
}

.status-active {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #16a34a;
}

.status-inactive {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #ef4444;
}

/* Product grid for card view */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.product-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 1px solid #e2e8f0;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.product-card-header {
  padding: 20px;
  border-bottom: 1px solid #e2e8f0;
}

.product-card-title {
  font-size: 18px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 5px 0;
}

.product-card-sku {
  font-size: 12px;
  color: #64748b;
  font-family: monospace;
}

.product-card-body {
  padding: 20px;
}

.product-card-description {
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 15px;
}

/* =============================================================================
   CATEGORIES MANAGEMENT STYLES
   ============================================================================= */

.categories-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  gap: 20px !important;
  margin-top: 20px !important;
}

.category-card {
  background: white !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
  border: 1px solid #e2e8f0 !important;
  padding: 20px !important;
  transition: transform 0.2s, box-shadow 0.2s !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  min-height: 160px !important;
}

.category-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.category-info {
  flex: 1 !important;
}

.category-info h4 {
  margin: 0 0 8px 0 !important;
  color: #1e293b !important;
  font-size: 18px !important;
  font-weight: 600 !important;
}

.category-info p {
  margin: 0 0 15px 0 !important;
  color: #64748b !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  min-height: 40px !important;
}

.category-stats {
  margin-top: auto !important;
  padding-top: 15px !important;
  border-top: 1px solid #f1f5f9 !important;
}

.product-count {
  font-size: 12px !important;
  color: #475569 !important;
  background: #f1f5f9 !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
  font-weight: 500 !important;
  display: inline-block !important;
}

.category-actions {
  margin-top: 15px !important;
  display: flex !important;
  gap: 8px !important;
  justify-content: flex-start !important;
}

/* Mobile responsive for categories */
@media (max-width: 768px) {
  .categories-grid {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
  }
  
  .category-card {
    padding: 15px !important;
    min-height: 140px !important;
  }
  
  .category-actions {
    flex-direction: column !important;
    gap: 8px !important;
  }
}

.product-card-price {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 10px;
}

.product-card-footer {
  padding: 15px 20px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.product-category-badge {
  background: #e0f2fe;
  color: #0369a1;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

@media (max-width: 768px) {
  .product-catalog-container {
    margin: 20px;
  }
  
  .product-modal {
    max-width: 95vw;
    margin: 20px auto;
  }
  
  .tier-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .products-grid {
    grid-template-columns: 1fr;
  }
  
  .checkbox-group {
    flex-direction: row;
    flex-wrap: wrap;
  }
}
}