* { margin: 0; padding: 0; box-sizing: border-box; }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: #f8f9fa;
            color: #333;
            line-height: 1.6;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        
        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 1rem;
        }
        
        .login-container {
            max-width: 400px;
            margin: 5rem auto;
            background: white;
            padding: 2rem;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        }
        
        .login-form h2 {
            margin-bottom: 1.5rem;
            text-align: center;
        }
        
        .header {
            background: white;
            padding: 1rem;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            margin-bottom: 1.5rem;
        }
        
        .user-info {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 1rem;
        }
        
        .stats {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1rem;
            margin-bottom: 1.5rem;
        }
        
        .stat-card {
            background: white;
            padding: 1rem;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            text-align: center;
        }
        
        .stat-number {
            font-size: 2rem;
            font-weight: bold;
            color: #007bff;
        }
        
        .controls {
            background: white;
            padding: 1rem;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            margin-bottom: 1.5rem;
        }
        
        .control-row {
            display: flex;
            gap: 1rem;
            align-items: center;
            flex-wrap: wrap;
            margin-bottom: 1rem;
        }

        /*new stuff*/
        .card {
            background: white;
            border-radius: 12px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 450px;
            overflow: hidden;
        }

        .card-header {
            background: linear-gradient(135deg, #667eea 0%, #e9af11 100%);
            color: white;
            padding: 32px 24px;
            text-align: center;
        }

        .card-header h1 {
            font-size: 28px;
            margin-bottom: 8px;
        }

        .card-header p {
            font-size: 14px;
            opacity: 0.9;
        }

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

        label {
            display: block;
            margin-bottom: 8px;
            font-weight: 500;
            color: #374151;
        }

        input {
            width: 100%;
            padding: 12px;
            border: 2px solid #e5e7eb;
            border-radius: 8px;
            font-size: 14px;
            transition: border-color 0.2s;
        }

        input:focus {
            outline: none;
            border-color: #667eea;
        }

        .alert {
            padding: 12px 16px;
            border-radius: 8px;
            margin-bottom: 20px;
            font-size: 14px;
        }

        .alert-success {
            background: #d1fae5;
            color: #065f46;
            border: 1px solid #6ee7b7;
        }

        .alert-error {
            background: #fee2e2;
            color: #991b1b;
            border: 1px solid #fca5a5;
        }

        .alert-info {
            background: #dbeafe;
            color: #1e40af;
            border: 1px solid #93c5fd;
        }

        .password-requirements {
            font-size: 12px;
            color: #6b7280;
            margin-top: 8px;
        }

        .password-requirements ul {
            list-style: none;
            padding-left: 0;
        }

        .password-requirements li {
            padding: 4px 0;
        }

        .password-requirements li::before {
            content: "• ";
            color: #667eea;
        }

        .password-strength {
            height: 4px;
            background: #e5e7eb;
            border-radius: 2px;
            margin-top: 8px;
            overflow: hidden;
        }

        .password-strength-bar {
            height: 100%;
            transition: all 0.3s;
            border-radius: 2px;
        }

        .strength-weak { width: 33%; background: #ef4444; }
        .strength-medium { width: 66%; background: #f59e0b; }
        .strength-strong { width: 100%; background: #10b981; }

        .back-link {
            text-align: center;
            margin-top: 24px;
        }

        .back-link a {
            color: #667eea;
            text-decoration: none;
            font-size: 14px;
            font-weight: 500;
        }

        .back-link a:hover {
            text-decoration: underline;
        }

        .success-icon {
            text-align: center;
            font-size: 48px;
            margin-bottom: 16px;
        }

        .loading-spinner {
            text-align: center;
            padding: 40px;
        }

        .spinner {
            border: 3px solid #f3f4f6;
            border-top: 3px solid #667eea;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
            margin: 0 auto;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* end of new stuff*/
        
        input[type="text"], input[type="email"], input[type="password"], input[type="number"], select {
            padding: 0.5rem;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 1rem;
        }
        
        .search-box {
            flex: 1;
            min-width: 200px;
        }
        
        .btn {
            background: #007bff;
            color: white;
            border: none;
            padding: 0.5rem 1rem;
            border-radius: 4px;
            cursor: pointer;
            font-size: 0.9rem;
        }
        
        .btn:hover {
            background: #0056b3;
        }
        
        .btn:disabled {
            background: #ccc;
            cursor: not-allowed;
        }
        
        .btn-sm {
            padding: 0.25rem 0.5rem;
            font-size: 0.8rem;
        }
        
        .btn-success {
            background: #28a745;
        }
        
        .btn-success:hover {
            background: #1e7e34;
        }
        
        .btn-warning {
            background: #ffc107;
            color: #000;
        }
        
        .inventory-table {
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
            overflow: hidden;
        }
        
        table {
            width: 100%;
            border-collapse: collapse;
        }
        
        th, td {
            padding: 0.75rem;
            text-align: left;
            border-bottom: 1px solid #ddd;
        }
        
        th {
            background: #f8f9fa;
            font-weight: 600;
        }
        
        tbody tr:hover {
            background: #f8f9fa;
        }
        
        .store-tag {
            padding: 0.2rem 0.5rem;
            border-radius: 12px;
            font-size: 0.8rem;
            font-weight: 500;
        }
        
        .store-central {
            background: #e3f2fd;
            color: #1976d2;
        }
        
        .store-customer_site {
            background: #f3e5f5;
            color: #7b1fa2;
        }
        
        .store-engineer {
            background: #e8f5e8;
            color: #388e3c;
        }
        
        .store-mine {
            background: #fff3e0;
            color: #f57c00;
            border: 2px solid #ff9800;
        }
        
        .wo-tag {
            background: #f0f0f0;
            padding: 0.1rem 0.3rem;
            border-radius: 4px;
            font-size: 0.75rem;
        }
        
        .low-stock {
            background: #ffebee;
            color: #c62828;
            font-weight: bold;
        }
        
        .modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
        }
        
        .modal-content {
            background: white;
            padding: 2rem;
            border-radius: 8px;
            width: 90%;
            max-width: 500px;
        }
        
        .form-group {
            margin-bottom: 1rem;
        }
        
        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 500;
        }
        
        .form-group input, .form-group select {
            width: 100%;
        }
        
        .loading {
            text-align: center;
            padding: 2rem;
            color: #666;
        }
        
        .error {
            background: #f8d7da;
            color: #721c24;
            padding: 1rem;
            border-radius: 4px;
            margin-bottom: 1rem;
        }
        
        .success {
            background: #d4edda;
            color: #155724;
            padding: 1rem;
            border-radius: 4px;
            margin-bottom: 1rem;
        }
        
        .demo-credentials {
            background: #e7f3ff;
            padding: 1rem;
            border-radius: 4px;
            margin-bottom: 1rem;
            font-size: 0.9rem;
        }
        
        @media (max-width: 768px) {
            .container {
                padding: 0.5rem;
            }
            
            table {
                font-size: 0.9rem;
            }
            
            th, td {
                padding: 0.5rem;
            }
            
            .control-row {
                flex-direction: column;
                align-items: stretch;
            }
            
            .search-box {
                min-width: auto;
            }
        }

        /* Better touch targets for mobile */
@media (max-width: 768px) {
    .btn {
        min-height: 44px; /* iOS recommended touch target */
        padding: 0.6rem 1rem;
    }
    
    .btn-sm {
        min-height: 38px;
        padding: 0.4rem 0.8rem;
    }
    
    /* Larger form inputs */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    select {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Responsive tables */
    .inventory-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 0.5rem 0.3rem;
        white-space: nowrap;
    }
    
    /* Stack control buttons vertically on small screens */
    .control-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-row .btn {
        width: 100%;
    }
    
    .search-box {
        min-width: auto;
    }

    .search-box {
        width: 100%;
        min-width: auto;
    }
    
    /* Better modal sizing on mobile */
    .modal-content {
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
        padding: 1.5rem;
    }
    
    /* Reduce header padding */
    .header {
        padding: 0.75rem;
    }
    
    .user-info {
        gap: 0.5rem;
    }
    
    /* Stats cards - 2 columns on mobile */
    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    /* Hide less important columns on very small screens */
    @media (max-width: 480px) {
        /* Show only essential columns */
        th:nth-child(3), td:nth-child(3) { /* Store column */
            display: none;
        }
        
        th:nth-child(5), td:nth-child(5) { /* Work Order column */
            display: none;
        }
    }
}

/* Tablet improvements */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        padding: 1rem;
    }
    
    .control-row {
        gap: 0.5rem;
    }
    
    table {
        font-size: 0.9rem;
    }
}

/* Better scrolling for horizontal tables */
.inventory-table::-webkit-scrollbar {
    height: 8px;
}

.inventory-table::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.inventory-table::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.inventory-table::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Better loading state */
.loading {
    padding: 3rem;
    text-align: center;
}

.loading::after {
    content: "...";
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}

/* Touch-friendly quantity display */
td strong {
    font-size: 1.1em;
    display: inline-block;
    min-width: 30px;
    text-align: center;
}

/* Better focus states for accessibility */
input:focus,
select:focus,
button:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Improve tag readability */
.store-tag,
.wo-tag {
    display: inline-block;
    white-space: nowrap;
}

/* Better error/success messages on mobile */
.error,
.success {
    margin: 0.5rem;
    padding: 0.75rem;
    font-size: 0.9rem;
}

/* Sticky table header for long lists */
@media (min-width: 769px) {
    .inventory-table table thead {
        position: sticky;
        top: 0;
        z-index: 10;
        background: #f8f9fa;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
}

/* Better file input styling */
input[type="file"] {
    display: none;
}

label.btn {
    margin: 0;
}

/* Grid improvements for filters */
@media (max-width: 768px) {
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* Style the tab */
.tab {
  overflow: hidden;
  border: 1px solid #ccc;
  background-color: #f1f1f1;
}

/* Style the buttons that are used to open the tab content */
.tab button {
  background-color: inherit;
  float: left;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 14px 16px;
  transition: 0.3s;
}

/* Change background color of buttons on hover */
.tab button:hover {
  background-color: #ddd;
}

/* Create an active/current tablink class */
.tab button.active {
  background-color: #ccc;
}

/* Style the tab content */
.tabcontent {
  display: none;
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-top: none;
}

/* Equipment Calibration Status Styles */
.overdue-cal {
    background: #fee2e2;
    border-left: 4px solid #dc2626;
}

.urgent-cal {
    background: #fed7aa;
    border-left: 4px solid #ea580c;
}

.soon-cal {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
}

.ok-cal {
    background: #d1fae5;
    border-left: 4px solid #10b981;
}

/* Equipment status badges */
.equipment-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.equipment-status.active {
    background: #d1fae5;
    color: #065f46;
}

.equipment-status.inactive {
    background: #f3f4f6;
    color: #6b7280;
}

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

/* Equipment history timeline */
.equipment-history-item {
    position: relative;
    padding-left: 2rem;
    padding-bottom: 1.5rem;
    border-left: 2px solid #e5e7eb;
}

.equipment-history-item:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.equipment-history-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #667eea;
    border: 2px solid white;
}

.equipment-history-item.calibrated::before {
    background: #10b981;
}

.equipment-history-item.transferred::before {
    background: #f59e0b;
}

.equipment-history-item.created::before {
    background: #3b82f6;
}

.equipment-history-item.deleted::before {
    background: #dc2626;
}

/* Calibration badge styles for table */
.cal-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.cal-badge.overdue {
    background: #fee2e2;
    color: #991b1b;
}

.cal-badge.urgent {
    background: #fed7aa;
    color: #9a3412;
}

.cal-badge.soon {
    background: #fef3c7;
    color: #92400e;
}

.cal-badge.ok {
    background: #d1fae5;
    color: #065f46;
}

.cal-badge.none {
    background: #f3f4f6;
    color: #6b7280;
}

/* Equipment card hover effect */
.equipment-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

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

/* Responsive adjustments for equipment table */
@media (max-width: 768px) {
    .equipment-table th:nth-child(4), 
    .equipment-table td:nth-child(4) {
        display: none; /* Hide assigned to column on mobile */
    }
    
    .equipment-table th:nth-child(5), 
    .equipment-table td:nth-child(5) {
        display: none; /* Hide last calibration on mobile */
    }
}

@media (max-width: 480px) {
    .equipment-table th:nth-child(2), 
    .equipment-table td:nth-child(2) {
        display: none; /* Hide make/model on very small screens */
    }
}