/* MSA /trips colour style — 20261206c2
   c2: labelled Edit/Delete/View buttons; colour the glyph only (do not fill spacer paths).
   Mohamed (6 Dec 2026, 11:40 EAT): "iwe na colour nzuri".
   CSS/UI only. Scoped to the Trips list page. Does not change logic, data,
   API, permissions, copy, or the green sidebar brand (#43A515).
   Beats msa-theme-live (20261127live3) flatten rules on /trips only.
*/
body[data-msa-path="/trips"] {
  --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-month-bg: #e6f7f6;
  --msa-trip-month-border: #0d9488;
  --msa-trip-month-ink: #0f766e;
  --msa-trip-fail-bg: #fdecec;
  --msa-trip-fail-border: #dc2626;
  --msa-trip-fail-ink: #b91c1c;
  --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;
}

/* -------------------------------------------------------------------------- */
/* 1. KPI cards — soft tint + matching left border, title and number colour    */
/*    data-msa-count-card is set on the MuiGrid-item; the card is h-[140px].   */
/* -------------------------------------------------------------------------- */
body[data-msa-path="/trips"] #root main [data-msa-count-card] [class*="h-[140px]"],
body[data-msa-path="/trips"] #root main [data-msa-count-card] .h-\[140px\],
body[data-msa-path="/trips"] #root main [data-msa-count-card] [data-msa-trip-kind="metric"] {
  background-image: none !important;
  color: var(--msa-trip-ink) !important;
  border: 1px solid var(--msa-trip-line) !important;
  box-shadow: none !important;
  border-radius: 10px !important;
}

body[data-msa-path="/trips"] #root main [data-msa-count-card="inProgress"] [class*="h-[140px]"],
body[data-msa-path="/trips"] #root main [data-msa-count-card="inProgress"] .h-\[140px\],
body[data-msa-path="/trips"] #root main [data-msa-count-card="inProgress"] [data-msa-trip-kind="metric"] {
  background: var(--msa-trip-open-bg) !important;
  background-color: var(--msa-trip-open-bg) !important;
  border-left: 4px solid var(--msa-trip-open-border) !important;
}
body[data-msa-path="/trips"] #root main [data-msa-count-card="completed"] [class*="h-[140px]"],
body[data-msa-path="/trips"] #root main [data-msa-count-card="completed"] .h-\[140px\],
body[data-msa-path="/trips"] #root main [data-msa-count-card="completed"] [data-msa-trip-kind="metric"] {
  background: var(--msa-trip-done-bg) !important;
  background-color: var(--msa-trip-done-bg) !important;
  border-left: 4px solid var(--msa-trip-done-border) !important;
}
body[data-msa-path="/trips"] #root main [data-msa-count-card="month"] [class*="h-[140px]"],
body[data-msa-path="/trips"] #root main [data-msa-count-card="month"] .h-\[140px\],
body[data-msa-path="/trips"] #root main [data-msa-count-card="month"] [data-msa-trip-kind="metric"] {
  background: var(--msa-trip-month-bg) !important;
  background-color: var(--msa-trip-month-bg) !important;
  border-left: 4px solid var(--msa-trip-month-border) !important;
}
body[data-msa-path="/trips"] #root main [data-msa-count-card="failed"] [class*="h-[140px]"],
body[data-msa-path="/trips"] #root main [data-msa-count-card="failed"] .h-\[140px\],
body[data-msa-path="/trips"] #root main [data-msa-count-card="failed"] [data-msa-trip-kind="metric"] {
  background: var(--msa-trip-fail-bg) !important;
  background-color: var(--msa-trip-fail-bg) !important;
  border-left: 4px solid var(--msa-trip-fail-border) !important;
}

/* Titles stay dark and readable; the big number and icon pick up the accent. */
body[data-msa-path="/trips"] #root main [data-msa-count-card] [class*="h-[140px]"] h4,
body[data-msa-path="/trips"] #root main [data-msa-count-card] [class*="h-[140px]"] h4 span,
body[data-msa-path="/trips"] #root main [data-msa-count-card] .h-\[140px\] h4,
body[data-msa-path="/trips"] #root main [data-msa-count-card] .h-\[140px\] h4 span {
  color: var(--msa-trip-ink) !important;
  font-weight: 600 !important;
}
body[data-msa-path="/trips"] #root main [data-msa-count-card="inProgress"] [class*="h-[140px]"] p,
body[data-msa-path="/trips"] #root main [data-msa-count-card="inProgress"] [class*="h-[140px]"] p span,
body[data-msa-path="/trips"] #root main [data-msa-count-card="inProgress"] .h-\[140px\] p,
body[data-msa-path="/trips"] #root main [data-msa-count-card="inProgress"] .h-\[140px\] p span {
  color: var(--msa-trip-open-ink) !important;
  font-weight: 700 !important;
}
body[data-msa-path="/trips"] #root main [data-msa-count-card="completed"] [class*="h-[140px]"] p,
body[data-msa-path="/trips"] #root main [data-msa-count-card="completed"] [class*="h-[140px]"] p span,
body[data-msa-path="/trips"] #root main [data-msa-count-card="completed"] .h-\[140px\] p,
body[data-msa-path="/trips"] #root main [data-msa-count-card="completed"] .h-\[140px\] p span {
  color: var(--msa-trip-done-ink) !important;
  font-weight: 700 !important;
}
body[data-msa-path="/trips"] #root main [data-msa-count-card="month"] [class*="h-[140px]"] p,
body[data-msa-path="/trips"] #root main [data-msa-count-card="month"] [class*="h-[140px]"] p span,
body[data-msa-path="/trips"] #root main [data-msa-count-card="month"] .h-\[140px\] p,
body[data-msa-path="/trips"] #root main [data-msa-count-card="month"] .h-\[140px\] p span {
  color: var(--msa-trip-month-ink) !important;
  font-weight: 700 !important;
}
body[data-msa-path="/trips"] #root main [data-msa-count-card="failed"] [class*="h-[140px]"] p,
body[data-msa-path="/trips"] #root main [data-msa-count-card="failed"] [class*="h-[140px]"] p span,
body[data-msa-path="/trips"] #root main [data-msa-count-card="failed"] .h-\[140px\] p,
body[data-msa-path="/trips"] #root main [data-msa-count-card="failed"] .h-\[140px\] p span {
  color: var(--msa-trip-fail-ink) !important;
  font-weight: 700 !important;
}

body[data-msa-path="/trips"] #root main [data-msa-count-card="inProgress"] [class*="h-[140px]"] svg,
body[data-msa-path="/trips"] #root main [data-msa-count-card="inProgress"] .h-\[140px\] svg {
  color: var(--msa-trip-open-border) !important;
  fill: currentColor !important;
  background: transparent !important;
}
body[data-msa-path="/trips"] #root main [data-msa-count-card="completed"] [class*="h-[140px]"] svg,
body[data-msa-path="/trips"] #root main [data-msa-count-card="completed"] .h-\[140px\] svg {
  color: var(--msa-trip-done-border) !important;
  fill: currentColor !important;
  background: transparent !important;
}
body[data-msa-path="/trips"] #root main [data-msa-count-card="month"] [class*="h-[140px]"] svg,
body[data-msa-path="/trips"] #root main [data-msa-count-card="month"] .h-\[140px\] svg {
  color: var(--msa-trip-month-border) !important;
  fill: currentColor !important;
  background: transparent !important;
}
body[data-msa-path="/trips"] #root main [data-msa-count-card="failed"] [class*="h-[140px]"] svg,
body[data-msa-path="/trips"] #root main [data-msa-count-card="failed"] .h-\[140px\] svg {
  color: var(--msa-trip-fail-border) !important;
  fill: currentColor !important;
  background: transparent !important;
}
body[data-msa-path="/trips"] #root main [data-msa-count-card] svg path[fill="none"],
body[data-msa-path="/trips"] #root main [data-msa-trip-kind="add"] svg path[fill="none"],
body[data-msa-path="/trips"] #root main [data-msa-trip-kind="filter"] svg path[fill="none"] {
  fill: none !important;
}

/* Add Trip / year filter keep a quiet accent so they are not the same orange bar. */
body[data-msa-path="/trips"] #root main [data-msa-trip-kind="add"][class*="h-[140px]"],
body[data-msa-path="/trips"] #root main [data-msa-trip-kind="add"].h-\[140px\] {
  background: #f3faf4 !important;
  background-color: #f3faf4 !important;
  background-image: none !important;
  border: 1px solid #cfe8d4 !important;
  border-left: 4px solid #43a515 !important;
  color: var(--msa-trip-ink) !important;
  box-shadow: none !important;
}
body[data-msa-path="/trips"] #root main [data-msa-trip-kind="add"] h4,
body[data-msa-path="/trips"] #root main [data-msa-trip-kind="add"] p,
body[data-msa-path="/trips"] #root main [data-msa-trip-kind="add"] span {
  color: #1f4d14 !important;
}
body[data-msa-path="/trips"] #root main [data-msa-trip-kind="add"] svg {
  color: #43a515 !important;
  fill: currentColor !important;
  background: transparent !important;
}
body[data-msa-path="/trips"] #root main [data-msa-trip-kind="filter"][class*="h-[140px]"],
body[data-msa-path="/trips"] #root main [data-msa-trip-kind="filter"].h-\[140px\] {
  background: #f5f7fa !important;
  background-color: #f5f7fa !important;
  background-image: none !important;
  border: 1px solid var(--msa-trip-line) !important;
  border-left: 4px solid #64748b !important;
  color: var(--msa-trip-ink) !important;
  box-shadow: none !important;
}
body[data-msa-path="/trips"] #root main [data-msa-trip-kind="filter"] h4,
body[data-msa-path="/trips"] #root main [data-msa-trip-kind="filter"] p,
body[data-msa-path="/trips"] #root main [data-msa-trip-kind="filter"] span {
  color: var(--msa-trip-ink) !important;
}

/* -------------------------------------------------------------------------- */
/* 2. Status pills. Labels are stamped data-msa-status-pill by the companion   */
/*    JS (text is not changed). GPS line [data-msa-journey-km] is left alone.  */
/* -------------------------------------------------------------------------- */
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] [data-msa-status-pill] {
  display: inline-block !important;
  padding: 2px 9px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  letter-spacing: 0.01em !important;
  border: 1px solid transparent !important;
  max-width: 100%;
  white-space: nowrap;
  vertical-align: middle;
  text-transform: none !important;
}
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] [data-msa-status-pill="open"] {
  background: #dbeafe !important;
  color: #1e40af !important;
  border-color: #93c5fd !important;
}
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] [data-msa-status-pill="closed"] {
  background: #dcfce7 !important;
  color: #166534 !important;
  border-color: #86efac !important;
}
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] [data-msa-status-pill="failed"] {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border-color: #fca5a5 !important;
}
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] [data-msa-status-pill="payment-pending"] {
  background: #fef3c7 !important;
  color: #92400e !important;
  border-color: #fcd34d !important;
}
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] [data-msa-status-pill="neutral"] {
  background: #f3f4f6 !important;
  color: #374151 !important;
  border-color: #d1d5db !important;
}

/* -------------------------------------------------------------------------- */
/* 3. Table: clear header, zebra rows, hover, coloured action icons            */
/*    Theme JS may set inline background !important on _tripTable_ rows;       */
/*    inset box-shadow is the reliable override.                               */
/* -------------------------------------------------------------------------- */
body[data-msa-path="/trips"] #root main .bg-\[\#EEDEDE\][class*="_tripTable_"],
body[data-msa-path="/trips"] #root main [class*="EEDEDE"][class*="_tripTable_"],
body[data-msa-path="/trips"] #root main [class*="_tripTable_"][data-msa-th="1"] {
  background: var(--msa-trip-header) !important;
  background-color: var(--msa-trip-header) !important;
  background-image: none !important;
  box-shadow: inset 0 0 0 999px var(--msa-trip-header) !important;
  color: var(--msa-trip-header-ink) !important;
  border-bottom: 2px solid #94a3b8 !important;
  font-weight: 700 !important;
}
body[data-msa-path="/trips"] #root main .bg-\[\#EEDEDE\][class*="_tripTable_"] p,
body[data-msa-path="/trips"] #root main .bg-\[\#EEDEDE\][class*="_tripTable_"] span,
body[data-msa-path="/trips"] #root main [class*="EEDEDE"][class*="_tripTable_"] p,
body[data-msa-path="/trips"] #root main [class*="EEDEDE"][class*="_tripTable_"] span,
body[data-msa-path="/trips"] #root main [class*="_tripTable_"][data-msa-th="1"] p,
body[data-msa-path="/trips"] #root main [class*="_tripTable_"][data-msa-th="1"] span {
  color: var(--msa-trip-header-ink) !important;
  font-weight: 700 !important;
}

body[data-msa-path="/trips"] #root main .h-10.bg-white[class*="_tripTable_"] {
  height: auto !important;
  min-height: 40px !important;
  align-items: center !important;
  border: 1px solid #edf1f5 !important;
  color: var(--msa-trip-ink) !important;
}
body[data-msa-path="/trips"] #root main .h-10.bg-white[class*="_tripTable_"]:nth-child(odd) {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  box-shadow: inset 0 0 0 999px #ffffff !important;
}
body[data-msa-path="/trips"] #root main .h-10.bg-white[class*="_tripTable_"]:nth-child(even) {
  background: var(--msa-trip-row-alt) !important;
  background-color: var(--msa-trip-row-alt) !important;
  background-image: none !important;
  box-shadow: inset 0 0 0 999px var(--msa-trip-row-alt) !important;
}
body[data-msa-path="/trips"] #root main .h-10.bg-white[class*="_tripTable_"]:hover {
  background: var(--msa-trip-row-hover) !important;
  background-color: var(--msa-trip-row-hover) !important;
  background-image: none !important;
  box-shadow: inset 0 0 0 999px var(--msa-trip-row-hover) !important;
}

/* Actions = 8th column (Edit, Delete). View = 9th column.
   c2: colour the glyph via currentColor only. Never set fill on paths —
   MUI/react-icons include a 24x24 path[fill=none] spacer; filling it painted
   a solid square over the pencil/trash. Labels via ::after so handlers stay. */
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(8),
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(9) {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  height: auto !important;
  min-height: 40px !important;
  padding-top: 4px !important;
  padding-bottom: 4px !important;
}
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(8) button,
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(9) button {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  width: auto !important;
  height: auto !important;
  min-height: 32px !important;
  min-width: 0 !important;
  padding: 4px 8px !important;
  margin: 0 !important;
  border-radius: 8px !important;
  border-style: solid !important;
  border-width: 1px !important;
  font: 700 12px/1.2 system-ui, sans-serif !important;
  text-transform: none !important;
  background-image: none !important;
  fill: none !important;
  box-shadow: none !important;
}
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(8) button svg,
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(9) button svg {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  flex: 0 0 16px !important;
  background: transparent !important;
  fill: currentColor !important;
  color: inherit !important;
  display: inline-block !important;
}
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(8) button svg path,
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(9) button svg path {
  /* inherit currentColor for the glyph; never override fill="none" spacers */
  fill: currentColor;
}
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(8) button svg path[fill="none"],
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(9) button svg path[fill="none"] {
  fill: none !important;
}

/* Edit — first action button: blue, pencil + "Edit" */
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(8) > button:first-of-type,
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(8) button:first-of-type {
  color: #1d4ed8 !important;
  background: #eff6ff !important;
  background-color: #eff6ff !important;
  border-color: #93c5fd !important;
}
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(8) > button:first-of-type::after,
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(8) button:first-of-type::after {
  content: "Edit";
  color: #1d4ed8;
  font: inherit;
}

/* Delete — last action button: red, trash + "Delete" */
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(8) > button:last-of-type,
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(8) button:last-of-type {
  color: #b91c1c !important;
  background: #fef2f2 !important;
  background-color: #fef2f2 !important;
  border-color: #fca5a5 !important;
}
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(8) > button:last-of-type::after,
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(8) button:last-of-type::after {
  content: "Delete";
  color: #b91c1c;
  font: inherit;
}

/* View — keep the eye, add "View" label, teal */
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(9) button {
  color: #0f766e !important;
  background: #f0fdfa !important;
  background-color: #f0fdfa !important;
  border-color: #99f6e4 !important;
}
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(9) button::after {
  content: "View";
  color: #0f766e;
  font: inherit;
}

/* If a helper span is present, hide the CSS fallback label */
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] button:has(.msa-action-label)::after {
  content: none !important;
}
body[data-msa-path="/trips"] #root main [class*="_tripTable_"] .msa-action-label {
  font: inherit;
  color: inherit;
}

@media (max-width: 680px) {
  body[data-msa-path="/trips"] #root main [data-msa-count-card] [class*="h-[140px]"],
  body[data-msa-path="/trips"] #root main [data-msa-count-card] .h-\[140px\] {
    min-height: 72px !important;
  }
  body[data-msa-path="/trips"] #root main [class*="_tripTable_"] [data-msa-status-pill] {
    font-size: 11px !important;
    padding: 2px 8px !important;
  }
  body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(8),
  body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(9) {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px !important;
  }
  body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(8) button,
  body[data-msa-path="/trips"] #root main [class*="_tripTable_"] > p:nth-child(9) button {
    width: 100% !important;
    min-height: 36px !important;
    justify-content: flex-start !important;
  }
}
