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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f9fafb;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, #2A3B6B 0%, #3A4B7B 100%);
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    will-change: transform;
    contain: layout style;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 700;
    font-size: 1.5rem;
    color: white;
    text-decoration: none;
}

.nav-logo {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    will-change: scroll-position;
    transform: translateZ(0);
    contain: layout style paint;
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    padding: 0.5625rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.nav-link i {
    font-size: 1rem;
}

/* User Menu Styles */
.nav-user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    color: white;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-logout-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    will-change: transform;
    contain: layout style;
}

.nav-logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.nav-logout-btn i {
    font-size: 1rem;
}

/* Mobile Navigation */
.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0.5rem;
    gap: 3px;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background: white;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.container {
    width: 100%;
}

/* Wide Container for tables that need more space */
.container-wide {
    width: 100%;
    max-width: 1600px; /* Updated to 1600px */
    margin: 0 auto;
    padding: 2rem;
}

/* Page Headers */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-header p {
    color: #6b7280;
    font-size: 1.1rem;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    will-change: transform;
    contain: layout style;
    text-decoration: none;
}

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

.stat-card.clickable {
    cursor: pointer;
}

.stat-card.clickable:active {
    transform: translateY(-1px);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-icon.pending { background: #fbbf24; }
.stat-icon.in-progress { background: #3b82f6; }
.stat-icon.completed { background: #10b981; }
.stat-icon.completion-rate { background: #8b5cf6; }
.stat-icon.due-soon { background: #f59e0b; }
.stat-icon.high-priority { background: #ef4444; }

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.stat-content p {
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.chart-container {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    height: 500px; /* Increased from 450px */
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    will-change: auto;
    transform: translateZ(0);
    contain: layout style paint;
}

.chart-container canvas {
    max-width: 100% !important;
    height: auto !important;
    flex: 1;
    min-height: 350px; /* Increased minimum height */
}

.chart-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.chart-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    will-change: transform;
    contain: layout style;
}

.btn-primary {
    background: #1E2A56;
    color: white;
}

.btn-primary:hover {
    background: #2A3B6B;
    transform: translateY(-1px);
    /* Use will-change sparingly and only when needed */
    will-change: transform;
}

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

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
    will-change: transform;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    will-change: transform;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

/* Tables */
.table-container {
    position: relative;
    background: white;
    border-radius: 1rem;
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    width: 100%;
    margin-bottom: 2rem;
    min-height: 400px; /* Consistent height */
    display: flex;
    flex-direction: column;
    will-change: scroll-position;
    transform: translateZ(0);
    contain: layout style paint;
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
}

.orders-table {
    /* Use containment to limit layout calculations */
    contain: layout style;
    flex: 1;
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    table-layout: fixed;
    min-height: 350px;
}

.orders-table th {
    background: #f9fafb;
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
    will-change: transform;
    contain: layout style;
}

.orders-table th:hover {
    background: #f3f4f6;
}

.orders-table th.sortable {
    position: relative;
    padding-right: 2rem;
}

.orders-table th.sortable::after {
    content: '↕';
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    font-size: 0.8rem;
}

.orders-table th.sortable.sort-asc::after {
    content: '↑';
    opacity: 1;
    color: #3b82f6;
}

.orders-table th.sortable.sort-desc::after {
    content: '↓';
    opacity: 1;
    color: #3b82f6;
}

.orders-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Set specific widths for each column - updated for layout without Project and Actions columns */
.orders-table th:nth-child(1), /* ID column */
.orders-table td:nth-child(1) {
    width: 60px;
}

.orders-table th:nth-child(2), /* Title column */
.orders-table td:nth-child(2) {
    width: 200px;
}

.orders-table th:nth-child(3), /* Order Type column */
.orders-table td:nth-child(3) {
    width: 120px;
}

.orders-table th:nth-child(4), /* Category column */
.orders-table td:nth-child(4) {
    width: 90px;
}

.orders-table th:nth-child(5), /* Priority column */
.orders-table td:nth-child(5) {
    width: 70px;
}

.orders-table th:nth-child(6), /* Status column */
.orders-table td:nth-child(6) {
    width: 100px;
    min-width: 80px;
}

.orders-table th:nth-child(7), /* Days Left column */
.orders-table td:nth-child(7) {
    width: 60px;
    min-width: 45px;
}

.orders-table th:nth-child(8), /* Age column */
.orders-table td:nth-child(8) {
    width: 40px;
    min-width: 30px;
}

.orders-table th:nth-child(9), /* Error column */
.orders-table td:nth-child(9) {
    width: 40px;
    min-width: 30px;
}

.orders-table th:nth-child(10), /* Actions column */
.orders-table td:nth-child(10) {
    width: 100px;
    text-align: center;
}

.orders-table th:nth-child(11), /* Priority column */
.orders-table td:nth-child(11) {
    width: 10%; /* Same as before */
    min-width: 70px;
}

.orders-table th:nth-child(12), /* Days Left column */
.orders-table td:nth-child(12) {
    width: 11%; /* Increased from 9% to accommodate sort arrow */
    min-width: 75px; /* Increased from 65px */
}

.orders-table th:nth-child(13), /* Age column */
.orders-table td:nth-child(13) {
    width: 8%; /* Same as before */
    min-width: 45px;
}

.orders-table th:nth-child(14), /* Errors column */
.orders-table td:nth-child(14) {
    width: 5%; /* Reduced from 8% since no header text */
    min-width: 35px; /* Reduced from 45px */
    text-align: center;
}

/* Specific styling for projects table - 7 columns total */
body:has(#projects-table) .orders-table th:nth-child(7),
body:has(#projects-table) .orders-table td:nth-child(7) {
    width: 140px !important;
    min-width: 140px !important;
    text-align: center;
}

/* Action buttons styling for projects table */
body:has(#projects-table) .orders-table td:nth-child(7) .btn {
    margin: 0 2px;
    padding: 0.25rem 0.5rem;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Alternative: If CSS :has() isn't supported, use a specific page class */
.admin-projects-page .orders-table th:nth-child(7),
.admin-projects-page .orders-table td:nth-child(7) {
    width: 140px !important;
    min-width: 140px !important;
    text-align: center;
}

/* Specific column widths for admin projects page */
.admin-projects-page .orders-table th:nth-child(5), /* Status column */
.admin-projects-page .orders-table td:nth-child(5) {
    width: 110px !important;
    min-width: 110px !important;
}

.admin-projects-page .orders-table th:nth-child(6), /* Orders column */
.admin-projects-page .orders-table td:nth-child(6) {
    width: 70px !important;
    min-width: 70px !important;
    text-align: center;
}

.admin-projects-page .orders-table td:nth-child(7) .btn {
    margin: 0 2px;
    padding: 0.25rem 0.5rem;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.orders-table tbody tr:hover {
    background-color: #f8fafc;
    /* Use transform to create a new compositing layer */
    transform: translateZ(0);
}

/* Status and Priority Badges */
.status-badge, .priority-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    min-width: 60px;
    text-align: center;
    /* Use transforms for better performance */
    transform: translateZ(0);
}

/* Status badges */
.status-badge.pending {
    background: #fef3c7;
    color: #d97706;
}

.status-badge.in_progress {
    background: #dbeafe;
    color: #2563eb;
}

.status-badge.completed {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.on_hold {
    background: #fee2e2;
    color: #dc2626;
}

/* Priority badges */
.priority-badge.normal {
    background: #f3f4f6;
    color: #6b7280;
    padding: 0.125rem 0.5rem;
    font-size: 0.65rem;
}

.priority-badge.high {
    background: #fed7aa;
    color: #ea580c;
    padding: 0.125rem 0.5rem;
    font-size: 0.65rem;
}

/* Filters Section */
.filters-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

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

.filter-select, .search-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    min-width: 150px;
}

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

.actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* Forms */
.form-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.order-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.form-row.two-cols {
    grid-template-columns: 1fr 1fr;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.form-group label.required::after {
    content: ' *';
    color: #ef4444;
}

.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
    /* Improve input performance */
    transform: translateZ(0);
}

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

.form-control.error {
    border-color: #ef4444;
}

/* Custom select styling for forms */
.form-control select,
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: white url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%236b7280" d="M2 0L0 2h4zM2 5L0 3h4z"/></svg>') no-repeat right 0.75rem center;
    background-size: 12px;
    cursor: pointer;
    padding-right: 2.5rem;
}

.form-help {
    font-size: 0.875rem;
    color: #6b7280;
}

.field-error {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Recent Orders */
.recent-orders {
    margin-top: 2rem;
}

.orders-summary {
    min-height: 24px; /* Reserve space for summary text */
    margin-top: 1.25rem;
    margin-bottom: 1rem;
    color: #6b7280;
    font-size: 0.9rem;
}

/* Loading States */
.table-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10;
}

.loading-text {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #6b7280;
    font-size: 1.1rem;
}

.loading-spinner {
    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: 9999;
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* No Orders State */
.no-orders {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.no-orders-content {
    text-align: center;
    color: #6b7280;
}

.no-orders-content i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #d1d5db;
}

.no-orders-content h3 {
    font-size: 1.5rem;
    color: #374151;
    margin-bottom: 0.5rem;
}

/* Success Message */
.success-message {
    display: none;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    text-align: center;
}

.success-content {
    background: white;
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    max-width: 500px;
}

.success-content i {
    font-size: 4rem;
    color: #1E2A56;
    margin-bottom: 1rem;
}

.success-content h3 {
    font-size: 1.5rem;
    color: #1f2937;
    margin-bottom: 1rem;
}

.success-content p {
    color: #6b7280;
    margin-bottom: 2rem;
}

.success-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    /* Remove expensive backdrop-filter that causes Chrome performance issues */
    /* backdrop-filter: blur(2px); */
    /* Add efficient compositing */
    will-change: opacity;
    contain: layout style;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* Reduced from heavy shadow */
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.2s ease-out; /* Faster animation */
    /* Use GPU acceleration */
    transform: translateZ(0);
    will-change: auto;
    /* Optimize scrolling */
    contain: layout style;
}

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

@keyframes modalSlideIn {
    from {
        transform: scale(0.95) translateZ(0); /* Simplified animation */
        opacity: 0;
    }
    to {
        transform: scale(1) translateZ(0);
        opacity: 1;
    }
}

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

.modal-header h2,
.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

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

.modal-close:hover,
.close:hover {
    color: #374151;
    background: #e5e7eb;
}

.modal-body {
    padding: 1.5rem;
    /* Enable smooth scrolling on GPU */
    transform: translateZ(0);
}

.modal-footer,
.modal-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 1rem 1rem;
}

.modal-footer-left {
    display: flex;
    gap: 0.5rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    background: #1E2A56;
    color: white;
}

.toast.error {
    background: #ef4444;
    color: white;
}

.toast.info {
    background: #3b82f6;
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        padding: 1rem;
        position: relative;
    }
    
    /* Show hamburger button on mobile */
    .nav-toggle {
        display: flex;
        z-index: 1004; /* Increased to ensure hamburger button is above everything */
        position: relative;
    }
    
    /* Hide navigation menu by default on mobile */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 280px;
        background: linear-gradient(135deg, #1E2A56 0%, #2A3B6B 100%);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 80px 2rem 2rem 2rem;
        transition: right 0.3s ease;
        z-index: 1003; /* Ensure menu is above overlay */
        overflow-y: auto;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.2);
        /* Ensure menu content is clickable */
        pointer-events: auto;
        /* Create new stacking context */
        isolation: isolate;
    }
    
    /* Show navigation menu when active */
    .nav-menu.active {
        right: 0;
    }
    
    /* Mobile navigation links - ensure they're clickable */
    .nav-menu .nav-link {
        padding: 1rem;
        margin-bottom: 0.5rem;
        border-radius: 0.5rem;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        transition: all 0.2s ease;
        /* Ensure links are clickable */
        pointer-events: auto;
        position: relative;
        z-index: 1;
    }
    
    .nav-menu .nav-link:hover {
        background-color: rgba(255, 255, 255, 0.15);
        transform: translateX(5px);
    }
    
    .nav-menu .nav-link i {
        width: 24px;
        text-align: center;
    }
    
    /* User menu in mobile navigation */
    .nav-menu .nav-user-menu {
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 1rem;
        padding-top: 1rem;
        border-left: none;
        margin-left: 0;
        padding-left: 0;
        /* Ensure user menu is clickable */
        pointer-events: auto;
        position: relative;
        z-index: 1;
    }
    
    .nav-menu .nav-user-menu .nav-logout-btn {
        /* Ensure logout button is clickable */
        pointer-events: auto;
        position: relative;
        z-index: 1;
    }
    
    /* Remove overlay entirely - use document click detection instead */
    .nav-overlay {
        display: none !important;
    }
    
    .nav-overlay.active {
        display: none !important;
    }
    
    /* When menu is active, ensure the menu area allows interaction */
    .nav-menu.active {
        /* Ensure menu area is fully interactive */
        pointer-events: auto;
        /* Create strong stacking context */
        will-change: transform;
        transform: translateZ(0);
    }
    
    /* Ensure all interactive elements in the menu work properly */
    .nav-menu.active .nav-link,
    .nav-menu.active .nav-user-menu,
    .nav-menu.active .nav-logout-btn {
        pointer-events: auto;
        /* Ensure they're above any potential overlay interference */
        position: relative;
        z-index: 1;
    }
    
    /* Prevent body scroll when menu is open */
    body.nav-open {
        overflow: hidden;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Tablet breakpoint for stats grid */
@media (max-width: 1024px) and (min-width: 769px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .filters-section {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .filters {
        justify-content: stretch;
        flex-direction: column;
        gap: 1rem;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .form-row.two-cols {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .success-actions {
        flex-direction: column;
    }
    
    .toast-container {
        top: 1rem;
        right: 1rem;
        left: 1rem;
    }
    
    .toast {
        max-width: none;
    }
    
    .container-wide {
        padding: 0.5rem;
    }
    
    .orders-table {
        min-width: 750px; /* Increased from 700px for wider ID column */
        font-size: 0.8rem; /* Smaller text on mobile */
    }
    
    .orders-table th,
    .orders-table td {
        padding: 0.5rem 0.25rem; /* Tighter padding */
    }
    
    .admin-menu {
        grid-template-columns: 1fr;
    }
    
    .admin-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .dropdown-truncate {
        font-size: 0.875rem;
    }
    
    /* Fix dropdown and select overflow on mobile */
    .filter-select, 
    .search-input, 
    .form-control, 
    .custom-select select {
        min-width: 0; /* Allow shrinking */
        width: 100%; /* Take full width of container */
        max-width: 100%; /* Prevent overflow */
        box-sizing: border-box; /* Include padding in width calculation */
    }
    
    /* Improve modal display on mobile */
    .modal-content {
        width: 95%;
        max-width: 95vw;
        margin: 1rem;
    }
    
    /* Fix filter group alignment on mobile */
    .filter-group label {
        margin-bottom: 0.25rem;
    }
    
    /* Ensure buttons don't overflow */
    .btn {
        min-width: 0;
        flex-shrink: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Toggle Switch for Completed Orders */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

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

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #1E2A56;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

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

/* Inline Status Dropdown */
.status-dropdown {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    min-width: 100px;
    padding: 0.125rem 0.25rem;
    font-family: inherit;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
    /* Contain style recalculations */
    contain: style;
}

.status-dropdown:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.status-dropdown:focus {
    outline: 2px solid #1E2A56;
    outline-offset: 2px;
}

/* Order Detail Modal */
.order-detail-modal .modal-content {
    max-width: 800px;
    width: 95%;
}

.order-detail-header {
    display: flex;
    justify-content: between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.order-detail-title {
    flex: 1;
}

.order-detail-title h2 {
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.order-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
}

/* Two-column grid layout for order metadata */
.order-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
}

.meta-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-value {
    font-weight: 400;
    color: #1f2937;
    font-size: 0.9rem;
}

/* Responsive: Stack columns on small screens */
@media (max-width: 768px) {
    .order-meta-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.order-description {
    margin-bottom: 2rem;
}

.order-description h3 {
    margin-bottom: 0.75rem;
    color: #1f2937;
}

.description-content {
    background-color: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid #1E2A56;
    white-space: pre-wrap;
    line-height: 1.6;
    word-break: break-word;
    overflow-wrap: break-word;
}

.description-link {
    color: #3b82f6;
    text-decoration: underline;
    word-break: break-all;
    transition: color 0.2s;
}

.description-link:hover {
    color: #1d4ed8;
}

.order-edit-form {
    display: grid;
    gap: 1rem;
}

.form-row-detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Footer */
.footer {
    background-color: #ebebeb;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-logos {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.footer-logo {
    opacity: 0.8;
}

.footer-logo.orderbase-logo {
    max-height: 40px;
}

.footer-logo.stormyran-logo {
    max-height: 30px;
}

.powered-by-text {
    font-size: 0.75rem;
    color: #9ca3af;
}

.footer-text {
    color: #9ca3af;
    font-size: 0.75rem;
    margin: 0;
}

/* Admin Styles */
.admin-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.admin-section {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

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

.admin-section p {
    color: #6b7280;
    margin-bottom: 1.5rem;
}

.admin-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    min-height: 44px; /* Ensure consistent height */
}

/* Standardize admin button sizes */
.admin-actions .btn {
    flex: 0 1 auto; /* Allow shrinking but not growing */
    min-width: 180px; /* Increased to prevent text wrapping */
    justify-content: center;
    text-align: center;
    height: 44px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap; /* Prevent text wrapping */
    text-overflow: ellipsis;
    overflow: hidden;
}

/* When there's only one button, don't let it fill the whole width */
.admin-actions .btn:only-child {
    flex: 0 0 auto;
    min-width: 200px;
}

/* Medium resolution fixes for admin buttons */
@media (min-width: 1000px) and (max-width: 1400px) {
    .admin-actions {
        justify-content: flex-start; /* Align buttons to start instead of stretching */
        gap: 0.75rem; /* Slightly smaller gap for medium screens */
    }
    
    .admin-actions .btn {
        min-width: 170px; /* Slightly smaller for medium screens */
        max-width: 200px; /* Prevent buttons from getting too wide */
    }
    
    .admin-actions .btn:only-child {
        min-width: 170px;
        max-width: 200px;
    }
}

.admin-stat {
    color: #6b7280;
    font-size: 0.9rem;
}

/* Admin Tabs */
.admin-tabs-container {
    margin-bottom: 3rem;
}

.admin-tabs-nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: #f9fafb;
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.admin-tab-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    background-color: transparent;
    color: #6b7280;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.admin-tab-btn.active {
    background-color: #1E2A56;
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.admin-tab-btn.active:hover {
    background-color: #2A3B6B;
}

.admin-tab-content {
    display: none;
}

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

/* Inactive Admin Section */
.inactive-section {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.inactive-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 48%, rgba(0,0,0,0.1) 49%, rgba(0,0,0,0.1) 51%, transparent 52%);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 1;
}

.inactive-badge {
    background: #6b7280;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.inactive-notice {
    color: #ef4444;
    font-size: 0.875rem;
    font-style: italic;
    margin-top: 0.5rem;
}

/* Dashboard Order Filter Tabs */
.order-filter-tabs {
    margin-bottom: 1.5rem;
    background: white;
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.tab-nav {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    padding: 0.625rem 1.25rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    background-color: white;
    color: #6b7280;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    position: relative;
}

.tab-btn:hover {
    background-color: #f9fafb;
    color: #374151;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tab-btn.active {
    background: linear-gradient(135deg, #1E2A56 0%, #2A3B6B 100%);
    color: white;
    border-color: #2A3B6B;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.tab-btn.active:hover {
    background: linear-gradient(135deg, #2A3B6B 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 3px;
    background-color: #1E2A56;
    border-radius: 2px;
}

.recent-activity {
    margin-top: 3rem;
}

.activity-list {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.activity-item {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.activity-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
}

.activity-icon.project { background: #3b82f6; }
.activity-icon.order-type { background: #1E2A56; }
.activity-icon.error { background: #ef4444; }
.activity-icon.order { background: #8b5cf6; }

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.activity-description {
    color: #6b7280;
    font-size: 0.875rem;
}

.activity-time {
    color: #9ca3af;
    font-size: 0.75rem;
    white-space: nowrap;
}

/* Project Badge Styles */
.project-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #dbeafe;
}

/* Status badge updates for error reports */
.status-badge.needs_action {
    background: #fef3c7;
    color: #d97706;
}

.status-badge.in_progress {
    background: #dbeafe;
    color: #2563eb;
}

.status-badge.action_taken {
    background: #d1fae5;
    color: #065f46;
}

/* Error severity badges */
.severity-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.severity-badge.low {
    background: #f3f4f6;
    color: #6b7280;
}

.severity-badge.medium {
    background: #fef3c7;
    color: #d97706;
}

.severity-badge.high {
    background: #fee2e2;
    color: #dc2626;
}

/* Error type badges */
.error-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: #f9fafb;
    color: #374151;
    border: 1px solid #e5e7eb;
}

/* Responsive improvements */
@media (max-width: 1800px) { /* Changed from 1600px to 1800px */
    .container-wide {
        max-width: 100%;
        padding: 1rem;
    }
}

@media (max-width: 1200px) {
    .container-wide {
        padding: 1rem;
        max-width: 100%;
    }
    
    /* Keep table within bounds */
    .table-container {
        width: 100%;
        overflow-x: auto;
    }
    
    .orders-table {
        min-width: 850px; /* Same as before */
    }
    
    /* Reduce column min-widths further on smaller screens - updated for 8 columns */
    .orders-table th:nth-child(1), .orders-table td:nth-child(1) { min-width: 50px; }
    .orders-table th:nth-child(2), .orders-table td:nth-child(2) { min-width: 140px; }
    .orders-table th:nth-child(3), .orders-table td:nth-child(3) { min-width: 90px; }
    .orders-table th:nth-child(4), .orders-table td:nth-child(4) { min-width: 55px; }
    .orders-table th:nth-child(5), .orders-table td:nth-child(5) { min-width: 80px; }
    .orders-table th:nth-child(6), .orders-table td:nth-child(6) { min-width: 60px; } /* Increased for sort arrow */
    .orders-table th:nth-child(7), .orders-table td:nth-child(7) { min-width: 35px; }
    .orders-table th:nth-child(8), .orders-table td:nth-child(8) { min-width: 30px; } /* Reduced for icon-only */
}

@media (max-width: 768px) {
    .container-wide {
        padding: 0.5rem;
    }
    
    .orders-table {
        min-width: 750px; /* Increased from 700px for wider ID column */
        font-size: 0.8rem; /* Smaller text on mobile */
    }
    
    .orders-table th,
    .orders-table td {
        padding: 0.5rem 0.25rem; /* Tighter padding */
    }
    
    .admin-menu {
        grid-template-columns: 1fr;
    }
    
    .admin-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    /* Reset button sizing on mobile for better touch targets */
    .admin-actions .btn {
        flex: none;
        min-width: auto;
        width: 100%;
        height: 48px; /* Slightly taller for mobile touch */
    }
    
    .admin-actions .btn:only-child {
        min-width: auto;
        width: 100%;
    }
    
    .dropdown-truncate {
        font-size: 0.875rem;
    }
}

/* Table improvements for better data display */
.orders-table {
    font-size: 0.875rem; /* Slightly smaller text to fit more data */
}

.orders-table th {
    white-space: nowrap;
    padding: 0.75rem;
}

.orders-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Improve text display in specific columns */
.orders-table td:nth-child(2) { /* Title column - allow wrapping if needed */
    white-space: normal;
    word-wrap: break-word;
    max-height: 3rem;
    overflow: hidden;
}

.orders-table td:nth-child(3) { /* Order Type column */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.orders-table td:first-child { /* ID column */
    max-width: 70px;
}

.orders-table td:nth-child(2) { /* Title column */
    max-width: 300px;
    white-space: normal;
    word-wrap: break-word;
    max-height: 3rem;
    overflow: hidden;
}

.orders-table td:nth-child(3) { /* Order Type column */
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Status dropdown in tables should be more compact */
.status-dropdown {
    padding: 0.125rem 0.25rem;
    font-size: 0.75rem;
    min-width: 100px;
}

/* Clickable KPI card styles */
.stat-card.clickable.active {
    background-color: #f0f9ff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    border: 2px solid #3b82f6;
}

.stat-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.stat-card.clickable.active:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.2);
}

/* Dropdown overflow handling */
.dropdown-truncate {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-truncate option {
    white-space: normal;
    overflow: visible;
    text-overflow: initial;
    max-width: none;
}

/* Container width improvements */
.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Article management styles */
.article-item {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr auto;
    gap: 1rem;
    padding: 1rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    align-items: end;
    overflow: hidden; /* Prevent overflow */
    min-width: 0; /* Allow grid items to shrink */
}

.article-item .form-group {
    margin-bottom: 0;
    min-width: 0; /* Allow form groups to shrink */
}

.article-item .form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
}

.article-item .form-control {
    min-width: 0; /* Allow inputs to shrink */
    width: 100%;
    box-sizing: border-box;
}

/* Materials container improvements */
#materials-container {
    overflow: hidden; /* Prevent container overflow */
}

#materials-list {
    overflow: hidden; /* Prevent list overflow */
}

/* Responsive design for article items */
@media (max-width: 1024px) {
    .article-item {
        grid-template-columns: 1fr 1fr 1fr auto;
        gap: 0.75rem;
    }
}

@media (max-width: 768px) {
    .article-item {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .article-item .form-group {
        margin-bottom: 0.75rem;
    }
    
    .article-item .form-group:last-child {
        margin-bottom: 0;
    }
    
    .article-item > div:last-child {
        align-self: center;
        margin-top: 0.5rem;
    }
}

@media (max-width: 640px) {
    /* Additional mobile fixes */
    .form-container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 1rem;
    }
    
    .article-item {
        padding: 0.5rem;
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .article-item .form-group {
        margin-bottom: 0.5rem;
    }
    
    .article-item .form-control {
        font-size: 0.875rem;
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .article-item {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .article-item .form-group {
        margin-bottom: 0.5rem;
    }
    
    /* Ensure materials header is responsive */
    .materials-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
    
    .materials-header .btn {
        width: 100%;
        justify-content: center;
    }
}

.article-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.article-checkbox:hover {
    background: #f9fafb;
}

.article-checkbox.completed {
    background: #d1fae5;
    border-color: #1E2A56;
    text-decoration: line-through;
    opacity: 0.7;
}

.article-checkbox input[type="checkbox"] {
    margin: 0;
}

.remove-article-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 0.375rem;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background-color 0.2s;
}

.remove-article-btn:hover {
    background: #dc2626;
}

/* Form container improvements */
.form-container {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

/* Custom dropdown styling */
.custom-select {
    position: relative;
    display: inline-block;
    width: 100%;
    font-family: inherit;
}

.custom-select select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.9rem;
    width: 100%;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.custom-select::after {
    content: '▼';
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    pointer-events: none;
    color: #6b7280;
    font-size: 0.75rem;
}

.filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: white url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%236b7280" d="M2 0L0 2h4zM2 5L0 3h4z"/></svg>') no-repeat right 0.75rem center;
    background-size: 12px;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.9rem;
    min-width: 150px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.search-input {
    appearance: none;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    min-width: 150px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

/* Days left and age styling with negative values support */
.days-left {
    /* Removed font-weight: 600; to remove bold formatting */
}

.days-left.overdue {
    color: #dc2626;
    /* Removed font-weight: 700; to remove bold formatting */
}

.days-left.due-soon {
    color: #d97706;
}

.days-left.on-time {
    color: #16a34a;
}

.age-badge {
    font-size: 0.75rem;
    color: #6b7280;
}

/* View Toggle Styles */
.view-toggle-group {
    display: inline-flex;
    background: #f3f4f6;
    border-radius: 0.5rem;
    padding: 0.25rem;
    gap: 0.25rem;
}

.view-toggle-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #6b7280;
    font-size: 1rem;
}

.view-toggle-btn:hover {
    color: #374151;
    background: #f3f4f6;
}

.view-toggle-btn.active {
    background: white;
    color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Card View Styles */
.cards-container {
    background: transparent;
    border-radius: 1rem;
    position: relative;
    width: 100%;
}

.orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    padding: 0.5rem;
}

.order-card {
    background: white;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #d1d5db;
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.order-card-id {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

.order-card-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.order-card-title {
    font-size: 1rem;
    color: #374151;
    margin-bottom: 1rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.order-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.order-card-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.order-card-meta-item i {
    font-size: 0.75rem;
    opacity: 0.7;
}

.order-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.order-card-time {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
}

.order-card-time-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.order-card-status {
    display: flex;
    align-items: center;
}

/* Cards loading overlay */
.cards-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    min-height: 300px;
}

/* Responsive adjustments for cards */
@media (max-width: 1200px) {
    .orders-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .orders-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.25rem;
    }
    
    .order-card {
        padding: 1rem;
    }
    
    .view-toggle-group {
        margin-bottom: 0.5rem;
    }
}

/* Pagination Styles */
.pagination-container {
    min-height: 60px; /* Reserve space even when hidden */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 1rem 1rem;
    margin-top: -1px; /* Overlap with table border */
    visibility: hidden; /* Use visibility instead of display to maintain space */
}

.pagination-container.visible {
    visibility: visible;
}

.pagination-info {
    color: #6b7280;
    font-size: 0.875rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-numbers {
    display: flex;
    gap: 0.25rem;
}

.page-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: white;
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.2s;
    cursor: pointer;
}

.page-number:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.page-number.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.page-number:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .pagination-controls {
        justify-content: center;
    }
}

/* Dashboard table specific styles */
.recent-orders .orders-table th.priority-col,
.recent-orders .orders-table td.priority-col {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
}

.recent-orders .orders-table th:nth-child(1), /* ID */
.recent-orders .orders-table td:nth-child(1) {
    width: 60px;
    min-width: 60px;
}

.recent-orders .orders-table th:nth-child(3), /* Order Type */
.recent-orders .orders-table td:nth-child(3) {
    width: 120px;
    min-width: 120px;
}

.recent-orders .orders-table th:nth-child(6), /* Days Left */
.recent-orders .orders-table td:nth-child(6) {
    width: 90px;
    min-width: 90px;
    text-align: center;
}

/* Error Report Modal Styles */
.error-report-modal .modal-content {
    max-width: 600px;
    width: 90%;
    /* Prevent layout shifts during interaction */
    contain: layout style;
}

.error-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    /* Use GPU layer */
    transform: translateZ(0);
}

.error-type-card {
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    position: relative;
    /* Use GPU acceleration for smoother interactions */
    transform: translateZ(0);
    /* Contain paint to prevent reflows */
    contain: layout paint;
}

.error-type-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px) translateZ(0);
}

.error-type-card.selected {
    border-color: #ef4444;
    background: #fef2f2;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    /* Maintain GPU layer */
    transform: translateZ(0);
}

.error-type-card i {
    font-size: 2rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
    display: block;
}

.error-type-card.selected i {
    color: #ef4444;
}

.error-type-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.error-type-card p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.4;
}

.error-severity {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.severity-option {
    flex: 1;
    min-width: 120px;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    /* Use GPU acceleration */
    transform: translateZ(0);
    /* Contain layout calculations */
    contain: layout paint;
}

.severity-option:hover {
    border-color: #3b82f6;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
    transform: translateZ(0);
}

.severity-option.selected {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.severity-option.severity-low.selected {
    border-color: #1E2A56;
    background: #f0fdf4;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.severity-option.severity-medium.selected {
    border-color: #f59e0b;
    background: #fffbeb;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.severity-option.severity-high.selected {
    border-color: #ef4444;
    background: #fef2f2;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.severity-option h5 {
    margin: 0 0 0.25rem 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
}

.severity-option p {
    margin: 0;
    font-size: 0.8rem;
    color: #6b7280;
}

.error-report-modal h4 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

.error-report-modal .form-group {
    margin-bottom: 1.5rem;
}

.error-report-modal .form-group:last-child {
    margin-bottom: 0;
}

/* Order Type Category Badge */
.category-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: capitalize;
    min-width: 60px;
    text-align: center;
    /* Use transforms for better performance */
    transform: translateZ(0);
}

.category-badge.purchasing {
    background-color: #3b82f6;
    color: white;
}

.category-badge.transportation {
    background-color: #1E2A56;
    color: white;
}

.category-badge.warehouse {
    background-color: #f59e0b;
    color: white;
}

.category-badge.other {
    background-color: #6b7280;
    color: white;
}

/* Dropdown indicator for status */
.dropdown-indicator {
    font-size: 0.8em;
    margin-left: 0.25em;
    opacity: 0.6;
    vertical-align: middle;
}

.category-badge-sm {
    font-size: 0.75em;
    padding: 0.15rem 0.4rem;
    border-radius: 0.2rem;
}

.status-cell {
    position: relative;
}
.status-cell .dropdown-indicator {
    display: none;
    position: absolute;
    right: 0.5em;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}
.status-cell:hover .dropdown-indicator {
    display: inline;
}

.mini-status-bar {
    width: 100%;
    height: 10px;
    background: #f3f4f6;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.1em;
    margin-bottom: 0.1em;
    display: flex;
}

.category-badge-sm {
    font-size: 0.75em;
    padding: 0.15rem 0.4rem;
    border-radius: 0.2rem;
    display: inline-block;
    font-weight: 600;
    text-transform: capitalize;
    margin-right: 0.2em;
}

/* Gantt Chart Styles */
.gantt-section {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    margin-bottom: 3rem;
}

.gantt-section .chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.gantt-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.gantt-legend {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    display: inline-block;
}

.legend-color.pending {
    background-color: #fbbf24;
}

.legend-color.in-progress {
    background-color: #3b82f6;
}

.legend-color.on-hold {
    background-color: #ef4444;
}

.legend-color.completed {
    background-color: #10b981;
}

.gantt-container {
    position: relative;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #f9fafb;
}

.gantt-chart {
    position: relative;
    overflow-x: auto;
    overflow-y: auto;
    max-height: 700px; /* Increased from 500px */
}

.gantt-header {
    position: sticky;
    top: 0;
    background: white;
    border-bottom: 2px solid #e5e7eb;
    z-index: 20;
    display: flex;
    min-width: 100%;
}

.gantt-project-header {
    position: sticky;
    left: 0;
    background: white;
    border-right: 1px solid #e5e7eb;
    width: 280px;
    min-width: 280px;
    padding: 1rem;
    font-weight: 600;
    color: #374151;
    z-index: 21;
}

.gantt-timeline-header {
    flex: 1;
    overflow: hidden;
    position: relative;
    z-index: 20;
}

.gantt-month-header {
    display: flex;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    min-width: max-content;
}

.gantt-month-column {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    padding: 0.75rem 0.5rem;
    border-right: 1px solid #cbd5e1;
    background: linear-gradient(to bottom, #f8fafc, #f1f5f9);
    flex-shrink: 0;
}

.gantt-body {
    position: relative;
    max-height: 600px; /* Increased from 400px */
    overflow-y: auto;
    overflow-x: auto;
}

.gantt-timeline-background {
    position: absolute;
    top: 0;
    left: 280px;
    bottom: 0;
    display: flex;
    z-index: 1;
    pointer-events: none;
}

.gantt-timeline-column {
    min-width: 4px;
    width: 4px;
    border-right: 1px solid #f1f5f9;
    position: relative;
    height: 100%;
    flex-shrink: 0;
}

.gantt-timeline-column.month-start {
    border-right: 2px solid #cbd5e1;
}

.gantt-timeline-column.today {
    background-color: rgba(220, 38, 38, 0.1);
}

.gantt-timeline-column.weekend {
    background-color: #f8fafc;
}

.gantt-projects {
    position: relative;
    z-index: 5;
    min-width: max-content;
}

.gantt-project-row {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    min-height: 45px; /* Reduced from 60px */
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
    background: white;
}

.gantt-project-row:hover {
    background-color: #f8fafc;
}

.gantt-project-row:hover .gantt-project-info {
    background-color: #f8fafc;
}

.gantt-project-info {
    position: sticky;
    left: 0;
    background: inherit;
    border-right: 1px solid #e5e7eb;
    width: 280px;
    min-width: 280px;
    padding: 0.75rem; /* Reduced from 1rem */
    z-index: 15;
}

.gantt-project-name {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.gantt-project-details {
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.4;
}

.gantt-project-timeline {
    flex: 1;
    position: relative;
    min-width: 0;
    align-items: center;
    height: 45px; /* Reduced from 60px */
    display: flex;
    z-index: 5;
}

.gantt-project-bar {
    position: absolute;
    height: 28px; /* Reduced from 32px */
    border-radius: 6px; /* Slightly reduced from 8px */
    display: flex;
    align-items: center;
    color: white;
    font-size: 0.7rem; /* Slightly reduced from 0.75rem */
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: height 0.2s, box-shadow 0.2s;
    border: none;
    padding: 0;
    gap: 0;
    min-width: 40px;
    z-index: 6;
    overflow: hidden;
    position: relative;
}

.gantt-project-bar:hover {
    height: 32px; /* Reduced from 36px */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
    z-index: 7;
}

.gantt-bar-segments {
    display: flex;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 8px;
    overflow: hidden;
}

.gantt-bar-segment {
    height: 100%;
    flex-shrink: 0;
    position: relative;
    transition: opacity 0.2s;
}

.gantt-bar-segment.completed {
    background: linear-gradient(135deg, #10b981, #059669);
}

.gantt-bar-segment.in-progress {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.gantt-bar-segment.pending {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.gantt-bar-segment.on-hold {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.gantt-bar-segment.no-orders {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
}

.gantt-bar-segment.in-progress {
    /* border: 1px solid rgba(0, 0, 0, 0.1); */
}

/* Remove old order box styles */
.gantt-order-count {
    display: none;
}

.gantt-order-boxes {
    display: none;
}

.gantt-order-box {
    display: none;
}

.gantt-today-line.gantt-today-header {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, rgba(59, 130, 246, 0.8), rgba(37, 99, 235, 0.6));
    z-index: 25;
    pointer-events: none;
    box-shadow: 0 0 3px rgba(59, 130, 246, 0.4);
    border-radius: 1px;
}

.gantt-today-line::before {
    display: none;
}

.gantt-today-line::after {
    display: none;
}

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

.gantt-empty i {
    font-size: 2rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gantt-section {
        padding: 1rem;
    }
    
    .gantt-section .chart-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .gantt-legend {
        gap: 1rem;
    }
    
    .gantt-project-info {
        width: 200px;
        min-width: 200px;
        padding: 0.75rem;
    }
    
    .gantt-project-header {
        width: 200px;
        min-width: 200px;
        padding: 0.75rem;
    }
    
    .gantt-project-name {
        font-size: 0.8rem;
    }
    
    .gantt-project-details {
        font-size: 0.75rem;
    }
}

/* File Upload Styles */
.file-upload-area {
    margin-bottom: 1rem;
}

.file-upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    background: #fafafa;
}

.file-upload-zone:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
}

.file-upload-zone.drag-over {
    border-color: #3b82f6;
    background: #eff6ff;
    border-style: solid;
}

.file-upload-zone i {
    font-size: 2rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    display: block;
}

.file-upload-zone p {
    margin: 0.5rem 0;
    color: #374151;
    font-weight: 500;
}

.file-upload-zone small {
    color: #6b7280;
    font-size: 0.875rem;
}

.selected-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

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

.file-icon {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3b82f6;
    color: white;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.file-size {
    font-size: 0.75rem;
    color: #6b7280;
}

.file-remove {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background-color 0.2s;
}

.file-remove:hover {
    background: #dc2626;
}

.attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

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

.attachment-icon {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1E2A56;
    color: white;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.attachment-details {
    flex: 1;
}

.attachment-name {
    font-weight: 500;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.attachment-meta {
    font-size: 0.75rem;
    color: #6b7280;
}

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

.attachment-view {
    background: #10b981;
    color: white;
    border: none;
    border-radius: 0.25rem;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    transition: background-color 0.2s;
}

.attachment-view:hover {
    background: #059669;
    color: white;
    text-decoration: none;
}

.attachment-download {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.25rem;
    padding: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    transition: background-color 0.2s;
}

.attachment-download:hover {
    background: #2563eb;
    color: white;
    text-decoration: none;
}

.attachment-delete {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: background-color 0.2s;
}

.attachment-delete:hover {
    background: #dc2626;
}

/* Additional CSS to ensure proper button visibility */
.admin-projects-page .orders-table .actions-column {
    white-space: nowrap !important;
    overflow: visible !important;
    padding: 0.5rem !important;
}

.admin-projects-page .orders-table .actions-column .btn {
    font-size: 0.875rem;
    border-radius: 4px;
    vertical-align: middle;
}

.admin-projects-page .orders-table .actions-column .btn i {
    font-size: 0.875rem;
}

/* Upcoming Deadlines Chart Styles */
.upcoming-deadlines-section {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    margin-bottom: 3rem;
}

.upcoming-deadlines-section .chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.upcoming-deadlines-section .chart-legend {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.legend-color-square {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    display: inline-block;
}

.legend-color-square.purchasing {
    background-color: #8b5cf6;
}

.legend-color-square.warehouse {
    background-color: #14b8a6;
}

.legend-color-square.transportation {
    background-color: #f97316;
}

.legend-color-square.other {
    background-color: #64748b;
}

.upcoming-deadlines-section .chart-container {
    position: relative;
    height: 400px;
    width: 100%;
}

.upcoming-deadlines-section canvas {
    max-width: 100% !important;
    height: auto !important;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

/* Table Performance Optimizations */
.table-container {
    /* Enable GPU-accelerated scrolling for tables */
    will-change: scroll-position;
    transform: translateZ(0);
    contain: layout style;
    -webkit-overflow-scrolling: touch;
}

.orders-table thead th {
    /* Optimize sticky header performance */
    will-change: transform;
    contain: layout style;
}

.orders-table tbody tr:hover {
    /* Use transform for hover effects instead of heavy box-shadow */
    transform: translateZ(0);
    will-change: transform;
}

/* Reduce expensive hover effects for Chrome */
.stat-card.clickable:hover {
    /* Replace heavy box-shadow with subtle transform */
    transform: translateY(-1px) translateZ(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); /* Reduced from heavy shadow */
}

.btn:hover {
    /* Optimize button hover performance */
    transform: translateY(-1px) translateZ(0);
    will-change: transform;
}

/* Mobile-specific improvements */
@media (max-width: 480px) {
    /* Extra small screens */
    .container-wide {
        padding: 0.25rem;
    }
    
    .page-header h1 {
        font-size: 1.75rem;
    }
    
    .filters-section {
        padding: 1rem;
    }
    
    .filter-select, 
    .search-input {
        min-width: unset;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Ensure dropdowns don't cause horizontal scroll */
    .filter-group {
        overflow: hidden;
    }
    
    /* Improve button spacing */
    .actions {
        gap: 0.5rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Fix modal on very small screens */
    .modal-content {
        width: 98%;
        max-width: 98vw;
        margin: 0.5rem;
        border-radius: 0.5rem;
    }
    
    /* Reduce navigation menu width on small screens */
    .nav-menu {
        width: 260px;
    }
}

/* Move Requests Overlay Styles */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Remove expensive backdrop-filter that causes Chrome performance issues */
    /* backdrop-filter: blur(2px); */
    /* Add efficient compositing */
    will-change: opacity;
    contain: layout style;
}

.overlay-content {
    background: #fff;
    border-radius: 1rem;
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.2s ease-out;
    /* Use GPU acceleration */
    transform: translateZ(0);
    will-change: auto;
    /* Optimize scrolling */
    contain: layout style;
}

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

.overlay-header h2 {
    margin: 0;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
}

.overlay-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0.25rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.overlay-close:hover {
    color: #374151;
    background: #e5e7eb;
}

.overlay-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    /* Enable smooth scrolling on GPU */
    transform: translateZ(0);
}

.overlay-body .filter-section {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.overlay-body .filter-section label {
    font-weight: 500;
    color: #374151;
    min-width: 120px;
}

.overlay-body .filter-section .form-control {
    width: 300px;
}

.overlay-body .table-container {
    margin-top: 0;
}

/* Fix z-index for move request modal to appear above overlay */
#moveRequestModal {
    z-index: 3000 !important;
}

/* Fix z-index for add items modal to appear above order detail modal */
#add-items-modal {
    z-index: 2000 !important;
}

/* Add Items Modal - Make it wider for better field visibility */
.modal-lg {
    max-width: 1100px !important;
    width: 95% !important;
}

/* Responsive overlay */
@media (max-width: 768px) {
    .overlay-content {
        width: 95%;
        max-width: 95vw;
        margin: 1rem;
        max-height: 95vh;
    }
    
    .overlay-header {
        padding: 1rem;
    }
    
    .overlay-header h2 {
        font-size: 1.1rem;
    }
    
    .overlay-body {
        padding: 1rem;
    }
    
    .overlay-body .filter-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .overlay-body .filter-section label {
        min-width: auto;
    }
    
    .overlay-body .filter-section .form-control {
        width: 100%;
    }
}

/* Project Table Chart Styles */
.project-table-section {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    margin-bottom: 3rem;
}

.project-table-section .chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.project-table-legend {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.project-table-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.project-table-legend .legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    display: inline-block;
}

.project-table-legend .legend-color.completed {
    background-color: #10b981;
}

.project-table-legend .legend-color.overdue {
    background-color: #ef4444;
}

.project-table-legend .legend-color.in-progress {
    background-color: #3b82f6;
}

.project-table-legend .legend-color.unassigned {
    background-color: #fbbf24;
}

.project-table-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 900px; /* Increased from 650px to 900px */
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    background: white;
}

.project-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* Fixed layout for better column control */
}

.project-table thead {
    background-color: #f9fafb;
}

.project-table th {
    padding: 0.6rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.825rem;
}

.project-table th:first-child {
    width: 25%; /* Project name - flexible width */
    min-width: 250px; /* Minimum to prevent excessive shrinking */
}

.project-table th:nth-child(2) {
    width: 120px; /* Start Date column - keep fixed */
}

.project-table th:nth-child(3) {
    width: 35%; /* Progress Bar column - flexible width */
    min-width: 300px; /* Minimum for progress bars */
}

.project-table th:nth-child(4) {
    width: auto; /* Notes column - takes remaining space */
    max-width: 300px; /* Limit notes column width */
}

.project-table th:last-child {
    text-align: left;
}

.project-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s;
}

.project-table tbody tr:hover {
    background-color: #f9fafb;
}

.project-table td {
    padding: 0.6rem 1rem;
    vertical-align: middle;
    font-size: 0.875rem;
    overflow: hidden;
}

.project-table td:last-child {
    text-align: left;
}

.project-data-cell {
    width: 330px; /* Base width for standard screens */
}

.project-name {
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.375rem; /* Increased from 0.25rem for more spacing */
    font-size: 0.875rem;
    line-height: 1.2;
    /* Responsive text truncation */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.project-client {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.375rem; /* Increased from 0.25rem for more spacing */
    line-height: 1.1;
}

.project-orders-count {
    font-size: 0.75rem;
    color: #9ca3af;
    line-height: 1.1;
}

.start-date-cell {
    width: 120px; /* Fixed width to match header */
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 500;
}

.project-bar-cell {
    width: 400px; /* Fixed width to match header */
}

.project-bar-container {
    position: relative;
    width: 100%;
    height: 32px; /* Restored to Gantt chart height */
    background: #f3f4f6;
    border-radius: 8px; /* Restored to Gantt chart border radius */
    overflow: hidden;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); /* Restored Gantt chart shadow */
    border: 1px solid #e5e7eb;
}

.project-bar-segments {
    display: flex;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    border-radius: 8px; /* Match container border radius */
    overflow: hidden;
    background-color: transparent; /* Ensure transparent background */
}

.project-bar-segment {
    height: 100%;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem; /* Restored to Gantt chart font size */
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: opacity 0.2s;
    min-width: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-bar-segment.completed {
    background-color: #10b981; /* Solid fallback */
    background: linear-gradient(135deg, #10b981, #059669); /* Restored Gantt chart gradient */
}

.project-bar-segment.overdue {
    background-color: #ef4444; /* Solid fallback */
    background: linear-gradient(135deg, #ef4444, #dc2626); /* Restored Gantt chart gradient */
}

.project-bar-segment.in-progress {
    background-color: #3b82f6; /* Solid fallback */
    background: linear-gradient(135deg, #3b82f6, #2563eb); /* Restored Gantt chart gradient */
}

.project-bar-segment.unassigned {
    background-color: #fbbf24; /* Solid fallback */
    background: linear-gradient(135deg, #fbbf24, #f59e0b); /* Restored Gantt chart gradient */
}

.project-bar-segment.no-orders {
    background-color: #9ca3af; /* Solid fallback */
    background: linear-gradient(135deg, #9ca3af, #6b7280); /* Restored Gantt chart gradient */
}

.project-bar-segment:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.project-bar-segment:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.project-bar-segment:hover {
    opacity: 0.9;
    transform: scale(1.02);
    z-index: 5;
}

.project-description-cell {
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.3;
    word-wrap: break-word;
}

.project-table-empty {
    text-align: center;
    padding: 3rem;
    color: #9ca3af;
}

.project-table-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    color: #d1d5db;
}

/* Responsive project table widths for different screen sizes */
@media (min-width: 1800px) {
    .project-data-cell {
        width: 450px; /* More space for project names on very large screens */
    }
    
    .project-bar-cell {
        width: 500px; /* More space for progress bars too */
    }
}

@media (min-width: 1400px) and (max-width: 1799px) {
    .project-data-cell {
        width: 380px; /* Moderate increase for large screens */
    }
    
    .project-bar-cell {
        width: 420px;
    }
}

@media (min-width: 1200px) and (max-width: 1399px) {
    .project-data-cell {
        width: 350px; /* Slightly more space */
    }
}

@media (min-width: 769px) and (max-width: 1199px) {
    .project-data-cell {
        width: 300px; /* Slightly less space for medium screens */
    }
    
    .project-bar-cell {
        width: 350px;
    }
}

@media (max-width: 768px) {
    .project-table-section {
        padding: 1rem;
    }

    .project-table-legend {
        gap: 1rem;
    }

    .project-data-cell {
        width: 180px;
    }

    .project-bar-cell {
        width: 150px;
    }

    .project-table th,
    .project-table td {
        padding: 0.5rem 0.75rem;
    }

    .project-name {
        font-size: 0.8rem;
    }

    .project-client,
    .project-orders-count {
        font-size: 0.7rem;
    }
}

.project-bar-container {
    will-change: transform;
    transform: translateZ(0);
    contain: layout style paint;
}

/* Large Screen Optimizations */
@media (min-width: 1600px) {
    .nav-container,
    .main-content,
    .footer-content {
        max-width: 1600px;
    }
    
    .container-wide {
        max-width: 1800px;
    }
    
    /* Increase padding for better spacing on large screens */
    .main-content {
        padding: 2.5rem;
    }
}

@media (min-width: 1920px) {
    .nav-container,
    .main-content,
    .footer-content {
        max-width: 1700px;
    }
    
    .container-wide {
        max-width: 1900px;
    }
    
    /* Better spacing for ultra-wide screens */
    .main-content {
        padding: 3rem;
    }
    
    /* Dashboard stats grid improvements */
    .stats-grid {
        gap: 2rem;
    }
    
    /* Table improvements for large screens */
    .orders-table th,
    .orders-table td {
        padding: 1rem 1.5rem;
    }
}

@media (min-width: 2560px) {
    .nav-container,
    .main-content,
    .footer-content {
        max-width: 2000px;
    }
    
    .container-wide {
        max-width: 2200px;
    }
    
    /* 4K display optimizations */
    .main-content {
        padding: 4rem;
    }
    
    /* Scale up fonts slightly for better readability on large displays */
    body {
        font-size: 1.1rem;
    }
    
    .page-header h1 {
        font-size: 3rem;
    }
    
    .stats-grid {
        gap: 2.5rem;
    }
}

/* Edit Mode Styles for Warehouse Operations */
.shipping-days-cell {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.shipping-days-display {
    min-width: 2rem;
    text-align: center;
}

.shipping-days-display.modified {
    color: #2A3B6B;
    font-weight: 600;
}

.shipping-days-display.unmodified {
    color: #6b7280;
}

.shipping-days-input {
    width: 4rem;
    padding: 0.25rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    text-align: center;
    font-size: 0.875rem;
}

.edit-shipping-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    font-size: 0.75rem;
}

.edit-shipping-btn:hover {
    color: #2A3B6B;
    background-color: #ecfdf5;
}

.delivery-number-cell {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    max-width: 12rem;
}

.delivery-number-display {
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
}

.delivery-number-input {
    width: 10rem;
    padding: 0.25rem;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.edit-delivery-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.edit-delivery-btn:hover {
    color: #2A3B6B;
    background-color: #ecfdf5;
}

.status-icons-cell {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex-wrap: wrap;
}

.status-icon {
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    padding: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-icon-active {
    background-color: #1E2A56;
    color: white;
    border-color: #1E2A56;
}

.status-icon-inactive {
    background-color: #f9fafb;
    color: #6b7280;
    border-color: #d1d5db;
}

.status-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-icon-active:hover {
    background-color: #2A3B6B;
}

.status-icon-inactive:hover {
    background-color: #f3f4f6;
    color: #374151;
}

.eu-export-cell {
    text-align: center;
}

.eu-export-badge {
    background-color: #dc2626;
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.eu-export-badge-no {
    background-color: #e5e7eb;
    color: #6b7280;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
}

.ship-by-date {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.ship-by-overdue {
    background-color: #fee2e2;
    color: #dc2626;
}

.ship-by-urgent {
    background-color: #fed7aa;
    color: #ea580c;
}

.ship-by-warning {
    background-color: #fef3c7;
    color: #d97706;
}

.clickable-cell {
    cursor: pointer;
}

.clickable-cell:hover {
    background-color: #f9fafb;
}

/* Add Items Modal Styles */
.add-item-row {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background-color: #f9fafb;
}

.item-fields {
    display: grid;
    grid-template-columns: 3fr 2fr 1fr 1fr auto;
    gap: 0.875rem;
    align-items: end;
}

/* Ensure fields don't overflow on larger screens */
@media (min-width: 1025px) {
    .item-fields {
        grid-template-columns: minmax(200px, 3fr) minmax(150px, 2fr) minmax(80px, 1fr) minmax(100px, 1fr) auto;
    }
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

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

.remove-item-btn {
    background-color: #ef4444;
    color: white;
    border: none;
    border-radius: 0.25rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    height: fit-content;
}

.remove-item-btn:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
}

.add-item-actions {
    margin-top: 1rem;
    text-align: center;
}

.form-control.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 1px #ef4444;
}

.article-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: white;
}

.article-checkbox:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

.article-checkbox.completed {
    background-color: #ecfdf5;
    border-color: #1E2A56;
}

.article-checkbox.completed input[type="checkbox"] {
    accent-color: #1E2A56;
}

.materials-list {
    max-height: 300px;
    overflow-y: auto;
}

/* Responsive adjustments for add items modal */
/* Tablet breakpoint: 2-column layout for better use of space */
@media (max-width: 1024px) and (min-width: 769px) {
    .item-fields {
        grid-template-columns: 2fr 1.5fr;
        gap: 0.875rem;
    }

    .field-group:nth-child(5) {
        grid-column: 2;
        justify-self: end;
    }
}

/* Mobile breakpoint: stack vertically */
@media (max-width: 768px) {
    .item-fields {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .remove-item-btn {
        align-self: center;
        margin-top: 0.5rem;
    }
}
/* Font Consistency Fixes */
input[type="date"],
input[type="datetime-local"],
input[type="time"],
textarea {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}
