/* MSA users + other list-table colours — 20261206u2
   u2: Actions column sizing + no clipped/overlapping View/Edit. Scoped by path. Visual + display-only QA row hide. No handler, permission, or DB changes. */
body[data-msa-path="/users"],
body[data-msa-path="/trucks"],
body[data-msa-path="/suppliers"],
body[data-msa-path="/customers"],
body[data-msa-path="/employees"] {
  --msa-trip-open-bg: #e8f1fb;
  --msa-trip-open-border: #3b82f6;
  --msa-trip-open-ink: #1d4ed8;
  --msa-trip-done-bg: #e8f6ee;
  --msa-trip-done-border: #16a34a;
  --msa-trip-done-ink: #15803d;
  --msa-trip-fail-bg: #fdecec;
  --msa-trip-fail-border: #dc2626;
  --msa-trip-fail-ink: #b91c1c;
  --msa-dash-amber-bg: #fff6e8;
  --msa-dash-amber-border: #f59e0b;
  --msa-dash-amber-ink: #b45309;
  --msa-dash-violet-bg: #f3eefc;
  --msa-dash-violet-border: #7c3aed;
  --msa-dash-violet-ink: #5b21b6;
  --msa-trip-ink: #1f2937;
  --msa-trip-muted: #4b5563;
  --msa-trip-header: #dce3ec;
  --msa-trip-header-ink: #1f2937;
  --msa-trip-row-alt: #e7eef7;
  --msa-trip-row-hover: #e8f2ff;
  --msa-trip-line: #c5d0dc;
}

/* Users: hide QA/test rows unless the admin toggle is on. */
body[data-msa-path="/users"]:not([data-msa-show-qa-users="1"]) #root main table tbody tr[data-msa-qa-user="1"] {
  display: none !important;
}

/* Users heading + toggle */
#msa-users-qa-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--msa-trip-muted);
  cursor: pointer;
  user-select: none;
}
#msa-users-qa-toggle input { margin: 0; }
#msa-users-qa-note {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  color: var(--msa-trip-muted);
  font-weight: 500;
}

body[data-msa-path="/users"] .msa-directory-heading h5,
body[data-msa-path="/users"] #root main h5 {
  color: var(--msa-trip-header-ink);
}

/* Shared table chrome (users + other list pages). */
body[data-msa-path="/users"] #root main table thead th,
body[data-msa-path="/trucks"] #root main table thead th,
body[data-msa-path="/suppliers"] #root main table thead th,
body[data-msa-path="/customers"] #root main table thead th,
body[data-msa-path="/employees"] #root main table thead th {
  background: var(--msa-trip-header) !important;
  color: var(--msa-trip-header-ink) !important;
  font-weight: 700 !important;
  border-bottom: 1px solid var(--msa-trip-line) !important;
}
body[data-msa-path="/users"] #root main table tbody tr,
body[data-msa-path="/trucks"] #root main table tbody tr,
body[data-msa-path="/suppliers"] #root main table tbody tr,
body[data-msa-path="/customers"] #root main table tbody tr,
body[data-msa-path="/employees"] #root main table tbody tr {
  background: #fff !important;
  box-shadow: inset 0 0 0 9999px #fff;
}
body[data-msa-path="/users"] #root main table tbody tr:nth-child(even),
body[data-msa-path="/trucks"] #root main table tbody tr:nth-child(even),
body[data-msa-path="/suppliers"] #root main table tbody tr:nth-child(even),
body[data-msa-path="/customers"] #root main table tbody tr:nth-child(even),
body[data-msa-path="/employees"] #root main table tbody tr:nth-child(even) {
  background: var(--msa-trip-row-alt) !important;
  box-shadow: inset 0 0 0 9999px var(--msa-trip-row-alt);
}
body[data-msa-path="/users"] #root main table tbody tr:hover,
body[data-msa-path="/trucks"] #root main table tbody tr:hover,
body[data-msa-path="/suppliers"] #root main table tbody tr:hover,
body[data-msa-path="/customers"] #root main table tbody tr:hover,
body[data-msa-path="/employees"] #root main table tbody tr:hover {
  background: var(--msa-trip-row-hover) !important;
  box-shadow: inset 0 0 0 9999px var(--msa-trip-row-hover);
}

/* Users status pills */
body[data-msa-path="/users"] #root main table tbody td [data-msa-status-pill="active"],
body[data-msa-path="/users"] #root main table tbody td span[data-msa-status-pill="active"] {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--msa-trip-done-bg);
  color: var(--msa-trip-done-ink);
  border: 1px solid #86efac;
  font-weight: 700;
  font-size: 12px;
}
body[data-msa-path="/users"] #root main table tbody td [data-msa-status-pill="deactivated"],
body[data-msa-path="/users"] #root main table tbody td span[data-msa-status-pill="deactivated"] {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #d1d5db;
  font-weight: 700;
  font-size: 12px;
}

/* Labelled action buttons (View / Edit icon buttons, plus existing text buttons).
   u2: give the Actions column room, keep buttons on one row with a gap,
   and stop MUI IconButton's fixed width + overflow:hidden from clipping
   "View" (it was reading as "Viev") or overlapping Edit. */
body[data-msa-path="/users"] #root main table,
body[data-msa-path="/trucks"] #root main table,
body[data-msa-path="/suppliers"] #root main table,
body[data-msa-path="/customers"] #root main table,
body[data-msa-path="/employees"] #root main table {
  table-layout: auto;
}
body[data-msa-path="/users"] #root main table thead th:last-child,
body[data-msa-path="/users"] #root main table tbody td:last-child,
body[data-msa-path="/trucks"] #root main table thead th:last-child,
body[data-msa-path="/trucks"] #root main table tbody td:last-child,
body[data-msa-path="/suppliers"] #root main table thead th:last-child,
body[data-msa-path="/suppliers"] #root main table tbody td:last-child,
body[data-msa-path="/customers"] #root main table thead th:last-child,
body[data-msa-path="/customers"] #root main table tbody td:last-child,
body[data-msa-path="/employees"] #root main table thead th:last-child,
body[data-msa-path="/employees"] #root main table tbody td:last-child {
  min-width: 17rem;
  width: auto;
  white-space: nowrap;
  vertical-align: middle;
}
body[data-msa-path="/users"] #root main table tbody td:last-child,
body[data-msa-path="/users"] #root main table tbody td.p-3.flex,
body[data-msa-path="/users"] #root main table tbody td[class*="space-x-2"],
body[data-msa-path="/trucks"] #root main table tbody td:last-child,
body[data-msa-path="/trucks"] #root main table tbody td[class*="space-x-2"],
body[data-msa-path="/suppliers"] #root main table tbody td:last-child,
body[data-msa-path="/suppliers"] #root main table tbody td[class*="space-x-2"],
body[data-msa-path="/customers"] #root main table tbody td:last-child,
body[data-msa-path="/customers"] #root main table tbody td[class*="space-x-2"],
body[data-msa-path="/employees"] #root main table tbody td:last-child,
body[data-msa-path="/employees"] #root main table tbody td[class*="space-x-2"] {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  width: max-content;
  max-width: none;
}
body[data-msa-path="/users"] #root main table tbody td:last-child > * + *,
body[data-msa-path="/users"] #root main table tbody td[class*="space-x-2"] > * + *,
body[data-msa-path="/trucks"] #root main table tbody td:last-child > * + *,
body[data-msa-path="/trucks"] #root main table tbody td[class*="space-x-2"] > * + *,
body[data-msa-path="/suppliers"] #root main table tbody td:last-child > * + *,
body[data-msa-path="/suppliers"] #root main table tbody td[class*="space-x-2"] > * + *,
body[data-msa-path="/customers"] #root main table tbody td:last-child > * + *,
body[data-msa-path="/customers"] #root main table tbody td[class*="space-x-2"] > * + *,
body[data-msa-path="/employees"] #root main table tbody td:last-child > * + *,
body[data-msa-path="/employees"] #root main table tbody td[class*="space-x-2"] > * + * {
  margin-left: 0 !important;
}

body[data-msa-path="/users"] #root main table tbody [data-msa-user-action],
body[data-msa-path="/trucks"] #root main table tbody [data-msa-user-action],
body[data-msa-path="/suppliers"] #root main table tbody [data-msa-user-action],
body[data-msa-path="/customers"] #root main table tbody [data-msa-user-action],
body[data-msa-path="/employees"] #root main table tbody [data-msa-user-action] {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  width: auto !important;
  max-width: none !important;
  min-width: 4.75rem !important;
  height: auto !important;
  min-height: 32px !important;
  padding: 4px 8px !important;
  margin: 0 !important;
  overflow: visible !important;
  white-space: nowrap !important;
  flex: 0 0 auto !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
  border-radius: 6px !important;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.2;
  text-transform: none;
  box-shadow: none !important;
}
body[data-msa-path="/users"] #root main table tbody [data-msa-user-action="reset"],
body[data-msa-path="/users"] #root main table tbody [data-msa-user-action="deactivate"],
body[data-msa-path="/users"] #root main table tbody [data-msa-user-action="activate"],
body[data-msa-path="/users"] button[data-msa-user-action="reset"],
body[data-msa-path="/users"] button[data-msa-user-action="deactivate"],
body[data-msa-path="/users"] button[data-msa-user-action="activate"] {
  min-width: 8.25rem !important;
  width: auto !important;
  overflow: visible !important;
  white-space: nowrap !important;
}
body[data-msa-path="/users"] #root main table tbody [data-msa-user-action]::after,
body[data-msa-path="/trucks"] #root main table tbody [data-msa-user-action]::after,
body[data-msa-path="/suppliers"] #root main table tbody [data-msa-user-action]::after,
body[data-msa-path="/customers"] #root main table tbody [data-msa-user-action]::after,
body[data-msa-path="/employees"] #root main table tbody [data-msa-user-action]::after {
  white-space: nowrap;
  flex: 0 0 auto;
  overflow: visible;
}
body[data-msa-path="/users"] #root main table tbody [data-msa-user-action] svg,
body[data-msa-path="/trucks"] #root main table tbody [data-msa-user-action] svg,
body[data-msa-path="/suppliers"] #root main table tbody [data-msa-user-action] svg,
body[data-msa-path="/customers"] #root main table tbody [data-msa-user-action] svg,
body[data-msa-path="/employees"] #root main table tbody [data-msa-user-action] svg {
  fill: currentColor;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  flex: 0 0 16px !important;
  overflow: visible;
}
body[data-msa-path="/users"] #root main table tbody [data-msa-user-action] path[fill="none"],
body[data-msa-path="/trucks"] #root main table tbody [data-msa-user-action] path[fill="none"],
body[data-msa-path="/suppliers"] #root main table tbody [data-msa-user-action] path[fill="none"],
body[data-msa-path="/customers"] #root main table tbody [data-msa-user-action] path[fill="none"],
body[data-msa-path="/employees"] #root main table tbody [data-msa-user-action] path[fill="none"] {
  fill: none !important;
}
body[data-msa-path="/users"] #root main table tbody [data-msa-user-action="view"],
body[data-msa-path="/trucks"] #root main table tbody [data-msa-user-action="view"],
body[data-msa-path="/suppliers"] #root main table tbody [data-msa-user-action="view"],
body[data-msa-path="/customers"] #root main table tbody [data-msa-user-action="view"],
body[data-msa-path="/employees"] #root main table tbody [data-msa-user-action="view"] {
  color: var(--msa-trip-open-ink) !important;
  background: var(--msa-trip-open-bg) !important;
  border: 1px solid #93c5fd !important;
}
body[data-msa-path="/users"] #root main table tbody [data-msa-user-action="edit"],
body[data-msa-path="/trucks"] #root main table tbody [data-msa-user-action="edit"],
body[data-msa-path="/suppliers"] #root main table tbody [data-msa-user-action="edit"],
body[data-msa-path="/customers"] #root main table tbody [data-msa-user-action="edit"],
body[data-msa-path="/employees"] #root main table tbody [data-msa-user-action="edit"] {
  color: var(--msa-trip-open-ink) !important;
  background: var(--msa-trip-open-bg) !important;
  border: 1px solid #93c5fd !important;
}
body[data-msa-path="/users"] #root main table tbody [data-msa-user-action="delete"],
body[data-msa-path="/trucks"] #root main table tbody [data-msa-user-action="delete"],
body[data-msa-path="/suppliers"] #root main table tbody [data-msa-user-action="delete"],
body[data-msa-path="/customers"] #root main table tbody [data-msa-user-action="delete"],
body[data-msa-path="/employees"] #root main table tbody [data-msa-user-action="delete"] {
  color: var(--msa-trip-fail-ink) !important;
  background: var(--msa-trip-fail-bg) !important;
  border: 1px solid #fca5a5 !important;
}
body[data-msa-path="/users"] #root main table tbody [data-msa-user-action="deactivate"],
body[data-msa-path="/users"] button[data-msa-user-action="deactivate"] {
  color: #9a3412 !important;
  background: var(--msa-dash-amber-bg) !important;
  background-color: var(--msa-dash-amber-bg) !important;
  border: 1px solid #fdba74 !important;
}
body[data-msa-path="/users"] #root main table tbody [data-msa-user-action="activate"],
body[data-msa-path="/users"] button[data-msa-user-action="activate"] {
  color: var(--msa-trip-done-ink) !important;
  background: var(--msa-trip-done-bg) !important;
  background-color: var(--msa-trip-done-bg) !important;
  border: 1px solid #86efac !important;
}
body[data-msa-path="/users"] #root main table tbody [data-msa-user-action="reset"],
body[data-msa-path="/users"] button[data-msa-user-action="reset"] {
  color: var(--msa-dash-violet-ink) !important;
  background: var(--msa-dash-violet-bg) !important;
  background-color: var(--msa-dash-violet-bg) !important;
  border: 1px solid #c4b5fd !important;
}
body[data-msa-path="/users"] #root main table tbody [data-msa-user-action="view"]::after { content: "View"; }
body[data-msa-path="/users"] #root main table tbody [data-msa-user-action="edit"]::after { content: "Edit"; }
body[data-msa-path="/trucks"] #root main table tbody [data-msa-user-action="view"]::after,
body[data-msa-path="/suppliers"] #root main table tbody [data-msa-user-action="view"]::after,
body[data-msa-path="/customers"] #root main table tbody [data-msa-user-action="view"]::after,
body[data-msa-path="/employees"] #root main table tbody [data-msa-user-action="view"]::after { content: "View"; }
body[data-msa-path="/trucks"] #root main table tbody [data-msa-user-action="edit"]::after,
body[data-msa-path="/suppliers"] #root main table tbody [data-msa-user-action="edit"]::after,
body[data-msa-path="/customers"] #root main table tbody [data-msa-user-action="edit"]::after,
body[data-msa-path="/employees"] #root main table tbody [data-msa-user-action="edit"]::after { content: "Edit"; }
body[data-msa-path="/trucks"] #root main table tbody [data-msa-user-action="delete"]::after,
body[data-msa-path="/suppliers"] #root main table tbody [data-msa-user-action="delete"]::after,
body[data-msa-path="/customers"] #root main table tbody [data-msa-user-action="delete"]::after,
body[data-msa-path="/employees"] #root main table tbody [data-msa-user-action="delete"]::after { content: "Delete"; }

@media (max-width: 680px) {
  body[data-msa-path="/users"] #root main table thead th:last-child,
  body[data-msa-path="/users"] #root main table tbody td:last-child,
  body[data-msa-path="/trucks"] #root main table thead th:last-child,
  body[data-msa-path="/trucks"] #root main table tbody td:last-child,
  body[data-msa-path="/suppliers"] #root main table thead th:last-child,
  body[data-msa-path="/suppliers"] #root main table tbody td:last-child,
  body[data-msa-path="/customers"] #root main table thead th:last-child,
  body[data-msa-path="/customers"] #root main table tbody td:last-child,
  body[data-msa-path="/employees"] #root main table thead th:last-child,
  body[data-msa-path="/employees"] #root main table tbody td:last-child {
    min-width: 0;
    white-space: normal;
  }
  body[data-msa-path="/users"] #root main table tbody td:last-child,
  body[data-msa-path="/users"] #root main table tbody td.p-3.flex,
  body[data-msa-path="/users"] #root main table tbody td[class*="space-x-2"],
  body[data-msa-path="/trucks"] #root main table tbody td:last-child,
  body[data-msa-path="/trucks"] #root main table tbody td[class*="space-x-2"],
  body[data-msa-path="/suppliers"] #root main table tbody td:last-child,
  body[data-msa-path="/suppliers"] #root main table tbody td[class*="space-x-2"],
  body[data-msa-path="/customers"] #root main table tbody td:last-child,
  body[data-msa-path="/customers"] #root main table tbody td[class*="space-x-2"],
  body[data-msa-path="/employees"] #root main table tbody td:last-child,
  body[data-msa-path="/employees"] #root main table tbody td[class*="space-x-2"] {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  body[data-msa-path="/users"] #root main table tbody [data-msa-user-action],
  body[data-msa-path="/trucks"] #root main table tbody [data-msa-user-action],
  body[data-msa-path="/suppliers"] #root main table tbody [data-msa-user-action],
  body[data-msa-path="/customers"] #root main table tbody [data-msa-user-action],
  body[data-msa-path="/employees"] #root main table tbody [data-msa-user-action] {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }
}
