/* ============================================
   ORDER IMPORT MANAGEMENT DASHBOARD
   Complete Styles
============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f0f2f5;
    color: var(--gray-800);
}

/* ============================================
   DASHBOARD CONTAINER
============================================ */
.dashboard-container {
    min-height: 100vh;
    background: #f0f2f5;
}

/* ============================================
   NAVIGATION BAR
============================================ */
.nav-bar {
    background: white;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

.nav-logo i {
    font-size: 24px;
}

.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-item {
    padding: 8px 16px;
    text-decoration: none;
    color: var(--gray-600);
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.nav-profile:hover {
    background: var(--gray-100);
}

.nav-profile i:first-child {
    font-size: 24px;
    color: var(--gray-500);
}

/* ============================================
   KPI CARDS
============================================ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 24px;
}

.kpi-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: all 0.2s;
    border: 1px solid var(--gray-200);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.kpi-icon.blue {
    background: #eff6ff;
    color: #3b82f6;
}

.kpi-icon.orange {
    background: #fff7ed;
    color: #f97316;
}

.kpi-icon.red {
    background: #fef2f2;
    color: #ef4444;
}

.kpi-icon.green {
    background: #ecfdf5;
    color: #10b981;
}

.kpi-info {
    flex: 1;
}

.kpi-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--gray-800);
    line-height: 1;
}

.kpi-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
}

.kpi-sub {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 2px;
}

/* ============================================
   CARD
============================================ */
.card {
    background: white;
    border-radius: 16px;
    margin: 0 24px 24px 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--gray-200);
    background: white;
}

.card-title {
    font-weight: 700;
    font-size: 18px;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: var(--primary);
    font-size: 20px;
}

.card-actions {
    display: flex;
    gap: 12px;
}

/* ============================================
   BUTTONS
============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-outline {
    background: white;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 11px;
}

/* ============================================
   DATA TABLE
============================================ */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 14px 16px;
    background: var(--gray-50);
    font-weight: 600;
    font-size: 12px;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
}

.data-table td {
    padding: 14px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.data-table tr:hover {
    background: var(--gray-50);
}

/* ============================================
   STATUS BADGES
============================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-success {
    background: #ecfdf5;
    color: #065f46;
}

.status-warning {
    background: #fffbeb;
    color: #92400e;
}

.status-danger {
    background: #fef2f2;
    color: #991b1b;
}

.status-info {
    background: #eff6ff;
    color: #1e40af;
}

/* Pipeline Steps */
.pipeline-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pipeline-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.pipeline-step i {
    width: 16px;
    font-size: 10px;
}

.pipeline-step.completed {
    color: var(--success);
}

.pipeline-step.active {
    color: var(--primary);
}

.pipeline-step.pending {
    color: var(--gray-400);
}

.pipeline-step.error {
    color: var(--danger);
}

/* Priority Badges */
.priority-rush {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.priority-standard {
    background: #e0f2fe;
    color: #075985;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

/* Print Suite Links */
.print-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.print-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--gray-100);
    border-radius: 6px;
    font-size: 11px;
    text-decoration: none;
    color: var(--gray-700);
    transition: all 0.2s;
}

.print-link:hover {
    background: var(--gray-200);
}

.print-link.conflict {
    background: #fef2f2;
    color: #991b1b;
}

.print-link.error {
    background: #fef2f2;
    color: #991b1b;
    text-decoration: line-through;
}

/* ============================================
   MODALS
============================================ */
.modal {
    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: 1000;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}

.modal-md { width: 500px; }
.modal-lg { width: 750px; }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-400);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: var(--gray-50);
}

/* Form Elements */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 13px;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-text {
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* Scan Results */
.scan-results {
    margin-top: 16px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
}

.info-title {
    padding: 10px 12px;
    background: var(--gray-50);
    font-weight: 600;
    font-size: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.files-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-bottom: 1px solid var(--gray-100);
}

.file-item:last-child {
    border-bottom: none;
}

.file-item input {
    margin: 0;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.info-section {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
}

.info-section-title {
    background: var(--gray-50);
    padding: 10px 12px;
    font-weight: 600;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-200);
}

.info-section-content {
    padding: 12px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--gray-100);
}

.info-label {
    font-weight: 500;
    color: var(--gray-600);
}

.info-value {
    color: var(--gray-800);
}

.items-list {
    max-height: 300px;
    overflow-y: auto;
}

.item-card {
    padding: 10px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    margin-bottom: 8px;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 12px;
    color: var(--gray-500);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: white;
    padding: 14px 18px;
    border-radius: 10px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    border-left-color: var(--success);
}
.toast-success i:first-child {
    color: var(--success);
}

.toast-error {
    border-left-color: var(--danger);
}
.toast-error i:first-child {
    color: var(--danger);
}

.toast-warning {
    border-left-color: var(--warning);
}
.toast-warning i:first-child {
    color: var(--warning);
}

.toast-info {
    border-left-color: var(--info);
}
.toast-info i:first-child {
    color: var(--info);
}

/* Responsive */
@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .card {
        margin: 0 16px 16px 16px;
    }

    .card-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* Action Bar */
.action-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 0 4px;
}

.btn-primary {
    background: #2563eb;
    color: white;
    border: none;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-outline {
    background: white;
    border: 1px solid #e2e8f0;
    color: #1e293b;
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}