/*
 * Shared "rd-grid" list/management-grid design — intended for reuse across
 * every data-grid page EXCEPT Fleet Status (http://localhost:3000/fleet-status),
 * which keeps its own denser design in fleet-status-redesign.css. This file
 * is the common base; apply the classes below (rd-grid-wrap / rd-ibtn /
 * rd-status-pill) to each page's grid as it gets its turn, same pattern as
 * every other *-redesign.css file in this folder.
 *
 * Values are copied verbatim from the reference app's own compiled output
 * (https://fleettracking.utwiz.com/vehicle-groups — read-only: fetched its
 * JS/CSS via curl, nothing submitted or changed there), specifically its
 * .rd-grid*, .rd-ibtn*, and inline status-pill styles. Not estimated from
 * the screenshot.
 *
 * Our grids are DevExtreme's DataGrid, not the reference's plain <table>, so
 * these values are applied to the DevExtreme-generated equivalents
 * (.dx-datagrid-headers, .dx-data-row, etc.) wherever a page wraps its grid
 * in .rd-grid-wrap, plus to a genuine <table class="rd-grid"> for any page
 * that isn't using DevExtreme.
 */

.rd-grid-wrap {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  font-family: var(--font-family-base);
}

/* DevExtreme's own built-in toolbar items (search box, export-to-excel
   button) still carry their default bordered-button chrome, which clashes
   with the cleaner rd-grid look — this just removes those borders/
   backgrounds on the two controls, without hiding or disabling them
   (unlike Fleet Status, these pages don't have a custom replacement for
   either one, so the native controls stay, just flattened). */
.rd-grid-wrap .dx-datagrid-search-panel .dx-editor-outlined,
.rd-grid-wrap .dx-datagrid-search-panel .dx-texteditor-input-container {
  border: none !important;
}

.rd-grid-wrap .dx-datagrid-export-button.dx-button,
.rd-grid-wrap .dx-datagrid-export-button .dx-button {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* ---- Plain <table class="rd-grid"> path ---- */

.rd-grid-wrap table.rd-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
  color: #1f2430;
}

.rd-grid-wrap table.rd-grid thead {
  background: rgba(235, 240, 255, 0.7);
  position: sticky;
  top: 0;
}

.rd-grid-wrap table.rd-grid th {
  padding: 11px 14px;
  font-weight: 600;
  font-size: 0.7rem;
  color: #5a6a8e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.rd-grid-wrap table.rd-grid td {
  padding: 10px 14px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.rd-grid-wrap table.rd-grid tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.92);
}

.rd-grid-wrap table.rd-grid tbody tr:nth-child(2n) {
  background: rgba(235, 240, 255, 0.4);
}

.rd-grid-wrap table.rd-grid tbody tr:hover {
  background: #faf5ff;
}

/* ---- DevExtreme DataGrid path ---- */

.rd-grid-wrap .dx-datagrid {
  font-family: var(--font-family-base);
  color: #1f2430;
}

.rd-grid-wrap .dx-datagrid-headers {
  background: rgba(235, 240, 255, 0.7);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.rd-grid-wrap .dx-datagrid-headers .dx-datagrid-table .dx-row > td {
  padding: 11px 14px !important;
  font-weight: 600;
  font-size: 0.7rem;
  color: #5a6a8e;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  border: none !important;
}

.rd-grid-wrap .dx-datagrid-rowsview .dx-data-row > td {
  padding: 10px 14px !important;
  font-size: 0.84rem;
  color: #1f2430;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
  vertical-align: middle;
}

.rd-grid-wrap .dx-datagrid-rowsview .dx-data-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.92);
}

.rd-grid-wrap .dx-datagrid-rowsview .dx-data-row:nth-child(2n) {
  background: rgba(235, 240, 255, 0.4);
}

.rd-grid-wrap .dx-datagrid-rowsview .dx-data-row:hover > td {
  background: #faf5ff;
}

/* ---- Action icon buttons (rd-ibtn) — exact colors from the reference's
   .rd-ibtn.assign / .edit / .delete / .view classes. ---- */

.rd-ibtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  flex-shrink: 0;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
  font-size: 13px;
  transition: filter 0.12s ease, background 0.12s ease;
  text-decoration: none !important;
}

.rd-ibtn:hover {
  filter: brightness(0.9);
}

.rd-ibtn.edit {
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.22);
  background: rgba(59, 130, 246, 0.08);
}

.rd-ibtn.view {
  color: #7c3aed;
  border: 1px solid rgba(124, 58, 237, 0.22);
  background: rgba(124, 58, 237, 0.08);
}

.rd-ibtn.delete,
.rd-ibtn.archive {
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.22);
  background: rgba(239, 68, 68, 0.08);
}

.rd-ibtn.assign {
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.22);
  background: rgba(16, 185, 129, 0.08);
}

.rd-ibtn.history,
.rd-ibtn.toggle {
  color: #6b7280;
  border: 1px solid rgba(107, 114, 128, 0.22);
  background: rgba(107, 114, 128, 0.08);
}

/* ---- Status pill — exact colors from the reference's inline pill style
   (isActive ? success-soft/success-fg : danger-soft/danger-fg). ---- */

.rd-status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
}

.rd-status-pill--active {
  background: rgba(16, 185, 129, 0.1);
  color: #065f46;
}

.rd-status-pill--inactive {
  background: rgba(239, 68, 68, 0.1);
  color: #991b1b;
}
