* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary: #667eea;
    --primary-dark: #5568d3;
    --primary-light: #7c8ff0;
    --secondary: #764ba2;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Urgency Colors */
    --very-urgent: #dc2626;
    --high-urgent: #f97316;
    --medium-urgent: #eab308;

    /* Neutrals */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #334155;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-very-urgent: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    --gradient-high: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    --gradient-medium: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Heebo', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-icon {
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-lg);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-badge {
    background: var(--bg-tertiary);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.stat-badge.urgent {
    background: rgba(220, 38, 38, 0.1);
    border-color: var(--very-urgent);
}

.stat-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.stat-value {
    color: var(--primary-light);
    font-weight: 700;
    font-size: 1.25rem;
}

.stat-badge.urgent .stat-value {
    color: var(--very-urgent);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Action Bar */
.action-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-family: 'Heebo', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
}

.btn-success {
    background: var(--gradient-success);
    color: white;
}

.btn-danger {
    background: var(--gradient-danger);
    color: white;
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Form Elements */
input[type="text"],
input[type="tel"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Heebo', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-select {
    min-width: 180px;
}

/* Image Upload */
.image-upload-container {
    position: relative;
}

input[type="file"] {
    display: none;
}

.upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-tertiary);
    border: 2px dashed var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.upload-label:hover {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.upload-text {
    color: var(--text-secondary);
    text-align: center;
}

.image-preview {
    margin-top: 1rem;
    display: none;
}

.image-preview.show {
    display: block;
}

.preview-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.remove-image {
    margin-top: 0.5rem;
    background: var(--gradient-danger);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Heebo', sans-serif;
    font-weight: 600;
    transition: var(--transition);
}

.remove-image:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Orders Container */
.orders-container {
    display: grid;
    gap: 1.5rem;
}

.order-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: var(--transition);
    animation: slideIn 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.order-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    background: var(--primary);
}

.order-card.urgency-very-urgent::before {
    background: var(--gradient-very-urgent);
}

.order-card.urgency-high::before {
    background: var(--gradient-high);
}

.order-card.urgency-medium::before {
    background: var(--gradient-medium);
}

.order-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.order-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.order-number {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.order-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.order-status,
.urgency-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    min-width: 100px;
}

.status-pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.status-processing {
    background: rgba(59, 130, 246, 0.2);
    color: var(--info);
    border: 1px solid var(--info);
}

.status-completed {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-cancelled {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.urgency-very-urgent {
    background: rgba(220, 38, 38, 0.2);
    color: var(--very-urgent);
    border: 1px solid var(--very-urgent);
    animation: blink 1.5s ease-in-out infinite;
}

.urgency-high {
    background: rgba(249, 115, 22, 0.2);
    color: var(--high-urgent);
    border: 1px solid var(--high-urgent);
}

.urgency-medium {
    background: rgba(234, 179, 8, 0.2);
    color: var(--medium-urgent);
    border: 1px solid var(--medium-urgent);
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.order-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

.detail-value.low-stock {
    color: var(--danger);
}

.detail-value.missing {
    color: var(--warning);
}

.order-image {
    margin-bottom: 1rem;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.order-image:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.order-image img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
}

.order-notes {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-right: 3px solid var(--info);
}

.notes-label {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.notes-text {
    color: var(--text-secondary);
}

.order-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    display: none;
}

.empty-state.show {
    display: block;
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h2 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    max-width: 600px;
    margin: 2rem auto;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 10;
}

.modal-header h2 {
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    background: var(--bg-secondary);
}

/* Image Viewer Modal */
.image-viewer-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    margin: 5vh auto;
    animation: slideDown 0.3s ease-out;
}

.image-viewer-content img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
}

.image-viewer-content .modal-close {
    position: absolute;
    top: -50px;
    left: 0;
    background: var(--bg-secondary);
    color: white;
    width: 50px;
    height: 50px;
    font-size: 2rem;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(200px);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 1rem 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    z-index: 2000;
    transition: transform 0.3s ease-out;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-stats {
        width: 100%;
        justify-content: space-between;
    }

    .action-bar {
        flex-direction: column;
    }

    .search-box {
        width: 100%;
        min-width: auto;
    }

    .filter-select {
        width: 100%;
        min-width: auto;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .order-details {
        grid-template-columns: 1fr;
    }

    .order-header {
        flex-direction: column;
    }

    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
    }

    .logo h1 {
        font-size: 1.2rem;
    }

    .container {
        padding: 1rem;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}