/* ============================================
   PRIMOS Production Styles
   Production tables, health status, order modals
   ============================================ */

/* ============================================
      overflow: hidden;
      box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    }

    .production-table {
      width: 100%;
      border-collapse: collapse;
      table-layout: fixed;
    }

    /* Production table column widths */
    .production-table .col-health { width: 50px; min-width: 50px; }
    .production-table .col-pd { width: 120px; min-width: 100px; }
    .production-table .col-customer { width: auto; min-width: 150px; }
    .production-table .col-location { width: 60px; min-width: 60px; }
    .production-table .col-days { width: 60px; min-width: 60px; text-align: right; }
    .production-table .col-due { width: 100px; min-width: 90px; }
    .production-table .col-status { width: auto; min-width: 200px; }

    .production-table thead th {
      background: linear-gradient(to bottom, #f8f9fa, #f0f1f3);
      padding: 14px 12px;
      text-align: left;
      font-weight: 600;
      font-size: 12px;
      color: #555;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      border-bottom: 2px solid #e0e0e0;
    }

    .production-table thead th.col-health {
      text-align: center;
      padding: 14px 8px;
    }

    .production-table tbody tr {
      transition: background 0.15s ease;
      cursor: pointer;
    }

    .production-table tbody tr:hover {
      background: #f5f7fa;
    }

    .production-table tbody tr:active {
      background: #eef2f7;
    }

    .production-table tbody td {
      padding: 14px 12px;
      border-bottom: 1px solid #eee;
      font-size: 14px;
      vertical-align: middle;
    }

    .production-table tbody td.col-health {
      text-align: center;
      padding: 14px 8px;
    }

    /* Health Status Swatch - Square style like bedding color swatches */
    .health-swatch {
      width: 24px;
      height: 24px;
      border-radius: 4px;
      display: inline-block;
      border: 2px solid rgba(0,0,0,0.1);
    }

    .health-green {
      background: #4caf50;
      border-color: #388e3c;
    }

    .health-yellow {
      background: #ffc107;
      border-color: #ffa000;
    }

    .health-red {
      background: #f44336;
      border-color: #d32f2f;
    }

    .health-gray {
      background: #9e9e9e;
      border-color: #757575;
    }

    /* PD Number cell */
    .pd-number {
      font-weight: 600;
      color: #333;
    }

    /* Customer cell */
    .customer-name {
      font-weight: 500;
      color: #333;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 200px;
    }

    /* Days until due cell */
    .days-until {
      font-weight: 600;
      text-align: right;
      display: block;
    }

    .days-until.overdue {
      color: #d32f2f;
    }

    .days-until.urgent {
      color: #f57c00;
    }

    .days-until.normal {
      color: #333;
    }

    /* AI Status Summary cell */
    .status-summary {
      font-size: 13px;
      color: #555;
      line-height: 1.4;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .status-summary .ai-icon {
      flex-shrink: 0;
      width: 16px;
      height: 16px;
      background: linear-gradient(135deg, #8B1538, #a62d4d);
      border-radius: 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-size: 10px;
    }

    .status-summary .summary-text {
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    /* Production table loading state */
    .production-table .loading {
      text-align: center;
      padding: 40px 20px;
      color: #888;
    }

    .production-table .loading-spinner {
      display: inline-block;
      width: 24px;
      height: 24px;
      border: 3px solid #e0e0e0;
      border-top-color: #8B1538;
      border-radius: 50%;
      animation: spin 1s linear infinite;
      margin-right: 10px;
      vertical-align: middle;
    }

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

    .production-table .loading-text {
      vertical-align: middle;
    }

    /* Empty state */
    .production-table .empty-state {
      text-align: center;
      padding: 60px 20px;
      color: #888;
    }

    .production-table .empty-state-icon {
      font-size: 48px;
      margin-bottom: 15px;
      opacity: 0.5;
    }

    /* ============================================
       HEALTH METRICS BAR
       ============================================ */

    .health-metrics-bar {
      display: flex;
      gap: 12px;
      margin-bottom: 20px;
    }

    .health-metric-card {
      display: flex;
      align-items: center;
      gap: 12px;
      background: white;
      border: 2px solid #e0e0e0;
      border-radius: 10px;
      padding: 14px 18px;
      cursor: pointer;
      transition: all 0.2s ease;
      min-width: 120px;
    }

    .health-metric-card:hover {
      border-color: #bbb;
      box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }

    .health-metric-card.active {
      border-color: #8B1538;
      background: #fdf6f8;
    }

    .health-metric-card.health-all {
      flex-direction: column;
      align-items: center;
      gap: 4px;
      padding: 12px 20px;
    }

    .health-metric-card.health-all .health-metric-count {
      font-size: 28px;
      font-weight: 700;
      color: #333;
    }

    .health-metric-card.health-all .health-metric-label {
      font-size: 12px;
      color: #666;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .health-metric-indicator {
      width: 24px;
      height: 24px;
      border-radius: 4px;
      flex-shrink: 0;
      border: 2px solid rgba(0,0,0,0.1);
    }

    .health-metric-indicator.green {
      background: #4caf50;
      border-color: #388e3c;
    }

    .health-metric-indicator.yellow {
      background: #ffc107;
      border-color: #ffa000;
    }

    .health-metric-indicator.red {
      background: #f44336;
      border-color: #d32f2f;
    }

    .health-metric-content {
      flex: 1;
    }

    .health-metric-count {
      font-size: 22px;
      font-weight: 700;
      color: #333;
      line-height: 1.1;
    }

    .health-metric-label {
      font-size: 11px;
      color: #888;
      text-transform: uppercase;
      letter-spacing: 0.3px;
    }

    .health-metric-percent {
      font-size: 14px;
      font-weight: 600;
      color: #666;
      background: #f0f0f0;
      padding: 4px 8px;
      border-radius: 4px;
    }

    /* Card-specific active states */
    .health-metric-card.health-green-card.active {
      border-color: #4caf50;
      background: #f1f8f1;
    }

    .health-metric-card.health-yellow-card.active {
      border-color: #ffc107;
      background: #fffdf1;
    }

    .health-metric-card.health-red-card.active {
      border-color: #f44336;
      background: #fef6f5;
    }

    /* ============================================
       PRODUCTION INTELLIGENCE STATUS BADGES
       ============================================ */

    .production-status-badge {
      display: inline-flex;
      align-items: center;
      padding: 3px 8px;
      border-radius: 4px;
      font-size: 10px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      white-space: nowrap;
    }

    .status-critical {
      background: #1a1a1a;
      color: white;
    }

    .status-behind {
      background: #dc2626;
      color: white;
    }

    .status-at-risk {
      background: #f59e0b;
      color: white;
    }

    .status-on-track {
      background: #22c55e;
      color: white;
    }

    .status-scheduled {
      background: #6b7280;
      color: white;
    }

    .status-complete {
      background: #9ca3af;
      color: white;
    }

    .status-on-hold {
      background: #3b82f6;
      color: white;
    }

    /* Production Progress Bar */
    .production-progress-bar {
      width: 80px;
      height: 14px;
      background: #e5e7eb;
      border-radius: 7px;
      position: relative;
      overflow: hidden;
    }

    .production-progress-fill {
      height: 100%;
      border-radius: 7px;
      transition: width 0.3s ease;
    }

    .production-progress-fill.on-track {
      background: #22c55e;
    }

    .production-progress-fill.at-risk {
      background: #f59e0b;
    }

    .production-progress-fill.behind {
      background: #dc2626;
    }

    .production-progress-fill.critical {
      background: #1a1a1a;
    }

    .production-progress-fill.scheduled {
      background: #6b7280;
    }

    .production-progress-text {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      font-size: 9px;
      font-weight: 600;
      color: #374151;
    }

    /* Worker Indicator */
    .worker-indicator {
      display: inline-flex;
      align-items: center;
      font-size: 14px;
    }

    .worker-indicator.active {
      color: #22c55e;
    }

    .worker-indicator.idle {
      color: #f59e0b;
    }

    /* Production Summary Card (Dashboard) */
    .production-summary-card {
      background: white;
      border-radius: 10px;
      padding: 20px;
      box-shadow: 0 2px 10px rgba(0,0,0,0.05);
      margin-bottom: 20px;
    }

    .production-summary-card h3 {
      font-size: 14px;
      color: #6b7280;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin: 0 0 16px 0;
      font-weight: 600;
    }

    .production-status-counts {
      display: flex;
      gap: 16px;
      flex-wrap: wrap;
      margin-bottom: 16px;
    }

    .production-count-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      min-width: 60px;
      padding: 10px;
      background: #f9fafb;
      border-radius: 8px;
    }

    .production-count-item .count {
      font-size: 24px;
      font-weight: 700;
      line-height: 1.2;
    }

    .production-count-item .label {
      font-size: 11px;
      color: #6b7280;
      text-transform: uppercase;
      letter-spacing: 0.3px;
    }

    .production-count-item.critical .count { color: #1a1a1a; }
    .production-count-item.behind .count { color: #dc2626; }
    .production-count-item.at-risk .count { color: #f59e0b; }
    .production-count-item.on-track .count { color: #22c55e; }

    .production-facility-summary {
      display: flex;
      gap: 20px;
      font-size: 13px;
      color: #6b7280;
      padding-top: 12px;
      border-top: 1px solid #e5e7eb;
    }

    .production-facility-summary strong {
      color: #374151;
    }

    /* ============================================
       REDESIGNED ORDER DETAIL MODAL
       Modern card-based layout with production status
       ============================================ */

    .order-modal-redesign {
      max-width: 2250px;
      width: 95%;
      position: relative;
    }

    .order-modal-header {
      background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
      color: white;
      padding: 0;
      position: relative;
    }

    .order-header-top {
      padding: 20px 60px 20px 24px; /* Extra right padding for close button */
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 20px;
    }

    /* Close button inside modal header */
    .order-modal-redesign .modal-close-corner {
      position: absolute;
      top: 16px;
      right: 16px;
      background: rgba(255,255,255,0.2);
      border: none;
      color: white;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      font-size: 22px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background 0.2s;
      z-index: 10;
    }

    .order-modal-redesign .modal-close-corner:hover {
      background: rgba(255,255,255,0.3);
    }

    .order-header-left {
      flex: 1;
    }

    .order-header-pd-number {
      font-size: 36px;
      font-weight: 800;
      margin-bottom: 8px;
      letter-spacing: -0.5px;
    }

    .order-header-customer {
      font-size: 28px;
      font-weight: 700;
      margin-bottom: 6px;
      letter-spacing: -0.3px;
    }

    .order-header-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 16px;
      font-size: 15px;
      opacity: 0.9;
    }

    .order-header-meta span {
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .order-header-meta .so-number {
      font-size: 18px;
      font-weight: 600;
    }

    .order-header-right {
      text-align: right;
    }

    .order-header-status {
      margin-bottom: 8px;
    }

    .order-status-badge-large {
      display: inline-flex;
      align-items: center;
      padding: 6px 14px;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .order-status-badge-large.critical { background: #dc2626; color: white; }
    .order-status-badge-large.behind { background: #f97316; color: white; }
    .order-status-badge-large.at-risk { background: #f59e0b; color: #1a1a1a; }
    .order-status-badge-large.on-track { background: #22c55e; color: white; }
    .order-status-badge-large.scheduled { background: #6b7280; color: white; }
    .order-status-badge-large.complete { background: #3b82f6; color: white; }

    .order-header-progress {
      font-size: 13px;
      opacity: 0.9;
    }

    .order-status-blurb {
      background: rgba(255,255,255,0.1);
      padding: 12px 24px;
      font-size: 13px;
      border-top: 1px solid rgba(255,255,255,0.15);
    }

    .order-modal-body {
      padding: 24px;
      background: #f5f6f8;
    }

    /* Order info bar */
    .order-info-bar {
      display: flex;
      gap: 16px;
      margin-bottom: 20px;
      flex-wrap: wrap;
    }

    .order-info-chip {
      background: white;
      padding: 10px 16px;
      border-radius: 8px;
      box-shadow: 0 1px 3px rgba(0,0,0,0.08);
      font-size: 13px;
    }

    .order-info-chip .label {
      color: #6b7280;
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      display: block;
      margin-bottom: 2px;
    }

    .order-info-chip .value {
      font-weight: 600;
      color: #1a1a2e;
    }

    .order-info-chip .value.highlight { color: #8B1538; }
    .order-info-chip .value.critical { color: #dc2626; }
    .order-info-chip .value.warning { color: #f59e0b; }
    .order-info-chip .value.success { color: #22c55e; }
    .order-info-chip .value.missing { color: #9ca3af; font-style: italic; }

    .order-info-chip.clickable {
      cursor: pointer;
      transition: all 0.2s ease;
      border: 2px dashed #d1d5db;
    }
    .order-info-chip.clickable:hover {
      border-color: #8B1538;
      background: #fef2f2;
    }

    /* Modal loading spinner (same style as production tables) */
    .order-modal-redesign .loading {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 60px 20px;
      color: #666;
    }

    .order-modal-redesign .loading-spinner {
      display: inline-block;
      width: 32px;
      height: 32px;
      border: 3px solid #e0e0e0;
      border-top-color: #8B1538;
      border-radius: 50%;
      animation: spin 1s linear infinite;
      margin-bottom: 12px;
    }

    .order-modal-redesign .loading-text {
      font-size: 14px;
      color: #888;
    }

    /* Section titles */
    .order-section-title {
      font-size: 14px;
      font-weight: 600;
      color: #1a1a2e;
      margin: 24px 0 12px 0;
      padding-bottom: 8px;
      border-bottom: 2px solid #e5e7eb;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .order-section-title:first-child {
      margin-top: 0;
    }

    /* Line item cards */
    .line-item-cards {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .line-item-card {
      background: white;
      border-radius: 10px;
      box-shadow: 0 2px 6px rgba(0,0,0,0.06);
      overflow: hidden;
      transition: all 0.2s ease;
      border: 1px solid #e5e7eb;
    }

    .line-item-card:hover {
      box-shadow: 0 4px 12px rgba(0,0,0,0.1);
      transform: translateY(-1px);
    }

    .line-item-card-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 14px 18px;
      background: #fafbfc;
      border-bottom: 1px solid #eee;
    }

    .line-item-name {
      font-size: 15px;
      font-weight: 600;
      color: #1a1a2e;
      margin-bottom: 2px;
    }

    .line-item-part {
      font-size: 11px;
      color: #6b7280;
      font-family: 'SF Mono', 'Consolas', monospace;
      background: #f0f0f0;
      padding: 2px 6px;
      border-radius: 3px;
      display: inline-block;
    }

    .line-item-status-col {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .line-item-progress-mini {
      width: 60px;
      height: 8px;
      background: #e5e7eb;
      border-radius: 4px;
      overflow: hidden;
    }

    .line-item-progress-mini-fill {
      height: 100%;
      border-radius: 4px;
    }

    .line-item-card-body {
      padding: 14px 18px;
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      gap: 12px;
    }

    .line-item-field {
      font-size: 12px;
    }

    .line-item-field .field-label {
      color: #6b7280;
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.3px;
      margin-bottom: 3px;
    }

    .line-item-field .field-value {
      color: #1a1a2e;
      font-weight: 500;
    }

    .line-item-field .field-value.missing {
      color: #dc2626;
      font-style: italic;
    }

    .line-item-field .field-value.started {
      color: #22c55e;
    }

    .line-item-field .field-value.not-started {
      color: #6b7280;
    }

    /* Status indicator dots */
    .status-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      display: inline-block;
      margin-right: 6px;
    }

    .status-dot.active { background: #22c55e; animation: pulse 2s infinite; }
    .status-dot.idle { background: #f59e0b; }
    .status-dot.not-started { background: #6b7280; }

    @keyframes pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.5; }
    }

    /* Collapsible order details */
    .order-details-collapsible {
      background: white;
      border-radius: 8px;
      margin-bottom: 16px;
      box-shadow: 0 1px 3px rgba(0,0,0,0.06);
      border: 1px solid #e5e7eb;
    }

    .order-details-collapsible summary {
      padding: 14px 18px;
      font-size: 13px;
      font-weight: 600;
      color: #374151;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 8px;
      list-style: none;
    }

    .order-details-collapsible summary::-webkit-details-marker {
      display: none;
    }

    .order-details-collapsible summary::after {
      content: '▸';
      margin-left: auto;
      transition: transform 0.2s;
    }

    .order-details-collapsible[open] summary::after {
      transform: rotate(90deg);
    }

    .order-details-content {
      padding: 0 18px 18px;
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 16px;
    }

    .order-detail-item {
      font-size: 13px;
    }

    .order-detail-item .label {
      color: #6b7280;
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.3px;
      margin-bottom: 3px;
    }

    .order-detail-item .value {
      color: #1a1a2e;
      font-weight: 500;
    }

    /* Actions bar */
    .order-actions-bar {
      display: flex;
      gap: 10px;
      margin-top: 20px;
      padding-top: 16px;
      border-top: 1px solid #e5e7eb;
    }

    .order-action-btn {
      padding: 10px 18px;
      border-radius: 6px;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s;
      border: none;
    }

    .order-action-btn.primary {
      background: #8B1538;
      color: white;
    }

    .order-action-btn.primary:hover {
      background: #6d1029;
    }

    .order-action-btn.secondary {
      background: white;
      color: #374151;
      border: 1px solid #ddd;
    }

    .order-action-btn.secondary:hover {
      border-color: #8B1538;
      color: #8B1538;
    }

    /* Facility badge */
    .facility-badge {
      font-size: 10px;
      padding: 2px 8px;
      border-radius: 10px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.3px;
    }

    .facility-badge.wpb {
      background: #dbeafe;
      color: #1e40af;
    }

    .facility-badge.tus {
      background: #fef3c7;
      color: #92400e;
    }

    /* Production Brief Modal */
    .production-brief-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: 10000;
      padding: 20px;
    }

    .production-brief-modal {
      background: white;
      border-radius: 12px;
      max-width: 800px;
      width: 100%;
      max-height: 90vh;
      overflow: auto;
      box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    }

    .production-brief-header {
      background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
      color: white;
      padding: 24px;
      position: sticky;
      top: 0;
    }

    .production-brief-header h2 {
      margin: 0 0 8px 0;
      font-size: 20px;
      font-weight: 600;
    }

    .production-brief-header .date {
      font-size: 13px;
      opacity: 0.8;
    }

    .production-brief-content {
      padding: 24px;
    }

    .production-brief-section {
      margin-bottom: 24px;
    }

    .production-brief-section h3 {
      font-size: 14px;
      color: #374151;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin: 0 0 12px 0;
      padding-bottom: 8px;
      border-bottom: 2px solid #e5e7eb;
    }

    .production-alert-list {
      list-style: none;
      padding: 0;
      margin: 0;
    }

    .production-alert-item {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      padding: 12px;
      background: #f9fafb;
      border-radius: 8px;
      margin-bottom: 8px;
    }

    .production-alert-item.critical {
      background: #fef2f2;
      border-left: 3px solid #dc2626;
    }

    .production-alert-item.behind {
      background: #fff7ed;
      border-left: 3px solid #f59e0b;
    }

    .production-alert-item .pd-number {
      font-weight: 600;
      color: #374151;
      min-width: 80px;
    }

    .production-alert-item .product {
      flex: 1;
      color: #6b7280;
    }

    .production-alert-item .reason {
      font-size: 12px;
      color: #9ca3af;
    }

    /* ============================================
       PRODUCTION HEADER WITH LOCATION TOGGLE
       ============================================ */

    .production-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 16px;
      gap: 16px;
      flex-wrap: wrap;
    }

    .production-header-left {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }

    .production-header-left h2 {
      font-size: 20px;
      font-weight: 600;
      color: #1a1a2e;
      margin: 0;
    }

    .production-header .btn-icon {
      background: #f3f4f6;
      border: 1px solid #e5e7eb;
      color: #6b7280;
      padding: 8px;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .production-header .btn-icon:hover {
      background: #e5e7eb;
      color: #374151;
    }

    /* Location Toggle Buttons */
    .location-toggle {
      display: flex;
      gap: 8px;
      align-items: center;
    }

    .location-btn {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 8px 14px;
      border: 2px solid #e5e7eb;
      border-radius: 8px;
      background: white;
      font-size: 13px;
      font-weight: 600;
      color: #6b7280;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .location-btn:hover {
      border-color: #d1d5db;
      background: #f9fafb;
    }

    .location-btn.active {
      border-color: #8B1538;
      background: #fef2f4;
      color: #8B1538;
    }

    .location-btn:not(.active) {
      opacity: 0.6;
    }

    .location-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
    }

    .location-dot.wpb {
      background: #3b82f6;
    }

    .location-dot.tus {
      background: #f59e0b;
    }

    /* Data Freshness Indicator */
    .data-freshness {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      color: #6b7280;
      padding: 6px 12px;
      background: #f9fafb;
      border-radius: 6px;
      border: 1px solid #e5e7eb;
    }

    .data-freshness-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: #22c55e;
      animation: pulse-dot 2s infinite;
    }

    @keyframes pulse-dot {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.5; }
    }

    .data-freshness-text {
      color: #6b7280;
    }

    .data-freshness-time {
      font-weight: 500;
      color: #374151;
    }

    /* ============================================
       PAGE TITLE (ABOVE METRICS)
       ============================================ */

    .page-title-bar {
      margin-bottom: 20px;
    }

    .page-title-bar h1 {
      font-size: 28px;
      font-weight: 700;
      color: #1a1a2e;
      margin: 0;
      letter-spacing: -0.5px;
    }

    /* ============================================
       PRODUCTION CONTROLS BAR (REDESIGNED)
       Updated time, filters, refresh in a clean bar
       ============================================ */

    .production-controls-bar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 12px 16px;
      background: white;
      border-radius: 10px;
      box-shadow: 0 1px 3px rgba(0,0,0,0.06);
      margin-bottom: 16px;
      gap: 16px;
      flex-wrap: wrap;
    }

    .production-controls-left {
      display: flex;
      align-items: center;
      gap: 16px;
      flex-wrap: wrap;
    }

    .production-controls-right {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    /* Refresh Button - Modern Style */
    .refresh-btn {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 8px 14px;
      background: #8B1538;
      color: white;
      border: none;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s ease;
    }

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

    .refresh-btn:active {
      transform: translateY(0);
    }

    .refresh-btn svg {
      transition: transform 0.3s ease;
    }

    .refresh-btn:hover svg {
      transform: rotate(180deg);
    }

    /* Location Filter Pills */
    .location-filter-group {
      display: flex;
      gap: 4px;
      padding: 4px;
      background: #f3f4f6;
      border-radius: 10px;
    }

    .location-filter-pill {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 6px 12px;
      border: none;
      border-radius: 8px;
      background: transparent;
      font-size: 13px;
      font-weight: 500;
      color: #6b7280;
      cursor: pointer;
      transition: all 0.2s ease;
    }

    .location-filter-pill:hover {
      background: rgba(255,255,255,0.5);
    }

    .location-filter-pill.active {
      background: white;
      color: #1a1a2e;
      box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    .location-filter-pill .pill-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
    }

    .location-filter-pill .pill-dot.wpb {
      background: #3b82f6;
    }

    .location-filter-pill .pill-dot.tus {
      background: #f59e0b;
    }

    /* Updated Time Display */
    .updated-time-display {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      color: #6b7280;
    }

    .updated-time-display .sync-icon {
      width: 16px;
      height: 16px;
      color: #22c55e;
    }

    .updated-time-display .time-text {
      color: #374151;
      font-weight: 500;
    }

    /* ============================================
       ALL ORDERS PAGE FILTERS
       ============================================ */

    .orders-filter-select {
      padding: 6px 12px;
      border: none;
      border-radius: 8px;
      background: white;
      font-size: 13px;
      font-weight: 500;
      color: #1a1a2e;
      cursor: pointer;
      box-shadow: 0 1px 3px rgba(0,0,0,0.1);
      min-width: 140px;
    }

    .orders-filter-select:hover {
      background: #f9fafb;
    }

    .orders-filter-select:focus {
      outline: none;
      box-shadow: 0 0 0 2px rgba(139, 21, 56, 0.2);
    }

    .orders-search-wrapper {
      display: flex;
      align-items: center;
      gap: 8px;
      background: white;
      border-radius: 8px;
      padding: 6px 12px;
      box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }

    .orders-search-wrapper svg {
      color: #6b7280;
      flex-shrink: 0;
    }

    .orders-search-input {
      border: none;
      outline: none;
      font-size: 13px;
      width: 200px;
      background: transparent;
    }

    .orders-search-input::placeholder {
      color: #9ca3af;
    }

    /* ============================================
       Orders Pagination
       ============================================ */

    .orders-pagination {
      padding: 16px 24px;
      background: var(--color-gray-50);
      border-top: 1px solid var(--color-gray-200);
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }

    .orders-pagination-info {
      font-size: 13px;
      color: var(--color-gray-600);
      font-weight: 500;
    }

    .orders-pagination-buttons {
      display: flex;
      gap: 12px;
      align-items: center;
    }

    .orders-pagination-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 8px 16px;
      background: white;
      border: 1px solid var(--color-gray-300);
      border-radius: var(--radius-md);
      cursor: pointer;
      font-size: 13px;
      font-weight: 500;
      color: var(--color-gray-700);
      transition: all var(--transition-normal);
    }

    .orders-pagination-btn:hover:not(:disabled) {
      background: var(--color-gray-100);
      border-color: var(--color-gray-400);
      color: var(--color-gray-900);
    }

    .orders-pagination-btn:disabled {
      opacity: 0.4;
      cursor: not-allowed;
      background: var(--color-gray-100);
    }

    .orders-pagination-current {
      font-size: 13px;
      color: var(--color-gray-700);
      font-weight: 600;
      padding: 0 8px;
    }

    /* ============================================
       Engineering Queue Badges (matches status-badge style)
       ============================================ */

    .eng-queue-badge {
      display: inline-block;
      padding: 4px 10px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 500;
      white-space: nowrap;
    }

    .eng-queue-badge.none {
      background: var(--color-gray-200);
      color: var(--color-gray-600);
    }

    .eng-queue-badge.eng-standard {
      background: var(--color-success-light);
      color: var(--color-success-dark);
    }

    .eng-queue-badge.eng-scans {
      background: var(--color-info-light);
      color: var(--color-info-dark);
    }

    .eng-queue-badge.eng-noscans {
      background: var(--color-warning-light);
      color: var(--color-warning-dark);
    }

    .eng-queue-badge.mixed {
      background: var(--color-eng-review-bg);
      color: var(--color-eng-review);
    }

    /* ============================================
       Sync Status Indicator
       ============================================ */

    .sync-indicator {
      display: inline-block;
      margin-right: 4px;
      cursor: help;
      font-size: 14px;
    }

    .sync-indicator.pending {
      color: var(--color-warning);
    }

    .sync-indicator.failed {
      color: var(--color-danger);
    }
