  #viewer {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 100%;
  margin: 0 auto;
  overflow-x: auto;
  /* background: #ffffff; */
  /* padding: 2rem; */
  /* border-radius: 16px; */
  /* box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04); */
}

/* Header styling */
#viewer .manager-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.75rem;
  margin-top: 0.25em;
  flex-wrap: wrap;
}

#viewer .manager-header h3 {
  display:none;
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--bs-body-text);
  letter-spacing: -0.02em;
}

#viewer .manager-header button {
  padding: 5px 12px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Header button colors (scoped safely with nth-of-type) */
#viewer .manager-header button:nth-of-type(1) { /* Export CSV */
  background: #64748b; /* #10b981 */
  color: #fff;
}
#viewer .manager-header button:nth-of-type(1):hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

#viewer .manager-header button:nth-of-type(2) { /* Import CSV */
  background: #64748b; /* #3b82f6 */
  color: #fff;
}
#viewer .manager-header button:nth-of-type(2):hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

#viewer .manager-header button:nth-of-type(3) { /* Clear All Data */
  background: #64748b; /* #ef4444 */
  color: #fff;
}
#viewer .manager-header button:nth-of-type(3):hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.3);
}

#viewer .manager-header button:nth-of-type(4) { /* Refresh Table */
  background: #64748b;
  color: #fff;
}
#viewer .manager-header button:nth-of-type(4):hover {
  background: #475569;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(100, 116, 139, 0.3);
}

/* Table styling – clean & modern */
#viewer table {
  width: 100%;
  /* border-collapse: collapse; */
  /* background: #fff; */
  /* border-radius: 12px; */
  overflow: hidden;
  /* box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1); */
}

#viewer thead {
  /* background: #f8fafc; */
}

#viewer th {
  /* padding: 1.25rem 1.5rem; */
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  /* color: #334155; */
  text-align: left;
  /* border-bottom: 3px solid #e2e8f0; */
}

/* Column alignment (no HTML changes needed) */
#viewer th:first-child { text-align: left; }
#viewer th:last-child { text-align: center; }

/* Data rows */
#viewer tbody tr {
  transition: background-color 0.2s ease;
}
#viewer tbody tr:hover {
  /* background-color: #f8fafc; */
}

#viewer td {
  /* padding: 1.25rem 1.5rem; */
  border-bottom: 1px solid #f1f5f9;
  /* color: #1e2937; */
  font-size: 1rem;
}

/* Data column alignment & styling */
#viewer td:first-child {
  font-weight: 600;
  /* color: #0f172a; */
}

#viewer td:not(:last-child) {
  text-align: left;
  font-variant-numeric: tabular-nums;
  padding-right: 12px;
}

/* Last 4 columns = Actions (centered, compact) */
#viewer td:last-child {
  display: flex;
  gap: 8px;
  justify-content: center;
}

/* Action buttons inside table */
#viewer .edit-btn,
#viewer .delete-btn,
#viewer .move-up,
#viewer .move-down {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  text-wrap: nowrap;
}

#viewer .edit-btn {
  background: #3b82f6;
  color: #fff;
}
#viewer .edit-btn:hover {
  background: #2563eb;
  transform: scale(1.05);
}

#viewer .delete-btn {
  background: #ef4444;
  color: #fff;
}
#viewer .delete-btn:hover {
  background: #dc2626;
  transform: scale(1.05);
}

#viewer .move-up,
#viewer .move-down {
  background: #64748b;
  color: #fff;
  padding: 6px 10px; /* slightly tighter for arrows */
  min-width: 32px;
}
#viewer .move-up:hover,
#viewer .move-down:hover {
  background: #475569;
  transform: scale(1.05);
}

/* Remove bottom border on last row */
#viewer tbody tr:last-child td {
  border-bottom: none;
}

/* Tiny polish for the percent_error column */
#viewer td:nth-child(4) {
  font-weight: 500;
  color: #b91c1c; /* subtle red tone for errors (works great with negative values) */
}