/* ========================================
   INSPECTION ROUTING - WORKFLOW STYLES
   ======================================== */

/* Page Header */
.page-header {
    background: var(--nm-card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
}

    .page-header .header-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

/* FIX: Override site.css text-muted with !important */
.page-header .page-subtitle {
    font-size: 1rem;
    color: var(--nm-text-muted) !important;
    margin: 0.5rem 0 0 0;
}

.header-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
}

    .status-badge.validated {
        background-color: #10b981;
        color: white;
    }

    .status-badge.draft {
        background-color: #f59e0b;
        color: white;
    }

.record-count {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

/* Workflow Card */
.workflow-card {
    background: var(--nm-card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.workflow-header {
    background: var(--nm-primary);
    padding: 1.5rem 2rem;
    color: white;
}

    .workflow-header h3 {
        margin: 0;
        font-size: 1.5rem;
        font-weight: 600;
    }

.workflow-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    padding: 0;
}

.workflow-step {
    padding: 2rem;
    border-right: 1px solid #e5e7eb;
    position: relative;
    background: var(--nm-bg);
    transition: all 0.3s ease;
}

    .workflow-step:last-child {
        border-right: none;
    }

    .workflow-step.active {
        background: var(--nm-card-bg);
        border-left: 4px solid #4f46e5;
    }

        .workflow-step.active .step-number {
            background: var(--nm-primary);
            color: white;
        }

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.step-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #111827;
}

.step-content p {
    color: #6b7280;
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
}

/* File Upload Zone */
.file-upload-zone {
    margin-top: 1rem;
}

    .file-upload-zone .badge {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

/* Progress Card */
.progress-card {
    background: var(--nm-card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.progress-count {
    font-weight: 600;
    color: #4f46e5;
}

.progress {
    height: 24px;
    border-radius: 12px;
    background-color: #e5e7eb;
}

.progress-bar {
    border-radius: 12px;
}

/* Data Grid Container */
.data-grid-container {
    background: var(--nm-card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Grid header */
.grid-header {
    background: var(--nm-primary);
    padding: 1.5rem 2rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .grid-header h3 {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 600;
        color: white !important;
    }

.grid-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.table-wrapper {
    overflow-x: auto;
    max-height: 600px;
}

.data-table {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
}

    /* FIX: Make table headers dark with white text for visibility */
    .data-table thead {
        position: sticky;
        top: 0;
        z-index: 10;
        background: #1e293b;
    }

    .data-table th {
        background: #1e293b;
        padding: 1rem;
        text-align: left;
        font-weight: 600;
        font-size: 0.875rem;
        color: white !important;
        border-bottom: 2px solid #0f172a;
        white-space: nowrap;
    }

        .data-table th.th-index {
            width: 50px;
            text-align: center;
        }

        .data-table th.th-required::after {
            content: " *";
            color: #ef4444;
        }

    .data-table td {
        padding: 0.75rem 1rem;
        border-bottom: 1px solid #e5e7eb;
        font-size: 0.875rem;
    }

        .data-table td.cell-index {
            text-align: center;
            color: #6b7280;
            font-weight: 600;
        }

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

    .data-table tbody tr.row-modified {
        background-color: #fef3c7;
    }

        .data-table tbody tr.row-modified:hover {
            background-color: #fde68a;
        }

    .data-table tbody tr.row-error {
        background-color: #fee2e2;
    }

        .data-table tbody tr.row-error:hover {
            background-color: #fecaca;
        }

    .data-table tbody tr.row-empty {
        opacity: 0.6;
    }

/* Validation Errors */
.validation-errors {
    padding: 0 2rem 2rem 2rem;
}

    .validation-errors .alert {
        margin: 0;
    }

    .validation-errors ul {
        margin-top: 1rem;
        padding-left: 1.5rem;
    }

    .validation-errors li {
        margin-bottom: 0.5rem;
    }

/* Results Card */
.results-card {
    background: var(--nm-card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.results-header {
    background: var(--nm-success);
    padding: 1.5rem 2rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .results-header h3 {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 600;
    }

.execution-time {
    font-size: 0.875rem;
    opacity: 0.9;
}

.results-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}

.result-stat {
    padding: 2rem;
    text-align: center;
    border-right: 1px solid #e5e7eb;
}

    .result-stat:last-child {
        border-right: none;
    }

    .result-stat.success {
        background-color: #d1fae5;
    }

    .result-stat.failure {
        background-color: #fee2e2;
    }

    .result-stat.total {
        background-color: #dbeafe;
    }

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.result-stat.success .stat-value {
    color: #059669;
}

.result-stat.failure .stat-value {
    color: #dc2626;
}

.result-stat.total .stat-value {
    color: #2563eb;
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.results-errors {
    padding: 2rem;
    background-color: #fef3c7;
}

    .results-errors h5 {
        color: #92400e;
        margin: 0 0 1rem 0;
    }

    .results-errors ul {
        margin: 0;
        padding-left: 1.5rem;
    }

    .results-errors li {
        margin-bottom: 0.5rem;
        color: #78350f;
    }

/* Empty State */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
    background: var(--nm-card-bg);
    border-radius: 12px;
    border: 2px dashed #e5e7eb;
}

    .empty-state h4 {
        margin: 0 0 0.5rem 0;
        color: #374151;
    }

    .empty-state p {
        margin: 0;
        color: #6b7280;
    }

/* Responsive Design */
@media (max-width: 1024px) {
    .workflow-steps {
        grid-template-columns: 1fr;
    }

    .workflow-step {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }

        .workflow-step:last-child {
            border-bottom: none;
        }

    .results-body {
        grid-template-columns: 1fr;
    }

    .result-stat {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }

        .result-stat:last-child {
            border-bottom: none;
        }
}

/* Button Improvements - use site.css styles */

/* Utility Classes */
.text-muted {
    color: #6b7280 !important;
}

.fst-italic {
    font-style: italic;
}

.d-flex {
    display: flex;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-2 {
    margin-bottom: 0.5rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.ms-1 {
    margin-left: 0.25rem !important;
}

.ms-2 {
    margin-left: 0.5rem !important;
}

.ms-3 {
    margin-left: 1rem !important;
}

.fw-bold {
    font-weight: 700 !important;
}

.text-center {
    text-align: center !important;
}

.text-danger {
    color: #dc2626 !important;
}

.text-success {
    color: #059669 !important;
}

.text-warning {
    color: #f59e0b !important;
}
