:root {
  /* One solid layout colour — a translucent value stacked darker on
     .content than on body, making the areas look different. */
  --color-body: #f4f5f7;
  --table-row-base: #ffffff;
}

/* ── GHMC / production (navy) ───────────────────────────────────── */
.ghmc-true,
:root {
  --color-primary: #004554;
  --color-primary-hover: #004554;
  --color-primary-rgb: 0, 69, 84;
  --color-primary-light: rgba(0, 69, 84, 0.06);
  --color-primary-lighter: rgba(0, 69, 84, 0.04);
  --table-row-stripe: rgba(0, 69, 84, 0.04);
  --table-row-hover: rgba(0, 69, 84, 0.07);
  --sidebar-bg: #004554;
  /* Action buttons — amber with white text */
  --btn-primary-bg: #ffae00;
  --btn-primary-text: #ffffff;
  --btn-primary-rgb: 255, 174, 0;
}

/* ── SWM / dev (red) — same UI patterns as GHMC ─────────────────── */
.ghmc-false {
  --color-primary: #EC1117;
  --color-primary-hover: #EC1117;
  --color-primary-rgb: 236, 17, 23;
  --color-primary-light: rgba(236, 17, 23, 0.06);
  --color-primary-lighter: rgba(236, 17, 23, 0.04);
  --table-row-stripe: rgba(236, 17, 23, 0.04);
  --table-row-hover: rgba(236, 17, 23, 0.07);
  --sidebar-bg: #EC1117;
  --btn-primary-bg: #f03c41;
  --btn-primary-rgb: 240, 60, 65;
}

body {
  background-color: var(--color-body) !important;
  color: #212529;
}

html,
.content,
.header,
.header .header-container {
  background-color: var(--color-body) !important;
}

.bg-primary,
.btn.btn-primary,
a.btn[href="#next"],
a.btn[href="#previous"] {
  background: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
}

.btn.btn-primary:not(:disabled):not(.disabled):hover,
.btn.btn-primary:not(:disabled):not(.disabled):focus,
.btn.btn-primary:not(:disabled):not(.disabled):active,
.btn.btn-primary:not(:disabled):not(.disabled).active,
a.btn[href="#next"]:not(:disabled):not(.disabled):hover,
a.btn[href="#previous"]:not(:disabled):not(.disabled):hover,
.btn-blue:hover,
.btn-blue:focus,
.search-ghmc:hover,
.search-ghmcNew:hover,
.report-search-ghmc:hover,
.search-swm:hover,
.report-search-swm:hover,
a.text-primary:hover,
a.bg-primary:hover,
button.bg-primary:hover {
  background: var(--btn-primary-bg) !important;
  border-color: var(--btn-primary-bg) !important;
  filter: brightness(1.12);
}

.text-primary {
  color: var(--color-primary) !important;
}

.active-ghmc,
.report-search-ghmc,
.ghmc-table-col,
.search-ghmc,
.search-ghmcNew,
.active-swmnew,
.report-search-swm,
.swm-table-col,
.search-swm {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
}

/* Sidebar — no shadow */
.navigation,
body:not(.horizontal-navigation) .navigation,
.app-sidebar,
.app-sidebar.sidebar-shadow {
  box-shadow: none !important;
}

/* Sidebar — GHMC open / active overlays */
.navigation .bg-ghmc,
.navigation.ghmc-true .bg-ghmc {
  background-color: #266b79 !important;
  border-color: transparent !important;
  color: #ffffff !important;
}

.navigation .active-ghmc,
.navigation.ghmc-true .active-ghmc {
  background-color: rgba(255, 255, 255, 0.14) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  border-left: none !important;
}

/* Sidebar — SWM open / active overlays (same style as GHMC) */
.navigation.ghmc-false .bg-swm {
  background-color: rgba(255, 255, 255, 0.1) !important;
  border-color: transparent !important;
  color: #ffffff !important;
}

.navigation.ghmc-false .active-swmnew {
  background-color: rgba(255, 255, 255, 0.14) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  border-left: none !important;
}

.navigation .active-ghmc:hover,
.navigation .bg-ghmc:hover,
.navigation.ghmc-false .active-swmnew:hover,
.navigation.ghmc-false .bg-swm:hover {
  color: #ffffff !important;
}

.navigation .bg-ghmc:hover,
.navigation.ghmc-false .bg-swm:hover {
  background-color: rgba(255, 255, 255, 0.12) !important;
}

.navigation .active-ghmc:hover,
.navigation.ghmc-false .active-swmnew:hover {
  background-color: rgba(255, 255, 255, 0.16) !important;
}

.navigation.ghmc-false .active-swmnew span,
.navigation.ghmc-false .bg-swm span,
.navigation.ghmc-false .active-swmnew .MuiTypography-root,
.navigation.ghmc-false .bg-swm .MuiTypography-root,
.navigation.ghmc-false .active-swmnew i,
.navigation.ghmc-false .bg-swm i,
.navigation.ghmc-false .active-swmnew .MuiSvgIcon-root,
.navigation.ghmc-false .bg-swm .MuiSvgIcon-root {
  color: #ffffff !important;
}

.icon-blue,
.text-blue,
.btn-blue,
.ghmc-false .icon-red,
.ghmc-false .text-red {
  color: var(--color-primary) !important;
}

.btn-blue {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #fff !important;
}

.excel-ghmc,
.excel-swm {
  color: var(--color-primary) !important;
}

.edit-ghmc,
.edit-swm {
  background-color: var(--color-primary-lighter) !important;
  border-color: var(--color-primary) !important;
  color: var(--color-primary) !important;
}

.circle.enabled.circle-ghmc,
.circle.enabled.circle-swm {
  border-color: var(--color-primary) !important;
  background-color: var(--color-primary) !important;
}

.ghmc-true .content::-webkit-scrollbar-thumb,
.ghmc-true .data-table::-webkit-scrollbar-thumb,
.ghmc-false .content::-webkit-scrollbar-thumb,
.ghmc-false .data-table::-webkit-scrollbar-thumb {
  background-color: rgba(var(--color-primary-rgb), 0.35) !important;
}

.btn.btn-gradient-primary,
.bg-primary-gradient {
  background: var(--color-primary) !important;
}

.badge.badge-primary,
.alert.alert-primary {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
}

.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before,
.custom-radio .custom-control-input:checked ~ .custom-control-label::before,
.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
  border-color: var(--color-primary) !important;
  background-color: var(--color-primary) !important;
}

.page-content .card {
  background-color: #ffffff;
  color: #1B2128;
}

/* ==========================================================================
   TABLES — soft card, rounded tinted header, divider rows (all tables)
   Inline styles in table components set header/stripe colours, so these
   rules use !important to win.
   ========================================================================== */
:root {
  --table-card-border: #eef0f3;
  --table-divider: #eef0f3;
  --table-text: #4b5565;
  --table-head-tint: rgba(var(--color-primary-rgb), 0.07);
}

/* Card wrapper */
.table-container,
.content .rdt_Table,
.content .MuiTableContainer-root {
  background-color: #ffffff !important;
  border: 1px solid var(--table-card-border) !important;
  border-radius: 16px !important;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.03), 0 6px 20px rgba(17, 24, 39, 0.05) !important;
}

.table-container {
  padding: 8px 10px 4px;
}

.content .rdt_Table {
  padding: 8px 10px 4px;
}

/* Plain HTML tables */
.table-container table,
.content table.table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border: none !important;
  margin-bottom: 0 !important;
  font-family: "Poppins", sans-serif;
}

.table-container table thead th,
.content table.table thead th {
  background: linear-gradient(var(--table-head-tint), var(--table-head-tint)), #ffffff !important;
  color: var(--color-primary) !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  text-align: left !important;
  vertical-align: middle !important;
  white-space: nowrap;
  padding: 12px 14px !important;
  border: none !important;
}

.table-container table thead th:first-child,
.content table.table thead th:first-child {
  border-radius: 6px 0 0 6px !important;
}

.table-container table thead th:last-child,
.content table.table thead th:last-child {
  border-radius: 0 6px 6px 0 !important;
}

.table-container table thead th div,
.content table.table thead th div {
  justify-content: flex-start !important;
}

.table-container table tbody tr,
.content table.table tbody tr,
.table.table-hover tbody tr {
  background-color: transparent !important;
}

.table-container table tbody td,
.content table.table tbody td {
  background-color: #ffffff !important;
  color: var(--table-text) !important;
  font-size: 13px !important;
  text-align: left !important;
  vertical-align: middle !important;
  padding: 12px 14px !important;
  border: none !important;
  border-bottom: 1px solid var(--table-divider) !important;
  transition: background-color 0.12s ease;
}

.table-container table tbody tr:last-child td,
.content table.table tbody tr:last-child td {
  border-bottom: none !important;
}

.table-container table tbody tr:hover td,
.content table.table tbody tr:hover td {
  background-color: rgba(var(--color-primary-rgb), 0.035) !important;
}

/* Footer totals */
.table-container table tfoot td,
.content table.table tfoot td {
  background-color: var(--table-head-tint) !important;
  color: var(--color-primary) !important;
  font-weight: 600 !important;
  text-align: left !important;
  padding: 12px 14px !important;
  border: none !important;
}

/* Row action buttons (eye / edit) — bare icons like the reference */
.edit-ghmc,
.edit-swm {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 0 2px;
  padding: 0 !important;
  border: none !important;
  border-radius: 8px !important;
  background-color: transparent !important;
  color: #6b7585 !important;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.edit-ghmc:hover,
.edit-swm:hover {
  background-color: rgba(var(--color-primary-rgb), 0.08) !important;
  color: var(--color-primary) !important;
}

/* react-data-table-component */
.content .rdt_TableHead {
  background: transparent !important;
}

.content .rdt_TableHeadRow {
  background: linear-gradient(var(--table-head-tint), var(--table-head-tint)), #ffffff !important;
  border: none !important;
  border-radius: 6px !important;
  min-height: 44px !important;
}

.content .rdt_TableHeadRow .rdt_TableCol {
  background-color: transparent !important;
  color: var(--color-primary) !important;
  font-family: "Poppins", sans-serif !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  justify-content: flex-start !important;
  padding: 0 14px !important;
  border: none !important;
}

.content .rdt_TableRow {
  background-color: #ffffff !important;
  border: none !important;
  border-bottom: 1px solid var(--table-divider) !important;
  min-height: 46px !important;
}

.content .rdt_TableRow:last-of-type {
  border-bottom: none !important;
}

.content .rdt_TableRow:hover {
  background-color: rgba(var(--color-primary-rgb), 0.035) !important;
}

.content .rdt_TableCell {
  background-color: transparent !important;
  color: var(--table-text) !important;
  font-family: "Poppins", sans-serif !important;
  font-size: 13px !important;
  justify-content: flex-start !important;
  text-align: left !important;
  padding: 0 14px !important;
  border: none !important;
}

/* MUI tables */
.content .MuiTableContainer-root {
  padding: 8px 10px 4px;
}

.content .MuiTableHead-root .MuiTableCell-head {
  background: linear-gradient(var(--table-head-tint), var(--table-head-tint)), #ffffff !important;
  color: var(--color-primary) !important;
  font-family: "Poppins", sans-serif !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  padding: 12px 14px !important;
  border: none !important;
}

.content .MuiTableHead-root .MuiTableCell-head:first-child {
  border-radius: 6px 0 0 6px;
}

.content .MuiTableHead-root .MuiTableCell-head:last-child {
  border-radius: 0 6px 6px 0;
}

.content .MuiTableBody-root .MuiTableRow-root {
  background-color: #ffffff !important;
}

.content .MuiTableBody-root .MuiTableRow-root:hover {
  background-color: rgba(var(--color-primary-rgb), 0.035) !important;
}

.content .MuiTableCell-root {
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
}

.content .MuiTableBody-root .MuiTableCell-body {
  color: var(--table-text) !important;
  font-family: "Poppins", sans-serif !important;
  font-size: 13px !important;
  padding: 12px 14px !important;
  border-bottom: 1px solid var(--table-divider) !important;
}

.ghmc-false .btn-red {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
}

.ghmc-false .login-title,
.ghmc-false .login-title span,
.ghmc-false .login-title-line1,
.ghmc-false .login-title-line2,
.ghmc-false .heading {
  color: var(--color-primary) !important;
}

/* ==========================================================================
   SITE-WIDE RESPONSIVE LAYOUT
   Small screens only (≤767.98px). Medium & desktop stay unchanged.
   ========================================================================== */

/* Safe table scroll helper (does not change desktop/medium layout) */
.table-container {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.content .MuiTableContainer-root,
.content .MuiPaper-root {
  max-width: 100%;
  overflow-x: auto;
}

/* ---------- Small screens only ---------- */
@media (max-width: 767.98px) {
  .content {
    margin-left: 0 !important;
    padding: 10px !important;
    height: auto !important;
    overflow-x: hidden;
  }

  .page-content {
    padding-top: 52px;
  }

  .page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
  }

  .page-header .row {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-left: 0;
    margin-right: 0;
  }

  .page-header .flex_end_middle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
  }

  .page-content > .d-flex.justify-content-between,
  .page-content > .d-flex.flex-md-row.justify-content-between {
    flex-direction: column !important;
    align-items: stretch !important;
    flex-wrap: wrap;
    gap: 12px;
  }

  .page-content > .d-flex.justify-content-between > .d-flex,
  .page-content > .d-flex.flex-md-row.justify-content-between > .d-flex {
    width: 100%;
    justify-content: flex-start !important;
    flex-wrap: wrap;
    gap: 8px;
  }

  .page-header .row > [class*="col-"] {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
  }

  .card .card-body,
  .table-container,
  .page-content .table-responsive {
    max-width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .table-container table {
    min-width: 700px;
  }

  .table-container th,
  .table-container td {
    white-space: nowrap;
  }

  .card-body {
    padding: 12px !important;
  }

  .form-label,
  .form-group > label {
    font-size: 13px;
  }

  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }

  .modal-body {
    padding: 12px !important;
  }

  .card .d-flex.gap-2,
  .card-body .d-flex.gap-2 {
    flex-wrap: wrap;
  }

  .header-toolbar h4 {
    max-width: none;
    font-size: 13px;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
  }

  .button-container {
    white-space: nowrap;
  }
}

/* ---------- Small phones ---------- */
@media (max-width: 480px) {
  .content {
    padding: 8px !important;
  }

  .button-container {
    padding: 5px 10px !important;
    font-size: 13px;
  }

  .page-content h4,
  .page-content h5 {
    font-size: 1.05rem;
  }
}

/* ==========================================================================
   ACTION BUTTONS — Add / Excel / PDF / Submit / Search
   Sleek solid theme buttons: 6px corners, icon + label. Cancel/Delete
   (btn-secondary, btn-danger) are left as they are.
   ========================================================================== */
button.button-container,
a.button-container,
.btn.btn-excel,
.btn.btn-excel:focus,
.btn.btn-excel:hover,
.btn.btn-excelnew,
.btn.btn-primary,
.btn.btn-blue,
.btn.search-ghmc,
.btn.search-swm,
.btn.search-ghmcNew,
.btn.report-search-ghmc,
.btn.report-search-swm {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px;
  height: 36px !important;
  min-height: 0;
  padding: 0 14px !important;
  border: 1px solid var(--btn-primary-bg) !important;
  border-radius: 6px !important;
  background: var(--btn-primary-bg) !important;
  color: var(--btn-primary-text) !important;
  font-family: "Poppins", sans-serif;
  font-size: 13px !important;
  font-weight: 500 !important;
  letter-spacing: 0.01em;
  line-height: 1 !important;
  white-space: nowrap;
  text-decoration: none !important;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(var(--btn-primary-rgb), 0.18) !important;
  transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

button.button-container:hover,
a.button-container:hover,
.btn.btn-excel:hover,
.btn.btn-excelnew:hover,
.btn.btn-primary:not(:disabled):hover,
.btn.btn-blue:hover,
.btn.search-ghmc:hover,
.btn.search-swm:hover,
.btn.search-ghmcNew:hover,
.btn.report-search-ghmc:hover,
.btn.report-search-swm:hover {
  filter: brightness(0.94);
  box-shadow: none !important;
}

button.button-container:active,
.btn.btn-excel:active,
.btn.btn-primary:active,
.btn.search-ghmc:active,
.btn.search-swm:active {
  transform: translateY(1px);
}

button.button-container:focus-visible,
.btn.btn-excel:focus-visible,
.btn.btn-primary:focus-visible,
.btn.search-ghmc:focus-visible,
.btn.search-swm:focus-visible {
  outline: 2px solid rgba(var(--color-primary-rgb), 0.35);
  outline-offset: 2px;
}

button.button-container:disabled,
.btn.btn-excel:disabled,
.btn.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
  box-shadow: none !important;
}

/* Icons inside these buttons: white, no extra spacing (gap handles it) */
button.button-container i,
button.button-container svg,
button.button-container .icon-container,
a.button-container i,
.btn.btn-excel i,
.btn.btn-excel svg,
.btn.btn-excel .icon-container,
.btn.btn-excelnew i,
.btn.btn-excelnew .icon-container,
.btn.btn-primary i,
.btn.btn-blue i,
.btn.search-ghmc i,
.btn.search-swm i,
.btn.search-ghmcNew i,
.btn.report-search-ghmc i,
.btn.report-search-swm i {
  color: var(--btn-primary-text) !important;
  font-size: 13px !important;
  margin: 0 !important;
}

/* ==========================================================================
   PAGE SEARCH INPUT — rounded-md: search icon | divider | text
   Flat (no shadow) in every state. Selector must out-rank app.min.css
   `.form-control:not(.form-control-lg):not(.form-control-sm)` (padding 4px !important).
   ========================================================================== */
html body input[placeholder][placeholder^="Search" i]:not(.MuiInputBase-input) {
  height: 38px !important;
  padding: 0 14px 0 46px !important;
  border: 1px solid #e3e3e6 !important;
  border-radius: 6px !important;
  background-color: #ffffff !important;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23222' stroke-width='2.6' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21'/%3E%3C/svg%3E"),
    linear-gradient(#cfcfd4, #cfcfd4) !important;
  background-repeat: no-repeat !important;
  background-position: 14px center, 36px center !important;
  background-size: 14px 14px, 1px 16px !important;
  color: #333333 !important;
  font-size: 13px !important;
  box-shadow: none !important;
  outline: none !important;
}

html body input[placeholder][placeholder^="Search" i]:not(.MuiInputBase-input):hover,
html body input[placeholder][placeholder^="Search" i]:not(.MuiInputBase-input):focus,
html body input[placeholder][placeholder^="Search" i]:not(.MuiInputBase-input):active {
  border-color: #d4d4d8 !important;
  box-shadow: none !important;
  outline: none !important;
}

html body input[placeholder][placeholder^="Search" i]:not(.MuiInputBase-input)::placeholder {
  color: #8a8a90 !important;
  opacity: 1;
}

/* ==========================================================================
   NO HOVER SHADOWS — MUI buttons/FABs raise their elevation on hover
   ========================================================================== */
.MuiButton-root:hover,
.MuiButton-contained:hover,
.MuiFab-root:hover,
.MuiIconButton-root:hover {
  box-shadow: none !important;
}

/* ==========================================================================
   TABLE TITLE (.top-header) — plain page-title text, no grey header bar.
   Overrides app.min.css and inline backgroundColor on some report pages.
   ========================================================================== */
.top-header,
.card-body .top-header {
  display: block !important;
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  margin: 4px 0 12px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  text-align: left !important;
  font-family: "Poppins", sans-serif;
  font-size: 18px !important;
  font-weight: 500 !important;
  line-height: 1.3 !important;
  color: #1a1a2e !important;
}

.top-header span,
.card-body .top-header span {
  margin: 0 !important;
  font-size: 18px !important;
  font-weight: 500 !important;
  color: #1a1a2e !important;
}

/* Explicit title row: <div class="page-title-row"> title + button bar </div> */
.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin: 18px 0 14px;
}

.page-title-row > .top-header,
.page-title-row > .page-title {
  width: auto !important;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 !important;
}

.page-title-row > .vehicle-button,
.page-title-row > .page-title-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 !important;
}

.page-title-row > .vehicle-button > .btn,
.page-title-row > .vehicle-button > button,
.page-title-row > .page-title-actions > .btn,
.page-title-row > .page-title-actions > button {
  margin: 0 !important;
}

/* ==========================================================================
   PAGE TITLE ROW — title and action buttons on one line, search below.
   Matches the common page layouts after the title:
     .page-header > .row (search col + buttons col)   e.g. Zones, Wards
     .row (search col + buttons col)                  e.g. Users
     .page-header > .text-end / .flex_end_middle      e.g. Cities
     .d-flex button bar                               e.g. Colonies
   ========================================================================== */
.page-content:has(> .page-title + .page-header > .row:first-child input[placeholder^="Search" i], > .page-title + .row input[placeholder^="Search" i], > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child button, > .page-title + .d-flex.justify-content-end > * > .d-flex > button) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px 16px;
  align-items: center;
  margin-top: 18px;
}

.page-content:has(> .page-title + .page-header > .row:first-child input[placeholder^="Search" i], > .page-title + .row input[placeholder^="Search" i], > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child button, > .page-title + .d-flex.justify-content-end > * > .d-flex > button) > * {
  grid-column: 1 / -1;
}

.page-content:has(> .page-title + .page-header > .row:first-child input[placeholder^="Search" i], > .page-title + .row input[placeholder^="Search" i], > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child button, > .page-title + .d-flex.justify-content-end > * > .d-flex > button) > .page-title {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  display: flex !important;
  align-items: center;
  min-height: 36px;
  margin: 0 !important;
}

.page-content > .page-title span {
  line-height: 1.2 !important;
}

/* unwrap header/row wrappers so their children join the grid */
.page-content:has(> .page-title + .page-header > .row:first-child input[placeholder^="Search" i], > .page-title + .row input[placeholder^="Search" i], > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child button, > .page-title + .d-flex.justify-content-end > * > .d-flex > button) > .page-title + .page-header:has(> .row:first-child input[placeholder^="Search" i]),
.page-content:has(> .page-title + .page-header > .row:first-child input[placeholder^="Search" i], > .page-title + .row input[placeholder^="Search" i], > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child button, > .page-title + .d-flex.justify-content-end > * > .d-flex > button) > .page-title + .page-header > .row:first-child:has(input[placeholder^="Search" i]),
.page-content:has(> .page-title + .page-header > .row:first-child input[placeholder^="Search" i], > .page-title + .row input[placeholder^="Search" i], > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child button, > .page-title + .d-flex.justify-content-end > * > .d-flex > button) > .page-title + .row:has(input[placeholder^="Search" i]),
.page-content:has(> .page-title + .page-header > .row:first-child input[placeholder^="Search" i], > .page-title + .row input[placeholder^="Search" i], > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child button, > .page-title + .d-flex.justify-content-end > * > .d-flex > button) > .page-title + .page-header:has(> :is(.text-end, .flex_end_middle, .vehicle-button):first-child button) {
  display: contents;
}

.page-content:has(> .page-title + .page-header > .row:first-child input[placeholder^="Search" i], > .page-title + .row input[placeholder^="Search" i], > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child button, > .page-title + .d-flex.justify-content-end > * > .d-flex > button) > .page-title + .page-header:has(> .row:first-child input[placeholder^="Search" i]) > *,
.page-content:has(> .page-title + .page-header > .row:first-child input[placeholder^="Search" i], > .page-title + .row input[placeholder^="Search" i], > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child button, > .page-title + .d-flex.justify-content-end > * > .d-flex > button) > .page-title + .page-header > .row:first-child:has(input[placeholder^="Search" i]) > *,
.page-content:has(> .page-title + .page-header > .row:first-child input[placeholder^="Search" i], > .page-title + .row input[placeholder^="Search" i], > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child button, > .page-title + .d-flex.justify-content-end > * > .d-flex > button) > .page-title + .row:has(input[placeholder^="Search" i]) > *,
.page-content:has(> .page-title + .page-header > .row:first-child input[placeholder^="Search" i], > .page-title + .row input[placeholder^="Search" i], > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child button, > .page-title + .d-flex.justify-content-end > * > .d-flex > button) > .page-title + .page-header:has(> :is(.text-end, .flex_end_middle, .vehicle-button):first-child button) > * {
  grid-column: 1 / -1;
}

/* buttons → right end of the title line */
.page-content:has(> .page-title + .page-header > .row:first-child input[placeholder^="Search" i], > .page-title + .row input[placeholder^="Search" i], > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child button, > .page-title + .d-flex.justify-content-end > * > .d-flex > button) > .page-title + .page-header > .row:first-child > :has(button):not(:has(input)),
.page-content:has(> .page-title + .page-header > .row:first-child input[placeholder^="Search" i], > .page-title + .row input[placeholder^="Search" i], > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child button, > .page-title + .d-flex.justify-content-end > * > .d-flex > button) > .page-title + .row > :has(button):not(:has(input)),
.page-content:has(> .page-title + .page-header > .row:first-child input[placeholder^="Search" i], > .page-title + .row input[placeholder^="Search" i], > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child button, > .page-title + .d-flex.justify-content-end > * > .d-flex > button) > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child,
.page-content:has(> .page-title + .page-header > .row:first-child input[placeholder^="Search" i], > .page-title + .row input[placeholder^="Search" i], > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child button, > .page-title + .d-flex.justify-content-end > * > .d-flex > button) > .page-title + .d-flex.justify-content-end:not(:has(input, select, .card)) {
  grid-column: 2;
  grid-row: 1;
  width: auto;
  max-width: none;
  margin: 0 !important;
  padding: 0;
}

.page-content:has(> .page-title + .page-header > .row:first-child input[placeholder^="Search" i], > .page-title + .row input[placeholder^="Search" i], > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child button, > .page-title + .d-flex.justify-content-end > * > .d-flex > button) > .page-title + .page-header > .row:first-child > :has(button):not(:has(input)) > *,
.page-content:has(> .page-title + .page-header > .row:first-child input[placeholder^="Search" i], > .page-title + .row input[placeholder^="Search" i], > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child button, > .page-title + .d-flex.justify-content-end > * > .d-flex > button) > .page-title + .row > :has(button):not(:has(input)) > *,
.page-content:has(> .page-title + .page-header > .row:first-child input[placeholder^="Search" i], > .page-title + .row input[placeholder^="Search" i], > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child button, > .page-title + .d-flex.justify-content-end > * > .d-flex > button) > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child > *,
.page-content:has(> .page-title + .page-header > .row:first-child input[placeholder^="Search" i], > .page-title + .row input[placeholder^="Search" i], > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child button, > .page-title + .d-flex.justify-content-end > * > .d-flex > button) > .page-title + .d-flex.justify-content-end:not(:has(input, select, .card)) > * {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* search → its own line under the title */
.page-content:has(> .page-title + .page-header > .row:first-child input[placeholder^="Search" i], > .page-title + .row input[placeholder^="Search" i], > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child button, > .page-title + .d-flex.justify-content-end > * > .d-flex > button) > .page-title + .page-header > .row:first-child > :has(input[placeholder^="Search" i]),
.page-content:has(> .page-title + .page-header > .row:first-child input[placeholder^="Search" i], > .page-title + .row input[placeholder^="Search" i], > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child button, > .page-title + .d-flex.justify-content-end > * > .d-flex > button) > .page-title + .row > :has(input[placeholder^="Search" i]) {
  padding-left: 0;
}

.page-content:has(> .page-title + .page-header > .row:first-child input[placeholder^="Search" i], > .page-title + .row input[placeholder^="Search" i], > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child button, > .page-title + .d-flex.justify-content-end > * > .d-flex > button) > .page-title + .page-header > .row:first-child > :has(input[placeholder^="Search" i]) > .form-group,
.page-content:has(> .page-title + .page-header > .row:first-child input[placeholder^="Search" i], > .page-title + .row input[placeholder^="Search" i], > .page-title + .page-header > :is(.text-end, .flex_end_middle, .vehicle-button):first-child button, > .page-title + .d-flex.justify-content-end > * > .d-flex > button) > .page-title + .row > :has(input[placeholder^="Search" i]) > .form-group {
  margin-bottom: 0 !important;
}

/* ==========================================================================
   Modal Save buttons (.deployment-button) — same amber as action buttons
   ========================================================================== */
.deployment-button {
  background-color: var(--btn-primary-bg) !important;
  border: 1px solid var(--btn-primary-bg) !important;
  color: var(--btn-primary-text) !important;
  font-weight: 500;
  transition: filter 0.15s ease;
}

.deployment-button:not(:disabled):hover {
  filter: brightness(0.94);
}

.deployment-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.deployment-button .done-container {
  color: var(--btn-primary-text) !important;
}

/* Modal close (✕) circle — amber, teal ✕ */
.close-container {
  background-color: var(--btn-primary-bg) !important;
  color: var(--btn-primary-text) !important;
  transition: filter 0.15s ease;
}

.close-container:hover {
  filter: brightness(0.94);
}

/* ==========================================================================
   FORM FIELDS — white, light border, 38px
   app.min.css paints every .form-control #ECECEC with a 30px pill radius,
   and hard-codes react-select's default control class (.css-13cymwt-control)
   to #ECECEC !important. Override both here so every filter row is white.
   (The "Search…" inputs above keep their own icon style — higher specificity.)
   ========================================================================== */
html body .form-control:not(.form-control-lg):not(.form-control-sm):not(textarea):not([placeholder^="Search" i]) {
  height: 38px;
  padding: 6px 10px !important;
  background-color: #ffffff;
  border: 1px solid #e3e3e6;
  border-radius: 6px;
  color: #333333;
  font-size: 13px !important;
  box-shadow: none;
}

html body textarea.form-control {
  background-color: #ffffff;
  border: 1px solid #e3e3e6;
  border-radius: 6px;
  font-size: 13px !important;
}

html body .form-control:focus,
html body .form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.12);
}

html body .form-control::placeholder {
  color: #8a8a90;
}

html body .form-select {
  min-height: 38px;
  background-color: #ffffff;
  border: 1px solid #e3e3e6;
  border-radius: 6px;
  color: #333333;
  font-size: 13px;
}

/* react-select — default (unfocused) control */
html body .css-13cymwt-control {
  min-height: 38px;
  background-color: #ffffff !important;
  border-color: #e3e3e6;
  border-radius: 6px;
}

html body .css-13cymwt-control:hover {
  border-color: #d4d4d8;
}

/* react-select — focused control */
html body .css-t3ipsp-control {
  min-height: 38px;
  border-color: var(--color-primary) !important;
  border-radius: 6px;
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.12) !important;
}

/* react-select — inner input box (app.min.css greys it too) */
html body .css-90724z-Input input {
  background-color: transparent !important;
}

/* react-select — no divider before the chevron */
html body .css-1u9des2-indicatorSeparator {
  display: none;
}

/* Table data stays on one line; columns size to their content and the table
   scrolls sideways when needed. Cells that opt into wrapping inline (e.g.
   address columns in TableComponent) keep wrapping. */
.table-container table tbody td,
.content table.table tbody td {
  white-space: nowrap;
}

/* react-select dropdown lists open above sticky table headers / cards.
   (react-select's own menu z-index is 1; sticky table heads use 2–10.)
   Covers every classNamePrefix in use plus the default emotion class. */
.react-select__menu,
.select__menu,
.CreatableSelect__menu,
html body .css-1nmdiq5-menu {
  z-index: 1060 !important;
}
