/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.hidden {
    display: none !important;
}

/* Login Screen */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

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

.login-header i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 10px;
}

.login-header h1 {
    color: #333;
    font-size: 1.8rem;
    font-weight: 600;
}

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

.login-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

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

.demo-credentials {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 12px;
    color: #666;
}

/* Main Application */
.main-app {
    min-height: 100vh;
    background: #f5f7fa;
}

/* Header */
.app-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

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

.header-left i {
    font-size: 1.8rem;
    color: #667eea;
}

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-role {
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.user-name {
    font-weight: 500;
    color: #555;
}

/* Navigation */
.nav-tabs {
    background: white;
    border-bottom: 1px solid #e1e5e9;
    padding: 0 30px;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
}

.nav-tab {
    background: none;
    border: none;
    padding: 15px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    font-weight: 500;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-tab:hover {
    color: #667eea;
    background: #f8f9fa;
}

.nav-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

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

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s;
}

.dashboard-card:hover {
    transform: translateY(-5px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.card-header i {
    font-size: 1.5rem;
    color: #667eea;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 500;
    color: #666;
}

.card-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
}

.alerts-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.alerts-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: #333;
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid;
}

.alert-item.low-stock {
    background: #fff3cd;
    border-left-color: #f0ad4e;
}

.alert-item.back-order {
    background: #f8d7da;
    border-left-color: #d9534f;
}

.alert-icon {
    font-size: 1.2rem;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.alert-description {
    color: #666;
    font-size: 14px;
}

/* Inventory Controls */
.inventory-controls {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.search-filter-section {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
}

.filter-controls {
    display: flex;
    gap: 15px;
}

.filter-controls select {
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    min-width: 150px;
}

/* Inventory Table */
.inventory-table-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

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

.inventory-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e1e5e9;
}

.inventory-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.inventory-table tr:hover {
    background: #f8f9fa;
}

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

.status-badge.in-stock {
    background: #d4edda;
    color: #155724;
}

.status-badge.low-stock {
    background: #fff3cd;
    color: #856404;
}

.status-badge.back-order {
    background: #f8d7da;
    color: #721c24;
}

.quantity-display {
    font-weight: 600;
}

.quantity-display.low {
    color: #f0ad4e;
}

.quantity-display.out {
    color: #d9534f;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-icon.edit {
    color: #007bff;
}

.btn-icon.edit:hover {
    background: #e7f3ff;
}

.btn-icon.delete {
    color: #dc3545;
}

.btn-icon.delete:hover {
    background: #f8d7da;
}

/* Take Parts */
.take-parts-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.take-parts-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select {
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
}

.part-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.part-info h4 {
    margin-bottom: 10px;
    color: #333;
}

.recent-takes-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.recent-takes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.take-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.take-details {
    flex: 1;
}

.take-part {
    font-weight: 600;
    margin-bottom: 2px;
}

.take-info {
    font-size: 12px;
    color: #666;
}

.take-quantity {
    font-weight: 600;
    color: #dc3545;
}

/* Manage Section */
.manage-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.manage-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.part-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-start;
}

.settings-form .form-group small {
    color: #666;
    font-size: 12px;
    margin-top: 5px;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-success,
.btn-logout {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-logout {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    padding: 8px 15px;
    font-size: 13px;
}

.btn-logout:hover {
    background: #f8f9fa;
    color: #333;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #333;
}

.modal-content p {
    margin-bottom: 25px;
    color: #666;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Role-based visibility */
.manager-only {
    display: none;
}

body.manager .manager-only {
    display: table-cell;
}

body.manager .nav-tab.manager-only {
    display: flex;
}

body.manager .manage-controls .manager-only {
    display: inline-flex;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header-content {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .nav-tabs {
        padding: 0 20px;
        overflow-x: auto;
        white-space: nowrap;
    }

    .nav-tab {
        flex-shrink: 0;
    }

    .tab-content {
        padding: 20px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .search-filter-section {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-controls {
        flex-direction: column;
    }

    .form-row {
        flex-direction: column;
    }

    .manage-controls {
        flex-direction: column;
    }

    .inventory-table-container {
        overflow-x: auto;
    }

    .inventory-table {
        min-width: 800px;
    }

    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }

    .action-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 30px 20px;
    }

    .header-left h1 {
        font-size: 1.2rem;
    }

    .card-value {
        font-size: 2rem;
    }

    .dashboard-card {
        padding: 20px;
    }

    .take-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Print Styles */
@media print {
    .login-screen,
    .nav-tabs,
    .inventory-controls,
    .manage-controls,
    .action-buttons,
    .btn-logout,
    .scanner-section,
    .job-actions,
    .completion-actions {
        display: none !important;
    }

    .main-app {
        background: white;
    }

    .tab-content {
        display: block !important;
        padding: 0;
    }

    .inventory-table-container,
    .job-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .completion-parts {
        break-inside: avoid;
    }
}

/* Help Section Styles */
.help-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.help-content h2 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
    font-size: 2rem;
}

.help-section {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.help-section h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.4rem;
    border-bottom: 2px solid #f0f2f5;
    padding-bottom: 10px;
}

.help-section h3 i {
    margin-right: 10px;
}

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

.help-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
}

.help-card h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.help-card p {
    margin-bottom: 15px;
    color: #6c757d;
}

.help-section ul, .help-section ol {
    padding-left: 25px;
    margin-bottom: 15px;
}

.help-section li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.help-section ul ul {
    margin-top: 5px;
    margin-bottom: 5px;
}

.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-indicator.in-stock {
    color: #28a745;
}

.status-indicator.low-stock {
    color: #ffc107;
}

.status-indicator.back-order {
    color: #dc3545;
}

.troubleshooting h4 {
    color: #495057;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.troubleshooting h4:first-child {
    margin-top: 0;
}

.troubleshooting p {
    margin-bottom: 15px;
    padding: 10px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
    color: #856404;
}

.help-footer {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    color: #6c757d;
}

.help-footer p {
    margin-bottom: 10px;
}

.help-footer p:last-child {
    margin-bottom: 0;
}

/* Mobile Help Styles */
@media (max-width: 768px) {
    .help-content {
        padding: 15px;
    }
    
    .help-content h2 {
        font-size: 1.6rem;
        margin-bottom: 20px;
    }
    
    .help-section {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .help-section h3 {
        font-size: 1.2rem;
    }
    
    .help-cards {
        grid-template-columns: 1fr;
    }
    
    .help-card {
        padding: 15px;
    }
}

/* UPC Scanner Styles */
.upc-scanner-section {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: center;
}

.mobile-notice {
    background: #e7f3ff;
    border: 1px solid #b3d7ff;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 15px;
    color: #0066cc;
    font-size: 0.9rem;
}

.mobile-notice i {
    margin-right: 8px;
}

.btn-debug {
    background: #6c757d;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-debug:hover {
    background: #5a6268;
}

.scanner-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.btn-scanner {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-scanner:hover {
    background: linear-gradient(135deg, #218838, #1ea888);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-scanner i {
    margin-right: 10px;
    font-size: 1.2rem;
}

.scanner-input-group {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 400px;
}

.scanner-input-group input {
    flex: 1;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 1rem;
    text-align: center;
    letter-spacing: 1px;
}

.scanner-input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.scanner-preview {
    position: relative;
    margin-top: 20px;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.scanner-preview video {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.scanner-line {
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ff0000, transparent);
    transform: translateY(-50%);
    animation: scan-line 2s ease-in-out infinite;
}

@keyframes scan-line {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.scanner-stop {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    font-size: 0.9rem;
}

.scanner-status {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-weight: 500;
    min-height: 20px;
}

.scanner-status.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.scanner-status.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.scanner-status.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.upc-result {
    background: white;
    border: 2px solid #28a745;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    text-align: left;
}

.upc-result h4 {
    color: #28a745;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.upc-result p {
    margin: 5px 0;
    color: #495057;
}

.upc-result .upc-code {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* Mobile Scanner Styles */
@media (max-width: 768px) {
    .scanner-controls {
        gap: 12px;
    }
    
    .scanner-input-group {
        flex-direction: column;
        max-width: 100%;
    }
    
    .scanner-input-group input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn-scanner {
        padding: 12px 25px;
        font-size: 1rem;
    }
    
    .scanner-preview video {
        height: 250px;
    }
    
    .upc-scanner-section {
        padding: 15px;
        margin-bottom: 20px;
    }
}

/* Job Scanner Styles */
.job-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    overflow: hidden;
}

.job-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.job-header h2 {
    margin: 0 0 10px 0;
    font-size: 2rem;
    font-weight: 600;
}

.job-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

.job-controls {
    padding: 30px;
}

.existing-jobs {
    margin-bottom: 30px;
}

.existing-jobs h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.job-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.existing-job-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    transition: all 0.3s;
}

.existing-job-item:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

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

.job-item-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 5px;
}

.job-item-details {
    color: #666;
    font-size: 0.9rem;
}

.job-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.job-status.active {
    color: #28a745;
}

.job-status.paused {
    color: #ffc107;
}

.job-divider {
    text-align: center;
    margin: 30px 0;
    position: relative;
    color: #999;
    font-weight: 600;
}

.job-divider::before,
.job-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background: #e1e5e9;
}

.job-divider::before {
    left: 0;
}

.job-divider::after {
    right: 0;
}

.new-job-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.new-job-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.new-job-form textarea {
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

.no-jobs {
    text-align: center;
    color: #666;
    padding: 30px;
    font-style: italic;
}

/* Active Job Header */
.active-job-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.job-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.job-info p {
    margin: 0;
    opacity: 0.9;
}

.job-actions {
    display: flex;
    gap: 15px;
}

/* Scanner Section */
.scanner-section {
    padding: 30px;
    border-bottom: 1px solid #e1e5e9;
}

.mobile-scanner-notice {
    background: #e7f3ff;
    border: 1px solid #b3d7ff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 25px;
    color: #0066cc;
    text-align: center;
}

.mobile-scanner-notice i {
    margin-right: 8px;
    font-size: 1.2rem;
}

.scanner-controls-job {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.btn-scanner-large {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 20px 40px;
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-scanner-large:hover {
    background: linear-gradient(135deg, #218838, #1ea888);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.btn-scanner-large i {
    font-size: 1.5rem;
}

.manual-entry-group {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 500px;
}

.manual-entry-group input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1.1rem;
    text-align: center;
    letter-spacing: 1px;
}

.manual-entry-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Job Scanner Preview */
.scanner-preview-job {
    position: relative;
    margin-top: 25px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.scanner-preview-job video {
    width: 100%;
    height: 350px;
    object-fit: cover;
}

.scanner-overlay-job {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-crosshair {
    width: 200px;
    height: 200px;
    border: 3px solid #ff0000;
    border-radius: 10px;
    position: relative;
    background: rgba(255, 0, 0, 0.1);
}

.scanner-crosshair::before,
.scanner-crosshair::after {
    content: '';
    position: absolute;
    background: #ff0000;
}

.scanner-crosshair::before {
    top: 50%;
    left: 20px;
    right: 20px;
    height: 2px;
    transform: translateY(-50%);
    animation: scan-line-horizontal 2s ease-in-out infinite;
}

.scanner-crosshair::after {
    left: 50%;
    top: 20px;
    bottom: 20px;
    width: 2px;
    transform: translateX(-50%);
    animation: scan-line-vertical 2s ease-in-out infinite;
}

@keyframes scan-line-horizontal {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes scan-line-vertical {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.scan-instructions {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.scanner-stop-job {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 10px 15px;
    font-size: 0.9rem;
    border-radius: 20px;
}

.scanner-status-job {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    min-height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.scanner-status-job.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.scanner-status-job.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.scanner-status-job.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Scanned Parts Section */
.scanned-parts-section {
    padding: 30px;
}

.parts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e1e5e9;
}

.parts-header h3 {
    color: #333;
    margin: 0;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.parts-summary {
    color: #666;
    font-weight: 500;
}

.scanned-parts-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.scanned-part-item {
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    transition: all 0.3s;
}

.scanned-part-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.part-item-main {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.part-item-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-icon {
    color: #ffc107;
    font-size: 1rem;
}

.part-item-details {
    color: #666;
    font-size: 0.9rem;
}

.unknown-badge {
    background: #ffc107;
    color: #212529;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.warning-badge {
    background: #dc3545;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.part-item-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quantity-controls-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 20px;
}

.qty-btn-inline {
    background: #667eea;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
}

.qty-btn-inline:hover {
    background: #5a6fd8;
}

.quantity-display {
    font-weight: 600;
    min-width: 30px;
    text-align: center;
    font-size: 1.1rem;
}

.remove-part-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.remove-part-btn:hover {
    background: #c82333;
    transform: scale(1.05);
}

.empty-message {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-message i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-message p {
    margin: 10px 0;
    font-size: 1.1rem;
}

/* Job Completion Styles */
.completion-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.completion-header h3 {
    margin: 0 0 10px 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.completion-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1rem;
}

.completion-summary {
    padding: 30px;
    border-bottom: 1px solid #e1e5e9;
}

.summary-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
}

.summary-stat {
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.completion-parts-list {
    padding: 30px;
}

.completion-parts-list h4 {
    color: #333;
    margin: 0 0 20px 0;
    font-size: 1.2rem;
}

.completion-parts {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.completion-part-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.completion-part-info {
    flex: 1;
}

.completion-part-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.completion-part-details {
    color: #666;
    font-size: 0.9rem;
}

.completion-warning {
    color: #dc3545;
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 3px;
}

.completion-part-qty {
    font-weight: 600;
    color: #28a745;
    font-size: 1.1rem;
}

.completion-actions {
    padding: 30px;
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

/* Job History */
.job-history-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    padding: 25px;
}

.job-history-section h3 {
    color: #333;
    margin: 0 0 20px 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.job-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.job-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.history-job-info {
    flex: 1;
}

.history-job-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.history-job-details {
    color: #666;
    font-size: 0.9rem;
}

.status-badge.completed {
    background: #d4edda;
    color: #155724;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.no-history {
    text-align: center;
    color: #666;
    padding: 30px;
    font-style: italic;
}

/* Modal Styles for Job Scanner */
.part-modal {
    max-width: 500px;
}

.part-modal-content {
    margin: 20px 0;
}

.part-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.part-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-label {
    font-weight: 500;
    color: #666;
}

.detail-value {
    font-weight: 600;
    color: #333;
}

.quantity-in-stock {
    color: #28a745;
}

.quantity-low {
    color: #ffc107;
}

.quantity-out {
    color: #dc3545;
}

.status-unknown {
    color: #6c757d;
}

.part-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quantity-controls label {
    font-weight: 500;
    color: #333;
}

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

.qty-btn {
    background: #667eea;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    transition: background 0.3s;
}

.qty-btn:hover {
    background: #5a6fd8;
}

.quantity-input-group input {
    width: 80px;
    padding: 8px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
}

.job-summary-modal {
    max-width: 600px;
}

.job-summary-content {
    margin: 20px 0;
}

.job-summary-details h4 {
    color: #333;
    margin: 0 0 20px 0;
    font-size: 1.4rem;
    text-align: center;
}

.summary-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.summary-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    margin: 0;
}

.success-message i {
    margin-right: 8px;
    font-size: 1.2rem;
}

.unknown-part-modal {
    max-width: 500px;
}

.unknown-barcode {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.2rem;
    color: #495057;
    margin: 15px 0;
    letter-spacing: 1px;
}

.unknown-part-form {
    margin: 20px 0;
}

/* Mobile Responsive for Job Scanner */
@media (max-width: 768px) {
    .job-header {
        padding: 20px;
    }
    
    .job-header h2 {
        font-size: 1.5rem;
    }
    
    .job-controls {
        padding: 20px;
    }
    
    .existing-job-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .job-item-actions {
        width: 100%;
    }
    
    .job-item-actions .btn-secondary {
        width: 100%;
        justify-content: center;
    }
    
    .active-job-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .job-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .scanner-section {
        padding: 20px;
    }
    
    .btn-scanner-large {
        padding: 15px 30px;
        font-size: 1.1rem;
        width: 100%;
        justify-content: center;
    }
    
    .manual-entry-group {
        flex-direction: column;
        max-width: 100%;
    }
    
    .manual-entry-group input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .scanner-preview-job video {
        height: 280px;
    }
    
    .scanner-crosshair {
        width: 150px;
        height: 150px;
    }
    
    .scanned-parts-section {
        padding: 20px;
    }
    
    .parts-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .part-item-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .part-item-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .summary-card {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        padding: 20px;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .completion-actions {
        flex-direction: column;
    }
    
    .completion-part-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .completion-part-qty {
        align-self: flex-end;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
    }
}

/* CSV Import Styles */
.csv-import-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #17a2b8;
}

.csv-import-info h4 {
    color: #17a2b8;
    margin-bottom: 15px;
}

.csv-import-info ul {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.csv-import-info li {
    background: white;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    font-size: 0.9rem;
}

.csv-import-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.csv-import-actions button {
    flex: 1;
    min-width: 200px;
}

.import-result {
    margin-top: 20px;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.import-success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.import-success i {
    color: #28a745;
    margin-right: 10px;
    font-size: 1.2rem;
}

.import-success h4 {
    color: #155724;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.import-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.import-error i {
    color: #dc3545;
    margin-right: 10px;
    font-size: 1.2rem;
}

.import-error h4 {
    color: #721c24;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

/* Responsive adjustments for CSV import */
@media (max-width: 768px) {
    .csv-import-actions {
        flex-direction: column;
    }
    
    .csv-import-actions button {
        min-width: auto;
    }
    
    .csv-import-info ul {
        grid-template-columns: 1fr;
    }
}