/* ── 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;
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 0.68rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.4;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

.vm-card__badge--active {
  top: 8px;
  left: 8px;
  background: rgba(220, 252, 231, 0.92);
  color: #16a34a;
}

.vm-card__badge--inactive {
  top: 8px;
  left: 8px;
  background: rgba(254, 226, 226, 0.92);
  color: #dc2626;
}

.vm-card__badge--price {
  bottom: 8px;
  left: 8px;
  background: var(--clr-blue);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.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;
}

/* ── Unavailability page ───────────────────────────────────── */
.uav-pick-card {
  transition: box-shadow 0.15s, border-color 0.15s;
}

.uav-pick-card--selected {
  border: 2px solid #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.uav-pick-card__check {
  position: absolute;
  bottom: 7px;
  right: 7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.uav-records {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.uav-record {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  transition: box-shadow 0.15s, border-color 0.15s;
}

.uav-record:hover {
  border-color: #bfdbfe;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.09);
}

.uav-record__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
}

.uav-record__date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e3a5f;
  letter-spacing: 0.2px;
}

.uav-record__date svg {
  color: #2563eb;
  flex-shrink: 0;
}

.uav-record__status {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

.uav-record__status--full {
  background: #fee2e2;
  color: #dc2626;
}

.uav-record__status--partial {
  background: #dbeafe;
  color: #2563eb;
}

.uav-record__body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.uav-record__times {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.uav-record__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  border-top: 1px solid #f1f5f9;
}

.uav-record__message {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  color: #64748b;
  font-style: italic;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 180px;
}

.uav-record__del {
  margin-left: auto;
  flex-shrink: 0;
}

/* ── UAV records card: tighten internal padding ────────────── */
.uav-records-card{
  margin-top: 16px;
}
.uav-records-card > .ev-card__body {
  padding: 12px 16px 16px;
}

/* ── UAV time slot rows ────────────────────────────────────── */
.uav-timeslots__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.uav-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.uav-slot:focus-within {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.07);
}

.uav-slot__index {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.1);
  color: var(--clr-blue, #2563eb);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.uav-slot__field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.uav-slot__label {
  font-size: 10.5px;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.uav-slot__input {
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: #1e3a5f;
  padding: 0;
  outline: none;
  width: 100%;
  cursor: pointer;
}

.uav-slot__arrow {
  color: #cbd5e1;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.uav-slot__btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
}

.uav-slot__btn--spacer {
  background: transparent;
  pointer-events: none;
}

.uav-slot__btn--remove {
  background: #fee2e2;
  color: #dc2626;
}

.uav-slot__btn--remove:hover {
  background: #fecaca;
  transform: scale(1.1);
}

.uav-timeslots__add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill, 999px);
  border: 1.5px dashed rgba(37, 99, 235, 0.4);
  background: transparent;
  color: var(--clr-blue, #2563eb);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.uav-timeslots__add:hover {
  background: rgba(37, 99, 235, 0.06);
  border-color: var(--clr-blue, #2563eb);
}

/* ── UAV section dividers (upcoming / previous) ────────────── */
.uav-section__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid #e5e7eb;
}

.uav-section__label--future {
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.2);
}

.uav-section__label--past {
  color: #64748b;
  border-color: #e5e7eb;
}

.uav-section__count {
  margin-left: 4px;
  background: currentColor;
  color: #fff;
  font-size: 10px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 99px;
  opacity: 0.85;
}

.uav-section--separated {
  margin-top: 24px;
}

/* ── fix footer message overflow ───────────────────────────── */
.uav-record__message {
  flex: 1;
  min-width: 0;
  max-width: unset;
}

/* ── UAV future date record ────────────────────────────────── */
.uav-record--future {
  border-color: rgba(37, 99, 235, 0.35);
  background: linear-gradient(135deg, #f0f7ff 0%, #fff 100%);
}

.uav-record--future .uav-record__head {
  background: linear-gradient(90deg, #e8f0fe 0%, #f0f7ff 100%);
}

.uav-record--future .uav-record__date {
  color: var(--clr-blue, #2563eb);
}

.uav-record--future .uav-record__date svg {
  color: var(--clr-blue, #2563eb);
}

/* ── UAV date picker tag trigger ───────────────────────────── */
.uav-date-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 7px 12px 7px 10px;
  border: 1.5px solid var(--clr-border-light, #e2e8f0);
  border-radius: var(--radius-md, 8px);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s;
  width: 100%;
}

.uav-date-tags:hover {
  border-color: var(--clr-blue, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.uav-date-tags__icon {
  display: flex;
  align-items: center;
  color: var(--clr-blue, #2563eb);
  flex-shrink: 0;
}

.uav-date-tags__placeholder {
  font-size: 13.5px;
  color: #a0aec0;
}

.uav-date-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--clr-blue, #2563eb);
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: var(--radius-pill, 999px);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── UAV time slots section (inside the same card) ─────────── */
.uav-timeslots {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1.5px dashed var(--clr-border-light, #e2e8f0);
}

.uav-timeslots__label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--clr-blue, #2563eb);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

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

[dir="rtl"] .vm-card__badge--price {
  left: auto;
  right: 8px;
}

[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;
}
