:root {
  --sidebar-width: 210px;
  --header-height: 48px;
  --primary-color: #0d6efd;
  --success-color: #198754;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #0dcaf0;
  --light-bg: #f8f9fa;
  --border-color: #dee2e6;
  --text-muted: #6c757d;
  --shadow-sm: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
  --shadow: 0 0.5rem 1rem rgba(0,0,0,0.15);
  --shadow-lg: 0 1rem 3rem rgba(0,0,0,0.175);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #f5f7fa;
  color: #212529;
  font-size: 10.5px;
  line-height: 1.6;
}

/* Header */
.header {
  height: var(--header-height);
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  padding: 0 1.125rem;
}

.header-brand {
  display: flex;
  align-items: center;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #212529;
  text-decoration: none;
}

.header-brand i {
  color: var(--primary-color);
  margin-right: 0.5625rem;
  font-size: 1.125rem;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s ease;
  z-index: 1020;
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
  width: 4.5px;
}

.sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 2.25px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.sidebar-menu {
  padding: 1.125rem;
}

.sidebar-menu-item {
  padding: 0.5625rem 0.75rem;
  border-radius: 0.375rem;
  margin-bottom: 0.375rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  color: #495057;
  text-decoration: none;
}

.sidebar-menu-item:hover {
  background-color: var(--light-bg);
  color: var(--primary-color);
}

.sidebar-menu-item.active {
  background-color: rgba(13, 110, 253, 0.1);
  color: var(--primary-color);
  font-weight: 500;
}

.sidebar-menu-item i {
  margin-right: 0.5625rem;
  width: 15px;
  text-align: center;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: 1.125rem;
  min-height: calc(100vh - var(--header-height));
}

/* Cards */
.card {
  border: none;
  border-radius: 0.5625rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.125rem;
  background: #ffffff;
}

.card-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0.9375rem 1.125rem;
  font-weight: 600;
  color: #212529;
  border-radius: 0.5625rem 0.5625rem 0 0 !important;
}

.card-body {
  padding: 1.125rem;
}

.card-title {
  font-size: 0.825rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: #212529;
}

.card-subtitle {
  font-size: 0.65625rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* Forms */
.form-label {
  font-weight: 500;
  color: #495057;
  margin-bottom: 0.375rem;
  font-size: 0.65625rem;
}

.form-control, .form-select {
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  padding: 0.375rem 0.5625rem;
  font-size: 0.65625rem;
  transition: all 0.2s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.input-group-text {
  background-color: var(--light-bg);
  border: 1px solid var(--border-color);
  color: #495057;
  font-size: 0.65625rem;
  font-weight: 500;
}

/* Buttons */
.btn {
  border-radius: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-weight: 500;
  font-size: 0.65625rem;
  transition: all 0.2s;
}

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

.btn-primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-success {
  background-color: var(--success-color);
  border-color: var(--success-color);
}

.btn-success:hover {
  background-color: #157347;
  border-color: #146c43;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-outline-secondary {
  border-color: var(--border-color);
  color: #495057;
}

.btn-outline-secondary:hover {
  background-color: var(--light-bg);
  border-color: var(--border-color);
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border-color);
  border-radius: 0.375rem;
  padding: 0.5625rem 0.75rem;
  background-color: var(--light-bg);
  color: var(--text-muted);
  transition: all 0.3s;
  cursor: pointer;
  min-height: auto;
}

.dropzone:hover {
  border-color: var(--primary-color);
  background-color: rgba(13, 110, 253, 0.05);
}

.dropzone.dragover {
  border-color: var(--primary-color);
  background-color: rgba(13, 110, 253, 0.1);
  color: var(--primary-color);
}

.dropzone i {
  color: var(--primary-color);
  flex-shrink: 0;
}

/* Tables */
.table {
  margin-bottom: 0;
}

.table thead th {
  background-color: var(--light-bg);
  border-bottom: 2px solid var(--border-color);
  font-weight: 600;
  color: #495057;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.table tbody td {
  padding: 0.5625rem 0.75rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color);
}

.table tbody tr {
  transition: all 0.2s;
}

.table tbody tr:hover {
  background-color: rgba(13, 110, 253, 0.05);
  cursor: pointer;
}

.table-responsive {
  border-radius: 0.375rem;
  max-height: 60vh;
  overflow-y: auto;
}

/* Badges */
.badge {
  padding: 0.35em 0.65em;
  font-weight: 500;
  font-size: 0.75em;
  border-radius: 0.375rem;
}

.badge-pass {
  background-color: var(--success-color);
  color: #ffffff;
}

.badge-fail {
  background-color: var(--danger-color);
  color: #ffffff;
}

/* Tabs */
.nav-tabs {
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1.125rem;
}

.nav-tabs .nav-link {
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-weight: 500;
  padding: 0.5625rem 1.125rem;
  transition: all 0.2s;
}

.nav-tabs .nav-link:hover {
  border-bottom-color: var(--border-color);
  color: #212529;
}

.nav-tabs .nav-link.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background-color: transparent;
}

/* Stats Cards */
.stat-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  border-radius: 0.5625rem;
  padding: 1.125rem;
  margin-bottom: 1.125rem;
}

.stat-card.success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-card.danger {
  background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
}

.stat-card.info {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-card-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.1875rem;
}

.stat-card-label {
  font-size: 0.65625rem;
  opacity: 0.9;
}

/* Section Title */
.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #212529;
  margin-bottom: 1.125rem;
  display: flex;
  align-items: center;
}

.section-title i {
  margin-right: 0.5625rem;
  color: var(--primary-color);
}

/* Alerts */
.alert {
  border-radius: 0.375rem;
  border: none;
  padding: 0.75rem 0.9375rem;
}

/* Utilities */
.text-muted {
  color: var(--text-muted) !important;
}

.small-muted {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .header-toggle {
    display: block;
  }
}

@media (min-width: 993px) {
  .header-toggle {
    display: none;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Loading Spinner */
.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 0.15em;
}

/* Chart Container */
.chart-container {
  position: relative;
  height: 300px;
  margin-top: 0.75rem;
  width: 100%;
  overflow: hidden;
}

/* Pass/Fail Rate Chart specific styles */
#summaryChartSPI,
#summaryChartMOI,
#summaryChartAOI {
  max-width: 100%;
  height: auto !important;
}

.chart-container:has(#summaryChartSPI),
.chart-container:has(#summaryChartMOI),
.chart-container:has(#summaryChartAOI) {
  overflow: visible !important;
  min-height: 350px;
  padding-bottom: 5px;
  margin-bottom: 0;
}

/* Ensure chart canvas doesn't clip text */
.card-body:has(#summaryChartSPI),
.card-body:has(#summaryChartMOI),
.card-body:has(#summaryChartAOI) {
  overflow: visible !important;
}

.card:has(#summaryChartSPI),
.card:has(#summaryChartMOI),
.card:has(#summaryChartAOI) {
  overflow: visible !important;
}

/* Progress Bar */
.progress-container {
  display: none;
  padding: 0.375rem;
  background: var(--light-bg);
  border-radius: 0.375rem;
  border: 1px solid var(--border-color);
}

.progress-container.show {
  display: block !important;
}

@media (max-width: 991px) {
  .progress-container {
    margin-top: 0.375rem !important;
  }
}

.progress {
  height: 1.125rem;
  background-color: #e9ecef;
  border-radius: 0.375rem;
  overflow: hidden;
  margin-bottom: 0.375rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color) 0%, #0b5ed7 100%);
  transition: width 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.5625rem;
  font-weight: 600;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65625rem;
  color: var(--text-muted);
  margin-bottom: 0.375rem;
}

.progress-status {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.progress-spinner {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border: 1.5px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.progress-details {
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* ====== Notification/Toast Styles ====== */
.notification-container {
  position: fixed;
  top: 60px;
  right: 15px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 315px;
  width: 100%;
  pointer-events: none;
}

.notification {
  background: #ffffff;
  border-radius: 9px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.15);
  padding: 0;
  overflow: hidden;
  transform: translateX(500px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  pointer-events: auto;
  position: relative;
  border-left: 3px solid;
  width: 100%;
}

.notification.show {
  transform: translateX(0);
  opacity: 1;
}

.notification.hide {
  transform: translateX(500px);
  opacity: 0;
}

.notification-success {
  border-left-color: var(--success-color);
}

.notification-error {
  border-left-color: var(--danger-color);
}

.notification-warning {
  border-left-color: var(--warning-color);
}

.notification-info {
  border-left-color: var(--info-color);
}

.notification-content {
  display: flex;
  align-items: flex-start;
  padding: 12px;
  gap: 9px;
}

.notification-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  margin-top: 1.5px;
}

.notification-success .notification-icon {
  color: var(--success-color);
}

.notification-error .notification-icon {
  color: var(--danger-color);
}

.notification-warning .notification-icon {
  color: var(--warning-color);
}

.notification-info .notification-icon {
  color: var(--info-color);
}

.notification-body {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: 11.25px;
  font-weight: 600;
  color: #212529;
  margin-bottom: 3px;
  line-height: 1.4;
}

.notification-message {
  font-size: 10.5px;
  color: #6c757d;
  line-height: 1.5;
  margin-bottom: 6px;
}

.notification-details {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #e9ecef;
}

.notification-detail {
  font-size: 9.75px;
  color: #495057;
  line-height: 1.6;
  padding: 1.5px 0;
}

.notification-progress-wrapper {
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 7.5px;
}

.notification-progress-bar {
  flex: 1;
  height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.notification-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--info-color), var(--primary-color));
  border-radius: 3px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.notification-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: progress-shine 1.5s infinite;
}

@keyframes progress-shine {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.notification-progress-text {
  font-size: 9px;
  font-weight: 600;
  color: var(--info-color);
  min-width: 30px;
  text-align: right;
}

.notification-success .notification-progress-fill {
  background: linear-gradient(90deg, var(--success-color), #20c997);
}

.notification-success .notification-progress-text {
  color: var(--success-color);
}

.notification-close {
  background: none;
  border: none;
  padding: 3px;
  cursor: pointer;
  color: #6c757d;
  font-size: 13.5px;
  line-height: 1;
  transition: color 0.2s;
  flex-shrink: 0;
  margin-top: -1.5px;
  margin-right: -3px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.notification-close:hover {
  color: #212529;
  background: #f8f9fa;
}

.notification-progress {
  height: 2.25px;
  background: rgba(0, 0, 0, 0.1);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  transform-origin: left;
}

.notification-success .notification-progress {
  background: rgba(25, 135, 84, 0.2);
}

.notification-error .notification-progress {
  background: rgba(220, 53, 69, 0.2);
}

.notification-warning .notification-progress {
  background: rgba(255, 193, 7, 0.2);
}

.notification-info .notification-progress {
  background: rgba(13, 202, 240, 0.2);
}

@keyframes notification-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .notification-container {
    right: 10px;
    left: 10px;
    max-width: none;
    top: 52.5px;
  }
  
  .notification {
    transform: translateY(-100px);
  }
  
  .notification.show {
    transform: translateY(0);
  }
  
  .notification.hide {
    transform: translateY(-100px);
  }
}

/* Pass Rate Detail Table */
#tblPassRateDetail {
  border-collapse: collapse;
  font-size: 0.5625rem;
  width: 100%;
}

#tblPassRateDetail th {
  background-color: #f8f9fa !important;
  border: 1px solid #dee2e6;
  text-align: center;
  vertical-align: middle;
  font-weight: 600;
  padding: 0.2625rem 0.3rem !important;
  font-size: 0.5625rem;
  white-space: nowrap;
  line-height: 1.2;
}

#tblPassRateDetail td {
  border: 1px solid #dee2e6;
  vertical-align: middle;
  padding: 0.225rem 0.3rem !important;
  font-size: 0.5625rem;
  line-height: 1.2;
  text-align: center;
}

#tblPassRateDetail .text-danger {
  color: #dc3545 !important;
  font-weight: 600;
}

#tblPassRateDetail td[rowspan] {
  background-color: #f8f9fa;
  font-weight: 600;
  padding: 0.225rem 0.3rem !important;
  text-align: center;
}

#tblPassRateDetail tbody tr {
  height: auto;
  line-height: 1.2;
}

/* Override table-responsive for pass rate detail table container */
.card-body:has(#tblPassRateDetail) .table-responsive {
  max-height: none !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
}

/* Compact spacing for pass rate detail table */
#tblPassRateDetail {
  margin-bottom: 0 !important;
}

/* Pass Rate Control Tables - Same styling as Pass Rate Detail */
#tblPassRateControlSPI,
#tblPassRateControlMOI,
#tblPassRateControlAOI {
  border-collapse: collapse;
  font-size: 0.5625rem;
  width: 100%;
}

#tblPassRateControlSPI th,
#tblPassRateControlMOI th,
#tblPassRateControlAOI th {
  background-color: #f8f9fa !important;
  border: 1px solid #dee2e6;
  text-align: center;
  vertical-align: middle;
  font-weight: 600;
  padding: 0.2625rem 0.3rem !important;
  font-size: 0.5625rem;
  white-space: nowrap;
  line-height: 1.2;
}

#tblPassRateControlSPI td,
#tblPassRateControlMOI td,
#tblPassRateControlAOI td {
  border: 1px solid #dee2e6;
  vertical-align: middle;
  padding: 0.225rem 0.3rem !important;
  font-size: 0.5625rem;
  line-height: 1.2;
  text-align: center;
}

#tblPassRateControlSPI .text-danger,
#tblPassRateControlMOI .text-danger,
#tblPassRateControlAOI .text-danger {
  color: #dc3545 !important;
  font-weight: 600;
}

#tblPassRateControlSPI td[rowspan],
#tblPassRateControlMOI td[rowspan],
#tblPassRateControlAOI td[rowspan] {
  background-color: #f8f9fa;
  font-weight: 600;
  padding: 0.225rem 0.3rem !important;
  text-align: center;
}

#tblPassRateControlSPI tbody tr,
#tblPassRateControlMOI tbody tr,
#tblPassRateControlAOI tbody tr {
  height: auto;
  line-height: 1.2;
}

/* Override table-responsive for pass rate control table containers */
.card-body:has(#tblPassRateControlSPI) .table-responsive,
.card-body:has(#tblPassRateControlMOI) .table-responsive,
.card-body:has(#tblPassRateControlAOI) .table-responsive {
  max-height: none !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
}

/* Compact spacing for pass rate control tables */
#tblPassRateControlSPI,
#tblPassRateControlMOI,
#tblPassRateControlAOI {
  margin-bottom: 0 !important;
}

/* Filters for Summary Page (no sticky) */
#summaryFiltersCard {
  margin-bottom: 0.75rem !important;
}

/* Dashboard Cards */
.dashboard-card {
  border: none;
  border-radius: 0.5625rem;
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
}

.dashboard-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);
}

.dashboard-card .card-body {
  padding: 1.125rem;
}

.dashboard-card .card-footer {
  padding: 0.5625rem 1.125rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dashboard-icon {
  font-size: 1.875rem;
  opacity: 0.3;
}

/* Modern Gradient Backgrounds */
.dashboard-card-gradient-1 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.dashboard-card-gradient-2 {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.dashboard-card-gradient-3 {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
}

.dashboard-card-gradient-4 {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  color: white;
}

.text-white-50 {
  color: rgba(255, 255, 255, 0.5) !important;
}

.text-white-75 {
  color: rgba(255, 255, 255, 0.75) !important;
}

/* Quick Access Cards */
.quick-access-card {
  transition: all 0.3s ease;
  cursor: pointer;
  background-color: #fff;
}

.quick-access-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color) !important;
}

.quick-access-card i {
  transition: transform 0.3s ease;
}

.quick-access-card:hover i {
  transform: scale(1.1);
}

/* Module Status */
.module-status-item .progress {
  border-radius: 0.25rem;
}

/* Production Lines Cards */
.card.bg-light {
  background-color: #f8f9fa !important;
  border: 1px solid #e9ecef;
}

.vr {
  opacity: 0.3;
}

/* Editable Cell Styles (for passrate settings) */
.editable-cell {
  cursor: pointer;
  padding: 0.375rem;
  border-radius: 0.1875rem;
  transition: background-color 0.2s;
  min-height: 28.5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.editable-cell:hover {
  background-color: #f8f9fa;
}

.editable-cell .value {
  font-weight: 600;
  color: #0d6efd;
}

.editable-cell input {
  text-align: center;
  font-weight: 600;
}

.editable-cell input:focus {
  border-color: #0d6efd;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Edit and Delete period buttons in table header */
.btn-edit-period,
.btn-delete-period {
  padding: 0.09375rem 0.28125rem;
  font-size: 0.5625rem;
  line-height: 1;
}

.btn-edit-period:hover,
.btn-delete-period:hover {
  transform: scale(1.1);
}

/* Target settings table styling */
#tblTargetSettings {
  font-size: 0.675rem;
}

#tblTargetSettings thead th {
  background-color: #f8f9fa;
  font-weight: 600;
  border-bottom: 2px solid #dee2e6;
  padding: 0.5625rem 0.375rem;
  vertical-align: middle;
}

#tblTargetSettings tbody td {
  vertical-align: middle;
  padding: 0.375rem;
}

/* Production Plan Table - Auto fit column width */
#productionPlanTable {
  table-layout: auto;
  width: max-content;
  min-width: 100%;
}

#productionPlanTable thead th {
  white-space: nowrap;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  width: auto;
}

#productionPlanTable tbody td {
  white-space: nowrap;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  width: auto;
}

#productionPlanTable .table-responsive {
  overflow-x: auto;
  width: 100%;
}

/* Production Plan Table - Highlight rows */
/* Override Bootstrap table-hover for highlighted rows */
/* JavaScript sets background-color with !important, CSS ensures hover doesn't override */
#productionPlanTable.table-hover > tbody > tr.highlighted-row:hover > td {
  background-color: inherit !important;
}

/* ====== Modern Dashboard Styles ====== */

/* Hero Section */
.dashboard-hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 0.5rem 1.5rem rgba(102, 126, 234, 0.3);
}

.hero-content {
  color: white;
}

.hero-title {
  font-size: 2rem;
  font-weight: 700;
  color: white;
  margin: 0;
}

.hero-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.875rem;
}

.hero-stats {
  margin-top: 1.5rem;
}

.hero-stat-item {
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: white;
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 0.25rem;
}

.hero-quick-actions {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  color: white;
  height: 100%;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-quick-actions h6 {
  color: white;
  font-weight: 600;
}

.hero-quick-actions .btn-outline-primary,
.hero-quick-actions .btn-outline-warning,
.hero-quick-actions .btn-outline-success {
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

.hero-quick-actions .btn-outline-primary:hover,
.hero-quick-actions .btn-outline-warning:hover,
.hero-quick-actions .btn-outline-success:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
}

/* Modern Stat Cards */
.stat-card-modern {
  background: white;
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 1px solid #f0f0f0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.stat-card-modern:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.stat-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.stat-icon {
  font-size: 2rem;
  opacity: 0.8;
}

.stat-card-primary .stat-icon {
  color: #667eea;
}

.stat-card-warning .stat-icon {
  color: #f093fb;
}

.stat-card-info .stat-icon {
  color: #4facfe;
}

.stat-card-success .stat-icon {
  color: #43e97b;
}

.stat-badge {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  font-weight: 600;
}

.stat-card-body {
  flex: 1;
}

.stat-main-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #212529;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-main-label {
  font-size: 0.875rem;
  color: #6c757d;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.stat-trend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #6c757d;
}

.stat-card-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #f0f0f0;
}

.stat-link {
  color: #667eea;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  transition: color 0.2s;
}

.stat-link:hover {
  color: #5568d3;
}

/* Modern Chart Cards */
.chart-card-modern {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #f0f0f0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.chart-card-modern:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.chart-header-modern {
  padding: 1.25rem;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: #fafafa;
}

.chart-header-modern h5 {
  font-size: 1rem;
  font-weight: 600;
  color: #212529;
  margin: 0;
}

.chart-header-modern .text-muted {
  font-size: 0.75rem;
}

.chart-actions {
  display: flex;
  gap: 0.5rem;
}

.chart-body-modern {
  padding: 1.25rem;
  position: relative;
  min-height: 300px;
}

.chart-body-modern canvas {
  max-height: 300px;
}

/* Modern Progress Bars */
.progress-modern {
  height: 28px;
  background-color: #f0f0f0;
  border-radius: 0.5rem;
  overflow: hidden;
  position: relative;
}

.progress-bar-modern {
  height: 100%;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.6s ease;
  position: relative;
  overflow: hidden;
}

.progress-text {
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  z-index: 1;
  position: relative;
}

.resource-item {
  padding: 0.75rem 0;
}

.resource-item:not(:last-child) {
  border-bottom: 1px solid #f0f0f0;
}

.network-stats {
  padding: 0.5rem 0.75rem;
  background: #f8f9fa;
  border-radius: 0.375rem;
}

/* Activity Timeline */
.activity-timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 0.375rem;
  top: 1.5rem;
  bottom: -1.5rem;
  width: 2px;
  background: #e9ecef;
}

.timeline-marker {
  position: absolute;
  left: 0;
  top: 0.25rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 0 2px;
  z-index: 1;
}

.timeline-marker-primary {
  background: #667eea;
  box-shadow: 0 0 0 2px #667eea;
}

.timeline-marker-success {
  background: #43e97b;
  box-shadow: 0 0 0 2px #43e97b;
}

.timeline-marker-warning {
  background: #f093fb;
  box-shadow: 0 0 0 2px #f093fb;
}

.timeline-marker-info {
  background: #4facfe;
  box-shadow: 0 0 0 2px #4facfe;
}

.timeline-marker-danger {
  background: #f5576c;
  box-shadow: 0 0 0 2px #f5576c;
}

.timeline-content h6 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #212529;
  margin-bottom: 0.25rem;
}

.timeline-content .text-muted {
  font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 1.5rem;
  }
  
  .hero-stats {
    flex-direction: column;
    gap: 1rem;
  }
  
  .stat-main-value {
    font-size: 2rem;
  }
  
  .chart-body-modern {
    min-height: 250px;
  }
  
  .activity-timeline {
    padding-left: 1.5rem;
  }
  
  .timeline-item {
    padding-left: 1rem;
  }
}

