/* ============================================
   YARDPRO DESIGN SYSTEM
   Unified styling for consistent UI
   ============================================ */

/* ============================================
   1. CSS VARIABLES - Design Tokens
   ============================================ */

:root {
    /* Primary Brand Colors */
    --primary: #667eea;
    --primary-dark: #5468d4;
    --primary-light: #818cf8;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* Accent Colors */
    --accent-purple: #8b5cf6;
    --accent-green: #22c55e;
    --accent-blue: #3b82f6;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
    --accent-teal: #14b8a6;
    
    /* Neutral Colors - Light Mode */
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-elevated: #f8fafc;
    --bg-muted: #f1f5f9;
    --bg-hover: #e2e8f0;
    
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-disabled: #94a3b8;
    
    /* Typography Scale */
    --text-xs: 0.75rem;     /* 12px - badges, hints */
    --text-sm: 0.875rem;    /* 14px - body small, labels */
    --text-base: 1rem;      /* 16px - body */
    --text-lg: 1.125rem;    /* 18px - body large */
    --text-xl: 1.25rem;     /* 20px - headings */
    --text-2xl: 1.5rem;     /* 24px - section titles */
    --text-3xl: 2rem;       /* 32px - page titles */
    --text-4xl: 2.5rem;     /* 40px - hero titles */
    
    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
    
    /* Spacing Scale */
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.15);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
    
    /* Sidebar */
    --sidebar-width: 260px;
    --header-height: 72px;
}

/* Dark Mode Variables */
[data-bs-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-elevated: #334155;
    --bg-muted: #0f172a;
    --bg-hover: #334155;
    
    --border-light: #334155;
    --border-medium: #475569;
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-disabled: #64748b;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.4);
}

/* ============================================
   2. BASE STYLES
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    font-size: var(--text-base);
    color: var(--text-primary);
    background: var(--bg-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   3. LAYOUT
   ============================================ */

.app-layout {
    display: flex;
    min-height: 100vh;
    background: var(--bg-body);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

[data-bs-theme="light"] .sidebar {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
    box-shadow: var(--shadow-md);
}

.sidebar-header {
    padding: var(--space-6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-bs-theme="light"] .sidebar-header {
    border-bottom-color: var(--border-light);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.logo-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-name {
    font-size: var(--text-xl);
    font-weight: var(--font-extrabold);
    color: #ffffff !important;
    letter-spacing: -0.025em;
}

[data-bs-theme="light"] .logo-name {
    color: var(--text-primary) !important;
}

.logo-tagline {
    font-size: var(--text-xs);
    color: #94a3b8 !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

[data-bs-theme="light"] .logo-tagline {
    color: var(--text-muted) !important;
}

/* Logo dark/light mode switching */
.sidebar-logo {
    height: 56px;
    width: auto;
    object-fit: contain;
}

.logo-for-dark {
    display: inline-block;
}

.logo-for-light {
    display: none;
}

[data-bs-theme="light"] .logo-for-dark {
    display: none;
}

[data-bs-theme="light"] .logo-for-light {
    display: inline-block;
}

/* Login page logo */
.login-logo-wrapper {
    text-align: center;
    margin-bottom: var(--space-4);
}

.login-logo {
    max-width: 280px;
    height: auto;
}

/* Company logo in header */
.company-logo-img {
    height: 24px;
    width: auto;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.sidebar-footer {
    margin-top: auto;
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

[data-bs-theme="light"] .sidebar-footer {
    border-top-color: var(--border-light);
}

.version-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--text-xs);
    color: var(--text-muted) !important;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--text-muted);
}

.status-dot.online {
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

/* Main Wrapper */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--space-8);
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: var(--space-2);
    cursor: pointer;
}

.page-context {
    display: flex;
    flex-direction: column;
}

.page-title {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: var(--space-6) var(--space-8);
    background: var(--bg-body);
}

.content-area {
    max-width: 1600px;
    margin: 0 auto;
}

/* Footer */
.main-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-8);
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.footer-right {
    display: flex;
    gap: var(--space-6);
}

.footer-right a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-right a:hover {
    color: var(--primary);
}

/* ============================================
   4. NAVIGATION
   ============================================ */

.nav-menu {
    display: flex;
    flex-direction: column;
    padding: var(--space-4) 0;
    flex: 1;
    overflow-y: auto;
}

.nav-section {
    padding: var(--space-2) var(--space-4);
    margin-bottom: var(--space-2);
}

.nav-section-title {
    display: block;
    font-size: 0.65rem;
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted) !important;
    padding: 0 var(--space-3);
    margin-bottom: var(--space-3);
}

/* Nav Links */
.sidebar .nav-link,
.nav-menu .nav-link,
.nav-menu a {
    display: flex !important;
    align-items: center !important;
    gap: var(--space-3) !important;
    padding: var(--space-3) !important;
    margin-bottom: var(--space-1) !important;
    border-radius: var(--radius-lg) !important;
    color: #cbd5e1 !important;
    text-decoration: none !important;
    font-size: var(--text-sm) !important;
    font-weight: var(--font-medium) !important;
    transition: all var(--transition-base) !important;
    position: relative !important;
    background: transparent !important;
}

[data-bs-theme="light"] .sidebar .nav-link,
[data-bs-theme="light"] .nav-menu .nav-link,
[data-bs-theme="light"] .nav-menu a {
    color: var(--text-secondary) !important;
}

.sidebar .nav-link:hover,
.nav-menu .nav-link:hover,
.nav-menu a:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

[data-bs-theme="light"] .sidebar .nav-link:hover,
[data-bs-theme="light"] .nav-menu .nav-link:hover,
[data-bs-theme="light"] .nav-menu a:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    color: var(--text-primary) !important;
}

.sidebar .nav-link.active,
.nav-menu .nav-link.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.25) 100%) !important;
    color: #ffffff !important;
}

[data-bs-theme="light"] .sidebar .nav-link.active,
[data-bs-theme="light"] .nav-menu .nav-link.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%) !important;
    color: var(--primary) !important;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 28px;
    background: var(--primary-gradient);
    border-radius: 0 4px 4px 0;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    flex-shrink: 0;
    transition: all var(--transition-base);
    color: #94a3b8;
}

[data-bs-theme="light"] .nav-icon {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-muted);
}

.nav-link:hover .nav-icon {
    background: rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
}

[data-bs-theme="light"] .nav-link:hover .nav-icon {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-secondary);
}

.nav-link.active .nav-icon {
    background: var(--primary-gradient);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.nav-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit !important;
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.5rem;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white !important;
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: var(--font-bold);
    text-transform: uppercase;
}

.nav-arrow {
    display: flex;
    align-items: center;
    opacity: 0.5;
    transition: all var(--transition-base);
    color: #94a3b8;
}

.nav-link:hover .nav-arrow {
    opacity: 1;
    transform: translateX(3px);
}

.admin-section {
    margin-top: auto;
    padding-top: var(--space-4);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

[data-bs-theme="light"] .admin-section {
    border-top-color: var(--border-light);
}

.admin-link {
    background: rgba(139, 92, 246, 0.15) !important;
    border: 1px solid rgba(139, 92, 246, 0.25) !important;
}

.admin-link:hover {
    background: rgba(139, 92, 246, 0.25) !important;
    border-color: rgba(139, 92, 246, 0.4) !important;
}

.admin-link .nav-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
    color: white !important;
}

/* Scrollbar */
.nav-menu::-webkit-scrollbar {
    width: 4px;
}

.nav-menu::-webkit-scrollbar-track {
    background: transparent;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.nav-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ============================================
   5. CARDS
   ============================================ */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: var(--space-5) var(--space-6);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-light);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.card-header.gradient {
    background: var(--primary-gradient);
    color: white;
    border-bottom: none;
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-4) var(--space-6);
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-light);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ============================================
   6. STAT CARDS - Unified Design
   ============================================ */

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    color: white;
    flex-shrink: 0;
}

.stat-icon.primary, .stat-icon.bg-primary { background: var(--primary-gradient); }
.stat-icon.success, .stat-icon.bg-success { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); }
.stat-icon.info, .stat-icon.bg-info { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }
.stat-icon.warning, .stat-icon.bg-warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.stat-icon.danger, .stat-icon.bg-danger { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.stat-icon.purple, .stat-icon.bg-purple { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); }
.stat-icon.teal, .stat-icon.bg-teal { background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%); }
.stat-icon.secondary, .stat-icon.bg-secondary { background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%); }

.stat-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-extrabold);
    line-height: 1.2;
    color: var(--text-primary);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-value.plain {
    background: none;
    -webkit-text-fill-color: var(--text-primary);
    color: var(--text-primary);
}

.stat-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: var(--font-semibold);
    margin-top: var(--space-1);
}

/* Stat Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
}

/* Compact Stat Chip */
.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--primary);
}

.stat-chip.success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: var(--accent-green);
}

[data-bs-theme="dark"] .stat-chip {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e3a8a 100%);
    color: #60a5fa;
}

[data-bs-theme="dark"] .stat-chip.success {
    background: linear-gradient(135deg, #14532d 0%, #166534 100%);
    color: #4ade80;
}

/* ============================================
   7. TABLES - Unified Design
   ============================================ */

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

.table th {
    padding: var(--space-4) var(--space-5);
    text-align: left;
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border-bottom: 2px solid var(--border-light);
}

.table td {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

.table-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

/* Override Bootstrap table-light */
[data-bs-theme="dark"] .table-light {
    --bs-table-bg: var(--bg-card) !important;
    --bs-table-color: var(--text-primary) !important;
    --bs-table-border-color: var(--border-light) !important;
}

[data-bs-theme="dark"] .table thead th {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-bottom-color: var(--border-light);
}

[data-bs-theme="dark"] .table tbody td {
    border-color: var(--border-light);
}

[data-bs-theme="dark"] .table-hover tbody tr:hover {
    --bs-table-hover-bg: rgba(102, 126, 234, 0.1);
}

/* ============================================
   8. BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
    color: white;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 2px solid var(--border-light);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-medium);
}

[data-bs-theme="dark"] .btn-secondary {
    background: var(--bg-card);
    border-color: var(--border-light);
    color: var(--text-secondary);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.5);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.4);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.5);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-light);
}

.btn-outline:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--bg-hover);
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
}

.btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-base);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    color: var(--text-muted);
}

.btn-icon:hover:not(:disabled) {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Action Button for Tables */
.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-elevated);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-base);
}

.action-btn:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.action-btn.danger:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.action-btn.success:hover {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.action-btn.warning:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.action-buttons {
    display: flex;
    gap: var(--space-2);
}

/* ============================================
   9. BADGES
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-pill {
    border-radius: var(--radius-full);
}

.badge-primary { background: var(--primary-gradient); color: white; }
.badge-success { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); color: white; }
.badge-info { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: white; }
.badge-warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; }
.badge-danger { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); color: white; }
.badge-purple { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); color: white; }

/* Role Badges */
.role-badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.role-god { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); color: white; }
.role-superadmin { background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%); color: white; }
.role-admin { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: white; }
.role-manager { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); color: white; }
.role-worker { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); color: white; }
.role-viewer { background: linear-gradient(135deg, #64748b 0%, #475569 100%); color: white; }

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
}

.status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.inactive {
    background: #fee2e2;
    color: #dc2626;
}

[data-bs-theme="dark"] .status-badge.active {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

[data-bs-theme="dark"] .status-badge.inactive {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* ============================================
   10. FORMS
   ============================================ */

.form-group {
    margin-bottom: var(--space-4);
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-secondary);
}

.form-control,
.form-select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    background: var(--bg-elevated);
    color: var(--text-primary);
    transition: all var(--transition-base);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

.form-control::placeholder {
    color: var(--text-disabled);
}

.form-control:disabled {
    background: var(--bg-muted);
    color: var(--text-disabled);
    cursor: not-allowed;
}

.form-hint {
    display: block;
    margin-top: var(--space-2);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.form-section {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--border-light);
}

.form-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.form-section h4 {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0 0 var(--space-4) 0;
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.form-section h4::before {
    content: '';
    display: block;
    width: 4px;
    height: 16px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

/* Input Group */
.input-group-text {
    background: var(--bg-elevated);
    border-color: var(--border-light);
    color: var(--text-muted);
}

/* ============================================
   11. MODALS
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-4);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

.modal-content.sm { max-width: 420px; }
.modal-content.lg { max-width: 720px; }
.modal-content.xl { max-width: 900px; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-6);
    background: var(--primary-gradient);
    color: white;
}

.modal-header.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.modal-header.success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.modal-header.purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.modal-header h3 {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    display: flex;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-body {
    padding: var(--space-6);
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-4);
    padding: var(--space-5) var(--space-6);
    border-top: 1px solid var(--border-light);
    background: var(--bg-elevated);
}

/* ============================================
   12. ALERTS & MESSAGES
   ============================================ */

.alert {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    margin-bottom: var(--space-4);
    border: 1px solid;
}

.alert-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #bbf7d0;
    color: #166534;
}

.alert-danger {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fecaca;
    color: #dc2626;
}

.alert-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fde68a;
    color: #92400e;
}

.alert-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #bfdbfe;
    color: #1e40af;
}

[data-bs-theme="dark"] .alert-success {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: #86efac;
}

[data-bs-theme="dark"] .alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

[data-bs-theme="dark"] .alert-warning {
    background: rgba(234, 179, 8, 0.15);
    border-color: rgba(234, 179, 8, 0.3);
    color: #fde047;
}

[data-bs-theme="dark"] .alert-info {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

.error-message {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #dc2626;
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    margin-top: var(--space-4);
    border: 1px solid #fecaca;
}

[data-bs-theme="dark"] .error-message {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

/* ============================================
   13. PAGE LAYOUTS
   ============================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.page-header h1 {
    font-size: var(--text-3xl);
    font-weight: var(--font-extrabold);
    color: var(--text-primary);
    margin: 0 0 var(--space-1) 0;
}

.page-header .text-muted {
    color: var(--text-muted) !important;
    font-size: var(--text-sm);
}

.header-actions {
    display: flex;
    gap: var(--space-3);
}

/* Tab Header (Admin tabs) */
.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    padding: var(--space-6);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.header-info h3 {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin: 0 0 var(--space-2) 0;
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}

.header-info h3 svg {
    color: var(--primary);
}

.header-info p {
    margin: 0;
    color: var(--text-muted);
    font-size: var(--text-sm);
}

/* Hero Section */
.hero-section {
    background: var(--primary-gradient);
    border-radius: var(--radius-xl);
    padding: var(--space-10);
    color: white;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    margin-bottom: var(--space-6);
}

[data-bs-theme="dark"] .hero-section {
    background: linear-gradient(135deg, #4c51bf 0%, #553c9a 100%);
}

.hero-title {
    font-size: var(--text-3xl);
    font-weight: var(--font-extrabold);
    margin-bottom: var(--space-2);
}

.hero-subtitle {
    opacity: 0.9;
    font-size: var(--text-lg);
    margin-bottom: var(--space-6);
}

/* ============================================
   14. FILTERS & SEARCH
   ============================================ */

.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    padding: var(--space-5) var(--space-6);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    margin-bottom: var(--space-6);
    border: 1px solid var(--border-light);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    min-width: 160px;
}

.filter-group.search {
    flex: 1;
    min-width: 250px;
}

.filter-group label {
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper svg {
    position: absolute;
    left: 12px;
    color: var(--text-disabled);
}

.search-input-wrapper input {
    width: 100%;
    padding-left: var(--space-10);
}

.filter-card {
    position: sticky;
    top: var(--space-4);
    border: 1px solid var(--border-light);
}

.filter-card .card-header {
    background: var(--primary-gradient);
    color: white;
    border-bottom: none;
}

/* ============================================
   15. ENTITY CARDS (Companies, Yards, etc.)
   ============================================ */

.entity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--space-6);
}

.entity-card {
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all var(--transition-slow);
    border: 1px solid var(--border-light);
}

.entity-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.entity-card .card-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5) var(--space-6);
    background: var(--primary-gradient);
    color: white;
}

.entity-card .card-header.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.entity-card .card-header.purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.entity-icon {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.entity-title {
    flex: 1;
    min-width: 0;
}

.entity-title h4 {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: white;
}

.entity-title .subtitle {
    font-size: var(--text-sm);
    opacity: 0.85;
    margin-top: var(--space-1);
}

.entity-card .card-body {
    padding: var(--space-5) var(--space-6);
}

.entity-card .card-footer {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-4) var(--space-5);
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-light);
}

/* Company Card extends entity-card */
.company-card { }
.company-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: var(--font-bold);
    font-size: var(--text-sm);
    flex-shrink: 0;
}

.company-avatar.large {
    width: 56px;
    height: 56px;
    font-size: var(--text-xl);
    border-radius: var(--radius-lg);
}

.company-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    object-fit: contain;
    flex-shrink: 0;
    background: var(--bg-elevated);
}

/* Yard Card */
.yard-card .stats-row {
    display: flex;
    gap: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-light);
}

.yard-card .stats-row .stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    flex: 1;
}

/* ============================================
   16. AVATARS
   ============================================ */

.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    font-weight: var(--font-bold);
    color: white;
    flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.avatar-md { width: 44px; height: 44px; font-size: var(--text-sm); }
.avatar-lg { width: 56px; height: 56px; font-size: var(--text-lg); }
.avatar-xl { width: 72px; height: 72px; font-size: var(--text-xl); }

.avatar-circle { border-radius: var(--radius-full); }

.avatar-primary { background: var(--primary-gradient); }
.avatar-success { background: linear-gradient(135deg, #10b981, #059669); }
.avatar-info { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.avatar-warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.avatar-purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.avatar-secondary { background: linear-gradient(135deg, #6b7280, #4b5563); }

/* User specific avatars */
.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: var(--font-bold);
    font-size: var(--text-sm);
}

.user-avatar.large {
    width: 56px;
    height: 56px;
    font-size: var(--text-lg);
    border-radius: var(--radius-lg);
}

.worker-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: var(--font-bold);
    font-size: var(--text-sm);
    flex-shrink: 0;
}

.customer-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-semibold);
    color: white;
    font-size: var(--text-base);
    flex-shrink: 0;
}

.customer-avatar-sm {
    width: 36px;
    height: 36px;
    font-size: var(--text-xs);
}

/* ============================================
   17. PAGINATION
   ============================================ */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-6);
    margin-top: var(--space-6);
    padding: var(--space-5);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.page-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    background: var(--bg-elevated);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.page-btn:hover:not(:disabled) {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-weight: var(--font-medium);
}

/* ============================================
   18. LOADING STATES
   ============================================ */

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12) var(--space-8);
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow);
}

.loading-state .spinner {
    width: 56px;
    height: 56px;
    border: 4px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: var(--space-6);
}

.loading-state p {
    color: var(--text-muted);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
}

.spinner-small {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-8);
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow);
}

.empty-state .icon {
    font-size: 4rem;
    color: var(--text-disabled);
    margin-bottom: var(--space-4);
}

.empty-state h4 {
    margin: 0 0 var(--space-3) 0;
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}

.empty-state p {
    margin: 0 0 var(--space-6) 0;
    color: var(--text-muted);
    font-size: var(--text-base);
}

/* Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================
   19. ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   20. USER MENU & DROPDOWNS
   ============================================ */

.user-menu {
    position: relative;
    z-index: 1001;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2);
    padding-right: var(--space-3);
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
}

.user-menu-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-medium);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.user-name {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
}

.user-role {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.chevron {
    color: var(--text-disabled);
    transition: transform var(--transition-base);
}

.chevron.open {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-light);
    overflow: hidden;
    z-index: 1002;
    animation: dropdownFadeIn 0.2s ease;
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5);
    background: var(--bg-elevated);
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.user-details .name {
    font-weight: var(--font-bold);
    color: var(--text-primary);
    font-size: var(--text-sm);
}

.user-details .email {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 0;
}

.dropdown-section {
    padding: var(--space-2);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.dropdown-item.logout {
    color: var(--accent-red);
}

.dropdown-item.logout:hover {
    background: #fef2f2;
}

[data-bs-theme="dark"] .dropdown-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: 998;
}

/* Quick Stats in Header */
.quick-stats {
    display: flex;
    gap: var(--space-3);
}

/* Notifications */
.notifications-wrapper {
    position: relative;
}

.notification-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-base);
}

.notification-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-medium);
    color: var(--text-secondary);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 9px;
    font-size: 0.65rem;
    font-weight: var(--font-bold);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Company Badge in Header */
.company-badge {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: #7c3aed;
}

[data-bs-theme="dark"] .company-badge {
    background: linear-gradient(135deg, #312e81 0%, #3730a3 100%);
    color: #a5b4fc;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-base);
}

.theme-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--border-medium);
    color: var(--text-secondary);
}

[data-bs-theme="dark"] .theme-toggle {
    color: #fbbf24;
}

[data-bs-theme="dark"] .theme-toggle:hover {
    color: #fcd34d;
}

/* Sign In Button */
.signin-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    background: var(--primary-gradient);
    color: white;
    border-radius: var(--radius-lg);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    text-decoration: none;
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.signin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    color: white;
}

/* ============================================
   21. SPECIFIC PAGE STYLES
   ============================================ */

/* Lookup Hero (Home Page) */
.lookup-hero {
    background: var(--primary-gradient);
    border-radius: var(--radius-xl);
    padding: var(--space-10);
    color: white;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

[data-bs-theme="dark"] .lookup-hero {
    background: linear-gradient(135deg, #4c51bf 0%, #553c9a 100%);
}

.lookup-title {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-2);
}

.lookup-subtitle {
    opacity: 0.9;
    font-size: var(--text-lg);
    margin-bottom: var(--space-6);
}

.lookup-form {
    max-width: 600px;
}

.lookup-input {
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 2px;
    border: none;
}

.lookup-input::placeholder {
    text-transform: none;
    letter-spacing: normal;
    font-weight: normal;
}

.lookup-btn {
    font-weight: var(--font-semibold);
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

.lookup-hint {
    display: block;
    margin-top: var(--space-2);
    opacity: 0.85;
}

/* Dashboard Container */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-5);
}

/* Vehicle Details */
.engine-hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    text-align: center;
}

.engine-stat {
    display: inline-flex;
    align-items: baseline;
    margin: 0 var(--space-2);
}

.engine-value {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    color: #fff;
    line-height: 1;
}

.engine-unit {
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    color: var(--primary);
    margin-left: var(--space-1);
}

.engine-config {
    font-size: var(--text-lg);
    color: var(--primary);
    font-weight: var(--font-semibold);
    padding: var(--space-1) var(--space-3);
    background: rgba(102, 126, 234, 0.15);
    border-radius: var(--radius-full);
}

.section-title {
    color: var(--text-secondary);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
}

.section-title.clickable:hover {
    color: var(--primary);
}

.technical-data-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-1) var(--space-4);
    max-height: 400px;
    overflow-y: auto;
    padding: var(--space-3);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    margin-top: var(--space-2);
}

.tech-item {
    display: flex;
    flex-direction: column;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--border-light);
}

.tech-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tech-value {
    font-size: var(--text-sm);
    color: var(--text-primary);
    word-break: break-word;
}

/* ============================================
   22. TABS
   ============================================ */

.tabs {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.tab-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-light);
}

.tab-list li {
    padding: var(--space-4) var(--space-6);
    cursor: pointer;
    font-weight: var(--font-semibold);
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition-base);
}

.tab-list li:hover {
    color: var(--primary);
    background: var(--bg-hover);
}

.tab-list li.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    padding: var(--space-6);
}

/* Detail Tabs (Customer details etc.) */
.detail-tabs {
    display: flex;
    gap: var(--space-1);
    padding: 0 var(--space-4);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-light);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: var(--font-medium);
}

/* ============================================
   23. CUSTOMER PAGE SPECIFIC
   ============================================ */

.customers-page {
    padding: 0;
}

.customer-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-base);
}

.customer-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.customer-card.preferred {
    border-color: var(--accent-amber);
    background: linear-gradient(135deg, #fffbeb 0%, var(--bg-card) 50%);
}

[data-bs-theme="dark"] .customer-card.preferred {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, var(--bg-card) 50%);
}

.customer-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    position: relative;
}

.customer-title {
    flex: 1;
    min-width: 0;
}

.customer-title h6 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    color: var(--text-primary);
}

.preferred-star {
    color: var(--accent-amber);
    font-size: var(--text-xl);
}

.customer-card-body {
    padding: 0 var(--space-4) var(--space-4);
}

.contact-line {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
}

.contact-line span:first-child {
    color: var(--text-disabled);
    width: 16px;
}

.customer-card-footer {
    display: flex;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-light);
}

/* Info Sections (Customer details) */
.info-section {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-light);
}

.info-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.info-section h6 {
    color: var(--text-secondary);
    margin-bottom: var(--space-3);
    font-weight: var(--font-semibold);
}

.info-grid {
    display: grid;
    gap: var(--space-3);
}

.info-item {
    display: flex;
    flex-direction: column;
    padding: var(--space-2) 0;
}

.info-item.full-width {
    grid-column: span 2;
}

.info-label {
    font-size: var(--text-xs);
    color: var(--text-disabled);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.info-value {
    font-size: var(--text-sm);
    color: var(--text-primary);
    font-weight: var(--font-medium);
}

.address-block {
    background: var(--bg-elevated);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    line-height: 1.6;
}

/* Mini Stats Grid */
.mini-stat {
    background: var(--bg-elevated);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    text-align: center;
}

.mini-stat-value {
    display: block;
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}

.mini-stat-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* Activity Timeline */
.activity-timeline {
    position: relative;
    padding-left: var(--space-8);
}

.activity-timeline::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-light);
}

.activity-item {
    position: relative;
    padding-bottom: var(--space-6);
    display: flex;
    gap: var(--space-4);
}

.activity-icon {
    position: absolute;
    left: calc(-1 * var(--space-8));
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--text-xs);
    z-index: 1;
}

.activity-content {
    display: flex;
    flex-direction: column;
}

.activity-content strong {
    font-size: var(--text-sm);
}

.activity-content span {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* ============================================
   24. EBAY PAGE
   ============================================ */

.ebay-page {
    padding: 0;
}

.ebay-logo {
    width: 50px;
    height: 50px;
}

.part-preview {
    padding: var(--space-3);
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

/* ============================================
   25. LOGIN PAGE
   ============================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    position: relative;
    overflow: hidden;
    padding: var(--space-8);
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(59, 130, 246, 0.1) 0%, transparent 40%);
    animation: backgroundPulse 15s ease-in-out infinite;
    pointer-events: none;
}

@keyframes backgroundPulse {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(2%, 2%) rotate(1deg); }
    66% { transform: translate(-1%, 1%) rotate(-1deg); }
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    top: -10%;
    right: -10%;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    bottom: -5%;
    left: -5%;
    animation-delay: -7s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    top: 50%;
    left: 20%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -20px) scale(1.05); }
    50% { transform: translate(-10px, 20px) scale(0.95); }
    75% { transform: translate(-20px, -10px) scale(1.02); }
}

.login-container {
    display: flex;
    width: 100%;
    max-width: 1000px;
    min-height: 600px;
    position: relative;
    z-index: 10;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.login-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-12);
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
}

.login-header {
    text-align: center;
    margin-bottom: var(--space-10);
}

.login-title {
    font-size: var(--text-3xl);
    font-weight: var(--font-extrabold);
    background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin-top: var(--space-2);
}

.login-form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.login-form .form-group {
    margin-bottom: var(--space-6);
}

.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}

.forgot-link {
    font-size: var(--text-sm);
    color: var(--primary);
    text-decoration: none;
}

.forgot-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: var(--space-4);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    pointer-events: none;
    z-index: 2;
}

.form-input {
    width: 100%;
    padding: var(--space-4) var(--space-4) var(--space-4) var(--space-12);
    font-size: var(--text-sm);
    color: #f1f5f9;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(71, 85, 105, 0.5);
    border-radius: var(--radius-lg);
    outline: none;
    transition: all var(--transition-slow);
}

.form-input:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(30, 41, 59, 0.7);
}

.form-input:focus {
    border-color: var(--primary);
    background: rgba(30, 41, 59, 0.9);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.form-input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

.toggle-password {
    position: absolute;
    right: var(--space-4);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-1);
    z-index: 2;
}

.toggle-password:hover {
    color: var(--text-secondary);
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.checkbox-label {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.btn-login {
    width: 100%;
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: white;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    transition: all var(--transition-slow);
    margin-top: auto;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-footer {
    text-align: center;
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid rgba(71, 85, 105, 0.3);
}

.login-footer p {
    color: var(--text-muted);
    font-size: var(--text-sm);
    margin: 0;
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: var(--font-medium);
}

.login-footer a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.login-info {
    flex: 1;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #6366f1 100%);
    background-size: 200% 200%;
    animation: gradientShift 10s ease infinite;
    padding: var(--space-12);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.info-content {
    position: relative;
    z-index: 1;
    color: white;
    max-width: 320px;
}

.info-content h2 {
    font-size: var(--text-2xl);
    font-weight: var(--font-extrabold);
    margin-bottom: var(--space-4);
}

.info-content p {
    font-size: var(--text-base);
    opacity: 0.9;
    margin-bottom: var(--space-8);
    line-height: 1.6;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    font-size: var(--text-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-icon {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    flex-shrink: 0;
}

/* ============================================
   26. UPLOAD ZONE (Catalog Import)
   ============================================ */

.upload-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 3px dashed var(--border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-12) var(--space-8);
    text-align: center;
    transition: all var(--transition-slow);
    background: var(--bg-elevated);
    cursor: pointer;
    margin-bottom: var(--space-6);
}

.upload-zone:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
}

[data-bs-theme="dark"] .upload-zone:hover {
    background: rgba(102, 126, 234, 0.1);
}

.upload-zone.has-file {
    border-color: var(--accent-green);
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-style: solid;
}

.upload-zone.dragging {
    border-color: var(--primary);
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    transform: scale(1.02);
}

.upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: var(--primary-gradient);
    border-radius: var(--radius-2xl);
    margin: 0 auto var(--space-6);
    color: white;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.upload-zone.has-file .upload-icon {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.upload-title {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin: 0 0 var(--space-2) 0;
}

.upload-subtitle {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: 0 0 var(--space-4) 0;
}

.upload-hint {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
}

/* ============================================
   26b. COLUMN MAPPING (Catalog Import)
   ============================================ */

.mapping-section {
    margin: var(--space-6) 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.mapping-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-card);
}

.mapping-header h4 {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin: 0 0 var(--space-2) 0;
}

.mapping-header p {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: 0;
}

.mapping-grid {
    padding: var(--space-4) var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.mapping-row {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid transparent;
    transition: all var(--transition-base);
}

.mapping-row.mapped {
    border-color: rgba(102, 126, 234, 0.2);
    background: linear-gradient(135deg, #f5f3ff 0%, #faf5ff 100%);
}

[data-bs-theme="dark"] .mapping-row.mapped {
    background: rgba(102, 126, 234, 0.06);
}

.mapping-row.required .mapping-target .field-name {
    font-weight: var(--font-bold);
}

.mapping-target {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 140px;
    flex-shrink: 0;
}

.mapping-target .field-name {
    font-size: var(--text-sm);
    color: var(--text-primary);
    font-weight: var(--font-medium);
}

.required-badge {
    color: var(--accent-red, #ef4444);
    font-weight: var(--font-bold);
    font-size: var(--text-lg);
}

.mapping-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.mapping-row.mapped .mapping-arrow {
    color: var(--primary);
}

.mapping-source {
    flex: 1;
    min-width: 0;
}

.mapping-source select {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: var(--text-sm);
    transition: all var(--transition-base);
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23999' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding-right: var(--space-8);
}

.mapping-source select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.mapping-info {
    padding: var(--space-3) var(--space-6) var(--space-5);
    text-align: right;
}

.mapped-count {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-weight: var(--font-medium);
}

.upload-zone.loading {
    pointer-events: none;
    opacity: 0.7;
}

.spinner.large {
    width: 36px;
    height: 36px;
}

@media (max-width: 640px) {
    .mapping-row {
        flex-wrap: wrap;
        gap: var(--space-2);
    }

    .mapping-target {
        min-width: 100%;
    }

    .mapping-arrow {
        display: none;
    }

    .mapping-source {
        width: 100%;
    }
}

/* ============================================
   27. TOGGLE SWITCH
   ============================================ */

.status-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    cursor: pointer;
    padding: var(--space-3);
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    transition: background var(--transition-base);
}

.status-toggle:hover {
    background: var(--bg-hover);
}

.toggle-switch {
    width: 50px;
    height: 28px;
    background: var(--border-light);
    border-radius: 14px;
    position: relative;
    transition: background var(--transition-slow);
}

.toggle-switch.active {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-slow);
}

.toggle-switch.active .toggle-knob {
    transform: translateX(22px);
}

/* ============================================
   28. OFFCANVAS (Mobile Sidebar)
   ============================================ */

.offcanvas-sidebar {
    width: 280px !important;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
}

[data-bs-theme="light"] .offcanvas-sidebar {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important;
}

.offcanvas-sidebar .offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

[data-bs-theme="light"] .offcanvas-sidebar .offcanvas-header {
    border-bottom-color: var(--border-light);
}

.offcanvas-sidebar .btn-close {
    filter: invert(1);
}

[data-bs-theme="light"] .offcanvas-sidebar .btn-close {
    filter: none;
}

/* ============================================
   29. PRINT STYLES
   ============================================ */

@media print {
    body * {
        visibility: hidden;
    }

    #invoice-print, #invoice-print * {
        visibility: visible;
    }

    #invoice-print {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none !important;
        border: none !important;
    }

    .no-print {
        display: none !important;
    }

    .card-footer {
        display: none !important;
    }
}

.invoice-logo {
    max-height: 80px;
    margin-bottom: var(--space-5);
}

/* ============================================
   30. WORKERS TAB - Enterprise Design
   ============================================ */

/* Hero Header */
.wt-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-6) var(--space-8);
    background: var(--primary-gradient);
    border-radius: var(--radius-xl);
    color: white;
    margin-bottom: var(--space-5);
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.25);
}

[data-bs-theme="dark"] .wt-hero {
    background: linear-gradient(135deg, #4c51bf 0%, #553c9a 100%);
    box-shadow: 0 8px 32px rgba(76, 81, 191, 0.3);
}

.wt-hero-content {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.wt-hero-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wt-hero-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    margin: 0;
    color: white;
}

.wt-hero-subtitle {
    font-size: var(--text-sm);
    opacity: 0.85;
    margin: var(--space-1) 0 0 0;
}

.wt-add-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    color: white;
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

.wt-add-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

/* Stats Grid */
.wt-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.wt-stat-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-5);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    transition: all var(--transition-base);
}

.wt-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.wt-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.wt-stat-icon.primary { background: var(--primary-gradient); }
.wt-stat-icon.success { background: linear-gradient(135deg, #22c55e, #16a34a); }
.wt-stat-icon.warning { background: linear-gradient(135deg, #f59e0b, #d97706); }
.wt-stat-icon.purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

.wt-stat-content {
    display: flex;
    flex-direction: column;
}

.wt-stat-value {
    font-size: var(--text-2xl);
    font-weight: var(--font-extrabold);
    line-height: 1.2;
    color: var(--text-primary);
}

.wt-stat-value.success { color: var(--accent-green); }
.wt-stat-value.warning { color: var(--accent-amber); }
.wt-stat-value.purple { color: var(--accent-purple); }

.wt-stat-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: var(--font-semibold);
    margin-top: 2px;
}

/* Filters */
.wt-filters {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-4) var(--space-5);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    margin-bottom: var(--space-5);
}

.wt-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: center;
}

.wt-search {
    flex: 1;
    min-width: 220px;
    position: relative;
    display: flex;
    align-items: center;
}

.wt-search svg {
    position: absolute;
    left: 12px;
    color: var(--text-disabled);
    pointer-events: none;
}

.wt-search input {
    width: 100%;
    padding: var(--space-3) var(--space-4) var(--space-3) var(--space-10);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    background: var(--bg-elevated);
    color: var(--text-primary);
    transition: all var(--transition-base);
}

.wt-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.wt-select {
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    background: var(--bg-elevated);
    color: var(--text-primary);
    min-width: 140px;
    transition: all var(--transition-base);
    cursor: pointer;
}

.wt-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.wt-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Table Card */
.wt-table-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.wt-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-elevated);
}

.wt-table-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    color: var(--text-primary);
}

.wt-table-subtitle {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.wt-table-wrapper {
    overflow-x: auto;
}

.wt-table {
    width: 100%;
    border-collapse: collapse;
}

.wt-table thead th {
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: left;
    white-space: nowrap;
    background: var(--bg-card);
    border-bottom: 2px solid var(--border-light);
}

.wt-th-actions {
    text-align: right !important;
}

.wt-table tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

.wt-table tbody tr:last-child {
    border-bottom: none;
}

.wt-table tbody tr:hover {
    background: var(--bg-hover);
}

.wt-table tbody tr.wt-row-inactive {
    opacity: 0.6;
}

.wt-table tbody td {
    padding: var(--space-4) var(--space-5);
    vertical-align: middle;
    font-size: var(--text-sm);
    color: var(--text-primary);
}

/* Worker Cell */
.wt-worker-cell {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.wt-avatar {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: var(--font-bold);
    font-size: var(--text-xs);
    flex-shrink: 0;
    letter-spacing: 0.05em;
}

.wt-avatar.role-god { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.wt-avatar.role-superadmin { background: linear-gradient(135deg, #f43f5e, #e11d48); }
.wt-avatar.role-admin { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.wt-avatar.role-manager { background: linear-gradient(135deg, #22c55e, #16a34a); }
.wt-avatar.role-worker { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.wt-avatar.role-viewer { background: linear-gradient(135deg, #64748b, #475569); }

.wt-worker-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.wt-worker-name {
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    font-size: var(--text-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wt-worker-meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wt-worker-meta.dim {
    color: var(--text-disabled);
}

/* Yard Chip */
.wt-yard-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    color: #2563eb;
}

[data-bs-theme="dark"] .wt-yard-chip {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

.wt-all-yards {
    font-size: var(--text-xs);
    color: var(--text-disabled);
    font-style: italic;
}

/* Status with dot indicator */
.wt-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.wt-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.wt-status.active { color: #16a34a; }
.wt-status.active .wt-status-dot { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.5); }
.wt-status.inactive { color: #dc2626; }
.wt-status.inactive .wt-status-dot { background: #ef4444; }

[data-bs-theme="dark"] .wt-status.active { color: #4ade80; }
[data-bs-theme="dark"] .wt-status.inactive { color: #f87171; }

.wt-date {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Table Footer */
.wt-table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--border-light);
    background: var(--bg-elevated);
}

.wt-table-info {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-weight: var(--font-medium);
}

.wt-pagination {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.wt-page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
}

.wt-page-btn:hover:not(:disabled) {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.wt-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.wt-page-indicator {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--text-primary);
    padding: 0 var(--space-3);
}

/* Workers tab responsive */
@media (max-width: 768px) {
    .wt-hero {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
        padding: var(--space-5);
    }

    .wt-hero-content {
        flex-direction: column;
    }

    .wt-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .wt-filter-row {
        flex-direction: column;
    }

    .wt-search,
    .wt-select {
        width: 100%;
    }

    .wt-table-footer {
        flex-direction: column;
        gap: var(--space-3);
    }
}

@media (max-width: 480px) {
    .wt-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Legacy compat */
.warning-text {
    color: var(--accent-red);
    font-size: var(--text-sm);
}

.modal-content.small-modal {
    max-width: 420px;
}

.modal-content.delete-modal {
    max-width: 450px;
}

/* ============================================
   31. RESPONSIVE STYLES
   ============================================ */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-slow);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .quick-stats {
        display: none;
    }
}

@media (max-width: 900px) {
    .entity-grid {
        grid-template-columns: 1fr;
    }
    
    .login-info {
        display: none;
    }
    
    .login-container {
        max-width: 450px;
    }
    
    .login-card {
        border-radius: var(--radius-2xl);
    }
}

@media (max-width: 768px) {
    .top-header {
        padding: 0 var(--space-4);
    }

    .company-badge {
        display: none;
    }

    .user-info {
        display: none;
    }

    .main-content {
        padding: var(--space-4);
    }

    .main-footer {
        flex-direction: column;
        gap: var(--space-3);
        text-align: center;
    }

    .page-header {
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        flex: 1;
    }

    .tab-header {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }

    .filters-bar {
        flex-direction: column;
    }

    .filter-group {
        min-width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .pagination {
        flex-direction: column;
        gap: var(--space-4);
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .detail-tabs {
        overflow-x: auto;
    }

    .info-grid,
    .technical-data-grid {
        grid-template-columns: 1fr;
    }

    .info-item.full-width {
        grid-column: span 1;
    }

    .engine-value {
        font-size: var(--text-3xl);
    }
}

@media (max-width: 480px) {
    .login-page {
        padding: var(--space-4);
    }

    .login-card {
        padding: var(--space-8) var(--space-6);
    }

    .login-title {
        font-size: var(--text-2xl);
    }
}

/* ============================================
   32. MOBILE-FRIENDLY ENHANCEMENTS
   ============================================ */

/* --- Tables: horizontal scroll in card wrappers --- */
.table-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* --- Nav Tabs: horizontal scroll on small screens --- */
@media (max-width: 768px) {
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .nav-tabs .nav-link {
        white-space: nowrap;
    }

    /* Admin tab-list: scrollable */
    .tab-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .tab-list::-webkit-scrollbar {
        display: none;
    }

    .tab-list li {
        white-space: nowrap;
        padding: var(--space-3) var(--space-4);
        font-size: var(--text-sm);
    }

    .tab-content {
        padding: var(--space-4);
    }

    /* Page headers: stack vertically */
    .d-flex.justify-content-between.align-items-center {
        flex-wrap: wrap;
        gap: var(--space-3);
    }

    /* Action button groups: wrap */
    .d-flex.gap-2 {
        flex-wrap: wrap;
    }

    /* Stat cards: compact text */
    .stat-value {
        font-size: var(--text-lg);
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: var(--text-sm);
    }

    /* Card padding reduction */
    .card-body.p-5 {
        padding: var(--space-4) !important;
    }

    /* Mini-stat compact */
    .mini-stat-value {
        font-size: var(--text-lg);
    }

    /* Header h1 sizing */
    h1 {
        font-size: var(--text-xl);
    }

    /* Inline fixed-width search inputs */
    input[style*="width: 250px"],
    input[style*="width:250px"] {
        width: 100% !important;
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    .stat-card {
        padding: var(--space-3);
        gap: var(--space-2);
    }

    .stat-value {
        font-size: var(--text-base);
    }

    .stat-icon {
        width: 32px;
        height: 32px;
    }

    /* Buttons: icon-only on very small screens via text truncation */
    .header-actions .btn {
        font-size: var(--text-xs);
        padding: var(--space-2) var(--space-3);
    }

    /* Stack badges on detail pages */
    .badge {
        font-size: 0.65rem;
    }
}
