/* تتبع المركبات: نافذة متابعة متجاوبة ومشتركة بين لوحة التحكم وإدارة السيارات */
.track-open {
  overflow: hidden;
}

.track-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0px, 2vw, 22px);
  background: rgba(8, 20, 30, 0.58);
  backdrop-filter: blur(6px);
}

.track-overlay[hidden] {
  display: none !important;
}

.trk-shell {
  width: min(1480px, 100%);
  height: min(950px, 95vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #f6f7f8;
  box-shadow: 0 30px 80px rgba(4, 15, 25, 0.45);
}

.trk-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 16px;
  background: linear-gradient(120deg, #0e2c42, #143f5c 55%, #0b2d46);
  color: #fbfbfc;
}

.trk-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.trk-brand-badge {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e4e6e8;
  flex: none;
}

.trk-brand-badge .icon {
  width: 20px;
  height: 20px;
}

.trk-brand-text {
  min-width: 0;
}

.trk-brand-text strong {
  display: block;
  font-size: 15px;
  letter-spacing: -0.2px;
}

.trk-brand-text span {
  display: block;
  font-size: 11px;
  color: #b8cfdc;
  margin-top: 1px;
}

.trk-head-spacer {
  flex: 1;
}

.trk-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #dbddde;
  white-space: nowrap;
}

.trk-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.16);
}

.trk-car-picker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 4px 8px 4px 10px;
  color: #e4e6e6;
  font-size: 11.5px;
}

.trk-car-picker select {
  background: transparent;
  color: #fff;
  border: 0;
  font: inherit;
  font-weight: 700;
  padding: 5px 4px;
  max-width: 240px;
  outline: none;
}

.trk-car-picker select option {
  color: #0f172a;
  background: #fff;
}

.trk-head-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #f7f8f8;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.trk-head-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.trk-head-btn .icon {
  width: 15px;
  height: 15px;
}

.trk-head-btn.is-close {
  background: rgba(140, 47, 57, 0.85);
  border-color: rgba(255, 255, 255, 0.2);
}

.trk-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.12);
  color: #eeefef;
  border: 1px solid rgba(255, 255, 255, 0.18);
  white-space: nowrap;
}

.trk-status-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}

.trk-status-chip.tone-ok::before { background: #4ade80; }
.trk-status-chip.tone-warn::before { background: #d54a5b; }
.trk-status-chip.tone-danger::before { background: #fb7185; }

.trk-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 16px;
  background: #f3f2f2;
  color: #671821;
  border-bottom: 1px solid #eeb8be;
  font-size: 12px;
  line-height: 1.6;
}

.trk-banner[hidden] {
  display: none;
}

.trk-banner .icon {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 2px;
}

.trk-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 396px;
}

.trk-map-wrap {
  position: relative;
  min-height: 0;
  background: #e9ebec;
}

.cc-map {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #e9ebec;
  touch-action: none;
}

.cc-map-canvas {
  display: block;
  cursor: grab;
  touch-action: none;
}

.cc-map-canvas:active {
  cursor: grabbing;
}

.cc-map.is-drawing .cc-map-canvas {
  cursor: crosshair;
}

.cc-map-attrib {
  position: absolute;
  inset-inline-end: 4px;
  bottom: 2px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.72);
  color: #334155;
  font-size: 9px;
  pointer-events: none;
}

.trk-map-tools {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 3;
}

.trk-tool {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 6px 9px;
  border-radius: 9px;
  border: 1px solid #d5d9dc;
  background: rgba(255, 255, 255, 0.95);
  color: #143f5c;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.trk-tool:hover {
  background: #fff;
}

.trk-tool .icon {
  width: 14px;
  height: 14px;
}

.trk-map-note {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  z-index: 3;
  max-width: 240px;
  padding: 7px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #dee1e4;
  color: #475569;
  font-size: 10.5px;
  line-height: 1.55;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.trk-map-note strong {
  color: #143f5c;
}

.trk-map-legend {
  position: absolute;
  bottom: 12px;
  inset-inline-start: 12px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #dee1e4;
  color: #475569;
  font-size: 10px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.trk-map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.trk-map-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #143f5c;
}

.trk-map-legend i.warn { background: #992432; }
.trk-map-legend i.off { background: #64748b; }
.trk-map-legend i.danger { background: #8c2f39; }

.trk-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
  border-inline-start: 1px solid #dee1e4;
}

.trk-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 7px;
  border-bottom: 1px solid #e8eaeb;
  background: #fbfcfc;
  scrollbar-width: thin;
}

.trk-tab {
  position: relative;
  flex: none;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #5b6b7a;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  padding: 7px 9px;
  cursor: pointer;
  white-space: nowrap;
}

.trk-tab:hover {
  background: #eef0f2;
}

.trk-tab.is-active {
  background: #143f5c;
  color: #fff;
}

.trk-tab-badge {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  margin-inline-start: 4px;
  padding: 0 4px;
  border-radius: 999px;
  background: #8c2f39;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.trk-tab.is-active .trk-tab-badge {
  background: #fff;
  color: #8c2f39;
}

.trk-pane {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 13px 14px 30px;
  scrollbar-width: thin;
}

.trk-pane-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.trk-pane-head h3 {
  margin: 0;
  font-size: 14px;
  color: #143f5c;
}

.trk-pane-head p {
  margin: 3px 0 0;
  font-size: 11px;
  color: #64748b;
  line-height: 1.6;
}

.trk-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #dee1e4;
}

.trk-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.trk-section h4 {
  margin: 0 0 8px;
  font-size: 12.5px;
  color: #143f5c;
  display: flex;
  align-items: center;
  gap: 6px;
}

.trk-section h4 .icon {
  width: 15px;
  height: 15px;
}

.trk-muted {
  color: #64748b;
  font-size: 11px;
  line-height: 1.7;
}

.trk-note {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 9px;
  background: #f5f6f7;
  border: 1px solid #e4e6e8;
  color: #475569;
  font-size: 10.8px;
  line-height: 1.7;
}

.trk-note.is-warn {
  background: #f4f3f3;
  border-color: #efb9c0;
  color: #671821;
}

.trk-note.is-danger {
  background: #fdf1f2;
  border-color: #f0d2d6;
  color: #8c2f39;
}

.trk-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 12px;
  text-align: center;
  color: #64748b;
}

.trk-empty .icon {
  width: 30px;
  height: 30px;
  color: #94a3b8;
}

.trk-empty strong {
  color: #143f5c;
  font-size: 13px;
}

.trk-empty p {
  margin: 0;
  font-size: 11px;
  line-height: 1.7;
  max-width: 300px;
}

.trk-status-card {
  border-radius: 13px;
  border: 1px solid #dde0e2;
  background: linear-gradient(145deg, #f8f9fa, #eef0f2);
  padding: 12px;
}

.trk-status-card.is-off {
  background: linear-gradient(145deg, #fafafa, #f2f3f4);
  border-color: #e0e2e3;
}

.trk-status-card.is-danger {
  background: linear-gradient(145deg, #fdf7f7, #fbeff1);
  border-color: #efd5d9;
}

.trk-status-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.trk-status-top strong {
  display: block;
  font-size: 14px;
  color: #143f5c;
}

.trk-status-top small {
  display: block;
  margin-top: 2px;
  font-size: 10.5px;
  color: #64748b;
  direction: ltr;
  text-align: right;
}

.trk-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  background: #e7f5ee;
  color: #0f6848;
  border: 1px solid #cbe8da;
  white-space: nowrap;
}

.trk-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.trk-chip.tone-warn { background: #f8e3e5; color: #7e1e29; border-color: #eeb8be; }
.trk-chip.tone-danger { background: #fdebec; color: #8c2f39; border-color: #f1cdd2; }
.trk-chip.tone-muted { background: #f1f2f2; color: #52616b; border-color: #e2e4e5; }

.trk-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.trk-metric {
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #e5e7e9;
}

.trk-metric span {
  display: block;
  font-size: 9.5px;
  color: #64748b;
}

.trk-metric strong {
  display: block;
  margin-top: 1px;
  font-size: 12px;
  color: #143f5c;
  direction: ltr;
  text-align: right;
}

.trk-metric strong.is-missing {
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  direction: rtl;
  text-align: right;
}

.trk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.trk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 9px;
  border: 1px solid transparent;
  padding: 7px 10px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.trk-btn .icon {
  width: 14px;
  height: 14px;
}

.trk-btn-primary {
  background: #143f5c;
  color: #fff;
}

.trk-btn-primary:hover { background: #0f3149; }

.trk-btn-soft {
  background: #eef0f2;
  color: #143f5c;
  border-color: #d3d7db;
}

.trk-btn-soft:hover { background: #e5e7e9; }

.trk-btn-outline {
  background: #fff;
  color: #143f5c;
  border-color: #cfd4d8;
}

.trk-btn-outline:hover { background: #f7f8f9; }

.trk-btn-danger {
  background: #fdf0f1;
  color: #8c2f39;
  border-color: #f0cdd2;
}

.trk-btn-danger:hover { background: #fbe4e6; }

.trk-btn-dark {
  background: #0a2336;
  color: #fff;
}

.trk-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.trk-btn.is-small {
  padding: 5px 8px;
  font-size: 10.5px;
}

.trk-form {
  display: grid;
  gap: 8px;
}

.trk-form-grid {
  display: grid;
  gap: 8px;
}

.trk-form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.trk-field {
  display: grid;
  gap: 4px;
}

.trk-field > span {
  font-size: 10.5px;
  font-weight: 700;
  color: #4b5b6a;
}

.trk-field input,
.trk-field select,
.trk-field textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid #d5d9dc;
  border-radius: 8px;
  background: #fff;
  color: #1b2a38;
  font: inherit;
  font-size: 12px;
  padding: 8px 9px;
  outline: none;
}

.trk-field input:focus,
.trk-field select:focus,
.trk-field textarea:focus {
  border-color: #8c2f39;
  box-shadow: 0 0 0 3px rgba(140, 47, 57, 0.1);
}

.trk-field textarea {
  resize: vertical;
  min-height: 58px;
}

.trk-check {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  color: #33414e;
}

.trk-check input {
  width: 16px;
  height: 16px;
  accent-color: #143f5c;
}

.trk-token {
  margin-top: 10px;
  border: 1px dashed #dee1e4;
  border-radius: 11px;
  background: #f4f6f8;
  padding: 10px;
}

.trk-token h4 {
  margin: 0 0 5px;
  color: #143f5c;
  font-size: 12px;
}

.trk-token code,
.trk-code {
  display: block;
  overflow-wrap: anywhere;
  padding: 6px 8px;
  border-radius: 6px;
  background: #0a2336;
  color: #f2f4f6;
  font-size: 10px;
  direction: ltr;
  text-align: left;
}

.trk-token .trk-field {
  margin-top: 7px;
}

.trk-events {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.trk-event {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 7px;
  background: #f7f8f9;
  border: 1px solid #e9ebec;
  font-size: 10.5px;
}

.trk-event strong {
  color: #143f5c;
}

.trk-event span {
  color: #64748b;
  white-space: nowrap;
}

.trk-list {
  display: grid;
  gap: 7px;
}

.trk-card {
  border: 1px solid #e4e6e8;
  border-radius: 10px;
  background: #fff;
  padding: 9px 10px;
}

.trk-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.trk-card-head strong {
  font-size: 11.5px;
  color: #143f5c;
}

.trk-card-head small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: #64748b;
}

.trk-card p {
  margin: 6px 0 0;
  font-size: 10.8px;
  color: #475569;
  line-height: 1.6;
}

.trk-card-actions {
  display: flex;
  gap: 5px;
  margin-top: 7px;
  flex-wrap: wrap;
}

.trk-trip {
  border: 1px solid #e4e6e8;
  border-radius: 10px;
  padding: 9px;
  background: #fbfcfc;
}

.trk-trip.is-selected {
  border-color: #8c2f39;
  background: #f7eff0;
  box-shadow: 0 0 0 2px rgba(140, 47, 57, 0.08);
}

.trk-trip-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.trk-trip-head strong {
  font-size: 11.5px;
  color: #143f5c;
}

.trk-trip-head span {
  font-size: 11px;
  font-weight: 800;
  color: #143f5c;
  white-space: nowrap;
}

.trk-trip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.trk-trip-meta span {
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef0f2;
  color: #5b6b7a;
  font-size: 9.5px;
  font-weight: 700;
}

.trk-trip-stops {
  margin: 7px 0 0;
  padding: 7px 8px;
  border-radius: 7px;
  background: #f4f3f3;
  color: #671821;
  font-size: 10px;
  line-height: 1.7;
}

.trk-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.trk-summary div {
  padding: 8px;
  border-radius: 9px;
  background: #f5f6f7;
  border: 1px solid #e4e6e8;
  text-align: center;
}

.trk-summary span {
  display: block;
  font-size: 9.5px;
  color: #64748b;
}

.trk-summary strong {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: #143f5c;
}

.trk-alert {
  display: grid;
  gap: 4px;
  padding: 9px;
  border-radius: 10px;
  border: 1px solid #e8eaeb;
  border-inline-start: 3px solid #94a3b8;
  background: #fff;
}

.trk-alert.is-warning { border-inline-start-color: #b52a3b; background: #fbfbfb; }
.trk-alert.is-critical { border-inline-start-color: #dc2626; background: #fff8f8; }
.trk-alert.is-info { border-inline-start-color: #143f5c; background: #f4f6f8; }

.trk-alert-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.trk-alert-top strong {
  font-size: 11px;
  color: #143f5c;
}

.trk-alert-top time {
  font-size: 9.5px;
  color: #64748b;
  white-space: nowrap;
}

.trk-alert p {
  margin: 0;
  font-size: 10.8px;
  color: #334155;
  line-height: 1.6;
}

.trk-rule {
  border: 1px solid #e6e8e9;
  border-radius: 10px;
  padding: 9px;
  background: #fbfcfb;
}

.trk-rule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.trk-rule-head strong {
  font-size: 11.5px;
  color: #143f5c;
}

.trk-confirm {
  margin-top: 9px;
  border: 1px solid #ebacb3;
  border-radius: 10px;
  background: #f5f4f4;
  padding: 10px;
}

.trk-confirm strong {
  display: block;
  font-size: 12px;
  color: #761c26;
}

.trk-confirm p {
  margin: 4px 0 8px;
  font-size: 10.8px;
  color: #671821;
  line-height: 1.7;
}

.trk-scan {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(6, 15, 22, 0.85);
  color: #fff;
  padding: 20px;
}

.trk-scan video {
  width: min(420px, 88vw);
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  background: #000;
  object-fit: cover;
}

.trk-scan p {
  margin: 0;
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.trk-toast {
  position: fixed;
  bottom: 24px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  z-index: 1300;
  max-width: min(420px, 90vw);
  padding: 10px 14px;
  border-radius: 10px;
  background: #143f5c;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(8, 20, 30, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.trk-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

.trk-toast.is-error {
  background: #8c2f39;
}

.trk-loading {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 0;
}

.trk-loading span {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #eef0f1, #f7f8f9, #eef0f1);
  background-size: 200% 100%;
  animation: trk-shimmer 1.1s linear infinite;
}

.trk-loading span:nth-child(2) { width: 82%; }
.trk-loading span:nth-child(3) { width: 64%; }

@keyframes trk-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.trk-requirements {
  margin: 8px 0 0;
  padding: 0 0 0 16px;
  color: #475569;
  font-size: 10.8px;
  line-height: 1.8;
}

.trk-requirements li::marker {
  color: #143f5c;
}

/* ---------- إضافة جهاز: QR أو إدخال يدوي ---------- */

.trk-add-entry {
  display: grid;
  gap: 8px;
}

.trk-add-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 8px;
}

.trk-add-option {
  display: grid;
  justify-items: start;
  gap: 4px;
  padding: 12px 11px;
  border: 1px solid #d7dbde;
  border-radius: 11px;
  background: linear-gradient(150deg, #f8f9fa, #eeeef1);
  color: #143f5c;
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.trk-add-option:hover,
.trk-add-option:focus-visible {
  border-color: #8c2f39;
  box-shadow: 0 6px 16px rgba(20, 63, 92, 0.1);
  transform: translateY(-1px);
  outline: none;
}

.trk-add-option strong {
  font-size: 13px;
}

.trk-add-option small {
  color: #5b6b7a;
  font-size: 10.8px;
  line-height: 1.7;
}

.trk-add-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 2px;
  border-radius: 10px;
  background: #143f5c;
  color: #f2f4f6;
}

.trk-add-icon .icon {
  width: 17px;
  height: 17px;
}

.trk-add-panel {
  display: grid;
  gap: 10px;
}

.trk-qr-guide {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px;
  border: 1px solid #dde0e2;
  border-radius: 11px;
  background: #f8f9fa;
}

.trk-qr-frame {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 2px dashed #c8ced4;
  background: #fff;
  color: #143f5c;
}

.trk-qr-frame .icon {
  width: 24px;
  height: 24px;
}

.trk-qr-guide strong {
  display: block;
  font-size: 12px;
  color: #143f5c;
}

.trk-qr-guide ol {
  margin: 5px 0 0;
  padding: 0 16px 0 0;
  color: #5b6b7a;
  font-size: 10.8px;
  line-height: 1.8;
}

.trk-qr-guide .trk-muted {
  margin: 5px 0 0;
}

.trk-add-source {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border-radius: 9px;
  background: #f2f4f5;
  border: 1px solid #e2e4e6;
}

.trk-add-source small {
  font-size: 9.5px;
  color: #52616b;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.trk-add-error,
.trk-form-error {
  padding: 9px 10px;
  border-radius: 9px;
  border: 1px solid #efc9ce;
  border-inline-start: 3px solid #b23a48;
  background: #fdf1f2;
  color: #8c2f39;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.7;
}

.trk-provider-hint {
  margin: -2px 0 0;
  color: #52616b;
  font-size: 10.5px;
  line-height: 1.7;
}

.trk-creds {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px dashed #d0d4d7;
  border-radius: 10px;
  background: #f9fafa;
}

.trk-creds .trk-note {
  margin: 0;
}

.trk-add-test {
  display: grid;
  gap: 6px;
}

.trk-test-result {
  padding: 9px 10px;
  border-radius: 9px;
  border: 1px solid #dce0e2;
  background: #f5f6f7;
  color: #334155;
}

.trk-test-result strong {
  display: block;
  font-size: 11.5px;
  color: #143f5c;
}

.trk-test-result p {
  margin: 3px 0 0;
  font-size: 10.8px;
  line-height: 1.7;
}

.trk-test-result small {
  display: block;
  margin-top: 4px;
  font-size: 9.5px;
  color: #64748b;
  direction: ltr;
  text-align: right;
}

.trk-test-result.is-ok {
  background: #eefaf3;
  border-color: #c5e8d5;
  border-inline-start: 3px solid #14805a;
}

.trk-test-result.is-ok strong { color: #0f6848; }

.trk-test-result.is-warn {
  background: #f4f3f3;
  border-color: #efb9c0;
  border-inline-start: 3px solid #c92f41;
}

.trk-test-result.is-warn strong { color: #761c26; }

.trk-test-result.is-danger {
  background: #fdf1f2;
  border-color: #f0d2d6;
  border-inline-start: 3px solid #b23a48;
}

.trk-test-result.is-danger strong { color: #8c2f39; }

/* ---------- حالة التفعيل وقائمة أجهزة الأسطول ---------- */

.trk-activation {
  margin-top: 10px;
  padding: 10px;
  border-radius: 11px;
  border: 1px solid #e2e4e6;
  border-inline-start: 4px solid #9aa8b0;
  background: #f9fafa;
}

.trk-activation.is-confirmed {
  border-inline-start-color: #14805a;
  background: #f2fbf6;
}

.trk-activation.is-pending {
  border-inline-start-color: #c92f41;
  background: #f8f7f7;
}

.trk-activation.is-failed {
  border-inline-start-color: #b23a48;
  background: #fdf4f5;
}

.trk-activation-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.trk-activation-top small {
  font-size: 9.5px;
  color: #64748b;
}

.trk-activation p {
  margin: 6px 0 0;
  font-size: 10.8px;
  line-height: 1.7;
  color: #475569;
}

.trk-activation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 7px;
  font-size: 10px;
  color: #52616b;
}

.trk-activation-meta strong {
  color: #143f5c;
  font-weight: 800;
}

.trk-fleet {
  display: grid;
  gap: 6px;
}

.trk-fleet-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 10px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid #e3e5e7;
  border-radius: 9px;
  background: #fff;
  font: inherit;
  text-align: start;
  color: inherit;
  cursor: pointer;
}

.trk-fleet-row:hover {
  border-color: #dee1e4;
  background: #f8f9fa;
}

.trk-fleet-row.is-active {
  border-color: #8c2f39;
  background: #f7eff0;
}

.trk-fleet-main {
  min-width: 0;
}

.trk-fleet-main strong {
  display: block;
  font-size: 11.5px;
  color: #143f5c;
}

.trk-fleet-main small {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: #64748b;
  overflow-wrap: anywhere;
}

.trk-fleet-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.trk-fleet-time {
  grid-column: 1 / -1;
  font-size: 9.5px;
  color: #64748b;
}

@media (max-width: 560px) {
  .trk-fleet-row {
    grid-template-columns: 1fr;
  }

  .trk-fleet-badges {
    justify-content: flex-start;
  }

  .trk-qr-guide {
    flex-direction: column;
  }

  .trk-add-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .track-overlay {
    padding: 0;
  }

  .trk-shell {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    border: 0;
  }

  .trk-head {
    gap: 8px;
    padding: 9px 11px;
  }

  .trk-brand-text span {
    display: none;
  }

  .trk-live {
    display: none;
  }

  .trk-car-picker {
    order: 5;
    width: 100%;
    justify-content: space-between;
  }

  .trk-car-picker select {
    flex: 1;
    max-width: none;
  }

  .trk-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(150px, 25vh) minmax(0, 1fr);
  }

  .trk-panel {
    border-inline-start: 0;
    border-top: 1px solid #dee1e4;
  }

  .trk-pane {
    padding-bottom: 40px;
  }

  .trk-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .trk-status-chip {
    display: none;
  }

  .trk-map-note {
    display: none;
  }
}

@media (max-width: 560px) {
  .trk-map-legend {
    display: none;
  }

  .trk-head-btn span {
    display: none;
  }

  .trk-head-btn {
    padding: 8px 9px;
  }

  .trk-head-btn .icon {
    width: 16px;
    height: 16px;
  }

  .trk-form-grid.two {
    grid-template-columns: 1fr;
  }

  .trk-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .trk-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trk-tabs {
    padding: 6px 7px;
  }
}
