/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Login Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem 1rem;
}

.login-form {
    background: white;
    padding: 2.5rem 2rem;
    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);
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-form h2 {
    text-align: center;
    margin-bottom: 1rem;
    color: #667eea;
}

.login-form h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #666;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #ffffff;
    color: #2d3748;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background-color: #f8fafc;
}

/* Stock Tabs */
.stock-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px 12px 0 0;
    padding: 0 1rem;
    overflow: hidden;
}

.stock-tab {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #4a5568;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 8px 8px 0 0;
    margin-bottom: -2px;
}

.stock-tab:hover {
    background-color: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.stock-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.stock-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

/* Stock Form Specific Input Styling */
.stock-form-container .form-group {
    margin-bottom: 1.75rem;
}

.stock-form-container .form-group label {
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stock-form-container .form-group label::after {
    content: '*';
    color: #e53e3e;
    font-weight: bold;
}

.stock-form-container .form-group input,
.stock-form-container .form-group select {
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #ffffff;
    color: #2d3748;
    width: 100%;
}

.stock-form-container .form-group input:focus,
.stock-form-container .form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background-color: #f8fafc;
    transform: translateY(-1px);
}

.stock-form-container .form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1rem;
    padding-right: 2.5rem;
    appearance: none;
}

/* Stock Form Grid Layout */
.stock-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stock-form-grid .form-group {
    margin-bottom: 0;
}

/* Stock Form Actions */
.stock-form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 2px solid #e2e8f0;
    margin-top: 2rem;
}

.stock-form-actions .btn {
    padding: 0.875rem 2rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.stock-form-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.stock-form-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.stock-form-actions .btn-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    border: none;
    color: white;
    box-shadow: 0 2px 4px rgba(245, 101, 101, 0.3);
}

.stock-form-actions .btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(245, 101, 101, 0.4);
}


/* Form Validation States */
.form-group.error input,
.form-group.error select {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.form-group.success input,
.form-group.success select {
    border-color: #48bb78;
    box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.1);
}

.form-error-message {
    color: #e53e3e;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.form-error-message::before {
    content: '⚠';
    font-size: 0.75rem;
}

/* Stock Form Icons */
.stock-form-section h3::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    margin-left: 1rem;
}

/* Add Stock Icon */
.add-stock-section h3::before {
    content: '📦';
    font-size: 1.2rem;
}

/* Remove Stock Icon */
.remove-stock-section h3::before {
    content: '📤';
    font-size: 1.2rem;
}

/* Transfer Stock Icon */
.transfer-stock-section h3::before {
    content: '🔄';
    font-size: 1.2rem;
}

/* Enhanced Button Icons */
.stock-form-actions .btn-primary::before {
    content: '✓';
    font-size: 1rem;
}

.stock-form-actions .btn-danger::before {
    content: '✕';
    font-size: 1rem;
}

/* Form Field Icons */
.form-group.has-icon {
    position: relative;
}

.form-group.has-icon input,
.form-group.has-icon select {
    padding-left: 3rem;
}

.form-group.has-icon::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    opacity: 0.6;
    z-index: 1;
}

.form-group.product-field::before {
    content: '';
}

.form-group.location-field::before {
    content: '📍';
}

.form-group.quantity-field::before {
    content: '🔢';
}

.form-group.notes-field::before {
    content: '📝';
}

/* Loading States */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success Animation */
.form-group.success input,
.form-group.success select {
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Autocomplete Styles */
.autocomplete-container {
    position: relative;
    width: 100%;
}

.autocomplete-input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #ffffff;
    color: #2d3748;
}

.autocomplete-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background-color: #f8fafc;
}

.autocomplete-input.has-selection {
    border-color: #48bb78;
    box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.1);
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background-color: #f8fafc;
    color: #667eea;
}

.autocomplete-item .product-name {
    font-weight: 600;
    color: #2d3748;
}

.autocomplete-item .category-name {
    font-size: 0.875rem;
    color: #718096;
    font-weight: 400;
}

.autocomplete-item .product-icon {
    font-size: 1.1rem;
    opacity: 0.7;
}

.autocomplete-item .stock-info {
    font-size: 0.8rem;
    color: #48bb78;
    font-weight: 600;
    margin-top: 0.25rem;
}

.autocomplete-no-results {
    padding: 1rem;
    text-align: center;
    color: #a0aec0;
    font-style: italic;
}

.autocomplete-loading {
    padding: 1rem;
    text-align: center;
    color: #667eea;
}

.autocomplete-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #667eea;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
}

/* Clear button for autocomplete */
.autocomplete-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: none;
}

.autocomplete-clear:hover {
    color: #e53e3e;
    background-color: #fed7d7;
}

.autocomplete-input:not(:placeholder-shown) + .autocomplete-clear {
    display: block;
}

/* Enhanced form group for autocomplete */
.form-group.has-autocomplete {
    position: relative;
}

.form-group.has-autocomplete .autocomplete-container {
    position: relative;
}

.form-group.has-autocomplete .autocomplete-input {
    width: 100%;
}

/* Mobile responsive for autocomplete */
@media (max-width: 768px) {
    .autocomplete-dropdown {
        max-height: 150px;
        border-radius: 0 0 6px 6px;
    }

    .autocomplete-item {
        padding: 0.625rem 0.875rem;
    }
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.btn {
    display: inline-block;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    letter-spacing: 0.025em;
}

.btn-primary {
    background-color: #667eea;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background-color: #5a67d8;
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid;
    font-weight: 500;
}

.alert-error {
    background-color: #fed7d7;
    color: #c53030;
    border: 1px solid #feb2b2;
}

/* Main Layout */
.main-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: #2d3748;
    color: white;
    padding: 1.5rem 1.25rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: transform 0.3s;
}

.sidebar.collapsed {
    transform: translateX(-250px);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    color: white;
    text-decoration: none;
    display: block;
    padding: 0.75rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: #4a5568;
}

.main-content {
    flex: 1;
    margin-left: 250px;
    transition: margin-left 0.3s;
}

.main-content.expanded {
    margin-left: 0;
}

/* Header */
.header {
    background-color: white;
    padding: 1.25rem 2.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

.header-left {
    display: flex;
    align-items: center;
}

.toggle-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    margin-right: 1rem;
    color: #4a5568;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    position: relative;
    z-index: 1001;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.toggle-btn:hover {
    background-color: rgba(74, 85, 104, 0.1);
}

.toggle-btn:active {
    background-color: rgba(74, 85, 104, 0.2);
}

.header-right {
    display: flex;
    align-items: center;
}

/* Notification Icon */
.notification-icon {
    position: relative;
    font-size: 1.5rem;
    color: #4a5568;
    text-decoration: none;
    margin-right: 1rem;
    transition: color 0.3s;
}

.notification-icon:hover {
    color: #667eea;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #e53e3e;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.user-info {
    margin-right: 1rem;
}

.logout-btn {
    background-color: #e53e3e;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
}

.logout-btn:hover {
    background-color: #c53030;
}

/* Content */
.content {
    padding: 2.5rem 2.5rem 3rem;
}

.page-title {
    margin-bottom: 2rem;
    color: #2d3748;
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 2rem 1.75rem;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 16px 0 0;
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px) scale(1.02);
}

.card-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 1rem;
    position: relative;
    overflow: hidden;
}

.card-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    opacity: 0.1;
    border-radius: 12px;
}

.card-text {
    flex: 1;
}

.card-title {
    font-size: 0.85rem;
    color: #718096;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title::before {
    content: '';
    width: 3px;
    height: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.card-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: #2d3748;
    line-height: 1;
    margin-bottom: 0.25rem;
    position: relative;
}

.card-trend {
    font-size: 0.75rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

/* Card Type Specific Styles */
.card:nth-child(1) .card-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.card:nth-child(1)::before {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.card:nth-child(2) .card-icon {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.card:nth-child(2)::before {
    background: linear-gradient(90deg, #48bb78 0%, #38a169 100%);
}

.card:nth-child(3) .card-icon {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

.card:nth-child(3)::before {
    background: linear-gradient(90deg, #4299e1 0%, #3182ce 100%);
}

.card:nth-child(4) .card-icon {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.card:nth-child(4)::before {
    background: linear-gradient(90deg, #f56565 0%, #e53e3e 100%);
}

/* Card Animations */
@keyframes cardPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.card:hover .card-icon {
    animation: cardPulse 0.6s ease-out;
}





.admin-dashboard .card:nth-child(1) .card-icon::after {
    content: '⚠️';
    position: relative;
    z-index: 1;
}

/* Card Icons - Stock Keeper Dashboard */

.stock-keeper-dashboard .card:nth-child(1) .card-icon::after {
    content: '⚠️';
    position: relative;
    z-index: 1;
}

/* Low Stock Card - Red Color Override */
.admin-dashboard .card:nth-child(1),
.stock-keeper-dashboard .card:nth-child(1) {
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
    border: 1px solid #e53e3e;
}

.admin-dashboard .card:nth-child(1) .card-icon,
.stock-keeper-dashboard .card:nth-child(1) .card-icon {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

.admin-dashboard .card:nth-child(1)::before,
.stock-keeper-dashboard .card:nth-child(1)::before {
    background: linear-gradient(90deg, #f56565 0%, #e53e3e 100%);
}

.admin-dashboard .card:nth-child(1) .card-title,
.stock-keeper-dashboard .card:nth-child(1) .card-title {
    color: #c53030;
}

.admin-dashboard .card:nth-child(1) .card-value,
.stock-keeper-dashboard .card:nth-child(1) .card-value {
    color: #e53e3e;
}

/* Notification Badge Blinking Animation */
.notification-badge {
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
        transform: scale(1);
    }
    25%, 75% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Stop blinking when notification count is 0 */
.notification-badge:empty,
.notification-badge:not([data-count]):not(:empty) {
    animation: none;
}

/* Alternative: Only blink when count > 0 */
.notification-icon .notification-badge {
    animation: none;
}

.notification-icon .notification-badge:not(:empty) {
    animation: blink 2s infinite;
}

/* Trend Indicators */
.trend-up {
    color: #38a169;
}

.trend-down {
    color: #e53e3e;
}

.trend-neutral {
    color: #718096;
}

.trend-up::before {
    content: '↗';
    font-size: 0.8rem;
}

.trend-down::before {
    content: '↘';
    font-size: 0.8rem;
}

.trend-neutral::before {
    content: '→';
    font-size: 0.8rem;
}

/* Enhanced Tables */
.table-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid #e2e8f0;
    position: relative;
    width: 100%;
    margin: 0 auto;
    display: block;
}

.table-container.dashboard-table {
    margin-bottom: 3rem;
}

/* Table Titles */
.table-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 1.5rem;
    margin-top: 2rem;
    position: relative;
}

.table-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.table-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.table-container.scrollable {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    table-layout: auto; /* Allow columns to auto-adjust based on content */
    min-width: 100%;
    max-width: 100%;
}

.table th,
.table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

/* Product name column width control */
.table th:first-child,
.table td:first-child {
    max-width: 200px; /* Maximum width to prevent too wide */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Quantity column width control - auto-adjust based on content */
.table th:nth-child(2),
.table td:nth-child(2) {
    min-width: 35px; /* Minimum width to ensure readability */
    text-align: center; /* Center quantity values */
    width: auto; /* Allow auto-sizing */
}

.table th:nth-child(3),
.table td:nth-child(3) {
    min-width: 35px; /* Minimum width to ensure readability */
    text-align: center; /* Center quantity values */
    width: auto; /* Allow auto-sizing */
}

.table th {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    font-weight: 700;
    color: #2d3748;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:nth-child(even) {
    background-color: rgba(102, 126, 234, 0.02);
}

.table tbody tr:nth-child(odd) {
    background-color: rgba(255, 255, 255, 0.5);
}

.table tbody tr:hover {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
    border-left: 3px solid #667eea;
}

/* Enhanced Status Badges */
.table .status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    white-space: nowrap;
}

.table .status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.table .status-badge.in-stock {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    color: #22543d;
    border: 1px solid #68d391;
}

.table .status-badge.in-stock::before {
    background-color: #38a169;
}

.table .status-badge.low-stock {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    color: #742a2a;
    border: 1px solid #fc8181;
}

.table .status-badge.low-stock::before {
    background-color: #e53e3e;
}

.table .status-badge.out-of-stock {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e0 100%);
    color: #2d3748;
    border: 1px solid #a0aec0;
}

.table .status-badge.out-of-stock::before {
    background-color: #4a5568;
}

/* Enhanced Typography */
.table td {
    color: #4a5568;
    font-weight: 500;
}

.table td:first-child {
    font-weight: 600;
    color: #2d3748;
}

/* Number formatting */
.table .number-cell {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-weight: 600;
    text-align: right;
    color: #2d3748;
}

/* Action buttons in tables */
.table .action-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.table .action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table .action-btn.edit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.table .action-btn.delete {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.table .action-btn.view {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

/* Table loading state */
.table-container.loading {
    position: relative;
}

.table-container.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.table-container.loading::after {
    content: 'Loading...';
    font-size: 1rem;
    color: #667eea;
    font-weight: 600;
}

/* Empty state */
.table-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #a0aec0;
}

.table-empty h3 {
    margin: 0 0 0.5rem 0;
    color: #4a5568;
    font-size: 1.25rem;
}

.table-empty p {
    margin: 0;
    font-size: 0.875rem;
}

/* Forms */
.form-container {
    background: white;
    padding: 2.5rem 2.25rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    max-width: 650px;
    margin: 0 auto;
}

/* Stock Forms Specific Styling */
.stock-form-container {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.stock-form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.stock-form-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.stock-form-section h3 {
    margin: 0 0 1.5rem 0;
    color: #2d3748;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.stock-form-section h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* Add Stock Section */
.add-stock-section h3::before {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

/* Remove Stock Section */
.remove-stock-section h3::before {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

/* Transfer Stock Section */
.transfer-stock-section h3::before {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    flex: 1;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Buttons */
.btn-secondary {
    background-color: #718096;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a67d8;
}

.btn-danger {
    background-color: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background-color: #c53030;
}

/* Filters */
.filters {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    align-items: end;
    border: 2px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

.filters::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.filter-group {
    display: flex;
    flex-direction: column;
    position: relative;
}

.filter-group label {
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label::before {
    content: '';
    width: 4px;
    height: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.filter-group select,
.filter-group input[type="text"],
.filter-group input[type="date"] {
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background-color: #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #2d3748;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-group select:focus,
.filter-group input[type="text"]:focus,
.filter-group input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15), 0 4px 8px rgba(102, 126, 234, 0.1);
    background-color: #f8fafc;
    transform: translateY(-1px);
}

.filter-group select:hover,
.filter-group input[type="text"]:hover,
.filter-group input[type="date"]:hover {
    border-color: #cbd5e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.1rem;
    padding-right: 2.75rem;
    appearance: none;
}

.filter-group input[type="date"] {
    cursor: pointer;
}

.filter-group input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.7;
    filter: invert(0.5);
}

.filters .btn {
    padding: 0.875rem 2rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    align-self: flex-end;
    font-size: 0.95rem;
    letter-spacing: 0.025em;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filters .btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.filters .btn:hover::before {
    left: 100%;
}

.filters .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.filters .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.filters .btn-secondary {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #4a5568;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filters .btn-secondary:hover {
    background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
    border-color: #cbd5e0;
    color: #2d3748;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.4), rgba(118, 75, 162, 0.4));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: modalFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(6px);
    }
}

/* Modal overlay - prevents main page scrolling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 10000; /* Higher z-index */
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto; /* Allow modal itself to scroll if needed */
    -webkit-overflow-scrolling: touch;
}

/* Prevent body scrolling when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    margin: 0 auto;
    border-radius: 20px;
    width: 100%;
    max-width: 800px;
    max-height: 98vh; /* Increased from 95vh to 98vh */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: modalSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: visible; /* Allow content to overflow for scrolling */
}

.modal-content.scrollable {
    overflow: hidden;
}

.modal-content.scrollable {
    max-height: 90vh;
    height: auto;
    min-height: 600px;
}

.modal-content.scrollable {
    max-height: 90vh;
    height: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    }
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.modal-header {
    padding: 2rem 2.5rem 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px 20px 0 0;
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    pointer-events: none;
}

.modal-header h3 {
    margin: 0;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    letter-spacing: -0.025em;
}

.close {
    color: rgba(255, 255, 255, 0.9);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-body {
    padding: 2.5rem;
    color: #4a5568;
    line-height: 1.6;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto; /* Allow body to grow and shrink */
    min-height: 200px; /* Minimum height to ensure content is visible */
    max-height: calc(90vh - 160px); /* Dynamic height based on modal size */
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f1f5f9;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.modal-body::-webkit-scrollbar {
    width: 10px;
    visibility: visible;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 5px;
    visibility: visible;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 5px;
    border: 2px solid #f1f5f9;
    visibility: visible;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
    visibility: visible;
}

/* Ensure all modals have scrolling capability */
.modal-content .modal-body {
    overflow-y: auto;
    max-height: 60vh;
}

.modal-content.scrollable .modal-body {
    overflow-y: auto;
    max-height: 70vh; /* Slightly taller for scrollable modals */
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
    border: 2px solid #f1f5f9;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Create Order Modal Specific Styles */
#createOrderModal .modal-body {
    padding: 2rem 2.5rem;
}

/* View Order Modal Specific Styles */
.view-order-modal {
    max-width: 600px;
}

.view-order-modal .modal-body {
    padding: 1.5rem;
}

.view-order-modal table {
    font-size: 0.875rem;
}

.view-order-modal table th,
.view-order-modal table td {
    padding: 0.75rem 0.5rem;
    white-space: nowrap;
}

.view-order-modal table th:nth-child(2),
.view-order-modal table td:nth-child(2) {
    text-align: right;
    width: 100px;
    min-width: 100px;
}

.view-order-modal .order-info {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.view-order-modal .order-info p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: #4a5568;
}

.view-order-modal .order-info strong {
    color: #2d3748;
    font-weight: 600;
}

.view-order-modal h4 {
    margin: 1.5rem 0 1rem 0;
    color: #2d3748;
    font-size: 1.1rem;
    font-weight: 600;
}

.view-order-modal .quantity-cell {
    font-weight: 600;
    color: #2d3748;
    text-align: center;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    margin: 0.125rem;
}

#createOrderModal h4 {
    margin: 2rem 0 1.5rem 0;
    color: #2d3748;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#createOrderModal h4::before {
    content: '🛒';
    font-size: 1.2rem;
}

#createOrderModal .productsContainer {
    margin-bottom: 2rem;
}

/* Custom scrollbar for modal body */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Modal Animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Form Styles */
.modal .form-group {
    margin-bottom: 1.75rem;
    position: relative;
}

.modal .form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: #2d3748;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal .form-group label::before {
    content: '';
    width: 4px;
    height: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.modal .form-group input,
.modal .form-group select,
.modal .form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: #ffffff;
    color: #2d3748;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.modal .form-group input:focus,
.modal .form-group select:focus,
.modal .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15), 0 4px 8px rgba(102, 126, 234, 0.1);
    background-color: #f8fafc;
    transform: translateY(-1px);
}

.modal .form-group textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

.modal .form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.1rem;
    padding-right: 2.75rem;
    appearance: none;
}

/* Product Row Styles */
.product-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    position: relative;
    transition: all 0.3s ease;
}

.product-row:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.product-row select,
.product-row input {
    margin-bottom: 0;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    background-color: white;
}

.product-row select:focus,
.product-row input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.product-row .btn-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    border: none;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(245, 101, 101, 0.3);
}

.product-row .btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(245, 101, 101, 0.4);
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

/* Enhanced Quantity Input Styling */
.quantity-input {
    text-align: center;
    font-weight: 600;
    font-size: 1.1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background-color: #ffffff;
    color: #2d3748;
    transition: all 0.3s ease;
}

.quantity-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background-color: #f8fafc;
    transform: scale(1.02);
}

.quantity-input:hover {
    border-color: #cbd5e0;
}

/* Stock Display Enhancement */
.current-stock-display {
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
    border: 2px solid #9ae6b4;
    border-radius: 8px;
    padding: 0.75rem;
    margin-top: 0.5rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.current-stock-display h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: #22543d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stock-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: #38a169;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Enhanced Add Product Button */
.add-product-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border: none;
    color: white;
    padding: 0.875rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(72, 187, 120, 0.3);
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.add-product-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(72, 187, 120, 0.4);
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

.add-product-btn::before {
    content: '+';
    font-size: 1.2rem;
    font-weight: bold;
}

/* Remove Product Button Enhancement */
.remove-product-btn {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    border: none;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(245, 101, 101, 0.3);
    min-width: 80px;
}

.remove-product-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(245, 101, 101, 0.4);
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

/* Add Product Button */
.modal .btn-secondary {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border: none;
    color: white;
    padding: 0.875rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(72, 187, 120, 0.3);
    margin-top: 1rem;
}

.modal .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(72, 187, 120, 0.4);
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

/* Modal Button Styles */
.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: auto; /* Push to bottom of flex container */
    padding: 1.5rem 2.5rem 2rem;
    border-top: 2px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    flex-shrink: 0;
}

.modal .form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding: 1.5rem 2.5rem 2rem;
    border-top: 2px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    flex-shrink: 0;
}

.modal .btn {
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    min-width: 100px;
}

.modal .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.modal .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.modal .btn-secondary {
    background-color: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.modal .btn-secondary:hover {
    background-color: #edf2f7;
    border-color: #cbd5e0;
    color: #2d3748;
}

/* Button Sizes */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab-btn:hover {
    background-color: #f7fafc;
}

.tab-btn.active {
    border-bottom-color: #667eea;
    color: #667eea;
    font-weight: 500;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Current Stock Display */
.current-stock-display {
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #666;
}

.current-stock-display h4 {
    display: inline;
    margin: 0;
    font-size: 0.8rem;
    font-weight: normal;
    color: #666;
}

.stock-value {
    font-weight: bold;
    color: #28a745;
    margin-left: 0.25rem;
}

/* Page Actions */
.page-actions {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Report Actions */
.report-actions {
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Alert Info Style */
.alert-info {
    background-color: #ebf8ff;
    color: #2c5282;
    border: 1px solid #90cdf4;
}

/* Alert Styles */
.alert-success {
    background-color: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
}

/* Status Styles */
.status-pending {
    background-color: #fef5e7;
    color: #d69e2e;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-processing {
    background-color: #bee3f8;
    color: #3182ce;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-completed {
    background-color: #c6f6d5;
    color: #38a169;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-cancelled {
    background-color: #fed7d7;
    color: #e53e3e;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.pagination a {
    text-decoration: none;
}

.pagination-info {
    margin-left: 1rem;
    color: #666;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-250px);
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1000;
        transition: transform 0.3s ease;
    }

    .sidebar:not(.collapsed) {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        transition: margin-left 0.3s ease;
    }

    .main-content.expanded {
        margin-left: 0;
    }

    .header {
        padding: 1rem 1.5rem;
        position: relative;
        z-index: 999;
    }

    .header h1 {
        font-size: 1.125rem !important;
        margin: 0;
        font-weight: 600;
    }

    .header-left h1 {
        font-size: 1rem !important;
        line-height: 1.2;
        font-weight: 600;
    }

    /* Use very small fonts for all headings on mobile */
    h1 { font-size: 1.25rem !important; font-weight: 600; }
    h2 { font-size: 1.125rem !important; font-weight: 600; }
    h3 { font-size: 1rem !important; font-weight: 600; }
    h4 { font-size: 0.875rem !important; font-weight: 500; }
    h5 { font-size: 0.8125rem !important; font-weight: 500; }
    h6 { font-size: 0.75rem !important; font-weight: 500; }

    /* Page title specific - very small */
    .page-title {
        font-size: 1.125rem !important;
        margin-bottom: 1rem;
        line-height: 1.3;
        font-weight: 600;
    }

    /* Modal headers - compact */
    .modal-header h3 {
        font-size: 1rem !important;
        font-weight: 600;
    }

    /* Form section headers - minimal */
    .stock-form-section h3 {
        font-size: 0.875rem !important;
        margin-bottom: 1rem;
        font-weight: 600;
    }

    /* Sidebar menu items - smaller */
    .sidebar-menu a {
        font-size: 0.875rem;
        padding: 0.625rem;
    }

    /* Card titles - compact */
    .card-title {
        font-size: 0.75rem !important;
        font-weight: 600;
    }

    /* Button text - smaller */
    .btn {
        font-size: 0.875rem;
        padding: 0.625rem 1.125rem;
    }

    .toggle-btn {
        display: block !important;
        position: relative !important;
        z-index: 1002 !important;
        background: rgba(255, 255, 255, 0.95) !important;
        border-radius: 8px !important;
        border: 2px solid rgba(74, 85, 104, 0.2) !important;
        margin-right: 1rem !important;
        font-size: 1.2rem !important;
        padding: 0.75rem !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
        -webkit-tap-highlight-color: transparent !important;
        touch-action: manipulation !important;
    }

    .toggle-btn:hover {
        background: rgba(255, 255, 255, 1) !important;
        border-color: rgba(74, 85, 104, 0.4) !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    }

    .toggle-btn:active {
        transform: scale(0.95) !important;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2) !important;
    }

    .content {
        padding: 1.5rem 1.25rem 2rem;
    }

    .sidebar {
        padding: 1rem;
    }

    .card {
        padding: 1.5rem 1.25rem;
    }

    .table th,
    .table td {
        padding: 0.875rem 1rem;
        white-space: nowrap; /* Prevent text wrapping */
    }

    /* Mobile product name column adjustments */
    .table th:first-child,
    .table td:first-child {
        max-width: 150px; /* Smaller max width on mobile */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        width: auto; /* Allow auto-sizing */
    }

    /* Mobile quantity column adjustments - auto-adjust based on content */
    .table th:nth-child(2),
    .table td:nth-child(2) {
        min-width: 30px; /* Minimum width for readability */
        text-align: center;
        width: auto; /* Allow auto-sizing */
    }

    .table th:nth-child(3),
    .table td:nth-child(3) {
        min-width: 30px; /* Minimum width for readability */
        text-align: center;
        width: auto; /* Allow auto-sizing */
    }

    /* Mobile table scrolling */
    .table-container {
        overflow-x: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
        max-height: 60vh; /* Allow vertical scrolling */
        width: calc(100% + 2rem); /* Account for negative margins */
    }

    .table {
        min-width: 600px; /* Ensure minimum width for horizontal scrolling */
        font-size: 0.875rem;
        width: 100%;
        table-layout: auto; /* Allow columns to auto-adjust based on content */
    }

    /* Sticky table headers for vertical scrolling */
    .table thead th {
        position: sticky;
        top: 0;
        background: #f7fafc;
        z-index: 10;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    /* Horizontal scrollbar styling */
    .table-container::-webkit-scrollbar {
        height: 8px;
    }

    .table-container::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 4px;
    }

    .table-container::-webkit-scrollbar-thumb {
        background: #cbd5e0;
        border-radius: 4px;
        border: 2px solid #f1f5f9;
    }

    .table-container::-webkit-scrollbar-thumb:hover {
        background: #a0aec0;
    }

    /* Vertical scrollbar styling */
    .table-container::-webkit-scrollbar:vertical {
        width: 8px;
    }

    .table-container::-webkit-scrollbar-track:vertical {
        background: #f1f5f9;
        border-radius: 4px;
    }

    .table-container::-webkit-scrollbar-thumb:vertical {
        background: #cbd5e0;
        border-radius: 4px;
        border: 2px solid #f1f5f9;
    }

    .table-container::-webkit-scrollbar-thumb:vertical:hover {
        background: #a0aec0;
    }

    .form-container {
        padding: 1.75rem 1.5rem;
    }

    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
    }

    .alert {
        padding: 0.875rem 1rem;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card {
        padding: 1.5rem 1.25rem;
    }

    .card-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .card-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
        margin-right: 0;
        margin-bottom: 0.5rem;
    }

    .card-value {
        font-size: 2rem;
    }

    .card-title {
        justify-content: center;
        font-size: 0.8rem;
    }

    .form-row {
        flex-direction: column;
    }

    .stock-form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stock-form-section {
        padding: 1.5rem;
    }

    .stock-form-section h3 {
        font-size: 1.1rem;
        margin-bottom: 1.25rem;
    }

    .stock-form-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .stock-form-actions .btn {
        width: 100%;
        min-width: auto;
    }

    .current-stock-display {
        padding: 1.25rem;
    }

    .current-stock-display h4 {
        font-size: 1rem;
    }

    .current-stock-display .stock-value {
        font-size: 1.5rem;
    }

    .modal-content {
        margin: 1% auto;
        width: 95%;
        max-width: 95vw;
        max-height: 99vh; /* Increased from 98vh to 99vh for mobile */
        border-radius: 12px;
    }

    .modal-content.scrollable {
        max-height: 95vh;
    }

    .modal-header {
        padding: 1.5rem 2rem;
    }

    .modal-header h3 {
        font-size: 1.25rem;
    }

    .modal-body {
        padding: 1.5rem 2rem;
        flex: 1 1 auto; /* Allow body to grow and shrink */
        min-height: 150px; /* Minimum height for mobile */
        max-height: calc(95vh - 160px); /* Adjusted for mobile with more space */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on mobile */
    }

    .modal-body::-webkit-scrollbar {
        width: 6px;
    }

    .modal-body::-webkit-scrollbar-thumb {
        background: #a0aec0;
        border-radius: 3px;
    }

    .modal .form-actions {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1.5rem 2rem 2rem;
        background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
        border-top: 2px solid #e2e8f0;
        margin-top: 2rem;
        position: static;
    }

    /* View Order Modal Mobile Styles */
    .view-order-modal {
        width: 95vw;
        max-width: 95vw;
    }

    .view-order-modal .modal-body {
        padding: 1rem;
        max-height: 70vh;
        overflow-y: auto;
    }

    .view-order-modal table {
        font-size: 0.8rem;
        
    }

    .view-order-modal table th,
    .view-order-modal table td {
        padding: 0.5rem 0.25rem;
        
    }

    .view-order-modal table th:nth-child(2),
    .view-order-modal table td:nth-child(2) {
       
        text-align: left;
        font-weight: 600;
    }

    .view-order-modal .order-info {
        padding: 0.75rem;
        margin-bottom: 1rem;
    }

    .view-order-modal .order-info p {
        font-size: 0.8rem;
        margin: 0.25rem 0;
    }

    .view-order-modal h4 {
        font-size: 1rem;
        margin: 1rem 0 0.75rem 0;
    }

    .view-order-modal .quantity-cell {
        font-size: 0.8rem;
        padding: 0.125rem 0.25rem;
        width: 20px;
    }

    .modal .btn {
        width: 100%;
        min-width: auto;
        padding: 0.875rem 1.5rem;
    }

    /* Mobile Product Row Styles */
    .product-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1rem;
    }

    .product-row .btn-danger {
        align-self: center;
        width: 100%;
        margin-top: 0.5rem;
    }

    #createOrderModal h4 {
        font-size: 1.1rem;
        margin: 1.5rem 0 1rem 0;
    }

    .filters {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding: 1.5rem;
    }

    .filter-group {
        min-width: 100%;
    }

    .filters .btn {
        width: 100%;
        margin-top: 0.5rem;
        align-self: stretch;
        justify-content: center;
    }

    .filter-group label {
        font-size: 0.85rem;
    }

    .filter-group select,
    .filter-group input[type="text"],
    .filter-group input[type="date"] {
        padding: 0.75rem 0.875rem;
        font-size: 0.95rem;
    }

    .pagination {
        justify-content: center;
    }

    .pagination-info {
        margin-left: 0;
        margin-top: 0.5rem;
        width: 100%;
        text-align: center;
    }
}

/* Products List Styles */
.products-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.product-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.product-name {
    font-weight: 600;
    color: #2d3748;
    flex: 1;
    margin-right: 1rem;
}

.product-quantity {
    font-weight: 500;
    color: #48bb78;
    background: rgba(72, 187, 120, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid rgba(72, 187, 120, 0.2);
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Mobile styles for products list */
@media (max-width: 768px) {
    .products-list {
        gap: 0.5rem;
    }

    .product-item {
        padding: 0.75rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .product-name {
        margin-right: 0;
        margin-bottom: 0.25rem;
    }

    .product-quantity {
        align-self: flex-end;
        font-size: 0.85rem;
        padding: 0.2rem 0.6rem;
    }
}

/* Table spacer for spacing between table containers */
.table-spacer {
    height: 2rem; /* Adjust this value to control spacing */
    width: 100%;
}

/* Section titles for table containers */
.section-title {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
    margin-top: 2rem;
    position: relative;
}

.section-title:first-of-type {
    margin-top: 0;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* Mobile styles for section titles */
@media (max-width: 768px) {
    .section-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
        margin-top: 1.5rem;
    }

    .section-title::after {
        width: 40px;
        height: 2px;
        bottom: -0.375rem;
    }
}

/* Enhanced Issue Button Styling */
.btn-issue {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(72, 187, 120, 0.3);
    position: relative;
    overflow: hidden;
    min-width: 70px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.btn-issue::before {
    content: '📦';
    font-size: 0.875rem;
}

.btn-issue:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

.btn-issue:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(72, 187, 120, 0.3);
}

.btn-issue::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-issue:hover::after {
    left: 100%;
}
/* Mobile styles for issue button */
@media (max-width: 768px) {
    .btn-issue {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
        min-width: 60px;
    }

    .btn-issue::before {
        font-size: 0.8rem;
    }
}

/* Location Checkboxes Styling - Enhanced */
.location-checkboxes {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    max-height: 200px !important;
    overflow-y: auto !important;
    padding: 1rem !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 8px !important;
    background-color: #f8fafc !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

.checkbox-label {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.75rem !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    color: #4a5568 !important;
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    margin-bottom: 0 !important;
}

.checkbox-label:hover {
    background-color: rgba(102, 126, 234, 0.05) !important;
    border-color: #667eea !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15) !important;
    transform: translateY(-1px) !important;
}

.checkbox-label input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    accent-color: #667eea !important;
    cursor: pointer !important;
    border: 2px solid #cbd5e0 !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

.checkbox-label input[type="checkbox"]:checked {
    background-color: #667eea !important;
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
}

.checkbox-label input[type="checkbox"]:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
}

/* Scrollbar for location checkboxes */
.location-checkboxes::-webkit-scrollbar {
    width: 6px;
}

.location-checkboxes::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.location-checkboxes::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
    border: 1px solid #f1f5f9;
}

.location-checkboxes::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Location selection help text */
.form-help {
    display: block !important;
    margin-top: 0.5rem !important;
    font-size: 0.875rem !important;
    color: #718096 !important;
    font-style: italic !important;
    padding-left: 0.25rem !important;
}

/* Checkbox text styling */
.checkbox-text {
    flex: 1 !important;
    cursor: pointer !important;
    user-select: none !important;
    line-height: 1.4 !important;
}

/* Location selection styling - final version */
.location-checkboxes {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    max-height: 200px !important;
    overflow-y: auto !important;
    padding: 1rem !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 8px !important;
    background-color: #f8fafc !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

.checkbox-label {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.75rem !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    color: #4a5568 !important;
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    margin-bottom: 0 !important;
}

.checkbox-label:hover {
    background-color: rgba(102, 126, 234, 0.05) !important;
    border-color: #667eea !important;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15) !important;
    transform: translateY(-1px) !important;
}

.checkbox-label input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    accent-color: #667eea !important;
    cursor: pointer !important;
    border: 2px solid #cbd5e0 !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

.checkbox-label input[type="checkbox"]:checked {
    background-color: #667eea !important;
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
}

.checkbox-label input[type="checkbox"]:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
}

/* Enhanced location selection area */
.location-checkboxes:empty::after {
    content: 'No locations available';
    display: block;
    text-align: center;
    color: #a0aec0;
    font-style: italic;
    padding: 2rem;
}

/* Invoice Items Styles */
.invoice-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.invoice-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
    padding: 1.25rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.invoice-row:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.invoice-row .product-field,
.invoice-row .quantity-field,
.invoice-row .min-quantity-field,
.invoice-row .actions-field {
    display: flex;
    flex-direction: column;
}

.invoice-row label {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.invoice-row .autocomplete-container {
    width: 100%;
}

.invoice-row .quantity-input,
.invoice-row .min-quantity-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    background-color: #ffffff;
    color: #2d3748;
}

.invoice-row .quantity-input:focus,
.invoice-row .min-quantity-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background-color: #f8fafc;
}

.invoice-row .btn-danger {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(245, 101, 101, 0.3);
    align-self: flex-end;
}

.invoice-row .btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(245, 101, 101, 0.4);
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

/* Add Product Button */
.add-row-actions {
    margin-top: 1rem;
    text-align: center;
}

.add-row-actions .btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border: none;
    color: white;
    padding: 0.875rem 2rem;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(72, 187, 120, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.add-row-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(72, 187, 120, 0.4);
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

.add-row-actions .btn::before {
    content: '+';
    font-size: 1.2rem;
    font-weight: bold;
}

/* Modal product items */
.product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.product-name {
    font-weight: 600;
    color: #2d3748;
}

.product-quantity {
    font-weight: 500;
    color: #48bb78;
    background: rgba(72, 187, 120, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid rgba(72, 187, 120, 0.2);
}

/* Mobile styles for invoice items */
@media (max-width: 768px) {
    .invoice-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1rem;
    }

    .invoice-row .product-field,
    .invoice-row .quantity-field,
    .invoice-row .min-quantity-field,
    .invoice-row .actions-field {
        grid-column: 1;
    }

    .invoice-row .btn-danger {
        align-self: center;
        width: 100%;
        margin-top: 0.5rem;
    }

    .invoice-row .quantity-input,
    .invoice-row .min-quantity-input {
        padding: 0.625rem;
        font-size: 0.9rem;
    }

    .add-row-actions .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    .product-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .product-name {
        margin-bottom: 0.25rem;
    }

    .product-quantity {
        align-self: flex-end;
    }
}

/* Mobile styles for location checkboxes */
@media (max-width: 768px) {
    .location-checkboxes {
        max-height: 150px;
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .checkbox-label {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .checkbox-label input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }

    .form-help {
        font-size: 0.8rem;
        margin-top: 0.375rem;
    }
}

/* Low Stock Card Styling */
.low-stock-card {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%) !important;
    border: 2px solid #e53e3e !important;
    box-shadow: 0 4px 6px rgba(229, 62, 62, 0.1);
}

.low-stock-card .card-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #c53030;
}

.low-stock-card .card-title {
    color: #742a2a;
    font-weight: 600;
}

.low-stock-card .card-icon::before {
    content: '🚨';
}

  