/* styles.css - Production Dashboard Styles - Neuro Brand Theme */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Root variables for Neuro brand colors */
:root {
    --neuro-turquoise: #22aac9;
    --neuro-turquoise-light: #44ccee;
    --neuro-red: #e74c3c;
    --neuro-red-light: #ec7063;
    --neuro-yellow: #f5b041;
    --neuro-yellow-light: #f8c471;
    --neuro-mint: #48bb78;
    --neuro-gray-dark: #2c3e50;
    --neuro-gray-medium: #7f8c8d;
    --neuro-gray-light: #ecf0f1;
    --neuro-gray-lighter: #f8f9fa;
    --neuro-white: #ffffff;
    --neuro-text-primary: #2c3e50;
    --neuro-text-secondary: #5d6d7e;
    --neuro-border: #e5e7eb;
    --neuro-shadow: rgba(0, 0, 0, 0.08);
    --neuro-shadow-hover: rgba(0, 0, 0, 0.12);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--neuro-gray-lighter);
    color: var(--neuro-text-primary);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.dashboard {
    max-width: 1600px;
    margin: 0 auto;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 8px;
    text-align: center;
    color: var(--neuro-text-primary);
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Header Section */
.header-section {
    background: var(--neuro-white);
    border-radius: 12px;
    padding: 40px 20px;
    margin-bottom: 30px;
    text-align: center;
    box-shadow: 0 2px 4px var(--neuro-shadow);
    border-top: 4px solid var(--neuro-turquoise);
    position: relative;
}

/* Home Button */
.home-button {
    position: absolute;
    top: 20px;
    left: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--neuro-turquoise);
    color: var(--neuro-white);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--neuro-shadow);
}

.home-button:hover {
    background: var(--neuro-turquoise-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--neuro-shadow-hover);
    color: var(--neuro-white);
    text-decoration: none;
}

.home-button svg {
    width: 20px;
    height: 20px;
}

/* View Toggle Button */
.view-toggle-button {
    position: absolute;
    top: 20px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--neuro-gray-dark);
    color: var(--neuro-white);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--neuro-shadow);
}

.view-toggle-button:hover {
    background: var(--neuro-gray-medium);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--neuro-shadow-hover);
    color: var(--neuro-white);
    text-decoration: none;
}

.view-toggle-button svg {
    width: 20px;
    height: 20px;
}

.company-branding {
    max-width: 800px;
    margin: 0 auto;
}

.tagline {
    color: var(--neuro-text-secondary);
    font-size: 1.1rem;
    margin: 0;
    font-weight: 500;
}

h2 {
    font-size: 1.8rem;
    margin: 30px 0 20px;
    color: var(--neuro-text-primary);
    font-weight: 600;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.metric-card {
    background: var(--neuro-white);
    border: 1px solid var(--neuro-border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 1px 3px var(--neuro-shadow);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--neuro-shadow-hover);
    border-color: var(--neuro-turquoise);
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--neuro-turquoise);
    margin-bottom: 8px;
}

.metric-label {
    color: var(--neuro-text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

/* Controls */
.controls {
    display: flex;
    gap: 16px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    align-items: center;
    background: var(--neuro-white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 1px 3px var(--neuro-shadow);
}

.filter-select {
    background: var(--neuro-white);
    border: 2px solid var(--neuro-border);
    color: var(--neuro-text-primary);
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-select:hover {
    border-color: var(--neuro-turquoise);
}

.filter-select:focus {
    outline: none;
    border-color: var(--neuro-turquoise);
    box-shadow: 0 0 0 3px rgba(34, 170, 201, 0.1);
}

.filter-select option {
    background: var(--neuro-white);
    color: var(--neuro-text-primary);
}

.btn {
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--neuro-turquoise);
    border-color: var(--neuro-turquoise);
    color: var(--neuro-white);
}

.btn-primary:hover {
    background-color: var(--neuro-turquoise-light);
    border-color: var(--neuro-turquoise-light);
    transform: translateY(-1px);
}

/* Print Button */
.print-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--neuro-gray-dark);
    color: var(--neuro-white);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--neuro-shadow);
}

.print-button:hover {
    background: var(--neuro-gray-medium);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--neuro-shadow-hover);
}

.print-button svg {
    width: 20px;
    height: 20px;
}

/* Chart Containers */
.chart-container {
    background: var(--neuro-white);
    border: 1px solid var(--neuro-border);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    height: 400px;
    box-shadow: 0 1px 3px var(--neuro-shadow);
}

/* Process Grid */
.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.process-card {
    background: var(--neuro-white);
    border: 1px solid var(--neuro-border);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px var(--neuro-shadow);
}

.process-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--neuro-shadow-hover);
    border-color: var(--neuro-turquoise);
}

.process-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--neuro-gray-light);
}

.completion-badge {
    background: var(--neuro-turquoise);
    color: var(--neuro-white);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.process-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--neuro-text-primary);
}

/* Status Badges */
.status-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
}

.status-ready {
    background: rgba(72, 187, 120, 0.1);
    color: var(--neuro-mint);
    border: 1px solid rgba(72, 187, 120, 0.2);
}

.status-stopped {
    background: rgba(231, 76, 60, 0.1);
    color: var(--neuro-red);
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.status-working {
    background: rgba(245, 176, 65, 0.1);
    color: #d68910;
    border: 1px solid rgba(245, 176, 65, 0.2);
}

/* Process Metrics */
.process-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 16px;
}

.progress {
    height: 24px;
    background-color: var(--neuro-gray-light);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--neuro-turquoise) 0%, var(--neuro-turquoise-light) 100%);
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neuro-white);
    font-weight: 600;
    font-size: 0.85rem;
}

.progress-label {
    text-align: center;
    font-size: 0.85rem;
    color: var(--neuro-text-secondary);
    font-weight: 500;
}

.process-metric {
    background: var(--neuro-gray-lighter);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--neuro-border);
}

.process-metric-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--neuro-turquoise);
}

.process-metric-label {
    font-size: 0.75rem;
    color: var(--neuro-text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Timeline Container */
.timeline-container {
    background: var(--neuro-white);
    border: 1px solid var(--neuro-border);
    border-radius: 12px;
    padding: 30px;
    overflow-x: auto;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px var(--neuro-shadow);
}

/* Table Section */
.table-section {
    background: var(--neuro-white);
    border: 1px solid var(--neuro-border);
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 1px 3px var(--neuro-shadow);
}

/* DataTable Customization */
.dataTables_wrapper {
    color: var(--neuro-text-primary);
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    color: var(--neuro-text-secondary);
}

.dataTables_wrapper .dataTables_filter input {
    background: var(--neuro-white);
    border: 2px solid var(--neuro-border);
    color: var(--neuro-text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    margin-left: 10px;
    font-weight: 500;
}

.dataTables_wrapper .dataTables_filter input:focus {
    outline: none;
    border-color: var(--neuro-turquoise);
    box-shadow: 0 0 0 3px rgba(34, 170, 201, 0.1);
}

.dataTables_wrapper .dataTables_length select {
    background: var(--neuro-white);
    border: 2px solid var(--neuro-border);
    color: var(--neuro-text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    margin: 0 5px;
    font-weight: 500;
}

.column-search {
    background: var(--neuro-white) !important;
    border: 1px solid var(--neuro-border) !important;
    color: var(--neuro-text-primary) !important;
    font-size: 0.8rem;
    margin-top: 5px;
    padding: 4px 8px;
    border-radius: 4px;
}

.column-search:focus {
    outline: none;
    border-color: var(--neuro-turquoise) !important;
}

.column-search::placeholder {
    color: var(--neuro-text-secondary);
    opacity: 0.7;
}

/* Updated table styles for light theme */
.table {
    --bs-table-bg: var(--neuro-white);
    --bs-table-hover-bg: var(--neuro-gray-lighter);
    --bs-table-striped-bg: rgba(236, 240, 241, 0.5);
    --bs-table-border-color: var(--neuro-border);
    color: var(--neuro-text-primary);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: var(--bs-table-striped-bg);
}

.table-hover > tbody > tr:hover > * {
    background-color: var(--bs-table-hover-bg);
}

.table th {
    background: var(--neuro-gray-lighter);
    border-bottom: 2px solid var(--neuro-turquoise);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    color: var(--neuro-text-primary);
}

.table td {
    border-color: var(--neuro-border);
    vertical-align: middle;
}

.page-link {
    background: var(--neuro-white);
    border-color: var(--neuro-border);
    color: var(--neuro-text-primary);
    font-weight: 500;
}

.page-link:hover {
    background: var(--neuro-gray-lighter);
    border-color: var(--neuro-turquoise);
    color: var(--neuro-turquoise);
}

.page-item.active .page-link {
    background: var(--neuro-turquoise);
    border-color: var(--neuro-turquoise);
    color: var(--neuro-white);
}

/* Loading Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
    color: var(--neuro-turquoise);
}

/* Alert styling */
.alert-danger {
    background-color: rgba(231, 76, 60, 0.1);
    border-color: rgba(231, 76, 60, 0.2);
    color: var(--neuro-red);
}

/* Wave pattern decoration (inspired by Neuro packaging) */
.dashboard::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(135deg, var(--neuro-turquoise) 0%, var(--neuro-turquoise-light) 100%);
    opacity: 0.05;
    z-index: -1;
    border-radius: 0 0 50% 50% / 0 0 20% 20%;
}

/* Label Link Styling */
.label-link {
    color: var(--neuro-turquoise);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
}

.label-link:hover {
    color: var(--neuro-turquoise-light);
    transform: scale(1.1);
}

.label-link svg {
    width: 20px;
    height: 20px;
}

/* Custom scrollbar for better aesthetics */
::-webkit-scrollbar-thumb {
    background: var(--neuro-turquoise);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neuro-turquoise-light);
}

/* Hide print footer on screen */
.print-footer {
    display: none;
}

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

    .chart-container {
        height: 300px;
        padding: 20px;
    }

    .controls {
        flex-direction: column;
        width: 100%;
    }

    .filter-select {
        width: 100%;
    }

    h1 {
        font-size: 1.75rem;
    }

    .metric-value {
        font-size: 2rem;
    }

    .process-metrics {
        grid-template-columns: 1fr;
    }

    .home-button,
    .view-toggle-button {
        position: static;
        margin-bottom: 10px;
        width: fit-content;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }

    .header-section {
        padding: 20px;
    }
}

/* Print Styles */
@media print {
    /* Hide everything except the table */
    body * {
        visibility: hidden;
    }

    .print-container,
    .print-container * {
        visibility: visible;
    }

    .print-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    /* Hide non-essential elements */
    .header-section,
    .metrics-grid,
    .controls,
    .chart-container,
    .process-grid,
    .timeline-container,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate,
    .column-search,
    .home-button,
    .view-toggle-button,
    #loadingSpinner,
    .dashboard::before {
        display: none !important;
    }

    /* Page setup - LANDSCAPE */
    @page {
        size: letter landscape;
        margin: 0.5in;
    }

    /* Reset body styles for print */
    body {
        background: white;
        color: black;
        padding: 0;
    }

    /* Table styling for print */
    .table-section {
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: white !important;
    }

    .table-section h2 {
        font-size: 16pt !important;
        margin-bottom: 10px !important;
        text-align: center;
        color: black !important;
    }

    #productionTable {
        font-size: 9pt !important;
        width: 100% !important;
        border-collapse: collapse !important;
    }

    #productionTable th,
    #productionTable td {
        padding: 3px 5px !important;
        border: 1px solid #ccc !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    #productionTable th {
        background-color: #f0f0f0 !important;
        font-weight: bold !important;
        font-size: 8pt !important;
        text-transform: none !important;
        letter-spacing: normal !important;
        color: black !important;
    }

    /* Column widths for landscape print - adjusted for better spacing */
    #productionTable th:nth-child(1),
    #productionTable td:nth-child(1) { width: 5%; }   /* Job # */
    #productionTable th:nth-child(2),
    #productionTable td:nth-child(2) { width: 7%; }   /* Start Date */
    #productionTable th:nth-child(3),
    #productionTable td:nth-child(3) { width: 5%; }   /* Start Time */
    #productionTable th:nth-child(4),
    #productionTable td:nth-child(4) { width: 9%; }   /* Process */
    #productionTable th:nth-child(5),
    #productionTable td:nth-child(5) { width: 12%; }  /* Description */
    #productionTable th:nth-child(6),
    #productionTable td:nth-child(6) { width: 10%; }  /* Add Desc */
    #productionTable th:nth-child(7),
    #productionTable td:nth-child(7) { width: 6%; }   /* Colors */
    #productionTable th:nth-child(8),
    #productionTable td:nth-child(8) { width: 6%; }   /* Brand */
    #productionTable th:nth-child(9),
    #productionTable td:nth-child(9) { width: 5%; }   /* Size */
    #productionTable th:nth-child(10),
    #productionTable td:nth-child(10) { width: 6%; }  /* Sheets to Press */
    #productionTable th:nth-child(11),
    #productionTable td:nth-child(11) { width: 7%; }  /* Status */
    #productionTable th:nth-child(12),
    #productionTable td:nth-child(12) { width: 7%; }  /* External Status */
    #productionTable th:nth-child(13),
    #productionTable td:nth-child(13) { width: 5%; }  /* Qty Ordered */
    #productionTable th:nth-child(14),
    #productionTable td:nth-child(14) { width: 5%; }  /* Est. Units */
    #productionTable th:nth-child(15),
    #productionTable td:nth-child(15) { width: 5%; }  /* Current Units */
    #productionTable th:nth-child(16),
    #productionTable td:nth-child(16) { width: 5%; }  /* Est. Hours */
    #productionTable th:nth-child(17),
    #productionTable td:nth-child(17) { display: none !important; } /* Hide Labels column */

    /* Status badges for print */
    .status-badge {
        padding: 1px 3px !important;
        font-size: 6pt !important;
        border-radius: 2px !important;
        border: none !important;
        background: #f0f0f0 !important;
        color: black !important;
    }

    /* Ensure text is black for print */
    #productionTable,
    #productionTable th,
    #productionTable td {
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Page break handling */
    tr {
        page-break-inside: avoid;
    }

    /* Add print date/time footer */
    .print-footer {
        display: block !important;
        position: fixed;
        bottom: 0;
        width: 100%;
        text-align: center;
        font-size: 8pt;
        color: #666;
    }
}

/* Animation for refresh button */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinning {
    display: inline-block;
    animation: spin 1s linear infinite;
}bar {
     width: 8px;
     height: 8px;
 }

::-webkit-scrollbar-track {
    background: var(--neuro-gray-lighter);
    border-radius: 4px;
}

::-webkit-scroll