/* Mobile-First Event Rental System Styles */

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

html {
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
    overflow-x: hidden;
    padding-bottom: 80px; /* Space for bottom nav */
}

body.nav-open {
    overflow: hidden;
}

/* Mobile Header */
.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
}

.app-title {
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    text-align: center;
    margin: 0 16px;
}

.menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 1px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-name {
    font-size: 12px;
    opacity: 0.9;
}

.admin-indicator {
    background: #ef4444;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

/* Mobile Navigation */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.mobile-nav.active {
    visibility: visible;
    opacity: 1;
}

.nav-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.nav-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: white;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
}

.mobile-nav.active .nav-content {
    transform: translateX(0);
}

.nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.nav-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
}

.nav-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #e2e8f0;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    color: #64748b;
}

.nav-sections {
    flex: 1;
    overflow-y: auto;
    padding: 0 0 20px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section h3 {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    padding: 0 20px 8px;
    margin-top: 16px;
    letter-spacing: 0.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: #374151;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.nav-item.logout {
    color: #ef4444;
}

.nav-icon {
    width: 24px;
    font-size: 16px;
    margin-right: 12px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-top: 60px;
    min-height: calc(100vh - 140px);
    padding: 16px;
}

/* Flash Messages */
.flash-container {
    position: fixed;
    top: 70px;
    right: 16px;
    z-index: 1500;
    max-width: calc(100vw - 32px);
}

.flash-message {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateX(100%);
    animation: slideIn 0.3s ease forwards;
    max-width: 320px;
}

.flash-success {
    background: #dcfce7;
    color: #166534;
    border-left: 4px solid #22c55e;
}

.flash-error {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.flash-text {
    flex: 1;
    font-size: 14px;
}

.flash-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    margin-left: 8px;
    opacity: 0.7;
    width: 24px;
    height: 24px;
}

@keyframes slideIn {
    to { transform: translateX(0); }
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 900;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #64748b;
    font-size: 12px;
    padding: 8px 4px;
    min-width: 44px;
    transition: all 0.2s ease;
    border: none;
    background: none;
    cursor: pointer;
}

.bottom-nav-item.active {
    color: #2563eb;
}

.bottom-nav-item.primary {
    background: #2563eb;
    color: white;
    border-radius: 12px;
    padding: 8px 12px;
}

.bottom-nav-icon {
    font-size: 18px;
    margin-bottom: 2px;
}

.bottom-nav-label {
    font-size: 10px;
    font-weight: 500;
}

/* Cards and Containers */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 16px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #1e293b;
}

.card-body {
    padding: 20px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row {
    display: grid;
    gap: 16px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    gap: 8px;
    font-size: 14px;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #64748b;
    color: white;
}

.btn-success {
    background: #22c55e;
    color: white;
}

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

.btn-small {
    padding: 8px 12px;
    font-size: 12px;
    min-height: 36px;
}

.btn-full {
    width: 100%;
}

/* Touch feedback */
.touch-active {
    transform: scale(0.98);
    opacity: 0.8;
}

/* Tables - Mobile optimized */
.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 16px;
}

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

.table th {
    background: #f8fafc;
    padding: 12px 8px;
    font-weight: 600;
    color: #374151;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.table td {
    padding: 12px 8px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.table tr:hover {
    background: #f8fafc;
}

/* Mobile-specific table cards */
.table-cards {
    display: none;
}

/* Statistics Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
    border-left: 4px solid #2563eb;
}

.stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
    color: white;
}

.stat-label {
    font-size: 14px;
    opacity: 1;
    color: white;
}

/* Analytics Charts */
.chart-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.chart-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1e293b;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 12px;
    margin-bottom: 16px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #64748b;
}

.empty-text {
    color: #94a3b8;
    margin-bottom: 20px;
}

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 50%;
    border-top-color: #2563eb;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile-Friendly Order Form Styles */
.order-form-container {
    padding: 16px;
    max-width: 100%;
}

.page-header {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.page-header h2 {
    margin: 0;
    color: #1e293b;
    font-size: 20px;
}

.form-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    margin: 0 0 16px 0;
    color: #1e293b;
    font-size: 18px;
    font-weight: 600;
}

/* Product Form Section */
.product-form-section {
    margin-bottom: 32px;
}

.add-product-form {
    background: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
    margin-bottom: 24px;
}

/* Order Items List */
.order-items-section {
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.section-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.items-count {
    background: #2563eb;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.order-items-list {
    max-height: 400px;
    overflow-y: auto;
}

.order-item {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s;
}

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

.order-item:hover {
    background: #f8fafc;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.item-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 16px;
}

.item-remove {
    width: 32px;
    height: 32px;
    border: none;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.item-remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.item-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.item-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.detail-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.subtotal {
    font-weight: 600;
    color: #059669;
    font-family: monospace;
    padding: 8px 12px;
    background: #f0fdfa;
    border-radius: 6px;
    text-align: center;
}

/* Order Total Section */
.order-total-section {
    padding: 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-label {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.total-amount {
    font-size: 24px;
    font-weight: bold;
    color: #2563eb;
    font-family: monospace;
}

/* Empty state for order items */
.order-items-list:empty::after {
    content: "No items added yet. Add products above to get started.";
    display: block;
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
    font-style: italic;
}

/* Mobile responsiveness for order items */
@media (max-width: 480px) {
    .item-details {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .item-detail:nth-child(3) {
        grid-column: 1 / -1;
    }
    
    .order-form-container {
        padding: 12px;
    }
    
    .add-product-form {
        padding: 16px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .total-row {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .total-amount {
        font-size: 28px;
    }
}

/* Add Order Form - Mobile Fixes */
@media (max-width: 768px) {
    .order-form-container {
        padding: 12px;
    }
    
    .form-card {
        padding: 16px;
    }
    
    /* Products table mobile optimization */
    .products-table-container {
        overflow-x: auto;
        margin: 0 -16px; /* Extend to edges */
        padding: 0 16px;
    }
    
    .products-table {
        min-width: 600px; /* Force horizontal scroll */
        font-size: 14px;
    }
    
    .products-table th,
    .products-table td {
        padding: 8px 4px;
        min-width: 80px;
    }
    
    /* Product name column */
    .products-table th:nth-child(1),
    .products-table td:nth-child(1) {
        min-width: 150px;
    }
    
    /* Input fields in table */
    .products-table input {
        font-size: 14px;
        padding: 6px;
        min-height: 36px;
    }
    
    /* Datalist dropdown */
    .products-table input[list] {
        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 8l4 4 4-4'/%3e%3c/svg%3e");
        background-position: right 8px center;
        background-repeat: no-repeat;
        background-size: 16px;
        padding-right: 32px;
    }
    
    /* Button adjustments */
    .btn-small {
        padding: 4px 8px;
        font-size: 11px;
        min-height: 32px;
    }
    
    /* Products header */
    .products-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    /* Total row */
    .total-row th,
    .total-row td {
        font-size: 16px;
        font-weight: bold;
    }
    
    /* Form actions */
    .form-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* Very small screens - keep table but make it more scrollable */
@media (max-width: 480px) {
    .products-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .products-table {
        min-width: 500px; /* Smaller minimum for very small screens */
    }
    
    /* Hide mobile card form - we'll keep using the table */
    .mobile-products-form {
        display: none;
    }
    
    .product-card {
        background: #f8fafc;
        padding: 16px;
        margin-bottom: 16px;
        border-radius: 8px;
        border: 1px solid #e2e8f0;
    }
    
    .product-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
    }
    
    .product-card-title {
        font-weight: 600;
        color: #374151;
    }
    
    .product-fields {
        display: grid;
        gap: 12px;
    }
    
    .product-subtotal {
        text-align: right;
        font-weight: bold;
        color: #059669;
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid #d1d5db;
    }
}

/* Responsive breakpoints */
@media (max-width: 480px) {
    .main-content {
        padding: 12px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .table {
        min-width: 500px;
    }
    
    /* Show card view for tables on very small screens */
    .table-responsive .table {
        display: none;
    }
    
    .table-responsive .table-cards {
        display: block;
    }
    
    .table-card {
        background: white;
        padding: 16px;
        margin-bottom: 12px;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        border-left: 4px solid #2563eb;
    }
    
    .table-card-header {
        font-weight: 600;
        margin-bottom: 8px;
        color: #1e293b;
    }
    
    .table-card-row {
        display: flex;
        justify-content: space-between;
        margin-bottom: 4px;
        font-size: 14px;
    }
    
    .table-card-label {
        color: #64748b;
        font-size: 12px;
    }
}

/* Desktop Navigation Styles */
.desktop-header {
    display: none; /* Hidden by default (mobile-first) */
    background: white;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.desktop-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.desktop-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.desktop-nav > a {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.desktop-nav > a:hover {
    background: #f1f5f9;
    color: #2563eb;
}

/* Desktop Dropdown Navigation */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-label {
    color: #64748b;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.nav-dropdown:hover .nav-dropdown-label {
    background: #f1f5f9;
    color: #2563eb;
}

.nav-dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    min-width: 160px;
    z-index: 1100;
}

.nav-dropdown:hover .nav-dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-content a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 6px;
    margin: 4px;
}

.nav-dropdown-content a:hover {
    background: #f3f4f6;
    color: #2563eb;
}

.desktop-user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.desktop-user-info .user-name {
    font-weight: 600;
    color: #1e293b;
}

.desktop-user-info .admin-indicator {
    background: #ef4444;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.desktop-user-info .user-link {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.desktop-user-info .user-link:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.desktop-user-info .logout-link {
    text-decoration: none;
    color: #ef4444;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.desktop-user-info .logout-link:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Order Detail Page Styles - Status Controls Fix */
.order-detail-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.order-header {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.status-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

/* Mobile fixes for status controls */
@media (max-width: 768px) {
    .order-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .status-controls {
        justify-content: center;
        gap: 6px;
        width: 100%;
    }
    
    .status-controls .btn {
        font-size: 12px;
        padding: 8px 12px;
        flex: 1;
        min-width: 0;
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    .status-controls {
        flex-direction: column;
        gap: 8px;
    }
    
    .status-controls .btn {
        width: 100%;
        max-width: 200px;
    }
    
    .order-detail-container {
        padding: 12px;
    }
}

/* Tablet and Desktop (Progressive Enhancement) */
@media (min-width: 768px) {
    body {
        padding-bottom: 0;
    }
    
    /* Show desktop header, hide mobile elements */
    .desktop-header {
        display: block !important;
    }
    
    .mobile-header {
        display: none !important;
    }
    
    .bottom-nav {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
        padding: 24px;
        max-width: 1400px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .mobile-nav {
        display: none !important;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .form-row {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .flash-container {
        top: 24px;
        right: 24px;
    }
    
    /* Desktop status controls fix */
    .status-controls {
        max-width: 500px;
        gap: 6px;
    }
    
    .status-controls .btn {
        font-size: 12px;
        padding: 6px 12px;
        min-width: 90px;
        white-space: nowrap;
    }
}

/* Success Modal Styles */
.success-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.success-modal {
    background: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    max-width: 400px;
    margin: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.success-modal h3 {
    margin: 0 0 8px 0;
    color: #1f2937;
    font-size: 20px;
}

.success-modal p {
    margin: 0 0 24px 0;
    color: #6b7280;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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


@media (max-width: 480px) {
    .modal-actions {
        flex-direction: column;
    }
    
    .success-modal {
        margin: 16px;
        padding: 24px;
    }
}

@media (max-width: 768px) {
    #product_select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 16px 12px;
        background-image: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'><path fill='%23666' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/></svg>");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 16px;
        -webkit-appearance: none;
        appearance: none;
    }
}

.maintenance-options {
    background: #fff3cd;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ffeaa7;
    margin-top: 20px;
    text-align: center;
}

.maintenance-options h4 {
    margin-bottom: 10px;
    color: #856404;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
    border: 1px solid #ffc107;
}

.btn-warning:hover {
    background-color: #e0a800;
    border-color: #d39e00;
}


/* Loading States */
.loading-overlay {
    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: 1000;
    border-radius: 12px;
}

.loading-spinner-large {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-radius: 50%;
    border-top-color: #2563eb;
    animation: spin 1s ease-in-out infinite;
}

.loading-text {
    margin-left: 12px;
    color: #64748b;
    font-weight: 500;
}
