/* Inventory Page Specific Styles */
/* Import Inter font for consistency */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

/* Base styling for inventory page */
.inventory-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8fafc;
    color: #334155;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Main Inventory Content */
.inventory-main {
    flex: 1;
    padding: 0;
    margin-left: 0;
    transition: margin-left 0.3s ease;
    min-height: calc(100vh - 120px);
}

.inventory-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Inventory Header */
.inventory-header {
    margin-bottom: 2rem;
    text-align: left;
}

.inventory-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.875rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.inventory-title i {
    color: #3b82f6;
    font-size: 1.5rem;
}

.inventory-subtitle {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-left: 2.5rem;
}

/* Inventory Controls */
.inventory-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.controls-left {
    display: flex;
    align-items: center;
    flex: 1;
}

.controls-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Inventory Tabs */
.inventory-tabs {
    display: flex;
    gap: 0.5rem;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    background: #f3f4f6;
    color: #374151;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    background: #e5e7eb;
}

.tab-btn.active {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
}

.tab-btn i {
    font-size: 0.875rem;
}

/* Search Container */
.search-container {
    position: relative;
    min-width: 300px;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 0.875rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    background: #f9fafb;
    transition: all 0.2s ease;
}

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

.search-input::placeholder {
    color: #9ca3af;
    transition: color 0.2s ease;
}

.search-input:focus::placeholder {
    color: #6b7280;
}

.clear-search-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    color: #ef4444;
    background: #fef2f2;
    transform: scale(1.1);
}

.clear-search-btn:active {
    transform: scale(0.95);
}

/* Tab Content */
.tab-content {
    display: none;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

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

/* Inventory Table */
.inventory-table-container {
    overflow-x: auto;
}

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

.inventory-table th {
    background: #f8fafc;
    color: #374151;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem;
    white-space: nowrap;
}

.inventory-table td {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    font-size: 0.875rem;
}

.inventory-table tbody tr {
    transition: background-color 0.2s ease;
    cursor: pointer;
}

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

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

/* Status Indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.status-in-stock, .status-available {
    background: #dcfce7;
    color: #16a34a;
}

.status-low-stock {
    background: #fef3c7;
    color: #d97706;
}

.status-out-of-stock, .status-not-available {
    background: #fecaca;
    color: #dc2626;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    color: #6b7280;
}

.action-btn:hover {
    background: #f3f4f6;
    transform: scale(1.1);
}

.action-btn.view {
    color: #3b82f6;
}

.action-btn.edit {
    color: #f59e0b;
}

.action-btn.log {
    color: #8b5cf6;
}

.action-btn.delete {
    color: #ef4444;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 1rem 1.5rem;
    gap: 0.5rem;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(.active) {
    background: #f9fafb;
    border-color: #d1d5db;
}

.pagination-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    overflow: hidden;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    background: white;
    margin: 2vh auto;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideIn 0.3s ease-out;
    max-height: 96vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-content.large {
    max-width: 900px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: white;
    border-radius: 12px 12px 0 0;
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
    transform: scale(1.1);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 1.5rem 1.5rem;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
}

/* Custom scrollbar for webkit browsers */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Scroll indicator */
.modal-body {
    background: 
        /* Shadow covers */
        linear-gradient(white 30%, rgba(255,255,255,0)),
        linear-gradient(rgba(255,255,255,0), white 70%) 0 100%,
        /* Shadows */
        radial-gradient(50% 0, farthest-side, rgba(0,0,0,.2), rgba(0,0,0,0)),
        radial-gradient(50% 100%, farthest-side, rgba(0,0,0,.2), rgba(0,0,0,0)) 0 100%;
    background-repeat: no-repeat;
    background-color: white;
    background-size: 100% 40px, 100% 40px, 100% 14px, 100% 14px;
    background-attachment: local, local, scroll, scroll;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
    flex-shrink: 0;
}

/* Form Styles */
.form-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.form-required-note {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f3f4f6;
    border-radius: 6px;
}

.required-asterisk {
    color: #ef4444;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: white;
}

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

.input-group {
    display: flex;
    align-items: center;
}

.input-group .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group-addon {
    padding: 0.75rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-right: none;
    border-radius: 6px 0 0 6px;
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
}

/* Toggle Switches */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
}

.toggle-label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.toggle-label.small {
    font-size: 0.8rem;
    color: #6b7280;
}

.toggle-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-text {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked + .toggle-slider {
    background-color: #3b82f6;
}

input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Conditional Fields */
.conditional-field {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.conditional-field.show {
    display: block;
}

/* File Upload */
.file-upload {
    margin-top: 1rem;
}

.file-upload-area {
    position: relative;
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: linear-gradient(135deg, #fafafa 0%, #f1f5f9 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
}

.file-upload-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(59, 130, 246, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.file-upload-area:hover {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.file-upload-area:hover::before {
    opacity: 1;
}

.file-upload-area.dragover {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 35px rgba(16, 185, 129, 0.25);
    animation: dragPulse 1s ease-in-out infinite alternate;
}

.file-upload-area.dragover::before {
    background: linear-gradient(135deg, transparent 0%, rgba(16, 185, 129, 0.1) 100%);
    opacity: 1;
}

.file-upload-area.error {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    animation: shake 0.5s ease-in-out;
}

.file-upload-area.success {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    animation: success-bounce 0.6s ease-out;
}

@keyframes dragPulse {
    0% {
        box-shadow: 0 12px 35px rgba(16, 185, 129, 0.25);
    }
    100% {
        box-shadow: 0 16px 45px rgba(16, 185, 129, 0.35);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes success-bounce {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.file-upload-content {
    pointer-events: none;
    position: relative;
    z-index: 2;
}

.file-upload-content i {
    font-size: 3rem;
    color: #9ca3af;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.file-upload-area:hover .file-upload-content i {
    color: #3b82f6;
    transform: scale(1.1);
}

.file-upload-area.dragover .file-upload-content i {
    color: #10b981;
    transform: scale(1.2) rotateY(180deg);
}

.file-upload-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.file-upload-area:hover .file-upload-content h4 {
    color: #1e293b;
}

.file-upload-area.dragover .file-upload-content h4 {
    color: #065f46;
}

.file-upload-content p {
    color: #6b7280;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.file-upload-area:hover .file-upload-content p {
    color: #4b5563;
}

.file-upload-area.dragover .file-upload-content p {
    color: #047857;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.file-upload-content .btn {
    pointer-events: auto;
    position: relative;
    z-index: 3;
    transition: all 0.3s ease;
}

.file-upload-area:hover .file-upload-content .btn {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.file-preview {
    margin-top: 1rem;
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.file-preview.show {
    display: block;
}

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

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    animation: slideInLeft 0.3s ease-out;
}

.file-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(4px);
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.file-item-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.file-item-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 6px;
    color: #6b7280;
    font-size: 1.125rem;
    transition: all 0.3s ease;
}

.file-item:hover .file-item-icon {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #3b82f6;
    transform: scale(1.1);
}

.file-item-details h5 {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin: 0 0 0.25rem 0;
    word-break: break-all;
}

.file-item-details p {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0;
}

.file-item-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.file-item-remove:hover {
    background: #fef2f2;
    color: #dc2626;
    transform: scale(1.2) rotate(90deg);
}

.file-item-remove:active {
    transform: scale(0.95) rotate(90deg);
}

.file-info {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.file-info small {
    color: #64748b;
    font-size: 0.75rem;
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-info small::before {
    content: '📎';
    font-size: 0.875rem;
}

/* File upload animations for better feedback */
.file-upload-area.processing {
    pointer-events: none;
    opacity: 0.7;
}

.file-upload-area.processing::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 4;
}

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

/* Responsive improvements */
@media (max-width: 768px) {
    .file-upload-area {
        padding: 1.5rem 1rem;
    }
    
    .file-upload-content i {
        font-size: 2.5rem;
    }
    
    .file-upload-content h4 {
        font-size: 1rem;
    }
    
    .file-item {
        padding: 0.5rem 0.75rem;
    }
    
    .file-item-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .file-item-details h5 {
        font-size: 0.8125rem;
    }
    
    .file-item-remove {
        width: 28px;
        height: 28px;
    }
}

/* Dark mode support for file uploads */
@media (prefers-color-scheme: dark) {
    .file-upload-area {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
        border-color: #374151;
    }
    
    .file-upload-area:hover {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        border-color: #3b82f6;
    }
    
    .file-upload-content i {
        color: #6b7280;
    }
    
    .file-upload-content h4 {
        color: #e5e7eb;
    }
    
    .file-upload-content p {
        color: #9ca3af;
    }
    
    .file-item {
        background: #1f2937;
        border-color: #374151;
    }
    
    .file-item:hover {
        border-color: #4b5563;
    }
    
    .file-item-details h5 {
        color: #e5e7eb;
    }
    
    .file-info {
        background: #1f2937;
        border-color: #374151;
    }
}

/* Button Styles */
.btn {
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    white-space: nowrap;
}

.btn.small {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn.primary {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
}

.btn.primary:hover {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn.secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.btn.secondary:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

/* Item Details Styles */
.item-details-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.item-details-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.item-detail-field {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.item-detail-field label {
    display: block;
    font-weight: 500;
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.item-detail-value {
    color: #111827;
    font-size: 0.875rem;
    font-weight: 500;
}

.attachment-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.attachment-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
}

.attachment-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    margin-bottom: 0.75rem;
}

.attachment-icon {
    margin-right: 0.75rem;
    font-size: 1.25rem;
    color: #ef4444;
}

.attachment-name {
    flex: 1;
    font-weight: 500;
    color: #111827;
}

.attachment-actions {
    display: flex;
    gap: 0.5rem;
}

.attachment-actions button {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.attachment-actions button:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Enhanced Change Log Styles */
.change-log-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.change-log-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.log-item-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.log-item-info p {
    font-size: 0.875rem;
    color: #6b7280;
}

.log-controls {
    display: flex;
    gap: 0.5rem;
}

.change-log-timeline {
    max-height: 400px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: white;
}

.change-log-timeline::-webkit-scrollbar {
    width: 8px;
}

.change-log-timeline::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 4px;
}

.change-log-timeline::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.change-log-timeline::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.change-log-list {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}

.change-log-entry {
    display: flex;
    align-items: flex-start;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    gap: 1rem;
    transition: background-color 0.2s ease;
    position: relative;
}

.change-log-entry:hover {
    background: #f8fafc;
}

.change-log-entry:last-child {
    border-bottom: none;
}

.log-entry-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    position: relative;
}

.log-entry-icon.action-create {
    background: #dcfce7;
    color: #16a34a;
    border: 2px solid #bbf7d0;
}

.log-entry-icon.action-edit {
    background: #fef3c7;
    color: #d97706;
    border: 2px solid #fed7aa;
}

.log-entry-icon.action-delete {
    background: #fee2e2;
    color: #dc2626;
    border: 2px solid #fecaca;
}

.log-entry-icon.action-view {
    background: #eff6ff;
    color: #2563eb;
    border: 2px solid #bfdbfe;
}

.log-entry-icon.action-export {
    background: #f3e8ff;
    color: #7c3aed;
    border: 2px solid #c4b5fd;
}

.log-entry-icon.action-other {
    background: #f1f5f9;
    color: #64748b;
    border: 2px solid #cbd5e1;
}

.log-entry-content {
    flex: 1;
    min-width: 0;
}

.log-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.log-action {
    font-weight: 600;
    color: #111827;
    font-size: 0.875rem;
}

.log-timestamp {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

.log-details {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
}

.log-user {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.log-user::before {
    content: '\f007';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.625rem;
    color: #cbd5e1;
}

.change-log-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.change-log-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #d1d5db;
}

.change-log-empty h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.change-log-empty p {
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Enhanced loading state for change log modal */
.modal-body.loading {
    position: relative;
    pointer-events: none;
    min-height: 200px;
}

.modal-body.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(2px);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.modal-body.loading::after {
    content: '\f1ce';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: #3b82f6;
    animation: spin 1s linear infinite;
    z-index: 11;
}

/* Action timeline line */
.change-log-list::before {
    content: '';
    position: absolute;
    left: 2rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #e5e7eb, #f3f4f6);
    z-index: 0;
}

.change-log-entry::after {
    content: '';
    position: absolute;
    left: 1.9rem;
    top: 1.25rem;
    width: 4px;
    height: 4px;
    background: #94a3b8;
    border-radius: 50%;
    z-index: 1;
}

/* Button enhancements for change log */
.log-controls .btn {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.log-controls .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.log-controls .btn i {
    margin-right: 0.375rem;
    font-size: 0.75rem;
}

/* Print Styles */
.print-view {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
}

@media print {
    body * {
        visibility: hidden;
    }
    
    .print-view, .print-view * {
        visibility: visible;
    }
    
    .print-view {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 25mm;
    }
    
    .modal-footer, .attachment-actions {
        display: none !important;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .inventory-container {
        padding: 1.5rem;
    }
    
    .inventory-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .controls-left, .controls-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .search-container {
        min-width: unset;
        flex: 1;
    }
}

@media (max-width: 768px) {
    .inventory-container {
        padding: 1rem;
    }
    
    .inventory-title {
        font-size: 1.5rem;
    }
    
    .inventory-controls {
        padding: 1rem;
    }
    
    .controls-right {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn {
        justify-content: center;
        width: 100%;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .inventory-table-container {
        overflow-x: auto;
    }
    
    .inventory-table {
        min-width: 700px;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
    }
    
    .tab-btn {
        flex: 1;
        justify-content: center;
    }
    
    .toggle-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .change-log-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .log-controls {
        justify-content: flex-end;
    }
}

@media (max-width: 480px) {
    .inventory-container {
        padding: 0.75rem;
    }
    
    .inventory-title {
        font-size: 1.25rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .inventory-controls {
        padding: 0.75rem;
    }
    
    .modal-content {
        margin: 2% auto;
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header, .modal-body, .modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .change-log-timeline {
        max-height: 300px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .inventory-table-container,
    .inventory-controls,
    .modal-content {
        border: 2px solid #000000;
    }
    
    .btn.primary {
        background: #000000;
        color: #ffffff;
    }
    
    .status-indicator {
        border: 1px solid #000000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .btn,
    .action-btn,
    .tab-btn,
    .inventory-table tbody tr,
    .modal-content {
        transition: none;
    }
    
    .modal-content {
        animation: none;
    }
    
    .btn.primary:hover {
        transform: none;
    }
}

/* Text Center Utility */
.text-center {
    text-align: center;
}

/* Legacy Support for Existing JavaScript */
.modal.show {
    display: block;
}

.item-status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

/* Status Colors for Item Details */
.item-status-indicator {
    background: #dcfce7;
    color: #16a34a;
}

.item-status-indicator[data-status*="low"],
.item-status-indicator[data-status*="used"] {
    background: #fef3c7;
    color: #d97706;
}

.item-status-indicator[data-status*="out"],
.item-status-indicator[data-status*="not"],
.item-status-indicator[data-status*="condemned"] {
    background: #fecaca;
    color: #dc2626;
}

/* ID Input Group Styles */
.id-input-group {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.id-input-group .form-control {
    flex: 1;
}

.id-input-group .btn {
    white-space: nowrap;
}

/* Toggle Row Styles */
.toggle-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0;
}

.toggle-label-text {
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
}

/* Helper Text Styles */
.helper-text {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
    line-height: 1.4;
    font-style: italic;
}

/* Enhanced Button Styles for Auto-Generate */
.btn.small {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    min-width: auto;
}

.btn .fas {
    margin-right: 0.25rem;
}

.btn.small .fas {
    margin-right: 0.125rem;
    font-size: 0.75rem;
}

/* Search Stats Styles */
.search-stats {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #eff6ff;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #1e40af;
    margin-right: 0.75rem;
}

.search-results-text {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 500;
}

.search-results-text i {
    font-size: 0.625rem;
    color: #3b82f6;
}

/* Enhanced View Modal Styles */
.company-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e5e7eb;
}

.company-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.company-header h2 i {
    color: #3b82f6;
    font-size: 1.25rem;
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
    font-size: 1rem;
}

.loading i {
    margin-right: 0.5rem;
    color: #3b82f6;
}

.error-message {
    text-align: center;
    padding: 3rem 1rem;
    color: #ef4444;
    font-size: 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin: 1rem 0;
}

.error-message i {
    margin-right: 0.5rem;
    font-size: 1.25rem;
}

/* Status Indicators */
.rotable-indicator,
.calibration-indicator,
.rental-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
}

.rotable-yes,
.calibration-yes,
.rental-yes {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.rotable-no,
.calibration-no,
.rental-no {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.rotable-indicator i,
.calibration-indicator i,
.rental-indicator i {
    font-size: 0.875rem;
}

/* Enhanced Item Details Container */
.item-details-container {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
}

.item-details-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.item-details-row:last-child {
    margin-bottom: 0;
}

.item-detail-field {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.item-detail-field label {
    display: block;
    font-weight: 600;
    color: #374151;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.5rem;
}

.item-detail-value {
    color: #111827;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    min-height: 1.25rem;
}

/* Empty field styling */
.item-detail-field:empty {
    background: transparent;
    border: none;
    box-shadow: none;
}

/* Attachment Section Enhancements */
.attachment-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e5e7eb;
}

.attachment-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.attachment-section h3 i {
    color: #6b7280;
    font-size: 1rem;
}

.attachment-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.attachment-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.attachment-icon {
    margin-right: 0.75rem;
    font-size: 1.25rem;
    color: #ef4444;
}

.attachment-name {
    flex: 1;
    font-weight: 500;
    color: #111827;
}

.attachment-actions {
    display: flex;
    gap: 0.5rem;
}

.attachment-actions button {
    background: none;
    border: 1px solid #e5e7eb;
    color: #6b7280;
    cursor: pointer;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    font-weight: 500;
}

.attachment-actions button:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
    transform: translateY(-1px);
}

.attachment-actions button i {
    margin-right: 0.25rem;
}

/* Enhanced Modal Footer */
.modal-footer .btn {
    min-width: 120px;
    font-weight: 600;
}

.modal-footer .btn i {
    margin-right: 0.5rem;
}

/* Edit Mode Enhancements */
.modal-header h2[data-mode="edit"] {
    color: #f59e0b;
}

.modal-header h2 i[class*="fa-edit"] {
    color: #f59e0b;
}

/* Form Field Focus Enhancements */
.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.form-control.editing {
    border-color: #f59e0b;
    background-color: #fffbeb;
}

.form-control.editing:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

/* Enhanced Button States */
.btn.primary[data-action="update"] {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.btn.primary[data-action="update"]:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* Action Button Hover Effects */
.action-btn.edit:hover {
    background: #fef3c7;
    color: #d97706;
    transform: scale(1.15);
}

.action-btn.edit:active {
    transform: scale(1.05);
}

/* Loading State for Edit */
.modal-body.loading {
    position: relative;
    pointer-events: none;
}

.modal-body.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body.loading::after {
    content: '\f1ce';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: #3b82f6;
    animation: spin 1s linear infinite;
    z-index: 11;
}

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Notification for Edit Mode */
.edit-notification {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background: #f59e0b;
    color: white;
    font-size: 0.625rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Form Validation Enhancements */
.form-control.is-invalid {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.form-control.is-invalid:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-control.is-valid {
    border-color: #16a34a;
    background-color: #f0fdf4;
}

.form-control.is-valid:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}
