/* ── Vehicle Management Page ──────────────────────────────── */

/* Page header */
.vm-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding: 20px 24px;
  background: var(--clr-white, #fff);
  border: 1px solid rgba(205, 205, 205, 0.45);
  border-radius: var(--radius-lg, 14px);
  box-shadow: var(--shadow-card, 0 2px 8px rgba(0,0,0,0.06));
  position: relative;
  overflow: hidden;
}

.vm-page-header::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--grad-navy, #25315b);
  border-radius: 4px 0 0 4px;
}

[dir="rtl"] .vm-page-header::before {
  left: auto;
  right: 0;
  border-radius: 0 4px 4px 0;
}

.vm-page-header__title {
  font-size: 22px;
  font-weight: 800;
  color: var(--clr-navy-text, #25315b);
  margin: 0;
}

.vm-page-header__sub {
  font-size: 12.5px;
  color: var(--clr-text-muted, #6b7280);
  margin: 2px 0 0;
  font-weight: 500;
}

.vm-btn-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--clr-blue, #2563eb);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.vm-btn-add:hover {
  background: var(--clr-blue-dark, #1d4ed8);
  color: #fff;
}

/* ── Filter card ───────────────────────────────────────────── */
.vm-filter-card {
  background: var(--clr-white, #fff);
  border: 1px solid rgba(205, 205, 205, 0.5);
  border-radius: var(--radius-lg, 14px);
  box-shadow: 0 2px 8px rgba(37, 49, 91, 0.06);
  margin-bottom: 20px;
}

.vm-filter-card__header {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(205, 205, 205, 0.4);
  display: flex;
  align-items: center;
  gap: 8px;
}

.vm-filter-card__title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--clr-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
}

.vm-filter-card__title svg {
  opacity: 0.6;
}

.vm-filter-card__body {
  padding: 16px 20px;
  background: var(--clr-bg-card-alt, #f8f9fb);
}

.vm-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

@media (min-width: 640px) {
  .vm-filter-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .vm-filter-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.vm-filter-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.vm-filter-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--clr-text-label, #374151);
  margin: 0;
}

.vm-filter-input,
.vm-filter-select {
  width: 100%;
  padding: 9px 13px;
  border: 1.5px solid var(--clr-border-mid, #d1d5db);
  border-radius: var(--radius-sm, 8px);
  font-size: 0.875rem;
  color: var(--clr-text-base, #374151);
  background: var(--clr-white, #fff);
  outline: none;
  line-height: 1.4;
  transition: border-color var(--trans-fast, 0.15s), box-shadow var(--trans-fast, 0.15s);
}

.vm-filter-input:focus,
.vm-filter-select:focus {
  border-color: var(--clr-blue, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 156, 0.1);
}

.vm-filter-input::placeholder {
  color: var(--clr-text-placeholder, #9ca3af);
}

.vm-filter-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2325639c'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
  cursor: pointer;
}

.vm-range-inputs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.vm-range-inputs .vm-filter-input {
  flex: 1;
  min-width: 0;
}

.vm-range-sep {
  font-size: 0.8rem;
  color: var(--clr-text-muted, #6b7280);
  flex-shrink: 0;
}

.vm-filter-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.vm-btn-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  background: var(--grad-navy, #25315b);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: opacity 0.15s;
}

.vm-btn-search:hover {
  opacity: 0.88;
}

.vm-btn-clear {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--clr-white, #fff);
  color: var(--clr-text, #374151);
  border: 1px solid rgba(205, 205, 205, 0.7);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.vm-btn-clear:hover {
  border-color: var(--clr-blue, #2563eb);
  color: var(--clr-blue, #2563eb);
}

/* ── Section grouping ──────────────────────────────────────── */
.vm-section {
  margin-bottom: 28px;
}

.vm-section__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--clr-border, #e5e7eb);
}

.vm-section__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.vm-section__dot--active   { background: #16a34a; }
.vm-section__dot--inactive { background: #dc2626; }

.vm-section__title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--clr-text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Vehicle grid ──────────────────────────────────────────── */
.vm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

/* ── Vehicle card ──────────────────────────────────────────── */
.vm-card {
  background: #fff;
  border: 1px solid var(--clr-border, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s;
}

.vm-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
}

.vm-card__img-wrap {
  position: relative;
  height: 130px;
  overflow: hidden;
  background: #f3f4f6;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vm-card__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.vm-card__img-wrap--grey {
  background: #e5e7eb;
}

.vm-card__img-wrap--grey .vm-card__img {
  opacity: 0.45;
  filter: grayscale(1);
}

.vm-card__badge {
  position: absolute;
  top: 7px;
  left: 7px;
  border-radius: 20px;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.vm-card__badge--active {
  background: #dcfce7;
  color: #16a34a;
}

.vm-card__badge--inactive {
  background: #fee2e2;
  color: #dc2626;
}

.vm-card__badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.vm-card__body {
  padding: 10px 12px;
  flex: 1;
}

.vm-card__title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--clr-text-dark, #111827);
  margin-bottom: 2px;
}

.vm-card__id {
  font-size: 0.7rem;
  color: var(--clr-text-muted, #6b7280);
  margin-bottom: 8px;
}

.vm-card__specs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.vm-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.68rem;
  background: var(--clr-bg-light, #f3f4f6);
  color: var(--clr-text, #374151);
}

.vm-chip svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.vm-card__price {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--clr-blue, #2563eb);
}

/* ── Card footer / actions ─────────────────────────────────── */
.vm-card__footer {
  border-top: 1px solid var(--clr-border, #e5e7eb);
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.vm-card__footer-label {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--clr-text-muted, #6b7280);
}

/* Icon-only circular action buttons */
.vm-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, opacity 0.15s;
  flex-shrink: 0;
}

.vm-icon-btn:hover {
  transform: translateY(-1px);
  opacity: 0.85;
}

.vm-icon-btn--edit {
  background: var(--clr-blue-light, #eff6ff);
  color: var(--clr-blue, #2563eb);
}

.vm-icon-btn--activate {
  background: #dcfce7;
  color: #16a34a;
}

.vm-icon-btn--deactivate {
  background: #fef9c3;
  color: #a16207;
}

.vm-icon-btn--delete {
  background: #fee2e2;
  color: #dc2626;
}

/* ── Empty state ───────────────────────────────────────────── */
.vm-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--clr-text-muted, #6b7280);
}

.vm-empty img {
  width: 80px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.vm-empty p {
  font-size: 0.95rem;
}

/* ── RTL ───────────────────────────────────────────────────── */
[dir="rtl"] .vm-card__badge {
  left: auto;
  right: 10px;
}

[dir="rtl"] .vm-filter-select {
  background-position: left 12px center;
  padding-right: 13px;
  padding-left: 30px;
}

[dir="rtl"] .vm-filter-actions {
  justify-content: flex-start;
}

[dir="rtl"] .vm-card__footer-label {
  margin-left: 0;
  margin-right: auto;
}
